" : makeWiki(newItem2)}`;
+ function select_change_handler() {
+ rel = select_value(this);
+ $$invalidate(0, rel);
+ }
+ function input_binding($$value) {
+ binding_callbacks[$$value ? "unshift" : "push"](() => {
+ inputEl = $$value;
+ $$invalidate(4, inputEl);
+ });
+ }
+ function input_input_handler() {
+ newItem = this.value;
+ $$invalidate(5, newItem);
+ }
+ const click_handler = async (e) => {
+ if (rel === "up" && hnItem.depth === 0) {
+ new import_obsidian11.Notice("Can't add parent to top level item, choose another direction");
+ return;
+ } else {
+ try {
+ const content = await app.vault.read(file);
+ const lines = content.split("\n");
+ const lineNo = rel === "up" ? hnItem.lineNo : hnItem.lineNo + 1;
+ const depth = rel === "up" ? hnItem.depth - 4 : rel === "down" ? hnItem.depth + 4 : hnItem.depth;
+ lines.splice(lineNo, 0, buildNewItem(newItem, depth));
+ await app.vault.modify(file, lines.join("\n"));
+ modal.close();
+ } catch (err) {
+ (0, import_console.error)(err);
+ new import_obsidian11.Notice("An error occured, please check the console");
+ }
+ }
+ };
+ $$self.$$set = ($$props2) => {
+ if ("modal" in $$props2)
+ $$invalidate(1, modal = $$props2.modal);
+ if ("settings" in $$props2)
+ $$invalidate(7, settings = $$props2.settings);
+ if ("hnItem" in $$props2)
+ $$invalidate(2, hnItem = $$props2.hnItem);
+ if ("file" in $$props2)
+ $$invalidate(3, file = $$props2.file);
+ if ("rel" in $$props2)
+ $$invalidate(0, rel = $$props2.rel);
+ };
+ return [
+ rel,
+ modal,
+ hnItem,
+ file,
+ inputEl,
+ newItem,
+ buildNewItem,
+ settings,
+ select_change_handler,
+ input_binding,
+ input_input_handler,
+ click_handler
+ ];
+}
+var ModifyHNItemComp = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(
+ this,
+ options,
+ instance8,
+ create_fragment8,
+ safe_not_equal,
+ {
+ modal: 1,
+ settings: 7,
+ hnItem: 2,
+ file: 3,
+ rel: 0
+ },
+ add_css6
+ );
+ }
+};
+var ModifyHNItemComp_default = ModifyHNItemComp;
+
+// src/AlternativeHierarchies/HierarchyNotes/ModifyHierItemModal.ts
+var ModifyHierItemModal = class extends import_obsidian12.Modal {
+ constructor(plugin, hnItem, file, rel) {
+ super(app);
+ this.plugin = plugin;
+ this.modal = this;
+ this.hnItem = hnItem;
+ this.file = file;
+ this.rel = rel;
+ }
+ onOpen() {
+ const { contentEl } = this;
+ contentEl.empty();
+ this.mount = new ModifyHNItemComp_default({
+ target: contentEl,
+ props: {
+ modal: this,
+ settings: this.plugin.settings,
+ hnItem: this.hnItem,
+ file: this.file,
+ rel: this.rel
+ }
+ });
+ }
+ onClose() {
+ this.mount.$destroy();
+ this.contentEl.empty();
+ }
+};
+
+// src/AlternativeHierarchies/HierarchyNotes/HierarchyNoteManipulator.ts
+var HierarchyNoteManipulator = class extends import_obsidian13.FuzzySuggestModal {
+ constructor(plugin, hierNoteName) {
+ super(app);
+ this.plugin = plugin;
+ this.settings = this.plugin.settings;
+ this.hierNoteName = hierNoteName;
+ const chooseOverride = (evt) => {
+ this.chooser.useSelectedItem(evt);
+ return false;
+ };
+ this.scope.register([], "Delete", chooseOverride);
+ this.scope.register(["Shift"], "ArrowUp", chooseOverride);
+ this.scope.register(["Shift"], "ArrowRight", chooseOverride);
+ this.scope.register(["Shift"], "ArrowDown", chooseOverride);
+ }
+ async onOpen() {
+ this.setPlaceholder("HN Manipulator");
+ this.setInstructions([
+ { command: "Shift + Enter", purpose: "Jump to item" },
+ { command: "Shift + \u2191", purpose: "Add parent" },
+ { command: "Shift + \u2192", purpose: "Add sibling" },
+ { command: "Shift + \u2193 / Enter / Click", purpose: "Add child" },
+ { command: "Delete", purpose: "Delete item" }
+ ]);
+ this.file = app.metadataCache.getFirstLinkpathDest(this.hierNoteName, "");
+ if (!this.file)
+ this.lines = [];
+ console.log(this);
+ const content = await app.vault.cachedRead(this.file);
+ this.lines = content.split("\n");
+ this.listItems = app.metadataCache.getFileCache(this.file).listItems;
+ console.log(this);
+ super.onOpen();
+ }
+ getItems() {
+ const items = this.listItems.map((item) => {
+ const i = item.position.start.line;
+ return { i, line: this.lines[i] };
+ }).map((item) => {
+ const splits = item.line.split("- ");
+ const depth = splits[0].length;
+ const line = splits.slice(1).join("- ");
+ return { depth, line, lineNo: item.i };
+ });
+ (0, import_loglevel15.info)(items);
+ return items;
+ }
+ getItemText(item) {
+ return `${" ".repeat(item.depth)}- ${dropWikilinks(item.line)}`;
+ }
+ renderSuggestion(item, el) {
+ super.renderSuggestion(item, el);
+ el.innerText = `${" ".repeat(item.item.depth)}- ${dropWikilinks(
+ item.item.line
+ )}`;
+ }
+ async deleteItem(item) {
+ try {
+ this.lines.splice(item.lineNo, 1);
+ this.listItems.splice(item.lineNo, 1);
+ await app.vault.modify(this.file, this.lines.join("\n"));
+ new import_obsidian13.Notice("Item deleted Succesfully");
+ } catch (err) {
+ (0, import_loglevel15.error)(err);
+ new import_obsidian13.Notice("An error occured. Please check the console");
+ }
+ }
+ onChooseItem(item, evt) {
+ if (evt instanceof KeyboardEvent && evt.key === "Delete") {
+ this.deleteItem(item);
+ } else if (evt instanceof KeyboardEvent && evt.key == "Enter" && evt.shiftKey) {
+ const view = app.workspace.getActiveViewOfType(import_obsidian13.MarkdownView);
+ const { editor } = view != null ? view : {};
+ if (!editor)
+ return;
+ view.leaf.openFile(this.file, { active: true, mode: "source" });
+ editor.setCursor({ line: item.lineNo, ch: item.depth + 2 });
+ } else if (evt instanceof KeyboardEvent || evt instanceof MouseEvent) {
+ let rel;
+ if (evt instanceof MouseEvent && evt.type == "click")
+ rel = "down";
+ if (evt instanceof KeyboardEvent) {
+ if (evt.key === "Enter")
+ rel = "down";
+ }
+ if (evt instanceof KeyboardEvent && evt.shiftKey) {
+ if (evt.key === "ArrowUp")
+ rel = "up";
+ if (evt.key === "ArrowDown")
+ rel = "down";
+ if (evt.key === "ArrowRight")
+ rel = "same";
+ }
+ new ModifyHierItemModal(
+ this.plugin,
+ item,
+ this.file,
+ rel
+ ).open();
+ this.close();
+ }
+ }
+};
+
+// src/AlternativeHierarchies/HierarchyNotes/HierNoteModal.ts
+var HierarchyNoteSelectorModal = class extends import_obsidian14.FuzzySuggestModal {
+ constructor(plugin) {
+ super(app);
+ this.plugin = plugin;
+ this.settings = this.plugin.settings;
+ }
+ onOpen() {
+ this.setPlaceholder("HN Chooser");
+ const { hierarchyNotes } = this.settings;
+ if (hierarchyNotes.length === 0) {
+ this.close();
+ new import_obsidian14.Notice("No hierarchy notes found");
+ } else if (hierarchyNotes.length === 1 && !hierarchyNotes[0].endsWith("/")) {
+ this.close();
+ new HierarchyNoteManipulator(
+ this.plugin,
+ hierarchyNotes[0]
+ ).open();
+ } else {
+ super.onOpen();
+ }
+ }
+ getItems() {
+ const { hierarchyNotes } = this.settings;
+ if (hierarchyNotes.length == 1 && hierarchyNotes[0].endsWith("/")) {
+ let folder = hierarchyNotes[0].slice(0, -1);
+ if (app.plugins.plugins.dataview != void 0) {
+ let pages = app.plugins.plugins.dataview.api.pages(
+ `"${folder}"`
+ );
+ return pages.values.map((page) => page.file.path);
+ } else {
+ new import_obsidian14.Notice("make sure you have dataview enabled");
+ }
+ } else
+ return hierarchyNotes;
+ }
+ getItemText(item) {
+ return `${item}`;
+ }
+ renderSuggestion(item, el) {
+ super.renderSuggestion(item, el);
+ }
+ onChooseItem(item, evt) {
+ new HierarchyNoteManipulator(this.plugin, item).open();
+ this.close();
+ }
+};
+
+// src/Codeblocks.ts
+var import_loglevel16 = __toESM(require_loglevel());
+var import_obsidian16 = require("obsidian");
+
+// src/Components/RenderMarkdown.svelte
+var import_obsidian15 = require("obsidian");
+function add_css7(target) {
+ append_styles(target, "svelte-7e9i10", "div.BC-note-content.svelte-7e9i10{padding-left:20px}");
+}
+function create_fragment9(ctx) {
+ let div;
+ return {
+ c() {
+ div = element("div");
+ attr(div, "class", "BC-note-content svelte-7e9i10");
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ ctx[2](div);
+ },
+ p: noop,
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ ctx[2](null);
+ }
+ };
+}
+function instance9($$self, $$props, $$invalidate) {
+ var __awaiter = this && this.__awaiter || function(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());
+ });
+ };
+ let { path: path2 } = $$props;
+ function getContent(note) {
+ return __awaiter(this, void 0, void 0, function* () {
+ const file = app.metadataCache.getFirstLinkpathDest(note, "");
+ return yield app.vault.cachedRead(file);
+ });
+ }
+ let el;
+ onMount(() => __awaiter(void 0, void 0, void 0, function* () {
+ import_obsidian15.MarkdownRenderer.renderMarkdown(yield getContent(path2), el, path2, null);
+ }));
+ function div_binding($$value) {
+ binding_callbacks[$$value ? "unshift" : "push"](() => {
+ el = $$value;
+ $$invalidate(0, el);
+ });
+ }
+ $$self.$$set = ($$props2) => {
+ if ("path" in $$props2)
+ $$invalidate(1, path2 = $$props2.path);
+ };
+ return [el, path2, div_binding];
+}
+var RenderMarkdown = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance9, create_fragment9, safe_not_equal, { path: 1 }, add_css7);
+ }
+};
+var RenderMarkdown_default = RenderMarkdown;
+
+// src/Components/CBTree.svelte
+function add_css8(target) {
+ append_styles(target, "svelte-1df5nr5", ".BC-tree.svelte-1df5nr5{padding-left:5px}pre.indent.svelte-1df5nr5{display:inline;background-color:transparent;position:top}details.svelte-1df5nr5{display:inline-block}.is-unresolved.svelte-1df5nr5{color:var(--text-muted)}");
+}
+function get_each_context5(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[17] = list[i][0];
+ child_ctx[18] = list[i][1];
+ return child_ctx;
+}
+function create_if_block_24(ctx) {
+ let h3;
+ let t0;
+ let t1;
+ let t2;
+ return {
+ c() {
+ h3 = element("h3");
+ t0 = text(
+ /*dir*/
+ ctx[8]
+ );
+ t1 = text(" of ");
+ t2 = text(
+ /*basename*/
+ ctx[4]
+ );
+ },
+ m(target, anchor) {
+ insert(target, h3, anchor);
+ append(h3, t0);
+ append(h3, t1);
+ append(h3, t2);
+ },
+ p(ctx2, dirty) {
+ if (dirty & /*basename*/
+ 16)
+ set_data(
+ t2,
+ /*basename*/
+ ctx2[4]
+ );
+ },
+ d(detaching) {
+ if (detaching)
+ detach(h3);
+ }
+ };
+}
+function create_if_block6(ctx) {
+ let current_block_type_index;
+ let if_block;
+ let if_block_anchor;
+ let current;
+ const if_block_creators = [create_if_block_14, create_else_block3];
+ const if_blocks = [];
+ function select_block_type(ctx2, dirty) {
+ if (
+ /*content*/
+ ctx2[7] === "open" || /*content*/
+ ctx2[7] === "closed"
+ )
+ return 0;
+ return 1;
+ }
+ current_block_type_index = select_block_type(ctx, -1);
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
+ return {
+ c() {
+ if_block.c();
+ if_block_anchor = empty();
+ },
+ m(target, anchor) {
+ if_blocks[current_block_type_index].m(target, anchor);
+ insert(target, if_block_anchor, anchor);
+ current = true;
+ },
+ p(ctx2, dirty) {
+ if_block.p(ctx2, dirty);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(if_block);
+ current = true;
+ },
+ o(local) {
+ transition_out(if_block);
+ current = false;
+ },
+ d(detaching) {
+ if_blocks[current_block_type_index].d(detaching);
+ if (detaching)
+ detach(if_block_anchor);
+ }
+ };
+}
+function create_else_block3(ctx) {
+ let div;
+ let pre;
+ let t0_value = (
+ /*indent*/
+ ctx[17] + "-"
+ );
+ let t0;
+ let t1;
+ let span;
+ let a2;
+ let t2_value = dropDendron(
+ /*link*/
+ ctx[18],
+ /*settings*/
+ ctx[5]
+ ) + "";
+ let t2;
+ let a_class_value;
+ let t3;
+ let mounted;
+ let dispose;
+ function click_handler_1(...args) {
+ return (
+ /*click_handler_1*/
+ ctx[15](
+ /*link*/
+ ctx[18],
+ ...args
+ )
+ );
+ }
+ function mouseover_handler_1(...args) {
+ return (
+ /*mouseover_handler_1*/
+ ctx[16](
+ /*link*/
+ ctx[18],
+ ...args
+ )
+ );
+ }
+ return {
+ c() {
+ div = element("div");
+ pre = element("pre");
+ t0 = text(t0_value);
+ t1 = space();
+ span = element("span");
+ a2 = element("a");
+ t2 = text(t2_value);
+ t3 = space();
+ attr(pre, "class", "indent svelte-1df5nr5");
+ attr(a2, "class", a_class_value = "internal-link " + (isInVault(
+ /*link*/
+ ctx[18]
+ ) ? "" : "is-unresolved") + " svelte-1df5nr5");
+ attr(span, "class", "internal-link");
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ append(div, pre);
+ append(pre, t0);
+ append(div, t1);
+ append(div, span);
+ append(span, a2);
+ append(a2, t2);
+ append(div, t3);
+ if (!mounted) {
+ dispose = [
+ listen(span, "click", click_handler_1),
+ listen(span, "mouseover", mouseover_handler_1)
+ ];
+ mounted = true;
+ }
+ },
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
+ if (dirty & /*lines*/
+ 1 && t0_value !== (t0_value = /*indent*/
+ ctx[17] + "-"))
+ set_data(t0, t0_value);
+ if (dirty & /*lines*/
+ 1 && t2_value !== (t2_value = dropDendron(
+ /*link*/
+ ctx[18],
+ /*settings*/
+ ctx[5]
+ ) + ""))
+ set_data(t2, t2_value);
+ if (dirty & /*lines*/
+ 1 && a_class_value !== (a_class_value = "internal-link " + (isInVault(
+ /*link*/
+ ctx[18]
+ ) ? "" : "is-unresolved") + " svelte-1df5nr5")) {
+ attr(a2, "class", a_class_value);
+ }
+ },
+ i: noop,
+ o: noop,
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function create_if_block_14(ctx) {
+ let div;
+ let pre;
+ let t0_value = (
+ /*indent*/
+ ctx[17] + ""
+ );
+ let t0;
+ let t1;
+ let details2;
+ let summary;
+ let span;
+ let a2;
+ let t2_value = dropDendron(
+ /*link*/
+ ctx[18],
+ /*settings*/
+ ctx[5]
+ ) + "";
+ let t2;
+ let a_class_value;
+ let t3;
+ let rendermarkdown;
+ let details_open_value;
+ let t4;
+ let current;
+ let mounted;
+ let dispose;
+ function click_handler(...args) {
+ return (
+ /*click_handler*/
+ ctx[13](
+ /*link*/
+ ctx[18],
+ ...args
+ )
+ );
+ }
+ function mouseover_handler(...args) {
+ return (
+ /*mouseover_handler*/
+ ctx[14](
+ /*link*/
+ ctx[18],
+ ...args
+ )
+ );
+ }
+ rendermarkdown = new RenderMarkdown_default({ props: { path: (
+ /*link*/
+ ctx[18]
+ ) } });
+ return {
+ c() {
+ div = element("div");
+ pre = element("pre");
+ t0 = text(t0_value);
+ t1 = space();
+ details2 = element("details");
+ summary = element("summary");
+ span = element("span");
+ a2 = element("a");
+ t2 = text(t2_value);
+ t3 = space();
+ create_component(rendermarkdown.$$.fragment);
+ t4 = space();
+ attr(pre, "class", "indent svelte-1df5nr5");
+ attr(a2, "class", a_class_value = "internal-link " + (isInVault(
+ /*link*/
+ ctx[18]
+ ) ? "" : "is-unresolved") + " svelte-1df5nr5");
+ attr(span, "class", "internal-link");
+ details2.open = details_open_value = /*content*/
+ ctx[7] === "open";
+ attr(details2, "class", "svelte-1df5nr5");
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ append(div, pre);
+ append(pre, t0);
+ append(div, t1);
+ append(div, details2);
+ append(details2, summary);
+ append(summary, span);
+ append(span, a2);
+ append(a2, t2);
+ append(details2, t3);
+ mount_component(rendermarkdown, details2, null);
+ append(div, t4);
+ current = true;
+ if (!mounted) {
+ dispose = [
+ listen(span, "click", click_handler),
+ listen(span, "mouseover", mouseover_handler)
+ ];
+ mounted = true;
+ }
+ },
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
+ if ((!current || dirty & /*lines*/
+ 1) && t0_value !== (t0_value = /*indent*/
+ ctx[17] + ""))
+ set_data(t0, t0_value);
+ if ((!current || dirty & /*lines*/
+ 1) && t2_value !== (t2_value = dropDendron(
+ /*link*/
+ ctx[18],
+ /*settings*/
+ ctx[5]
+ ) + ""))
+ set_data(t2, t2_value);
+ if (!current || dirty & /*lines*/
+ 1 && a_class_value !== (a_class_value = "internal-link " + (isInVault(
+ /*link*/
+ ctx[18]
+ ) ? "" : "is-unresolved") + " svelte-1df5nr5")) {
+ attr(a2, "class", a_class_value);
+ }
+ const rendermarkdown_changes = {};
+ if (dirty & /*lines*/
+ 1)
+ rendermarkdown_changes.path = /*link*/
+ ctx[18];
+ rendermarkdown.$set(rendermarkdown_changes);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(rendermarkdown.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(rendermarkdown.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ destroy_component(rendermarkdown);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function create_each_block5(ctx) {
+ let show_if = meetsConditions(
+ /*indent*/
+ ctx[17],
+ /*link*/
+ ctx[18],
+ /*froms*/
+ ctx[1],
+ /*min*/
+ ctx[2],
+ /*max*/
+ ctx[3]
+ );
+ let if_block_anchor;
+ let current;
+ let if_block = show_if && create_if_block6(ctx);
+ return {
+ c() {
+ if (if_block)
+ if_block.c();
+ if_block_anchor = empty();
+ },
+ m(target, anchor) {
+ if (if_block)
+ if_block.m(target, anchor);
+ insert(target, if_block_anchor, anchor);
+ current = true;
+ },
+ p(ctx2, dirty) {
+ if (dirty & /*lines, froms, min, max*/
+ 15)
+ show_if = meetsConditions(
+ /*indent*/
+ ctx2[17],
+ /*link*/
+ ctx2[18],
+ /*froms*/
+ ctx2[1],
+ /*min*/
+ ctx2[2],
+ /*max*/
+ ctx2[3]
+ );
+ if (show_if) {
+ if (if_block) {
+ if_block.p(ctx2, dirty);
+ if (dirty & /*lines, froms, min, max*/
+ 15) {
+ transition_in(if_block, 1);
+ }
+ } else {
+ if_block = create_if_block6(ctx2);
+ if_block.c();
+ transition_in(if_block, 1);
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
+ }
+ } 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(if_block_anchor);
+ }
+ };
+}
+function create_fragment10(ctx) {
+ let t;
+ let div;
+ let current;
+ let if_block = (
+ /*title*/
+ ctx[6] !== false && create_if_block_24(ctx)
+ );
+ let each_value = (
+ /*lines*/
+ ctx[0]
+ );
+ let each_blocks = [];
+ for (let i = 0; i < each_value.length; i += 1) {
+ each_blocks[i] = create_each_block5(get_each_context5(ctx, each_value, i));
+ }
+ const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
+ each_blocks[i] = null;
+ });
+ return {
+ c() {
+ if (if_block)
+ if_block.c();
+ t = space();
+ div = element("div");
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ attr(div, "class", "BC-tree svelte-1df5nr5");
+ },
+ m(target, anchor) {
+ if (if_block)
+ if_block.m(target, anchor);
+ insert(target, t, 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);
+ }
+ }
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ if (
+ /*title*/
+ ctx2[6] !== false
+ )
+ if_block.p(ctx2, dirty);
+ if (dirty & /*content, lines, openOrSwitch, hoverPreview, activeLeafView, isInVault, dropDendron, settings, meetsConditions, froms, min, max*/
+ 687) {
+ each_value = /*lines*/
+ ctx2[0];
+ let i;
+ for (i = 0; i < each_value.length; i += 1) {
+ const child_ctx = get_each_context5(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_block5(child_ctx);
+ each_blocks[i].c();
+ transition_in(each_blocks[i], 1);
+ each_blocks[i].m(div, null);
+ }
+ }
+ group_outros();
+ for (i = each_value.length; i < each_blocks.length; i += 1) {
+ out(i);
+ }
+ 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) {
+ 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 (if_block)
+ if_block.d(detaching);
+ if (detaching)
+ detach(t);
+ if (detaching)
+ detach(div);
+ destroy_each(each_blocks, detaching);
+ }
+ };
+}
+function instance10($$self, $$props, $$invalidate) {
+ ;
+ ;
+ let { plugin } = $$props;
+ let { el } = $$props;
+ let { lines } = $$props;
+ let { froms } = $$props;
+ let { min: min3 } = $$props;
+ let { max: max4 } = $$props;
+ let { basename } = $$props;
+ let { parsedSource } = $$props;
+ const { settings } = plugin;
+ const { title, content, dir } = parsedSource;
+ const activeLeafView = app.workspace.activeLeaf.view;
+ const click_handler = async (link2, e) => await openOrSwitch(link2, e);
+ const mouseover_handler = (link2, e) => hoverPreview(e, activeLeafView, link2);
+ const click_handler_1 = async (link2, e) => await openOrSwitch(link2, e);
+ const mouseover_handler_1 = (link2, e) => hoverPreview(e, activeLeafView, link2);
+ $$self.$$set = ($$props2) => {
+ if ("plugin" in $$props2)
+ $$invalidate(10, plugin = $$props2.plugin);
+ if ("el" in $$props2)
+ $$invalidate(11, el = $$props2.el);
+ if ("lines" in $$props2)
+ $$invalidate(0, lines = $$props2.lines);
+ if ("froms" in $$props2)
+ $$invalidate(1, froms = $$props2.froms);
+ if ("min" in $$props2)
+ $$invalidate(2, min3 = $$props2.min);
+ if ("max" in $$props2)
+ $$invalidate(3, max4 = $$props2.max);
+ if ("basename" in $$props2)
+ $$invalidate(4, basename = $$props2.basename);
+ if ("parsedSource" in $$props2)
+ $$invalidate(12, parsedSource = $$props2.parsedSource);
+ };
+ return [
+ lines,
+ froms,
+ min3,
+ max4,
+ basename,
+ settings,
+ title,
+ content,
+ dir,
+ activeLeafView,
+ plugin,
+ el,
+ parsedSource,
+ click_handler,
+ mouseover_handler,
+ click_handler_1,
+ mouseover_handler_1
+ ];
+}
+var CBTree = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(
+ this,
+ options,
+ instance10,
+ create_fragment10,
+ safe_not_equal,
+ {
+ plugin: 10,
+ el: 11,
+ lines: 0,
+ froms: 1,
+ min: 2,
+ max: 3,
+ basename: 4,
+ parsedSource: 12
+ },
+ add_css8
+ );
+ }
+};
+var CBTree_default = CBTree;
+
+// src/Codeblocks.ts
+function getCodeblockCB(plugin) {
+ const { settings, db } = plugin;
+ const { userHiers, createIndexIndent } = settings;
+ return (source, el, ctx) => {
+ var _a;
+ db.start2G("Codeblock");
+ const parsedSource = parseCodeBlockSource(source);
+ const err = codeblockError(plugin, parsedSource);
+ if (err !== "") {
+ el.innerHTML = err;
+ db.end2G();
+ return;
+ }
+ let min3 = 0, max4 = Infinity;
+ let { depth, dir, fields, from, implied, flat } = parsedSource;
+ if (depth !== void 0) {
+ const minNum = parseInt(depth[0]);
+ if (!isNaN(minNum))
+ min3 = minNum;
+ const maxNum = parseInt(depth[1]);
+ if (!isNaN(maxNum))
+ max4 = maxNum;
+ }
+ const currFile = app.metadataCache.getFirstLinkpathDest(
+ ctx.sourcePath,
+ ""
+ );
+ const { basename } = currFile;
+ let froms = void 0;
+ if (from !== void 0) {
+ try {
+ const api = getDVApi(plugin);
+ if (api) {
+ const pages = (_a = api.pagePaths(from)) == null ? void 0 : _a.values;
+ froms = pages.map(dropFolder);
+ } else
+ new import_obsidian16.Notice("Dataview must be enabled for `from` to work.");
+ } catch (e) {
+ new import_obsidian16.Notice(`The query "${from}" failed.`);
+ }
+ }
+ const oppDir = getOppDir(dir);
+ const sub = implied === false ? getSubInDirs(plugin.mainG, dir) : getSubInDirs(plugin.mainG, dir, oppDir);
+ const closed = getReflexiveClosure(sub, userHiers);
+ const subFields = fields != null ? fields : getFields(userHiers);
+ const subClosed = getSubForFields(getSubInDirs(closed, dir), subFields);
+ const allPaths = dfsAllPaths(subClosed, basename);
+ const index2 = createIndex(allPaths, false, createIndexIndent);
+ (0, import_loglevel16.info)({ allPaths, index: index2 });
+ const lines = indexToLinePairs(index2, flat);
+ switch (parsedSource.type) {
+ case "tree":
+ new CBTree_default({
+ target: el,
+ props: {
+ plugin,
+ el,
+ min: min3,
+ max: max4,
+ lines,
+ froms,
+ basename,
+ parsedSource
+ }
+ });
+ break;
+ case "juggl":
+ createdJugglCB(
+ plugin,
+ el,
+ parsedSource,
+ lines,
+ froms,
+ basename,
+ min3,
+ max4
+ );
+ break;
+ }
+ db.end2G();
+ };
+}
+var parseAsBool = (value) => value === "true" ? true : value === "false" ? false : value;
+function parseCodeBlockSource(source) {
+ const lines = source.split("\n");
+ const getValue = (type2) => {
+ var _a, _b, _c;
+ return (_c = (_b = (_a = lines.find((l2) => l2.startsWith(`${type2}:`))) == null ? void 0 : _a.split(":")) == null ? void 0 : _b[1]) == null ? void 0 : _c.trim();
+ };
+ const results = {};
+ CODEBLOCK_FIELDS.forEach((field) => {
+ const value = getValue(field);
+ results[field] = parseAsBool(value);
+ });
+ results.fields = results.fields ? splitAndTrim(results.fields) : void 0;
+ if (results.depth) {
+ const match2 = results.depth.match(/(\d*)-?(\d*)/);
+ results.depth = [match2[1], match2[2]];
+ }
+ return results;
+}
+function codeblockError(plugin, parsedSource) {
+ var _a;
+ const { dir, fields, type: type2, title, depth, flat, content, from, implied } = parsedSource;
+ const { userHiers } = plugin.settings;
+ let err = "";
+ if (!CODEBLOCK_TYPES.includes(type2))
+ err += `type: ${type2} is not a valid type. It must be one of: ${CODEBLOCK_TYPES.map(
+ (type3) => `${type3}`
+ ).join(", ")}.`;
+ const validDir = DIRECTIONS.includes(dir);
+ if (!validDir)
+ err += `dir: ${dir} is not a valid direction.`;
+ const allFields = getFields(userHiers);
+ (_a = [fields].flat()) == null ? void 0 : _a.forEach((f) => {
+ if (f !== void 0 && !allFields.includes(f))
+ err += `fields: ${f} is not a field in your hierarchies.`;
+ });
+ if (title !== void 0 && title !== false)
+ err += `title: ${title} is not a valid value. It has to be false, or leave the entire line out.`;
+ if (depth !== void 0 && depth.every((num) => isNaN(parseInt(num))))
+ err += `depth: ${depth} is not a valid value. It has to be a number.`;
+ if (flat !== void 0 && flat !== true)
+ err += `flat: ${flat} is not a valid value. It has to be true, or leave the entire line out.`;
+ if (content !== void 0 && content !== "open" && content !== "closed")
+ err += `content: ${content} is not a valid value. It has to be open or closed, or leave the entire line out.`;
+ if (from !== void 0 && !app.plugins.enabledPlugins.has("dataview")) {
+ err += `Dataview must be enabled to use from.`;
+ }
+ if (implied !== void 0 && implied !== false)
+ err += `implied: ${implied} is not a valid value. It has to be false, or leave the entire line out.`;
+ return err === "" ? "" : `${err}
+ A valid example would be:
+
+ type: tree
+ dir: ${validDir ? dir : "down"}
+ fields: ${allFields.map((f) => {
+ return { f, dir: getFieldInfo(userHiers, f).fieldDir };
+ }).filter((info14) => info14.dir === dir).map((info14) => info14.f).join(", ") || "child"}
+ depth: 3
+ `;
+}
+var indentToDepth = (indent) => indent.length / 2 + 1;
+function meetsConditions(indent, node, froms, min3, max4) {
+ const depth = indentToDepth(indent);
+ return depth >= min3 && depth <= max4 && (froms === void 0 || froms.includes(node));
+}
+function createdJugglCB(plugin, target, args, lines, froms, source, min3, max4) {
+ const nodes = lines.filter(([indent, node]) => meetsConditions(indent, node, froms, min3, max4)).map(([_, node]) => node + ".md");
+ if (min3 <= 0)
+ nodes.push(source + ".md");
+ createJuggl(plugin, target, nodes, args);
+}
+
+// src/Commands/jumpToFirstDir.ts
+var import_obsidian17 = require("obsidian");
+async function jumpToFirstDir(plugin, dir) {
+ var _a;
+ const { limitJumpToFirstFields } = plugin.settings;
+ const file = getCurrFile();
+ if (!file) {
+ new import_obsidian17.Notice("You need to be focussed on a Markdown file");
+ return;
+ }
+ const { basename } = file;
+ const realsNImplieds = getRealnImplied(plugin, basename, dir)[dir];
+ const allBCs = [...realsNImplieds.reals, ...realsNImplieds.implieds];
+ if (allBCs.length === 0) {
+ new import_obsidian17.Notice(`No ${dir} found`);
+ return;
+ }
+ const toNode = (_a = allBCs.find(
+ (bc) => limitJumpToFirstFields.includes(bc.field)
+ )) == null ? void 0 : _a.to;
+ if (!toNode) {
+ new import_obsidian17.Notice(
+ `No note was found in ${dir} given the limited fields allowed: ${limitJumpToFirstFields.join(
+ ", "
+ )}`
+ );
+ return;
+ }
+ const toFile = app.metadataCache.getFirstLinkpathDest(toNode, "");
+ await app.workspace.activeLeaf.openFile(toFile);
+}
+
+// src/Commands/threading.ts
+var import_obsidian18 = require("obsidian");
+var resolveThreadingNameTemplate = (template, currFile, field, dir, dateFormat) => template ? template.replace("{{current}}", currFile.basename).replace("{{field}}", field).replace("{{dir}}", dir).replace("{{date}}", moment().format(dateFormat)) : "Untitled";
+function makeFilenameUnique(filename) {
+ let i = 1, newName = filename;
+ while (app.metadataCache.getFirstLinkpathDest(newName, "")) {
+ if (i === 1)
+ newName += ` ${i}`;
+ else
+ newName = newName.slice(0, -2) + ` ${i}`;
+ i++;
+ }
+ return newName;
+}
+async function resolveThreadingContentTemplate(writeBCsInline, templatePath, oppField, currFile, crumb) {
+ let newContent = crumb;
+ if (templatePath) {
+ const templateFile = app.metadataCache.getFirstLinkpathDest(
+ templatePath,
+ ""
+ );
+ const template = await app.vault.cachedRead(templateFile);
+ newContent = template.replace(
+ /\{\{BC-thread-crumb\}\}/i,
+ writeBCsInline ? `${oppField}:: [[${currFile.basename}]]` : `${oppField}: ['${currFile.basename}']`
+ );
+ }
+ return newContent;
+}
+async function thread(plugin, field) {
+ var _a;
+ const { settings } = plugin;
+ const {
+ userHiers,
+ threadingTemplate,
+ dateFormat,
+ threadIntoNewPane,
+ threadingDirTemplates,
+ threadUnderCursor,
+ writeBCsInline
+ } = settings;
+ const currFile = getCurrFile();
+ if (!currFile)
+ return;
+ const newFileParent = app.fileManager.getNewFileParent(currFile.path);
+ const dir = getFieldInfo(userHiers, field).fieldDir;
+ const oppField = getOppFields(userHiers, field, dir)[0];
+ let newBasename = resolveThreadingNameTemplate(
+ threadingTemplate,
+ currFile,
+ field,
+ dir,
+ dateFormat
+ );
+ newBasename = makeFilenameUnique(newBasename);
+ const oppCrumb = writeBCsInline ? `${oppField}:: [[${currFile.basename}]]` : `---
+${oppField}: ['${currFile.basename}']
+---`;
+ const templatePath = threadingDirTemplates[dir];
+ const newContent = await resolveThreadingContentTemplate(
+ writeBCsInline,
+ templatePath,
+ oppField,
+ currFile,
+ oppCrumb
+ );
+ const newFile = await app.vault.create(
+ (0, import_obsidian18.normalizePath)(`${newFileParent.path}/${newBasename}.md`),
+ newContent
+ );
+ if (!writeBCsInline) {
+ const { api } = (_a = app.plugins.plugins.metaedit) != null ? _a : {};
+ if (!api) {
+ new import_obsidian18.Notice(
+ "Metaedit must be enabled to write to yaml. Alternatively, toggle the setting `Write Breadcrumbs Inline` to use Dataview inline fields instead."
+ );
+ return;
+ }
+ await createOrUpdateYaml(
+ field,
+ newFile.basename,
+ currFile,
+ app.metadataCache.getFileCache(currFile).frontmatter,
+ api
+ );
+ } else {
+ const crumb = `${field}:: [[${newFile.basename}]]`;
+ const { editor } = app.workspace.activeLeaf.view;
+ if (threadUnderCursor || !editor) {
+ editor.replaceRange(crumb, editor.getCursor());
+ } else {
+ let content = await app.vault.read(currFile);
+ const splits = splitAtYaml2(content);
+ content = splits[0] + (splits[0].length ? "\n" : "") + crumb + (splits[1].length ? "\n" : "") + splits[1];
+ await app.vault.modify(currFile, content);
+ }
+ }
+ const leaf = threadIntoNewPane ? app.workspace.getLeaf(true) : app.workspace.activeLeaf;
+ await leaf.openFile(newFile, { active: true, mode: "source" });
+ if (templatePath) {
+ if (app.plugins.plugins["templater-obsidian"]) {
+ app.commands.executeCommandById(
+ "templater-obsidian:replace-in-file-templater"
+ );
+ } else {
+ new import_obsidian18.Notice(
+ "The Templater plugin must be enabled to resolve the templates in the new note"
+ );
+ }
+ }
+ if (threadingTemplate) {
+ const editor = leaf.view.editor;
+ editor.setCursor(editor.getValue().length);
+ } else {
+ const noteNameInputs = document.getElementsByClassName("view-header-title");
+ const newNoteInputEl = Array.from(noteNameInputs).find(
+ (input) => input.innerText === newBasename
+ );
+ newNoteInputEl.innerText = "";
+ newNoteInputEl.focus();
+ }
+}
+
+// src/Commands/WriteBCs.ts
+var import_loglevel17 = __toESM(require_loglevel());
+var import_obsidian19 = require("obsidian");
+async function writeBCToFile(plugin, currFile) {
+ const { settings, mainG } = plugin;
+ const file = currFile != null ? currFile : getCurrFile();
+ const { limitWriteBCCheckboxes, writeBCsInline, userHiers } = settings;
+ const succInfo = mainG.mapInEdges(file.basename, (k, a2, s2, t) => {
+ const { field, dir } = a2;
+ const oppField = getOppFields(userHiers, field, dir)[0];
+ return { succ: s2, field: oppField };
+ });
+ for (const { succ, field } of succInfo) {
+ if (!limitWriteBCCheckboxes.includes(field))
+ return;
+ const content = await app.vault.read(file);
+ const [yaml, afterYaml] = splitAtYaml2(content);
+ if (!writeBCsInline) {
+ const inner = yaml === "" ? yaml : yaml.slice(4, -4);
+ const newYaml = changeYaml(inner, field, succ);
+ const newContent = `---
+${newYaml}
+---${afterYaml}`;
+ await app.vault.modify(file, newContent);
+ } else {
+ const newContent = yaml + (yaml.length ? "\n" : "") + `${field}:: [[${succ}]]` + (afterYaml.length ? "\n" : "") + afterYaml;
+ await app.vault.modify(file, newContent);
+ }
+ }
+}
+async function writeBCsToAllFiles(plugin) {
+ if (!plugin.settings.showWriteAllBCsCmd) {
+ new import_obsidian19.Notice(
+ "You first need to enable this command in Breadcrumbs' settings."
+ );
+ return;
+ }
+ if (window.confirm(
+ "This action will write the implied Breadcrumbs of each file to that file.\nIt uses the MetaEdit plugins API to update the YAML, so it should only affect that frontmatter of your note.\nI can't promise that nothing bad will happen. **This operation cannot be undone**."
+ )) {
+ if (window.confirm(
+ "Are you sure? You have been warned that this operation will attempt to update all files with implied breadcrumbs."
+ )) {
+ if (window.confirm("For real, please make a back up before.")) {
+ const notice = new import_obsidian19.Notice("Operation Started");
+ const problemFiles = [];
+ for (const file of app.vault.getMarkdownFiles()) {
+ try {
+ await writeBCToFile(plugin, file);
+ } catch (e) {
+ problemFiles.push(file.path);
+ }
+ }
+ notice.setMessage("Operation Complete");
+ if (problemFiles.length) {
+ new import_obsidian19.Notice(
+ "Some files were not updated due to errors. Check the console to see which ones."
+ );
+ (0, import_loglevel17.warn)({ problemFiles });
+ }
+ }
+ }
+ }
+}
+
+// src/FieldSuggestor.ts
+var import_obsidian20 = require("obsidian");
+var FieldSuggestor = class extends import_obsidian20.EditorSuggest {
+ constructor(plugin) {
+ super(app);
+ this.getSuggestions = (context) => {
+ const { query } = context;
+ return BC_FIELDS_INFO.map((sug) => sug.field).filter(
+ (sug) => sug.includes(query)
+ );
+ };
+ this.plugin = plugin;
+ }
+ onTrigger(cursor, editor, _) {
+ var _a;
+ const sub = editor.getLine(cursor.line).substring(0, cursor.ch);
+ const match2 = (_a = sub.match(/^BC-(.*)$/)) == null ? void 0 : _a[1];
+ if (match2 !== void 0) {
+ return {
+ end: cursor,
+ start: {
+ ch: sub.lastIndexOf(match2),
+ line: cursor.line
+ },
+ query: match2
+ };
+ }
+ return null;
+ }
+ renderSuggestion(suggestion, el) {
+ var _a;
+ el.createDiv({
+ text: suggestion.replace("BC-", ""),
+ cls: "BC-suggester-container",
+ attr: {
+ "aria-label": (_a = BC_FIELDS_INFO.find((f) => f.field === suggestion)) == null ? void 0 : _a.desc,
+ "aria-label-position": "right"
+ }
+ });
+ }
+ selectSuggestion(suggestion) {
+ const { context, plugin } = this;
+ if (!context)
+ return;
+ const field = BC_FIELDS_INFO.find((f) => f.field === suggestion);
+ const replacement = `${suggestion}${field == null ? void 0 : field[isInsideYaml() ? "afterYaml" : "afterInline"]}`;
+ context.editor.replaceRange(
+ replacement,
+ { ch: 0, line: context.start.line },
+ context.end
+ );
+ }
+};
+
+// src/RelationSuggestor.ts
+var import_obsidian21 = require("obsidian");
+var RelationSuggestor = class extends import_obsidian21.EditorSuggest {
+ constructor(plugin) {
+ super(app);
+ this.getSuggestions = (context) => {
+ const { query } = context;
+ const { userHiers } = this.plugin.settings;
+ return getFields(userHiers).filter((sug) => sug.includes(query));
+ };
+ this.plugin = plugin;
+ }
+ onTrigger(cursor, editor, _) {
+ var _a;
+ const trig = this.plugin.settings.relSuggestorTrigger;
+ const sub = editor.getLine(cursor.line).substring(0, cursor.ch);
+ const regex = new RegExp(`.*?${escapeRegex(trig)}(.*)$`);
+ const match2 = (_a = regex.exec(sub)) == null ? void 0 : _a[1];
+ if (match2 === void 0)
+ return null;
+ return {
+ start: {
+ ch: sub.lastIndexOf(trig),
+ line: cursor.line
+ },
+ end: cursor,
+ query: match2
+ };
+ }
+ renderSuggestion(suggestion, el) {
+ el.createDiv({
+ text: suggestion,
+ cls: "codeblock-suggestion"
+ });
+ }
+ selectSuggestion(suggestion) {
+ const { context, plugin } = this;
+ if (!context)
+ return;
+ const trig = plugin.settings.relSuggestorTrigger;
+ const { start: start2, end, editor } = context;
+ const replacement = suggestion + (isInsideYaml() ? ": " : ":: ") + "[[";
+ editor.replaceRange(
+ replacement,
+ { ch: start2.ch + 1 - trig.length, line: start2.line },
+ end
+ );
+ }
+};
+
+// src/Settings/BreadcrumbsSettingTab.ts
+var import_obsidian40 = require("obsidian");
+
+// src/Components/KoFi.svelte
+function add_css9(target) {
+ append_styles(target, "svelte-1j4tt4j", ".BC-Kofi-button.svelte-1j4tt4j{margin-top:10px}");
+}
+function create_fragment11(ctx) {
+ let script;
+ let script_src_value;
+ let t;
+ let div;
+ let mounted;
+ let dispose;
+ return {
+ c() {
+ script = element("script");
+ t = space();
+ div = element("div");
+ attr(script, "type", "text/javascript");
+ if (!src_url_equal(script.src, script_src_value = "https://ko-fi.com/widgets/widget_2.js"))
+ attr(script, "src", script_src_value);
+ attr(div, "class", "BC-Kofi-button svelte-1j4tt4j");
+ },
+ m(target, anchor) {
+ append(document.head, script);
+ insert(target, t, anchor);
+ insert(target, div, anchor);
+ ctx[2](div);
+ if (!mounted) {
+ dispose = listen(
+ script,
+ "load",
+ /*initializeKofi*/
+ ctx[1]
+ );
+ mounted = true;
+ }
+ },
+ p: noop,
+ i: noop,
+ o: noop,
+ d(detaching) {
+ detach(script);
+ if (detaching)
+ detach(t);
+ if (detaching)
+ detach(div);
+ ctx[2](null);
+ mounted = false;
+ dispose();
+ }
+ };
+}
+function instance11($$self, $$props, $$invalidate) {
+ let button;
+ const initializeKofi = () => {
+ kofiwidget2.init("Support Breadcrumbs development!", "#29abe0", "G2G454TZF");
+ $$invalidate(0, button.innerHTML = kofiwidget2.getHTML(), button);
+ };
+ function div_binding($$value) {
+ binding_callbacks[$$value ? "unshift" : "push"](() => {
+ button = $$value;
+ $$invalidate(0, button);
+ });
+ }
+ return [button, initializeKofi, div_binding];
+}
+var KoFi = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance11, create_fragment11, safe_not_equal, {}, add_css9);
+ }
+};
+var KoFi_default = KoFi;
+
+// src/Settings/CreateIndexSettings.ts
+var import_obsidian22 = require("obsidian");
+function addCreateIndexSettings(plugin, cmdsDetails) {
+ const { settings } = plugin;
+ const createIndexDetails = subDetails("Create Index", cmdsDetails);
+ new import_obsidian22.Setting(createIndexDetails).setName("Add wiklink brackets").setDesc(
+ fragWithHTML(
+ "When creating an index, should it wrap the note name in wikilinks [[]] or not.\n\u2705 = yes, \u274C = no."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.wikilinkIndex).onChange(async (value) => {
+ settings.wikilinkIndex = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian22.Setting(createIndexDetails).setName("Indent Character").setDesc(
+ fragWithHTML(
+ "The character(s) used to indent the index. These can be anything you want, but will usually be either spaces or tabs. Enter \\t to use tabs."
+ )
+ ).addText((text2) => {
+ text2.setValue(settings.createIndexIndent).onChange(async (value) => {
+ settings.createIndexIndent = value;
+ await plugin.saveSettings();
+ });
+ });
+ new import_obsidian22.Setting(createIndexDetails).setName("Show aliases of notes in index").setDesc("Show the aliases of each note in brackets.\n\u2705 = yes, \u274C = no.").addToggle(
+ (toggle) => toggle.setValue(settings.aliasesInIndex).onChange(async (value) => {
+ settings.aliasesInIndex = value;
+ await plugin.saveSettings();
+ })
+ );
+}
+
+// src/Settings/CSVSettings.ts
+var import_obsidian23 = require("obsidian");
+function addCSVSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const csvDetails = subDetails("CSV Notes", alternativeHierarchyDetails);
+ new import_obsidian23.Setting(csvDetails).setName("CSV Breadcrumb Paths").setDesc("The file path of a csv files with breadcrumbs information.").addText((text2) => {
+ text2.setValue(settings.CSVPaths);
+ text2.inputEl.onblur = async () => {
+ settings.CSVPaths = text2.inputEl.value;
+ await plugin.saveSettings();
+ };
+ });
+}
+
+// src/Settings/DataviewNoteSettings.ts
+var import_obsidian24 = require("obsidian");
+function addDataviewSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const { userHiers } = settings;
+ const fields = getFields(userHiers);
+ const dvDetails = subDetails("Dataview Notes", alternativeHierarchyDetails);
+ new import_obsidian24.Setting(dvDetails).setName("Default Dataview Note Field").setDesc(
+ fragWithHTML(
+ "By default, Dataview notes use the first field in your hierarchies (usually an \u2191 field). Choose a different one to use by default, without having to specify BC-dataview-note-field: {field}.If you don't want to choose a default, select the blank option at the bottom of the list."
+ )
+ ).addDropdown((dd) => {
+ fields.forEach((field) => dd.addOption(field, field));
+ dd.addOption("", "").setValue(settings.dataviewNoteField).onChange(async (field) => {
+ settings.dataviewNoteField = field;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+}
+
+// src/Settings/DateNoteSettings.ts
+var import_obsidian25 = require("obsidian");
+function addDateNoteSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const { userHiers } = settings;
+ const fields = getFields(userHiers);
+ const fieldOptions = { "": "" };
+ fields.forEach((field) => fieldOptions[field] = field);
+ const dateNoteDetails = subDetails("Date Notes", alternativeHierarchyDetails);
+ new import_obsidian25.Setting(dateNoteDetails).setName("Add Date Notes to Graph").setDesc(
+ "Breadcrumbs will try to link each daily note to the next one using the date format you provide in the settings below."
+ ).addToggle((toggle) => {
+ toggle.setValue(settings.addDateNotes).onChange(async (value) => {
+ settings.addDateNotes = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+ new import_obsidian25.Setting(dateNoteDetails).setName("Daily Note Format").setDesc(
+ fragWithHTML(
+ `The Luxon date format of your daily notes.Note : Luxon uses different formats to Moment, so your format for the Daily Notes plugin may not work here. Be sure to check out the docs to find the right format. You can escape characters by wrapping them in single quotes (e.g. yyyy-MM-dd 'Daily Note')`
+ )
+ ).addText((text2) => {
+ text2.setValue(settings.dateNoteFormat);
+ text2.inputEl.onblur = async () => {
+ settings.dateNoteFormat = text2.getValue();
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ };
+ });
+ new import_obsidian25.Setting(dateNoteDetails).setName("Date Note Field").setDesc(
+ fragWithHTML(
+ "Select a field to point to tomorrow's note from the current note. The opposite field will be used to point to yesterday's note."
+ )
+ ).addDropdown((dd) => {
+ dd.addOptions(fieldOptions).setValue(settings.dateNoteField).onChange(async (field) => {
+ settings.dateNoteField = field;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+}
+
+// src/Settings/DebuggingSettings.ts
+var import_loglevel18 = __toESM(require_loglevel());
+var import_obsidian26 = require("obsidian");
+function addDebuggingsSettings(plugin, containerEl) {
+ const { settings } = plugin;
+ const debugDetails = details("Debugging", containerEl);
+ new import_obsidian26.Setting(debugDetails).setName("Debug Mode").setDesc(
+ fragWithHTML(
+ "Set the minimum level of debug messages to console log. If you choose TRACE, then everything will be logged. If you choose ERROR, then only the most necessary issues will be logged. SILENT will turn off all logs."
+ )
+ ).addDropdown((dd) => {
+ Object.keys(import_loglevel18.default.levels).forEach((key) => dd.addOption(key, key));
+ dd.setValue(settings.debugMode).onChange(async (value) => {
+ import_loglevel18.default.setLevel(value);
+ settings.debugMode = value;
+ await plugin.saveSettings();
+ });
+ });
+ debugDetails.createEl("button", { text: "Console log settings" }, (el) => {
+ el.addEventListener("click", () => console.log(settings));
+ });
+}
+
+// src/Settings/DendronSettings.ts
+var import_obsidian27 = require("obsidian");
+function addDendronSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const { userHiers } = settings;
+ const fields = getFields(userHiers);
+ const dendronDetails = subDetails(
+ "Dendron Notes",
+ alternativeHierarchyDetails
+ );
+ new import_obsidian27.Setting(dendronDetails).setName("Add Dendron notes to graph").setDesc(
+ fragWithHTML(
+ "Dendron notes create a hierarchy using note names.nmath.algebra is a note about algebra, whose parent is math.nmath.calculus.limits is a note about limits whose parent is the note math.calculus, the parent of which is math."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.addDendronNotes).onChange(async (value) => {
+ settings.addDendronNotes = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian27.Setting(dendronDetails).setName("Delimiter").setDesc(
+ fragWithHTML(
+ "Which delimiter should Breadcrumbs look for? The default is .."
+ )
+ ).addText((text2) => {
+ text2.setPlaceholder("Delimiter").setValue(settings.dendronNoteDelimiter);
+ text2.inputEl.onblur = async () => {
+ const value = text2.getValue();
+ if (value)
+ settings.dendronNoteDelimiter = value;
+ else {
+ new import_obsidian27.Notice(`The delimiter can't be blank`);
+ settings.dendronNoteDelimiter = DEFAULT_SETTINGS.dendronNoteDelimiter;
+ }
+ await plugin.saveSettings();
+ };
+ });
+ new import_obsidian27.Setting(dendronDetails).setName("Trim Dendron Note Names").setDesc(
+ fragWithHTML(
+ "When displaying a dendron note name, should it be trimmed to only show the last item in the chain?e.g. A.B.C \u2192 C."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.trimDendronNotes).onChange(async (value) => {
+ settings.trimDendronNotes = value;
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ })
+ );
+ new import_obsidian27.Setting(dendronDetails).setName("Dendron Note Field").setDesc("Which field should Breadcrumbs use for Dendron notes?").addDropdown((dd) => {
+ fields.forEach((field) => dd.addOption(field, field));
+ dd.setValue(settings.dendronNoteField);
+ dd.onChange(async (value) => {
+ settings.dendronNoteField = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+}
+
+// src/Settings/GeneralSettings.ts
+var import_obsidian28 = require("obsidian");
+function addGeneralSettings(plugin, containerEl) {
+ const { settings } = plugin;
+ const generalDetails = details("General Options", containerEl);
+ new import_obsidian28.Setting(generalDetails).setName("Refresh Index on Note Change").setDesc(
+ fragWithHTML(
+ "Refresh the Breadcrumbs index data everytime you change notes.Note : This can be very slow on large vaults."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.refreshOnNoteChange).onChange(async (value) => {
+ settings.refreshOnNoteChange = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Refresh Index On Note Save").addToggle(
+ (toggle) => toggle.setValue(settings.refreshOnNoteSave).onChange(async (value) => {
+ settings.refreshOnNoteSave = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Show Refresh Index Notice").setDesc(
+ "When Refreshing Index, should it show a notice once the operation is complete?"
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.showRefreshNotice).onChange(async (value) => {
+ settings.showRefreshNotice = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Alias Fields").setDesc(
+ fragWithHTML(
+ "A comma-separated list of fields used to specify aliases. These fields will be checked, in order, to display an alternate note title in different views.This field will probably be alias or aliases, but it can be anything, like title."
+ )
+ ).addText((text2) => {
+ text2.setValue(settings.altLinkFields.join(", "));
+ text2.inputEl.onblur = async () => {
+ settings.altLinkFields = splitAndTrim(text2.getValue());
+ await plugin.saveSettings();
+ };
+ });
+ new import_obsidian28.Setting(generalDetails).setName("Only show first alias").setDesc(
+ "If a note has an alias (using the fields in the setting above), should only the first one be shown?"
+ ).addToggle(
+ (toggle) => toggle.setValue(!settings.showAllAliases).onChange(async (value) => {
+ settings.showAllAliases = !value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Use yaml or inline fields for hierarchy data").setDesc(
+ "If enabled, Breadcrumbs will make it's hierarchy using yaml fields, and inline Dataview fields.\nIf this is disabled, it will only use Juggl links (See below)."
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.useAllMetadata).onChange(async (value) => {
+ settings.useAllMetadata = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Use Juggl link syntax without having Juggl installed.").setDesc(
+ fragWithHTML(
+ `Should Breadcrumbs look for Juggl links even if you don't have Juggl installed? If you do have Juggl installed, it will always look for Juggl links.`
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.parseJugglLinksWithoutJuggl).onChange(async (value) => {
+ settings.parseJugglLinksWithoutJuggl = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Enable Field Suggestor").setDesc(
+ fragWithHTML(
+ "Alot of Breadcrumbs features require a metadata (or inline Dataview) field to work. For example, `BC-folder-note`.The Field Suggestor will show an autocomplete menu with all available Breadcrumbs field options when you type BC- at the start of a line."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.fieldSuggestor).onChange(async (value) => {
+ settings.fieldSuggestor = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Enable Relation Suggestor").setDesc(
+ fragWithHTML(
+ "Enable an editor suggestor which gets triggered by a custom string to show a list of relations from your hierarchies to insert."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.enableRelationSuggestor).onChange(async (value) => {
+ settings.enableRelationSuggestor = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian28.Setting(generalDetails).setName("Relation Suggestor Trigger").setDesc(
+ fragWithHTML(
+ "The string used to trigger the relation suggestor. Default is \\."
+ )
+ ).addText(
+ (text2) => text2.setValue(settings.relSuggestorTrigger).onChange(async (value) => {
+ settings.relSuggestorTrigger = value;
+ await plugin.saveSettings();
+ })
+ );
+ if (app.plugins.plugins.dataview !== void 0) {
+ new import_obsidian28.Setting(generalDetails).setName("Dataview Wait Time").setDesc(
+ "Enter an integer number of seconds to wait for the Dataview Index to load. The larger your vault, the longer it will take. The default is 5 seconds."
+ ).addText(
+ (text2) => text2.setPlaceholder("Seconds").setValue((settings.dvWaitTime / 1e3).toString()).onChange(async (value) => {
+ const num = Number(value);
+ if (num > 0) {
+ settings.dvWaitTime = num * 1e3;
+ await plugin.saveSettings();
+ } else {
+ new import_obsidian28.Notice("The interval must be a non-negative number");
+ }
+ })
+ );
+ }
+}
+
+// src/Settings/HierarchyNoteSettings.ts
+var import_obsidian29 = require("obsidian");
+function addHierarchyNoteSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const hierarchyNoteDetails = subDetails(
+ "Hierarchy Notes",
+ alternativeHierarchyDetails
+ );
+ new import_obsidian29.Setting(hierarchyNoteDetails).setName("Hierarchy Note(s)").setDesc(
+ fragWithHTML(
+ "A comma-separated list of notes used to create external Breadcrumb structures. You can also point to a folder of hierarchy notes by entering folderName/ (ending with a /). Hierarchy note names and folders of hierarchy notes can both be entered in the same comma-separated list."
+ )
+ ).addText((text2) => {
+ text2.setPlaceholder("Hierarchy Note(s)").setValue(settings.hierarchyNotes.join(", "));
+ text2.inputEl.onblur = async () => {
+ const splits = splitAndTrim(text2.getValue());
+ settings.hierarchyNotes = splits;
+ await plugin.saveSettings();
+ };
+ });
+ new import_obsidian29.Setting(hierarchyNoteDetails).setName("Hierarchy note is parent of top-level items").setDesc("Should the actual hierarchy note be treated as the parent of all the top-level items in the list? \u2705 = Yes, \u274C = No").addToggle((toggle) => {
+ toggle.setValue(settings.hierarchyNoteIsParent).onChange(async (value) => {
+ settings.hierarchyNoteIsParent = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+ new import_obsidian29.Setting(hierarchyNoteDetails).setName("Default Hierarchy Note Field").setDesc(
+ fragWithHTML(
+ "By default, hierarchy notes use the first up field in your hierarchies. Choose a different one to use by default. If you don't want to choose a default, select the blank option at the bottom of the list."
+ )
+ ).addDropdown((dd) => {
+ const upFields = getFields(settings.userHiers, "up");
+ const options = {};
+ upFields.forEach(
+ (field) => options[field] = field
+ );
+ dd.addOptions(options).setValue(settings.HNUpField || upFields[0]).onChange(async (field) => {
+ settings.HNUpField = field;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+}
+
+// src/Components/UserHierarchies.svelte
+var import_obsidian30 = require("obsidian");
+
+// node_modules/svelte-icons/components/IconBase.svelte
+function add_css10(target) {
+ append_styles(target, "svelte-c8tyih", "svg.svelte-c8tyih{stroke:currentColor;fill:currentColor;stroke-width:0;width:100%;height:auto;max-height:100%}");
+}
+function create_if_block7(ctx) {
+ let title_1;
+ let t;
+ return {
+ c() {
+ title_1 = svg_element("title");
+ t = text(
+ /*title*/
+ ctx[0]
+ );
+ },
+ m(target, anchor) {
+ insert(target, title_1, anchor);
+ append(title_1, t);
+ },
+ p(ctx2, dirty) {
+ if (dirty & /*title*/
+ 1)
+ set_data(
+ t,
+ /*title*/
+ ctx2[0]
+ );
+ },
+ d(detaching) {
+ if (detaching)
+ detach(title_1);
+ }
+ };
+}
+function create_fragment12(ctx) {
+ let svg;
+ let if_block_anchor;
+ let current;
+ let if_block = (
+ /*title*/
+ ctx[0] && create_if_block7(ctx)
+ );
+ const default_slot_template = (
+ /*#slots*/
+ ctx[3].default
+ );
+ const default_slot = create_slot(
+ default_slot_template,
+ ctx,
+ /*$$scope*/
+ ctx[2],
+ null
+ );
+ return {
+ c() {
+ svg = svg_element("svg");
+ if (if_block)
+ if_block.c();
+ if_block_anchor = empty();
+ if (default_slot)
+ default_slot.c();
+ attr(svg, "xmlns", "http://www.w3.org/2000/svg");
+ attr(
+ svg,
+ "viewBox",
+ /*viewBox*/
+ ctx[1]
+ );
+ attr(svg, "class", "svelte-c8tyih");
+ },
+ m(target, anchor) {
+ insert(target, svg, anchor);
+ if (if_block)
+ if_block.m(svg, null);
+ append(svg, if_block_anchor);
+ if (default_slot) {
+ default_slot.m(svg, null);
+ }
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ if (
+ /*title*/
+ ctx2[0]
+ ) {
+ if (if_block) {
+ if_block.p(ctx2, dirty);
+ } else {
+ if_block = create_if_block7(ctx2);
+ if_block.c();
+ if_block.m(svg, if_block_anchor);
+ }
+ } else if (if_block) {
+ if_block.d(1);
+ if_block = null;
+ }
+ 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 (!current || dirty & /*viewBox*/
+ 2) {
+ attr(
+ svg,
+ "viewBox",
+ /*viewBox*/
+ 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(svg);
+ if (if_block)
+ if_block.d();
+ if (default_slot)
+ default_slot.d(detaching);
+ }
+ };
+}
+function instance12($$self, $$props, $$invalidate) {
+ let { $$slots: slots = {}, $$scope } = $$props;
+ let { title = null } = $$props;
+ let { viewBox } = $$props;
+ $$self.$$set = ($$props2) => {
+ if ("title" in $$props2)
+ $$invalidate(0, title = $$props2.title);
+ if ("viewBox" in $$props2)
+ $$invalidate(1, viewBox = $$props2.viewBox);
+ if ("$$scope" in $$props2)
+ $$invalidate(2, $$scope = $$props2.$$scope);
+ };
+ return [title, viewBox, $$scope, slots];
+}
+var IconBase = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance12, create_fragment12, safe_not_equal, { title: 0, viewBox: 1 }, add_css10);
+ }
+};
+var IconBase_default = IconBase;
+
+// node_modules/svelte-icons/fa/FaListUl.svelte
+function create_default_slot(ctx) {
+ let path2;
+ return {
+ c() {
+ path2 = svg_element("path");
+ attr(path2, "d", "M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z");
+ },
+ m(target, anchor) {
+ insert(target, path2, anchor);
+ },
+ p: noop,
+ d(detaching) {
+ if (detaching)
+ detach(path2);
+ }
+ };
+}
+function create_fragment13(ctx) {
+ let iconbase;
+ let current;
+ const iconbase_spread_levels = [
+ { viewBox: "0 0 512 512" },
+ /*$$props*/
+ ctx[0]
+ ];
+ let iconbase_props = {
+ $$slots: { default: [create_default_slot] },
+ $$scope: { ctx }
+ };
+ for (let i = 0; i < iconbase_spread_levels.length; i += 1) {
+ iconbase_props = assign(iconbase_props, iconbase_spread_levels[i]);
+ }
+ iconbase = new IconBase_default({ props: iconbase_props });
+ return {
+ c() {
+ create_component(iconbase.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(iconbase, target, anchor);
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ const iconbase_changes = dirty & /*$$props*/
+ 1 ? get_spread_update(iconbase_spread_levels, [iconbase_spread_levels[0], get_spread_object(
+ /*$$props*/
+ ctx2[0]
+ )]) : {};
+ if (dirty & /*$$scope*/
+ 2) {
+ iconbase_changes.$$scope = { dirty, ctx: ctx2 };
+ }
+ iconbase.$set(iconbase_changes);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(iconbase.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(iconbase.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(iconbase, detaching);
+ }
+ };
+}
+function instance13($$self, $$props, $$invalidate) {
+ $$self.$$set = ($$new_props) => {
+ $$invalidate(0, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
+ };
+ $$props = exclude_internal_props($$props);
+ return [$$props];
+}
+var FaListUl = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance13, create_fragment13, safe_not_equal, {});
+ }
+};
+var FaListUl_default = FaListUl;
+
+// node_modules/svelte-icons/fa/FaPlus.svelte
+function create_default_slot2(ctx) {
+ let path2;
+ return {
+ c() {
+ path2 = svg_element("path");
+ attr(path2, "d", "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z");
+ },
+ m(target, anchor) {
+ insert(target, path2, anchor);
+ },
+ p: noop,
+ d(detaching) {
+ if (detaching)
+ detach(path2);
+ }
+ };
+}
+function create_fragment14(ctx) {
+ let iconbase;
+ let current;
+ const iconbase_spread_levels = [
+ { viewBox: "0 0 448 512" },
+ /*$$props*/
+ ctx[0]
+ ];
+ let iconbase_props = {
+ $$slots: { default: [create_default_slot2] },
+ $$scope: { ctx }
+ };
+ for (let i = 0; i < iconbase_spread_levels.length; i += 1) {
+ iconbase_props = assign(iconbase_props, iconbase_spread_levels[i]);
+ }
+ iconbase = new IconBase_default({ props: iconbase_props });
+ return {
+ c() {
+ create_component(iconbase.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(iconbase, target, anchor);
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ const iconbase_changes = dirty & /*$$props*/
+ 1 ? get_spread_update(iconbase_spread_levels, [iconbase_spread_levels[0], get_spread_object(
+ /*$$props*/
+ ctx2[0]
+ )]) : {};
+ if (dirty & /*$$scope*/
+ 2) {
+ iconbase_changes.$$scope = { dirty, ctx: ctx2 };
+ }
+ iconbase.$set(iconbase_changes);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(iconbase.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(iconbase.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(iconbase, detaching);
+ }
+ };
+}
+function instance14($$self, $$props, $$invalidate) {
+ $$self.$$set = ($$new_props) => {
+ $$invalidate(0, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
+ };
+ $$props = exclude_internal_props($$props);
+ return [$$props];
+}
+var FaPlus = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance14, create_fragment14, safe_not_equal, {});
+ }
+};
+var FaPlus_default = FaPlus;
+
+// node_modules/svelte-icons/fa/FaRegTrashAlt.svelte
+function create_default_slot3(ctx) {
+ let path2;
+ return {
+ c() {
+ path2 = svg_element("path");
+ attr(path2, "d", "M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z");
+ },
+ m(target, anchor) {
+ insert(target, path2, anchor);
+ },
+ p: noop,
+ d(detaching) {
+ if (detaching)
+ detach(path2);
+ }
+ };
+}
+function create_fragment15(ctx) {
+ let iconbase;
+ let current;
+ const iconbase_spread_levels = [
+ { viewBox: "0 0 448 512" },
+ /*$$props*/
+ ctx[0]
+ ];
+ let iconbase_props = {
+ $$slots: { default: [create_default_slot3] },
+ $$scope: { ctx }
+ };
+ for (let i = 0; i < iconbase_spread_levels.length; i += 1) {
+ iconbase_props = assign(iconbase_props, iconbase_spread_levels[i]);
+ }
+ iconbase = new IconBase_default({ props: iconbase_props });
+ return {
+ c() {
+ create_component(iconbase.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(iconbase, target, anchor);
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ const iconbase_changes = dirty & /*$$props*/
+ 1 ? get_spread_update(iconbase_spread_levels, [iconbase_spread_levels[0], get_spread_object(
+ /*$$props*/
+ ctx2[0]
+ )]) : {};
+ if (dirty & /*$$scope*/
+ 2) {
+ iconbase_changes.$$scope = { dirty, ctx: ctx2 };
+ }
+ iconbase.$set(iconbase_changes);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(iconbase.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(iconbase.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(iconbase, detaching);
+ }
+ };
+}
+function instance15($$self, $$props, $$invalidate) {
+ $$self.$$set = ($$new_props) => {
+ $$invalidate(0, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
+ };
+ $$props = exclude_internal_props($$props);
+ return [$$props];
+}
+var FaRegTrashAlt = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance15, create_fragment15, safe_not_equal, {});
+ }
+};
+var FaRegTrashAlt_default = FaRegTrashAlt;
+
+// src/Components/UserHierarchies.svelte
+function add_css11(target) {
+ append_styles(target, "svelte-1e9on6f", "label.BC-Arrow-Label.svelte-1e9on6f.svelte-1e9on6f{display:inline-block;width:20px !important}div.BC-Buttons.svelte-1e9on6f.svelte-1e9on6f{padding-bottom:5px}details.BC-Hier-Details.svelte-1e9on6f.svelte-1e9on6f{border:1px solid var(--background-modifier-border);border-radius:10px;padding:10px 5px 10px 10px;margin-bottom:15px}.BC-Hier-Details.svelte-1e9on6f summary.svelte-1e9on6f::marker{font-size:10px}.BC-Hier-Details.svelte-1e9on6f summary button.svelte-1e9on6f{float:right}.icon.svelte-1e9on6f.svelte-1e9on6f{color:var(--text-normal);display:inline-block;padding-top:3px;width:17px;height:17px}");
+}
+function get_each_context6(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[13] = list[i];
+ child_ctx[15] = i;
+ return child_ctx;
+}
+function get_each_context_15(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[16] = list[i];
+ return child_ctx;
+}
+function create_each_block_15(ctx) {
+ let div;
+ let label;
+ let t0_value = ARROW_DIRECTIONS[
+ /*dir*/
+ ctx[16]
+ ] + "";
+ let t0;
+ let label_for_value;
+ let t1;
+ let input;
+ let input_name_value;
+ let input_value_value;
+ let mounted;
+ let dispose;
+ function change_handler(...args) {
+ return (
+ /*change_handler*/
+ ctx[11](
+ /*i*/
+ ctx[15],
+ /*dir*/
+ ctx[16],
+ ...args
+ )
+ );
+ }
+ return {
+ c() {
+ var _a, _b;
+ div = element("div");
+ label = element("label");
+ t0 = text(t0_value);
+ t1 = space();
+ input = element("input");
+ attr(label, "class", "BC-Arrow-Label svelte-1e9on6f");
+ attr(label, "for", label_for_value = /*dir*/
+ ctx[16]);
+ attr(input, "type", "text");
+ attr(input, "size", "20");
+ attr(input, "name", input_name_value = /*dir*/
+ ctx[16]);
+ input.value = input_value_value = /*hier*/
+ (_b = (_a = ctx[13][
+ /*dir*/
+ ctx[16]
+ ]) == null ? void 0 : _a.join(", ")) != null ? _b : "";
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ append(div, label);
+ append(label, t0);
+ append(div, t1);
+ append(div, input);
+ if (!mounted) {
+ dispose = listen(input, "change", change_handler);
+ mounted = true;
+ }
+ },
+ p(new_ctx, dirty) {
+ var _a, _b;
+ ctx = new_ctx;
+ if (dirty & /*currHiers*/
+ 2 && input_value_value !== (input_value_value = /*hier*/
+ (_b = (_a = ctx[13][
+ /*dir*/
+ ctx[16]
+ ]) == null ? void 0 : _a.join(", ")) != null ? _b : "") && input.value !== input_value_value) {
+ input.value = input_value_value;
+ }
+ },
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ mounted = false;
+ dispose();
+ }
+ };
+}
+function create_each_block6(ctx) {
+ let details2;
+ let summary;
+ let t0_value = DIRECTIONS.map(func).map(func_1).join(" ") + "";
+ let t0;
+ let t1;
+ let span;
+ let button0;
+ let t3;
+ let button1;
+ let t5;
+ let button2;
+ let t7;
+ let t8;
+ let mounted;
+ let dispose;
+ function func(...args) {
+ return (
+ /*func*/
+ ctx[7](
+ /*hier*/
+ ctx[13],
+ ...args
+ )
+ );
+ }
+ function click_handler_3() {
+ return (
+ /*click_handler_3*/
+ ctx[8](
+ /*i*/
+ ctx[15]
+ )
+ );
+ }
+ function click_handler_4() {
+ return (
+ /*click_handler_4*/
+ ctx[9](
+ /*i*/
+ ctx[15]
+ )
+ );
+ }
+ function click_handler_5() {
+ return (
+ /*click_handler_5*/
+ ctx[10](
+ /*i*/
+ ctx[15]
+ )
+ );
+ }
+ let each_value_1 = DIRECTIONS;
+ let each_blocks = [];
+ for (let i = 0; i < each_value_1.length; i += 1) {
+ each_blocks[i] = create_each_block_15(get_each_context_15(ctx, each_value_1, i));
+ }
+ return {
+ c() {
+ details2 = element("details");
+ summary = element("summary");
+ t0 = text(t0_value);
+ t1 = space();
+ span = element("span");
+ button0 = element("button");
+ button0.textContent = "\u2191";
+ t3 = space();
+ button1 = element("button");
+ button1.textContent = "\u2193";
+ t5 = space();
+ button2 = element("button");
+ button2.textContent = "X";
+ t7 = space();
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ t8 = space();
+ attr(button0, "aria-label", "Swap with Hierarchy Above");
+ attr(button0, "class", "svelte-1e9on6f");
+ attr(button1, "aria-label", "Swap with Hierarchy Below");
+ attr(button1, "class", "svelte-1e9on6f");
+ attr(button2, "aria-label", "Remove Hierarchy");
+ attr(button2, "class", "svelte-1e9on6f");
+ attr(span, "class", "BC-Buttons");
+ attr(summary, "class", "svelte-1e9on6f");
+ attr(details2, "class", "BC-Hier-Details svelte-1e9on6f");
+ },
+ m(target, anchor) {
+ insert(target, details2, anchor);
+ append(details2, summary);
+ append(summary, t0);
+ append(summary, t1);
+ append(summary, span);
+ append(span, button0);
+ append(span, t3);
+ append(span, button1);
+ append(span, t5);
+ append(span, button2);
+ append(details2, t7);
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ if (each_blocks[i]) {
+ each_blocks[i].m(details2, null);
+ }
+ }
+ append(details2, t8);
+ if (!mounted) {
+ dispose = [
+ listen(button0, "click", click_handler_3),
+ listen(button1, "click", click_handler_4),
+ listen(button2, "click", click_handler_5)
+ ];
+ mounted = true;
+ }
+ },
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
+ if (dirty & /*currHiers*/
+ 2 && t0_value !== (t0_value = DIRECTIONS.map(func).map(func_1).join(" ") + ""))
+ set_data(t0, t0_value);
+ if (dirty & /*DIRECTIONS, currHiers, splitAndTrim, update, settings, plugin, ARROW_DIRECTIONS*/
+ 15) {
+ each_value_1 = DIRECTIONS;
+ let i;
+ for (i = 0; i < each_value_1.length; i += 1) {
+ const child_ctx = get_each_context_15(ctx, each_value_1, i);
+ if (each_blocks[i]) {
+ each_blocks[i].p(child_ctx, dirty);
+ } else {
+ each_blocks[i] = create_each_block_15(child_ctx);
+ each_blocks[i].c();
+ each_blocks[i].m(details2, t8);
+ }
+ }
+ for (; i < each_blocks.length; i += 1) {
+ each_blocks[i].d(1);
+ }
+ each_blocks.length = each_value_1.length;
+ }
+ },
+ d(detaching) {
+ if (detaching)
+ detach(details2);
+ destroy_each(each_blocks, detaching);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function create_fragment16(ctx) {
+ let div4;
+ let div3;
+ let button0;
+ let div0;
+ let faplus;
+ let t0;
+ let button1;
+ let div1;
+ let faregtrashalt;
+ let t1;
+ let button2;
+ let div2;
+ let falistul;
+ let t2;
+ let current;
+ let mounted;
+ let dispose;
+ faplus = new FaPlus_default({});
+ faregtrashalt = new FaRegTrashAlt_default({});
+ falistul = new FaListUl_default({});
+ let each_value = (
+ /*currHiers*/
+ ctx[1]
+ );
+ 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));
+ }
+ return {
+ c() {
+ div4 = element("div");
+ div3 = element("div");
+ button0 = element("button");
+ div0 = element("div");
+ create_component(faplus.$$.fragment);
+ t0 = space();
+ button1 = element("button");
+ div1 = element("div");
+ create_component(faregtrashalt.$$.fragment);
+ t1 = space();
+ button2 = element("button");
+ div2 = element("div");
+ create_component(falistul.$$.fragment);
+ t2 = space();
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ attr(div0, "class", "icon svelte-1e9on6f");
+ attr(button0, "aria-label", "Add New Hierarchy");
+ attr(div1, "class", "icon svelte-1e9on6f");
+ attr(button1, "aria-label", "Reset All Hierarchies");
+ attr(div2, "class", "icon svelte-1e9on6f");
+ attr(button2, "aria-label", "Show Hierarchies");
+ attr(div3, "class", "BC-Buttons svelte-1e9on6f");
+ },
+ m(target, anchor) {
+ insert(target, div4, anchor);
+ append(div4, div3);
+ append(div3, button0);
+ append(button0, div0);
+ mount_component(faplus, div0, null);
+ append(div3, t0);
+ append(div3, button1);
+ append(button1, div1);
+ mount_component(faregtrashalt, div1, null);
+ append(div3, t1);
+ append(div3, button2);
+ append(button2, div2);
+ mount_component(falistul, div2, null);
+ append(div4, t2);
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ if (each_blocks[i]) {
+ each_blocks[i].m(div4, null);
+ }
+ }
+ current = true;
+ if (!mounted) {
+ dispose = [
+ listen(
+ button0,
+ "click",
+ /*click_handler*/
+ ctx[4]
+ ),
+ listen(
+ button1,
+ "click",
+ /*click_handler_1*/
+ ctx[5]
+ ),
+ listen(
+ button2,
+ "click",
+ /*click_handler_2*/
+ ctx[6]
+ )
+ ];
+ mounted = true;
+ }
+ },
+ p(ctx2, [dirty]) {
+ if (dirty & /*DIRECTIONS, currHiers, splitAndTrim, update, settings, plugin, ARROW_DIRECTIONS, swapItems*/
+ 15) {
+ each_value = /*currHiers*/
+ ctx2[1];
+ 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);
+ } else {
+ each_blocks[i] = create_each_block6(child_ctx);
+ each_blocks[i].c();
+ each_blocks[i].m(div4, 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(faplus.$$.fragment, local);
+ transition_in(faregtrashalt.$$.fragment, local);
+ transition_in(falistul.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(faplus.$$.fragment, local);
+ transition_out(faregtrashalt.$$.fragment, local);
+ transition_out(falistul.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ if (detaching)
+ detach(div4);
+ destroy_component(faplus);
+ destroy_component(faregtrashalt);
+ destroy_component(falistul);
+ destroy_each(each_blocks, detaching);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+var func_1 = (dirFields) => `(${dirFields})`;
+function instance16($$self, $$props, $$invalidate) {
+ var __awaiter = this && this.__awaiter || function(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());
+ });
+ };
+ ;
+ ;
+ let { plugin } = $$props;
+ const { settings } = plugin;
+ let currHiers = [...plugin.settings.userHiers];
+ function update2(currHiers2) {
+ return __awaiter(this, void 0, void 0, function* () {
+ $$invalidate(0, plugin.settings.userHiers = currHiers2, plugin);
+ yield plugin.saveSettings();
+ });
+ }
+ const click_handler = async () => $$invalidate(1, currHiers = [...currHiers, blankUserHier()]);
+ const click_handler_1 = async () => {
+ if (window.confirm("Are you sure you want to reset all hierarchies?")) {
+ $$invalidate(1, currHiers = []);
+ await update2(currHiers);
+ }
+ };
+ const click_handler_2 = () => new import_obsidian30.Notice(currHiers.map(hierToStr).join("\n\n"));
+ const func = (hier, dir) => {
+ var _a, _b;
+ return (_b = (_a = hier[dir]) == null ? void 0 : _a.join(", ")) != null ? _b : "";
+ };
+ const click_handler_3 = async (i) => {
+ $$invalidate(1, currHiers = swapItems(i, i - 1, currHiers));
+ await update2(currHiers);
+ };
+ const click_handler_4 = async (i) => {
+ $$invalidate(1, currHiers = swapItems(i, i + 1, currHiers));
+ await update2(currHiers);
+ };
+ const click_handler_5 = async (i) => {
+ const oldHier = currHiers.splice(i, 1)[0];
+ oldHier.up.forEach((upField) => {
+ const index2 = settings.limitTrailCheckboxes.indexOf(upField);
+ if (index2 > -1)
+ settings.limitTrailCheckboxes.splice(index2, 1);
+ });
+ DIRECTIONS.forEach((dir) => {
+ oldHier[dir].forEach((field) => {
+ const indexI = settings.limitJumpToFirstFields.indexOf(field);
+ if (indexI > -1)
+ settings.limitJumpToFirstFields.splice(indexI, 1);
+ const indexJ = settings.limitWriteBCCheckboxes.indexOf(field);
+ if (indexJ > -1)
+ settings.limitJumpToFirstFields.splice(indexJ, 1);
+ });
+ });
+ $$invalidate(1, currHiers);
+ await update2(currHiers);
+ };
+ const change_handler = async (i, dir, e) => {
+ const { value } = e.target;
+ const splits = splitAndTrim(value);
+ $$invalidate(1, currHiers[i][dir] = splits, currHiers);
+ await update2(currHiers);
+ splits.forEach((split) => {
+ if (dir === "up" && !settings.limitTrailCheckboxes.includes(split))
+ settings.limitTrailCheckboxes.push(split);
+ if (!settings.limitJumpToFirstFields.includes(split))
+ settings.limitJumpToFirstFields.push(split);
+ if (!settings.limitWriteBCCheckboxes.includes(split))
+ settings.limitWriteBCCheckboxes.push(split);
+ });
+ await plugin.saveSettings();
+ };
+ $$self.$$set = ($$props2) => {
+ if ("plugin" in $$props2)
+ $$invalidate(0, plugin = $$props2.plugin);
+ };
+ return [
+ plugin,
+ currHiers,
+ settings,
+ update2,
+ click_handler,
+ click_handler_1,
+ click_handler_2,
+ func,
+ click_handler_3,
+ click_handler_4,
+ click_handler_5,
+ change_handler
+ ];
+}
+var UserHierarchies = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance16, create_fragment16, safe_not_equal, { plugin: 0 }, add_css11);
+ }
+};
+var UserHierarchies_default = UserHierarchies;
+
+// src/Settings/HierarchySettings.ts
+function addHierarchySettings(plugin, containerEl) {
+ const fieldDetails = details("Hierarchies", containerEl);
+ fieldDetails.createEl("p", {
+ text: "Here you can set up different hierarchies you use in your vault. To add a new hierarchy, click the plus button. Then, fill in the field names of your hierachy into the 5 boxes that appear."
+ });
+ fieldDetails.createEl("p", {
+ text: "For each direction, you can enter multiple field names in a comma-seperated list. For example: `parent, broader, upper`"
+ });
+ new UserHierarchies_default({
+ target: fieldDetails,
+ props: { plugin }
+ });
+}
+
+// src/Components/Checkboxes.svelte
+var import_loglevel19 = __toESM(require_loglevel());
+function add_css12(target) {
+ append_styles(target, "svelte-d1my4i", ".grid.svelte-d1my4i{display:grid;grid-template-columns:repeat(auto-fit, minmax(100px, 1fr))}");
+}
+function get_each_context7(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[12] = list[i];
+ return child_ctx;
+}
+function create_each_block7(ctx) {
+ let div;
+ let label;
+ let input;
+ let input_value_value;
+ let value_has_changed = false;
+ let t0;
+ let t1_value = (
+ /*option*/
+ ctx[12] + ""
+ );
+ let t1;
+ let t2;
+ let binding_group;
+ let mounted;
+ let dispose;
+ binding_group = init_binding_group(
+ /*$$binding_groups*/
+ ctx[8][0]
+ );
+ return {
+ c() {
+ div = element("div");
+ label = element("label");
+ input = element("input");
+ t0 = space();
+ t1 = text(t1_value);
+ t2 = space();
+ attr(input, "type", "checkbox");
+ input.__value = input_value_value = /*option*/
+ ctx[12];
+ input.value = input.__value;
+ binding_group.p(input);
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ append(div, label);
+ append(label, input);
+ input.checked = ~/*selected*/
+ (ctx[1] || []).indexOf(input.__value);
+ append(label, t0);
+ append(label, t1);
+ append(div, t2);
+ if (!mounted) {
+ dispose = [
+ listen(
+ input,
+ "change",
+ /*input_change_handler*/
+ ctx[7]
+ ),
+ listen(
+ input,
+ "change",
+ /*change_handler*/
+ ctx[9]
+ )
+ ];
+ mounted = true;
+ }
+ },
+ p(ctx2, dirty) {
+ if (dirty & /*options*/
+ 1 && input_value_value !== (input_value_value = /*option*/
+ ctx2[12])) {
+ input.__value = input_value_value;
+ input.value = input.__value;
+ value_has_changed = true;
+ }
+ if (value_has_changed || dirty & /*selected, options*/
+ 3) {
+ input.checked = ~/*selected*/
+ (ctx2[1] || []).indexOf(input.__value);
+ }
+ if (dirty & /*options*/
+ 1 && t1_value !== (t1_value = /*option*/
+ ctx2[12] + ""))
+ set_data(t1, t1_value);
+ },
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ binding_group.r();
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function create_fragment17(ctx) {
+ let div0;
+ let button;
+ let t0;
+ let t1_value = (
+ /*toNone*/
+ ctx[2] ? "None" : "All"
+ );
+ let t1;
+ let t2;
+ let div1;
+ let mounted;
+ let dispose;
+ let each_value = (
+ /*options*/
+ ctx[0]
+ );
+ let each_blocks = [];
+ for (let i = 0; i < each_value.length; i += 1) {
+ each_blocks[i] = create_each_block7(get_each_context7(ctx, each_value, i));
+ }
+ return {
+ c() {
+ div0 = element("div");
+ button = element("button");
+ t0 = text("Select ");
+ t1 = text(t1_value);
+ t2 = space();
+ div1 = element("div");
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ attr(div1, "class", "grid svelte-d1my4i");
+ },
+ m(target, anchor) {
+ insert(target, div0, anchor);
+ append(div0, button);
+ append(button, t0);
+ append(button, t1);
+ insert(target, t2, anchor);
+ insert(target, div1, anchor);
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ if (each_blocks[i]) {
+ each_blocks[i].m(div1, null);
+ }
+ }
+ if (!mounted) {
+ dispose = listen(
+ button,
+ "click",
+ /*click_handler*/
+ ctx[6]
+ );
+ mounted = true;
+ }
+ },
+ p(ctx2, [dirty]) {
+ if (dirty & /*toNone*/
+ 4 && t1_value !== (t1_value = /*toNone*/
+ ctx2[2] ? "None" : "All"))
+ set_data(t1, t1_value);
+ if (dirty & /*options, selected, save*/
+ 11) {
+ each_value = /*options*/
+ ctx2[0];
+ let i;
+ for (i = 0; i < each_value.length; i += 1) {
+ const child_ctx = get_each_context7(ctx2, each_value, i);
+ if (each_blocks[i]) {
+ each_blocks[i].p(child_ctx, dirty);
+ } else {
+ each_blocks[i] = create_each_block7(child_ctx);
+ each_blocks[i].c();
+ each_blocks[i].m(div1, 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(div0);
+ if (detaching)
+ detach(t2);
+ if (detaching)
+ detach(div1);
+ destroy_each(each_blocks, detaching);
+ mounted = false;
+ dispose();
+ }
+ };
+}
+function instance17($$self, $$props, $$invalidate) {
+ let toNone;
+ var __awaiter = this && this.__awaiter || function(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());
+ });
+ };
+ ;
+ let { plugin } = $$props;
+ let { settingName } = $$props;
+ let { options } = $$props;
+ const { settings } = plugin;
+ let selected = settings[settingName];
+ function save() {
+ return __awaiter(this, void 0, void 0, function* () {
+ if (settings[settingName] === void 0)
+ return (0, import_loglevel19.warn)(settingName + " not found in BC settings");
+ settings[settingName] = selected;
+ yield plugin.saveSettings();
+ yield refreshIndex(plugin);
+ });
+ }
+ const $$binding_groups = [[]];
+ const click_handler = async () => {
+ if (toNone)
+ $$invalidate(1, selected = []);
+ else
+ $$invalidate(1, selected = options);
+ await save();
+ };
+ function input_change_handler() {
+ selected = get_binding_group_value($$binding_groups[0], this.__value, this.checked);
+ $$invalidate(1, selected);
+ }
+ const change_handler = async () => await save();
+ $$self.$$set = ($$props2) => {
+ if ("plugin" in $$props2)
+ $$invalidate(4, plugin = $$props2.plugin);
+ if ("settingName" in $$props2)
+ $$invalidate(5, settingName = $$props2.settingName);
+ if ("options" in $$props2)
+ $$invalidate(0, options = $$props2.options);
+ };
+ $$self.$$.update = () => {
+ if ($$self.$$.dirty & /*selected*/
+ 2) {
+ $:
+ $$invalidate(2, toNone = selected.length === 0 ? false : true);
+ }
+ };
+ return [
+ options,
+ selected,
+ toNone,
+ save,
+ plugin,
+ settingName,
+ click_handler,
+ input_change_handler,
+ $$binding_groups,
+ change_handler
+ ];
+}
+var Checkboxes = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance17, create_fragment17, safe_not_equal, { plugin: 4, settingName: 5, options: 0 }, add_css12);
+ }
+};
+var Checkboxes_default = Checkboxes;
+
+// src/Settings/JumpToNextSettings.ts
+function addJumpToNextSettings(plugin, viewDetails) {
+ const { settings } = plugin;
+ const jumpToDirDetails = subDetails("Jump to Next Direction", viewDetails);
+ jumpToDirDetails.createDiv({ cls: "setting-item-name", text: "Limit which fields to jump to" });
+ new Checkboxes_default({
+ target: jumpToDirDetails,
+ props: {
+ plugin,
+ settingName: "limitJumpToFirstFields",
+ options: getFields(settings.userHiers)
+ }
+ });
+}
+
+// src/Settings/MatrixViewSettings.ts
+var import_obsidian31 = require("obsidian");
+function addMatrixViewSettings(plugin, viewDetails) {
+ const { settings } = plugin;
+ const MLViewDetails = subDetails("Matrix View", viewDetails);
+ new import_obsidian31.Setting(MLViewDetails).setName("Show all field names or just relation types").setDesc(
+ fragWithHTML(
+ "Show the list of metadata fields for each relation type (e.g. parent, broader, upper), or just the name of the relation type, i.e. 'Parent', 'Sibling', 'Child'.\u2705 = show the full list."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.showNameOrType).onChange(async (value) => {
+ settings.showNameOrType = value;
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ })
+ );
+ new import_obsidian31.Setting(MLViewDetails).setName("Show Relationship Type").setDesc(
+ fragWithHTML(
+ "Show whether a link is real or implied."
+ )
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.showRelationType).onChange(async (value) => {
+ settings.showRelationType = value;
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ })
+ );
+ new import_obsidian31.Setting(MLViewDetails).setName("Directions Order").setDesc(
+ fragWithHTML(
+ `Change the order in which the directions appear in the Matrix view.The default is "up, same, down, next, prev" (01234).
+
+ 0 \u2192 up
+ 1 \u2192 same
+ 2 \u2192 down
+ 3 \u2192 next
+ 4 \u2192 prev
+
+ Note : You can remove numbers to hide those directions in the Matrix View. For example, 02 will only show up and down, in that order.`
+ )
+ ).addText((text2) => {
+ text2.setValue(settings.squareDirectionsOrder.join(""));
+ text2.inputEl.onblur = async () => {
+ const value = text2.getValue();
+ const values = value.split("");
+ if (value.length <= 5 && values.every((value2) => ["0", "1", "2", "3", "4"].includes(value2))) {
+ settings.squareDirectionsOrder = values.map(
+ (order) => Number.parseInt(order)
+ );
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ } else {
+ new import_obsidian31.Notice(
+ 'The value must be a 5 digit number using only the digits "0", "1", "2", "3", "4"'
+ );
+ }
+ };
+ });
+ new import_obsidian31.Setting(MLViewDetails).setName("Enable Alphabetical Sorting").setDesc(
+ "By default, items in the Matrix view are sorted by the order they appear in your notes. Toggle this on to enable alphabetical sorting."
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.enableAlphaSort).onChange(async (value) => {
+ settings.enableAlphaSort = value;
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ })
+ );
+ new import_obsidian31.Setting(MLViewDetails).setName("Sort Alphabetically Ascending/Descending").setDesc(
+ "Sort square items alphabetically in Ascending (\u2705) or Descending (\u274C) order."
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.alphaSortAsc).onChange(async (value) => {
+ settings.alphaSortAsc = value;
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ })
+ );
+ new import_obsidian31.Setting(MLViewDetails).setName("Sort by note name, but show alias").setDesc(
+ "When this is turned off, notes will first be sorted by their alias, and then by their name if no alias is found. Turn this on to sort by note name always, but still show the alias in the results."
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.sortByNameShowAlias).onChange(async (value) => {
+ settings.sortByNameShowAlias = value;
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ })
+ );
+ new import_obsidian31.Setting(MLViewDetails).setName("Show Implied Relations").setDesc("Whether or not to show implied relations at all.").addToggle(
+ (toggle) => toggle.setValue(settings.showImpliedRelations).onChange(async (value) => {
+ settings.showImpliedRelations = value;
+ await plugin.saveSettings();
+ await plugin.getActiveTYPEView(MATRIX_VIEW).draw();
+ })
+ );
+ new import_obsidian31.Setting(MLViewDetails).setName("Open View in Right or Left side").setDesc(
+ "When loading the matrix view, should it open on the left or right side leaf? \u2705 = Right, \u274C = Left."
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.rlLeaf).onChange(async (value) => {
+ settings.rlLeaf = value;
+ await plugin.saveSettings();
+ app.workspace.detachLeavesOfType(MATRIX_VIEW);
+ await openView(
+ MATRIX_VIEW,
+ MatrixView,
+ value ? "right" : "left"
+ );
+ })
+ );
+}
+
+// src/Settings/NoSystemSettings.ts
+var import_obsidian32 = require("obsidian");
+function addNoSystemSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const { userHiers } = settings;
+ const fields = getFields(userHiers);
+ const noSystemDetails = subDetails(
+ "Naming System",
+ alternativeHierarchyDetails
+ );
+ new import_obsidian32.Setting(noSystemDetails).setName("Naming System Regex").setDesc(
+ fragWithHTML(
+ "If you name your notes using the Johnny Decimal System or a related system, enter a regular expression matching the longest possible naming system you use. The regex should only match the naming system part of the name, not the actual note title. For example, if you use the Johnny Decimal System, you might use /^\\d\\.\\d\\.\\w/g to match the note named 1.2.a Cars.If you don't want to choose a default, select the blank option at the bottom of the list."
+ )
+ ).addText((text2) => {
+ text2.setValue(settings.namingSystemRegex);
+ text2.inputEl.onblur = async () => {
+ const value = text2.getValue();
+ if (value === "" || strToRegex(value)) {
+ settings.namingSystemRegex = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ } else {
+ new import_obsidian32.Notice("Invalid Regex");
+ }
+ };
+ });
+ new import_obsidian32.Setting(noSystemDetails).setName("Naming System Delimiter").setDesc(
+ fragWithHTML(
+ "What character do you use to split up your naming convention? For example, if you use 1.2.a.b, then your delimiter is a period (.)."
+ )
+ ).addText((text2) => {
+ text2.setValue(settings.namingSystemSplit);
+ text2.inputEl.onblur = async () => {
+ const value = text2.getValue();
+ settings.namingSystemSplit = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ };
+ });
+ new import_obsidian32.Setting(noSystemDetails).setName("Naming System Field").setDesc("Which field should Breadcrumbs use for Naming System notes?").addDropdown((dd) => {
+ fields.forEach((field) => {
+ dd.addOption(field, field);
+ });
+ dd.setValue(settings.namingSystemField);
+ dd.onChange(async (value) => {
+ settings.namingSystemField = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+ new import_obsidian32.Setting(noSystemDetails).setName("Naming System Ends with Delimiter").setDesc(
+ fragWithHTML(
+ "Does your naming convention end with the delimiter? For example, 1.2. Note does end with the delimiter, but 1.2 Note does not.For matching purposes, it is highly recommended to name your notes with the delimiter on the end. Only turn this setting on if you do name your notes this way, but know that the results may not be as accurate if you don't."
+ )
+ ).addToggle(
+ (tog) => tog.setValue(settings.namingSystemEndsWithDelimiter).onChange(async (value) => {
+ settings.namingSystemEndsWithDelimiter = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+}
+
+// src/Settings/RegexNoteSettings.ts
+var import_obsidian33 = require("obsidian");
+function addRegexNoteSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const regexNoteDetails = subDetails(
+ "Regex Notes",
+ alternativeHierarchyDetails
+ );
+ new import_obsidian33.Setting(regexNoteDetails).setName("Default Regex Note Field").setDesc(
+ fragWithHTML(
+ "By default, regex notes use the first field in your hierarchies (usually an \u2191 field). Choose a different one to use by default, without having to specify BC-regex-note-field: {field}.If you don't want to choose a default, select the blank option at the bottom of the list."
+ )
+ ).addDropdown((dd) => {
+ const options = {};
+ getFields(settings.userHiers).forEach(
+ (field) => options[field] = field
+ );
+ dd.addOptions(Object.assign(options, { "": "" })).setValue(settings.regexNoteField).onChange(async (field) => {
+ settings.regexNoteField = field;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+}
+
+// src/Settings/RelationSettings.ts
+var import_obsidian34 = require("obsidian");
+function addRelationSettings(plugin, containerEl) {
+ const { settings } = plugin;
+ const relationDetails = details("Relationships", containerEl);
+ function mermaidDiagram(diagramStr) {
+ import_obsidian34.MarkdownRenderer.renderMarkdown(
+ diagramStr,
+ relationDetails.createDiv(),
+ "",
+ null
+ );
+ }
+ relationDetails.createEl("p", {
+ text: "Here you can toggle on/off different types of implied relationships. All of your explicit (real) relationships will still show, but you can choose which implied ones get filled in.\nAll implied relationships are given a CSS class of the type of implied relation, so you can style them differently. For example `.BC-Aunt`."
+ });
+ new import_obsidian34.Setting(relationDetails).setName("Same Parent is Siblings").setDesc("If one note shares a parent with another, treat them as siblings").addToggle(
+ (tg) => tg.setValue(settings.impliedRelations.sameParentIsSibling).onChange(async (val) => {
+ settings.impliedRelations.sameParentIsSibling = val;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+ mermaidDiagram("```mermaid\nflowchart LR\nMe -->|up| Dad\nSister -->|up| Dad\nMe <-.->|same| Sister\n```");
+ new import_obsidian34.Setting(relationDetails).setName("Siblings' Siblings").setDesc("Treat your siblings' siblings as your siblings").addToggle(
+ (tg) => tg.setValue(settings.impliedRelations.siblingsSiblingIsSibling).onChange(async (val) => {
+ settings.impliedRelations.siblingsSiblingIsSibling = val;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+ mermaidDiagram("```mermaid\nflowchart LR\nMe -->|same| Sister\nMe -->|same| Brother\nSister <-.->|same| Brother\n```");
+ new import_obsidian34.Setting(relationDetails).setName("Siblings' Parent is Parent").setDesc("Your siblings' parents are your parents").addToggle(
+ (tg) => tg.setValue(settings.impliedRelations.siblingsParentIsParent).onChange(async (val) => {
+ settings.impliedRelations.siblingsParentIsParent = val;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+ mermaidDiagram("```mermaid\nflowchart LR\nSister -->|up| Dad\nSister <-->|same| Me\nMe -.->|up| Dad\n```");
+ new import_obsidian34.Setting(relationDetails).setName("Aunt/Uncle").setDesc("Treat your parent's siblings as your parents (aunts/uncles)").addToggle(
+ (tg) => tg.setValue(settings.impliedRelations.parentsSiblingsIsParents).onChange(async (val) => {
+ settings.impliedRelations.parentsSiblingsIsParents = val;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+ mermaidDiagram("```mermaid\nflowchart LR\nMe -->|up| Dad\nDad -->|same| Uncle\nMe -.->|up| Uncle\n```");
+ new import_obsidian34.Setting(relationDetails).setName("Cousins").setDesc(
+ "Treat the cousins of a note as siblings (parents' siblings' children are cousins)"
+ ).addToggle(
+ (tg) => tg.setValue(settings.impliedRelations.cousinsIsSibling).onChange(async (val) => {
+ settings.impliedRelations.cousinsIsSibling = val;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+ mermaidDiagram("```mermaid\nflowchart LR\nMe -->|up| Dad\nDad -->|same| Uncle\nUncle -->|down| Cousin\nMe <-.->|same| Cousin\n```");
+ new import_obsidian34.Setting(relationDetails).setName("Make Current Note an Implied Sibling").setDesc(
+ "Techincally, the current note is always it's own implied sibling. By default, it is not show as such. Toggle this on to make it show."
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.treatCurrNodeAsImpliedSibling).onChange(async (value) => {
+ settings.treatCurrNodeAsImpliedSibling = value;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ })
+ );
+}
+
+// src/Settings/TagNoteSettings.ts
+var import_obsidian35 = require("obsidian");
+function addTagNoteSettings(plugin, alternativeHierarchyDetails) {
+ const { settings } = plugin;
+ const tagNoteDetails = subDetails("Tag Notes", alternativeHierarchyDetails);
+ new import_obsidian35.Setting(tagNoteDetails).setName("Default Tag Note Field").setDesc(
+ fragWithHTML(
+ "By default, tag notes use the first field in your hierarchies (usually an \u2191 field). Choose a different one to use by default, without having to specify BC-tag-note-field: {field}.If you don't want to choose a default, select the blank option at the bottom of the list."
+ )
+ ).addDropdown((dd) => {
+ const options = {};
+ getFields(settings.userHiers).forEach(
+ (field) => options[field] = field
+ );
+ dd.addOptions(Object.assign(options, { "": "" })).setValue(settings.tagNoteField).onChange(async (field) => {
+ settings.tagNoteField = field;
+ await plugin.saveSettings();
+ await refreshIndex(plugin);
+ });
+ });
+}
+
+// src/Settings/ThreadingSettings.ts
+var import_obsidian36 = require("obsidian");
+function addThreadingSettings(plugin, cmdsDetails) {
+ const { settings } = plugin;
+ const threadingDetails = subDetails("Threading", cmdsDetails);
+ threadingDetails.createDiv({
+ text: "Settings for the commands `Create new from current note`"
+ });
+ new import_obsidian36.Setting(threadingDetails).setName("Open new threads in new pane or current pane").addToggle((tog) => {
+ tog.setValue(settings.threadIntoNewPane);
+ tog.onChange(async (value) => {
+ settings.threadIntoNewPane = value;
+ await plugin.saveSettings();
+ });
+ });
+ new import_obsidian36.Setting(threadingDetails).setName("Thread under Cursor").setDesc(
+ fragWithHTML(
+ "If the setting Write Breadcrumbs Inline is enabled, where should the new Breadcrumb be added to the current note? \u2705 = Under the cursor, \u274C = At the top of the note (under the yaml, if applicable)"
+ )
+ ).addToggle((tog) => {
+ tog.setValue(settings.threadUnderCursor);
+ tog.onChange(async (value) => {
+ settings.threadUnderCursor = value;
+ await plugin.saveSettings();
+ });
+ });
+ new import_obsidian36.Setting(threadingDetails).setName("New Note Name Template").setDesc(
+ fragWithHTML(
+ `When threading into a new note, choose the template for the new note name.
+ Options include:
+
+ {{field}}: the field being thread into
+ {{dir}}: the direction being thread into
+ {{current}}: the current note name
+ {{date}}: the current date (Set the format in the setting below)
+ `
+ )
+ ).addText((text2) => {
+ text2.setValue(settings.threadingTemplate);
+ text2.inputEl.onblur = async () => {
+ const value = text2.getValue();
+ if (ILLEGAL_FILENAME_CHARS.some((char) => value.includes(char))) {
+ new import_obsidian36.Notice(
+ `File name cannot contain any of these characters: ${ILLEGAL_FILENAME_CHARS.join(
+ " "
+ )}`
+ );
+ text2.setValue(settings.threadingTemplate);
+ } else {
+ settings.threadingTemplate = value;
+ await plugin.saveSettings();
+ }
+ };
+ });
+ new import_obsidian36.Setting(threadingDetails).setName("Date Format").setDesc("The date format used in the Threading Template (setting above)").addMomentFormat((format2) => {
+ format2.setDefaultFormat(DEFAULT_SETTINGS.dateFormat).setValue(settings.dateFormat).onChange(async (value) => {
+ settings.dateFormat = value;
+ await plugin.saveSettings();
+ });
+ });
+ const threadDirTemplatesSetting = new import_obsidian36.Setting(threadingDetails).setClass("thread-dir-templates").setName("Templater Template per Direction").setDesc(
+ fragWithHTML(
+ `For each direction to be thread into, choose a Templater template to insert into the new note.
+ Give the basename, or the full file path (e.g. Templates/Parent Template).`
+ )
+ );
+ DIRECTIONS.forEach(
+ (dir) => threadDirTemplatesSetting.addText((text2) => {
+ text2.setPlaceholder(ARROW_DIRECTIONS[dir]).setValue(settings.threadingDirTemplates[dir]);
+ text2.inputEl.onblur = async () => {
+ settings.threadingDirTemplates[dir] = text2.getValue();
+ await plugin.saveSettings();
+ };
+ })
+ );
+}
+
+// src/Settings/TrailSettings.ts
+var import_obsidian37 = require("obsidian");
+function addTrailViewSettings(plugin, viewDetails) {
+ const { settings } = plugin;
+ const trailDetails = subDetails("Trail/Grid/Juggl", viewDetails);
+ new import_obsidian37.Setting(trailDetails).setName("Show Breadcrumbs in Edit/Live-Preview Mode").setDesc(
+ "It always shows in preview mode, but should it also show in the other two?"
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.showBCsInEditLPMode).onChange(async (value) => {
+ settings.showBCsInEditLPMode = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ })
+ );
+ trailDetails.createEl("hr");
+ trailDetails.createDiv({
+ cls: "setting-item-name",
+ text: "Limit Trail View to only show certain fields"
+ });
+ new Checkboxes_default({
+ target: trailDetails,
+ props: {
+ plugin,
+ settingName: "limitTrailCheckboxes",
+ options: getFields(settings.userHiers, "up")
+ }
+ });
+ const viewsToShow = new import_obsidian37.Setting(trailDetails).setName("Views to show").setDesc(
+ "Choose which of the views to show at the top of the note. Juggl View requires the Juggl plugin."
+ ).addToggle((toggle) => {
+ toggle.setTooltip("Trail view").setValue(settings.showTrail).onChange(async (value) => {
+ settings.showTrail = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ });
+ }).addToggle((toggle) => {
+ toggle.setTooltip("Grid view").setValue(settings.showGrid).onChange(async (value) => {
+ settings.showGrid = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ });
+ }).addToggle((toggle) => {
+ toggle.setTooltip("Next/Previous view").setValue(settings.showPrevNext).onChange(async (value) => {
+ settings.showPrevNext = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ });
+ });
+ if (app.plugins.plugins.juggl !== void 0) {
+ viewsToShow.addToggle((toggle) => {
+ toggle.setTooltip("Juggl view").setValue(settings.showJuggl).onChange(async (value) => {
+ settings.showJuggl = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ });
+ });
+ }
+ new import_obsidian37.Setting(trailDetails).setName("Grid view depth").setDesc("Limit the initial depth of the grid view").addSlider((slider) => {
+ slider.setLimits(0, 25, 1).setValue(settings.gridDefaultDepth).setDynamicTooltip();
+ slider.sliderEl.onblur = async () => {
+ settings.gridDefaultDepth = slider.getValue();
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ };
+ });
+ new import_obsidian37.Setting(trailDetails).setName("Index Note(s)").setDesc(
+ fragWithHTML(
+ "The note that all of your other notes lead back to. The parent of all your parent notes. Just enter the basename.You can also have multiple index notes (comma-separated list).Leaving this field empty will make the trail show all paths going as far up the parent-tree as possible."
+ )
+ ).addText((text2) => {
+ text2.setPlaceholder("Index Note").setValue(settings.indexNotes.join(", "));
+ text2.inputEl.onblur = async () => {
+ const splits = splitAndTrim(text2.getValue());
+ if (splits[0] === void 0 || splits.every((index2) => isInVault(index2))) {
+ settings.indexNotes = splits;
+ await plugin.saveSettings();
+ } else
+ new import_obsidian37.Notice("Atleast one of the notes is not in your vault");
+ };
+ });
+ new import_obsidian37.Setting(trailDetails).setName("Shows all paths if none to index note are found").setDesc(
+ "If you have an index note chosen, but the trail view has no paths going up to those index notes, should it show all paths instead?"
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.showAllPathsIfNoneToIndexNote).onChange(async (value) => {
+ settings.showAllPathsIfNoneToIndexNote = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ })
+ );
+ new import_obsidian37.Setting(trailDetails).setName("Default: All, Longest, or Shortest").setDesc(
+ "If multiple paths are found going up the parent tree, which of them should show?"
+ ).addDropdown((dd) => {
+ const options = {};
+ TRAIL_LENGTHS.forEach((length) => {
+ options[length] = length;
+ });
+ dd.addOptions(options);
+ dd.setValue(settings.showAll);
+ dd.onChange(async (val) => {
+ settings.showAll = val;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ });
+ });
+ new import_obsidian37.Setting(trailDetails).setName("Seperator").setDesc(
+ fragWithHTML(
+ "The character to show between crumbs in the breadcrumb trail. The default is \u2192"
+ )
+ ).addText(
+ (text2) => text2.setPlaceholder("\u2192").setValue(settings.trailSeperator).onChange(async (value) => {
+ settings.trailSeperator = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ })
+ );
+ new import_obsidian37.Setting(trailDetails).setName("No path found message").setDesc(
+ "The text to display when no path to the index note is found, or the current note has no parent."
+ ).addText(
+ (text2) => text2.setPlaceholder("No path to index note was found").setValue(settings.noPathMessage).onChange(async (value) => {
+ settings.noPathMessage = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ })
+ );
+ new import_obsidian37.Setting(trailDetails).setName("Respect Readable Line Length").setDesc(
+ "Should the breadcrumbs trail adjust its width to the readable line length, or use as much space as possible? \u2705 = use readable line length."
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.respectReadableLineLength).onChange(async (value) => {
+ settings.respectReadableLineLength = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ })
+ );
+ new import_obsidian37.Setting(trailDetails).setName("Show up fields in Juggl").setDesc("Juggl will show both up and down fields").addToggle((toggle) => {
+ toggle.setValue(settings.showUpInJuggl).onChange(async (value) => {
+ settings.showUpInJuggl = value;
+ await plugin.saveSettings();
+ });
+ });
+ new import_obsidian37.Setting(trailDetails).setName("Juggl view layout").setDesc(
+ fragWithHTML(
+ "The layout type to use for the Juggl view. The hierarchy layout is most natural for Breadcrumbs, but for large graphs D3 Force is recommended."
+ )
+ ).addDropdown((dc) => {
+ dc.addOption("hierarchy", "Hierarchy");
+ dc.addOption("d3-force", "D3 Force");
+ dc.addOption("cola", "Cola Force");
+ dc.addOption("grid", "Grid");
+ dc.addOption("concentric", "Concentric");
+ dc.setValue(settings.jugglLayout);
+ dc.onChange(async (value) => {
+ settings.jugglLayout = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ });
+ });
+}
+
+// src/Settings/VisModalSettings.ts
+var import_obsidian38 = require("obsidian");
+function addVisModalSettings(plugin, viewDetails) {
+ const { settings } = plugin;
+ const visModalDetails = subDetails("Visualisation Modal", viewDetails);
+ new import_obsidian38.Setting(visModalDetails).setName("Default Visualisation Type").setDesc("Which visualisation to show by default").addDropdown((cb) => {
+ VISTYPES.forEach((option) => {
+ cb.addOption(option, option);
+ });
+ cb.setValue(settings.visGraph);
+ cb.onChange(async (value) => {
+ settings.visGraph = value;
+ await plugin.saveSettings();
+ });
+ });
+ new import_obsidian38.Setting(visModalDetails).setName("Default Relation").setDesc("Which relation type to show first when opening the modal").addDropdown((dd) => {
+ RELATIONS.forEach((option) => {
+ dd.addOption(option, option);
+ });
+ dd.setValue(settings.visRelation);
+ dd.onChange(async (value) => {
+ settings.visRelation = value;
+ await plugin.saveSettings();
+ });
+ });
+ new import_obsidian38.Setting(visModalDetails).setName("Default Real/Closed").setDesc("Show the real or closed graph by default").addDropdown((cb) => {
+ REAlCLOSED.forEach((option) => {
+ cb.addOption(option, option);
+ });
+ cb.setValue(settings.visClosed);
+ cb.onChange(async (value) => {
+ settings.visClosed = value;
+ await plugin.saveSettings();
+ });
+ });
+ new import_obsidian38.Setting(visModalDetails).setName("Default Unlinked").setDesc("Show all nodes or only those which have links by default").addDropdown((cb) => {
+ ALLUNLINKED.forEach((option) => {
+ cb.addOption(option, option);
+ });
+ cb.setValue(settings.visAll);
+ cb.onChange(async (value) => {
+ settings.visAll = value;
+ await plugin.saveSettings();
+ });
+ });
+}
+
+// src/Settings/WriteBCsSettings.ts
+var import_obsidian39 = require("obsidian");
+function addWriteBCsSettings(plugin, cmdsDetails) {
+ const { settings } = plugin;
+ const writeBCsToFileDetails = subDetails(
+ "Write Breadcrumbs to File",
+ cmdsDetails
+ );
+ writeBCsToFileDetails.createDiv({
+ cls: "setting-item-name",
+ text: "Limit to only write certain fields"
+ });
+ new Checkboxes_default({
+ target: writeBCsToFileDetails,
+ props: {
+ plugin,
+ options: getFields(settings.userHiers),
+ settingName: "limitWriteBCCheckboxes"
+ }
+ });
+ new import_obsidian39.Setting(writeBCsToFileDetails).setName("Write Inline").setDesc(
+ "When writing BCs to file, should they be written inline (using Dataview syntax), or into the YAML of the note?"
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.writeBCsInline).onChange(async (value) => {
+ settings.writeBCsInline = value;
+ await plugin.saveSettings();
+ })
+ );
+ new import_obsidian39.Setting(writeBCsToFileDetails).setName(
+ fragWithHTML(
+ "Show the Write Breadcrumbs to ALL Files command"
+ )
+ ).setDesc(
+ "This command attempts to update ALL files with implied breadcrumbs pointing to them. So, it is not shown by default (even though it has 3 confirmation boxes to ensure you want to run it"
+ ).addToggle(
+ (toggle) => toggle.setValue(settings.showWriteAllBCsCmd).onChange(async (value) => {
+ settings.showWriteAllBCsCmd = value;
+ await plugin.saveSettings();
+ })
+ );
+}
+
+// src/Settings/BreadcrumbsSettingTab.ts
+var fragWithHTML = (html) => createFragment((frag) => frag.createDiv().innerHTML = html);
+var details = (text2, parent) => parent.createEl("details", {}, (d) => d.createEl("summary", { text: text2 }));
+var subDetails = (text2, parent) => parent.createDiv({
+ attr: { style: "padding-left: 10px;" }
+}).createEl("details", {}, (d) => d.createEl("summary", { text: text2 }));
+var BCSettingTab = class extends import_obsidian40.PluginSettingTab {
+ constructor(plugin) {
+ super(app, plugin);
+ this.plugin = plugin;
+ }
+ async display() {
+ const { plugin, containerEl } = this;
+ const { settings } = plugin;
+ containerEl.empty();
+ containerEl.createEl("h2", { text: "Breadcrumbs Settings" });
+ containerEl.addClass("BC-settings-tab");
+ addHierarchySettings(plugin, containerEl);
+ addRelationSettings(plugin, containerEl);
+ addGeneralSettings(plugin, containerEl);
+ const viewDetails = details("Views", containerEl);
+ new import_obsidian40.Setting(viewDetails).setName("Open Views by Default").setDesc(fragWithHTML("Choose which of the views to open onload Order is: Trail/Grid/Juggl, Matrix, Ducks, Tree")).addToggle(
+ (toggle) => toggle.setTooltip("Trail/Grid/Juggl").setValue(settings.showBCs).onChange(async (value) => {
+ settings.showBCs = value;
+ await plugin.saveSettings();
+ await drawTrail(plugin);
+ })
+ ).addToggle((toggle) => {
+ toggle.setTooltip("Matrix View").setValue(settings.openMatrixOnLoad).onChange(async (value) => {
+ settings.openMatrixOnLoad = value;
+ await plugin.saveSettings();
+ });
+ }).addToggle((toggle) => {
+ toggle.setTooltip("Ducks View").setValue(settings.openDuckOnLoad).onChange(async (value) => {
+ settings.openDuckOnLoad = value;
+ await plugin.saveSettings();
+ });
+ }).addToggle((toggle) => {
+ toggle.setTooltip("Tree View").setValue(settings.openDownOnLoad).onChange(async (value) => {
+ settings.openDownOnLoad = value;
+ await plugin.saveSettings();
+ });
+ });
+ viewDetails.createEl("hr");
+ addMatrixViewSettings(plugin, viewDetails);
+ addTrailViewSettings(plugin, viewDetails);
+ addVisModalSettings(plugin, viewDetails);
+ const alternativeHierarchyDetails = details(
+ "Alternative Hierarchies",
+ containerEl
+ );
+ addTagNoteSettings(plugin, alternativeHierarchyDetails);
+ addRegexNoteSettings(plugin, alternativeHierarchyDetails);
+ addNoSystemSettings(plugin, alternativeHierarchyDetails);
+ addHierarchyNoteSettings(plugin, alternativeHierarchyDetails);
+ addCSVSettings(plugin, alternativeHierarchyDetails);
+ addDendronSettings(plugin, alternativeHierarchyDetails);
+ addDataviewSettings(plugin, alternativeHierarchyDetails);
+ addDateNoteSettings(plugin, alternativeHierarchyDetails);
+ const cmdsDetails = details("Commands", containerEl);
+ addWriteBCsSettings(plugin, cmdsDetails);
+ addCreateIndexSettings(plugin, cmdsDetails);
+ addThreadingSettings(plugin, cmdsDetails);
+ addJumpToNextSettings(plugin, cmdsDetails);
+ addDebuggingsSettings(plugin, containerEl);
+ new KoFi_default({ target: containerEl });
+ }
+};
+
+// src/Views/DucksView.ts
+var import_obsidian41 = require("obsidian");
+
+// node_modules/svelte-icons/fa/FaInfo.svelte
+function create_default_slot4(ctx) {
+ let path2;
+ return {
+ c() {
+ path2 = svg_element("path");
+ attr(path2, "d", "M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z");
+ },
+ m(target, anchor) {
+ insert(target, path2, anchor);
+ },
+ p: noop,
+ d(detaching) {
+ if (detaching)
+ detach(path2);
+ }
+ };
+}
+function create_fragment18(ctx) {
+ let iconbase;
+ let current;
+ const iconbase_spread_levels = [
+ { viewBox: "0 0 192 512" },
+ /*$$props*/
+ ctx[0]
+ ];
+ let iconbase_props = {
+ $$slots: { default: [create_default_slot4] },
+ $$scope: { ctx }
+ };
+ for (let i = 0; i < iconbase_spread_levels.length; i += 1) {
+ iconbase_props = assign(iconbase_props, iconbase_spread_levels[i]);
+ }
+ iconbase = new IconBase_default({ props: iconbase_props });
+ return {
+ c() {
+ create_component(iconbase.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(iconbase, target, anchor);
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ const iconbase_changes = dirty & /*$$props*/
+ 1 ? get_spread_update(iconbase_spread_levels, [iconbase_spread_levels[0], get_spread_object(
+ /*$$props*/
+ ctx2[0]
+ )]) : {};
+ if (dirty & /*$$scope*/
+ 2) {
+ iconbase_changes.$$scope = { dirty, ctx: ctx2 };
+ }
+ iconbase.$set(iconbase_changes);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(iconbase.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(iconbase.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(iconbase, detaching);
+ }
+ };
+}
+function instance18($$self, $$props, $$invalidate) {
+ $$self.$$set = ($$new_props) => {
+ $$invalidate(0, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
+ };
+ $$props = exclude_internal_props($$props);
+ return [$$props];
+}
+var FaInfo = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance18, create_fragment18, safe_not_equal, {});
+ }
+};
+var FaInfo_default = FaInfo;
+
+// src/Components/Ducks.svelte
+function add_css13(target) {
+ append_styles(target, "svelte-gmdm3a", ".icon.svelte-gmdm3a{color:var(--text-normal);display:inline-block;padding-top:5px !important;width:20px;height:20px}");
+}
+function get_each_context8(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[13] = list[i];
+ return child_ctx;
+}
+function create_each_block8(ctx) {
+ let div;
+ let a2;
+ let t0_value = (
+ /*duck*/
+ ctx[13] + ""
+ );
+ let t0;
+ let t1;
+ let mounted;
+ let dispose;
+ function click_handler(...args) {
+ return (
+ /*click_handler*/
+ ctx[8](
+ /*duck*/
+ ctx[13],
+ ...args
+ )
+ );
+ }
+ function mouseover_handler(...args) {
+ return (
+ /*mouseover_handler*/
+ ctx[9](
+ /*duck*/
+ ctx[13],
+ ...args
+ )
+ );
+ }
+ return {
+ c() {
+ div = element("div");
+ a2 = element("a");
+ t0 = text(t0_value);
+ t1 = space();
+ attr(a2, "class", "internal-link");
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ append(div, a2);
+ append(a2, t0);
+ append(div, t1);
+ if (!mounted) {
+ dispose = [
+ listen(div, "click", click_handler),
+ listen(div, "mouseover", mouseover_handler)
+ ];
+ mounted = true;
+ }
+ },
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
+ if (dirty & /*ducks*/
+ 8 && t0_value !== (t0_value = /*duck*/
+ ctx[13] + ""))
+ set_data(t0, t0_value);
+ },
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function create_fragment19(ctx) {
+ let div;
+ let h6;
+ let t1;
+ let span;
+ let fainfo;
+ let span_aria_label_value;
+ let t2;
+ let label;
+ let t3;
+ let input0;
+ let t4;
+ let input1;
+ let t5;
+ let current;
+ let mounted;
+ let dispose;
+ fainfo = new FaInfo_default({});
+ let each_value = (
+ /*ducks*/
+ ctx[3]
+ );
+ let each_blocks = [];
+ for (let i = 0; i < each_value.length; i += 1) {
+ each_blocks[i] = create_each_block8(get_each_context8(ctx, each_value, i));
+ }
+ return {
+ c() {
+ div = element("div");
+ h6 = element("h6");
+ h6.textContent = "Notes without Breadcrumbs";
+ t1 = space();
+ span = element("span");
+ create_component(fainfo.$$.fragment);
+ t2 = space();
+ label = element("label");
+ t3 = text("Filter:\n ");
+ input0 = element("input");
+ t4 = space();
+ input1 = element("input");
+ t5 = space();
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ attr(span, "class", "icon svelte-gmdm3a");
+ attr(span, "aria-label", span_aria_label_value = `A Regex used to filter the results.
+If 'Include' is checked, it will only show notes that match the regex.
+If 'Include' is not checked, this regex will filter out notes that match it.`);
+ attr(input0, "type", "text");
+ attr(input0, "placeholder", "Regex");
+ attr(input1, "aria-label", "Include");
+ attr(input1, "type", "checkbox");
+ attr(div, "class", "BC-Ducks markdown-preview-view");
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ append(div, h6);
+ append(div, t1);
+ append(div, span);
+ mount_component(fainfo, span, null);
+ append(div, t2);
+ append(div, label);
+ append(label, t3);
+ append(label, input0);
+ set_input_value(
+ input0,
+ /*query*/
+ ctx[1]
+ );
+ append(div, t4);
+ append(div, input1);
+ input1.checked = /*include*/
+ ctx[2];
+ append(div, t5);
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ if (each_blocks[i]) {
+ each_blocks[i].m(div, null);
+ }
+ }
+ current = true;
+ if (!mounted) {
+ dispose = [
+ listen(
+ input0,
+ "input",
+ /*input0_input_handler*/
+ ctx[6]
+ ),
+ listen(
+ input1,
+ "change",
+ /*input1_change_handler*/
+ ctx[7]
+ )
+ ];
+ mounted = true;
+ }
+ },
+ p(ctx2, [dirty]) {
+ if (dirty & /*query*/
+ 2 && input0.value !== /*query*/
+ ctx2[1]) {
+ set_input_value(
+ input0,
+ /*query*/
+ ctx2[1]
+ );
+ }
+ if (dirty & /*include*/
+ 4) {
+ input1.checked = /*include*/
+ ctx2[2];
+ }
+ if (dirty & /*openOrSwitch, ducks, hoverPreview, ducksView*/
+ 9) {
+ each_value = /*ducks*/
+ ctx2[3];
+ let i;
+ for (i = 0; i < each_value.length; i += 1) {
+ const child_ctx = get_each_context8(ctx2, each_value, i);
+ if (each_blocks[i]) {
+ each_blocks[i].p(child_ctx, dirty);
+ } else {
+ each_blocks[i] = create_each_block8(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(fainfo.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(fainfo.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ destroy_component(fainfo);
+ destroy_each(each_blocks, detaching);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function instance19($$self, $$props, $$invalidate) {
+ let ducks;
+ ;
+ ;
+ let { plugin } = $$props;
+ let { ducksView } = $$props;
+ const { mainG } = plugin;
+ const files = app.vault.getMarkdownFiles();
+ let query = "";
+ let regex = new RegExp(query, "g");
+ let include = true;
+ const getDucks = (regex2) => {
+ if (!regex2)
+ return;
+ return files.map((file) => file.basename).filter((name) => !mainG.neighbors(name).length && include === regex2.test(name));
+ };
+ function input0_input_handler() {
+ query = this.value;
+ $$invalidate(1, query);
+ }
+ function input1_change_handler() {
+ include = this.checked;
+ $$invalidate(2, include);
+ }
+ const click_handler = async (duck, e) => await openOrSwitch(duck, e);
+ const mouseover_handler = (duck, e) => hoverPreview(e, ducksView, duck);
+ $$self.$$set = ($$props2) => {
+ if ("plugin" in $$props2)
+ $$invalidate(4, plugin = $$props2.plugin);
+ if ("ducksView" in $$props2)
+ $$invalidate(0, ducksView = $$props2.ducksView);
+ };
+ $$self.$$.update = () => {
+ if ($$self.$$.dirty & /*query*/
+ 2) {
+ $: {
+ try {
+ const newReg = new RegExp(query, "g");
+ $$invalidate(5, regex = newReg);
+ } catch (e) {
+ }
+ }
+ }
+ if ($$self.$$.dirty & /*regex*/
+ 32) {
+ $:
+ $$invalidate(3, ducks = getDucks(regex));
+ }
+ };
+ return [
+ ducksView,
+ query,
+ include,
+ ducks,
+ plugin,
+ regex,
+ input0_input_handler,
+ input1_change_handler,
+ click_handler,
+ mouseover_handler
+ ];
+}
+var Ducks = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance19, create_fragment19, safe_not_equal, { plugin: 4, ducksView: 0 }, add_css13);
+ }
+};
+var Ducks_default = Ducks;
+
+// src/Views/DucksView.ts
+var DucksView = class extends import_obsidian41.ItemView {
+ constructor(leaf, plugin) {
+ super(leaf);
+ // TODO Duck icon
+ this.icon = DUCK_ICON;
+ this.plugin = plugin;
+ }
+ async onload() {
+ super.onload();
+ await this.plugin.saveSettings();
+ app.workspace.onLayoutReady(async () => {
+ await this.draw();
+ });
+ }
+ getViewType() {
+ return DUCK_VIEW;
+ }
+ getDisplayText() {
+ return "Breadcrumbs Ducks";
+ }
+ async onOpen() {
+ }
+ onClose() {
+ var _a;
+ (_a = this.view) == null ? void 0 : _a.$destroy();
+ return Promise.resolve();
+ }
+ async draw() {
+ this.contentEl.empty();
+ this.view = new Ducks_default({
+ target: this.contentEl,
+ props: { plugin: this.plugin, ducksView: this }
+ });
+ }
+};
+
+// src/Views/TreeView.ts
+var import_obsidian42 = require("obsidian");
+
+// src/Components/SideTree.svelte
+var import_loglevel20 = __toESM(require_loglevel());
+
+// node_modules/svelte-icons/fa/FaFire.svelte
+function create_default_slot5(ctx) {
+ let path2;
+ return {
+ c() {
+ path2 = svg_element("path");
+ attr(path2, "d", "M216 23.86c0-23.8-30.65-32.77-44.15-13.04C48 191.85 224 200 224 288c0 35.63-29.11 64.46-64.85 63.99-35.17-.45-63.15-29.77-63.15-64.94v-85.51c0-21.7-26.47-32.23-41.43-16.5C27.8 213.16 0 261.33 0 320c0 105.87 86.13 192 192 192s192-86.13 192-192c0-170.29-168-193-168-296.14z");
+ },
+ m(target, anchor) {
+ insert(target, path2, anchor);
+ },
+ p: noop,
+ d(detaching) {
+ if (detaching)
+ detach(path2);
+ }
+ };
+}
+function create_fragment20(ctx) {
+ let iconbase;
+ let current;
+ const iconbase_spread_levels = [
+ { viewBox: "0 0 384 512" },
+ /*$$props*/
+ ctx[0]
+ ];
+ let iconbase_props = {
+ $$slots: { default: [create_default_slot5] },
+ $$scope: { ctx }
+ };
+ for (let i = 0; i < iconbase_spread_levels.length; i += 1) {
+ iconbase_props = assign(iconbase_props, iconbase_spread_levels[i]);
+ }
+ iconbase = new IconBase_default({ props: iconbase_props });
+ return {
+ c() {
+ create_component(iconbase.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(iconbase, target, anchor);
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ const iconbase_changes = dirty & /*$$props*/
+ 1 ? get_spread_update(iconbase_spread_levels, [iconbase_spread_levels[0], get_spread_object(
+ /*$$props*/
+ ctx2[0]
+ )]) : {};
+ if (dirty & /*$$scope*/
+ 2) {
+ iconbase_changes.$$scope = { dirty, ctx: ctx2 };
+ }
+ iconbase.$set(iconbase_changes);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(iconbase.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(iconbase.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(iconbase, detaching);
+ }
+ };
+}
+function instance20($$self, $$props, $$invalidate) {
+ $$self.$$set = ($$new_props) => {
+ $$invalidate(0, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
+ };
+ $$props = exclude_internal_props($$props);
+ return [$$props];
+}
+var FaFire = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance20, create_fragment20, safe_not_equal, {});
+ }
+};
+var FaFire_default = FaFire;
+
+// node_modules/svelte-icons/fa/FaRegSnowflake.svelte
+function create_default_slot6(ctx) {
+ let path2;
+ return {
+ c() {
+ path2 = svg_element("path");
+ attr(path2, "d", "M440.1 355.2l-39.2-23 34.1-9.3c8.4-2.3 13.4-11.1 11.1-19.6l-4.1-15.5c-2.2-8.5-10.9-13.6-19.3-11.3L343 298.2 271.2 256l71.9-42.2 79.7 21.7c8.4 2.3 17-2.8 19.3-11.3l4.1-15.5c2.2-8.5-2.7-17.3-11.1-19.6l-34.1-9.3 39.2-23c7.5-4.4 10.1-14.2 5.8-21.9l-7.9-13.9c-4.3-7.7-14-10.3-21.5-5.9l-39.2 23 9.1-34.7c2.2-8.5-2.7-17.3-11.1-19.6l-15.2-4.1c-8.4-2.3-17 2.8-19.3 11.3l-21.3 81-71.9 42.2v-84.5L306 70.4c6.1-6.2 6.1-16.4 0-22.6l-11.1-11.3c-6.1-6.2-16.1-6.2-22.2 0l-24.9 25.4V16c0-8.8-7-16-15.7-16h-15.7c-8.7 0-15.7 7.2-15.7 16v46.1l-24.9-25.4c-6.1-6.2-16.1-6.2-22.2 0L142.1 48c-6.1 6.2-6.1 16.4 0 22.6l58.3 59.3v84.5l-71.9-42.2-21.3-81c-2.2-8.5-10.9-13.6-19.3-11.3L72.7 84c-8.4 2.3-13.4 11.1-11.1 19.6l9.1 34.7-39.2-23c-7.5-4.4-17.1-1.8-21.5 5.9l-7.9 13.9c-4.3 7.7-1.8 17.4 5.8 21.9l39.2 23-34.1 9.1c-8.4 2.3-13.4 11.1-11.1 19.6L6 224.2c2.2 8.5 10.9 13.6 19.3 11.3l79.7-21.7 71.9 42.2-71.9 42.2-79.7-21.7c-8.4-2.3-17 2.8-19.3 11.3l-4.1 15.5c-2.2 8.5 2.7 17.3 11.1 19.6l34.1 9.3-39.2 23c-7.5 4.4-10.1 14.2-5.8 21.9L10 391c4.3 7.7 14 10.3 21.5 5.9l39.2-23-9.1 34.7c-2.2 8.5 2.7 17.3 11.1 19.6l15.2 4.1c8.4 2.3 17-2.8 19.3-11.3l21.3-81 71.9-42.2v84.5l-58.3 59.3c-6.1 6.2-6.1 16.4 0 22.6l11.1 11.3c6.1 6.2 16.1 6.2 22.2 0l24.9-25.4V496c0 8.8 7 16 15.7 16h15.7c8.7 0 15.7-7.2 15.7-16v-46.1l24.9 25.4c6.1 6.2 16.1 6.2 22.2 0l11.1-11.3c6.1-6.2 6.1-16.4 0-22.6l-58.3-59.3v-84.5l71.9 42.2 21.3 81c2.2 8.5 10.9 13.6 19.3 11.3L375 428c8.4-2.3 13.4-11.1 11.1-19.6l-9.1-34.7 39.2 23c7.5 4.4 17.1 1.8 21.5-5.9l7.9-13.9c4.6-7.5 2.1-17.3-5.5-21.7z");
+ },
+ m(target, anchor) {
+ insert(target, path2, anchor);
+ },
+ p: noop,
+ d(detaching) {
+ if (detaching)
+ detach(path2);
+ }
+ };
+}
+function create_fragment21(ctx) {
+ let iconbase;
+ let current;
+ const iconbase_spread_levels = [
+ { viewBox: "0 0 448 512" },
+ /*$$props*/
+ ctx[0]
+ ];
+ let iconbase_props = {
+ $$slots: { default: [create_default_slot6] },
+ $$scope: { ctx }
+ };
+ for (let i = 0; i < iconbase_spread_levels.length; i += 1) {
+ iconbase_props = assign(iconbase_props, iconbase_spread_levels[i]);
+ }
+ iconbase = new IconBase_default({ props: iconbase_props });
+ return {
+ c() {
+ create_component(iconbase.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(iconbase, target, anchor);
+ current = true;
+ },
+ p(ctx2, [dirty]) {
+ const iconbase_changes = dirty & /*$$props*/
+ 1 ? get_spread_update(iconbase_spread_levels, [iconbase_spread_levels[0], get_spread_object(
+ /*$$props*/
+ ctx2[0]
+ )]) : {};
+ if (dirty & /*$$scope*/
+ 2) {
+ iconbase_changes.$$scope = { dirty, ctx: ctx2 };
+ }
+ iconbase.$set(iconbase_changes);
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(iconbase.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(iconbase.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(iconbase, detaching);
+ }
+ };
+}
+function instance21($$self, $$props, $$invalidate) {
+ $$self.$$set = ($$new_props) => {
+ $$invalidate(0, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
+ };
+ $$props = exclude_internal_props($$props);
+ return [$$props];
+}
+var FaRegSnowflake = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance21, create_fragment21, safe_not_equal, {});
+ }
+};
+var FaRegSnowflake_default = FaRegSnowflake;
+
+// src/Components/SideTree.svelte
+function add_css14(target) {
+ append_styles(target, "svelte-8j6nux", "button.svelte-8j6nux{display:inline;padding:1px 6px 2px 6px}.BC-downs.svelte-8j6nux{padding-left:5px}pre.svelte-8j6nux{display:inline}.is-unresolved.svelte-8j6nux{color:var(--text-muted)}.icon.svelte-8j6nux{color:var(--text-normal);display:inline-block;padding-top:5px !important;width:20px;height:20px}");
+}
+function get_each_context9(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[16] = list[i];
+ return child_ctx;
+}
+function get_each_context_16(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[19] = list[i];
+ return child_ctx;
+}
+function create_else_block4(ctx) {
+ let fafire;
+ let current;
+ fafire = new FaFire_default({});
+ return {
+ c() {
+ create_component(fafire.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(fafire, target, anchor);
+ current = true;
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(fafire.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(fafire.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(fafire, detaching);
+ }
+ };
+}
+function create_if_block_15(ctx) {
+ let faregsnowflake;
+ let current;
+ faregsnowflake = new FaRegSnowflake_default({});
+ return {
+ c() {
+ create_component(faregsnowflake.$$.fragment);
+ },
+ m(target, anchor) {
+ mount_component(faregsnowflake, target, anchor);
+ current = true;
+ },
+ i(local) {
+ if (current)
+ return;
+ transition_in(faregsnowflake.$$.fragment, local);
+ current = true;
+ },
+ o(local) {
+ transition_out(faregsnowflake.$$.fragment, local);
+ current = false;
+ },
+ d(detaching) {
+ destroy_component(faregsnowflake, detaching);
+ }
+ };
+}
+function create_each_block_16(ctx) {
+ let option;
+ let t_value = (
+ /*direction*/
+ ctx[19] + ""
+ );
+ let t;
+ let option_value_value;
+ return {
+ c() {
+ option = element("option");
+ t = text(t_value);
+ option.__value = option_value_value = /*direction*/
+ ctx[19];
+ option.value = option.__value;
+ },
+ m(target, anchor) {
+ insert(target, option, anchor);
+ append(option, t);
+ },
+ p: noop,
+ d(detaching) {
+ if (detaching)
+ detach(option);
+ }
+ };
+}
+function create_if_block8(ctx) {
+ let div;
+ let pre;
+ let t0_value = (
+ /*line*/
+ ctx[16][0] + "-"
+ );
+ let t0;
+ let t1;
+ let span;
+ let a2;
+ let t2_value = dropDendron(
+ /*line*/
+ ctx[16][1],
+ /*settings*/
+ ctx[6]
+ ) + "";
+ let t2;
+ let a_class_value;
+ let t3;
+ let mounted;
+ let dispose;
+ function click_handler_2(...args) {
+ return (
+ /*click_handler_2*/
+ ctx[10](
+ /*line*/
+ ctx[16],
+ ...args
+ )
+ );
+ }
+ function mouseover_handler(...args) {
+ return (
+ /*mouseover_handler*/
+ ctx[11](
+ /*line*/
+ ctx[16],
+ ...args
+ )
+ );
+ }
+ return {
+ c() {
+ div = element("div");
+ pre = element("pre");
+ t0 = text(t0_value);
+ t1 = space();
+ span = element("span");
+ a2 = element("a");
+ t2 = text(t2_value);
+ t3 = space();
+ attr(pre, "class", "svelte-8j6nux");
+ attr(a2, "class", a_class_value = "internal-link " + (isInVault(
+ /*line*/
+ ctx[16][1]
+ ) ? "" : "is-unresolved") + " svelte-8j6nux");
+ attr(span, "class", "internal-link");
+ },
+ m(target, anchor) {
+ insert(target, div, anchor);
+ append(div, pre);
+ append(pre, t0);
+ append(div, t1);
+ append(div, span);
+ append(span, a2);
+ append(a2, t2);
+ append(div, t3);
+ if (!mounted) {
+ dispose = [
+ listen(span, "click", click_handler_2),
+ listen(span, "mouseover", mouseover_handler)
+ ];
+ mounted = true;
+ }
+ },
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
+ if (dirty & /*lines*/
+ 32 && t0_value !== (t0_value = /*line*/
+ ctx[16][0] + "-"))
+ set_data(t0, t0_value);
+ if (dirty & /*lines*/
+ 32 && t2_value !== (t2_value = dropDendron(
+ /*line*/
+ ctx[16][1],
+ /*settings*/
+ ctx[6]
+ ) + ""))
+ set_data(t2, t2_value);
+ if (dirty & /*lines*/
+ 32 && a_class_value !== (a_class_value = "internal-link " + (isInVault(
+ /*line*/
+ ctx[16][1]
+ ) ? "" : "is-unresolved") + " svelte-8j6nux")) {
+ attr(a2, "class", a_class_value);
+ }
+ },
+ d(detaching) {
+ if (detaching)
+ detach(div);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function create_each_block9(ctx) {
+ let if_block_anchor;
+ let if_block = (
+ /*line*/
+ ctx[16].length > 1 && create_if_block8(ctx)
+ );
+ return {
+ c() {
+ if (if_block)
+ if_block.c();
+ if_block_anchor = empty();
+ },
+ m(target, anchor) {
+ if (if_block)
+ if_block.m(target, anchor);
+ insert(target, if_block_anchor, anchor);
+ },
+ p(ctx2, dirty) {
+ if (
+ /*line*/
+ ctx2[16].length > 1
+ ) {
+ if (if_block) {
+ if_block.p(ctx2, dirty);
+ } else {
+ if_block = create_if_block8(ctx2);
+ if_block.c();
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
+ }
+ } else if (if_block) {
+ if_block.d(1);
+ if_block = null;
+ }
+ },
+ d(detaching) {
+ if (if_block)
+ if_block.d(detaching);
+ if (detaching)
+ detach(if_block_anchor);
+ }
+ };
+}
+function create_fragment22(ctx) {
+ let span;
+ let current_block_type_index;
+ let if_block;
+ let span_aria_label_value;
+ let t0;
+ let button;
+ let t2;
+ let select;
+ let t3;
+ let div;
+ let current;
+ let mounted;
+ let dispose;
+ const if_block_creators = [create_if_block_15, create_else_block4];
+ const if_blocks = [];
+ function select_block_type(ctx2, dirty) {
+ if (
+ /*frozen*/
+ ctx2[4]
+ )
+ return 0;
+ return 1;
+ }
+ current_block_type_index = select_block_type(ctx, -1);
+ if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
+ let each_value_1 = DIRECTIONS;
+ let each_blocks_1 = [];
+ for (let i = 0; i < each_value_1.length; i += 1) {
+ each_blocks_1[i] = create_each_block_16(get_each_context_16(ctx, each_value_1, i));
+ }
+ let each_value = (
+ /*lines*/
+ ctx[5]
+ );
+ let each_blocks = [];
+ for (let i = 0; i < each_value.length; i += 1) {
+ each_blocks[i] = create_each_block9(get_each_context9(ctx, each_value, i));
+ }
+ return {
+ c() {
+ span = element("span");
+ if_block.c();
+ t0 = space();
+ button = element("button");
+ button.textContent = "\u21BB";
+ t2 = space();
+ select = element("select");
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
+ each_blocks_1[i].c();
+ }
+ t3 = space();
+ div = element("div");
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ attr(span, "class", "icon svelte-8j6nux");
+ attr(span, "aria-label", span_aria_label_value = /*frozen*/
+ ctx[4] ? `Frozen on: ${/*basename*/
+ ctx[3]}` : "Unfrozen");
+ attr(span, "aria-label-position", "left");
+ attr(button, "aria-label", "Refresh Stats View (also refreshes Breadcrumbs Index)");
+ attr(button, "class", "svelte-8j6nux");
+ attr(select, "class", "dropdown");
+ if (
+ /*dir*/
+ ctx[2] === void 0
+ )
+ add_render_callback(() => (
+ /*select_change_handler*/
+ ctx[9].call(select)
+ ));
+ attr(div, "class", "BC-downs svelte-8j6nux");
+ },
+ m(target, anchor) {
+ insert(target, span, anchor);
+ if_blocks[current_block_type_index].m(span, null);
+ insert(target, t0, anchor);
+ insert(target, button, anchor);
+ insert(target, t2, anchor);
+ insert(target, select, anchor);
+ for (let i = 0; i < each_blocks_1.length; i += 1) {
+ if (each_blocks_1[i]) {
+ each_blocks_1[i].m(select, null);
+ }
+ }
+ select_option(
+ select,
+ /*dir*/
+ ctx[2],
+ true
+ );
+ insert(target, t3, 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);
+ }
+ }
+ current = true;
+ if (!mounted) {
+ dispose = [
+ listen(
+ span,
+ "click",
+ /*click_handler*/
+ ctx[7]
+ ),
+ listen(
+ button,
+ "click",
+ /*click_handler_1*/
+ ctx[8]
+ ),
+ listen(
+ select,
+ "change",
+ /*select_change_handler*/
+ ctx[9]
+ )
+ ];
+ mounted = true;
+ }
+ },
+ p(ctx2, [dirty]) {
+ let previous_block_index = current_block_type_index;
+ current_block_type_index = select_block_type(ctx2, 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](ctx2);
+ if_block.c();
+ } else {
+ }
+ transition_in(if_block, 1);
+ if_block.m(span, null);
+ }
+ if (!current || dirty & /*frozen, basename*/
+ 24 && span_aria_label_value !== (span_aria_label_value = /*frozen*/
+ ctx2[4] ? `Frozen on: ${/*basename*/
+ ctx2[3]}` : "Unfrozen")) {
+ attr(span, "aria-label", span_aria_label_value);
+ }
+ if (dirty & /*DIRECTIONS*/
+ 0) {
+ each_value_1 = DIRECTIONS;
+ let i;
+ for (i = 0; i < each_value_1.length; i += 1) {
+ const child_ctx = get_each_context_16(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_16(child_ctx);
+ each_blocks_1[i].c();
+ each_blocks_1[i].m(select, 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 & /*dir, DIRECTIONS*/
+ 4) {
+ select_option(
+ select,
+ /*dir*/
+ ctx2[2]
+ );
+ }
+ if (dirty & /*openOrSwitch, lines, hoverPreview, view, isInVault, dropDendron, settings*/
+ 98) {
+ each_value = /*lines*/
+ ctx2[5];
+ let i;
+ for (i = 0; i < each_value.length; i += 1) {
+ const child_ctx = get_each_context9(ctx2, each_value, i);
+ if (each_blocks[i]) {
+ each_blocks[i].p(child_ctx, dirty);
+ } else {
+ each_blocks[i] = create_each_block9(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(if_block);
+ current = true;
+ },
+ o(local) {
+ transition_out(if_block);
+ current = false;
+ },
+ d(detaching) {
+ if (detaching)
+ detach(span);
+ if_blocks[current_block_type_index].d();
+ if (detaching)
+ detach(t0);
+ if (detaching)
+ detach(button);
+ if (detaching)
+ detach(t2);
+ if (detaching)
+ detach(select);
+ destroy_each(each_blocks_1, detaching);
+ if (detaching)
+ detach(t3);
+ if (detaching)
+ detach(div);
+ destroy_each(each_blocks, detaching);
+ mounted = false;
+ run_all(dispose);
+ }
+ };
+}
+function instance22($$self, $$props, $$invalidate) {
+ var _a;
+ ;
+ ;
+ ;
+ let { plugin } = $$props;
+ let { view } = $$props;
+ const { settings, app: app2, closedG } = plugin;
+ const { createIndexIndent } = settings;
+ let dir = "down";
+ let frozen = false;
+ let { basename } = (_a = getCurrFile()) !== null && _a !== void 0 ? _a : {};
+ plugin.registerEvent(app2.workspace.on("active-leaf-change", () => {
+ var _a2;
+ if (frozen)
+ return;
+ $$invalidate(3, basename = (_a2 = getCurrFile()) === null || _a2 === void 0 ? void 0 : _a2.basename);
+ }));
+ let lines;
+ const click_handler = () => {
+ var _a2;
+ $$invalidate(4, frozen = !frozen);
+ if (!frozen)
+ $$invalidate(3, basename = (_a2 = getCurrFile()) == null ? void 0 : _a2.basename);
+ };
+ const click_handler_1 = async () => {
+ await refreshIndex(plugin);
+ await view.draw();
+ };
+ function select_change_handler() {
+ dir = select_value(this);
+ $$invalidate(2, dir);
+ }
+ const click_handler_2 = async (line, e) => await openOrSwitch(line[1], e);
+ const mouseover_handler = (line, e) => hoverPreview(e, view, line[1]);
+ $$self.$$set = ($$props2) => {
+ if ("plugin" in $$props2)
+ $$invalidate(0, plugin = $$props2.plugin);
+ if ("view" in $$props2)
+ $$invalidate(1, view = $$props2.view);
+ };
+ $$self.$$.update = () => {
+ if ($$self.$$.dirty & /*dir, basename*/
+ 12) {
+ $: {
+ const dirG = getSubInDirs(closedG, dir);
+ const allPaths = dfsAllPaths(dirG, basename);
+ const index2 = createIndex(allPaths, false, createIndexIndent);
+ (0, import_loglevel20.info)({ allPaths, index: index2 });
+ $$invalidate(5, lines = indexToLinePairs(index2));
+ }
+ }
+ };
+ return [
+ plugin,
+ view,
+ dir,
+ basename,
+ frozen,
+ lines,
+ settings,
+ click_handler,
+ click_handler_1,
+ select_change_handler,
+ click_handler_2,
+ mouseover_handler
+ ];
+}
+var SideTree = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance22, create_fragment22, safe_not_equal, { plugin: 0, view: 1 }, add_css14);
+ }
+};
+var SideTree_default = SideTree;
+
+// src/Views/TreeView.ts
+var TreeView = class extends import_obsidian42.ItemView {
+ constructor(leaf, plugin) {
+ super(leaf);
+ this.icon = addFeatherIcon("corner-right-down");
+ this.plugin = plugin;
+ }
+ async onload() {
+ super.onload();
+ app.workspace.onLayoutReady(async () => {
+ await this.draw();
+ });
+ }
+ getViewType() {
+ return TREE_VIEW;
+ }
+ getDisplayText() {
+ return "Breadcrumbs Down";
+ }
+ async onOpen() {
+ }
+ onClose() {
+ var _a;
+ (_a = this.view) == null ? void 0 : _a.$destroy();
+ return Promise.resolve();
+ }
+ async draw() {
+ this.contentEl.empty();
+ this.view = new SideTree_default({
+ target: this.contentEl,
+ props: { plugin: this.plugin, view: this }
+ });
+ }
+};
+
+// node_modules/d3-array/src/ascending.js
+function ascending_default(a2, b) {
+ return a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
+}
+
+// node_modules/d3-array/src/bisector.js
+function bisector_default(f) {
+ let delta = f;
+ let compare = f;
+ if (f.length === 1) {
+ delta = (d, x4) => f(d) - x4;
+ compare = ascendingComparator(f);
+ }
+ function left(a2, x4, lo, hi) {
+ if (lo == null)
+ lo = 0;
+ if (hi == null)
+ hi = a2.length;
+ while (lo < hi) {
+ const mid = lo + hi >>> 1;
+ if (compare(a2[mid], x4) < 0)
+ lo = mid + 1;
+ else
+ hi = mid;
+ }
+ return lo;
+ }
+ function right(a2, x4, lo, hi) {
+ if (lo == null)
+ lo = 0;
+ if (hi == null)
+ hi = a2.length;
+ while (lo < hi) {
+ const mid = lo + hi >>> 1;
+ if (compare(a2[mid], x4) > 0)
+ hi = mid;
+ else
+ lo = mid + 1;
+ }
+ return lo;
+ }
+ function center(a2, x4, lo, hi) {
+ if (lo == null)
+ lo = 0;
+ if (hi == null)
+ hi = a2.length;
+ const i = left(a2, x4, lo, hi - 1);
+ return i > lo && delta(a2[i - 1], x4) > -delta(a2[i], x4) ? i - 1 : i;
+ }
+ return { left, center, right };
+}
+function ascendingComparator(f) {
+ return (d, x4) => ascending_default(f(d), x4);
+}
+
+// node_modules/d3-array/src/number.js
+function number_default(x4) {
+ return x4 === null ? NaN : +x4;
+}
+
+// node_modules/d3-array/src/bisect.js
+var ascendingBisect = bisector_default(ascending_default);
+var bisectRight = ascendingBisect.right;
+var bisectLeft = ascendingBisect.left;
+var bisectCenter = bisector_default(number_default).center;
+var bisect_default = bisectRight;
+
+// node_modules/d3-array/src/ticks.js
+var e10 = Math.sqrt(50);
+var e5 = Math.sqrt(10);
+var e2 = Math.sqrt(2);
+function ticks_default(start2, stop, count2) {
+ var reverse, i = -1, n2, ticks, step;
+ stop = +stop, start2 = +start2, count2 = +count2;
+ if (start2 === stop && count2 > 0)
+ return [start2];
+ if (reverse = stop < start2)
+ n2 = start2, start2 = stop, stop = n2;
+ if ((step = tickIncrement(start2, stop, count2)) === 0 || !isFinite(step))
+ return [];
+ if (step > 0) {
+ let r0 = Math.round(start2 / step), r1 = Math.round(stop / step);
+ if (r0 * step < start2)
+ ++r0;
+ if (r1 * step > stop)
+ --r1;
+ ticks = new Array(n2 = r1 - r0 + 1);
+ while (++i < n2)
+ ticks[i] = (r0 + i) * step;
+ } else {
+ step = -step;
+ let r0 = Math.round(start2 * step), r1 = Math.round(stop * step);
+ if (r0 / step < start2)
+ ++r0;
+ if (r1 / step > stop)
+ --r1;
+ ticks = new Array(n2 = r1 - r0 + 1);
+ while (++i < n2)
+ ticks[i] = (r0 + i) / step;
+ }
+ if (reverse)
+ ticks.reverse();
+ return ticks;
+}
+function tickIncrement(start2, stop, count2) {
+ var step = (stop - start2) / Math.max(0, count2), power = Math.floor(Math.log(step) / Math.LN10), error6 = step / Math.pow(10, power);
+ return power >= 0 ? (error6 >= e10 ? 10 : error6 >= e5 ? 5 : error6 >= e2 ? 2 : 1) * Math.pow(10, power) : -Math.pow(10, -power) / (error6 >= e10 ? 10 : error6 >= e5 ? 5 : error6 >= e2 ? 2 : 1);
+}
+function tickStep(start2, stop, count2) {
+ var step0 = Math.abs(stop - start2) / Math.max(0, count2), step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), error6 = step0 / step1;
+ if (error6 >= e10)
+ step1 *= 10;
+ else if (error6 >= e5)
+ step1 *= 5;
+ else if (error6 >= e2)
+ step1 *= 2;
+ return stop < start2 ? -step1 : step1;
+}
+
+// node_modules/d3-array/src/max.js
+function max(values, valueof) {
+ let max4;
+ if (valueof === void 0) {
+ for (const value of values) {
+ if (value != null && (max4 < value || max4 === void 0 && value >= value)) {
+ max4 = value;
+ }
+ }
+ } else {
+ let index2 = -1;
+ for (let value of values) {
+ if ((value = valueof(value, ++index2, values)) != null && (max4 < value || max4 === void 0 && value >= value)) {
+ max4 = value;
+ }
+ }
+ }
+ return max4;
+}
+
+// node_modules/d3-array/src/range.js
+function range_default(start2, stop, step) {
+ start2 = +start2, stop = +stop, step = (n2 = arguments.length) < 2 ? (stop = start2, start2 = 0, 1) : n2 < 3 ? 1 : +step;
+ var i = -1, n2 = Math.max(0, Math.ceil((stop - start2) / step)) | 0, range = new Array(n2);
+ while (++i < n2) {
+ range[i] = start2 + i * step;
+ }
+ return range;
+}
+
+// node_modules/d3-dispatch/src/dispatch.js
+var noop2 = { value: () => {
+} };
+function dispatch() {
+ for (var i = 0, n2 = arguments.length, _ = {}, t; i < n2; ++i) {
+ if (!(t = arguments[i] + "") || t in _ || /[\s.]/.test(t))
+ throw new Error("illegal type: " + t);
+ _[t] = [];
+ }
+ return new Dispatch(_);
+}
+function Dispatch(_) {
+ this._ = _;
+}
+function parseTypenames(typenames, types) {
+ return typenames.trim().split(/^|\s+/).map(function(t) {
+ var name = "", i = t.indexOf(".");
+ if (i >= 0)
+ name = t.slice(i + 1), t = t.slice(0, i);
+ if (t && !types.hasOwnProperty(t))
+ throw new Error("unknown type: " + t);
+ return { type: t, name };
+ });
+}
+Dispatch.prototype = dispatch.prototype = {
+ constructor: Dispatch,
+ on: function(typename, callback) {
+ var _ = this._, T = parseTypenames(typename + "", _), t, i = -1, n2 = T.length;
+ if (arguments.length < 2) {
+ while (++i < n2)
+ if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name)))
+ return t;
+ return;
+ }
+ if (callback != null && typeof callback !== "function")
+ throw new Error("invalid callback: " + callback);
+ while (++i < n2) {
+ if (t = (typename = T[i]).type)
+ _[t] = set(_[t], typename.name, callback);
+ else if (callback == null)
+ for (t in _)
+ _[t] = set(_[t], typename.name, null);
+ }
+ return this;
+ },
+ copy: function() {
+ var copy3 = {}, _ = this._;
+ for (var t in _)
+ copy3[t] = _[t].slice();
+ return new Dispatch(copy3);
+ },
+ call: function(type2, that) {
+ if ((n2 = arguments.length - 2) > 0)
+ for (var args = new Array(n2), i = 0, n2, t; i < n2; ++i)
+ args[i] = arguments[i + 2];
+ if (!this._.hasOwnProperty(type2))
+ throw new Error("unknown type: " + type2);
+ for (t = this._[type2], i = 0, n2 = t.length; i < n2; ++i)
+ t[i].value.apply(that, args);
+ },
+ apply: function(type2, that, args) {
+ if (!this._.hasOwnProperty(type2))
+ throw new Error("unknown type: " + type2);
+ for (var t = this._[type2], i = 0, n2 = t.length; i < n2; ++i)
+ t[i].value.apply(that, args);
+ }
+};
+function get(type2, name) {
+ for (var i = 0, n2 = type2.length, c3; i < n2; ++i) {
+ if ((c3 = type2[i]).name === name) {
+ return c3.value;
+ }
+ }
+}
+function set(type2, name, callback) {
+ for (var i = 0, n2 = type2.length; i < n2; ++i) {
+ if (type2[i].name === name) {
+ type2[i] = noop2, type2 = type2.slice(0, i).concat(type2.slice(i + 1));
+ break;
+ }
+ }
+ if (callback != null)
+ type2.push({ name, value: callback });
+ return type2;
+}
+var dispatch_default = dispatch;
+
+// node_modules/d3-selection/src/namespaces.js
+var xhtml = "http://www.w3.org/1999/xhtml";
+var namespaces_default = {
+ svg: "http://www.w3.org/2000/svg",
+ xhtml,
+ xlink: "http://www.w3.org/1999/xlink",
+ xml: "http://www.w3.org/XML/1998/namespace",
+ xmlns: "http://www.w3.org/2000/xmlns/"
+};
+
+// node_modules/d3-selection/src/namespace.js
+function namespace_default(name) {
+ var prefix = name += "", i = prefix.indexOf(":");
+ if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns")
+ name = name.slice(i + 1);
+ return namespaces_default.hasOwnProperty(prefix) ? { space: namespaces_default[prefix], local: name } : name;
+}
+
+// node_modules/d3-selection/src/creator.js
+function creatorInherit(name) {
+ return function() {
+ var document2 = this.ownerDocument, uri = this.namespaceURI;
+ return uri === xhtml && document2.documentElement.namespaceURI === xhtml ? document2.createElement(name) : document2.createElementNS(uri, name);
+ };
+}
+function creatorFixed(fullname) {
+ return function() {
+ return this.ownerDocument.createElementNS(fullname.space, fullname.local);
+ };
+}
+function creator_default(name) {
+ var fullname = namespace_default(name);
+ return (fullname.local ? creatorFixed : creatorInherit)(fullname);
+}
+
+// node_modules/d3-selection/src/selector.js
+function none() {
+}
+function selector_default(selector) {
+ return selector == null ? none : function() {
+ return this.querySelector(selector);
+ };
+}
+
+// node_modules/d3-selection/src/selection/select.js
+function select_default(select) {
+ if (typeof select !== "function")
+ select = selector_default(select);
+ for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = new Array(n2), node, subnode, i = 0; i < n2; ++i) {
+ if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
+ if ("__data__" in node)
+ subnode.__data__ = node.__data__;
+ subgroup[i] = subnode;
+ }
+ }
+ }
+ return new Selection(subgroups, this._parents);
+}
+
+// node_modules/d3-selection/src/array.js
+function array_default(x4) {
+ return typeof x4 === "object" && "length" in x4 ? x4 : Array.from(x4);
+}
+
+// node_modules/d3-selection/src/selectorAll.js
+function empty2() {
+ return [];
+}
+function selectorAll_default(selector) {
+ return selector == null ? empty2 : function() {
+ return this.querySelectorAll(selector);
+ };
+}
+
+// node_modules/d3-selection/src/selection/selectAll.js
+function arrayAll(select) {
+ return function() {
+ var group = select.apply(this, arguments);
+ return group == null ? [] : array_default(group);
+ };
+}
+function selectAll_default(select) {
+ if (typeof select === "function")
+ select = arrayAll(select);
+ else
+ select = selectorAll_default(select);
+ for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, node, i = 0; i < n2; ++i) {
+ if (node = group[i]) {
+ subgroups.push(select.call(node, node.__data__, i, group));
+ parents.push(node);
+ }
+ }
+ }
+ return new Selection(subgroups, parents);
+}
+
+// node_modules/d3-selection/src/matcher.js
+function matcher_default(selector) {
+ return function() {
+ return this.matches(selector);
+ };
+}
+function childMatcher(selector) {
+ return function(node) {
+ return node.matches(selector);
+ };
+}
+
+// node_modules/d3-selection/src/selection/selectChild.js
+var find = Array.prototype.find;
+function childFind(match2) {
+ return function() {
+ return find.call(this.children, match2);
+ };
+}
+function childFirst() {
+ return this.firstElementChild;
+}
+function selectChild_default(match2) {
+ return this.select(match2 == null ? childFirst : childFind(typeof match2 === "function" ? match2 : childMatcher(match2)));
+}
+
+// node_modules/d3-selection/src/selection/selectChildren.js
+var filter = Array.prototype.filter;
+function children2() {
+ return this.children;
+}
+function childrenFilter(match2) {
+ return function() {
+ return filter.call(this.children, match2);
+ };
+}
+function selectChildren_default(match2) {
+ return this.selectAll(match2 == null ? children2 : childrenFilter(typeof match2 === "function" ? match2 : childMatcher(match2)));
+}
+
+// node_modules/d3-selection/src/selection/filter.js
+function filter_default(match2) {
+ if (typeof match2 !== "function")
+ match2 = matcher_default(match2);
+ for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n2; ++i) {
+ if ((node = group[i]) && match2.call(node, node.__data__, i, group)) {
+ subgroup.push(node);
+ }
+ }
+ }
+ return new Selection(subgroups, this._parents);
+}
+
+// node_modules/d3-selection/src/selection/sparse.js
+function sparse_default(update2) {
+ return new Array(update2.length);
+}
+
+// node_modules/d3-selection/src/selection/enter.js
+function enter_default() {
+ return new Selection(this._enter || this._groups.map(sparse_default), this._parents);
+}
+function EnterNode(parent, datum2) {
+ this.ownerDocument = parent.ownerDocument;
+ this.namespaceURI = parent.namespaceURI;
+ this._next = null;
+ this._parent = parent;
+ this.__data__ = datum2;
+}
+EnterNode.prototype = {
+ constructor: EnterNode,
+ appendChild: function(child) {
+ return this._parent.insertBefore(child, this._next);
+ },
+ insertBefore: function(child, next) {
+ return this._parent.insertBefore(child, next);
+ },
+ querySelector: function(selector) {
+ return this._parent.querySelector(selector);
+ },
+ querySelectorAll: function(selector) {
+ return this._parent.querySelectorAll(selector);
+ }
+};
+
+// node_modules/d3-selection/src/constant.js
+function constant_default(x4) {
+ return function() {
+ return x4;
+ };
+}
+
+// node_modules/d3-selection/src/selection/data.js
+function bindIndex(parent, group, enter, update2, exit, data) {
+ var i = 0, node, groupLength = group.length, dataLength = data.length;
+ for (; i < dataLength; ++i) {
+ if (node = group[i]) {
+ node.__data__ = data[i];
+ update2[i] = node;
+ } else {
+ enter[i] = new EnterNode(parent, data[i]);
+ }
+ }
+ for (; i < groupLength; ++i) {
+ if (node = group[i]) {
+ exit[i] = node;
+ }
+ }
+}
+function bindKey(parent, group, enter, update2, exit, data, key) {
+ var i, node, nodeByKeyValue = /* @__PURE__ */ new Map(), groupLength = group.length, dataLength = data.length, keyValues = new Array(groupLength), keyValue;
+ for (i = 0; i < groupLength; ++i) {
+ if (node = group[i]) {
+ keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + "";
+ if (nodeByKeyValue.has(keyValue)) {
+ exit[i] = node;
+ } else {
+ nodeByKeyValue.set(keyValue, node);
+ }
+ }
+ }
+ for (i = 0; i < dataLength; ++i) {
+ keyValue = key.call(parent, data[i], i, data) + "";
+ if (node = nodeByKeyValue.get(keyValue)) {
+ update2[i] = node;
+ node.__data__ = data[i];
+ nodeByKeyValue.delete(keyValue);
+ } else {
+ enter[i] = new EnterNode(parent, data[i]);
+ }
+ }
+ for (i = 0; i < groupLength; ++i) {
+ if ((node = group[i]) && nodeByKeyValue.get(keyValues[i]) === node) {
+ exit[i] = node;
+ }
+ }
+}
+function datum(node) {
+ return node.__data__;
+}
+function data_default(value, key) {
+ if (!arguments.length)
+ return Array.from(this, datum);
+ var bind = key ? bindKey : bindIndex, parents = this._parents, groups = this._groups;
+ if (typeof value !== "function")
+ value = constant_default(value);
+ for (var m2 = groups.length, update2 = new Array(m2), enter = new Array(m2), exit = new Array(m2), j = 0; j < m2; ++j) {
+ var parent = parents[j], group = groups[j], groupLength = group.length, data = array_default(value.call(parent, parent && parent.__data__, j, parents)), dataLength = data.length, enterGroup = enter[j] = new Array(dataLength), updateGroup = update2[j] = new Array(dataLength), exitGroup = exit[j] = new Array(groupLength);
+ bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
+ for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
+ if (previous = enterGroup[i0]) {
+ if (i0 >= i1)
+ i1 = i0 + 1;
+ while (!(next = updateGroup[i1]) && ++i1 < dataLength)
+ ;
+ previous._next = next || null;
+ }
+ }
+ }
+ update2 = new Selection(update2, parents);
+ update2._enter = enter;
+ update2._exit = exit;
+ return update2;
+}
+
+// node_modules/d3-selection/src/selection/exit.js
+function exit_default() {
+ return new Selection(this._exit || this._groups.map(sparse_default), this._parents);
+}
+
+// node_modules/d3-selection/src/selection/join.js
+function join_default(onenter, onupdate, onexit) {
+ var enter = this.enter(), update2 = this, exit = this.exit();
+ enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + "");
+ if (onupdate != null)
+ update2 = onupdate(update2);
+ if (onexit == null)
+ exit.remove();
+ else
+ onexit(exit);
+ return enter && update2 ? enter.merge(update2).order() : update2;
+}
+
+// node_modules/d3-selection/src/selection/merge.js
+function merge_default(selection2) {
+ if (!(selection2 instanceof Selection))
+ throw new Error("invalid merge");
+ for (var groups0 = this._groups, groups1 = selection2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m2; ++j) {
+ for (var group0 = groups0[j], group1 = groups1[j], n2 = group0.length, merge = merges[j] = new Array(n2), node, i = 0; i < n2; ++i) {
+ if (node = group0[i] || group1[i]) {
+ merge[i] = node;
+ }
+ }
+ }
+ for (; j < m0; ++j) {
+ merges[j] = groups0[j];
+ }
+ return new Selection(merges, this._parents);
+}
+
+// node_modules/d3-selection/src/selection/order.js
+function order_default() {
+ for (var groups = this._groups, j = -1, m2 = groups.length; ++j < m2; ) {
+ for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
+ if (node = group[i]) {
+ if (next && node.compareDocumentPosition(next) ^ 4)
+ next.parentNode.insertBefore(node, next);
+ next = node;
+ }
+ }
+ }
+ return this;
+}
+
+// node_modules/d3-selection/src/selection/sort.js
+function sort_default(compare) {
+ if (!compare)
+ compare = ascending;
+ function compareNode(a2, b) {
+ return a2 && b ? compare(a2.__data__, b.__data__) : !a2 - !b;
+ }
+ for (var groups = this._groups, m2 = groups.length, sortgroups = new Array(m2), j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, sortgroup = sortgroups[j] = new Array(n2), node, i = 0; i < n2; ++i) {
+ if (node = group[i]) {
+ sortgroup[i] = node;
+ }
+ }
+ sortgroup.sort(compareNode);
+ }
+ return new Selection(sortgroups, this._parents).order();
+}
+function ascending(a2, b) {
+ return a2 < b ? -1 : a2 > b ? 1 : a2 >= b ? 0 : NaN;
+}
+
+// node_modules/d3-selection/src/selection/call.js
+function call_default() {
+ var callback = arguments[0];
+ arguments[0] = this;
+ callback.apply(null, arguments);
+ return this;
+}
+
+// node_modules/d3-selection/src/selection/nodes.js
+function nodes_default() {
+ return Array.from(this);
+}
+
+// node_modules/d3-selection/src/selection/node.js
+function node_default() {
+ for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
+ for (var group = groups[j], i = 0, n2 = group.length; i < n2; ++i) {
+ var node = group[i];
+ if (node)
+ return node;
+ }
+ }
+ return null;
+}
+
+// node_modules/d3-selection/src/selection/size.js
+function size_default() {
+ let size = 0;
+ for (const node of this)
+ ++size;
+ return size;
+}
+
+// node_modules/d3-selection/src/selection/empty.js
+function empty_default() {
+ return !this.node();
+}
+
+// node_modules/d3-selection/src/selection/each.js
+function each_default(callback) {
+ for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
+ for (var group = groups[j], i = 0, n2 = group.length, node; i < n2; ++i) {
+ if (node = group[i])
+ callback.call(node, node.__data__, i, group);
+ }
+ }
+ return this;
+}
+
+// node_modules/d3-selection/src/selection/attr.js
+function attrRemove(name) {
+ return function() {
+ this.removeAttribute(name);
+ };
+}
+function attrRemoveNS(fullname) {
+ return function() {
+ this.removeAttributeNS(fullname.space, fullname.local);
+ };
+}
+function attrConstant(name, value) {
+ return function() {
+ this.setAttribute(name, value);
+ };
+}
+function attrConstantNS(fullname, value) {
+ return function() {
+ this.setAttributeNS(fullname.space, fullname.local, value);
+ };
+}
+function attrFunction(name, value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null)
+ this.removeAttribute(name);
+ else
+ this.setAttribute(name, v);
+ };
+}
+function attrFunctionNS(fullname, value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null)
+ this.removeAttributeNS(fullname.space, fullname.local);
+ else
+ this.setAttributeNS(fullname.space, fullname.local, v);
+ };
+}
+function attr_default(name, value) {
+ var fullname = namespace_default(name);
+ if (arguments.length < 2) {
+ var node = this.node();
+ return fullname.local ? node.getAttributeNS(fullname.space, fullname.local) : node.getAttribute(fullname);
+ }
+ return this.each((value == null ? fullname.local ? attrRemoveNS : attrRemove : typeof value === "function" ? fullname.local ? attrFunctionNS : attrFunction : fullname.local ? attrConstantNS : attrConstant)(fullname, value));
+}
+
+// node_modules/d3-selection/src/window.js
+function window_default(node) {
+ return node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView;
+}
+
+// node_modules/d3-selection/src/selection/style.js
+function styleRemove(name) {
+ return function() {
+ this.style.removeProperty(name);
+ };
+}
+function styleConstant(name, value, priority) {
+ return function() {
+ this.style.setProperty(name, value, priority);
+ };
+}
+function styleFunction(name, value, priority) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null)
+ this.style.removeProperty(name);
+ else
+ this.style.setProperty(name, v, priority);
+ };
+}
+function style_default(name, value, priority) {
+ return arguments.length > 1 ? this.each((value == null ? styleRemove : typeof value === "function" ? styleFunction : styleConstant)(name, value, priority == null ? "" : priority)) : styleValue(this.node(), name);
+}
+function styleValue(node, name) {
+ return node.style.getPropertyValue(name) || window_default(node).getComputedStyle(node, null).getPropertyValue(name);
+}
+
+// node_modules/d3-selection/src/selection/property.js
+function propertyRemove(name) {
+ return function() {
+ delete this[name];
+ };
+}
+function propertyConstant(name, value) {
+ return function() {
+ this[name] = value;
+ };
+}
+function propertyFunction(name, value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null)
+ delete this[name];
+ else
+ this[name] = v;
+ };
+}
+function property_default(name, value) {
+ return arguments.length > 1 ? this.each((value == null ? propertyRemove : typeof value === "function" ? propertyFunction : propertyConstant)(name, value)) : this.node()[name];
+}
+
+// node_modules/d3-selection/src/selection/classed.js
+function classArray(string) {
+ return string.trim().split(/^|\s+/);
+}
+function classList(node) {
+ return node.classList || new ClassList(node);
+}
+function ClassList(node) {
+ this._node = node;
+ this._names = classArray(node.getAttribute("class") || "");
+}
+ClassList.prototype = {
+ add: function(name) {
+ var i = this._names.indexOf(name);
+ if (i < 0) {
+ this._names.push(name);
+ this._node.setAttribute("class", this._names.join(" "));
+ }
+ },
+ remove: function(name) {
+ var i = this._names.indexOf(name);
+ if (i >= 0) {
+ this._names.splice(i, 1);
+ this._node.setAttribute("class", this._names.join(" "));
+ }
+ },
+ contains: function(name) {
+ return this._names.indexOf(name) >= 0;
+ }
+};
+function classedAdd(node, names) {
+ var list = classList(node), i = -1, n2 = names.length;
+ while (++i < n2)
+ list.add(names[i]);
+}
+function classedRemove(node, names) {
+ var list = classList(node), i = -1, n2 = names.length;
+ while (++i < n2)
+ list.remove(names[i]);
+}
+function classedTrue(names) {
+ return function() {
+ classedAdd(this, names);
+ };
+}
+function classedFalse(names) {
+ return function() {
+ classedRemove(this, names);
+ };
+}
+function classedFunction(names, value) {
+ return function() {
+ (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
+ };
+}
+function classed_default(name, value) {
+ var names = classArray(name + "");
+ if (arguments.length < 2) {
+ var list = classList(this.node()), i = -1, n2 = names.length;
+ while (++i < n2)
+ if (!list.contains(names[i]))
+ return false;
+ return true;
+ }
+ return this.each((typeof value === "function" ? classedFunction : value ? classedTrue : classedFalse)(names, value));
+}
+
+// node_modules/d3-selection/src/selection/text.js
+function textRemove() {
+ this.textContent = "";
+}
+function textConstant(value) {
+ return function() {
+ this.textContent = value;
+ };
+}
+function textFunction(value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ this.textContent = v == null ? "" : v;
+ };
+}
+function text_default(value) {
+ return arguments.length ? this.each(value == null ? textRemove : (typeof value === "function" ? textFunction : textConstant)(value)) : this.node().textContent;
+}
+
+// node_modules/d3-selection/src/selection/html.js
+function htmlRemove() {
+ this.innerHTML = "";
+}
+function htmlConstant(value) {
+ return function() {
+ this.innerHTML = value;
+ };
+}
+function htmlFunction(value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ this.innerHTML = v == null ? "" : v;
+ };
+}
+function html_default(value) {
+ return arguments.length ? this.each(value == null ? htmlRemove : (typeof value === "function" ? htmlFunction : htmlConstant)(value)) : this.node().innerHTML;
+}
+
+// node_modules/d3-selection/src/selection/raise.js
+function raise() {
+ if (this.nextSibling)
+ this.parentNode.appendChild(this);
+}
+function raise_default() {
+ return this.each(raise);
+}
+
+// node_modules/d3-selection/src/selection/lower.js
+function lower() {
+ if (this.previousSibling)
+ this.parentNode.insertBefore(this, this.parentNode.firstChild);
+}
+function lower_default() {
+ return this.each(lower);
+}
+
+// node_modules/d3-selection/src/selection/append.js
+function append_default(name) {
+ var create2 = typeof name === "function" ? name : creator_default(name);
+ return this.select(function() {
+ return this.appendChild(create2.apply(this, arguments));
+ });
+}
+
+// node_modules/d3-selection/src/selection/insert.js
+function constantNull() {
+ return null;
+}
+function insert_default(name, before) {
+ var create2 = typeof name === "function" ? name : creator_default(name), select = before == null ? constantNull : typeof before === "function" ? before : selector_default(before);
+ return this.select(function() {
+ return this.insertBefore(create2.apply(this, arguments), select.apply(this, arguments) || null);
+ });
+}
+
+// node_modules/d3-selection/src/selection/remove.js
+function remove() {
+ var parent = this.parentNode;
+ if (parent)
+ parent.removeChild(this);
+}
+function remove_default() {
+ return this.each(remove);
+}
+
+// node_modules/d3-selection/src/selection/clone.js
+function selection_cloneShallow() {
+ var clone3 = this.cloneNode(false), parent = this.parentNode;
+ return parent ? parent.insertBefore(clone3, this.nextSibling) : clone3;
+}
+function selection_cloneDeep() {
+ var clone3 = this.cloneNode(true), parent = this.parentNode;
+ return parent ? parent.insertBefore(clone3, this.nextSibling) : clone3;
+}
+function clone_default(deep) {
+ return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
+}
+
+// node_modules/d3-selection/src/selection/datum.js
+function datum_default(value) {
+ return arguments.length ? this.property("__data__", value) : this.node().__data__;
+}
+
+// node_modules/d3-selection/src/selection/on.js
+function contextListener(listener) {
+ return function(event) {
+ listener.call(this, event, this.__data__);
+ };
+}
+function parseTypenames2(typenames) {
+ return typenames.trim().split(/^|\s+/).map(function(t) {
+ var name = "", i = t.indexOf(".");
+ if (i >= 0)
+ name = t.slice(i + 1), t = t.slice(0, i);
+ return { type: t, name };
+ });
+}
+function onRemove(typename) {
+ return function() {
+ var on = this.__on;
+ if (!on)
+ return;
+ for (var j = 0, i = -1, m2 = on.length, o; j < m2; ++j) {
+ if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
+ this.removeEventListener(o.type, o.listener, o.options);
+ } else {
+ on[++i] = o;
+ }
+ }
+ if (++i)
+ on.length = i;
+ else
+ delete this.__on;
+ };
+}
+function onAdd(typename, value, options) {
+ return function() {
+ var on = this.__on, o, listener = contextListener(value);
+ if (on)
+ for (var j = 0, m2 = on.length; j < m2; ++j) {
+ if ((o = on[j]).type === typename.type && o.name === typename.name) {
+ this.removeEventListener(o.type, o.listener, o.options);
+ this.addEventListener(o.type, o.listener = listener, o.options = options);
+ o.value = value;
+ return;
+ }
+ }
+ this.addEventListener(typename.type, listener, options);
+ o = { type: typename.type, name: typename.name, value, listener, options };
+ if (!on)
+ this.__on = [o];
+ else
+ on.push(o);
+ };
+}
+function on_default(typename, value, options) {
+ var typenames = parseTypenames2(typename + ""), i, n2 = typenames.length, t;
+ if (arguments.length < 2) {
+ var on = this.node().__on;
+ if (on)
+ for (var j = 0, m2 = on.length, o; j < m2; ++j) {
+ for (i = 0, o = on[j]; i < n2; ++i) {
+ if ((t = typenames[i]).type === o.type && t.name === o.name) {
+ return o.value;
+ }
+ }
+ }
+ return;
+ }
+ on = value ? onAdd : onRemove;
+ for (i = 0; i < n2; ++i)
+ this.each(on(typenames[i], value, options));
+ return this;
+}
+
+// node_modules/d3-selection/src/selection/dispatch.js
+function dispatchEvent(node, type2, params) {
+ var window2 = window_default(node), event = window2.CustomEvent;
+ if (typeof event === "function") {
+ event = new event(type2, params);
+ } else {
+ event = window2.document.createEvent("Event");
+ if (params)
+ event.initEvent(type2, params.bubbles, params.cancelable), event.detail = params.detail;
+ else
+ event.initEvent(type2, false, false);
+ }
+ node.dispatchEvent(event);
+}
+function dispatchConstant(type2, params) {
+ return function() {
+ return dispatchEvent(this, type2, params);
+ };
+}
+function dispatchFunction(type2, params) {
+ return function() {
+ return dispatchEvent(this, type2, params.apply(this, arguments));
+ };
+}
+function dispatch_default2(type2, params) {
+ return this.each((typeof params === "function" ? dispatchFunction : dispatchConstant)(type2, params));
+}
+
+// node_modules/d3-selection/src/selection/iterator.js
+function* iterator_default() {
+ for (var groups = this._groups, j = 0, m2 = groups.length; j < m2; ++j) {
+ for (var group = groups[j], i = 0, n2 = group.length, node; i < n2; ++i) {
+ if (node = group[i])
+ yield node;
+ }
+ }
+}
+
+// node_modules/d3-selection/src/selection/index.js
+var root = [null];
+function Selection(groups, parents) {
+ this._groups = groups;
+ this._parents = parents;
+}
+function selection() {
+ return new Selection([[document.documentElement]], root);
+}
+function selection_selection() {
+ return this;
+}
+Selection.prototype = selection.prototype = {
+ constructor: Selection,
+ select: select_default,
+ selectAll: selectAll_default,
+ selectChild: selectChild_default,
+ selectChildren: selectChildren_default,
+ filter: filter_default,
+ data: data_default,
+ enter: enter_default,
+ exit: exit_default,
+ join: join_default,
+ merge: merge_default,
+ selection: selection_selection,
+ order: order_default,
+ sort: sort_default,
+ call: call_default,
+ nodes: nodes_default,
+ node: node_default,
+ size: size_default,
+ empty: empty_default,
+ each: each_default,
+ attr: attr_default,
+ style: style_default,
+ property: property_default,
+ classed: classed_default,
+ text: text_default,
+ html: html_default,
+ raise: raise_default,
+ lower: lower_default,
+ append: append_default,
+ insert: insert_default,
+ remove: remove_default,
+ clone: clone_default,
+ datum: datum_default,
+ on: on_default,
+ dispatch: dispatch_default2,
+ [Symbol.iterator]: iterator_default
+};
+var selection_default = selection;
+
+// node_modules/d3-selection/src/select.js
+function select_default2(selector) {
+ return typeof selector === "string" ? new Selection([[document.querySelector(selector)]], [document.documentElement]) : new Selection([[selector]], root);
+}
+
+// node_modules/d3-selection/src/sourceEvent.js
+function sourceEvent_default(event) {
+ let sourceEvent;
+ while (sourceEvent = event.sourceEvent)
+ event = sourceEvent;
+ return event;
+}
+
+// node_modules/d3-selection/src/pointer.js
+function pointer_default(event, node) {
+ event = sourceEvent_default(event);
+ if (node === void 0)
+ node = event.currentTarget;
+ if (node) {
+ var svg = node.ownerSVGElement || node;
+ if (svg.createSVGPoint) {
+ var point3 = svg.createSVGPoint();
+ point3.x = event.clientX, point3.y = event.clientY;
+ point3 = point3.matrixTransform(node.getScreenCTM().inverse());
+ return [point3.x, point3.y];
+ }
+ if (node.getBoundingClientRect) {
+ var rect = node.getBoundingClientRect();
+ return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
+ }
+ }
+ return [event.pageX, event.pageY];
+}
+
+// node_modules/d3-drag/src/noevent.js
+function nopropagation(event) {
+ event.stopImmediatePropagation();
+}
+function noevent_default(event) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+}
+
+// node_modules/d3-drag/src/nodrag.js
+function nodrag_default(view) {
+ var root2 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", noevent_default, true);
+ if ("onselectstart" in root2) {
+ selection2.on("selectstart.drag", noevent_default, true);
+ } else {
+ root2.__noselect = root2.style.MozUserSelect;
+ root2.style.MozUserSelect = "none";
+ }
+}
+function yesdrag(view, noclick) {
+ var root2 = view.document.documentElement, selection2 = select_default2(view).on("dragstart.drag", null);
+ if (noclick) {
+ selection2.on("click.drag", noevent_default, true);
+ setTimeout(function() {
+ selection2.on("click.drag", null);
+ }, 0);
+ }
+ if ("onselectstart" in root2) {
+ selection2.on("selectstart.drag", null);
+ } else {
+ root2.style.MozUserSelect = root2.__noselect;
+ delete root2.__noselect;
+ }
+}
+
+// node_modules/d3-drag/src/constant.js
+var constant_default2 = (x4) => () => x4;
+
+// node_modules/d3-drag/src/event.js
+function DragEvent(type2, {
+ sourceEvent,
+ subject,
+ target,
+ identifier,
+ active,
+ x: x4,
+ y: y4,
+ dx,
+ dy,
+ dispatch: dispatch2
+}) {
+ Object.defineProperties(this, {
+ type: { value: type2, enumerable: true, configurable: true },
+ sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
+ subject: { value: subject, enumerable: true, configurable: true },
+ target: { value: target, enumerable: true, configurable: true },
+ identifier: { value: identifier, enumerable: true, configurable: true },
+ active: { value: active, enumerable: true, configurable: true },
+ x: { value: x4, enumerable: true, configurable: true },
+ y: { value: y4, enumerable: true, configurable: true },
+ dx: { value: dx, enumerable: true, configurable: true },
+ dy: { value: dy, enumerable: true, configurable: true },
+ _: { value: dispatch2 }
+ });
+}
+DragEvent.prototype.on = function() {
+ var value = this._.on.apply(this._, arguments);
+ return value === this._ ? this : value;
+};
+
+// node_modules/d3-drag/src/drag.js
+function defaultFilter(event) {
+ return !event.ctrlKey && !event.button;
+}
+function defaultContainer() {
+ return this.parentNode;
+}
+function defaultSubject(event, d) {
+ return d == null ? { x: event.x, y: event.y } : d;
+}
+function defaultTouchable() {
+ return navigator.maxTouchPoints || "ontouchstart" in this;
+}
+function drag_default() {
+ var filter2 = defaultFilter, container = defaultContainer, subject = defaultSubject, touchable = defaultTouchable, gestures = {}, listeners = dispatch_default("start", "drag", "end"), active = 0, mousedownx, mousedowny, mousemoving, touchending, clickDistance2 = 0;
+ function drag(selection2) {
+ selection2.on("mousedown.drag", mousedowned).filter(touchable).on("touchstart.drag", touchstarted).on("touchmove.drag", touchmoved).on("touchend.drag touchcancel.drag", touchended).style("touch-action", "none").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
+ }
+ function mousedowned(event, d) {
+ if (touchending || !filter2.call(this, event, d))
+ return;
+ var gesture = beforestart(this, container.call(this, event, d), event, d, "mouse");
+ if (!gesture)
+ return;
+ select_default2(event.view).on("mousemove.drag", mousemoved, true).on("mouseup.drag", mouseupped, true);
+ nodrag_default(event.view);
+ nopropagation(event);
+ mousemoving = false;
+ mousedownx = event.clientX;
+ mousedowny = event.clientY;
+ gesture("start", event);
+ }
+ function mousemoved(event) {
+ noevent_default(event);
+ if (!mousemoving) {
+ var dx = event.clientX - mousedownx, dy = event.clientY - mousedowny;
+ mousemoving = dx * dx + dy * dy > clickDistance2;
+ }
+ gestures.mouse("drag", event);
+ }
+ function mouseupped(event) {
+ select_default2(event.view).on("mousemove.drag mouseup.drag", null);
+ yesdrag(event.view, mousemoving);
+ noevent_default(event);
+ gestures.mouse("end", event);
+ }
+ function touchstarted(event, d) {
+ if (!filter2.call(this, event, d))
+ return;
+ var touches = event.changedTouches, c3 = container.call(this, event, d), n2 = touches.length, i, gesture;
+ for (i = 0; i < n2; ++i) {
+ if (gesture = beforestart(this, c3, event, d, touches[i].identifier, touches[i])) {
+ nopropagation(event);
+ gesture("start", event, touches[i]);
+ }
+ }
+ }
+ function touchmoved(event) {
+ var touches = event.changedTouches, n2 = touches.length, i, gesture;
+ for (i = 0; i < n2; ++i) {
+ if (gesture = gestures[touches[i].identifier]) {
+ noevent_default(event);
+ gesture("drag", event, touches[i]);
+ }
+ }
+ }
+ function touchended(event) {
+ var touches = event.changedTouches, n2 = touches.length, i, gesture;
+ if (touchending)
+ clearTimeout(touchending);
+ touchending = setTimeout(function() {
+ touchending = null;
+ }, 500);
+ for (i = 0; i < n2; ++i) {
+ if (gesture = gestures[touches[i].identifier]) {
+ nopropagation(event);
+ gesture("end", event, touches[i]);
+ }
+ }
+ }
+ function beforestart(that, container2, event, d, identifier, touch) {
+ var dispatch2 = listeners.copy(), p = pointer_default(touch || event, container2), dx, dy, s2;
+ if ((s2 = subject.call(that, new DragEvent("beforestart", {
+ sourceEvent: event,
+ target: drag,
+ identifier,
+ active,
+ x: p[0],
+ y: p[1],
+ dx: 0,
+ dy: 0,
+ dispatch: dispatch2
+ }), d)) == null)
+ return;
+ dx = s2.x - p[0] || 0;
+ dy = s2.y - p[1] || 0;
+ return function gesture(type2, event2, touch2) {
+ var p0 = p, n2;
+ switch (type2) {
+ case "start":
+ gestures[identifier] = gesture, n2 = active++;
+ break;
+ case "end":
+ delete gestures[identifier], --active;
+ case "drag":
+ p = pointer_default(touch2 || event2, container2), n2 = active;
+ break;
+ }
+ dispatch2.call(
+ type2,
+ that,
+ new DragEvent(type2, {
+ sourceEvent: event2,
+ subject: s2,
+ target: drag,
+ identifier,
+ active: n2,
+ x: p[0] + dx,
+ y: p[1] + dy,
+ dx: p[0] - p0[0],
+ dy: p[1] - p0[1],
+ dispatch: dispatch2
+ }),
+ d
+ );
+ };
+ }
+ drag.filter = function(_) {
+ return arguments.length ? (filter2 = typeof _ === "function" ? _ : constant_default2(!!_), drag) : filter2;
+ };
+ drag.container = function(_) {
+ return arguments.length ? (container = typeof _ === "function" ? _ : constant_default2(_), drag) : container;
+ };
+ drag.subject = function(_) {
+ return arguments.length ? (subject = typeof _ === "function" ? _ : constant_default2(_), drag) : subject;
+ };
+ drag.touchable = function(_) {
+ return arguments.length ? (touchable = typeof _ === "function" ? _ : constant_default2(!!_), drag) : touchable;
+ };
+ drag.on = function() {
+ var value = listeners.on.apply(listeners, arguments);
+ return value === listeners ? drag : value;
+ };
+ drag.clickDistance = function(_) {
+ return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);
+ };
+ return drag;
+}
+
+// node_modules/d3-color/src/define.js
+function define_default(constructor, factory, prototype) {
+ constructor.prototype = factory.prototype = prototype;
+ prototype.constructor = constructor;
+}
+function extend(parent, definition) {
+ var prototype = Object.create(parent.prototype);
+ for (var key in definition)
+ prototype[key] = definition[key];
+ return prototype;
+}
+
+// node_modules/d3-color/src/color.js
+function Color() {
+}
+var darker = 0.7;
+var brighter = 1 / darker;
+var reI = "\\s*([+-]?\\d+)\\s*";
+var reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*";
+var reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*";
+var reHex = /^#([0-9a-f]{3,8})$/;
+var reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$");
+var reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$");
+var reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$");
+var reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$");
+var reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$");
+var reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
+var named = {
+ aliceblue: 15792383,
+ antiquewhite: 16444375,
+ aqua: 65535,
+ aquamarine: 8388564,
+ azure: 15794175,
+ beige: 16119260,
+ bisque: 16770244,
+ black: 0,
+ blanchedalmond: 16772045,
+ blue: 255,
+ blueviolet: 9055202,
+ brown: 10824234,
+ burlywood: 14596231,
+ cadetblue: 6266528,
+ chartreuse: 8388352,
+ chocolate: 13789470,
+ coral: 16744272,
+ cornflowerblue: 6591981,
+ cornsilk: 16775388,
+ crimson: 14423100,
+ cyan: 65535,
+ darkblue: 139,
+ darkcyan: 35723,
+ darkgoldenrod: 12092939,
+ darkgray: 11119017,
+ darkgreen: 25600,
+ darkgrey: 11119017,
+ darkkhaki: 12433259,
+ darkmagenta: 9109643,
+ darkolivegreen: 5597999,
+ darkorange: 16747520,
+ darkorchid: 10040012,
+ darkred: 9109504,
+ darksalmon: 15308410,
+ darkseagreen: 9419919,
+ darkslateblue: 4734347,
+ darkslategray: 3100495,
+ darkslategrey: 3100495,
+ darkturquoise: 52945,
+ darkviolet: 9699539,
+ deeppink: 16716947,
+ deepskyblue: 49151,
+ dimgray: 6908265,
+ dimgrey: 6908265,
+ dodgerblue: 2003199,
+ firebrick: 11674146,
+ floralwhite: 16775920,
+ forestgreen: 2263842,
+ fuchsia: 16711935,
+ gainsboro: 14474460,
+ ghostwhite: 16316671,
+ gold: 16766720,
+ goldenrod: 14329120,
+ gray: 8421504,
+ green: 32768,
+ greenyellow: 11403055,
+ grey: 8421504,
+ honeydew: 15794160,
+ hotpink: 16738740,
+ indianred: 13458524,
+ indigo: 4915330,
+ ivory: 16777200,
+ khaki: 15787660,
+ lavender: 15132410,
+ lavenderblush: 16773365,
+ lawngreen: 8190976,
+ lemonchiffon: 16775885,
+ lightblue: 11393254,
+ lightcoral: 15761536,
+ lightcyan: 14745599,
+ lightgoldenrodyellow: 16448210,
+ lightgray: 13882323,
+ lightgreen: 9498256,
+ lightgrey: 13882323,
+ lightpink: 16758465,
+ lightsalmon: 16752762,
+ lightseagreen: 2142890,
+ lightskyblue: 8900346,
+ lightslategray: 7833753,
+ lightslategrey: 7833753,
+ lightsteelblue: 11584734,
+ lightyellow: 16777184,
+ lime: 65280,
+ limegreen: 3329330,
+ linen: 16445670,
+ magenta: 16711935,
+ maroon: 8388608,
+ mediumaquamarine: 6737322,
+ mediumblue: 205,
+ mediumorchid: 12211667,
+ mediumpurple: 9662683,
+ mediumseagreen: 3978097,
+ mediumslateblue: 8087790,
+ mediumspringgreen: 64154,
+ mediumturquoise: 4772300,
+ mediumvioletred: 13047173,
+ midnightblue: 1644912,
+ mintcream: 16121850,
+ mistyrose: 16770273,
+ moccasin: 16770229,
+ navajowhite: 16768685,
+ navy: 128,
+ oldlace: 16643558,
+ olive: 8421376,
+ olivedrab: 7048739,
+ orange: 16753920,
+ orangered: 16729344,
+ orchid: 14315734,
+ palegoldenrod: 15657130,
+ palegreen: 10025880,
+ paleturquoise: 11529966,
+ palevioletred: 14381203,
+ papayawhip: 16773077,
+ peachpuff: 16767673,
+ peru: 13468991,
+ pink: 16761035,
+ plum: 14524637,
+ powderblue: 11591910,
+ purple: 8388736,
+ rebeccapurple: 6697881,
+ red: 16711680,
+ rosybrown: 12357519,
+ royalblue: 4286945,
+ saddlebrown: 9127187,
+ salmon: 16416882,
+ sandybrown: 16032864,
+ seagreen: 3050327,
+ seashell: 16774638,
+ sienna: 10506797,
+ silver: 12632256,
+ skyblue: 8900331,
+ slateblue: 6970061,
+ slategray: 7372944,
+ slategrey: 7372944,
+ snow: 16775930,
+ springgreen: 65407,
+ steelblue: 4620980,
+ tan: 13808780,
+ teal: 32896,
+ thistle: 14204888,
+ tomato: 16737095,
+ turquoise: 4251856,
+ violet: 15631086,
+ wheat: 16113331,
+ white: 16777215,
+ whitesmoke: 16119285,
+ yellow: 16776960,
+ yellowgreen: 10145074
+};
+define_default(Color, color, {
+ copy: function(channels) {
+ return Object.assign(new this.constructor(), this, channels);
+ },
+ displayable: function() {
+ return this.rgb().displayable();
+ },
+ hex: color_formatHex,
+ // Deprecated! Use color.formatHex.
+ formatHex: color_formatHex,
+ formatHsl: color_formatHsl,
+ formatRgb: color_formatRgb,
+ toString: color_formatRgb
+});
+function color_formatHex() {
+ return this.rgb().formatHex();
+}
+function color_formatHsl() {
+ return hslConvert(this).formatHsl();
+}
+function color_formatRgb() {
+ return this.rgb().formatRgb();
+}
+function color(format2) {
+ var m2, l2;
+ format2 = (format2 + "").trim().toLowerCase();
+ return (m2 = reHex.exec(format2)) ? (l2 = m2[1].length, m2 = parseInt(m2[1], 16), l2 === 6 ? rgbn(m2) : l2 === 3 ? new Rgb(m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, (m2 & 15) << 4 | m2 & 15, 1) : l2 === 8 ? rgba(m2 >> 24 & 255, m2 >> 16 & 255, m2 >> 8 & 255, (m2 & 255) / 255) : l2 === 4 ? rgba(m2 >> 12 & 15 | m2 >> 8 & 240, m2 >> 8 & 15 | m2 >> 4 & 240, m2 >> 4 & 15 | m2 & 240, ((m2 & 15) << 4 | m2 & 15) / 255) : null) : (m2 = reRgbInteger.exec(format2)) ? new Rgb(m2[1], m2[2], m2[3], 1) : (m2 = reRgbPercent.exec(format2)) ? new Rgb(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, 1) : (m2 = reRgbaInteger.exec(format2)) ? rgba(m2[1], m2[2], m2[3], m2[4]) : (m2 = reRgbaPercent.exec(format2)) ? rgba(m2[1] * 255 / 100, m2[2] * 255 / 100, m2[3] * 255 / 100, m2[4]) : (m2 = reHslPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, 1) : (m2 = reHslaPercent.exec(format2)) ? hsla(m2[1], m2[2] / 100, m2[3] / 100, m2[4]) : named.hasOwnProperty(format2) ? rgbn(named[format2]) : format2 === "transparent" ? new Rgb(NaN, NaN, NaN, 0) : null;
+}
+function rgbn(n2) {
+ return new Rgb(n2 >> 16 & 255, n2 >> 8 & 255, n2 & 255, 1);
+}
+function rgba(r, g, b, a2) {
+ if (a2 <= 0)
+ r = g = b = NaN;
+ return new Rgb(r, g, b, a2);
+}
+function rgbConvert(o) {
+ if (!(o instanceof Color))
+ o = color(o);
+ if (!o)
+ return new Rgb();
+ o = o.rgb();
+ return new Rgb(o.r, o.g, o.b, o.opacity);
+}
+function rgb(r, g, b, opacity) {
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
+}
+function Rgb(r, g, b, opacity) {
+ this.r = +r;
+ this.g = +g;
+ this.b = +b;
+ this.opacity = +opacity;
+}
+define_default(Rgb, rgb, extend(Color, {
+ brighter: function(k) {
+ k = k == null ? brighter : Math.pow(brighter, k);
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
+ },
+ darker: function(k) {
+ k = k == null ? darker : Math.pow(darker, k);
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
+ },
+ rgb: function() {
+ return this;
+ },
+ displayable: function() {
+ return -0.5 <= this.r && this.r < 255.5 && (-0.5 <= this.g && this.g < 255.5) && (-0.5 <= this.b && this.b < 255.5) && (0 <= this.opacity && this.opacity <= 1);
+ },
+ hex: rgb_formatHex,
+ // Deprecated! Use color.formatHex.
+ formatHex: rgb_formatHex,
+ formatRgb: rgb_formatRgb,
+ toString: rgb_formatRgb
+}));
+function rgb_formatHex() {
+ return "#" + hex(this.r) + hex(this.g) + hex(this.b);
+}
+function rgb_formatRgb() {
+ var a2 = this.opacity;
+ a2 = isNaN(a2) ? 1 : Math.max(0, Math.min(1, a2));
+ return (a2 === 1 ? "rgb(" : "rgba(") + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", " + Math.max(0, Math.min(255, Math.round(this.b) || 0)) + (a2 === 1 ? ")" : ", " + a2 + ")");
+}
+function hex(value) {
+ value = Math.max(0, Math.min(255, Math.round(value) || 0));
+ return (value < 16 ? "0" : "") + value.toString(16);
+}
+function hsla(h, s2, l2, a2) {
+ if (a2 <= 0)
+ h = s2 = l2 = NaN;
+ else if (l2 <= 0 || l2 >= 1)
+ h = s2 = NaN;
+ else if (s2 <= 0)
+ h = NaN;
+ return new Hsl(h, s2, l2, a2);
+}
+function hslConvert(o) {
+ if (o instanceof Hsl)
+ return new Hsl(o.h, o.s, o.l, o.opacity);
+ if (!(o instanceof Color))
+ o = color(o);
+ if (!o)
+ return new Hsl();
+ if (o instanceof Hsl)
+ return o;
+ o = o.rgb();
+ var r = o.r / 255, g = o.g / 255, b = o.b / 255, min3 = Math.min(r, g, b), max4 = Math.max(r, g, b), h = NaN, s2 = max4 - min3, l2 = (max4 + min3) / 2;
+ if (s2) {
+ if (r === max4)
+ h = (g - b) / s2 + (g < b) * 6;
+ else if (g === max4)
+ h = (b - r) / s2 + 2;
+ else
+ h = (r - g) / s2 + 4;
+ s2 /= l2 < 0.5 ? max4 + min3 : 2 - max4 - min3;
+ h *= 60;
+ } else {
+ s2 = l2 > 0 && l2 < 1 ? 0 : h;
+ }
+ return new Hsl(h, s2, l2, o.opacity);
+}
+function hsl(h, s2, l2, opacity) {
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s2, l2, opacity == null ? 1 : opacity);
+}
+function Hsl(h, s2, l2, opacity) {
+ this.h = +h;
+ this.s = +s2;
+ this.l = +l2;
+ this.opacity = +opacity;
+}
+define_default(Hsl, hsl, extend(Color, {
+ brighter: function(k) {
+ k = k == null ? brighter : Math.pow(brighter, k);
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
+ },
+ darker: function(k) {
+ k = k == null ? darker : Math.pow(darker, k);
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
+ },
+ rgb: function() {
+ var h = this.h % 360 + (this.h < 0) * 360, s2 = isNaN(h) || isNaN(this.s) ? 0 : this.s, l2 = this.l, m2 = l2 + (l2 < 0.5 ? l2 : 1 - l2) * s2, m1 = 2 * l2 - m2;
+ return new Rgb(
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
+ hsl2rgb(h, m1, m2),
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
+ this.opacity
+ );
+ },
+ displayable: function() {
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s)) && (0 <= this.l && this.l <= 1) && (0 <= this.opacity && this.opacity <= 1);
+ },
+ formatHsl: function() {
+ var a2 = this.opacity;
+ a2 = isNaN(a2) ? 1 : Math.max(0, Math.min(1, a2));
+ return (a2 === 1 ? "hsl(" : "hsla(") + (this.h || 0) + ", " + (this.s || 0) * 100 + "%, " + (this.l || 0) * 100 + "%" + (a2 === 1 ? ")" : ", " + a2 + ")");
+ }
+}));
+function hsl2rgb(h, m1, m2) {
+ return (h < 60 ? m1 + (m2 - m1) * h / 60 : h < 180 ? m2 : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 : m1) * 255;
+}
+
+// node_modules/d3-color/src/math.js
+var radians = Math.PI / 180;
+var degrees = 180 / Math.PI;
+
+// node_modules/d3-color/src/cubehelix.js
+var A = -0.14861;
+var B = 1.78277;
+var C = -0.29227;
+var D = -0.90649;
+var E = 1.97294;
+var ED = E * D;
+var EB = E * B;
+var BC_DA = B * C - D * A;
+function cubehelixConvert(o) {
+ if (o instanceof Cubehelix)
+ return new Cubehelix(o.h, o.s, o.l, o.opacity);
+ if (!(o instanceof Rgb))
+ o = rgbConvert(o);
+ var r = o.r / 255, g = o.g / 255, b = o.b / 255, l2 = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB), bl = b - l2, k = (E * (g - l2) - C * bl) / D, s2 = Math.sqrt(k * k + bl * bl) / (E * l2 * (1 - l2)), h = s2 ? Math.atan2(k, bl) * degrees - 120 : NaN;
+ return new Cubehelix(h < 0 ? h + 360 : h, s2, l2, o.opacity);
+}
+function cubehelix(h, s2, l2, opacity) {
+ return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s2, l2, opacity == null ? 1 : opacity);
+}
+function Cubehelix(h, s2, l2, opacity) {
+ this.h = +h;
+ this.s = +s2;
+ this.l = +l2;
+ this.opacity = +opacity;
+}
+define_default(Cubehelix, cubehelix, extend(Color, {
+ brighter: function(k) {
+ k = k == null ? brighter : Math.pow(brighter, k);
+ return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
+ },
+ darker: function(k) {
+ k = k == null ? darker : Math.pow(darker, k);
+ return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
+ },
+ rgb: function() {
+ var h = isNaN(this.h) ? 0 : (this.h + 120) * radians, l2 = +this.l, a2 = isNaN(this.s) ? 0 : this.s * l2 * (1 - l2), cosh2 = Math.cos(h), sinh2 = Math.sin(h);
+ return new Rgb(
+ 255 * (l2 + a2 * (A * cosh2 + B * sinh2)),
+ 255 * (l2 + a2 * (C * cosh2 + D * sinh2)),
+ 255 * (l2 + a2 * (E * cosh2)),
+ this.opacity
+ );
+ }
+}));
+
+// node_modules/d3-interpolate/src/basis.js
+function basis(t1, v0, v1, v2, v3) {
+ var t2 = t1 * t1, t3 = t2 * t1;
+ return ((1 - 3 * t1 + 3 * t2 - t3) * v0 + (4 - 6 * t2 + 3 * t3) * v1 + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2 + t3 * v3) / 6;
+}
+function basis_default(values) {
+ var n2 = values.length - 1;
+ return function(t) {
+ var i = t <= 0 ? t = 0 : t >= 1 ? (t = 1, n2 - 1) : Math.floor(t * n2), v1 = values[i], v2 = values[i + 1], v0 = i > 0 ? values[i - 1] : 2 * v1 - v2, v3 = i < n2 - 1 ? values[i + 2] : 2 * v2 - v1;
+ return basis((t - i / n2) * n2, v0, v1, v2, v3);
+ };
+}
+
+// node_modules/d3-interpolate/src/basisClosed.js
+function basisClosed_default(values) {
+ var n2 = values.length;
+ return function(t) {
+ var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n2), v0 = values[(i + n2 - 1) % n2], v1 = values[i % n2], v2 = values[(i + 1) % n2], v3 = values[(i + 2) % n2];
+ return basis((t - i / n2) * n2, v0, v1, v2, v3);
+ };
+}
+
+// node_modules/d3-interpolate/src/constant.js
+var constant_default3 = (x4) => () => x4;
+
+// node_modules/d3-interpolate/src/color.js
+function linear(a2, d) {
+ return function(t) {
+ return a2 + t * d;
+ };
+}
+function exponential(a2, b, y4) {
+ return a2 = Math.pow(a2, y4), b = Math.pow(b, y4) - a2, y4 = 1 / y4, function(t) {
+ return Math.pow(a2 + t * b, y4);
+ };
+}
+function hue(a2, b) {
+ var d = b - a2;
+ return d ? linear(a2, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant_default3(isNaN(a2) ? b : a2);
+}
+function gamma(y4) {
+ return (y4 = +y4) === 1 ? nogamma : function(a2, b) {
+ return b - a2 ? exponential(a2, b, y4) : constant_default3(isNaN(a2) ? b : a2);
+ };
+}
+function nogamma(a2, b) {
+ var d = b - a2;
+ return d ? linear(a2, d) : constant_default3(isNaN(a2) ? b : a2);
+}
+
+// node_modules/d3-interpolate/src/rgb.js
+var rgb_default = function rgbGamma(y4) {
+ var color2 = gamma(y4);
+ function rgb2(start2, end) {
+ var r = color2((start2 = rgb(start2)).r, (end = rgb(end)).r), g = color2(start2.g, end.g), b = color2(start2.b, end.b), opacity = nogamma(start2.opacity, end.opacity);
+ return function(t) {
+ start2.r = r(t);
+ start2.g = g(t);
+ start2.b = b(t);
+ start2.opacity = opacity(t);
+ return start2 + "";
+ };
+ }
+ rgb2.gamma = rgbGamma;
+ return rgb2;
+}(1);
+function rgbSpline(spline) {
+ return function(colors) {
+ var n2 = colors.length, r = new Array(n2), g = new Array(n2), b = new Array(n2), i, color2;
+ for (i = 0; i < n2; ++i) {
+ color2 = rgb(colors[i]);
+ r[i] = color2.r || 0;
+ g[i] = color2.g || 0;
+ b[i] = color2.b || 0;
+ }
+ r = spline(r);
+ g = spline(g);
+ b = spline(b);
+ color2.opacity = 1;
+ return function(t) {
+ color2.r = r(t);
+ color2.g = g(t);
+ color2.b = b(t);
+ return color2 + "";
+ };
+ };
+}
+var rgbBasis = rgbSpline(basis_default);
+var rgbBasisClosed = rgbSpline(basisClosed_default);
+
+// node_modules/d3-interpolate/src/numberArray.js
+function numberArray_default(a2, b) {
+ if (!b)
+ b = [];
+ var n2 = a2 ? Math.min(b.length, a2.length) : 0, c3 = b.slice(), i;
+ return function(t) {
+ for (i = 0; i < n2; ++i)
+ c3[i] = a2[i] * (1 - t) + b[i] * t;
+ return c3;
+ };
+}
+function isNumberArray(x4) {
+ return ArrayBuffer.isView(x4) && !(x4 instanceof DataView);
+}
+
+// node_modules/d3-interpolate/src/array.js
+function genericArray(a2, b) {
+ var nb = b ? b.length : 0, na = a2 ? Math.min(nb, a2.length) : 0, x4 = new Array(na), c3 = new Array(nb), i;
+ for (i = 0; i < na; ++i)
+ x4[i] = value_default(a2[i], b[i]);
+ for (; i < nb; ++i)
+ c3[i] = b[i];
+ return function(t) {
+ for (i = 0; i < na; ++i)
+ c3[i] = x4[i](t);
+ return c3;
+ };
+}
+
+// node_modules/d3-interpolate/src/date.js
+function date_default(a2, b) {
+ var d = new Date();
+ return a2 = +a2, b = +b, function(t) {
+ return d.setTime(a2 * (1 - t) + b * t), d;
+ };
+}
+
+// node_modules/d3-interpolate/src/number.js
+function number_default2(a2, b) {
+ return a2 = +a2, b = +b, function(t) {
+ return a2 * (1 - t) + b * t;
+ };
+}
+
+// node_modules/d3-interpolate/src/object.js
+function object_default(a2, b) {
+ var i = {}, c3 = {}, k;
+ if (a2 === null || typeof a2 !== "object")
+ a2 = {};
+ if (b === null || typeof b !== "object")
+ b = {};
+ for (k in b) {
+ if (k in a2) {
+ i[k] = value_default(a2[k], b[k]);
+ } else {
+ c3[k] = b[k];
+ }
+ }
+ return function(t) {
+ for (k in i)
+ c3[k] = i[k](t);
+ return c3;
+ };
+}
+
+// node_modules/d3-interpolate/src/string.js
+var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;
+var reB = new RegExp(reA.source, "g");
+function zero(b) {
+ return function() {
+ return b;
+ };
+}
+function one(b) {
+ return function(t) {
+ return b(t) + "";
+ };
+}
+function string_default(a2, b) {
+ var bi = reA.lastIndex = reB.lastIndex = 0, am, bm, bs, i = -1, s2 = [], q = [];
+ a2 = a2 + "", b = b + "";
+ while ((am = reA.exec(a2)) && (bm = reB.exec(b))) {
+ if ((bs = bm.index) > bi) {
+ bs = b.slice(bi, bs);
+ if (s2[i])
+ s2[i] += bs;
+ else
+ s2[++i] = bs;
+ }
+ if ((am = am[0]) === (bm = bm[0])) {
+ if (s2[i])
+ s2[i] += bm;
+ else
+ s2[++i] = bm;
+ } else {
+ s2[++i] = null;
+ q.push({ i, x: number_default2(am, bm) });
+ }
+ bi = reB.lastIndex;
+ }
+ if (bi < b.length) {
+ bs = b.slice(bi);
+ if (s2[i])
+ s2[i] += bs;
+ else
+ s2[++i] = bs;
+ }
+ return s2.length < 2 ? q[0] ? one(q[0].x) : zero(b) : (b = q.length, function(t) {
+ for (var i2 = 0, o; i2 < b; ++i2)
+ s2[(o = q[i2]).i] = o.x(t);
+ return s2.join("");
+ });
+}
+
+// node_modules/d3-interpolate/src/value.js
+function value_default(a2, b) {
+ var t = typeof b, c3;
+ return b == null || t === "boolean" ? constant_default3(b) : (t === "number" ? number_default2 : t === "string" ? (c3 = color(b)) ? (b = c3, rgb_default) : string_default : b instanceof color ? rgb_default : b instanceof Date ? date_default : isNumberArray(b) ? numberArray_default : Array.isArray(b) ? genericArray : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object_default : number_default2)(a2, b);
+}
+
+// node_modules/d3-interpolate/src/round.js
+function round_default(a2, b) {
+ return a2 = +a2, b = +b, function(t) {
+ return Math.round(a2 * (1 - t) + b * t);
+ };
+}
+
+// node_modules/d3-interpolate/src/transform/decompose.js
+var degrees2 = 180 / Math.PI;
+var identity = {
+ translateX: 0,
+ translateY: 0,
+ rotate: 0,
+ skewX: 0,
+ scaleX: 1,
+ scaleY: 1
+};
+function decompose_default(a2, b, c3, d, e, f) {
+ var scaleX, scaleY, skewX;
+ if (scaleX = Math.sqrt(a2 * a2 + b * b))
+ a2 /= scaleX, b /= scaleX;
+ if (skewX = a2 * c3 + b * d)
+ c3 -= a2 * skewX, d -= b * skewX;
+ if (scaleY = Math.sqrt(c3 * c3 + d * d))
+ c3 /= scaleY, d /= scaleY, skewX /= scaleY;
+ if (a2 * d < b * c3)
+ a2 = -a2, b = -b, skewX = -skewX, scaleX = -scaleX;
+ return {
+ translateX: e,
+ translateY: f,
+ rotate: Math.atan2(b, a2) * degrees2,
+ skewX: Math.atan(skewX) * degrees2,
+ scaleX,
+ scaleY
+ };
+}
+
+// node_modules/d3-interpolate/src/transform/parse.js
+var svgNode;
+function parseCss(value) {
+ const m2 = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + "");
+ return m2.isIdentity ? identity : decompose_default(m2.a, m2.b, m2.c, m2.d, m2.e, m2.f);
+}
+function parseSvg(value) {
+ if (value == null)
+ return identity;
+ if (!svgNode)
+ svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
+ svgNode.setAttribute("transform", value);
+ if (!(value = svgNode.transform.baseVal.consolidate()))
+ return identity;
+ value = value.matrix;
+ return decompose_default(value.a, value.b, value.c, value.d, value.e, value.f);
+}
+
+// node_modules/d3-interpolate/src/transform/index.js
+function interpolateTransform(parse2, pxComma, pxParen, degParen) {
+ function pop(s2) {
+ return s2.length ? s2.pop() + " " : "";
+ }
+ function translate(xa, ya, xb, yb, s2, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s2.push("translate(", null, pxComma, null, pxParen);
+ q.push({ i: i - 4, x: number_default2(xa, xb) }, { i: i - 2, x: number_default2(ya, yb) });
+ } else if (xb || yb) {
+ s2.push("translate(" + xb + pxComma + yb + pxParen);
+ }
+ }
+ function rotate(a2, b, s2, q) {
+ if (a2 !== b) {
+ if (a2 - b > 180)
+ b += 360;
+ else if (b - a2 > 180)
+ a2 += 360;
+ q.push({ i: s2.push(pop(s2) + "rotate(", null, degParen) - 2, x: number_default2(a2, b) });
+ } else if (b) {
+ s2.push(pop(s2) + "rotate(" + b + degParen);
+ }
+ }
+ function skewX(a2, b, s2, q) {
+ if (a2 !== b) {
+ q.push({ i: s2.push(pop(s2) + "skewX(", null, degParen) - 2, x: number_default2(a2, b) });
+ } else if (b) {
+ s2.push(pop(s2) + "skewX(" + b + degParen);
+ }
+ }
+ function scale(xa, ya, xb, yb, s2, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s2.push(pop(s2) + "scale(", null, ",", null, ")");
+ q.push({ i: i - 4, x: number_default2(xa, xb) }, { i: i - 2, x: number_default2(ya, yb) });
+ } else if (xb !== 1 || yb !== 1) {
+ s2.push(pop(s2) + "scale(" + xb + "," + yb + ")");
+ }
+ }
+ return function(a2, b) {
+ var s2 = [], q = [];
+ a2 = parse2(a2), b = parse2(b);
+ translate(a2.translateX, a2.translateY, b.translateX, b.translateY, s2, q);
+ rotate(a2.rotate, b.rotate, s2, q);
+ skewX(a2.skewX, b.skewX, s2, q);
+ scale(a2.scaleX, a2.scaleY, b.scaleX, b.scaleY, s2, q);
+ a2 = b = null;
+ return function(t) {
+ var i = -1, n2 = q.length, o;
+ while (++i < n2)
+ s2[(o = q[i]).i] = o.x(t);
+ return s2.join("");
+ };
+ };
+}
+var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
+var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
+
+// node_modules/d3-interpolate/src/zoom.js
+var epsilon2 = 1e-12;
+function cosh(x4) {
+ return ((x4 = Math.exp(x4)) + 1 / x4) / 2;
+}
+function sinh(x4) {
+ return ((x4 = Math.exp(x4)) - 1 / x4) / 2;
+}
+function tanh(x4) {
+ return ((x4 = Math.exp(2 * x4)) - 1) / (x4 + 1);
+}
+var zoom_default = function zoomRho(rho, rho2, rho4) {
+ function zoom(p0, p1) {
+ var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;
+ if (d2 < epsilon2) {
+ S = Math.log(w1 / w0) / rho;
+ i = function(t) {
+ return [
+ ux0 + t * dx,
+ uy0 + t * dy,
+ w0 * Math.exp(rho * t * S)
+ ];
+ };
+ } else {
+ var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1), b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
+ S = (r1 - r0) / rho;
+ i = function(t) {
+ var s2 = t * S, coshr0 = cosh(r0), u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s2 + r0) - sinh(r0));
+ return [
+ ux0 + u * dx,
+ uy0 + u * dy,
+ w0 * coshr0 / cosh(rho * s2 + r0)
+ ];
+ };
+ }
+ i.duration = S * 1e3 * rho / Math.SQRT2;
+ return i;
+ }
+ zoom.rho = function(_) {
+ var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
+ return zoomRho(_1, _2, _4);
+ };
+ return zoom;
+}(Math.SQRT2, 2, 4);
+
+// node_modules/d3-interpolate/src/cubehelix.js
+function cubehelix2(hue2) {
+ return function cubehelixGamma(y4) {
+ y4 = +y4;
+ function cubehelix3(start2, end) {
+ var h = hue2((start2 = cubehelix(start2)).h, (end = cubehelix(end)).h), s2 = nogamma(start2.s, end.s), l2 = nogamma(start2.l, end.l), opacity = nogamma(start2.opacity, end.opacity);
+ return function(t) {
+ start2.h = h(t);
+ start2.s = s2(t);
+ start2.l = l2(Math.pow(t, y4));
+ start2.opacity = opacity(t);
+ return start2 + "";
+ };
+ }
+ cubehelix3.gamma = cubehelixGamma;
+ return cubehelix3;
+ }(1);
+}
+var cubehelix_default = cubehelix2(hue);
+var cubehelixLong = cubehelix2(nogamma);
+
+// node_modules/d3-interpolate/src/quantize.js
+function quantize_default(interpolator, n2) {
+ var samples = new Array(n2);
+ for (var i = 0; i < n2; ++i)
+ samples[i] = interpolator(i / (n2 - 1));
+ return samples;
+}
+
+// node_modules/d3-timer/src/timer.js
+var frame = 0;
+var timeout = 0;
+var interval = 0;
+var pokeDelay = 1e3;
+var taskHead;
+var taskTail;
+var clockLast = 0;
+var clockNow = 0;
+var clockSkew = 0;
+var clock = typeof performance === "object" && performance.now ? performance : Date;
+var setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) {
+ setTimeout(f, 17);
+};
+function now2() {
+ return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
+}
+function clearNow() {
+ clockNow = 0;
+}
+function Timer() {
+ this._call = this._time = this._next = null;
+}
+Timer.prototype = timer.prototype = {
+ constructor: Timer,
+ restart: function(callback, delay, time) {
+ if (typeof callback !== "function")
+ throw new TypeError("callback is not a function");
+ time = (time == null ? now2() : +time) + (delay == null ? 0 : +delay);
+ if (!this._next && taskTail !== this) {
+ if (taskTail)
+ taskTail._next = this;
+ else
+ taskHead = this;
+ taskTail = this;
+ }
+ this._call = callback;
+ this._time = time;
+ sleep();
+ },
+ stop: function() {
+ if (this._call) {
+ this._call = null;
+ this._time = Infinity;
+ sleep();
+ }
+ }
+};
+function timer(callback, delay, time) {
+ var t = new Timer();
+ t.restart(callback, delay, time);
+ return t;
+}
+function timerFlush() {
+ now2();
+ ++frame;
+ var t = taskHead, e;
+ while (t) {
+ if ((e = clockNow - t._time) >= 0)
+ t._call.call(null, e);
+ t = t._next;
+ }
+ --frame;
+}
+function wake() {
+ clockNow = (clockLast = clock.now()) + clockSkew;
+ frame = timeout = 0;
+ try {
+ timerFlush();
+ } finally {
+ frame = 0;
+ nap();
+ clockNow = 0;
+ }
+}
+function poke() {
+ var now3 = clock.now(), delay = now3 - clockLast;
+ if (delay > pokeDelay)
+ clockSkew -= delay, clockLast = now3;
+}
+function nap() {
+ var t0, t1 = taskHead, t2, time = Infinity;
+ while (t1) {
+ if (t1._call) {
+ if (time > t1._time)
+ time = t1._time;
+ t0 = t1, t1 = t1._next;
+ } else {
+ t2 = t1._next, t1._next = null;
+ t1 = t0 ? t0._next = t2 : taskHead = t2;
+ }
+ }
+ taskTail = t0;
+ sleep(time);
+}
+function sleep(time) {
+ if (frame)
+ return;
+ if (timeout)
+ timeout = clearTimeout(timeout);
+ var delay = time - clockNow;
+ if (delay > 24) {
+ if (time < Infinity)
+ timeout = setTimeout(wake, time - clock.now() - clockSkew);
+ if (interval)
+ interval = clearInterval(interval);
+ } else {
+ if (!interval)
+ clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
+ frame = 1, setFrame(wake);
+ }
+}
+
+// node_modules/d3-timer/src/timeout.js
+function timeout_default(callback, delay, time) {
+ var t = new Timer();
+ delay = delay == null ? 0 : +delay;
+ t.restart((elapsed) => {
+ t.stop();
+ callback(elapsed + delay);
+ }, delay, time);
+ return t;
+}
+
+// node_modules/d3-transition/src/transition/schedule.js
+var emptyOn = dispatch_default("start", "end", "cancel", "interrupt");
+var emptyTween = [];
+var CREATED = 0;
+var SCHEDULED = 1;
+var STARTING = 2;
+var STARTED = 3;
+var RUNNING = 4;
+var ENDING = 5;
+var ENDED = 6;
+function schedule_default(node, name, id2, index2, group, timing) {
+ var schedules = node.__transition;
+ if (!schedules)
+ node.__transition = {};
+ else if (id2 in schedules)
+ return;
+ create(node, id2, {
+ name,
+ index: index2,
+ // For context during callback.
+ group,
+ // For context during callback.
+ on: emptyOn,
+ tween: emptyTween,
+ time: timing.time,
+ delay: timing.delay,
+ duration: timing.duration,
+ ease: timing.ease,
+ timer: null,
+ state: CREATED
+ });
+}
+function init2(node, id2) {
+ var schedule = get2(node, id2);
+ if (schedule.state > CREATED)
+ throw new Error("too late; already scheduled");
+ return schedule;
+}
+function set2(node, id2) {
+ var schedule = get2(node, id2);
+ if (schedule.state > STARTED)
+ throw new Error("too late; already running");
+ return schedule;
+}
+function get2(node, id2) {
+ var schedule = node.__transition;
+ if (!schedule || !(schedule = schedule[id2]))
+ throw new Error("transition not found");
+ return schedule;
+}
+function create(node, id2, self2) {
+ var schedules = node.__transition, tween;
+ schedules[id2] = self2;
+ self2.timer = timer(schedule, 0, self2.time);
+ function schedule(elapsed) {
+ self2.state = SCHEDULED;
+ self2.timer.restart(start2, self2.delay, self2.time);
+ if (self2.delay <= elapsed)
+ start2(elapsed - self2.delay);
+ }
+ function start2(elapsed) {
+ var i, j, n2, o;
+ if (self2.state !== SCHEDULED)
+ return stop();
+ for (i in schedules) {
+ o = schedules[i];
+ if (o.name !== self2.name)
+ continue;
+ if (o.state === STARTED)
+ return timeout_default(start2);
+ if (o.state === RUNNING) {
+ o.state = ENDED;
+ o.timer.stop();
+ o.on.call("interrupt", node, node.__data__, o.index, o.group);
+ delete schedules[i];
+ } else if (+i < id2) {
+ o.state = ENDED;
+ o.timer.stop();
+ o.on.call("cancel", node, node.__data__, o.index, o.group);
+ delete schedules[i];
+ }
+ }
+ timeout_default(function() {
+ if (self2.state === STARTED) {
+ self2.state = RUNNING;
+ self2.timer.restart(tick2, self2.delay, self2.time);
+ tick2(elapsed);
+ }
+ });
+ self2.state = STARTING;
+ self2.on.call("start", node, node.__data__, self2.index, self2.group);
+ if (self2.state !== STARTING)
+ return;
+ self2.state = STARTED;
+ tween = new Array(n2 = self2.tween.length);
+ for (i = 0, j = -1; i < n2; ++i) {
+ if (o = self2.tween[i].value.call(node, node.__data__, self2.index, self2.group)) {
+ tween[++j] = o;
+ }
+ }
+ tween.length = j + 1;
+ }
+ function tick2(elapsed) {
+ var t = elapsed < self2.duration ? self2.ease.call(null, elapsed / self2.duration) : (self2.timer.restart(stop), self2.state = ENDING, 1), i = -1, n2 = tween.length;
+ while (++i < n2) {
+ tween[i].call(node, t);
+ }
+ if (self2.state === ENDING) {
+ self2.on.call("end", node, node.__data__, self2.index, self2.group);
+ stop();
+ }
+ }
+ function stop() {
+ self2.state = ENDED;
+ self2.timer.stop();
+ delete schedules[id2];
+ for (var i in schedules)
+ return;
+ delete node.__transition;
+ }
+}
+
+// node_modules/d3-transition/src/interrupt.js
+function interrupt_default(node, name) {
+ var schedules = node.__transition, schedule, active, empty3 = true, i;
+ if (!schedules)
+ return;
+ name = name == null ? null : name + "";
+ for (i in schedules) {
+ if ((schedule = schedules[i]).name !== name) {
+ empty3 = false;
+ continue;
+ }
+ active = schedule.state > STARTING && schedule.state < ENDING;
+ schedule.state = ENDED;
+ schedule.timer.stop();
+ schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group);
+ delete schedules[i];
+ }
+ if (empty3)
+ delete node.__transition;
+}
+
+// node_modules/d3-transition/src/selection/interrupt.js
+function interrupt_default2(name) {
+ return this.each(function() {
+ interrupt_default(this, name);
+ });
+}
+
+// node_modules/d3-transition/src/transition/tween.js
+function tweenRemove(id2, name) {
+ var tween0, tween1;
+ return function() {
+ var schedule = set2(this, id2), tween = schedule.tween;
+ if (tween !== tween0) {
+ tween1 = tween0 = tween;
+ for (var i = 0, n2 = tween1.length; i < n2; ++i) {
+ if (tween1[i].name === name) {
+ tween1 = tween1.slice();
+ tween1.splice(i, 1);
+ break;
+ }
+ }
+ }
+ schedule.tween = tween1;
+ };
+}
+function tweenFunction(id2, name, value) {
+ var tween0, tween1;
+ if (typeof value !== "function")
+ throw new Error();
+ return function() {
+ var schedule = set2(this, id2), tween = schedule.tween;
+ if (tween !== tween0) {
+ tween1 = (tween0 = tween).slice();
+ for (var t = { name, value }, i = 0, n2 = tween1.length; i < n2; ++i) {
+ if (tween1[i].name === name) {
+ tween1[i] = t;
+ break;
+ }
+ }
+ if (i === n2)
+ tween1.push(t);
+ }
+ schedule.tween = tween1;
+ };
+}
+function tween_default(name, value) {
+ var id2 = this._id;
+ name += "";
+ if (arguments.length < 2) {
+ var tween = get2(this.node(), id2).tween;
+ for (var i = 0, n2 = tween.length, t; i < n2; ++i) {
+ if ((t = tween[i]).name === name) {
+ return t.value;
+ }
+ }
+ return null;
+ }
+ return this.each((value == null ? tweenRemove : tweenFunction)(id2, name, value));
+}
+function tweenValue(transition2, name, value) {
+ var id2 = transition2._id;
+ transition2.each(function() {
+ var schedule = set2(this, id2);
+ (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);
+ });
+ return function(node) {
+ return get2(node, id2).value[name];
+ };
+}
+
+// node_modules/d3-transition/src/transition/interpolate.js
+function interpolate_default(a2, b) {
+ var c3;
+ return (typeof b === "number" ? number_default2 : b instanceof color ? rgb_default : (c3 = color(b)) ? (b = c3, rgb_default) : string_default)(a2, b);
+}
+
+// node_modules/d3-transition/src/transition/attr.js
+function attrRemove2(name) {
+ return function() {
+ this.removeAttribute(name);
+ };
+}
+function attrRemoveNS2(fullname) {
+ return function() {
+ this.removeAttributeNS(fullname.space, fullname.local);
+ };
+}
+function attrConstant2(name, interpolate, value1) {
+ var string00, string1 = value1 + "", interpolate0;
+ return function() {
+ var string0 = this.getAttribute(name);
+ return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
+ };
+}
+function attrConstantNS2(fullname, interpolate, value1) {
+ var string00, string1 = value1 + "", interpolate0;
+ return function() {
+ var string0 = this.getAttributeNS(fullname.space, fullname.local);
+ return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
+ };
+}
+function attrFunction2(name, interpolate, value) {
+ var string00, string10, interpolate0;
+ return function() {
+ var string0, value1 = value(this), string1;
+ if (value1 == null)
+ return void this.removeAttribute(name);
+ string0 = this.getAttribute(name);
+ string1 = value1 + "";
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
+ };
+}
+function attrFunctionNS2(fullname, interpolate, value) {
+ var string00, string10, interpolate0;
+ return function() {
+ var string0, value1 = value(this), string1;
+ if (value1 == null)
+ return void this.removeAttributeNS(fullname.space, fullname.local);
+ string0 = this.getAttributeNS(fullname.space, fullname.local);
+ string1 = value1 + "";
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
+ };
+}
+function attr_default2(name, value) {
+ var fullname = namespace_default(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate_default;
+ return this.attrTween(name, typeof value === "function" ? (fullname.local ? attrFunctionNS2 : attrFunction2)(fullname, i, tweenValue(this, "attr." + name, value)) : value == null ? (fullname.local ? attrRemoveNS2 : attrRemove2)(fullname) : (fullname.local ? attrConstantNS2 : attrConstant2)(fullname, i, value));
+}
+
+// node_modules/d3-transition/src/transition/attrTween.js
+function attrInterpolate(name, i) {
+ return function(t) {
+ this.setAttribute(name, i.call(this, t));
+ };
+}
+function attrInterpolateNS(fullname, i) {
+ return function(t) {
+ this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));
+ };
+}
+function attrTweenNS(fullname, value) {
+ var t0, i0;
+ function tween() {
+ var i = value.apply(this, arguments);
+ if (i !== i0)
+ t0 = (i0 = i) && attrInterpolateNS(fullname, i);
+ return t0;
+ }
+ tween._value = value;
+ return tween;
+}
+function attrTween(name, value) {
+ var t0, i0;
+ function tween() {
+ var i = value.apply(this, arguments);
+ if (i !== i0)
+ t0 = (i0 = i) && attrInterpolate(name, i);
+ return t0;
+ }
+ tween._value = value;
+ return tween;
+}
+function attrTween_default(name, value) {
+ var key = "attr." + name;
+ if (arguments.length < 2)
+ return (key = this.tween(key)) && key._value;
+ if (value == null)
+ return this.tween(key, null);
+ if (typeof value !== "function")
+ throw new Error();
+ var fullname = namespace_default(name);
+ return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
+}
+
+// node_modules/d3-transition/src/transition/delay.js
+function delayFunction(id2, value) {
+ return function() {
+ init2(this, id2).delay = +value.apply(this, arguments);
+ };
+}
+function delayConstant(id2, value) {
+ return value = +value, function() {
+ init2(this, id2).delay = value;
+ };
+}
+function delay_default(value) {
+ var id2 = this._id;
+ return arguments.length ? this.each((typeof value === "function" ? delayFunction : delayConstant)(id2, value)) : get2(this.node(), id2).delay;
+}
+
+// node_modules/d3-transition/src/transition/duration.js
+function durationFunction(id2, value) {
+ return function() {
+ set2(this, id2).duration = +value.apply(this, arguments);
+ };
+}
+function durationConstant(id2, value) {
+ return value = +value, function() {
+ set2(this, id2).duration = value;
+ };
+}
+function duration_default(value) {
+ var id2 = this._id;
+ return arguments.length ? this.each((typeof value === "function" ? durationFunction : durationConstant)(id2, value)) : get2(this.node(), id2).duration;
+}
+
+// node_modules/d3-transition/src/transition/ease.js
+function easeConstant(id2, value) {
+ if (typeof value !== "function")
+ throw new Error();
+ return function() {
+ set2(this, id2).ease = value;
+ };
+}
+function ease_default(value) {
+ var id2 = this._id;
+ return arguments.length ? this.each(easeConstant(id2, value)) : get2(this.node(), id2).ease;
+}
+
+// node_modules/d3-transition/src/transition/easeVarying.js
+function easeVarying(id2, value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (typeof v !== "function")
+ throw new Error();
+ set2(this, id2).ease = v;
+ };
+}
+function easeVarying_default(value) {
+ if (typeof value !== "function")
+ throw new Error();
+ return this.each(easeVarying(this._id, value));
+}
+
+// node_modules/d3-transition/src/transition/filter.js
+function filter_default2(match2) {
+ if (typeof match2 !== "function")
+ match2 = matcher_default(match2);
+ for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n2; ++i) {
+ if ((node = group[i]) && match2.call(node, node.__data__, i, group)) {
+ subgroup.push(node);
+ }
+ }
+ }
+ return new Transition(subgroups, this._parents, this._name, this._id);
+}
+
+// node_modules/d3-transition/src/transition/merge.js
+function merge_default2(transition2) {
+ if (transition2._id !== this._id)
+ throw new Error();
+ for (var groups0 = this._groups, groups1 = transition2._groups, m0 = groups0.length, m1 = groups1.length, m2 = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m2; ++j) {
+ for (var group0 = groups0[j], group1 = groups1[j], n2 = group0.length, merge = merges[j] = new Array(n2), node, i = 0; i < n2; ++i) {
+ if (node = group0[i] || group1[i]) {
+ merge[i] = node;
+ }
+ }
+ }
+ for (; j < m0; ++j) {
+ merges[j] = groups0[j];
+ }
+ return new Transition(merges, this._parents, this._name, this._id);
+}
+
+// node_modules/d3-transition/src/transition/on.js
+function start(name) {
+ return (name + "").trim().split(/^|\s+/).every(function(t) {
+ var i = t.indexOf(".");
+ if (i >= 0)
+ t = t.slice(0, i);
+ return !t || t === "start";
+ });
+}
+function onFunction(id2, name, listener) {
+ var on0, on1, sit = start(name) ? init2 : set2;
+ return function() {
+ var schedule = sit(this, id2), on = schedule.on;
+ if (on !== on0)
+ (on1 = (on0 = on).copy()).on(name, listener);
+ schedule.on = on1;
+ };
+}
+function on_default2(name, listener) {
+ var id2 = this._id;
+ return arguments.length < 2 ? get2(this.node(), id2).on.on(name) : this.each(onFunction(id2, name, listener));
+}
+
+// node_modules/d3-transition/src/transition/remove.js
+function removeFunction(id2) {
+ return function() {
+ var parent = this.parentNode;
+ for (var i in this.__transition)
+ if (+i !== id2)
+ return;
+ if (parent)
+ parent.removeChild(this);
+ };
+}
+function remove_default2() {
+ return this.on("end.remove", removeFunction(this._id));
+}
+
+// node_modules/d3-transition/src/transition/select.js
+function select_default3(select) {
+ var name = this._name, id2 = this._id;
+ if (typeof select !== "function")
+ select = selector_default(select);
+ for (var groups = this._groups, m2 = groups.length, subgroups = new Array(m2), j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, subgroup = subgroups[j] = new Array(n2), node, subnode, i = 0; i < n2; ++i) {
+ if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
+ if ("__data__" in node)
+ subnode.__data__ = node.__data__;
+ subgroup[i] = subnode;
+ schedule_default(subgroup[i], name, id2, i, subgroup, get2(node, id2));
+ }
+ }
+ }
+ return new Transition(subgroups, this._parents, name, id2);
+}
+
+// node_modules/d3-transition/src/transition/selectAll.js
+function selectAll_default2(select) {
+ var name = this._name, id2 = this._id;
+ if (typeof select !== "function")
+ select = selectorAll_default(select);
+ for (var groups = this._groups, m2 = groups.length, subgroups = [], parents = [], j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, node, i = 0; i < n2; ++i) {
+ if (node = group[i]) {
+ for (var children3 = select.call(node, node.__data__, i, group), child, inherit2 = get2(node, id2), k = 0, l2 = children3.length; k < l2; ++k) {
+ if (child = children3[k]) {
+ schedule_default(child, name, id2, k, children3, inherit2);
+ }
+ }
+ subgroups.push(children3);
+ parents.push(node);
+ }
+ }
+ }
+ return new Transition(subgroups, parents, name, id2);
+}
+
+// node_modules/d3-transition/src/transition/selection.js
+var Selection2 = selection_default.prototype.constructor;
+function selection_default2() {
+ return new Selection2(this._groups, this._parents);
+}
+
+// node_modules/d3-transition/src/transition/style.js
+function styleNull(name, interpolate) {
+ var string00, string10, interpolate0;
+ return function() {
+ var string0 = styleValue(this, name), string1 = (this.style.removeProperty(name), styleValue(this, name));
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : interpolate0 = interpolate(string00 = string0, string10 = string1);
+ };
+}
+function styleRemove2(name) {
+ return function() {
+ this.style.removeProperty(name);
+ };
+}
+function styleConstant2(name, interpolate, value1) {
+ var string00, string1 = value1 + "", interpolate0;
+ return function() {
+ var string0 = styleValue(this, name);
+ return string0 === string1 ? null : string0 === string00 ? interpolate0 : interpolate0 = interpolate(string00 = string0, value1);
+ };
+}
+function styleFunction2(name, interpolate, value) {
+ var string00, string10, interpolate0;
+ return function() {
+ var string0 = styleValue(this, name), value1 = value(this), string1 = value1 + "";
+ if (value1 == null)
+ string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
+ return string0 === string1 ? null : string0 === string00 && string1 === string10 ? interpolate0 : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));
+ };
+}
+function styleMaybeRemove(id2, name) {
+ var on0, on1, listener0, key = "style." + name, event = "end." + key, remove2;
+ return function() {
+ var schedule = set2(this, id2), on = schedule.on, listener = schedule.value[key] == null ? remove2 || (remove2 = styleRemove2(name)) : void 0;
+ if (on !== on0 || listener0 !== listener)
+ (on1 = (on0 = on).copy()).on(event, listener0 = listener);
+ schedule.on = on1;
+ };
+}
+function style_default2(name, value, priority) {
+ var i = (name += "") === "transform" ? interpolateTransformCss : interpolate_default;
+ return value == null ? this.styleTween(name, styleNull(name, i)).on("end.style." + name, styleRemove2(name)) : typeof value === "function" ? this.styleTween(name, styleFunction2(name, i, tweenValue(this, "style." + name, value))).each(styleMaybeRemove(this._id, name)) : this.styleTween(name, styleConstant2(name, i, value), priority).on("end.style." + name, null);
+}
+
+// node_modules/d3-transition/src/transition/styleTween.js
+function styleInterpolate(name, i, priority) {
+ return function(t) {
+ this.style.setProperty(name, i.call(this, t), priority);
+ };
+}
+function styleTween(name, value, priority) {
+ var t, i0;
+ function tween() {
+ var i = value.apply(this, arguments);
+ if (i !== i0)
+ t = (i0 = i) && styleInterpolate(name, i, priority);
+ return t;
+ }
+ tween._value = value;
+ return tween;
+}
+function styleTween_default(name, value, priority) {
+ var key = "style." + (name += "");
+ if (arguments.length < 2)
+ return (key = this.tween(key)) && key._value;
+ if (value == null)
+ return this.tween(key, null);
+ if (typeof value !== "function")
+ throw new Error();
+ return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
+}
+
+// node_modules/d3-transition/src/transition/text.js
+function textConstant2(value) {
+ return function() {
+ this.textContent = value;
+ };
+}
+function textFunction2(value) {
+ return function() {
+ var value1 = value(this);
+ this.textContent = value1 == null ? "" : value1;
+ };
+}
+function text_default2(value) {
+ return this.tween("text", typeof value === "function" ? textFunction2(tweenValue(this, "text", value)) : textConstant2(value == null ? "" : value + ""));
+}
+
+// node_modules/d3-transition/src/transition/textTween.js
+function textInterpolate(i) {
+ return function(t) {
+ this.textContent = i.call(this, t);
+ };
+}
+function textTween(value) {
+ var t0, i0;
+ function tween() {
+ var i = value.apply(this, arguments);
+ if (i !== i0)
+ t0 = (i0 = i) && textInterpolate(i);
+ return t0;
+ }
+ tween._value = value;
+ return tween;
+}
+function textTween_default(value) {
+ var key = "text";
+ if (arguments.length < 1)
+ return (key = this.tween(key)) && key._value;
+ if (value == null)
+ return this.tween(key, null);
+ if (typeof value !== "function")
+ throw new Error();
+ return this.tween(key, textTween(value));
+}
+
+// node_modules/d3-transition/src/transition/transition.js
+function transition_default() {
+ var name = this._name, id0 = this._id, id1 = newId();
+ for (var groups = this._groups, m2 = groups.length, j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, node, i = 0; i < n2; ++i) {
+ if (node = group[i]) {
+ var inherit2 = get2(node, id0);
+ schedule_default(node, name, id1, i, group, {
+ time: inherit2.time + inherit2.delay + inherit2.duration,
+ delay: 0,
+ duration: inherit2.duration,
+ ease: inherit2.ease
+ });
+ }
+ }
+ }
+ return new Transition(groups, this._parents, name, id1);
+}
+
+// node_modules/d3-transition/src/transition/end.js
+function end_default() {
+ var on0, on1, that = this, id2 = that._id, size = that.size();
+ return new Promise(function(resolve, reject) {
+ var cancel = { value: reject }, end = { value: function() {
+ if (--size === 0)
+ resolve();
+ } };
+ that.each(function() {
+ var schedule = set2(this, id2), on = schedule.on;
+ if (on !== on0) {
+ on1 = (on0 = on).copy();
+ on1._.cancel.push(cancel);
+ on1._.interrupt.push(cancel);
+ on1._.end.push(end);
+ }
+ schedule.on = on1;
+ });
+ if (size === 0)
+ resolve();
+ });
+}
+
+// node_modules/d3-transition/src/transition/index.js
+var id = 0;
+function Transition(groups, parents, name, id2) {
+ this._groups = groups;
+ this._parents = parents;
+ this._name = name;
+ this._id = id2;
+}
+function transition(name) {
+ return selection_default().transition(name);
+}
+function newId() {
+ return ++id;
+}
+var selection_prototype = selection_default.prototype;
+Transition.prototype = transition.prototype = {
+ constructor: Transition,
+ select: select_default3,
+ selectAll: selectAll_default2,
+ filter: filter_default2,
+ merge: merge_default2,
+ selection: selection_default2,
+ transition: transition_default,
+ call: selection_prototype.call,
+ nodes: selection_prototype.nodes,
+ node: selection_prototype.node,
+ size: selection_prototype.size,
+ empty: selection_prototype.empty,
+ each: selection_prototype.each,
+ on: on_default2,
+ attr: attr_default2,
+ attrTween: attrTween_default,
+ style: style_default2,
+ styleTween: styleTween_default,
+ text: text_default2,
+ textTween: textTween_default,
+ remove: remove_default2,
+ tween: tween_default,
+ delay: delay_default,
+ duration: duration_default,
+ ease: ease_default,
+ easeVarying: easeVarying_default,
+ end: end_default,
+ [Symbol.iterator]: selection_prototype[Symbol.iterator]
+};
+
+// node_modules/d3-ease/src/cubic.js
+function cubicInOut(t) {
+ return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
+}
+
+// node_modules/d3-transition/src/selection/transition.js
+var defaultTiming = {
+ time: null,
+ // Set on use.
+ delay: 0,
+ duration: 250,
+ ease: cubicInOut
+};
+function inherit(node, id2) {
+ var timing;
+ while (!(timing = node.__transition) || !(timing = timing[id2])) {
+ if (!(node = node.parentNode)) {
+ throw new Error(`transition ${id2} not found`);
+ }
+ }
+ return timing;
+}
+function transition_default2(name) {
+ var id2, timing;
+ if (name instanceof Transition) {
+ id2 = name._id, name = name._name;
+ } else {
+ id2 = newId(), (timing = defaultTiming).time = now2(), name = name == null ? null : name + "";
+ }
+ for (var groups = this._groups, m2 = groups.length, j = 0; j < m2; ++j) {
+ for (var group = groups[j], n2 = group.length, node, i = 0; i < n2; ++i) {
+ if (node = group[i]) {
+ schedule_default(node, name, id2, i, group, timing || inherit(node, id2));
+ }
+ }
+ }
+ return new Transition(groups, this._parents, name, id2);
+}
+
+// node_modules/d3-transition/src/selection/index.js
+selection_default.prototype.interrupt = interrupt_default2;
+selection_default.prototype.transition = transition_default2;
+
+// node_modules/d3-brush/src/brush.js
+var { abs, max: max2, min } = Math;
+function number1(e) {
+ return [+e[0], +e[1]];
+}
+function number2(e) {
+ return [number1(e[0]), number1(e[1])];
+}
+var X = {
+ name: "x",
+ handles: ["w", "e"].map(type),
+ input: function(x4, e) {
+ return x4 == null ? null : [[+x4[0], e[0][1]], [+x4[1], e[1][1]]];
+ },
+ output: function(xy) {
+ return xy && [xy[0][0], xy[1][0]];
+ }
+};
+var Y = {
+ name: "y",
+ handles: ["n", "s"].map(type),
+ input: function(y4, e) {
+ return y4 == null ? null : [[e[0][0], +y4[0]], [e[1][0], +y4[1]]];
+ },
+ output: function(xy) {
+ return xy && [xy[0][1], xy[1][1]];
+ }
+};
+var XY = {
+ name: "xy",
+ handles: ["n", "w", "e", "s", "nw", "ne", "sw", "se"].map(type),
+ input: function(xy) {
+ return xy == null ? null : number2(xy);
+ },
+ output: function(xy) {
+ return xy;
+ }
+};
+function type(t) {
+ return { type: t };
+}
+
+// node_modules/d3-path/src/path.js
+var pi = Math.PI;
+var tau = 2 * pi;
+var epsilon = 1e-6;
+var tauEpsilon = tau - epsilon;
+function Path() {
+ this._x0 = this._y0 = // start of current subpath
+ this._x1 = this._y1 = null;
+ this._ = "";
+}
+function path() {
+ return new Path();
+}
+Path.prototype = path.prototype = {
+ constructor: Path,
+ moveTo: function(x4, y4) {
+ this._ += "M" + (this._x0 = this._x1 = +x4) + "," + (this._y0 = this._y1 = +y4);
+ },
+ closePath: function() {
+ if (this._x1 !== null) {
+ this._x1 = this._x0, this._y1 = this._y0;
+ this._ += "Z";
+ }
+ },
+ lineTo: function(x4, y4) {
+ this._ += "L" + (this._x1 = +x4) + "," + (this._y1 = +y4);
+ },
+ quadraticCurveTo: function(x1, y1, x4, y4) {
+ this._ += "Q" + +x1 + "," + +y1 + "," + (this._x1 = +x4) + "," + (this._y1 = +y4);
+ },
+ bezierCurveTo: function(x1, y1, x22, y22, x4, y4) {
+ this._ += "C" + +x1 + "," + +y1 + "," + +x22 + "," + +y22 + "," + (this._x1 = +x4) + "," + (this._y1 = +y4);
+ },
+ arcTo: function(x1, y1, x22, y22, r) {
+ x1 = +x1, y1 = +y1, x22 = +x22, y22 = +y22, r = +r;
+ var x0 = this._x1, y0 = this._y1, x21 = x22 - x1, y21 = y22 - y1, x01 = x0 - x1, y01 = y0 - y1, l01_2 = x01 * x01 + y01 * y01;
+ if (r < 0)
+ throw new Error("negative radius: " + r);
+ if (this._x1 === null) {
+ this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
+ } else if (!(l01_2 > epsilon))
+ ;
+ else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon) || !r) {
+ this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
+ } else {
+ var x20 = x22 - x0, y20 = y22 - y0, l21_2 = x21 * x21 + y21 * y21, l20_2 = x20 * x20 + y20 * y20, l21 = Math.sqrt(l21_2), l01 = Math.sqrt(l01_2), l2 = r * Math.tan((pi - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2), t01 = l2 / l01, t21 = l2 / l21;
+ if (Math.abs(t01 - 1) > epsilon) {
+ this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
+ }
+ this._ += "A" + r + "," + r + ",0,0," + +(y01 * x20 > x01 * y20) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
+ }
+ },
+ arc: function(x4, y4, r, a0, a1, ccw) {
+ x4 = +x4, y4 = +y4, r = +r, ccw = !!ccw;
+ var dx = r * Math.cos(a0), dy = r * Math.sin(a0), x0 = x4 + dx, y0 = y4 + dy, cw = 1 ^ ccw, da = ccw ? a0 - a1 : a1 - a0;
+ if (r < 0)
+ throw new Error("negative radius: " + r);
+ if (this._x1 === null) {
+ this._ += "M" + x0 + "," + y0;
+ } else if (Math.abs(this._x1 - x0) > epsilon || Math.abs(this._y1 - y0) > epsilon) {
+ this._ += "L" + x0 + "," + y0;
+ }
+ if (!r)
+ return;
+ if (da < 0)
+ da = da % tau + tau;
+ if (da > tauEpsilon) {
+ this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x4 - dx) + "," + (y4 - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
+ } else if (da > epsilon) {
+ this._ += "A" + r + "," + r + ",0," + +(da >= pi) + "," + cw + "," + (this._x1 = x4 + r * Math.cos(a1)) + "," + (this._y1 = y4 + r * Math.sin(a1));
+ }
+ },
+ rect: function(x4, y4, w, h) {
+ this._ += "M" + (this._x0 = this._x1 = +x4) + "," + (this._y0 = this._y1 = +y4) + "h" + +w + "v" + +h + "h" + -w + "Z";
+ },
+ toString: function() {
+ return this._;
+ }
+};
+var path_default = path;
+
+// node_modules/d3-force/src/center.js
+function center_default(x4, y4) {
+ var nodes, strength = 1;
+ if (x4 == null)
+ x4 = 0;
+ if (y4 == null)
+ y4 = 0;
+ function force() {
+ var i, n2 = nodes.length, node, sx = 0, sy = 0;
+ for (i = 0; i < n2; ++i) {
+ node = nodes[i], sx += node.x, sy += node.y;
+ }
+ for (sx = (sx / n2 - x4) * strength, sy = (sy / n2 - y4) * strength, i = 0; i < n2; ++i) {
+ node = nodes[i], node.x -= sx, node.y -= sy;
+ }
+ }
+ force.initialize = function(_) {
+ nodes = _;
+ };
+ force.x = function(_) {
+ return arguments.length ? (x4 = +_, force) : x4;
+ };
+ force.y = function(_) {
+ return arguments.length ? (y4 = +_, force) : y4;
+ };
+ force.strength = function(_) {
+ return arguments.length ? (strength = +_, force) : strength;
+ };
+ return force;
+}
+
+// node_modules/d3-quadtree/src/add.js
+function add_default(d) {
+ const x4 = +this._x.call(null, d), y4 = +this._y.call(null, d);
+ return add(this.cover(x4, y4), x4, y4, d);
+}
+function add(tree, x4, y4, d) {
+ if (isNaN(x4) || isNaN(y4))
+ return tree;
+ var parent, node = tree._root, leaf = { data: d }, x0 = tree._x0, y0 = tree._y0, x1 = tree._x1, y1 = tree._y1, xm, ym, xp, yp, right, bottom, i, j;
+ if (!node)
+ return tree._root = leaf, tree;
+ while (node.length) {
+ if (right = x4 >= (xm = (x0 + x1) / 2))
+ x0 = xm;
+ else
+ x1 = xm;
+ if (bottom = y4 >= (ym = (y0 + y1) / 2))
+ y0 = ym;
+ else
+ y1 = ym;
+ if (parent = node, !(node = node[i = bottom << 1 | right]))
+ return parent[i] = leaf, tree;
+ }
+ xp = +tree._x.call(null, node.data);
+ yp = +tree._y.call(null, node.data);
+ if (x4 === xp && y4 === yp)
+ return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
+ do {
+ parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);
+ if (right = x4 >= (xm = (x0 + x1) / 2))
+ x0 = xm;
+ else
+ x1 = xm;
+ if (bottom = y4 >= (ym = (y0 + y1) / 2))
+ y0 = ym;
+ else
+ y1 = ym;
+ } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | xp >= xm));
+ return parent[j] = node, parent[i] = leaf, tree;
+}
+function addAll(data) {
+ var d, i, n2 = data.length, x4, y4, xz = new Array(n2), yz = new Array(n2), x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
+ for (i = 0; i < n2; ++i) {
+ if (isNaN(x4 = +this._x.call(null, d = data[i])) || isNaN(y4 = +this._y.call(null, d)))
+ continue;
+ xz[i] = x4;
+ yz[i] = y4;
+ if (x4 < x0)
+ x0 = x4;
+ if (x4 > x1)
+ x1 = x4;
+ if (y4 < y0)
+ y0 = y4;
+ if (y4 > y1)
+ y1 = y4;
+ }
+ if (x0 > x1 || y0 > y1)
+ return this;
+ this.cover(x0, y0).cover(x1, y1);
+ for (i = 0; i < n2; ++i) {
+ add(this, xz[i], yz[i], data[i]);
+ }
+ return this;
+}
+
+// node_modules/d3-quadtree/src/cover.js
+function cover_default(x4, y4) {
+ if (isNaN(x4 = +x4) || isNaN(y4 = +y4))
+ return this;
+ var x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1;
+ if (isNaN(x0)) {
+ x1 = (x0 = Math.floor(x4)) + 1;
+ y1 = (y0 = Math.floor(y4)) + 1;
+ } else {
+ var z = x1 - x0 || 1, node = this._root, parent, i;
+ while (x0 > x4 || x4 >= x1 || y0 > y4 || y4 >= y1) {
+ i = (y4 < y0) << 1 | x4 < x0;
+ parent = new Array(4), parent[i] = node, node = parent, z *= 2;
+ switch (i) {
+ case 0:
+ x1 = x0 + z, y1 = y0 + z;
+ break;
+ case 1:
+ x0 = x1 - z, y1 = y0 + z;
+ break;
+ case 2:
+ x1 = x0 + z, y0 = y1 - z;
+ break;
+ case 3:
+ x0 = x1 - z, y0 = y1 - z;
+ break;
+ }
+ }
+ if (this._root && this._root.length)
+ this._root = node;
+ }
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ return this;
+}
+
+// node_modules/d3-quadtree/src/data.js
+function data_default2() {
+ var data = [];
+ this.visit(function(node) {
+ if (!node.length)
+ do
+ data.push(node.data);
+ while (node = node.next);
+ });
+ return data;
+}
+
+// node_modules/d3-quadtree/src/extent.js
+function extent_default(_) {
+ return arguments.length ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1]) : isNaN(this._x0) ? void 0 : [[this._x0, this._y0], [this._x1, this._y1]];
+}
+
+// node_modules/d3-quadtree/src/quad.js
+function quad_default(node, x0, y0, x1, y1) {
+ this.node = node;
+ this.x0 = x0;
+ this.y0 = y0;
+ this.x1 = x1;
+ this.y1 = y1;
+}
+
+// node_modules/d3-quadtree/src/find.js
+function find_default(x4, y4, radius) {
+ var data, x0 = this._x0, y0 = this._y0, x1, y1, x22, y22, x32 = this._x1, y32 = this._y1, quads = [], node = this._root, q, i;
+ if (node)
+ quads.push(new quad_default(node, x0, y0, x32, y32));
+ if (radius == null)
+ radius = Infinity;
+ else {
+ x0 = x4 - radius, y0 = y4 - radius;
+ x32 = x4 + radius, y32 = y4 + radius;
+ radius *= radius;
+ }
+ while (q = quads.pop()) {
+ if (!(node = q.node) || (x1 = q.x0) > x32 || (y1 = q.y0) > y32 || (x22 = q.x1) < x0 || (y22 = q.y1) < y0)
+ continue;
+ if (node.length) {
+ var xm = (x1 + x22) / 2, ym = (y1 + y22) / 2;
+ quads.push(
+ new quad_default(node[3], xm, ym, x22, y22),
+ new quad_default(node[2], x1, ym, xm, y22),
+ new quad_default(node[1], xm, y1, x22, ym),
+ new quad_default(node[0], x1, y1, xm, ym)
+ );
+ if (i = (y4 >= ym) << 1 | x4 >= xm) {
+ q = quads[quads.length - 1];
+ quads[quads.length - 1] = quads[quads.length - 1 - i];
+ quads[quads.length - 1 - i] = q;
+ }
+ } else {
+ var dx = x4 - +this._x.call(null, node.data), dy = y4 - +this._y.call(null, node.data), d2 = dx * dx + dy * dy;
+ if (d2 < radius) {
+ var d = Math.sqrt(radius = d2);
+ x0 = x4 - d, y0 = y4 - d;
+ x32 = x4 + d, y32 = y4 + d;
+ data = node.data;
+ }
+ }
+ }
+ return data;
+}
+
+// node_modules/d3-quadtree/src/remove.js
+function remove_default3(d) {
+ if (isNaN(x4 = +this._x.call(null, d)) || isNaN(y4 = +this._y.call(null, d)))
+ return this;
+ var parent, node = this._root, retainer, previous, next, x0 = this._x0, y0 = this._y0, x1 = this._x1, y1 = this._y1, x4, y4, xm, ym, right, bottom, i, j;
+ if (!node)
+ return this;
+ if (node.length)
+ while (true) {
+ if (right = x4 >= (xm = (x0 + x1) / 2))
+ x0 = xm;
+ else
+ x1 = xm;
+ if (bottom = y4 >= (ym = (y0 + y1) / 2))
+ y0 = ym;
+ else
+ y1 = ym;
+ if (!(parent = node, node = node[i = bottom << 1 | right]))
+ return this;
+ if (!node.length)
+ break;
+ if (parent[i + 1 & 3] || parent[i + 2 & 3] || parent[i + 3 & 3])
+ retainer = parent, j = i;
+ }
+ while (node.data !== d)
+ if (!(previous = node, node = node.next))
+ return this;
+ if (next = node.next)
+ delete node.next;
+ if (previous)
+ return next ? previous.next = next : delete previous.next, this;
+ if (!parent)
+ return this._root = next, this;
+ next ? parent[i] = next : delete parent[i];
+ if ((node = parent[0] || parent[1] || parent[2] || parent[3]) && node === (parent[3] || parent[2] || parent[1] || parent[0]) && !node.length) {
+ if (retainer)
+ retainer[j] = node;
+ else
+ this._root = node;
+ }
+ return this;
+}
+function removeAll(data) {
+ for (var i = 0, n2 = data.length; i < n2; ++i)
+ this.remove(data[i]);
+ return this;
+}
+
+// node_modules/d3-quadtree/src/root.js
+function root_default() {
+ return this._root;
+}
+
+// node_modules/d3-quadtree/src/size.js
+function size_default2() {
+ var size = 0;
+ this.visit(function(node) {
+ if (!node.length)
+ do
+ ++size;
+ while (node = node.next);
+ });
+ return size;
+}
+
+// node_modules/d3-quadtree/src/visit.js
+function visit_default(callback) {
+ var quads = [], q, node = this._root, child, x0, y0, x1, y1;
+ if (node)
+ quads.push(new quad_default(node, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {
+ var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[3])
+ quads.push(new quad_default(child, xm, ym, x1, y1));
+ if (child = node[2])
+ quads.push(new quad_default(child, x0, ym, xm, y1));
+ if (child = node[1])
+ quads.push(new quad_default(child, xm, y0, x1, ym));
+ if (child = node[0])
+ quads.push(new quad_default(child, x0, y0, xm, ym));
+ }
+ }
+ return this;
+}
+
+// node_modules/d3-quadtree/src/visitAfter.js
+function visitAfter_default(callback) {
+ var quads = [], next = [], q;
+ if (this._root)
+ quads.push(new quad_default(this._root, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ var node = q.node;
+ if (node.length) {
+ var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[0])
+ quads.push(new quad_default(child, x0, y0, xm, ym));
+ if (child = node[1])
+ quads.push(new quad_default(child, xm, y0, x1, ym));
+ if (child = node[2])
+ quads.push(new quad_default(child, x0, ym, xm, y1));
+ if (child = node[3])
+ quads.push(new quad_default(child, xm, ym, x1, y1));
+ }
+ next.push(q);
+ }
+ while (q = next.pop()) {
+ callback(q.node, q.x0, q.y0, q.x1, q.y1);
+ }
+ return this;
+}
+
+// node_modules/d3-quadtree/src/x.js
+function defaultX(d) {
+ return d[0];
+}
+function x_default(_) {
+ return arguments.length ? (this._x = _, this) : this._x;
+}
+
+// node_modules/d3-quadtree/src/y.js
+function defaultY(d) {
+ return d[1];
+}
+function y_default(_) {
+ return arguments.length ? (this._y = _, this) : this._y;
+}
+
+// node_modules/d3-quadtree/src/quadtree.js
+function quadtree(nodes, x4, y4) {
+ var tree = new Quadtree(x4 == null ? defaultX : x4, y4 == null ? defaultY : y4, NaN, NaN, NaN, NaN);
+ return nodes == null ? tree : tree.addAll(nodes);
+}
+function Quadtree(x4, y4, x0, y0, x1, y1) {
+ this._x = x4;
+ this._y = y4;
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ this._root = void 0;
+}
+function leaf_copy(leaf) {
+ var copy3 = { data: leaf.data }, next = copy3;
+ while (leaf = leaf.next)
+ next = next.next = { data: leaf.data };
+ return copy3;
+}
+var treeProto = quadtree.prototype = Quadtree.prototype;
+treeProto.copy = function() {
+ var copy3 = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1), node = this._root, nodes, child;
+ if (!node)
+ return copy3;
+ if (!node.length)
+ return copy3._root = leaf_copy(node), copy3;
+ nodes = [{ source: node, target: copy3._root = new Array(4) }];
+ while (node = nodes.pop()) {
+ for (var i = 0; i < 4; ++i) {
+ if (child = node.source[i]) {
+ if (child.length)
+ nodes.push({ source: child, target: node.target[i] = new Array(4) });
+ else
+ node.target[i] = leaf_copy(child);
+ }
+ }
+ }
+ return copy3;
+};
+treeProto.add = add_default;
+treeProto.addAll = addAll;
+treeProto.cover = cover_default;
+treeProto.data = data_default2;
+treeProto.extent = extent_default;
+treeProto.find = find_default;
+treeProto.remove = remove_default3;
+treeProto.removeAll = removeAll;
+treeProto.root = root_default;
+treeProto.size = size_default2;
+treeProto.visit = visit_default;
+treeProto.visitAfter = visitAfter_default;
+treeProto.x = x_default;
+treeProto.y = y_default;
+
+// node_modules/d3-force/src/constant.js
+function constant_default5(x4) {
+ return function() {
+ return x4;
+ };
+}
+
+// node_modules/d3-force/src/jiggle.js
+function jiggle_default(random) {
+ return (random() - 0.5) * 1e-6;
+}
+
+// node_modules/d3-force/src/collide.js
+function x(d) {
+ return d.x + d.vx;
+}
+function y(d) {
+ return d.y + d.vy;
+}
+function collide_default(radius) {
+ var nodes, radii, random, strength = 1, iterations = 1;
+ if (typeof radius !== "function")
+ radius = constant_default5(radius == null ? 1 : +radius);
+ function force() {
+ var i, n2 = nodes.length, tree, node, xi, yi, ri, ri2;
+ for (var k = 0; k < iterations; ++k) {
+ tree = quadtree(nodes, x, y).visitAfter(prepare);
+ for (i = 0; i < n2; ++i) {
+ node = nodes[i];
+ ri = radii[node.index], ri2 = ri * ri;
+ xi = node.x + node.vx;
+ yi = node.y + node.vy;
+ tree.visit(apply);
+ }
+ }
+ function apply(quad, x0, y0, x1, y1) {
+ var data = quad.data, rj = quad.r, r = ri + rj;
+ if (data) {
+ if (data.index > node.index) {
+ var x4 = xi - data.x - data.vx, y4 = yi - data.y - data.vy, l2 = x4 * x4 + y4 * y4;
+ if (l2 < r * r) {
+ if (x4 === 0)
+ x4 = jiggle_default(random), l2 += x4 * x4;
+ if (y4 === 0)
+ y4 = jiggle_default(random), l2 += y4 * y4;
+ l2 = (r - (l2 = Math.sqrt(l2))) / l2 * strength;
+ node.vx += (x4 *= l2) * (r = (rj *= rj) / (ri2 + rj));
+ node.vy += (y4 *= l2) * r;
+ data.vx -= x4 * (r = 1 - r);
+ data.vy -= y4 * r;
+ }
+ }
+ return;
+ }
+ return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;
+ }
+ }
+ function prepare(quad) {
+ if (quad.data)
+ return quad.r = radii[quad.data.index];
+ for (var i = quad.r = 0; i < 4; ++i) {
+ if (quad[i] && quad[i].r > quad.r) {
+ quad.r = quad[i].r;
+ }
+ }
+ }
+ function initialize() {
+ if (!nodes)
+ return;
+ var i, n2 = nodes.length, node;
+ radii = new Array(n2);
+ for (i = 0; i < n2; ++i)
+ node = nodes[i], radii[node.index] = +radius(node, i, nodes);
+ }
+ force.initialize = function(_nodes, _random) {
+ nodes = _nodes;
+ random = _random;
+ initialize();
+ };
+ force.iterations = function(_) {
+ return arguments.length ? (iterations = +_, force) : iterations;
+ };
+ force.strength = function(_) {
+ return arguments.length ? (strength = +_, force) : strength;
+ };
+ force.radius = function(_) {
+ return arguments.length ? (radius = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : radius;
+ };
+ return force;
+}
+
+// node_modules/d3-force/src/link.js
+function index(d) {
+ return d.index;
+}
+function find2(nodeById, nodeId) {
+ var node = nodeById.get(nodeId);
+ if (!node)
+ throw new Error("node not found: " + nodeId);
+ return node;
+}
+function link_default(links) {
+ var id2 = index, strength = defaultStrength, strengths, distance = constant_default5(30), distances, nodes, count2, bias, random, iterations = 1;
+ if (links == null)
+ links = [];
+ function defaultStrength(link2) {
+ return 1 / Math.min(count2[link2.source.index], count2[link2.target.index]);
+ }
+ function force(alpha) {
+ for (var k = 0, n2 = links.length; k < iterations; ++k) {
+ for (var i = 0, link2, source, target, x4, y4, l2, b; i < n2; ++i) {
+ link2 = links[i], source = link2.source, target = link2.target;
+ x4 = target.x + target.vx - source.x - source.vx || jiggle_default(random);
+ y4 = target.y + target.vy - source.y - source.vy || jiggle_default(random);
+ l2 = Math.sqrt(x4 * x4 + y4 * y4);
+ l2 = (l2 - distances[i]) / l2 * alpha * strengths[i];
+ x4 *= l2, y4 *= l2;
+ target.vx -= x4 * (b = bias[i]);
+ target.vy -= y4 * b;
+ source.vx += x4 * (b = 1 - b);
+ source.vy += y4 * b;
+ }
+ }
+ }
+ function initialize() {
+ if (!nodes)
+ return;
+ var i, n2 = nodes.length, m2 = links.length, nodeById = new Map(nodes.map((d, i2) => [id2(d, i2, nodes), d])), link2;
+ for (i = 0, count2 = new Array(n2); i < m2; ++i) {
+ link2 = links[i], link2.index = i;
+ if (typeof link2.source !== "object")
+ link2.source = find2(nodeById, link2.source);
+ if (typeof link2.target !== "object")
+ link2.target = find2(nodeById, link2.target);
+ count2[link2.source.index] = (count2[link2.source.index] || 0) + 1;
+ count2[link2.target.index] = (count2[link2.target.index] || 0) + 1;
+ }
+ for (i = 0, bias = new Array(m2); i < m2; ++i) {
+ link2 = links[i], bias[i] = count2[link2.source.index] / (count2[link2.source.index] + count2[link2.target.index]);
+ }
+ strengths = new Array(m2), initializeStrength();
+ distances = new Array(m2), initializeDistance();
+ }
+ function initializeStrength() {
+ if (!nodes)
+ return;
+ for (var i = 0, n2 = links.length; i < n2; ++i) {
+ strengths[i] = +strength(links[i], i, links);
+ }
+ }
+ function initializeDistance() {
+ if (!nodes)
+ return;
+ for (var i = 0, n2 = links.length; i < n2; ++i) {
+ distances[i] = +distance(links[i], i, links);
+ }
+ }
+ force.initialize = function(_nodes, _random) {
+ nodes = _nodes;
+ random = _random;
+ initialize();
+ };
+ force.links = function(_) {
+ return arguments.length ? (links = _, initialize(), force) : links;
+ };
+ force.id = function(_) {
+ return arguments.length ? (id2 = _, force) : id2;
+ };
+ force.iterations = function(_) {
+ return arguments.length ? (iterations = +_, force) : iterations;
+ };
+ force.strength = function(_) {
+ return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default5(+_), initializeStrength(), force) : strength;
+ };
+ force.distance = function(_) {
+ return arguments.length ? (distance = typeof _ === "function" ? _ : constant_default5(+_), initializeDistance(), force) : distance;
+ };
+ return force;
+}
+
+// node_modules/d3-force/src/lcg.js
+var a = 1664525;
+var c = 1013904223;
+var m = 4294967296;
+function lcg_default() {
+ let s2 = 1;
+ return () => (s2 = (a * s2 + c) % m) / m;
+}
+
+// node_modules/d3-force/src/simulation.js
+function x2(d) {
+ return d.x;
+}
+function y2(d) {
+ return d.y;
+}
+var initialRadius = 10;
+var initialAngle = Math.PI * (3 - Math.sqrt(5));
+function simulation_default(nodes) {
+ var simulation, alpha = 1, alphaMin = 1e-3, alphaDecay = 1 - Math.pow(alphaMin, 1 / 300), alphaTarget = 0, velocityDecay = 0.6, forces = /* @__PURE__ */ new Map(), stepper = timer(step), event = dispatch_default("tick", "end"), random = lcg_default();
+ if (nodes == null)
+ nodes = [];
+ function step() {
+ tick2();
+ event.call("tick", simulation);
+ if (alpha < alphaMin) {
+ stepper.stop();
+ event.call("end", simulation);
+ }
+ }
+ function tick2(iterations) {
+ var i, n2 = nodes.length, node;
+ if (iterations === void 0)
+ iterations = 1;
+ for (var k = 0; k < iterations; ++k) {
+ alpha += (alphaTarget - alpha) * alphaDecay;
+ forces.forEach(function(force) {
+ force(alpha);
+ });
+ for (i = 0; i < n2; ++i) {
+ node = nodes[i];
+ if (node.fx == null)
+ node.x += node.vx *= velocityDecay;
+ else
+ node.x = node.fx, node.vx = 0;
+ if (node.fy == null)
+ node.y += node.vy *= velocityDecay;
+ else
+ node.y = node.fy, node.vy = 0;
+ }
+ }
+ return simulation;
+ }
+ function initializeNodes() {
+ for (var i = 0, n2 = nodes.length, node; i < n2; ++i) {
+ node = nodes[i], node.index = i;
+ if (node.fx != null)
+ node.x = node.fx;
+ if (node.fy != null)
+ node.y = node.fy;
+ if (isNaN(node.x) || isNaN(node.y)) {
+ var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;
+ node.x = radius * Math.cos(angle);
+ node.y = radius * Math.sin(angle);
+ }
+ if (isNaN(node.vx) || isNaN(node.vy)) {
+ node.vx = node.vy = 0;
+ }
+ }
+ }
+ function initializeForce(force) {
+ if (force.initialize)
+ force.initialize(nodes, random);
+ return force;
+ }
+ initializeNodes();
+ return simulation = {
+ tick: tick2,
+ restart: function() {
+ return stepper.restart(step), simulation;
+ },
+ stop: function() {
+ return stepper.stop(), simulation;
+ },
+ nodes: function(_) {
+ return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;
+ },
+ alpha: function(_) {
+ return arguments.length ? (alpha = +_, simulation) : alpha;
+ },
+ alphaMin: function(_) {
+ return arguments.length ? (alphaMin = +_, simulation) : alphaMin;
+ },
+ alphaDecay: function(_) {
+ return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;
+ },
+ alphaTarget: function(_) {
+ return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;
+ },
+ velocityDecay: function(_) {
+ return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;
+ },
+ randomSource: function(_) {
+ return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;
+ },
+ force: function(name, _) {
+ return arguments.length > 1 ? (_ == null ? forces.delete(name) : forces.set(name, initializeForce(_)), simulation) : forces.get(name);
+ },
+ find: function(x4, y4, radius) {
+ var i = 0, n2 = nodes.length, dx, dy, d2, node, closest;
+ if (radius == null)
+ radius = Infinity;
+ else
+ radius *= radius;
+ for (i = 0; i < n2; ++i) {
+ node = nodes[i];
+ dx = x4 - node.x;
+ dy = y4 - node.y;
+ d2 = dx * dx + dy * dy;
+ if (d2 < radius)
+ closest = node, radius = d2;
+ }
+ return closest;
+ },
+ on: function(name, _) {
+ return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);
+ }
+ };
+}
+
+// node_modules/d3-force/src/manyBody.js
+function manyBody_default() {
+ var nodes, node, random, alpha, strength = constant_default5(-30), strengths, distanceMin2 = 1, distanceMax2 = Infinity, theta2 = 0.81;
+ function force(_) {
+ var i, n2 = nodes.length, tree = quadtree(nodes, x2, y2).visitAfter(accumulate);
+ for (alpha = _, i = 0; i < n2; ++i)
+ node = nodes[i], tree.visit(apply);
+ }
+ function initialize() {
+ if (!nodes)
+ return;
+ var i, n2 = nodes.length, node2;
+ strengths = new Array(n2);
+ for (i = 0; i < n2; ++i)
+ node2 = nodes[i], strengths[node2.index] = +strength(node2, i, nodes);
+ }
+ function accumulate(quad) {
+ var strength2 = 0, q, c3, weight = 0, x4, y4, i;
+ if (quad.length) {
+ for (x4 = y4 = i = 0; i < 4; ++i) {
+ if ((q = quad[i]) && (c3 = Math.abs(q.value))) {
+ strength2 += q.value, weight += c3, x4 += c3 * q.x, y4 += c3 * q.y;
+ }
+ }
+ quad.x = x4 / weight;
+ quad.y = y4 / weight;
+ } else {
+ q = quad;
+ q.x = q.data.x;
+ q.y = q.data.y;
+ do
+ strength2 += strengths[q.data.index];
+ while (q = q.next);
+ }
+ quad.value = strength2;
+ }
+ function apply(quad, x1, _, x22) {
+ if (!quad.value)
+ return true;
+ var x4 = quad.x - node.x, y4 = quad.y - node.y, w = x22 - x1, l2 = x4 * x4 + y4 * y4;
+ if (w * w / theta2 < l2) {
+ if (l2 < distanceMax2) {
+ if (x4 === 0)
+ x4 = jiggle_default(random), l2 += x4 * x4;
+ if (y4 === 0)
+ y4 = jiggle_default(random), l2 += y4 * y4;
+ if (l2 < distanceMin2)
+ l2 = Math.sqrt(distanceMin2 * l2);
+ node.vx += x4 * quad.value * alpha / l2;
+ node.vy += y4 * quad.value * alpha / l2;
+ }
+ return true;
+ } else if (quad.length || l2 >= distanceMax2)
+ return;
+ if (quad.data !== node || quad.next) {
+ if (x4 === 0)
+ x4 = jiggle_default(random), l2 += x4 * x4;
+ if (y4 === 0)
+ y4 = jiggle_default(random), l2 += y4 * y4;
+ if (l2 < distanceMin2)
+ l2 = Math.sqrt(distanceMin2 * l2);
+ }
+ do
+ if (quad.data !== node) {
+ w = strengths[quad.data.index] * alpha / l2;
+ node.vx += x4 * w;
+ node.vy += y4 * w;
+ }
+ while (quad = quad.next);
+ }
+ force.initialize = function(_nodes, _random) {
+ nodes = _nodes;
+ random = _random;
+ initialize();
+ };
+ force.strength = function(_) {
+ return arguments.length ? (strength = typeof _ === "function" ? _ : constant_default5(+_), initialize(), force) : strength;
+ };
+ force.distanceMin = function(_) {
+ return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);
+ };
+ force.distanceMax = function(_) {
+ return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);
+ };
+ force.theta = function(_) {
+ return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);
+ };
+ return force;
+}
+
+// node_modules/d3-format/src/formatDecimal.js
+function formatDecimal_default(x4) {
+ return Math.abs(x4 = Math.round(x4)) >= 1e21 ? x4.toLocaleString("en").replace(/,/g, "") : x4.toString(10);
+}
+function formatDecimalParts(x4, p) {
+ if ((i = (x4 = p ? x4.toExponential(p - 1) : x4.toExponential()).indexOf("e")) < 0)
+ return null;
+ var i, coefficient = x4.slice(0, i);
+ return [
+ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
+ +x4.slice(i + 1)
+ ];
+}
+
+// node_modules/d3-format/src/exponent.js
+function exponent_default(x4) {
+ return x4 = formatDecimalParts(Math.abs(x4)), x4 ? x4[1] : NaN;
+}
+
+// node_modules/d3-format/src/formatGroup.js
+function formatGroup_default(grouping, thousands) {
+ return function(value, width) {
+ var i = value.length, t = [], j = 0, g = grouping[0], length = 0;
+ while (i > 0 && g > 0) {
+ if (length + g + 1 > width)
+ g = Math.max(1, width - length);
+ t.push(value.substring(i -= g, i + g));
+ if ((length += g + 1) > width)
+ break;
+ g = grouping[j = (j + 1) % grouping.length];
+ }
+ return t.reverse().join(thousands);
+ };
+}
+
+// node_modules/d3-format/src/formatNumerals.js
+function formatNumerals_default(numerals) {
+ return function(value) {
+ return value.replace(/[0-9]/g, function(i) {
+ return numerals[+i];
+ });
+ };
+}
+
+// node_modules/d3-format/src/formatSpecifier.js
+var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
+function formatSpecifier(specifier) {
+ if (!(match2 = re.exec(specifier)))
+ throw new Error("invalid format: " + specifier);
+ var match2;
+ return new FormatSpecifier({
+ fill: match2[1],
+ align: match2[2],
+ sign: match2[3],
+ symbol: match2[4],
+ zero: match2[5],
+ width: match2[6],
+ comma: match2[7],
+ precision: match2[8] && match2[8].slice(1),
+ trim: match2[9],
+ type: match2[10]
+ });
+}
+formatSpecifier.prototype = FormatSpecifier.prototype;
+function FormatSpecifier(specifier) {
+ this.fill = specifier.fill === void 0 ? " " : specifier.fill + "";
+ this.align = specifier.align === void 0 ? ">" : specifier.align + "";
+ this.sign = specifier.sign === void 0 ? "-" : specifier.sign + "";
+ this.symbol = specifier.symbol === void 0 ? "" : specifier.symbol + "";
+ this.zero = !!specifier.zero;
+ this.width = specifier.width === void 0 ? void 0 : +specifier.width;
+ this.comma = !!specifier.comma;
+ this.precision = specifier.precision === void 0 ? void 0 : +specifier.precision;
+ this.trim = !!specifier.trim;
+ this.type = specifier.type === void 0 ? "" : specifier.type + "";
+}
+FormatSpecifier.prototype.toString = function() {
+ return this.fill + this.align + this.sign + this.symbol + (this.zero ? "0" : "") + (this.width === void 0 ? "" : Math.max(1, this.width | 0)) + (this.comma ? "," : "") + (this.precision === void 0 ? "" : "." + Math.max(0, this.precision | 0)) + (this.trim ? "~" : "") + this.type;
+};
+
+// node_modules/d3-format/src/formatTrim.js
+function formatTrim_default(s2) {
+ out:
+ for (var n2 = s2.length, i = 1, i0 = -1, i1; i < n2; ++i) {
+ switch (s2[i]) {
+ case ".":
+ i0 = i1 = i;
+ break;
+ case "0":
+ if (i0 === 0)
+ i0 = i;
+ i1 = i;
+ break;
+ default:
+ if (!+s2[i])
+ break out;
+ if (i0 > 0)
+ i0 = 0;
+ break;
+ }
+ }
+ return i0 > 0 ? s2.slice(0, i0) + s2.slice(i1 + 1) : s2;
+}
+
+// node_modules/d3-format/src/formatPrefixAuto.js
+var prefixExponent;
+function formatPrefixAuto_default(x4, p) {
+ var d = formatDecimalParts(x4, p);
+ if (!d)
+ return x4 + "";
+ var coefficient = d[0], exponent = d[1], i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, n2 = coefficient.length;
+ return i === n2 ? coefficient : i > n2 ? coefficient + new Array(i - n2 + 1).join("0") : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) : "0." + new Array(1 - i).join("0") + formatDecimalParts(x4, Math.max(0, p + i - 1))[0];
+}
+
+// node_modules/d3-format/src/formatRounded.js
+function formatRounded_default(x4, p) {
+ var d = formatDecimalParts(x4, p);
+ if (!d)
+ return x4 + "";
+ var coefficient = d[0], exponent = d[1];
+ return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) : coefficient + new Array(exponent - coefficient.length + 2).join("0");
+}
+
+// node_modules/d3-format/src/formatTypes.js
+var formatTypes_default = {
+ "%": (x4, p) => (x4 * 100).toFixed(p),
+ "b": (x4) => Math.round(x4).toString(2),
+ "c": (x4) => x4 + "",
+ "d": formatDecimal_default,
+ "e": (x4, p) => x4.toExponential(p),
+ "f": (x4, p) => x4.toFixed(p),
+ "g": (x4, p) => x4.toPrecision(p),
+ "o": (x4) => Math.round(x4).toString(8),
+ "p": (x4, p) => formatRounded_default(x4 * 100, p),
+ "r": formatRounded_default,
+ "s": formatPrefixAuto_default,
+ "X": (x4) => Math.round(x4).toString(16).toUpperCase(),
+ "x": (x4) => Math.round(x4).toString(16)
+};
+
+// node_modules/d3-format/src/identity.js
+function identity_default(x4) {
+ return x4;
+}
+
+// node_modules/d3-format/src/locale.js
+var map = Array.prototype.map;
+var prefixes = ["y", "z", "a", "f", "p", "n", "\xB5", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y"];
+function locale_default(locale2) {
+ var group = locale2.grouping === void 0 || locale2.thousands === void 0 ? identity_default : formatGroup_default(map.call(locale2.grouping, Number), locale2.thousands + ""), currencyPrefix = locale2.currency === void 0 ? "" : locale2.currency[0] + "", currencySuffix = locale2.currency === void 0 ? "" : locale2.currency[1] + "", decimal = locale2.decimal === void 0 ? "." : locale2.decimal + "", numerals = locale2.numerals === void 0 ? identity_default : formatNumerals_default(map.call(locale2.numerals, String)), percent = locale2.percent === void 0 ? "%" : locale2.percent + "", minus = locale2.minus === void 0 ? "\u2212" : locale2.minus + "", nan = locale2.nan === void 0 ? "NaN" : locale2.nan + "";
+ function newFormat(specifier) {
+ specifier = formatSpecifier(specifier);
+ var fill = specifier.fill, align = specifier.align, sign = specifier.sign, symbol = specifier.symbol, zero2 = specifier.zero, width = specifier.width, comma = specifier.comma, precision = specifier.precision, trim = specifier.trim, type2 = specifier.type;
+ if (type2 === "n")
+ comma = true, type2 = "g";
+ else if (!formatTypes_default[type2])
+ precision === void 0 && (precision = 12), trim = true, type2 = "g";
+ if (zero2 || fill === "0" && align === "=")
+ zero2 = true, fill = "0", align = "=";
+ var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type2) ? "0" + type2.toLowerCase() : "", suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type2) ? percent : "";
+ var formatType = formatTypes_default[type2], maybeSuffix = /[defgprs%]/.test(type2);
+ precision = precision === void 0 ? 6 : /[gprs]/.test(type2) ? Math.max(1, Math.min(21, precision)) : Math.max(0, Math.min(20, precision));
+ function format2(value) {
+ var valuePrefix = prefix, valueSuffix = suffix, i, n2, c3;
+ if (type2 === "c") {
+ valueSuffix = formatType(value) + valueSuffix;
+ value = "";
+ } else {
+ value = +value;
+ var valueNegative = value < 0 || 1 / value < 0;
+ value = isNaN(value) ? nan : formatType(Math.abs(value), precision);
+ if (trim)
+ value = formatTrim_default(value);
+ if (valueNegative && +value === 0 && sign !== "+")
+ valueNegative = false;
+ valuePrefix = (valueNegative ? sign === "(" ? sign : minus : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
+ valueSuffix = (type2 === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
+ if (maybeSuffix) {
+ i = -1, n2 = value.length;
+ while (++i < n2) {
+ if (c3 = value.charCodeAt(i), 48 > c3 || c3 > 57) {
+ valueSuffix = (c3 === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
+ value = value.slice(0, i);
+ break;
+ }
+ }
+ }
+ }
+ if (comma && !zero2)
+ value = group(value, Infinity);
+ var length = valuePrefix.length + value.length + valueSuffix.length, padding = length < width ? new Array(width - length + 1).join(fill) : "";
+ if (comma && zero2)
+ value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
+ switch (align) {
+ case "<":
+ value = valuePrefix + value + valueSuffix + padding;
+ break;
+ case "=":
+ value = valuePrefix + padding + value + valueSuffix;
+ break;
+ case "^":
+ value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length);
+ break;
+ default:
+ value = padding + valuePrefix + value + valueSuffix;
+ break;
+ }
+ return numerals(value);
+ }
+ format2.toString = function() {
+ return specifier + "";
+ };
+ return format2;
+ }
+ function formatPrefix2(specifier, value) {
+ var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), e = Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3, k = Math.pow(10, -e), prefix = prefixes[8 + e / 3];
+ return function(value2) {
+ return f(k * value2) + prefix;
+ };
+ }
+ return {
+ format: newFormat,
+ formatPrefix: formatPrefix2
+ };
+}
+
+// node_modules/d3-format/src/defaultLocale.js
+var locale;
+var format;
+var formatPrefix;
+defaultLocale2({
+ thousands: ",",
+ grouping: [3],
+ currency: ["$", ""]
+});
+function defaultLocale2(definition) {
+ locale = locale_default(definition);
+ format = locale.format;
+ formatPrefix = locale.formatPrefix;
+ return locale;
+}
+
+// node_modules/d3-format/src/precisionFixed.js
+function precisionFixed_default(step) {
+ return Math.max(0, -exponent_default(Math.abs(step)));
+}
+
+// node_modules/d3-format/src/precisionPrefix.js
+function precisionPrefix_default(step, value) {
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent_default(value) / 3))) * 3 - exponent_default(Math.abs(step)));
+}
+
+// node_modules/d3-format/src/precisionRound.js
+function precisionRound_default(step, max4) {
+ step = Math.abs(step), max4 = Math.abs(max4) - step;
+ return Math.max(0, exponent_default(max4) - exponent_default(step)) + 1;
+}
+
+// node_modules/d3-hierarchy/src/cluster.js
+function defaultSeparation(a2, b) {
+ return a2.parent === b.parent ? 1 : 2;
+}
+function meanX(children3) {
+ return children3.reduce(meanXReduce, 0) / children3.length;
+}
+function meanXReduce(x4, c3) {
+ return x4 + c3.x;
+}
+function maxY(children3) {
+ return 1 + children3.reduce(maxYReduce, 0);
+}
+function maxYReduce(y4, c3) {
+ return Math.max(y4, c3.y);
+}
+function leafLeft(node) {
+ var children3;
+ while (children3 = node.children)
+ node = children3[0];
+ return node;
+}
+function leafRight(node) {
+ var children3;
+ while (children3 = node.children)
+ node = children3[children3.length - 1];
+ return node;
+}
+function cluster_default() {
+ var separation = defaultSeparation, dx = 1, dy = 1, nodeSize = false;
+ function cluster(root2) {
+ var previousNode, x4 = 0;
+ root2.eachAfter(function(node) {
+ var children3 = node.children;
+ if (children3) {
+ node.x = meanX(children3);
+ node.y = maxY(children3);
+ } else {
+ node.x = previousNode ? x4 += separation(node, previousNode) : 0;
+ node.y = 0;
+ previousNode = node;
+ }
+ });
+ var left = leafLeft(root2), right = leafRight(root2), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
+ return root2.eachAfter(nodeSize ? function(node) {
+ node.x = (node.x - root2.x) * dx;
+ node.y = (root2.y - node.y) * dy;
+ } : function(node) {
+ node.x = (node.x - x0) / (x1 - x0) * dx;
+ node.y = (1 - (root2.y ? node.y / root2.y : 1)) * dy;
+ });
+ }
+ cluster.separation = function(x4) {
+ return arguments.length ? (separation = x4, cluster) : separation;
+ };
+ cluster.size = function(x4) {
+ return arguments.length ? (nodeSize = false, dx = +x4[0], dy = +x4[1], cluster) : nodeSize ? null : [dx, dy];
+ };
+ cluster.nodeSize = function(x4) {
+ return arguments.length ? (nodeSize = true, dx = +x4[0], dy = +x4[1], cluster) : nodeSize ? [dx, dy] : null;
+ };
+ return cluster;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/count.js
+function count(node) {
+ var sum = 0, children3 = node.children, i = children3 && children3.length;
+ if (!i)
+ sum = 1;
+ else
+ while (--i >= 0)
+ sum += children3[i].value;
+ node.value = sum;
+}
+function count_default() {
+ return this.eachAfter(count);
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/each.js
+function each_default2(callback, that) {
+ let index2 = -1;
+ for (const node of this) {
+ callback.call(that, node, ++index2, this);
+ }
+ return this;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/eachBefore.js
+function eachBefore_default(callback, that) {
+ var node = this, nodes = [node], children3, i, index2 = -1;
+ while (node = nodes.pop()) {
+ callback.call(that, node, ++index2, this);
+ if (children3 = node.children) {
+ for (i = children3.length - 1; i >= 0; --i) {
+ nodes.push(children3[i]);
+ }
+ }
+ }
+ return this;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/eachAfter.js
+function eachAfter_default(callback, that) {
+ var node = this, nodes = [node], next = [], children3, i, n2, index2 = -1;
+ while (node = nodes.pop()) {
+ next.push(node);
+ if (children3 = node.children) {
+ for (i = 0, n2 = children3.length; i < n2; ++i) {
+ nodes.push(children3[i]);
+ }
+ }
+ }
+ while (node = next.pop()) {
+ callback.call(that, node, ++index2, this);
+ }
+ return this;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/find.js
+function find_default2(callback, that) {
+ let index2 = -1;
+ for (const node of this) {
+ if (callback.call(that, node, ++index2, this)) {
+ return node;
+ }
+ }
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/sum.js
+function sum_default(value) {
+ return this.eachAfter(function(node) {
+ var sum = +value(node.data) || 0, children3 = node.children, i = children3 && children3.length;
+ while (--i >= 0)
+ sum += children3[i].value;
+ node.value = sum;
+ });
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/sort.js
+function sort_default2(compare) {
+ return this.eachBefore(function(node) {
+ if (node.children) {
+ node.children.sort(compare);
+ }
+ });
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/path.js
+function path_default2(end) {
+ var start2 = this, ancestor = leastCommonAncestor(start2, end), nodes = [start2];
+ while (start2 !== ancestor) {
+ start2 = start2.parent;
+ nodes.push(start2);
+ }
+ var k = nodes.length;
+ while (end !== ancestor) {
+ nodes.splice(k, 0, end);
+ end = end.parent;
+ }
+ return nodes;
+}
+function leastCommonAncestor(a2, b) {
+ if (a2 === b)
+ return a2;
+ var aNodes = a2.ancestors(), bNodes = b.ancestors(), c3 = null;
+ a2 = aNodes.pop();
+ b = bNodes.pop();
+ while (a2 === b) {
+ c3 = a2;
+ a2 = aNodes.pop();
+ b = bNodes.pop();
+ }
+ return c3;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/ancestors.js
+function ancestors_default() {
+ var node = this, nodes = [node];
+ while (node = node.parent) {
+ nodes.push(node);
+ }
+ return nodes;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/descendants.js
+function descendants_default() {
+ return Array.from(this);
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/leaves.js
+function leaves_default() {
+ var leaves = [];
+ this.eachBefore(function(node) {
+ if (!node.children) {
+ leaves.push(node);
+ }
+ });
+ return leaves;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/links.js
+function links_default() {
+ var root2 = this, links = [];
+ root2.each(function(node) {
+ if (node !== root2) {
+ links.push({ source: node.parent, target: node });
+ }
+ });
+ return links;
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/iterator.js
+function* iterator_default2() {
+ var node = this, current, next = [node], children3, i, n2;
+ do {
+ current = next.reverse(), next = [];
+ while (node = current.pop()) {
+ yield node;
+ if (children3 = node.children) {
+ for (i = 0, n2 = children3.length; i < n2; ++i) {
+ next.push(children3[i]);
+ }
+ }
+ }
+ } while (next.length);
+}
+
+// node_modules/d3-hierarchy/src/hierarchy/index.js
+function hierarchy(data, children3) {
+ if (data instanceof Map) {
+ data = [void 0, data];
+ if (children3 === void 0)
+ children3 = mapChildren;
+ } else if (children3 === void 0) {
+ children3 = objectChildren;
+ }
+ var root2 = new Node(data), node, nodes = [root2], child, childs, i, n2;
+ while (node = nodes.pop()) {
+ if ((childs = children3(node.data)) && (n2 = (childs = Array.from(childs)).length)) {
+ node.children = childs;
+ for (i = n2 - 1; i >= 0; --i) {
+ nodes.push(child = childs[i] = new Node(childs[i]));
+ child.parent = node;
+ child.depth = node.depth + 1;
+ }
+ }
+ }
+ return root2.eachBefore(computeHeight);
+}
+function node_copy() {
+ return hierarchy(this).eachBefore(copyData);
+}
+function objectChildren(d) {
+ return d.children;
+}
+function mapChildren(d) {
+ return Array.isArray(d) ? d[1] : null;
+}
+function copyData(node) {
+ if (node.data.value !== void 0)
+ node.value = node.data.value;
+ node.data = node.data.data;
+}
+function computeHeight(node) {
+ var height = 0;
+ do
+ node.height = height;
+ while ((node = node.parent) && node.height < ++height);
+}
+function Node(data) {
+ this.data = data;
+ this.depth = this.height = 0;
+ this.parent = null;
+}
+Node.prototype = hierarchy.prototype = {
+ constructor: Node,
+ count: count_default,
+ each: each_default2,
+ eachAfter: eachAfter_default,
+ eachBefore: eachBefore_default,
+ find: find_default2,
+ sum: sum_default,
+ sort: sort_default2,
+ path: path_default2,
+ ancestors: ancestors_default,
+ descendants: descendants_default,
+ leaves: leaves_default,
+ links: links_default,
+ copy: node_copy,
+ [Symbol.iterator]: iterator_default2
+};
+
+// node_modules/d3-hierarchy/src/accessors.js
+function required(f) {
+ if (typeof f !== "function")
+ throw new Error();
+ return f;
+}
+
+// node_modules/d3-hierarchy/src/constant.js
+function constantZero() {
+ return 0;
+}
+function constant_default6(x4) {
+ return function() {
+ return x4;
+ };
+}
+
+// node_modules/d3-hierarchy/src/treemap/round.js
+function round_default2(node) {
+ node.x0 = Math.round(node.x0);
+ node.y0 = Math.round(node.y0);
+ node.x1 = Math.round(node.x1);
+ node.y1 = Math.round(node.y1);
+}
+
+// node_modules/d3-hierarchy/src/treemap/dice.js
+function dice_default(parent, x0, y0, x1, y1) {
+ var nodes = parent.children, node, i = -1, n2 = nodes.length, k = parent.value && (x1 - x0) / parent.value;
+ while (++i < n2) {
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
+ node.x0 = x0, node.x1 = x0 += node.value * k;
+ }
+}
+
+// node_modules/d3-hierarchy/src/partition.js
+function partition_default() {
+ var dx = 1, dy = 1, padding = 0, round = false;
+ function partition(root2) {
+ var n2 = root2.height + 1;
+ root2.x0 = root2.y0 = padding;
+ root2.x1 = dx;
+ root2.y1 = dy / n2;
+ root2.eachBefore(positionNode(dy, n2));
+ if (round)
+ root2.eachBefore(round_default2);
+ return root2;
+ }
+ function positionNode(dy2, n2) {
+ return function(node) {
+ if (node.children) {
+ dice_default(node, node.x0, dy2 * (node.depth + 1) / n2, node.x1, dy2 * (node.depth + 2) / n2);
+ }
+ var x0 = node.x0, y0 = node.y0, x1 = node.x1 - padding, y1 = node.y1 - padding;
+ if (x1 < x0)
+ x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0)
+ y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ };
+ }
+ partition.round = function(x4) {
+ return arguments.length ? (round = !!x4, partition) : round;
+ };
+ partition.size = function(x4) {
+ return arguments.length ? (dx = +x4[0], dy = +x4[1], partition) : [dx, dy];
+ };
+ partition.padding = function(x4) {
+ return arguments.length ? (padding = +x4, partition) : padding;
+ };
+ return partition;
+}
+
+// node_modules/d3-hierarchy/src/stratify.js
+var preroot = { depth: -1 };
+var ambiguous = {};
+function defaultId(d) {
+ return d.id;
+}
+function defaultParentId(d) {
+ return d.parentId;
+}
+function stratify_default() {
+ var id2 = defaultId, parentId = defaultParentId;
+ function stratify2(data) {
+ var nodes = Array.from(data), n2 = nodes.length, d, i, root2, parent, node, nodeId, nodeKey, nodeByKey = /* @__PURE__ */ new Map();
+ for (i = 0; i < n2; ++i) {
+ d = nodes[i], node = nodes[i] = new Node(d);
+ if ((nodeId = id2(d, i, data)) != null && (nodeId += "")) {
+ nodeKey = node.id = nodeId;
+ nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);
+ }
+ if ((nodeId = parentId(d, i, data)) != null && (nodeId += "")) {
+ node.parent = nodeId;
+ }
+ }
+ for (i = 0; i < n2; ++i) {
+ node = nodes[i];
+ if (nodeId = node.parent) {
+ parent = nodeByKey.get(nodeId);
+ if (!parent)
+ throw new Error("missing: " + nodeId);
+ if (parent === ambiguous)
+ throw new Error("ambiguous: " + nodeId);
+ if (parent.children)
+ parent.children.push(node);
+ else
+ parent.children = [node];
+ node.parent = parent;
+ } else {
+ if (root2)
+ throw new Error("multiple roots");
+ root2 = node;
+ }
+ }
+ if (!root2)
+ throw new Error("no root");
+ root2.parent = preroot;
+ root2.eachBefore(function(node2) {
+ node2.depth = node2.parent.depth + 1;
+ --n2;
+ }).eachBefore(computeHeight);
+ root2.parent = null;
+ if (n2 > 0)
+ throw new Error("cycle");
+ return root2;
+ }
+ stratify2.id = function(x4) {
+ return arguments.length ? (id2 = required(x4), stratify2) : id2;
+ };
+ stratify2.parentId = function(x4) {
+ return arguments.length ? (parentId = required(x4), stratify2) : parentId;
+ };
+ return stratify2;
+}
+
+// node_modules/d3-hierarchy/src/tree.js
+function defaultSeparation2(a2, b) {
+ return a2.parent === b.parent ? 1 : 2;
+}
+function nextLeft(v) {
+ var children3 = v.children;
+ return children3 ? children3[0] : v.t;
+}
+function nextRight(v) {
+ var children3 = v.children;
+ return children3 ? children3[children3.length - 1] : v.t;
+}
+function moveSubtree(wm, wp, shift) {
+ var change = shift / (wp.i - wm.i);
+ wp.c -= change;
+ wp.s += shift;
+ wm.c += change;
+ wp.z += shift;
+ wp.m += shift;
+}
+function executeShifts(v) {
+ var shift = 0, change = 0, children3 = v.children, i = children3.length, w;
+ while (--i >= 0) {
+ w = children3[i];
+ w.z += shift;
+ w.m += shift;
+ shift += w.s + (change += w.c);
+ }
+}
+function nextAncestor(vim, v, ancestor) {
+ return vim.a.parent === v.parent ? vim.a : ancestor;
+}
+function TreeNode(node, i) {
+ this._ = node;
+ this.parent = null;
+ this.children = null;
+ this.A = null;
+ this.a = this;
+ this.z = 0;
+ this.m = 0;
+ this.c = 0;
+ this.s = 0;
+ this.t = null;
+ this.i = i;
+}
+TreeNode.prototype = Object.create(Node.prototype);
+function treeRoot(root2) {
+ var tree = new TreeNode(root2, 0), node, nodes = [tree], child, children3, i, n2;
+ while (node = nodes.pop()) {
+ if (children3 = node._.children) {
+ node.children = new Array(n2 = children3.length);
+ for (i = n2 - 1; i >= 0; --i) {
+ nodes.push(child = node.children[i] = new TreeNode(children3[i], i));
+ child.parent = node;
+ }
+ }
+ }
+ (tree.parent = new TreeNode(null, 0)).children = [tree];
+ return tree;
+}
+function tree_default() {
+ var separation = defaultSeparation2, dx = 1, dy = 1, nodeSize = null;
+ function tree(root2) {
+ var t = treeRoot(root2);
+ t.eachAfter(firstWalk), t.parent.m = -t.z;
+ t.eachBefore(secondWalk);
+ if (nodeSize)
+ root2.eachBefore(sizeNode);
+ else {
+ var left = root2, right = root2, bottom = root2;
+ root2.eachBefore(function(node) {
+ if (node.x < left.x)
+ left = node;
+ if (node.x > right.x)
+ right = node;
+ if (node.depth > bottom.depth)
+ bottom = node;
+ });
+ var s2 = left === right ? 1 : separation(left, right) / 2, tx = s2 - left.x, kx = dx / (right.x + s2 + tx), ky = dy / (bottom.depth || 1);
+ root2.eachBefore(function(node) {
+ node.x = (node.x + tx) * kx;
+ node.y = node.depth * ky;
+ });
+ }
+ return root2;
+ }
+ function firstWalk(v) {
+ var children3 = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
+ if (children3) {
+ executeShifts(v);
+ var midpoint = (children3[0].z + children3[children3.length - 1].z) / 2;
+ if (w) {
+ v.z = w.z + separation(v._, w._);
+ v.m = v.z - midpoint;
+ } else {
+ v.z = midpoint;
+ }
+ } else if (w) {
+ v.z = w.z + separation(v._, w._);
+ }
+ v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
+ }
+ function secondWalk(v) {
+ v._.x = v.z + v.parent.m;
+ v.m += v.parent.m;
+ }
+ function apportion(v, w, ancestor) {
+ if (w) {
+ var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
+ while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
+ vom = nextLeft(vom);
+ vop = nextRight(vop);
+ vop.a = v;
+ shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
+ if (shift > 0) {
+ moveSubtree(nextAncestor(vim, v, ancestor), v, shift);
+ sip += shift;
+ sop += shift;
+ }
+ sim += vim.m;
+ sip += vip.m;
+ som += vom.m;
+ sop += vop.m;
+ }
+ if (vim && !nextRight(vop)) {
+ vop.t = vim;
+ vop.m += sim - sop;
+ }
+ if (vip && !nextLeft(vom)) {
+ vom.t = vip;
+ vom.m += sip - som;
+ ancestor = v;
+ }
+ }
+ return ancestor;
+ }
+ function sizeNode(node) {
+ node.x *= dx;
+ node.y = node.depth * dy;
+ }
+ tree.separation = function(x4) {
+ return arguments.length ? (separation = x4, tree) : separation;
+ };
+ tree.size = function(x4) {
+ return arguments.length ? (nodeSize = false, dx = +x4[0], dy = +x4[1], tree) : nodeSize ? null : [dx, dy];
+ };
+ tree.nodeSize = function(x4) {
+ return arguments.length ? (nodeSize = true, dx = +x4[0], dy = +x4[1], tree) : nodeSize ? [dx, dy] : null;
+ };
+ return tree;
+}
+
+// node_modules/d3-hierarchy/src/treemap/slice.js
+function slice_default(parent, x0, y0, x1, y1) {
+ var nodes = parent.children, node, i = -1, n2 = nodes.length, k = parent.value && (y1 - y0) / parent.value;
+ while (++i < n2) {
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
+ node.y0 = y0, node.y1 = y0 += node.value * k;
+ }
+}
+
+// node_modules/d3-hierarchy/src/treemap/squarify.js
+var phi = (1 + Math.sqrt(5)) / 2;
+function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
+ var rows = [], nodes = parent.children, row, nodeValue, i0 = 0, i1 = 0, n2 = nodes.length, dx, dy, value = parent.value, sumValue, minValue, maxValue, newRatio, minRatio, alpha, beta;
+ while (i0 < n2) {
+ dx = x1 - x0, dy = y1 - y0;
+ do
+ sumValue = nodes[i1++].value;
+ while (!sumValue && i1 < n2);
+ minValue = maxValue = sumValue;
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
+ beta = sumValue * sumValue * alpha;
+ minRatio = Math.max(maxValue / beta, beta / minValue);
+ for (; i1 < n2; ++i1) {
+ sumValue += nodeValue = nodes[i1].value;
+ if (nodeValue < minValue)
+ minValue = nodeValue;
+ if (nodeValue > maxValue)
+ maxValue = nodeValue;
+ beta = sumValue * sumValue * alpha;
+ newRatio = Math.max(maxValue / beta, beta / minValue);
+ if (newRatio > minRatio) {
+ sumValue -= nodeValue;
+ break;
+ }
+ minRatio = newRatio;
+ }
+ rows.push(row = { value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1) });
+ if (row.dice)
+ dice_default(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
+ else
+ slice_default(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
+ value -= sumValue, i0 = i1;
+ }
+ return rows;
+}
+var squarify_default = function custom(ratio) {
+ function squarify(parent, x0, y0, x1, y1) {
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
+ }
+ squarify.ratio = function(x4) {
+ return custom((x4 = +x4) > 1 ? x4 : 1);
+ };
+ return squarify;
+}(phi);
+
+// node_modules/d3-hierarchy/src/treemap/index.js
+function treemap_default() {
+ var tile = squarify_default, round = false, dx = 1, dy = 1, paddingStack = [0], paddingInner = constantZero, paddingTop = constantZero, paddingRight = constantZero, paddingBottom = constantZero, paddingLeft = constantZero;
+ function treemap(root2) {
+ root2.x0 = root2.y0 = 0;
+ root2.x1 = dx;
+ root2.y1 = dy;
+ root2.eachBefore(positionNode);
+ paddingStack = [0];
+ if (round)
+ root2.eachBefore(round_default2);
+ return root2;
+ }
+ function positionNode(node) {
+ var p = paddingStack[node.depth], x0 = node.x0 + p, y0 = node.y0 + p, x1 = node.x1 - p, y1 = node.y1 - p;
+ if (x1 < x0)
+ x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0)
+ y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ if (node.children) {
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
+ x0 += paddingLeft(node) - p;
+ y0 += paddingTop(node) - p;
+ x1 -= paddingRight(node) - p;
+ y1 -= paddingBottom(node) - p;
+ if (x1 < x0)
+ x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0)
+ y0 = y1 = (y0 + y1) / 2;
+ tile(node, x0, y0, x1, y1);
+ }
+ }
+ treemap.round = function(x4) {
+ return arguments.length ? (round = !!x4, treemap) : round;
+ };
+ treemap.size = function(x4) {
+ return arguments.length ? (dx = +x4[0], dy = +x4[1], treemap) : [dx, dy];
+ };
+ treemap.tile = function(x4) {
+ return arguments.length ? (tile = required(x4), treemap) : tile;
+ };
+ treemap.padding = function(x4) {
+ return arguments.length ? treemap.paddingInner(x4).paddingOuter(x4) : treemap.paddingInner();
+ };
+ treemap.paddingInner = function(x4) {
+ return arguments.length ? (paddingInner = typeof x4 === "function" ? x4 : constant_default6(+x4), treemap) : paddingInner;
+ };
+ treemap.paddingOuter = function(x4) {
+ return arguments.length ? treemap.paddingTop(x4).paddingRight(x4).paddingBottom(x4).paddingLeft(x4) : treemap.paddingTop();
+ };
+ treemap.paddingTop = function(x4) {
+ return arguments.length ? (paddingTop = typeof x4 === "function" ? x4 : constant_default6(+x4), treemap) : paddingTop;
+ };
+ treemap.paddingRight = function(x4) {
+ return arguments.length ? (paddingRight = typeof x4 === "function" ? x4 : constant_default6(+x4), treemap) : paddingRight;
+ };
+ treemap.paddingBottom = function(x4) {
+ return arguments.length ? (paddingBottom = typeof x4 === "function" ? x4 : constant_default6(+x4), treemap) : paddingBottom;
+ };
+ treemap.paddingLeft = function(x4) {
+ return arguments.length ? (paddingLeft = typeof x4 === "function" ? x4 : constant_default6(+x4), treemap) : paddingLeft;
+ };
+ return treemap;
+}
+
+// node_modules/d3-hierarchy/src/treemap/binary.js
+function binary_default(parent, x0, y0, x1, y1) {
+ var nodes = parent.children, i, n2 = nodes.length, sum, sums = new Array(n2 + 1);
+ for (sums[0] = sum = i = 0; i < n2; ++i) {
+ sums[i + 1] = sum += nodes[i].value;
+ }
+ partition(0, n2, parent.value, x0, y0, x1, y1);
+ function partition(i2, j, value, x02, y02, x12, y12) {
+ if (i2 >= j - 1) {
+ var node = nodes[i2];
+ node.x0 = x02, node.y0 = y02;
+ node.x1 = x12, node.y1 = y12;
+ return;
+ }
+ var valueOffset = sums[i2], valueTarget = value / 2 + valueOffset, k = i2 + 1, hi = j - 1;
+ while (k < hi) {
+ var mid = k + hi >>> 1;
+ if (sums[mid] < valueTarget)
+ k = mid + 1;
+ else
+ hi = mid;
+ }
+ if (valueTarget - sums[k - 1] < sums[k] - valueTarget && i2 + 1 < k)
+ --k;
+ var valueLeft = sums[k] - valueOffset, valueRight = value - valueLeft;
+ if (x12 - x02 > y12 - y02) {
+ var xk = value ? (x02 * valueRight + x12 * valueLeft) / value : x12;
+ partition(i2, k, valueLeft, x02, y02, xk, y12);
+ partition(k, j, valueRight, xk, y02, x12, y12);
+ } else {
+ var yk = value ? (y02 * valueRight + y12 * valueLeft) / value : y12;
+ partition(i2, k, valueLeft, x02, y02, x12, yk);
+ partition(k, j, valueRight, x02, yk, x12, y12);
+ }
+ }
+}
+
+// node_modules/d3-scale/src/init.js
+function initRange(domain, range) {
+ switch (arguments.length) {
+ case 0:
+ break;
+ case 1:
+ this.range(domain);
+ break;
+ default:
+ this.range(range).domain(domain);
+ break;
+ }
+ return this;
+}
+
+// node_modules/d3-scale/src/ordinal.js
+var implicit = Symbol("implicit");
+function ordinal() {
+ var index2 = /* @__PURE__ */ new Map(), domain = [], range = [], unknown = implicit;
+ function scale(d) {
+ var key = d + "", i = index2.get(key);
+ if (!i) {
+ if (unknown !== implicit)
+ return unknown;
+ index2.set(key, i = domain.push(d));
+ }
+ return range[(i - 1) % range.length];
+ }
+ scale.domain = function(_) {
+ if (!arguments.length)
+ return domain.slice();
+ domain = [], index2 = /* @__PURE__ */ new Map();
+ for (const value of _) {
+ const key = value + "";
+ if (index2.has(key))
+ continue;
+ index2.set(key, domain.push(value));
+ }
+ return scale;
+ };
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), scale) : range.slice();
+ };
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+ scale.copy = function() {
+ return ordinal(domain, range).unknown(unknown);
+ };
+ initRange.apply(scale, arguments);
+ return scale;
+}
+
+// node_modules/d3-scale/src/band.js
+function band() {
+ var scale = ordinal().unknown(void 0), domain = scale.domain, ordinalRange = scale.range, r0 = 0, r1 = 1, step, bandwidth, round = false, paddingInner = 0, paddingOuter = 0, align = 0.5;
+ delete scale.unknown;
+ function rescale() {
+ var n2 = domain().length, reverse = r1 < r0, start2 = reverse ? r1 : r0, stop = reverse ? r0 : r1;
+ step = (stop - start2) / Math.max(1, n2 - paddingInner + paddingOuter * 2);
+ if (round)
+ step = Math.floor(step);
+ start2 += (stop - start2 - step * (n2 - paddingInner)) * align;
+ bandwidth = step * (1 - paddingInner);
+ if (round)
+ start2 = Math.round(start2), bandwidth = Math.round(bandwidth);
+ var values = range_default(n2).map(function(i) {
+ return start2 + step * i;
+ });
+ return ordinalRange(reverse ? values.reverse() : values);
+ }
+ scale.domain = function(_) {
+ return arguments.length ? (domain(_), rescale()) : domain();
+ };
+ scale.range = function(_) {
+ return arguments.length ? ([r0, r1] = _, r0 = +r0, r1 = +r1, rescale()) : [r0, r1];
+ };
+ scale.rangeRound = function(_) {
+ return [r0, r1] = _, r0 = +r0, r1 = +r1, round = true, rescale();
+ };
+ scale.bandwidth = function() {
+ return bandwidth;
+ };
+ scale.step = function() {
+ return step;
+ };
+ scale.round = function(_) {
+ return arguments.length ? (round = !!_, rescale()) : round;
+ };
+ scale.padding = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
+ };
+ scale.paddingInner = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
+ };
+ scale.paddingOuter = function(_) {
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
+ };
+ scale.align = function(_) {
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
+ };
+ scale.copy = function() {
+ return band(domain(), [r0, r1]).round(round).paddingInner(paddingInner).paddingOuter(paddingOuter).align(align);
+ };
+ return initRange.apply(rescale(), arguments);
+}
+function pointish(scale) {
+ var copy3 = scale.copy;
+ scale.padding = scale.paddingOuter;
+ delete scale.paddingInner;
+ delete scale.paddingOuter;
+ scale.copy = function() {
+ return pointish(copy3());
+ };
+ return scale;
+}
+function point() {
+ return pointish(band.apply(null, arguments).paddingInner(1));
+}
+
+// node_modules/d3-scale/src/constant.js
+function constants(x4) {
+ return function() {
+ return x4;
+ };
+}
+
+// node_modules/d3-scale/src/number.js
+function number(x4) {
+ return +x4;
+}
+
+// node_modules/d3-scale/src/continuous.js
+var unit = [0, 1];
+function identity2(x4) {
+ return x4;
+}
+function normalize(a2, b) {
+ return (b -= a2 = +a2) ? function(x4) {
+ return (x4 - a2) / b;
+ } : constants(isNaN(b) ? NaN : 0.5);
+}
+function clamper(a2, b) {
+ var t;
+ if (a2 > b)
+ t = a2, a2 = b, b = t;
+ return function(x4) {
+ return Math.max(a2, Math.min(b, x4));
+ };
+}
+function bimap(domain, range, interpolate) {
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
+ if (d1 < d0)
+ d0 = normalize(d1, d0), r0 = interpolate(r1, r0);
+ else
+ d0 = normalize(d0, d1), r0 = interpolate(r0, r1);
+ return function(x4) {
+ return r0(d0(x4));
+ };
+}
+function polymap(domain, range, interpolate) {
+ var j = Math.min(domain.length, range.length) - 1, d = new Array(j), r = new Array(j), i = -1;
+ if (domain[j] < domain[0]) {
+ domain = domain.slice().reverse();
+ range = range.slice().reverse();
+ }
+ while (++i < j) {
+ d[i] = normalize(domain[i], domain[i + 1]);
+ r[i] = interpolate(range[i], range[i + 1]);
+ }
+ return function(x4) {
+ var i2 = bisect_default(domain, x4, 1, j) - 1;
+ return r[i2](d[i2](x4));
+ };
+}
+function copy2(source, target) {
+ return target.domain(source.domain()).range(source.range()).interpolate(source.interpolate()).clamp(source.clamp()).unknown(source.unknown());
+}
+function transformer() {
+ var domain = unit, range = unit, interpolate = value_default, transform2, untransform, unknown, clamp = identity2, piecewise, output, input;
+ function rescale() {
+ var n2 = Math.min(domain.length, range.length);
+ if (clamp !== identity2)
+ clamp = clamper(domain[0], domain[n2 - 1]);
+ piecewise = n2 > 2 ? polymap : bimap;
+ output = input = null;
+ return scale;
+ }
+ function scale(x4) {
+ return x4 == null || isNaN(x4 = +x4) ? unknown : (output || (output = piecewise(domain.map(transform2), range, interpolate)))(transform2(clamp(x4)));
+ }
+ scale.invert = function(y4) {
+ return clamp(untransform((input || (input = piecewise(range, domain.map(transform2), number_default2)))(y4)));
+ };
+ scale.domain = function(_) {
+ return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();
+ };
+ scale.range = function(_) {
+ return arguments.length ? (range = Array.from(_), rescale()) : range.slice();
+ };
+ scale.rangeRound = function(_) {
+ return range = Array.from(_), interpolate = round_default, rescale();
+ };
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = _ ? true : identity2, rescale()) : clamp !== identity2;
+ };
+ scale.interpolate = function(_) {
+ return arguments.length ? (interpolate = _, rescale()) : interpolate;
+ };
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+ return function(t, u) {
+ transform2 = t, untransform = u;
+ return rescale();
+ };
+}
+function continuous() {
+ return transformer()(identity2, identity2);
+}
+
+// node_modules/d3-scale/src/tickFormat.js
+function tickFormat(start2, stop, count2, specifier) {
+ var step = tickStep(start2, stop, count2), precision;
+ specifier = formatSpecifier(specifier == null ? ",f" : specifier);
+ switch (specifier.type) {
+ case "s": {
+ var value = Math.max(Math.abs(start2), Math.abs(stop));
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix_default(step, value)))
+ specifier.precision = precision;
+ return formatPrefix(specifier, value);
+ }
+ case "":
+ case "e":
+ case "g":
+ case "p":
+ case "r": {
+ if (specifier.precision == null && !isNaN(precision = precisionRound_default(step, Math.max(Math.abs(start2), Math.abs(stop)))))
+ specifier.precision = precision - (specifier.type === "e");
+ break;
+ }
+ case "f":
+ case "%": {
+ if (specifier.precision == null && !isNaN(precision = precisionFixed_default(step)))
+ specifier.precision = precision - (specifier.type === "%") * 2;
+ break;
+ }
+ }
+ return format(specifier);
+}
+
+// node_modules/d3-scale/src/linear.js
+function linearish(scale) {
+ var domain = scale.domain;
+ scale.ticks = function(count2) {
+ var d = domain();
+ return ticks_default(d[0], d[d.length - 1], count2 == null ? 10 : count2);
+ };
+ scale.tickFormat = function(count2, specifier) {
+ var d = domain();
+ return tickFormat(d[0], d[d.length - 1], count2 == null ? 10 : count2, specifier);
+ };
+ scale.nice = function(count2) {
+ if (count2 == null)
+ count2 = 10;
+ var d = domain();
+ var i0 = 0;
+ var i1 = d.length - 1;
+ var start2 = d[i0];
+ var stop = d[i1];
+ var prestep;
+ var step;
+ var maxIter = 10;
+ if (stop < start2) {
+ step = start2, start2 = stop, stop = step;
+ step = i0, i0 = i1, i1 = step;
+ }
+ while (maxIter-- > 0) {
+ step = tickIncrement(start2, stop, count2);
+ if (step === prestep) {
+ d[i0] = start2;
+ d[i1] = stop;
+ return domain(d);
+ } else if (step > 0) {
+ start2 = Math.floor(start2 / step) * step;
+ stop = Math.ceil(stop / step) * step;
+ } else if (step < 0) {
+ start2 = Math.ceil(start2 * step) / step;
+ stop = Math.floor(stop * step) / step;
+ } else {
+ break;
+ }
+ prestep = step;
+ }
+ return scale;
+ };
+ return scale;
+}
+function linear2() {
+ var scale = continuous();
+ scale.copy = function() {
+ return copy2(scale, linear2());
+ };
+ initRange.apply(scale, arguments);
+ return linearish(scale);
+}
+
+// node_modules/d3-scale-chromatic/src/colors.js
+function colors_default(specifier) {
+ var n2 = specifier.length / 6 | 0, colors = new Array(n2), i = 0;
+ while (i < n2)
+ colors[i] = "#" + specifier.slice(i * 6, ++i * 6);
+ return colors;
+}
+
+// node_modules/d3-scale-chromatic/src/categorical/category10.js
+var category10_default = colors_default("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
+
+// node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js
+var warm = cubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.5, 0.8));
+var cool = cubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.5, 0.8));
+var c2 = cubehelix();
+function rainbow_default(t) {
+ if (t < 0 || t > 1)
+ t -= Math.floor(t);
+ var ts = Math.abs(t - 0.5);
+ c2.h = 360 * t - 100;
+ c2.s = 1.5 - 1.5 * ts;
+ c2.l = 0.8 - 0.9 * ts;
+ return c2 + "";
+}
+
+// node_modules/d3-shape/src/constant.js
+function constant_default7(x4) {
+ return function constant() {
+ return x4;
+ };
+}
+
+// node_modules/d3-shape/src/math.js
+var abs2 = Math.abs;
+var atan2 = Math.atan2;
+var cos = Math.cos;
+var max3 = Math.max;
+var min2 = Math.min;
+var sin = Math.sin;
+var sqrt = Math.sqrt;
+var epsilon3 = 1e-12;
+var pi2 = Math.PI;
+var halfPi = pi2 / 2;
+var tau2 = 2 * pi2;
+function acos(x4) {
+ return x4 > 1 ? 0 : x4 < -1 ? pi2 : Math.acos(x4);
+}
+function asin(x4) {
+ return x4 >= 1 ? halfPi : x4 <= -1 ? -halfPi : Math.asin(x4);
+}
+
+// node_modules/d3-shape/src/arc.js
+function arcInnerRadius(d) {
+ return d.innerRadius;
+}
+function arcOuterRadius(d) {
+ return d.outerRadius;
+}
+function arcStartAngle(d) {
+ return d.startAngle;
+}
+function arcEndAngle(d) {
+ return d.endAngle;
+}
+function arcPadAngle(d) {
+ return d && d.padAngle;
+}
+function intersect(x0, y0, x1, y1, x22, y22, x32, y32) {
+ var x10 = x1 - x0, y10 = y1 - y0, x322 = x32 - x22, y322 = y32 - y22, t = y322 * x10 - x322 * y10;
+ if (t * t < epsilon3)
+ return;
+ t = (x322 * (y0 - y22) - y322 * (x0 - x22)) / t;
+ return [x0 + t * x10, y0 + t * y10];
+}
+function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
+ var x01 = x0 - x1, y01 = y0 - y1, lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x11 = x0 + ox, y11 = y0 + oy, x10 = x1 + ox, y10 = y1 + oy, x00 = (x11 + x10) / 2, y00 = (y11 + y10) / 2, dx = x10 - x11, dy = y10 - y11, d2 = dx * dx + dy * dy, r = r1 - rc, D2 = x11 * y10 - x10 * y11, d = (dy < 0 ? -1 : 1) * sqrt(max3(0, r * r * d2 - D2 * D2)), cx0 = (D2 * dy - dx * d) / d2, cy0 = (-D2 * dx - dy * d) / d2, cx1 = (D2 * dy + dx * d) / d2, cy1 = (-D2 * dx + dy * d) / d2, dx0 = cx0 - x00, dy0 = cy0 - y00, dx1 = cx1 - x00, dy1 = cy1 - y00;
+ if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1)
+ cx0 = cx1, cy0 = cy1;
+ return {
+ cx: cx0,
+ cy: cy0,
+ x01: -ox,
+ y01: -oy,
+ x11: cx0 * (r1 / r - 1),
+ y11: cy0 * (r1 / r - 1)
+ };
+}
+function arc_default() {
+ var innerRadius = arcInnerRadius, outerRadius = arcOuterRadius, cornerRadius = constant_default7(0), padRadius = null, startAngle = arcStartAngle, endAngle = arcEndAngle, padAngle = arcPadAngle, context = null;
+ function arc() {
+ var buffer, r, r0 = +innerRadius.apply(this, arguments), r1 = +outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) - halfPi, a1 = endAngle.apply(this, arguments) - halfPi, da = abs2(a1 - a0), cw = a1 > a0;
+ if (!context)
+ context = buffer = path_default();
+ if (r1 < r0)
+ r = r1, r1 = r0, r0 = r;
+ if (!(r1 > epsilon3))
+ context.moveTo(0, 0);
+ else if (da > tau2 - epsilon3) {
+ context.moveTo(r1 * cos(a0), r1 * sin(a0));
+ context.arc(0, 0, r1, a0, a1, !cw);
+ if (r0 > epsilon3) {
+ context.moveTo(r0 * cos(a1), r0 * sin(a1));
+ context.arc(0, 0, r0, a1, a0, cw);
+ }
+ } else {
+ var a01 = a0, a11 = a1, a00 = a0, a10 = a1, da0 = da, da1 = da, ap = padAngle.apply(this, arguments) / 2, rp = ap > epsilon3 && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)), rc = min2(abs2(r1 - r0) / 2, +cornerRadius.apply(this, arguments)), rc0 = rc, rc1 = rc, t0, t1;
+ if (rp > epsilon3) {
+ var p0 = asin(rp / r0 * sin(ap)), p1 = asin(rp / r1 * sin(ap));
+ if ((da0 -= p0 * 2) > epsilon3)
+ p0 *= cw ? 1 : -1, a00 += p0, a10 -= p0;
+ else
+ da0 = 0, a00 = a10 = (a0 + a1) / 2;
+ if ((da1 -= p1 * 2) > epsilon3)
+ p1 *= cw ? 1 : -1, a01 += p1, a11 -= p1;
+ else
+ da1 = 0, a01 = a11 = (a0 + a1) / 2;
+ }
+ var x01 = r1 * cos(a01), y01 = r1 * sin(a01), x10 = r0 * cos(a10), y10 = r0 * sin(a10);
+ if (rc > epsilon3) {
+ var x11 = r1 * cos(a11), y11 = r1 * sin(a11), x00 = r0 * cos(a00), y00 = r0 * sin(a00), oc;
+ if (da < pi2 && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
+ var ax = x01 - oc[0], ay = y01 - oc[1], bx = x11 - oc[0], by = y11 - oc[1], kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2), lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
+ rc0 = min2(rc, (r0 - lc) / (kc - 1));
+ rc1 = min2(rc, (r1 - lc) / (kc + 1));
+ }
+ }
+ if (!(da1 > epsilon3))
+ context.moveTo(x01, y01);
+ else if (rc1 > epsilon3) {
+ t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
+ t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
+ context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
+ if (rc1 < rc)
+ context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
+ else {
+ context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
+ context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
+ }
+ } else
+ context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
+ if (!(r0 > epsilon3) || !(da0 > epsilon3))
+ context.lineTo(x10, y10);
+ else if (rc0 > epsilon3) {
+ t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
+ t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
+ context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
+ if (rc0 < rc)
+ context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
+ else {
+ context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
+ context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
+ }
+ } else
+ context.arc(0, 0, r0, a10, a00, cw);
+ }
+ context.closePath();
+ if (buffer)
+ return context = null, buffer + "" || null;
+ }
+ arc.centroid = function() {
+ var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a2 = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi2 / 2;
+ return [cos(a2) * r, sin(a2) * r];
+ };
+ arc.innerRadius = function(_) {
+ return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant_default7(+_), arc) : innerRadius;
+ };
+ arc.outerRadius = function(_) {
+ return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant_default7(+_), arc) : outerRadius;
+ };
+ arc.cornerRadius = function(_) {
+ return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant_default7(+_), arc) : cornerRadius;
+ };
+ arc.padRadius = function(_) {
+ return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant_default7(+_), arc) : padRadius;
+ };
+ arc.startAngle = function(_) {
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant_default7(+_), arc) : startAngle;
+ };
+ arc.endAngle = function(_) {
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant_default7(+_), arc) : endAngle;
+ };
+ arc.padAngle = function(_) {
+ return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant_default7(+_), arc) : padAngle;
+ };
+ arc.context = function(_) {
+ return arguments.length ? (context = _ == null ? null : _, arc) : context;
+ };
+ return arc;
+}
+
+// node_modules/d3-shape/src/array.js
+var slice = Array.prototype.slice;
+function array_default2(x4) {
+ return typeof x4 === "object" && "length" in x4 ? x4 : Array.from(x4);
+}
+
+// node_modules/d3-shape/src/curve/linear.js
+function Linear(context) {
+ this._context = context;
+}
+Linear.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || this._line !== 0 && this._point === 1)
+ this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x4, y4) {
+ x4 = +x4, y4 = +y4;
+ switch (this._point) {
+ case 0:
+ this._point = 1;
+ this._line ? this._context.lineTo(x4, y4) : this._context.moveTo(x4, y4);
+ break;
+ case 1:
+ this._point = 2;
+ default:
+ this._context.lineTo(x4, y4);
+ break;
+ }
+ }
+};
+function linear_default(context) {
+ return new Linear(context);
+}
+
+// node_modules/d3-shape/src/point.js
+function x3(p) {
+ return p[0];
+}
+function y3(p) {
+ return p[1];
+}
+
+// node_modules/d3-shape/src/line.js
+function line_default(x4, y4) {
+ var defined = constant_default7(true), context = null, curve = linear_default, output = null;
+ x4 = typeof x4 === "function" ? x4 : x4 === void 0 ? x3 : constant_default7(x4);
+ y4 = typeof y4 === "function" ? y4 : y4 === void 0 ? y3 : constant_default7(y4);
+ function line(data) {
+ var i, n2 = (data = array_default2(data)).length, d, defined0 = false, buffer;
+ if (context == null)
+ output = curve(buffer = path_default());
+ for (i = 0; i <= n2; ++i) {
+ if (!(i < n2 && defined(d = data[i], i, data)) === defined0) {
+ if (defined0 = !defined0)
+ output.lineStart();
+ else
+ output.lineEnd();
+ }
+ if (defined0)
+ output.point(+x4(d, i, data), +y4(d, i, data));
+ }
+ if (buffer)
+ return output = null, buffer + "" || null;
+ }
+ line.x = function(_) {
+ return arguments.length ? (x4 = typeof _ === "function" ? _ : constant_default7(+_), line) : x4;
+ };
+ line.y = function(_) {
+ return arguments.length ? (y4 = typeof _ === "function" ? _ : constant_default7(+_), line) : y4;
+ };
+ line.defined = function(_) {
+ return arguments.length ? (defined = typeof _ === "function" ? _ : constant_default7(!!_), line) : defined;
+ };
+ line.curve = function(_) {
+ return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
+ };
+ line.context = function(_) {
+ return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
+ };
+ return line;
+}
+
+// node_modules/d3-shape/src/curve/radial.js
+var curveRadialLinear = curveRadial(linear_default);
+function Radial(curve) {
+ this._curve = curve;
+}
+Radial.prototype = {
+ areaStart: function() {
+ this._curve.areaStart();
+ },
+ areaEnd: function() {
+ this._curve.areaEnd();
+ },
+ lineStart: function() {
+ this._curve.lineStart();
+ },
+ lineEnd: function() {
+ this._curve.lineEnd();
+ },
+ point: function(a2, r) {
+ this._curve.point(r * Math.sin(a2), r * -Math.cos(a2));
+ }
+};
+function curveRadial(curve) {
+ function radial(context) {
+ return new Radial(curve(context));
+ }
+ radial._curve = curve;
+ return radial;
+}
+
+// node_modules/d3-shape/src/lineRadial.js
+function lineRadial(l2) {
+ var c3 = l2.curve;
+ l2.angle = l2.x, delete l2.x;
+ l2.radius = l2.y, delete l2.y;
+ l2.curve = function(_) {
+ return arguments.length ? c3(curveRadial(_)) : c3()._curve;
+ };
+ return l2;
+}
+function lineRadial_default() {
+ return lineRadial(line_default().curve(curveRadialLinear));
+}
+
+// node_modules/d3-shape/src/link/index.js
+function linkSource(d) {
+ return d.source;
+}
+function linkTarget(d) {
+ return d.target;
+}
+function link(curve) {
+ var source = linkSource, target = linkTarget, x4 = x3, y4 = y3, context = null;
+ function link2() {
+ var buffer, argv = slice.call(arguments), s2 = source.apply(this, argv), t = target.apply(this, argv);
+ if (!context)
+ context = buffer = path_default();
+ curve(context, +x4.apply(this, (argv[0] = s2, argv)), +y4.apply(this, argv), +x4.apply(this, (argv[0] = t, argv)), +y4.apply(this, argv));
+ if (buffer)
+ return context = null, buffer + "" || null;
+ }
+ link2.source = function(_) {
+ return arguments.length ? (source = _, link2) : source;
+ };
+ link2.target = function(_) {
+ return arguments.length ? (target = _, link2) : target;
+ };
+ link2.x = function(_) {
+ return arguments.length ? (x4 = typeof _ === "function" ? _ : constant_default7(+_), link2) : x4;
+ };
+ link2.y = function(_) {
+ return arguments.length ? (y4 = typeof _ === "function" ? _ : constant_default7(+_), link2) : y4;
+ };
+ link2.context = function(_) {
+ return arguments.length ? (context = _ == null ? null : _, link2) : context;
+ };
+ return link2;
+}
+function curveHorizontal(context, x0, y0, x1, y1) {
+ context.moveTo(x0, y0);
+ context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);
+}
+function linkHorizontal() {
+ return link(curveHorizontal);
+}
+
+// node_modules/d3-shape/src/curve/basis.js
+function point2(that, x4, y4) {
+ that._context.bezierCurveTo(
+ (2 * that._x0 + that._x1) / 3,
+ (2 * that._y0 + that._y1) / 3,
+ (that._x0 + 2 * that._x1) / 3,
+ (that._y0 + 2 * that._y1) / 3,
+ (that._x0 + 4 * that._x1 + x4) / 6,
+ (that._y0 + 4 * that._y1 + y4) / 6
+ );
+}
+function Basis(context) {
+ this._context = context;
+}
+Basis.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._y0 = this._y1 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 3:
+ point2(this, this._x1, this._y1);
+ case 2:
+ this._context.lineTo(this._x1, this._y1);
+ break;
+ }
+ if (this._line || this._line !== 0 && this._point === 1)
+ this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x4, y4) {
+ x4 = +x4, y4 = +y4;
+ switch (this._point) {
+ case 0:
+ this._point = 1;
+ this._line ? this._context.lineTo(x4, y4) : this._context.moveTo(x4, y4);
+ break;
+ case 1:
+ this._point = 2;
+ break;
+ case 2:
+ this._point = 3;
+ this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6);
+ default:
+ point2(this, x4, y4);
+ break;
+ }
+ this._x0 = this._x1, this._x1 = x4;
+ this._y0 = this._y1, this._y1 = y4;
+ }
+};
+
+// node_modules/d3-shape/src/curve/bundle.js
+function Bundle(context, beta) {
+ this._basis = new Basis(context);
+ this._beta = beta;
+}
+Bundle.prototype = {
+ lineStart: function() {
+ this._x = [];
+ this._y = [];
+ this._basis.lineStart();
+ },
+ lineEnd: function() {
+ var x4 = this._x, y4 = this._y, j = x4.length - 1;
+ if (j > 0) {
+ var x0 = x4[0], y0 = y4[0], dx = x4[j] - x0, dy = y4[j] - y0, i = -1, t;
+ while (++i <= j) {
+ t = i / j;
+ this._basis.point(
+ this._beta * x4[i] + (1 - this._beta) * (x0 + t * dx),
+ this._beta * y4[i] + (1 - this._beta) * (y0 + t * dy)
+ );
+ }
+ }
+ this._x = this._y = null;
+ this._basis.lineEnd();
+ },
+ point: function(x4, y4) {
+ this._x.push(+x4);
+ this._y.push(+y4);
+ }
+};
+var bundle_default = function custom2(beta) {
+ function bundle(context) {
+ return beta === 1 ? new Basis(context) : new Bundle(context, beta);
+ }
+ bundle.beta = function(beta2) {
+ return custom2(+beta2);
+ };
+ return bundle;
+}(0.85);
+
+// node_modules/d3-zoom/src/constant.js
+var constant_default8 = (x4) => () => x4;
+
+// node_modules/d3-zoom/src/event.js
+function ZoomEvent(type2, {
+ sourceEvent,
+ target,
+ transform: transform2,
+ dispatch: dispatch2
+}) {
+ Object.defineProperties(this, {
+ type: { value: type2, enumerable: true, configurable: true },
+ sourceEvent: { value: sourceEvent, enumerable: true, configurable: true },
+ target: { value: target, enumerable: true, configurable: true },
+ transform: { value: transform2, enumerable: true, configurable: true },
+ _: { value: dispatch2 }
+ });
+}
+
+// node_modules/d3-zoom/src/transform.js
+function Transform(k, x4, y4) {
+ this.k = k;
+ this.x = x4;
+ this.y = y4;
+}
+Transform.prototype = {
+ constructor: Transform,
+ scale: function(k) {
+ return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
+ },
+ translate: function(x4, y4) {
+ return x4 === 0 & y4 === 0 ? this : new Transform(this.k, this.x + this.k * x4, this.y + this.k * y4);
+ },
+ apply: function(point3) {
+ return [point3[0] * this.k + this.x, point3[1] * this.k + this.y];
+ },
+ applyX: function(x4) {
+ return x4 * this.k + this.x;
+ },
+ applyY: function(y4) {
+ return y4 * this.k + this.y;
+ },
+ invert: function(location) {
+ return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
+ },
+ invertX: function(x4) {
+ return (x4 - this.x) / this.k;
+ },
+ invertY: function(y4) {
+ return (y4 - this.y) / this.k;
+ },
+ rescaleX: function(x4) {
+ return x4.copy().domain(x4.range().map(this.invertX, this).map(x4.invert, x4));
+ },
+ rescaleY: function(y4) {
+ return y4.copy().domain(y4.range().map(this.invertY, this).map(y4.invert, y4));
+ },
+ toString: function() {
+ return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
+ }
+};
+var identity3 = new Transform(1, 0, 0);
+transform.prototype = Transform.prototype;
+function transform(node) {
+ while (!node.__zoom)
+ if (!(node = node.parentNode))
+ return identity3;
+ return node.__zoom;
+}
+
+// node_modules/d3-zoom/src/noevent.js
+function nopropagation3(event) {
+ event.stopImmediatePropagation();
+}
+function noevent_default3(event) {
+ event.preventDefault();
+ event.stopImmediatePropagation();
+}
+
+// node_modules/d3-zoom/src/zoom.js
+function defaultFilter2(event) {
+ return (!event.ctrlKey || event.type === "wheel") && !event.button;
+}
+function defaultExtent() {
+ var e = this;
+ if (e instanceof SVGElement) {
+ e = e.ownerSVGElement || e;
+ if (e.hasAttribute("viewBox")) {
+ e = e.viewBox.baseVal;
+ return [[e.x, e.y], [e.x + e.width, e.y + e.height]];
+ }
+ return [[0, 0], [e.width.baseVal.value, e.height.baseVal.value]];
+ }
+ return [[0, 0], [e.clientWidth, e.clientHeight]];
+}
+function defaultTransform() {
+ return this.__zoom || identity3;
+}
+function defaultWheelDelta(event) {
+ return -event.deltaY * (event.deltaMode === 1 ? 0.05 : event.deltaMode ? 1 : 2e-3) * (event.ctrlKey ? 10 : 1);
+}
+function defaultTouchable2() {
+ return navigator.maxTouchPoints || "ontouchstart" in this;
+}
+function defaultConstrain(transform2, extent, translateExtent) {
+ var dx0 = transform2.invertX(extent[0][0]) - translateExtent[0][0], dx1 = transform2.invertX(extent[1][0]) - translateExtent[1][0], dy0 = transform2.invertY(extent[0][1]) - translateExtent[0][1], dy1 = transform2.invertY(extent[1][1]) - translateExtent[1][1];
+ return transform2.translate(
+ dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
+ dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
+ );
+}
+function zoom_default2() {
+ var filter2 = defaultFilter2, extent = defaultExtent, constrain = defaultConstrain, wheelDelta = defaultWheelDelta, touchable = defaultTouchable2, scaleExtent = [0, Infinity], translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]], duration = 250, interpolate = zoom_default, listeners = dispatch_default("start", "zoom", "end"), touchstarting, touchfirst, touchending, touchDelay = 500, wheelDelay = 150, clickDistance2 = 0, tapDistance = 10;
+ function zoom(selection2) {
+ selection2.property("__zoom", defaultTransform).on("wheel.zoom", wheeled).on("mousedown.zoom", mousedowned).on("dblclick.zoom", dblclicked).filter(touchable).on("touchstart.zoom", touchstarted).on("touchmove.zoom", touchmoved).on("touchend.zoom touchcancel.zoom", touchended).style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
+ }
+ zoom.transform = function(collection, transform2, point3, event) {
+ var selection2 = collection.selection ? collection.selection() : collection;
+ selection2.property("__zoom", defaultTransform);
+ if (collection !== selection2) {
+ schedule(collection, transform2, point3, event);
+ } else {
+ selection2.interrupt().each(function() {
+ gesture(this, arguments).event(event).start().zoom(null, typeof transform2 === "function" ? transform2.apply(this, arguments) : transform2).end();
+ });
+ }
+ };
+ zoom.scaleBy = function(selection2, k, p, event) {
+ zoom.scaleTo(selection2, function() {
+ var k0 = this.__zoom.k, k1 = typeof k === "function" ? k.apply(this, arguments) : k;
+ return k0 * k1;
+ }, p, event);
+ };
+ zoom.scaleTo = function(selection2, k, p, event) {
+ zoom.transform(selection2, function() {
+ var e = extent.apply(this, arguments), t0 = this.__zoom, p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p, p1 = t0.invert(p0), k1 = typeof k === "function" ? k.apply(this, arguments) : k;
+ return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);
+ }, p, event);
+ };
+ zoom.translateBy = function(selection2, x4, y4, event) {
+ zoom.transform(selection2, function() {
+ return constrain(this.__zoom.translate(
+ typeof x4 === "function" ? x4.apply(this, arguments) : x4,
+ typeof y4 === "function" ? y4.apply(this, arguments) : y4
+ ), extent.apply(this, arguments), translateExtent);
+ }, null, event);
+ };
+ zoom.translateTo = function(selection2, x4, y4, p, event) {
+ zoom.transform(selection2, function() {
+ var e = extent.apply(this, arguments), t = this.__zoom, p0 = p == null ? centroid(e) : typeof p === "function" ? p.apply(this, arguments) : p;
+ return constrain(identity3.translate(p0[0], p0[1]).scale(t.k).translate(
+ typeof x4 === "function" ? -x4.apply(this, arguments) : -x4,
+ typeof y4 === "function" ? -y4.apply(this, arguments) : -y4
+ ), e, translateExtent);
+ }, p, event);
+ };
+ function scale(transform2, k) {
+ k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));
+ return k === transform2.k ? transform2 : new Transform(k, transform2.x, transform2.y);
+ }
+ function translate(transform2, p0, p1) {
+ var x4 = p0[0] - p1[0] * transform2.k, y4 = p0[1] - p1[1] * transform2.k;
+ return x4 === transform2.x && y4 === transform2.y ? transform2 : new Transform(transform2.k, x4, y4);
+ }
+ function centroid(extent2) {
+ return [(+extent2[0][0] + +extent2[1][0]) / 2, (+extent2[0][1] + +extent2[1][1]) / 2];
+ }
+ function schedule(transition2, transform2, point3, event) {
+ transition2.on("start.zoom", function() {
+ gesture(this, arguments).event(event).start();
+ }).on("interrupt.zoom end.zoom", function() {
+ gesture(this, arguments).event(event).end();
+ }).tween("zoom", function() {
+ var that = this, args = arguments, g = gesture(that, args).event(event), e = extent.apply(that, args), p = point3 == null ? centroid(e) : typeof point3 === "function" ? point3.apply(that, args) : point3, w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]), a2 = that.__zoom, b = typeof transform2 === "function" ? transform2.apply(that, args) : transform2, i = interpolate(a2.invert(p).concat(w / a2.k), b.invert(p).concat(w / b.k));
+ return function(t) {
+ if (t === 1)
+ t = b;
+ else {
+ var l2 = i(t), k = w / l2[2];
+ t = new Transform(k, p[0] - l2[0] * k, p[1] - l2[1] * k);
+ }
+ g.zoom(null, t);
+ };
+ });
+ }
+ function gesture(that, args, clean) {
+ return !clean && that.__zooming || new Gesture(that, args);
+ }
+ function Gesture(that, args) {
+ this.that = that;
+ this.args = args;
+ this.active = 0;
+ this.sourceEvent = null;
+ this.extent = extent.apply(that, args);
+ this.taps = 0;
+ }
+ Gesture.prototype = {
+ event: function(event) {
+ if (event)
+ this.sourceEvent = event;
+ return this;
+ },
+ start: function() {
+ if (++this.active === 1) {
+ this.that.__zooming = this;
+ this.emit("start");
+ }
+ return this;
+ },
+ zoom: function(key, transform2) {
+ if (this.mouse && key !== "mouse")
+ this.mouse[1] = transform2.invert(this.mouse[0]);
+ if (this.touch0 && key !== "touch")
+ this.touch0[1] = transform2.invert(this.touch0[0]);
+ if (this.touch1 && key !== "touch")
+ this.touch1[1] = transform2.invert(this.touch1[0]);
+ this.that.__zoom = transform2;
+ this.emit("zoom");
+ return this;
+ },
+ end: function() {
+ if (--this.active === 0) {
+ delete this.that.__zooming;
+ this.emit("end");
+ }
+ return this;
+ },
+ emit: function(type2) {
+ var d = select_default2(this.that).datum();
+ listeners.call(
+ type2,
+ this.that,
+ new ZoomEvent(type2, {
+ sourceEvent: this.sourceEvent,
+ target: zoom,
+ type: type2,
+ transform: this.that.__zoom,
+ dispatch: listeners
+ }),
+ d
+ );
+ }
+ };
+ function wheeled(event, ...args) {
+ if (!filter2.apply(this, arguments))
+ return;
+ var g = gesture(this, args).event(event), t = this.__zoom, k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))), p = pointer_default(event);
+ if (g.wheel) {
+ if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {
+ g.mouse[1] = t.invert(g.mouse[0] = p);
+ }
+ clearTimeout(g.wheel);
+ } else if (t.k === k)
+ return;
+ else {
+ g.mouse = [p, t.invert(p)];
+ interrupt_default(this);
+ g.start();
+ }
+ noevent_default3(event);
+ g.wheel = setTimeout(wheelidled, wheelDelay);
+ g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));
+ function wheelidled() {
+ g.wheel = null;
+ g.end();
+ }
+ }
+ function mousedowned(event, ...args) {
+ if (touchending || !filter2.apply(this, arguments))
+ return;
+ var g = gesture(this, args, true).event(event), v = select_default2(event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true), p = pointer_default(event, currentTarget), currentTarget = event.currentTarget, x0 = event.clientX, y0 = event.clientY;
+ nodrag_default(event.view);
+ nopropagation3(event);
+ g.mouse = [p, this.__zoom.invert(p)];
+ interrupt_default(this);
+ g.start();
+ function mousemoved(event2) {
+ noevent_default3(event2);
+ if (!g.moved) {
+ var dx = event2.clientX - x0, dy = event2.clientY - y0;
+ g.moved = dx * dx + dy * dy > clickDistance2;
+ }
+ g.event(event2).zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = pointer_default(event2, currentTarget), g.mouse[1]), g.extent, translateExtent));
+ }
+ function mouseupped(event2) {
+ v.on("mousemove.zoom mouseup.zoom", null);
+ yesdrag(event2.view, g.moved);
+ noevent_default3(event2);
+ g.event(event2).end();
+ }
+ }
+ function dblclicked(event, ...args) {
+ if (!filter2.apply(this, arguments))
+ return;
+ var t0 = this.__zoom, p0 = pointer_default(event.changedTouches ? event.changedTouches[0] : event, this), p1 = t0.invert(p0), k1 = t0.k * (event.shiftKey ? 0.5 : 2), t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, args), translateExtent);
+ noevent_default3(event);
+ if (duration > 0)
+ select_default2(this).transition().duration(duration).call(schedule, t1, p0, event);
+ else
+ select_default2(this).call(zoom.transform, t1, p0, event);
+ }
+ function touchstarted(event, ...args) {
+ if (!filter2.apply(this, arguments))
+ return;
+ var touches = event.touches, n2 = touches.length, g = gesture(this, args, event.changedTouches.length === n2).event(event), started, i, t, p;
+ nopropagation3(event);
+ for (i = 0; i < n2; ++i) {
+ t = touches[i], p = pointer_default(t, this);
+ p = [p, this.__zoom.invert(p), t.identifier];
+ if (!g.touch0)
+ g.touch0 = p, started = true, g.taps = 1 + !!touchstarting;
+ else if (!g.touch1 && g.touch0[2] !== p[2])
+ g.touch1 = p, g.taps = 0;
+ }
+ if (touchstarting)
+ touchstarting = clearTimeout(touchstarting);
+ if (started) {
+ if (g.taps < 2)
+ touchfirst = p[0], touchstarting = setTimeout(function() {
+ touchstarting = null;
+ }, touchDelay);
+ interrupt_default(this);
+ g.start();
+ }
+ }
+ function touchmoved(event, ...args) {
+ if (!this.__zooming)
+ return;
+ var g = gesture(this, args).event(event), touches = event.changedTouches, n2 = touches.length, i, t, p, l2;
+ noevent_default3(event);
+ for (i = 0; i < n2; ++i) {
+ t = touches[i], p = pointer_default(t, this);
+ if (g.touch0 && g.touch0[2] === t.identifier)
+ g.touch0[0] = p;
+ else if (g.touch1 && g.touch1[2] === t.identifier)
+ g.touch1[0] = p;
+ }
+ t = g.that.__zoom;
+ if (g.touch1) {
+ var p0 = g.touch0[0], l0 = g.touch0[1], p1 = g.touch1[0], l1 = g.touch1[1], dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp, dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
+ t = scale(t, Math.sqrt(dp / dl));
+ p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];
+ l2 = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
+ } else if (g.touch0)
+ p = g.touch0[0], l2 = g.touch0[1];
+ else
+ return;
+ g.zoom("touch", constrain(translate(t, p, l2), g.extent, translateExtent));
+ }
+ function touchended(event, ...args) {
+ if (!this.__zooming)
+ return;
+ var g = gesture(this, args).event(event), touches = event.changedTouches, n2 = touches.length, i, t;
+ nopropagation3(event);
+ if (touchending)
+ clearTimeout(touchending);
+ touchending = setTimeout(function() {
+ touchending = null;
+ }, touchDelay);
+ for (i = 0; i < n2; ++i) {
+ t = touches[i];
+ if (g.touch0 && g.touch0[2] === t.identifier)
+ delete g.touch0;
+ else if (g.touch1 && g.touch1[2] === t.identifier)
+ delete g.touch1;
+ }
+ if (g.touch1 && !g.touch0)
+ g.touch0 = g.touch1, delete g.touch1;
+ if (g.touch0)
+ g.touch0[1] = this.__zoom.invert(g.touch0[0]);
+ else {
+ g.end();
+ if (g.taps === 2) {
+ t = pointer_default(t, this);
+ if (Math.hypot(touchfirst[0] - t[0], touchfirst[1] - t[1]) < tapDistance) {
+ var p = select_default2(this).on("dblclick.zoom");
+ if (p)
+ p.apply(this, arguments);
+ }
+ }
+ }
+ }
+ zoom.wheelDelta = function(_) {
+ return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant_default8(+_), zoom) : wheelDelta;
+ };
+ zoom.filter = function(_) {
+ return arguments.length ? (filter2 = typeof _ === "function" ? _ : constant_default8(!!_), zoom) : filter2;
+ };
+ zoom.touchable = function(_) {
+ return arguments.length ? (touchable = typeof _ === "function" ? _ : constant_default8(!!_), zoom) : touchable;
+ };
+ zoom.extent = function(_) {
+ return arguments.length ? (extent = typeof _ === "function" ? _ : constant_default8([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;
+ };
+ zoom.scaleExtent = function(_) {
+ return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];
+ };
+ zoom.translateExtent = function(_) {
+ return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
+ };
+ zoom.constrain = function(_) {
+ return arguments.length ? (constrain = _, zoom) : constrain;
+ };
+ zoom.duration = function(_) {
+ return arguments.length ? (duration = +_, zoom) : duration;
+ };
+ zoom.interpolate = function(_) {
+ return arguments.length ? (interpolate = _, zoom) : interpolate;
+ };
+ zoom.on = function() {
+ var value = listeners.on.apply(listeners, arguments);
+ return value === listeners ? zoom : value;
+ };
+ zoom.clickDistance = function(_) {
+ return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
+ };
+ zoom.tapDistance = function(_) {
+ return arguments.length ? (tapDistance = +_, zoom) : tapDistance;
+ };
+ return zoom;
+}
+
+// src/Visualisations/VisModal.ts
+var import_obsidian43 = require("obsidian");
+
+// src/Components/VisComp.svelte
+var import_loglevel21 = __toESM(require_loglevel());
+
+// src/Visualisations/ArcDiagram.ts
+var arcDiagram = (graph, currFile, modal, width, height) => {
+ const data = graphlibToD3(graph);
+ const margin = { top: 20, right: 20, bottom: 20, left: 150 };
+ const svg = select_default2(".d3-graph").append("svg").attr("height", height).attr("width", width);
+ const nodes = data.nodes.map(({ id: id2, name }) => ({
+ id: id2,
+ name,
+ sourceLinks: [],
+ targetLinks: []
+ }));
+ const nodeById = new Map(nodes.map((d) => [d.id, d]));
+ const links = data.links.map(({ source, target }) => ({
+ source: nodeById.get(source),
+ target: nodeById.get(target)
+ }));
+ for (const link2 of links) {
+ const { source, target } = link2;
+ source.sourceLinks.push(link2);
+ target.targetLinks.push(link2);
+ }
+ svg.append("style").text(`
+
+path {
+ stroke: #808080;
+ opacity: 0.8;
+}
+
+text {
+ stroke: var(--text-a);
+ opacity: 0.8;
+}
+
+
+.hover g.primary text {
+ fill: black;
+}
+
+.hover g.secondary text {
+ fill: #333;
+}
+
+.hover .secondary {
+ color: red;
+}
+
+.hover path.primary {
+ stroke: #333;
+ stroke-opacity: 1;
+}
+
+.hover rect {
+ opacity: 1;
+ cursor: pointer;
+}
+
+`);
+ const y4 = point(nodes.map((d) => d.name).sort(ascending_default), [
+ margin.top,
+ height - margin.bottom
+ ]);
+ const label = svg.append("g").attr("font-family", "sans-serif").attr("font-size", 10).attr("text-anchor", "end").selectAll("g").data(nodes).join("g").attr("transform", (d) => `translate(${margin.left},${d.y = y4(d.name)})`).call(
+ (g) => g.append("text").attr("x", -6).attr("dy", "0.35em").text((d) => d.name)
+ ).call(
+ (g) => g.append("circle").attr("r", 3)
+ // .attr("fill", (d) => color(d.group))
+ );
+ const path2 = svg.insert("g", "*").attr("fill", "none").attr("stroke-opacity", 0.6).attr("stroke-width", 1.5).selectAll("path").data(links).join("path").attr("d", arc);
+ const step = 104;
+ const nodeClick = (event, dest) => {
+ openOrSwitch(dest, event);
+ modal.close();
+ };
+ const overlay = svg.append("g").attr("fill", "none").attr("pointer-events", "all").selectAll("rect").data(nodes).join("rect").attr("width", margin.left + 40).attr("height", step).attr("y", (d) => y4(d.name) - step / 2).on("mouseover", (d) => {
+ svg.classed("hover", true);
+ label.classed("primary", (n2) => n2 === d);
+ label.classed(
+ "secondary",
+ (n2) => n2.sourceLinks.some((l2) => l2.target === d) || n2.targetLinks.some((l2) => l2.source === d)
+ );
+ path2.classed("primary", (l2) => l2.source === d || l2.target === d).filter(".primary").raise();
+ }).on("mouseout", (d) => {
+ svg.classed("hover", false);
+ label.classed("primary", false);
+ label.classed("secondary", false);
+ path2.classed("primary", false).order();
+ }).on("click", (event, d) => {
+ nodeClick(event, d.name);
+ });
+ function arc(d) {
+ const y1 = d.source.y;
+ const y22 = d.target.y;
+ const r = Math.abs(y22 - y1) / 2;
+ return `M${margin.left},${y1}A${r},${r} 0,0,${y1 < y22 ? 1 : 0} ${margin.left},${y22}`;
+ }
+ function zoomed({ transform: transform2 }) {
+ svg.attr("transform", transform2);
+ }
+ svg.call(
+ zoom_default2().extent([
+ [0, 0],
+ [width, height]
+ ]).scaleExtent([0.5, 8]).on("zoom", zoomed)
+ );
+};
+
+// src/Visualisations/CirclePacking.ts
+var circlePacking = (graph, currFile, modal, width, height) => {
+ const flatAdj = dfsFlatAdjList(graph, currFile.basename);
+ console.log({ flatAdj });
+ const hierarchy2 = stratify_default()(flatAdj);
+ console.log({ hierarchy: hierarchy2 });
+ const adjList = bfsAdjList(graph, currFile.basename);
+ console.log({ adjList });
+ const noDoubles = [...adjList];
+ noDoubles.forEach((a2, i) => {
+ if (noDoubles.some((b, j) => i !== j && a2.name === b.name)) {
+ const index2 = noDoubles.findIndex((b, j) => i !== j && a2.name === b.name);
+ noDoubles.splice(index2, 1);
+ }
+ });
+ console.log({ noDoubles });
+ const linkArr = noDoubles.map((d) => {
+ return { source: d.name, target: d.parentId };
+ });
+ const links = linkArr.map((d) => Object.create(d));
+ const svg = select_default2(".d3-graph").append("svg").attr("height", height).attr("width", width);
+ const nodeColour = getComputedStyle(document.body).getPropertyValue(
+ "--text-accent"
+ );
+ const node = svg.append("g").selectAll("circle").data(noDoubles).join("circle").attr("r", (d) => Math.round(d.height / 10) + 10).attr("cx", width / 2).attr("cy", height / 2).style("fill", nodeColour).style("fill-opacity", 0.6).attr("stroke", nodeColour).style("stroke-width", 4);
+ node.attr("aria-label", (d) => d.name);
+ const nodeClick = (event, dest) => {
+ const currFile2 = getCurrFile();
+ openOrSwitch(dest, event);
+ modal.close();
+ };
+ node.on("click", (event, d) => {
+ nodeClick(event, d.name);
+ });
+ const link2 = svg.append("g").attr("stroke", "#868282").attr("stroke-opacity", 0.6).selectAll("line").data(links).join("line").attr("stroke-width", 0.8);
+ const simulation = simulation_default().force(
+ "center",
+ center_default().x(width / 2).y(height / 2)
+ ).force("charge", manyBody_default().strength(0.5)).force(
+ "collide",
+ collide_default().strength(0.025).radius(30).iterations(1)
+ );
+ simulation.nodes(noDoubles).on("tick", function(d) {
+ node.attr("cx", (d2) => d2.x).attr("cy", (d2) => d2.y);
+ });
+ function zoomed({ transform: transform2 }) {
+ node.attr("transform", transform2);
+ }
+ svg.call(
+ zoom_default2().extent([
+ [0, 0],
+ [width, height]
+ ]).scaleExtent([0.5, 8]).on("zoom", zoomed)
+ );
+ const drag = (simulation2) => {
+ function dragstarted(event, d) {
+ if (!event.active)
+ simulation2.alphaTarget(0.3).restart();
+ d.fx = d.x;
+ d.fy = d.y;
+ }
+ function dragged(event, d) {
+ d.fx = event.x;
+ d.fy = event.y;
+ }
+ function dragended(event, d) {
+ if (!event.active)
+ simulation2.alphaTarget(0);
+ d.fx = null;
+ d.fy = null;
+ }
+ return drag_default().on("start", dragstarted).on("drag", dragged).on("end", dragended);
+ };
+ node.call(drag(simulation));
+};
+
+// src/Visualisations/EdgeBundling.ts
+var edgeBundling = (graph, currFile, modal, width, height) => {
+ const flatAdj = dfsFlatAdjList(graph, currFile.basename);
+ console.log({ flatAdj });
+ const hier = stratify_default()(flatAdj);
+ console.log({ hier });
+ const PADDING_BUBBLE = 15;
+ const PADDING_LABEL = 30;
+ const BUBBLE_SIZE_MIN = 4;
+ const BUBBLE_SIZE_MAX = 20;
+ var diameter = 560, radius = diameter / 2, innerRadius = radius - 170;
+ var cluster = cluster_default().size([360, innerRadius]);
+ var line = lineRadial_default().curve(bundle_default.beta(0.85)).radius(function(d) {
+ return d[1];
+ }).angle(function(d) {
+ return d[0] / 180 * Math.PI;
+ });
+ const svg = select_default2(".d3-graph").append("svg").attr("height", height).attr("width", width).append("g").attr("transform", "translate(" + radius + "," + radius + ")");
+ var link2 = svg.append("g").selectAll(".link"), label = svg.append("g").selectAll(".label"), bubble = svg.append("g").selectAll(".bubble");
+ var bubbleSizeScale = linear2().domain([0, 100]).range([BUBBLE_SIZE_MIN, BUBBLE_SIZE_MAX]);
+ var root2 = packageHierarchy(hier).sum(function(d) {
+ console.log(d);
+ return d.height;
+ });
+ cluster(root2);
+ const leaves = root2.leaves();
+ const _link = link2.data(packageImports(leaves)).enter().append("path").each(function(d) {
+ d.source = d[0], d.target = d[d.length - 1];
+ }).attr("class", "link").attr("d", line).attr("fill", "none").attr("stroke", "black");
+ const _label = label.data(leaves).enter().append("text").attr("class", "label").attr("dy", "0.31em").attr("transform", function(d) {
+ return "rotate(" + (d.x - 90) + ")translate(" + (d.y + PADDING_LABEL) + ",0)" + (d.x < 180 ? "" : "rotate(180)");
+ }).attr("text-anchor", function(d) {
+ return d.x < 180 ? "start" : "end";
+ }).text(function(d) {
+ return d.data.key;
+ });
+ const _bubble = bubble.data(leaves).enter().append("circle").attr("class", "bubble").attr("transform", function(d) {
+ return "rotate(" + (d.x - 90) + ")translate(" + (d.y + PADDING_BUBBLE) + ",0)";
+ }).attr("r", (d) => bubbleSizeScale(d.value)).attr("stroke", "black").attr("fill", "#69a3b2").style("opacity", 0.2);
+ function packageHierarchy(classes) {
+ var map2 = {};
+ function find3(name, data) {
+ var node = map2[name], i;
+ if (!node) {
+ node = map2[name] = data || { name, children: [] };
+ if (name.length) {
+ node.parent = find3(name.substring(0, i = name.lastIndexOf(".")));
+ node.parent.children.push(node);
+ node.key = name.substring(i + 1);
+ }
+ }
+ return node;
+ }
+ classes.forEach(function(d) {
+ find3(d.name, d);
+ });
+ return hierarchy(map2[""]);
+ }
+ function packageImports(nodes) {
+ var map2 = {}, imports = [];
+ nodes.forEach(function(d) {
+ map2[d.data.name] = d;
+ });
+ nodes.forEach(function(d) {
+ if (d.data.imports)
+ d.data.imports.forEach(function(i) {
+ imports.push(map2[d.data.name].path(map2[i]));
+ });
+ });
+ return imports;
+ }
+};
+
+// src/Visualisations/ForceDirectedG.ts
+var forceDirectedG = (graph, currFile, modal, width, height) => {
+ const { settings } = modal.plugin;
+ let nodeToGetTo = currFile.basename;
+ console.log({ nodeToGetTo });
+ console.time("Find all paths");
+ console.timeEnd("Find all paths");
+ const defaultNodeColour = getComputedStyle(document.body).getPropertyValue(
+ "--text-accent"
+ );
+ let currNodeColour = defaultNodeColour;
+ const colourChangeInput = select_default2(".d3-graph").append("input").attr("type", "color");
+ colourChangeInput.on("change", function changeColor(el) {
+ currNodeColour = el.target.value;
+ node.transition().duration(300).style("fill", (d) => {
+ if (d.index === currNodeIndex)
+ return;
+ return currNodeColour;
+ });
+ });
+ const data = graphlibToD3(graph);
+ const links = data.links.map((d) => Object.create(d));
+ const currNode = data.nodes.find((node2) => node2.name === currFile.basename);
+ let currNodeIndex;
+ if (!currNode) {
+ const id2 = data.nodes.length;
+ data.nodes.push({ id: id2, name: currFile.basename });
+ currNodeIndex = id2;
+ } else {
+ currNodeIndex = currNode.id;
+ }
+ const nodes = data.nodes.map((d) => Object.create(d));
+ const simulation = simulation_default(nodes).force(
+ "link",
+ link_default(links).id((d) => d.id)
+ ).force("charge", manyBody_default().strength(-8)).force("center", center_default(width / 2, height / 2).strength(0.5));
+ const drag = (simulation2) => {
+ function dragstarted(event, d) {
+ if (!event.active)
+ simulation2.alphaTarget(0.3).restart();
+ d.fx = d.x;
+ d.fy = d.y;
+ }
+ function dragged(event, d) {
+ d.fx = event.x;
+ d.fy = event.y;
+ }
+ function dragended(event, d) {
+ if (!event.active)
+ simulation2.alphaTarget(0);
+ d.fx = null;
+ d.fy = null;
+ }
+ return drag_default().on("start", dragstarted).on("drag", dragged).on("end", dragended);
+ };
+ const svg = select_default2(".d3-graph").append("svg").attr("height", height).attr("width", width).attr("class", "forceDirectedG");
+ const link2 = svg.append("g").attr("stroke", "#868282").attr("stroke-opacity", 0.6).selectAll("line").data(links).join("line").attr("stroke-width", 0.8).attr("marker-end", "url(#end)");
+ var path2 = svg.append("svg:g").selectAll("path").data(links).enter().append("svg:path").attr("class", "link").attr("marker-end", "url(#end)");
+ const arrowHead = svg.append("svg:defs").selectAll("marker").data(["end"]).enter().append("svg:marker").attr("id", String).attr("viewBox", "0 -5 10 10").attr("refX", 20).attr("refY", 0.1).attr("markerWidth", 6).attr("markerHeight", 6).attr("orient", "auto").attr("stroke-width", 10).append("svg:path").attr("d", "M0,-5L10,0L0,5");
+ const nameFromIndex = (d) => data.nodes.find((node2) => node2.id === d.index).name;
+ const indexFromName = (name) => data.nodes.find((node2) => node2.name === name).id;
+ const node = svg.append("g").selectAll("circle").data(nodes).join("circle").attr("r", 5).attr("fill", (d) => {
+ if (nameFromIndex(d) === currFile.basename) {
+ return "#ffffff";
+ } else {
+ return currNodeColour;
+ }
+ }).call(drag(simulation));
+ node.attr("aria-label", (d) => d.name);
+ const nodeClick = (event, dest) => {
+ openOrSwitch(dest, event);
+ modal.close();
+ };
+ node.on("click", (event, d) => {
+ nodeClick(event, d.name);
+ });
+ node.on("mousedown", (event, d) => {
+ if (event.button === 2) {
+ nodeToGetTo = d.name;
+ node.style("fill", (n2) => {
+ if (n2.name === nodeToGetTo) {
+ return "#ff0000";
+ } else
+ return currNodeColour;
+ });
+ }
+ });
+ function linked(a2, b) {
+ if (a2 === b)
+ return true;
+ const linkedArr = links.find(
+ (link3) => link3.source.index === a2 && link3.target.index === b || link3.target.index === a2 && link3.source.index === b
+ );
+ return !!linkedArr;
+ }
+ node.on("mouseover", (event, d) => {
+ node.transition().duration(150).style("opacity", (o) => {
+ return linked(d.index, o.index) ? 1 : 0.2;
+ });
+ link2.transition().duration(150).style("opacity", function(o) {
+ return o.source.index === d.index || o.target.index === d.index ? 1 : 0.2;
+ });
+ const hoveredNode = nameFromIndex(d);
+ }).on("mouseout", unfocus);
+ function focusNeighbours(d, event) {
+ }
+ function unfocus() {
+ node.style("opacity", 1);
+ link2.style("opacity", 1).style("stroke", "#868282");
+ }
+ simulation.on("tick", () => {
+ link2.attr("x1", (d) => d.source.x).attr("y1", (d) => d.source.y).attr("x2", (d) => d.target.x).attr("y2", (d) => d.target.y);
+ node.attr("cx", (d) => d.x).attr("cy", (d) => d.y);
+ });
+ function zoomed({ transform: transform2 }) {
+ node.attr("transform", transform2);
+ link2.attr("transform", transform2);
+ }
+ svg.call(
+ zoom_default2().extent([
+ [0, 0],
+ [width, height]
+ ]).scaleExtent([0.5, 10]).on("zoom", zoomed)
+ );
+ function saveGraph() {
+ const clone3 = svg.clone(true);
+ localStorage.setItem("FDG", JSON.stringify(clone3));
+ }
+};
+
+// src/Visualisations/Icicle.ts
+var icicle = (graph, currFile, modal, width, viewHeight) => {
+ const flatAdj = dfsFlatAdjList(graph, currFile.basename);
+ console.log({ flatAdj });
+ const hier = stratify_default()(flatAdj);
+ console.log({ hier });
+ const format2 = format(",d");
+ const color2 = ordinal(
+ quantize_default(rainbow_default, hier.children.length + 1)
+ );
+ const partition = (data) => {
+ const root3 = hierarchy(data).sum((d) => d.value).sort((a2, b) => b.height - a2.height || b.value - a2.value);
+ return partition_default().size([viewHeight, (root3.height + 1) * width / 3])(
+ root3
+ );
+ };
+ const root2 = partition(hier);
+ let focus = root2;
+ const svg = select_default2(".d3-graph").append("svg").attr("height", viewHeight).attr("width", width).style("font", "10px sans-serif");
+ const cell = svg.selectAll("g").data(root2.descendants()).join("g").attr("transform", (d) => `translate(${d.y0},${d.x0})`);
+ const rect = cell.append("rect").attr("width", (d) => d.y1 - d.y0 - 1).attr("height", (d) => rectHeight(d)).attr("fill-opacity", 0.6).attr("fill", (d) => {
+ if (!d.depth)
+ return "#ccc";
+ while (d.depth > 1)
+ d = d.parent;
+ return color2(d.data.data.name);
+ }).style("cursor", "pointer").on("click", clicked);
+ const text2 = cell.append("text").style("user-select", "none").attr("pointer-events", "none").attr("x", 4).attr("y", 13);
+ text2.append("tspan").text((d) => d.data.data.name);
+ const tspan = text2.append("tspan").attr("fill-opacity", (d) => (labelVisible(d) ? 1 : 0) * 0.7).text((d) => ` ${format2(d.value)}`);
+ cell.append("title").text(
+ (d) => `${d.ancestors().map((d2) => d2.data.data.name)}`
+ );
+ function clicked(event, p) {
+ console.log({ p });
+ focus = focus === p ? p = p.parent : p;
+ root2.each((d) => {
+ d.target = {
+ x0: (d.x0 - p.x0) / (p.x1 - p.x0) * viewHeight,
+ x1: (d.x1 - p.x0) / (p.x1 - p.x0) * viewHeight,
+ y0: d.y0 - p.y0,
+ y1: d.y1 - p.y0
+ };
+ console.log(d.target.x0);
+ });
+ const t = cell.transition().duration(750).attr("transform", (d) => `translate(${d.target.y0},${d.target.x0})`);
+ rect.transition(t).attr("height", (d) => rectHeight(d.target));
+ text2.transition(t).attr("fill-opacity", (d) => +labelVisible(d.target));
+ tspan.transition(t).attr("fill-opacity", (d) => (labelVisible(d) ? 1 : 0) * 0.7);
+ }
+ function rectHeight(d) {
+ console.log({ d });
+ return d.x1 - d.x0 - Math.min(1, (d.x1 - d.x0) / 2);
+ }
+ function labelVisible(d) {
+ return d.y1 <= width && d.y0 >= 0 && d.x1 - d.x0 > 16;
+ }
+};
+
+// src/Visualisations/RadialTree.ts
+var radialTree = (graph, currFile, modal, width, height) => {
+ const flatAdj = dfsFlatAdjList(graph, currFile.basename);
+ console.log({ flatAdj });
+ const hierarchy2 = stratify_default()(flatAdj);
+ console.log({ hierarchy: hierarchy2 });
+ const svg = select_default2(".d3-graph").append("svg").attr("height", height).attr("width", width);
+ const root2 = hierarchy(hierarchy2, (d) => d.children).sum((d) => d.children ? 0 : 1).sort((a2, b) => a2.depth - b.depth);
+ const outerRadius = width / 2;
+ const innerRadius = outerRadius - 170;
+ const cluster = cluster_default().size([360, innerRadius]).separation((a2, b) => 1);
+ const color2 = ordinal().domain(graph.nodes()).range(category10_default);
+ function maxLength(d) {
+ return d.data.data.depth + (d.children ? max(d.children, maxLength) : 0);
+ }
+ function setRadius(d, y0, k) {
+ d.radius = (y0 += d.data.data.depth) * k;
+ if (d.children)
+ d.children.forEach((d2) => setRadius(d2, y0, k));
+ }
+ function setColor(d) {
+ var name = d.data.data.name;
+ d.color = color2.domain().indexOf(name) >= 0 ? color2(name) : d.parent ? d.parent.color : null;
+ if (d.children)
+ d.children.forEach(setColor);
+ }
+ function linkVariable(d) {
+ return linkStep(d.source.x, d.source.radius, d.target.x, d.target.radius);
+ }
+ function linkConstant(d) {
+ return linkStep(d.source.x, d.source.y, d.target.x, d.target.y);
+ }
+ function linkExtensionVariable(d) {
+ return linkStep(d.target.x, d.target.radius, d.target.x, innerRadius);
+ }
+ function linkExtensionConstant(d) {
+ return linkStep(d.target.x, d.target.y, d.target.x, innerRadius);
+ }
+ function linkStep(startAngle, startRadius, endAngle, endRadius) {
+ const c0 = Math.cos(startAngle = (startAngle - 90) / 180 * Math.PI);
+ const s0 = Math.sin(startAngle);
+ const c1 = Math.cos(endAngle = (endAngle - 90) / 180 * Math.PI);
+ const s1 = Math.sin(endAngle);
+ return "M" + startRadius * c0 + "," + startRadius * s0 + (endAngle === startAngle ? "" : "A" + startRadius + "," + startRadius + " 0 0 " + (endAngle > startAngle ? 1 : 0) + " " + startRadius * c1 + "," + startRadius * s1) + "L" + endRadius * c1 + "," + endRadius * s1;
+ }
+ const legend = (svg2) => {
+ const g = svg2.selectAll("g").data(color2.domain()).join("g").attr(
+ "transform",
+ (d, i) => `translate(${-outerRadius},${-outerRadius + i * 20})`
+ );
+ g.append("rect").attr("width", 18).attr("height", 18).attr("fill", color2);
+ g.append("text").attr("x", 24).attr("y", 9).attr("dy", "0.35em").text((d) => d);
+ };
+ cluster(root2);
+ setRadius(root2, root2.data.data.depth = 0, innerRadius / maxLength(root2));
+ setColor(root2);
+ svg.append("g").call(legend);
+ svg.append("style").text(`
+
+.link--active {
+stroke: #000 !important;
+stroke-width: 1.5px;
+}
+
+.link-extension--active {
+stroke-opacity: .6;
+}
+
+.label--active {
+font-weight: bold;
+}
+
+`);
+ const linkExtension = svg.append("g").attr("fill", "none").attr("stroke", "#000").attr("stroke-opacity", 0.25).selectAll("path").data(root2.links().filter((d) => !d.target.children)).join("path").each(function(d) {
+ d.target.linkExtensionNode = this;
+ }).attr("d", linkExtensionConstant);
+ const link2 = svg.append("g").attr("fill", "none").attr("stroke", "#000").selectAll("path").data(root2.links()).join("path").each(function(d) {
+ d.target.linkNode = this;
+ }).attr("d", linkConstant).attr("stroke", (d) => d.target.color);
+ const label = svg.append("g").selectAll("text").data(root2.leaves()).join("text").attr("dy", ".31em").attr(
+ "transform",
+ (d) => `rotate(${d.x - 90}) translate(${innerRadius + 4},0)${d.x < 180 ? "" : " rotate(180)"}`
+ ).attr("text-anchor", (d) => d.x < 180 ? "start" : "end").text((d) => d.data.data.name).on("mouseover", mouseovered(true)).on("mouseout", mouseovered(false));
+ function mouseovered(active) {
+ return function(event, d) {
+ select_default2(this).classed("label--active", active);
+ select_default2(d.linkExtensionNode).classed("link-extension--active", active).raise();
+ do
+ select_default2(d.linkNode).classed("link--active", active).raise();
+ while (d = d.parent);
+ };
+ }
+ function zoomed({ transform: transform2 }) {
+ linkExtension.attr("transform", transform2);
+ link2.attr("transform", transform2);
+ label.attr("transform", transform2);
+ }
+ svg.call(
+ zoom_default2().extent([
+ [0, 0],
+ [width, height]
+ ]).scaleExtent([0.5, 8]).on("zoom", zoomed)
+ );
+};
+
+// src/Visualisations/Sunburst.ts
+var sunburst = (graph, currFile, modal, width, height) => {
+ const flatAdj = dfsFlatAdjList(graph, currFile.basename);
+ console.log({ flatAdj });
+ const hierarchy2 = stratify_default()(flatAdj);
+ console.log({ hierarchy: hierarchy2 });
+ var radius = Math.min(width, height) / 2;
+ var color2 = ordinal(category10_default);
+ var g = select_default2("svg").attr("width", width).attr("height", height).append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
+ var g = select_default2("svg").attr("width", width).attr("height", height).append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
+ var g = select_default2("svg").attr("width", width).attr("height", height).append("g").attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
+ var partition = partition_default().size([2 * Math.PI, radius]);
+ var root2 = hierarchy(hierarchy2).sum(function(d) {
+ return d.height;
+ });
+ partition(root2);
+ var arc = arc_default().startAngle(function(d) {
+ return d.x0;
+ }).endAngle(function(d) {
+ return d.x1;
+ }).innerRadius(function(d) {
+ return d.y0;
+ }).outerRadius(function(d) {
+ return d.y1;
+ });
+ g.selectAll("path").data(root2.descendants()).enter().append("path").attr("display", function(d) {
+ return d.depth ? null : "none";
+ }).attr("d", arc).style("stroke", "#fff").style("fill", function(d) {
+ return color2((d.children ? d : d.parent).data.name);
+ });
+};
+
+// src/Visualisations/TidyTree.ts
+var tidyTree = (graph, currFile, modal, width, height) => {
+ const tree = (data) => {
+ const root3 = hierarchy(data);
+ root3.dx = 10;
+ root3.dy = width / (root3.height + 1);
+ return tree_default().nodeSize([root3.dx, root3.dy])(root3);
+ };
+ const flatAdj = dfsFlatAdjList(graph, currFile.basename);
+ console.log({ flatAdj });
+ const hierarchy2 = stratify_default()(flatAdj);
+ console.log({ hierarchy: hierarchy2 });
+ const root2 = tree(hierarchy2);
+ console.log(root2);
+ let x0 = Infinity;
+ let x1 = -x0;
+ root2.each((d) => {
+ if (d.x > x1)
+ x1 = d.x;
+ if (d.x < x0)
+ x0 = d.x;
+ });
+ const svg = select_default2(".d3-graph").append("svg").attr("height", height).attr("width", width);
+ const g = svg.append("g").attr("font-family", "sans-serif").attr("font-size", 10).attr("transform", `translate(${root2.dy / 3},${root2.dx - x0})`);
+ const link2 = g.append("g").attr("fill", "none").attr("stroke", "#555").attr("stroke-opacity", 0.4).attr("stroke-width", 1.5).selectAll("path").data(root2.links()).join("path").attr(
+ "d",
+ linkHorizontal().x((d) => d.y).y((d) => d.x)
+ );
+ const node = g.append("g").attr("stroke-linejoin", "round").attr("stroke-width", 10).selectAll("g").data(root2.descendants()).join("g").attr("transform", (d) => `translate(${d.y},${d.x})`);
+ node.append("circle").attr("fill", (d) => d.children ? "#555" : "#999").attr("r", 10);
+ node.attr("aria-label", (d) => {
+ console.log(d);
+ return d.data.data.name;
+ });
+ const nodeClick = (event, dest) => {
+ openOrSwitch(dest, event);
+ modal.close();
+ };
+ node.on("click", (event, d) => {
+ console.log({ d });
+ nodeClick(event, d.data.data.name);
+ });
+ node.append("text").attr("dy", "0.31em").attr("x", (d) => d.children ? -6 : 6).attr("text-anchor", (d) => d.children ? "end" : "start").text((d) => d.data.data.name).clone(true).lower().attr("stroke", "white");
+ function zoomed({ transform: transform2 }) {
+ svg.attr("transform", transform2);
+ }
+ svg.call(
+ zoom_default2().extent([
+ [0, 0],
+ [width, height]
+ ]).scaleExtent([0.5, 8]).on("zoom", zoomed)
+ );
+};
+
+// src/Visualisations/TreeMap.ts
+var treeMap = (graph, currFile, modal, width, height) => {
+ const flatAdj = dfsFlatAdjList(graph, currFile.basename);
+ console.log({ flatAdj });
+ const hierarchy2 = stratify_default()(flatAdj);
+ console.log({ hierarchy: hierarchy2 });
+ const root2 = treemap_default().tile(binary_default).size([width, height]).padding(1).round(true)(
+ hierarchy2.sum((d) => d.height).sort((a2, b) => b.height - a2.height)
+ );
+ const svg = select_default2(".d3-graph").append("svg").attr("height", height).attr("width", width).style("font", "10px sans-serif");
+ const leaf = svg.selectAll("g").data(root2.leaves()).join("g").attr("transform", (d) => `translate(${d.x0},${d.y0})`);
+ leaf.attr("aria-label", (d) => d.data.name);
+ const color2 = ordinal(category10_default);
+ leaf.append("rect").attr("fill", (d) => {
+ while (d.depth > 1)
+ d = d.parent;
+ return color2(d.data.id);
+ }).attr("fill-opacity", 0.6).attr("width", (d) => d.x1 - d.x0).attr("height", (d) => d.y1 - d.y0);
+ leaf.append("clipPath").append("use");
+ const nodeClick = (event, dest) => {
+ openOrSwitch(dest, event);
+ modal.close();
+ };
+ leaf.on("click", (event, d) => {
+ console.log({ d });
+ nodeClick(event, d.data.name);
+ });
+ function zoomed({ transform: transform2 }) {
+ svg.attr("transform", transform2);
+ }
+ svg.call(
+ zoom_default2().extent([
+ [0, 0],
+ [width, height]
+ ]).scaleExtent([0.5, 8]).on("zoom", zoomed)
+ );
+};
+
+// src/Components/VisComp.svelte
+function get_each_context10(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[23] = list[i].text;
+ child_ctx[24] = list[i].options;
+ child_ctx[25] = list[i].val;
+ child_ctx[26] = list;
+ child_ctx[27] = i;
+ return child_ctx;
+}
+function get_each_context_17(ctx, list, i) {
+ const child_ctx = ctx.slice();
+ child_ctx[28] = list[i];
+ return child_ctx;
+}
+function create_each_block_17(ctx) {
+ let option;
+ let t_value = (
+ /*op*/
+ ctx[28] + ""
+ );
+ let t;
+ let option_value_value;
+ return {
+ c() {
+ option = element("option");
+ t = text(t_value);
+ option.__value = option_value_value = /*op*/
+ ctx[28];
+ option.value = option.__value;
+ },
+ m(target, anchor) {
+ insert(target, option, anchor);
+ append(option, t);
+ },
+ p(ctx2, dirty) {
+ if (dirty & /*selectors*/
+ 1 && t_value !== (t_value = /*op*/
+ ctx2[28] + ""))
+ set_data(t, t_value);
+ if (dirty & /*selectors*/
+ 1 && option_value_value !== (option_value_value = /*op*/
+ ctx2[28])) {
+ option.__value = option_value_value;
+ option.value = option.__value;
+ }
+ },
+ d(detaching) {
+ if (detaching)
+ detach(option);
+ }
+ };
+}
+function create_each_block10(ctx) {
+ let span;
+ let t0_value = (
+ /*text*/
+ ctx[23] + ""
+ );
+ let t0;
+ let t1;
+ let select;
+ let t2;
+ let mounted;
+ let dispose;
+ let each_value_1 = (
+ /*options*/
+ ctx[24]
+ );
+ let each_blocks = [];
+ for (let i = 0; i < each_value_1.length; i += 1) {
+ each_blocks[i] = create_each_block_17(get_each_context_17(ctx, each_value_1, i));
+ }
+ function select_change_handler() {
+ ctx[2].call(
+ select,
+ /*each_value*/
+ ctx[26],
+ /*each_index*/
+ ctx[27]
+ );
+ }
+ return {
+ c() {
+ span = element("span");
+ t0 = text(t0_value);
+ t1 = text(":\n ");
+ select = element("select");
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ t2 = space();
+ if (
+ /*val*/
+ ctx[25] === void 0
+ )
+ add_render_callback(select_change_handler);
+ },
+ m(target, anchor) {
+ insert(target, span, anchor);
+ append(span, t0);
+ append(span, t1);
+ append(span, select);
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ if (each_blocks[i]) {
+ each_blocks[i].m(select, null);
+ }
+ }
+ select_option(
+ select,
+ /*val*/
+ ctx[25],
+ true
+ );
+ append(span, t2);
+ if (!mounted) {
+ dispose = listen(select, "change", select_change_handler);
+ mounted = true;
+ }
+ },
+ p(new_ctx, dirty) {
+ ctx = new_ctx;
+ if (dirty & /*selectors*/
+ 1 && t0_value !== (t0_value = /*text*/
+ ctx[23] + ""))
+ set_data(t0, t0_value);
+ if (dirty & /*selectors*/
+ 1) {
+ each_value_1 = /*options*/
+ ctx[24];
+ let i;
+ for (i = 0; i < each_value_1.length; i += 1) {
+ const child_ctx = get_each_context_17(ctx, each_value_1, i);
+ if (each_blocks[i]) {
+ each_blocks[i].p(child_ctx, dirty);
+ } else {
+ each_blocks[i] = create_each_block_17(child_ctx);
+ each_blocks[i].c();
+ each_blocks[i].m(select, null);
+ }
+ }
+ for (; i < each_blocks.length; i += 1) {
+ each_blocks[i].d(1);
+ }
+ each_blocks.length = each_value_1.length;
+ }
+ if (dirty & /*selectors*/
+ 1) {
+ select_option(
+ select,
+ /*val*/
+ ctx[25]
+ );
+ }
+ },
+ d(detaching) {
+ if (detaching)
+ detach(span);
+ destroy_each(each_blocks, detaching);
+ mounted = false;
+ dispose();
+ }
+ };
+}
+function create_fragment23(ctx) {
+ let div0;
+ let t;
+ let div1;
+ let each_value = (
+ /*selectors*/
+ ctx[0]
+ );
+ let each_blocks = [];
+ for (let i = 0; i < each_value.length; i += 1) {
+ each_blocks[i] = create_each_block10(get_each_context10(ctx, each_value, i));
+ }
+ return {
+ c() {
+ div0 = element("div");
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ each_blocks[i].c();
+ }
+ t = space();
+ div1 = element("div");
+ attr(div1, "class", "d3-graph");
+ },
+ m(target, anchor) {
+ insert(target, div0, anchor);
+ for (let i = 0; i < each_blocks.length; i += 1) {
+ if (each_blocks[i]) {
+ each_blocks[i].m(div0, null);
+ }
+ }
+ insert(target, t, anchor);
+ insert(target, div1, anchor);
+ },
+ p(ctx2, [dirty]) {
+ if (dirty & /*selectors*/
+ 1) {
+ each_value = /*selectors*/
+ ctx2[0];
+ let i;
+ for (i = 0; i < each_value.length; i += 1) {
+ const child_ctx = get_each_context10(ctx2, each_value, i);
+ if (each_blocks[i]) {
+ each_blocks[i].p(child_ctx, dirty);
+ } else {
+ each_blocks[i] = create_each_block10(child_ctx);
+ each_blocks[i].c();
+ each_blocks[i].m(div0, 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(div0);
+ destroy_each(each_blocks, detaching);
+ if (detaching)
+ detach(t);
+ if (detaching)
+ detach(div1);
+ }
+ };
+}
+function instance23($$self, $$props, $$invalidate) {
+ let argArr;
+ ;
+ ;
+ let { modal } = $$props;
+ const { plugin } = modal;
+ const { mainG, settings } = plugin;
+ const { visGraph, visRelation, visClosed, visAll } = settings;
+ const currFile = getCurrFile();
+ const selectors = [
+ {
+ text: "Type",
+ options: VISTYPES,
+ val: visGraph
+ },
+ {
+ text: "Relation",
+ options: RELATIONS,
+ val: visRelation
+ },
+ {
+ text: "Close Implied",
+ options: REAlCLOSED,
+ val: visClosed
+ },
+ {
+ text: "No Unlinked",
+ options: ALLUNLINKED,
+ val: visAll
+ }
+ ];
+ const [width, height] = [Math.round(window.innerWidth / 1.3), Math.round(window.innerHeight / 1.3)];
+ const [up, same, down] = [
+ getSubInDirs(mainG, "up"),
+ getSubInDirs(mainG, "same"),
+ getSubInDirs(mainG, "down")
+ ];
+ const [closedParentNoSingle, closedSiblingNoSingle, closedChildNoSingle] = [
+ closeImpliedLinks(up, down),
+ closeImpliedLinks(same, same),
+ closeImpliedLinks(down, up)
+ ];
+ const graphs = {
+ Parent: {
+ Real: {
+ All: up,
+ "No Unlinked": removeUnlinkedNodes(up)
+ },
+ Closed: {
+ All: closedParentNoSingle,
+ "No Unlinked": removeUnlinkedNodes(closedParentNoSingle)
+ }
+ },
+ Sibling: {
+ Real: {
+ All: same,
+ "No Unlinked": removeUnlinkedNodes(same)
+ },
+ Closed: {
+ All: closedSiblingNoSingle,
+ "No Unlinked": removeUnlinkedNodes(closedSiblingNoSingle)
+ }
+ },
+ Child: {
+ Real: {
+ All: down,
+ "No Unlinked": removeUnlinkedNodes(down)
+ },
+ Closed: {
+ All: closedChildNoSingle,
+ "No Unlinked": removeUnlinkedNodes(closedChildNoSingle)
+ }
+ }
+ };
+ const types = {
+ "Force Directed Graph": forceDirectedG,
+ "Tidy Tree": tidyTree,
+ "Circle Packing": circlePacking,
+ "Edge Bundling": edgeBundling,
+ "Arc Diagram": arcDiagram,
+ Sunburst: sunburst,
+ "Tree Map": treeMap,
+ Icicle: icicle,
+ "Radial Tree": radialTree
+ };
+ function draw(type2) {
+ if (!document.querySelector(".d3-graph")) {
+ setTimeout(
+ () => {
+ var _a;
+ (_a = document.querySelector(".d3-graph")) === null || _a === void 0 ? void 0 : _a.empty();
+ try {
+ types[type2](...argArr);
+ } catch (error6) {
+ (0, import_loglevel21.warn)(error6);
+ }
+ },
+ 10
+ );
+ } else {
+ document.querySelector(".d3-graph").empty();
+ try {
+ types[type2](...argArr);
+ } catch (error6) {
+ (0, import_loglevel21.warn)(error6);
+ }
+ }
+ }
+ function select_change_handler(each_value, each_index) {
+ each_value[each_index].val = select_value(this);
+ $$invalidate(0, selectors);
+ }
+ $$self.$$set = ($$props2) => {
+ if ("modal" in $$props2)
+ $$invalidate(1, modal = $$props2.modal);
+ };
+ $$self.$$.update = () => {
+ if ($$self.$$.dirty & /*selectors, modal*/
+ 3) {
+ $:
+ argArr = [
+ graphs[selectors[1].val][selectors[2].val][selectors[3].val],
+ app,
+ currFile,
+ modal,
+ width,
+ height
+ ];
+ }
+ if ($$self.$$.dirty & /*selectors*/
+ 1) {
+ $:
+ draw(selectors[0].val);
+ }
+ };
+ return [selectors, modal, select_change_handler];
+}
+var VisComp = class extends SvelteComponent {
+ constructor(options) {
+ super();
+ init(this, options, instance23, create_fragment23, safe_not_equal, { modal: 1 });
+ }
+};
+var VisComp_default = VisComp;
+
+// src/Visualisations/VisModal.ts
+function graphlibToD3(g) {
+ const d3Graph = { nodes: [], links: [] };
+ const nodeIDs = {};
+ g.nodes().forEach((node, i) => {
+ d3Graph.nodes.push({ id: i, name: node });
+ nodeIDs[node] = i;
+ });
+ g.forEachEdge((k, a2, s2, t) => {
+ d3Graph.links.push({
+ source: nodeIDs[s2],
+ target: nodeIDs[t]
+ });
+ });
+ return d3Graph;
+}
+function bfsAdjList(g, startNode) {
+ const queue = [startNode];
+ const adjList = [];
+ let i = 0;
+ while (queue.length && i < 1e3) {
+ i++;
+ const currNode = queue.shift();
+ const neighbours = {
+ succs: getOutNeighbours(g, currNode),
+ pres: getInNeighbours(g, currNode)
+ };
+ console.log({ currNode, neighbours });
+ const next = {
+ name: currNode,
+ pres: void 0,
+ succs: void 0,
+ parentId: i,
+ depth: i
+ };
+ if (neighbours.succs.length) {
+ next.succs = neighbours.succs;
+ queue.push(...neighbours.succs);
+ }
+ if (neighbours.pres.length) {
+ next.pres = neighbours.pres;
+ }
+ adjList.push(next);
+ }
+ const maxDepth = adjList.sort((a2, b) => a2.depth - b.depth).last().depth;
+ adjList.forEach((item) => item.height = maxDepth - item.depth);
+ return adjList;
+}
+function dfsFlatAdjList(g, startNode) {
+ const nodes = g.nodes();
+ const nodeCount = nodes.length;
+ const visits = {};
+ nodes.forEach((node, i2) => {
+ visits[node] = nodeCount * i2;
+ });
+ const queue = [startNode];
+ const adjList = [];
+ let depth = 1;
+ let i = 0;
+ while (queue.length && i < 1e3) {
+ i++;
+ const currNode = queue.shift();
+ const next = getOutNeighbours(g, currNode);
+ if (next.length) {
+ queue.unshift(...next);
+ next.forEach((succ) => {
+ const parentId = nodeCount * nodes.indexOf(succ);
+ if (!adjList.some(
+ (adjItem) => adjItem.name === currNode && adjItem.parentId === parentId
+ )) {
+ adjList.push({
+ id: visits[currNode],
+ name: currNode,
+ parentId,
+ depth
+ });
+ visits[currNode]++;
+ }
+ });
+ depth++;
+ } else {
+ adjList.push({
+ id: visits[currNode],
+ name: currNode,
+ parentId: 999999999,
+ depth
+ });
+ depth = 1;
+ visits[currNode]++;
+ }
+ }
+ adjList.push({
+ id: 999999999,
+ name: "CONTAINER",
+ parentId: void 0,
+ depth: 0
+ });
+ const maxDepth = adjList.sort((a2, b) => a2.depth - b.depth).last().depth;
+ adjList.forEach((item) => item.height = maxDepth - item.depth);
+ console.log({ visits });
+ return adjList;
+}
+var stratify = stratify_default().id(function(d) {
+ console.log({ d });
+ return d.name;
+}).parentId(function(d) {
+ return d.parentId;
+});
+var VisModal8 = class extends import_obsidian43.Modal {
+ constructor(plugin) {
+ super(app);
+ this.plugin = plugin;
+ this.modal = this;
+ }
+ onOpen() {
+ new import_obsidian43.Notice(
+ "Alot of these features may not work, it is still very experimental."
+ );
+ const { contentEl } = this;
+ contentEl.empty();
+ new VisComp_default({
+ target: contentEl,
+ props: {
+ modal: this
+ }
+ });
+ }
+ onClose() {
+ this.contentEl.empty();
+ }
+};
+
+// src/main.ts
+var BCPlugin = class extends import_obsidian44.Plugin {
+ constructor() {
+ super(...arguments);
+ this.visited = [];
+ this.activeLeafChange = void 0;
+ this.layoutChange = void 0;
+ this.loadSettings = async () => this.settings = Object.assign(
+ {},
+ DEFAULT_SETTINGS,
+ await this.loadData()
+ );
+ this.saveSettings = async () => await this.saveData(this.settings);
+ }
+ registerActiveLeafChangeEvent() {
+ this.activeLeafChange = app.workspace.on(
+ "file-open",
+ async () => {
+ if (this.settings.refreshOnNoteChange)
+ await refreshIndex(this);
+ else {
+ const activeView = this.getActiveTYPEView(MATRIX_VIEW);
+ if (activeView)
+ await activeView.draw();
+ }
+ }
+ );
+ this.registerEvent(this.activeLeafChange);
+ }
+ registerLayoutChangeEvent() {
+ this.layoutChange = app.workspace.on("layout-change", async () => {
+ if (this.settings.showBCs)
+ await drawTrail(this);
+ });
+ this.registerEvent(this.layoutChange);
+ }
+ async onload() {
+ console.log("loading breadcrumbs plugin");
+ await this.loadSettings();
+ this.addSettingTab(new BCSettingTab(this));
+ this.db = new Debugger(this);
+ const { settings } = this;
+ const {
+ fieldSuggestor,
+ enableRelationSuggestor,
+ openMatrixOnLoad,
+ openDuckOnLoad,
+ openDownOnLoad,
+ showBCs,
+ userHiers
+ } = settings;
+ if (fieldSuggestor)
+ this.registerEditorSuggest(new FieldSuggestor(this));
+ if (enableRelationSuggestor)
+ this.registerEditorSuggest(new RelationSuggestor(this));
+ if (settings.limitTrailCheckboxes.length === 0)
+ settings.limitTrailCheckboxes = getFields(settings.userHiers);
+ if (typeof settings.showAll === "boolean")
+ settings.showAll = settings.showAll ? "All" : "Shortest";
+ this.VIEWS = [
+ {
+ plain: "Matrix",
+ type: MATRIX_VIEW,
+ constructor: MatrixView,
+ openOnLoad: openMatrixOnLoad
+ },
+ {
+ plain: "Duck",
+ type: DUCK_VIEW,
+ constructor: DucksView,
+ openOnLoad: openDuckOnLoad
+ },
+ {
+ plain: "Down",
+ type: TREE_VIEW,
+ constructor: TreeView,
+ openOnLoad: openDownOnLoad
+ }
+ ];
+ for (const { constructor, type: type2 } of this.VIEWS) {
+ this.registerView(
+ type2,
+ (leaf) => (
+ //@ts-ignore
+ new constructor(leaf, this)
+ )
+ );
+ }
+ (0, import_obsidian44.addIcon)(DUCK_ICON, DUCK_ICON_SVG);
+ (0, import_obsidian44.addIcon)(TRAIL_ICON, TRAIL_ICON_SVG);
+ this.addRibbonIcon(
+ addFeatherIcon("tv"),
+ "Breadcrumbs Visualisation",
+ () => new VisModal8(this).open()
+ );
+ await waitForCache(this);
+ this.mainG = await buildMainG(this);
+ this.closedG = buildClosedG(this);
+ app.workspace.onLayoutReady(async () => {
+ var _a;
+ const noFiles = app.vault.getMarkdownFiles().length;
+ if (((_a = this.mainG) == null ? void 0 : _a.nodes().length) < noFiles) {
+ await wait(3e3);
+ this.mainG = await buildMainG(this);
+ this.closedG = buildClosedG(this);
+ }
+ for (const { openOnLoad, type: type2, constructor } of this.VIEWS)
+ if (openOnLoad)
+ await openView(type2, constructor);
+ if (showBCs)
+ await drawTrail(this);
+ this.registerActiveLeafChangeEvent();
+ this.registerLayoutChangeEvent();
+ const saveCommandDefinition = app.commands.commands["editor:save-file"];
+ const save = saveCommandDefinition == null ? void 0 : saveCommandDefinition.callback;
+ if (typeof save === "function") {
+ saveCommandDefinition.callback = async () => {
+ await save();
+ if (this.settings.refreshOnNoteSave) {
+ await refreshIndex(this);
+ const activeView = this.getActiveTYPEView(MATRIX_VIEW);
+ if (activeView)
+ await activeView.draw();
+ }
+ };
+ }
+ app.workspace.iterateAllLeaves((leaf) => {
+ if (leaf instanceof import_obsidian44.MarkdownView)
+ leaf.view.previewMode.rerender(true);
+ });
+ });
+ for (const { type: type2, plain, constructor } of this.VIEWS) {
+ this.addCommand({
+ id: `show-${type2}-view`,
+ name: `Open ${plain} View`,
+ //@ts-ignore
+ checkCallback: async (checking) => {
+ if (checking)
+ return app.workspace.getLeavesOfType(type2).length === 0;
+ await openView(type2, constructor);
+ }
+ });
+ }
+ this.addCommand({
+ id: "open-vis-modal",
+ name: "Open Visualisation Modal",
+ callback: () => new VisModal8(this).open()
+ });
+ this.addCommand({
+ id: "manipulate-hierarchy-notes",
+ name: "Adjust Hierarchy Notes",
+ callback: () => new HierarchyNoteSelectorModal(this).open()
+ });
+ this.addCommand({
+ id: "Refresh-Breadcrumbs-Index",
+ name: "Refresh Breadcrumbs Index",
+ callback: async () => await refreshIndex(this)
+ });
+ this.addCommand({
+ id: "Toggle-trail-in-Edit&LP",
+ name: "Toggle: Show Trail/Grid in Edit & LP mode",
+ callback: async () => {
+ settings.showBCsInEditLPMode = !settings.showBCsInEditLPMode;
+ await this.saveSettings();
+ await drawTrail(this);
+ }
+ });
+ this.addCommand({
+ id: "Write-Breadcrumbs-to-Current-File",
+ name: "Write Breadcrumbs to Current File",
+ callback: async () => await writeBCToFile(this)
+ });
+ this.addCommand({
+ id: "Write-Breadcrumbs-to-All-Files",
+ name: "Write Breadcrumbs to **ALL** Files",
+ callback: async () => await writeBCsToAllFiles(this)
+ });
+ this.addCommand({
+ id: "local-index",
+ name: "Copy a Local Index to the clipboard",
+ callback: async () => await copyLocalIndex(this)
+ });
+ this.addCommand({
+ id: "global-index",
+ name: "Copy a Global Index to the clipboard",
+ callback: async () => await copyGlobalIndex(this)
+ });
+ ["up", "down", "next", "prev"].forEach((dir) => {
+ this.addCommand({
+ id: `jump-to-first-${dir}`,
+ name: `Jump to first '${dir}'`,
+ callback: async () => await jumpToFirstDir(this, dir)
+ });
+ });
+ getFields(userHiers).forEach((field) => {
+ this.addCommand({
+ id: `new-file-with-curr-as-${field}`,
+ name: `Create a new '${field}' from the current note`,
+ callback: async () => await thread(this, field)
+ });
+ });
+ this.registerMarkdownCodeBlockProcessor(
+ "breadcrumbs",
+ getCodeblockCB(this)
+ );
+ const jugglPlugin = getPlugin(app);
+ if (jugglPlugin) {
+ this.bcStore = new BCStore(this.mainG, app.metadataCache);
+ jugglPlugin.registerStore(this.bcStore);
+ }
+ this.api = new BCAPI(this);
+ (window[API_NAME] = this.api) && this.register(() => delete window[API_NAME]);
+ }
+ getActiveTYPEView(type2) {
+ const { constructor } = this.VIEWS.find((view) => view.type === type2);
+ const leaves = app.workspace.getLeavesOfType(type2);
+ if (leaves && leaves.length >= 1) {
+ const { view } = leaves[0];
+ if (view instanceof constructor)
+ return view;
+ }
+ return null;
+ }
+ onunload() {
+ console.log("unloading");
+ this.VIEWS.forEach(async (view) => {
+ app.workspace.getLeavesOfType(view.type).forEach((leaf) => {
+ leaf.detach();
+ });
+ });
+ this.visited.forEach((visit) => visit[1].remove());
+ if (this.bcStore) {
+ const jugglPlugin = getPlugin(app);
+ if (jugglPlugin) {
+ jugglPlugin.removeStore(this.bcStore);
+ }
+ }
+ }
+};
+/*! Bundled license information:
+
+feather-icons/dist/feather.js:
+ (*!
+ Copyright (c) 2016 Jed Watson.
+ Licensed under the MIT License (MIT), see
+ http://jedwatson.github.io/classnames
+ *)
+
+lodash/lodash.js:
+ (**
+ * @license
+ * Lodash
+ * Copyright OpenJS Foundation and other contributors
+ * Released under MIT license
+ * Based on Underscore.js 1.8.3
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ *)
+*/
+
+/* nosourcemap */
\ No newline at end of file
diff --git a/.obsidian/plugins/breadcrumbs/manifest.json b/.obsidian/plugins/breadcrumbs/manifest.json
new file mode 100644
index 0000000..cf5fe1c
--- /dev/null
+++ b/.obsidian/plugins/breadcrumbs/manifest.json
@@ -0,0 +1,10 @@
+{
+ "id": "breadcrumbs",
+ "name": "Breadcrumbs",
+ "version": "3.6.11",
+ "minAppVersion": "0.15.2",
+ "description": "Visualise & navigate your vault's structure",
+ "author": "SkepticMystic",
+ "authorUrl": "https://github.com/SkepticMystic/breadcrumbs",
+ "isDesktopOnly": false
+}
diff --git a/.obsidian/plugins/breadcrumbs/styles.css b/.obsidian/plugins/breadcrumbs/styles.css
new file mode 100644
index 0000000..51a6a96
--- /dev/null
+++ b/.obsidian/plugins/breadcrumbs/styles.css
@@ -0,0 +1,113 @@
+.BC-trail {
+ border: 1px solid var(--background-modifier-border);
+ border-radius: 5px;
+ padding: 5px;
+ margin-bottom: 5px !important;
+}
+
+/* completely hides the trail when "no path found message" is left empty and no path is found */
+.BC-trail:empty {
+ display: none;
+}
+
+.BC-matrix-square li {
+ text-align: left;
+}
+
+/* ensure empty headers not leaving an element */
+.BC-Matrix .BC-Matrix-square .BC-Matrix-header:empty {
+ display: none;
+}
+
+.internal-link.BC-Link {
+ color: var(--text-accent);
+}
+
+.internal-link.BC-Link:hover {
+ color: var(--text-accent-hover, var(--text-accent));
+}
+
+.vis-view-options > * {
+ padding: 5px;
+}
+
+/* Source: https://svelte.dev/repl/3153faf7584d40bd8ddebecf39f24ac1?version=3.41.0 */
+[data-tooltip] {
+ position: relative;
+ /* z-index: 2; */
+ /* display: block; */
+}
+
+[data-tooltip]:before,
+[data-tooltip]:after {
+ visibility: hidden;
+ opacity: 0;
+ pointer-events: none;
+ transition: 0.2s ease-out;
+ transform: translate(-50%, 5px);
+}
+
+[data-tooltip]:before {
+ position: absolute;
+ top: 80%;
+ /* bottom: 100%; */
+ left: 50%;
+ margin-bottom: 5px;
+ padding: 7px;
+ width: fit-content;
+ height: fit-content;
+ min-width: 200px;
+ min-height: 200px;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ background-color: var(--background-primary);
+ color: var(--text-normal);
+ content: attr(data-tooltip);
+ text-align: center;
+ font-size: var(--font-medium);
+ line-height: 1.2;
+ transition: 0.2s ease-out;
+ white-space: pre-line;
+ z-index: 100;
+}
+
+/* [data-tooltip]:after {
+ position: absolute;
+ top: 80%;
+ left: 50%;
+ width: 0;
+ border-top: 5px solid #000;
+ border-top: 5px solid hsla(0, 0%, 20%, 0.9);
+ border-right: 5px solid transparent;
+ border-left: 5px solid transparent;
+ background-color: red;
+ content: " ";
+ font-size: 0;
+ line-height: 0;
+} */
+
+[data-tooltip]:hover:before,
+[data-tooltip]:hover:after {
+ visibility: visible;
+ opacity: 1;
+ transform: translate(-50%, 0);
+}
+[data-tooltip="false"]:hover:before,
+[data-tooltip="false"]:hover:after {
+ visibility: hidden;
+ opacity: 0;
+}
+
+.thread-dir-templates .setting-item-control {
+ display: flex;
+ flex-direction: column;
+}
+
+.juggl-hide {
+ display: none;
+}
+
+[data-type="BC-matrix"] div.view-content {
+ overflow: hidden !important;
+}
diff --git a/.obsidian/plugins/obsidian-tagfolder/data.json b/.obsidian/plugins/obsidian-tagfolder/data.json
new file mode 100644
index 0000000..e2bd153
--- /dev/null
+++ b/.obsidian/plugins/obsidian-tagfolder/data.json
@@ -0,0 +1,45 @@
+{
+ "displayMethod": "NAME",
+ "alwaysOpen": true,
+ "ignoreDocTags": "",
+ "ignoreTags": "",
+ "hideOnRootTags": "",
+ "sortType": "DISPNAME_ASC",
+ "sortExactFirst": false,
+ "sortTypeTag": "NAME_ASC",
+ "expandLimit": 0,
+ "disableNestedTags": false,
+ "hideItems": "NONE",
+ "ignoreFolders": "",
+ "targetFolders": "",
+ "scanDelay": 250,
+ "useTitle": false,
+ "reduceNestedParent": true,
+ "frontmatterKey": "title",
+ "useTagInfo": false,
+ "tagInfo": "pininfo.md",
+ "mergeRedundantCombination": false,
+ "useVirtualTag": false,
+ "useFrontmatterTagsForNewNotes": false,
+ "doNotSimplifyTags": false,
+ "overrideTagClicking": false,
+ "useMultiPaneList": false,
+ "archiveTags": "",
+ "disableNarrowingDown": true,
+ "expandUntaggedToRoot": false,
+ "disableDragging": false,
+ "linkConfig": {
+ "incoming": {
+ "enabled": true,
+ "key": ""
+ },
+ "outgoing": {
+ "enabled": true,
+ "key": ""
+ }
+ },
+ "linkShowOnlyFDR": true,
+ "linkCombineOtherTree": true,
+ "showListIn": "",
+ "displayFolderAsTag": false
+}
\ No newline at end of file
diff --git a/.obsidian/plugins/obsidian-tagfolder/main.js b/.obsidian/plugins/obsidian-tagfolder/main.js
new file mode 100644
index 0000000..68f2ac3
--- /dev/null
+++ b/.obsidian/plugins/obsidian-tagfolder/main.js
@@ -0,0 +1,5746 @@
+/*
+THIS IS A GENERATED/BUNDLED FILE BY ESBUILD AND TERSER
+if you want to view the source, please visit the github repository of this plugin
+*/
+
+"use strict";
+
+var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __typeError = msg => {
+ throw TypeError(msg);
+}, __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
+ enumerable: true,
+ configurable: true,
+ writable: true,
+ value
+}) : obj[key] = value, __export = (target, all) => {
+ for (var name in all) __defProp(target, name, {
+ get: all[name],
+ enumerable: true
+ });
+}, __copyProps = (to, from, except, desc) => {
+ if (from && "object" == typeof from || "function" == typeof from) 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;
+}, __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
+ value: true
+}), mod), __publicField = (obj, key, value) => __defNormalProp(obj, "symbol" != typeof key ? key + "" : key, value), __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg), __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"),
+getter ? getter.call(obj) : member.get(obj)), __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value), __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"),
+setter ? setter.call(obj, value) : member.set(obj, value), value), main_exports = {};
+
+__export(main_exports, {
+ default: () => TagFolderPlugin5
+});
+
+module.exports = __toCommonJS(main_exports);
+
+var _a, _b, import_obsidian8 = require("obsidian"), enumShowListIn = {
+ "": "Sidebar",
+ CURRENT_PANE: "Current pane",
+ SPLIT_PANE: "New pane"
+}, DEFAULT_SETTINGS = {
+ displayMethod: "NAME",
+ alwaysOpen: false,
+ ignoreDocTags: "",
+ ignoreTags: "",
+ hideOnRootTags: "",
+ sortType: "DISPNAME_ASC",
+ sortExactFirst: false,
+ sortTypeTag: "NAME_ASC",
+ expandLimit: 0,
+ disableNestedTags: false,
+ hideItems: "NONE",
+ ignoreFolders: "",
+ targetFolders: "",
+ scanDelay: 250,
+ useTitle: true,
+ reduceNestedParent: true,
+ frontmatterKey: "title",
+ useTagInfo: false,
+ tagInfo: "pininfo.md",
+ mergeRedundantCombination: false,
+ useVirtualTag: false,
+ useFrontmatterTagsForNewNotes: false,
+ doNotSimplifyTags: false,
+ overrideTagClicking: false,
+ useMultiPaneList: false,
+ archiveTags: "",
+ disableNarrowingDown: false,
+ expandUntaggedToRoot: false,
+ disableDragging: false,
+ linkConfig: {
+ incoming: {
+ enabled: true,
+ key: ""
+ },
+ outgoing: {
+ enabled: true,
+ key: ""
+ }
+ },
+ linkShowOnlyFDR: true,
+ linkCombineOtherTree: true,
+ showListIn: "",
+ displayFolderAsTag: false
+}, VIEW_TYPE_SCROLL = "tagfolder-view-scroll", EPOCH_MINUTE = 60, EPOCH_HOUR = 60 * EPOCH_MINUTE, EPOCH_DAY = 24 * EPOCH_HOUR, FRESHNESS_1 = "FRESHNESS_01", FRESHNESS_2 = "FRESHNESS_02", FRESHNESS_3 = "FRESHNESS_03", FRESHNESS_4 = "FRESHNESS_04", FRESHNESS_5 = "FRESHNESS_05", tagDispDict = {
+ FRESHNESS_01: "🕐",
+ FRESHNESS_02: "📖",
+ FRESHNESS_03: "📗",
+ FRESHNESS_04: "📚",
+ FRESHNESS_05: "🗄",
+ _VIRTUAL_TAG_FRESHNESS: "⌛",
+ _VIRTUAL_TAG_CANVAS: "📋 Canvas",
+ _VIRTUAL_TAG_FOLDER: "📁"
+}, VIEW_TYPE_TAGFOLDER = "tagfolder-view", VIEW_TYPE_TAGFOLDER_LINK = "tagfolder-link-view", VIEW_TYPE_TAGFOLDER_LIST = "tagfolder-view-list", OrderKeyTag = {
+ NAME: "Tag name",
+ ITEMS: "Count of items"
+}, OrderDirection = {
+ ASC: "Ascending",
+ DESC: "Descending"
+}, OrderKeyItem = {
+ DISPNAME: "Displaying name",
+ NAME: "File name",
+ MTIME: "Modified time",
+ CTIME: "Created time",
+ FULLPATH: "Fullpath of the file"
+}, node_env = null == (_b = null == (_a = globalThis.process) ? void 0 : _a.env) ? void 0 : _b.NODE_ENV, dev_fallback_default = node_env && !node_env.toLowerCase().startsWith("prod"), is_array = Array.isArray, index_of = Array.prototype.indexOf, array_from = Array.from, object_keys = Object.keys, define_property = Object.defineProperty, get_descriptor = Object.getOwnPropertyDescriptor, get_descriptors = Object.getOwnPropertyDescriptors, object_prototype = Object.prototype, array_prototype = Array.prototype, get_prototype_of = Object.getPrototypeOf, is_extensible = Object.isExtensible, noop = () => {};
+
+function run_all(arr) {
+ for (var i = 0; i < arr.length; i++) arr[i]();
+}
+
+var DERIVED = 2, EFFECT = 4, RENDER_EFFECT = 8, BLOCK_EFFECT = 16, BRANCH_EFFECT = 32, ROOT_EFFECT = 64, BOUNDARY_EFFECT = 128, UNOWNED = 256, DISCONNECTED = 512, CLEAN = 1024, DIRTY = 2048, MAYBE_DIRTY = 4096, INERT = 8192, DESTROYED = 16384, EFFECT_RAN = 32768, EFFECT_TRANSPARENT = 65536, LEGACY_DERIVED_PROP = 1 << 17, INSPECT_EFFECT = 1 << 18, HEAD_EFFECT = 1 << 19, EFFECT_HAS_DERIVED = 1 << 20, EFFECT_IS_UPDATING = 1 << 21, STATE_SYMBOL = Symbol("$state"), LEGACY_PROPS = Symbol("legacy props"), LOADING_ATTR_SYMBOL = Symbol(""), request_idle_callback = "undefined" == typeof requestIdleCallback ? cb => setTimeout(cb, 1) : requestIdleCallback, micro_tasks = [], idle_tasks = [];
+
+function run_micro_tasks() {
+ var tasks = micro_tasks;
+ micro_tasks = [];
+ run_all(tasks);
+}
+
+function run_idle_tasks() {
+ var tasks = idle_tasks;
+ idle_tasks = [];
+ run_all(tasks);
+}
+
+function queue_micro_task(fn) {
+ if (0 === micro_tasks.length) queueMicrotask(run_micro_tasks);
+ micro_tasks.push(fn);
+}
+
+function queue_idle_task(fn) {
+ if (0 === idle_tasks.length) request_idle_callback(run_idle_tasks);
+ idle_tasks.push(fn);
+}
+
+function flush_tasks() {
+ if (micro_tasks.length > 0) run_micro_tasks();
+ if (idle_tasks.length > 0) run_idle_tasks();
+}
+
+function equals(value) {
+ return value === this.v;
+}
+
+function safe_not_equal(a, b) {
+ return a != a ? b == b : a !== b || null !== a && "object" == typeof a || "function" == typeof a;
+}
+
+function safe_equals(value) {
+ return !safe_not_equal(value, this.v);
+}
+
+function bind_invalid_checkbox_value() {
+ if (dev_fallback_default) {
+ const error = new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value");
+}
+
+function derived_references_self() {
+ if (dev_fallback_default) {
+ const error = new Error("derived_references_self\nA derived value cannot reference itself recursively\nhttps://svelte.dev/e/derived_references_self");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/derived_references_self");
+}
+
+function effect_in_teardown(rune) {
+ if (dev_fallback_default) {
+ const error = new Error(`effect_in_teardown\n\`${rune}\` cannot be used inside an effect cleanup function\nhttps://svelte.dev/e/effect_in_teardown`);
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/effect_in_teardown");
+}
+
+function effect_in_unowned_derived() {
+ if (dev_fallback_default) {
+ const error = new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
+}
+
+function effect_orphan(rune) {
+ if (dev_fallback_default) {
+ const error = new Error(`effect_orphan\n\`${rune}\` can only be used inside an effect (e.g. during component initialisation)\nhttps://svelte.dev/e/effect_orphan`);
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/effect_orphan");
+}
+
+function effect_update_depth_exceeded() {
+ if (dev_fallback_default) {
+ const error = new Error("effect_update_depth_exceeded\nMaximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops\nhttps://svelte.dev/e/effect_update_depth_exceeded");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
+}
+
+function hydration_failed() {
+ if (dev_fallback_default) {
+ const error = new Error("hydration_failed\nFailed to hydrate the application\nhttps://svelte.dev/e/hydration_failed");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/hydration_failed");
+}
+
+function invalid_snippet() {
+ if (dev_fallback_default) {
+ const error = new Error("invalid_snippet\nCould not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\nhttps://svelte.dev/e/invalid_snippet");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/invalid_snippet");
+}
+
+function props_invalid_value(key) {
+ if (dev_fallback_default) {
+ const error = new Error(`props_invalid_value\nCannot do \`bind:${key}={undefined}\` when \`${key}\` has a fallback value\nhttps://svelte.dev/e/props_invalid_value`);
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/props_invalid_value");
+}
+
+function rune_outside_svelte(rune) {
+ if (dev_fallback_default) {
+ const error = new Error(`rune_outside_svelte\nThe \`${rune}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files\nhttps://svelte.dev/e/rune_outside_svelte`);
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/rune_outside_svelte");
+}
+
+function state_descriptors_fixed() {
+ if (dev_fallback_default) {
+ const error = new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/state_descriptors_fixed");
+}
+
+function state_prototype_fixed() {
+ if (dev_fallback_default) {
+ const error = new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/state_prototype_fixed");
+}
+
+function state_unsafe_mutation() {
+ if (dev_fallback_default) {
+ const error = new Error("state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/state_unsafe_mutation");
+}
+
+var legacy_mode_flag = false, tracing_mode_flag = false, EACH_ITEM_REACTIVE = 1, EACH_INDEX_REACTIVE = 2, EACH_IS_CONTROLLED = 4, EACH_IS_ANIMATED = 8, EACH_ITEM_IMMUTABLE = 16, PROPS_IS_IMMUTABLE = 1, PROPS_IS_RUNES = 2, PROPS_IS_UPDATED = 4, PROPS_IS_BINDABLE = 8, PROPS_IS_LAZY_INITIAL = 16, TRANSITION_OUT = 2, TRANSITION_GLOBAL = 4, TEMPLATE_FRAGMENT = 1, TEMPLATE_USE_IMPORT_NODE = 2, HYDRATION_START = "[", HYDRATION_START_ELSE = "[!", HYDRATION_END = "]", HYDRATION_ERROR = {}, ELEMENT_PRESERVE_ATTRIBUTE_CASE = 2, UNINITIALIZED = Symbol(), FILENAME = Symbol("filename"), HMR = Symbol("hmr"), NAMESPACE_HTML = "http://www.w3.org/1999/xhtml", tracing_expressions = null;
+
+function get_stack(label) {
+ let error = Error();
+ const stack2 = error.stack;
+ if (stack2) {
+ const lines = stack2.split("\n"), new_lines = [ "\n" ];
+ for (let i = 0; i < lines.length; i++) {
+ const line = lines[i];
+ if ("Error" !== line) {
+ if (line.includes("validate_each_keys")) return null;
+ if (!line.includes("svelte/src/internal")) new_lines.push(line);
+ }
+ }
+ if (1 === new_lines.length) return null;
+ define_property(error, "stack", {
+ value: new_lines.join("\n")
+ });
+ define_property(error, "name", {
+ value: `${label}Error`
+ });
+ }
+ return error;
+}
+
+function lifecycle_outside_component(name) {
+ if (dev_fallback_default) {
+ const error = new Error(`lifecycle_outside_component\n\`${name}(...)\` can only be used during component initialisation\nhttps://svelte.dev/e/lifecycle_outside_component`);
+ error.name = "Svelte error";
+ throw error;
+ } else throw new Error("https://svelte.dev/e/lifecycle_outside_component");
+}
+
+var component_context = null;
+
+function set_component_context(context) {
+ component_context = context;
+}
+
+var dev_current_component_function = null;
+
+function set_dev_current_component_function(fn) {
+ dev_current_component_function = fn;
+}
+
+function getContext(key) {
+ return get_or_init_context_map("getContext").get(key);
+}
+
+function setContext(key, context) {
+ get_or_init_context_map("setContext").set(key, context);
+ return context;
+}
+
+function push(props, runes = false, fn) {
+ var ctx = component_context = {
+ p: component_context,
+ c: null,
+ d: false,
+ e: null,
+ m: false,
+ s: props,
+ x: null,
+ l: null
+ };
+ if (legacy_mode_flag && !runes) component_context.l = {
+ s: null,
+ u: null,
+ r1: [],
+ r2: source(false)
+ };
+ teardown((() => {
+ ctx.d = true;
+ }));
+ if (dev_fallback_default) {
+ component_context.function = fn;
+ dev_current_component_function = fn;
+ }
+}
+
+function pop(component2) {
+ var _a3, _b3;
+ const context_stack_item = component_context;
+ if (null !== context_stack_item) {
+ if (void 0 !== component2) context_stack_item.x = component2;
+ const component_effects = context_stack_item.e;
+ if (null !== component_effects) {
+ var previous_effect = active_effect, previous_reaction = active_reaction;
+ context_stack_item.e = null;
+ try {
+ for (var i = 0; i < component_effects.length; i++) {
+ var component_effect = component_effects[i];
+ set_active_effect(component_effect.effect);
+ set_active_reaction(component_effect.reaction);
+ effect(component_effect.fn);
+ }
+ } finally {
+ set_active_effect(previous_effect);
+ set_active_reaction(previous_reaction);
+ }
+ }
+ component_context = context_stack_item.p;
+ if (dev_fallback_default) dev_current_component_function = null != (_b3 = null == (_a3 = context_stack_item.p) ? void 0 : _a3.function) ? _b3 : null;
+ context_stack_item.m = true;
+ }
+ return component2 || {};
+}
+
+function is_runes() {
+ return !legacy_mode_flag || null !== component_context && null === component_context.l;
+}
+
+function get_or_init_context_map(name) {
+ var _a3;
+ if (null === component_context) lifecycle_outside_component(name);
+ return null != (_a3 = component_context.c) ? _a3 : component_context.c = new Map(get_parent_context(component_context) || void 0);
+}
+
+function get_parent_context(component_context2) {
+ let parent = component_context2.p;
+ for (;null !== parent; ) {
+ const context_map = parent.c;
+ if (null !== context_map) return context_map;
+ parent = parent.p;
+ }
+ return null;
+}
+
+function proxy(value) {
+ if ("object" != typeof value || null === value || STATE_SYMBOL in value) return value;
+ const prototype = get_prototype_of(value);
+ if (prototype !== object_prototype && prototype !== array_prototype) return value;
+ var sources = new Map, is_proxied_array = is_array(value), version = state(0), stack2 = dev_fallback_default && tracing_mode_flag ? get_stack("CreatedAt") : null, reaction = active_reaction, with_parent = fn => {
+ var previous_reaction = active_reaction;
+ set_active_reaction(reaction);
+ var result = fn();
+ set_active_reaction(previous_reaction);
+ return result;
+ };
+ if (is_proxied_array) sources.set("length", state(value.length, stack2));
+ return new Proxy(value, {
+ defineProperty(_, prop2, descriptor) {
+ if (!("value" in descriptor) || false === descriptor.configurable || false === descriptor.enumerable || false === descriptor.writable) state_descriptors_fixed();
+ var s = sources.get(prop2);
+ if (void 0 === s) {
+ s = with_parent((() => state(descriptor.value, stack2)));
+ sources.set(prop2, s);
+ } else set(s, with_parent((() => proxy(descriptor.value))));
+ return true;
+ },
+ deleteProperty(target, prop2) {
+ var s = sources.get(prop2);
+ if (void 0 === s) {
+ if (prop2 in target) sources.set(prop2, with_parent((() => state(UNINITIALIZED, stack2))));
+ } else {
+ if (is_proxied_array && "string" == typeof prop2) {
+ var ls = sources.get("length"), n = Number(prop2);
+ if (Number.isInteger(n) && n < ls.v) set(ls, n);
+ }
+ set(s, UNINITIALIZED);
+ update_version(version);
+ }
+ return true;
+ },
+ get(target, prop2, receiver) {
+ var _a3;
+ if (prop2 === STATE_SYMBOL) return value;
+ var s = sources.get(prop2), exists = prop2 in target;
+ if (void 0 === s && (!exists || (null == (_a3 = get_descriptor(target, prop2)) ? void 0 : _a3.writable))) {
+ s = with_parent((() => state(proxy(exists ? target[prop2] : UNINITIALIZED), stack2)));
+ sources.set(prop2, s);
+ }
+ if (void 0 !== s) {
+ var v = get(s);
+ return v === UNINITIALIZED ? void 0 : v;
+ }
+ return Reflect.get(target, prop2, receiver);
+ },
+ getOwnPropertyDescriptor(target, prop2) {
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop2);
+ if (descriptor && "value" in descriptor) {
+ var s = sources.get(prop2);
+ if (s) descriptor.value = get(s);
+ } else if (void 0 === descriptor) {
+ var source2 = sources.get(prop2), value2 = null == source2 ? void 0 : source2.v;
+ if (void 0 !== source2 && value2 !== UNINITIALIZED) return {
+ enumerable: true,
+ configurable: true,
+ value: value2,
+ writable: true
+ };
+ }
+ return descriptor;
+ },
+ has(target, prop2) {
+ var _a3;
+ if (prop2 === STATE_SYMBOL) return true;
+ var s = sources.get(prop2), has = void 0 !== s && s.v !== UNINITIALIZED || Reflect.has(target, prop2);
+ if (void 0 !== s || null !== active_effect && (!has || (null == (_a3 = get_descriptor(target, prop2)) ? void 0 : _a3.writable))) {
+ if (void 0 === s) {
+ s = with_parent((() => state(has ? proxy(target[prop2]) : UNINITIALIZED, stack2)));
+ sources.set(prop2, s);
+ }
+ if (get(s) === UNINITIALIZED) return false;
+ }
+ return has;
+ },
+ set(target, prop2, value2, receiver) {
+ var _a3, s = sources.get(prop2), has = prop2 in target;
+ if (is_proxied_array && "length" === prop2) for (var i = value2; i < s.v; i += 1) {
+ var other_s = sources.get(i + "");
+ if (void 0 !== other_s) set(other_s, UNINITIALIZED); else if (i in target) {
+ other_s = with_parent((() => state(UNINITIALIZED, stack2)));
+ sources.set(i + "", other_s);
+ }
+ }
+ if (void 0 === s) {
+ if (!has || (null == (_a3 = get_descriptor(target, prop2)) ? void 0 : _a3.writable)) {
+ set(s = with_parent((() => state(void 0, stack2))), with_parent((() => proxy(value2))));
+ sources.set(prop2, s);
+ }
+ } else {
+ has = s.v !== UNINITIALIZED;
+ set(s, with_parent((() => proxy(value2))));
+ }
+ var descriptor = Reflect.getOwnPropertyDescriptor(target, prop2);
+ if (null == descriptor ? void 0 : descriptor.set) descriptor.set.call(receiver, value2);
+ if (!has) {
+ if (is_proxied_array && "string" == typeof prop2) {
+ var ls = sources.get("length"), n = Number(prop2);
+ if (Number.isInteger(n) && n >= ls.v) set(ls, n + 1);
+ }
+ update_version(version);
+ }
+ return true;
+ },
+ ownKeys(target) {
+ get(version);
+ var own_keys = Reflect.ownKeys(target).filter((key2 => {
+ var source3 = sources.get(key2);
+ return void 0 === source3 || source3.v !== UNINITIALIZED;
+ }));
+ for (var [key, source2] of sources) if (source2.v !== UNINITIALIZED && !(key in target)) own_keys.push(key);
+ return own_keys;
+ },
+ setPrototypeOf() {
+ state_prototype_fixed();
+ }
+ });
+}
+
+function update_version(signal, d = 1) {
+ set(signal, signal.v + d);
+}
+
+function get_proxied_value(value) {
+ try {
+ if (null !== value && "object" == typeof value && STATE_SYMBOL in value) return value[STATE_SYMBOL];
+ } catch (e) {}
+ return value;
+}
+
+function derived(fn) {
+ var flags = DERIVED | DIRTY, parent_derived = null !== active_reaction && !!(active_reaction.f & DERIVED) ? active_reaction : null;
+ if (null === active_effect || null !== parent_derived && !!(parent_derived.f & UNOWNED)) flags |= UNOWNED; else active_effect.f |= EFFECT_HAS_DERIVED;
+ const signal = {
+ ctx: component_context,
+ deps: null,
+ effects: null,
+ equals,
+ f: flags,
+ fn,
+ reactions: null,
+ rv: 0,
+ v: null,
+ wv: 0,
+ parent: null != parent_derived ? parent_derived : active_effect
+ };
+ if (dev_fallback_default && tracing_mode_flag) signal.created = get_stack("CreatedAt");
+ return signal;
+}
+
+function user_derived(fn) {
+ const d = derived(fn);
+ push_reaction_value(d);
+ return d;
+}
+
+function derived_safe_equal(fn) {
+ const signal = derived(fn);
+ signal.equals = safe_equals;
+ return signal;
+}
+
+function destroy_derived_effects(derived3) {
+ var effects = derived3.effects;
+ if (null !== effects) {
+ derived3.effects = null;
+ for (var i = 0; i < effects.length; i += 1) destroy_effect(effects[i]);
+ }
+}
+
+var stack = [];
+
+function get_derived_parent_effect(derived3) {
+ for (var parent = derived3.parent; null !== parent; ) {
+ if (!(parent.f & DERIVED)) return parent;
+ parent = parent.parent;
+ }
+ return null;
+}
+
+function execute_derived(derived3) {
+ var value, prev_active_effect = active_effect;
+ set_active_effect(get_derived_parent_effect(derived3));
+ if (dev_fallback_default) {
+ let prev_inspect_effects = inspect_effects;
+ set_inspect_effects(new Set);
+ try {
+ if (stack.includes(derived3)) derived_references_self();
+ stack.push(derived3);
+ destroy_derived_effects(derived3);
+ value = update_reaction(derived3);
+ } finally {
+ set_active_effect(prev_active_effect);
+ set_inspect_effects(prev_inspect_effects);
+ stack.pop();
+ }
+ } else try {
+ destroy_derived_effects(derived3);
+ value = update_reaction(derived3);
+ } finally {
+ set_active_effect(prev_active_effect);
+ }
+ return value;
+}
+
+function update_derived(derived3) {
+ var value = execute_derived(derived3);
+ set_signal_status(derived3, (skip_reaction || !!(derived3.f & UNOWNED)) && null !== derived3.deps ? MAYBE_DIRTY : CLEAN);
+ if (!derived3.equals(value)) {
+ derived3.v = value;
+ derived3.wv = increment_write_version();
+ }
+}
+
+var inspect_effects = new Set, old_values = new Map;
+
+function set_inspect_effects(v) {
+ inspect_effects = v;
+}
+
+function source(v, stack2) {
+ var signal = {
+ f: 0,
+ v,
+ reactions: null,
+ equals,
+ rv: 0,
+ wv: 0
+ };
+ if (dev_fallback_default && tracing_mode_flag) {
+ signal.created = null != stack2 ? stack2 : get_stack("CreatedAt");
+ signal.debug = null;
+ }
+ return signal;
+}
+
+function state(v, stack2) {
+ const s = source(v, stack2);
+ push_reaction_value(s);
+ return s;
+}
+
+function mutable_source(initial_value, immutable = false) {
+ var _a3, _b3;
+ const s = source(initial_value);
+ if (!immutable) s.equals = safe_equals;
+ if (legacy_mode_flag && null !== component_context && null !== component_context.l) (null != (_b3 = (_a3 = component_context.l).s) ? _b3 : _a3.s = []).push(s);
+ return s;
+}
+
+function set(source2, value, should_proxy = false) {
+ var _a3;
+ if (null !== active_reaction && !untracking && is_runes() && !!(active_reaction.f & (DERIVED | BLOCK_EFFECT)) && !(null == (_a3 = reaction_sources) ? void 0 : _a3.includes(source2))) state_unsafe_mutation();
+ return internal_set(source2, should_proxy ? proxy(value) : value);
+}
+
+function internal_set(source2, value) {
+ if (!source2.equals(value)) {
+ var old_value = source2.v;
+ if (is_destroying_effect) old_values.set(source2, value); else old_values.set(source2, old_value);
+ source2.v = value;
+ if (dev_fallback_default && tracing_mode_flag) {
+ source2.updated = get_stack("UpdatedAt");
+ if (null != active_effect) {
+ source2.trace_need_increase = true;
+ null != source2.trace_v || (source2.trace_v = old_value);
+ }
+ }
+ if (!!(source2.f & DERIVED)) {
+ if (!!(source2.f & DIRTY)) execute_derived(source2);
+ set_signal_status(source2, !(source2.f & UNOWNED) ? CLEAN : MAYBE_DIRTY);
+ }
+ source2.wv = increment_write_version();
+ mark_reactions(source2, DIRTY);
+ if (is_runes() && null !== active_effect && !!(active_effect.f & CLEAN) && !(active_effect.f & (BRANCH_EFFECT | ROOT_EFFECT))) if (null === untracked_writes) set_untracked_writes([ source2 ]); else untracked_writes.push(source2);
+ if (dev_fallback_default && inspect_effects.size > 0) {
+ const inspects = Array.from(inspect_effects);
+ for (const effect2 of inspects) {
+ if (!!(effect2.f & CLEAN)) set_signal_status(effect2, MAYBE_DIRTY);
+ if (check_dirtiness(effect2)) update_effect(effect2);
+ }
+ inspect_effects.clear();
+ }
+ }
+ return value;
+}
+
+function mark_reactions(signal, status) {
+ var reactions = signal.reactions;
+ if (null !== reactions) for (var runes = is_runes(), length = reactions.length, i = 0; i < length; i++) {
+ var reaction = reactions[i], flags = reaction.f;
+ if (!(flags & DIRTY)) if (runes || reaction !== active_effect) if (!(dev_fallback_default && flags & INSPECT_EFFECT)) {
+ set_signal_status(reaction, status);
+ if (!!(flags & (CLEAN | UNOWNED))) if (!!(flags & DERIVED)) mark_reactions(reaction, MAYBE_DIRTY); else schedule_effect(reaction);
+ } else inspect_effects.add(reaction);
+ }
+}
+
+var bold = "font-weight: bold", normal = "font-weight: normal";
+
+function hydration_attribute_changed(attribute, html2, value) {
+ if (dev_fallback_default) console.warn(`%c[svelte] hydration_attribute_changed\n%cThe \`${attribute}\` attribute on \`${html2}\` changed its value between server and client renders. The client value, \`${value}\`, will be ignored in favour of the server value\nhttps://svelte.dev/e/hydration_attribute_changed`, bold, normal); else console.warn("https://svelte.dev/e/hydration_attribute_changed");
+}
+
+function hydration_html_changed(location) {
+ if (dev_fallback_default) console.warn(`%c[svelte] hydration_html_changed\n%c${location ? `The value of an \`{@html ...}\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value` : "The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}\nhttps://svelte.dev/e/hydration_html_changed`, bold, normal); else console.warn("https://svelte.dev/e/hydration_html_changed");
+}
+
+function hydration_mismatch(location) {
+ if (dev_fallback_default) console.warn(`%c[svelte] hydration_mismatch\n%c${location ? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}` : "Hydration failed because the initial UI does not match what was rendered on the server"}\nhttps://svelte.dev/e/hydration_mismatch`, bold, normal); else console.warn("https://svelte.dev/e/hydration_mismatch");
+}
+
+function lifecycle_double_unmount() {
+ if (dev_fallback_default) console.warn("%c[svelte] lifecycle_double_unmount\n%cTried to unmount a component that was not mounted\nhttps://svelte.dev/e/lifecycle_double_unmount", bold, normal); else console.warn("https://svelte.dev/e/lifecycle_double_unmount");
+}
+
+function state_proxy_equality_mismatch(operator) {
+ if (dev_fallback_default) console.warn(`%c[svelte] state_proxy_equality_mismatch\n%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results\nhttps://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal); else console.warn("https://svelte.dev/e/state_proxy_equality_mismatch");
+}
+
+var hydrate_node, $window, $document, is_firefox, first_child_getter, next_sibling_getter, hydrating = false;
+
+function set_hydrating(value) {
+ hydrating = value;
+}
+
+function set_hydrate_node(node) {
+ if (null === node) {
+ hydration_mismatch();
+ throw HYDRATION_ERROR;
+ }
+ return hydrate_node = node;
+}
+
+function hydrate_next() {
+ return set_hydrate_node(get_next_sibling(hydrate_node));
+}
+
+function reset(node) {
+ if (hydrating) {
+ if (null !== get_next_sibling(hydrate_node)) {
+ hydration_mismatch();
+ throw HYDRATION_ERROR;
+ }
+ hydrate_node = node;
+ }
+}
+
+function next(count = 1) {
+ if (hydrating) {
+ for (var i = count, node = hydrate_node; i--; ) node = get_next_sibling(node);
+ hydrate_node = node;
+ }
+}
+
+function remove_nodes() {
+ for (var depth = 0, node = hydrate_node; ;) {
+ if (8 === node.nodeType) {
+ var data = node.data;
+ if (data === HYDRATION_END) {
+ if (0 === depth) return node;
+ depth -= 1;
+ } else if (data === HYDRATION_START || data === HYDRATION_START_ELSE) depth += 1;
+ }
+ var next2 = get_next_sibling(node);
+ node.remove();
+ node = next2;
+ }
+}
+
+function init_array_prototype_warnings() {
+ const array_prototype2 = Array.prototype, cleanup = Array.__svelte_cleanup;
+ if (cleanup) cleanup();
+ const {indexOf, lastIndexOf, includes} = array_prototype2;
+ array_prototype2.indexOf = function(item, from_index) {
+ const index2 = indexOf.call(this, item, from_index);
+ if (-1 === index2) for (let i = null != from_index ? from_index : 0; i < this.length; i += 1) if (get_proxied_value(this[i]) === item) {
+ state_proxy_equality_mismatch("array.indexOf(...)");
+ break;
+ }
+ return index2;
+ };
+ array_prototype2.lastIndexOf = function(item, from_index) {
+ const index2 = lastIndexOf.call(this, item, null != from_index ? from_index : this.length - 1);
+ if (-1 === index2) for (let i = 0; i <= (null != from_index ? from_index : this.length - 1); i += 1) if (get_proxied_value(this[i]) === item) {
+ state_proxy_equality_mismatch("array.lastIndexOf(...)");
+ break;
+ }
+ return index2;
+ };
+ array_prototype2.includes = function(item, from_index) {
+ const has = includes.call(this, item, from_index);
+ if (!has) for (let i = 0; i < this.length; i += 1) if (get_proxied_value(this[i]) === item) {
+ state_proxy_equality_mismatch("array.includes(...)");
+ break;
+ }
+ return has;
+ };
+ Array.__svelte_cleanup = () => {
+ array_prototype2.indexOf = indexOf;
+ array_prototype2.lastIndexOf = lastIndexOf;
+ array_prototype2.includes = includes;
+ };
+}
+
+function init_operations() {
+ if (void 0 === $window) {
+ $window = window;
+ $document = document;
+ is_firefox = /Firefox/.test(navigator.userAgent);
+ var element_prototype = Element.prototype, node_prototype = Node.prototype, text_prototype = Text.prototype;
+ first_child_getter = get_descriptor(node_prototype, "firstChild").get;
+ next_sibling_getter = get_descriptor(node_prototype, "nextSibling").get;
+ if (is_extensible(element_prototype)) {
+ element_prototype.__click = void 0;
+ element_prototype.__className = void 0;
+ element_prototype.__attributes = null;
+ element_prototype.__style = void 0;
+ element_prototype.__e = void 0;
+ }
+ if (is_extensible(text_prototype)) text_prototype.__t = void 0;
+ if (dev_fallback_default) {
+ element_prototype.__svelte_meta = null;
+ init_array_prototype_warnings();
+ }
+ }
+}
+
+function create_text(value = "") {
+ return document.createTextNode(value);
+}
+
+function get_first_child(node) {
+ return first_child_getter.call(node);
+}
+
+function get_next_sibling(node) {
+ return next_sibling_getter.call(node);
+}
+
+function child(node, is_text) {
+ if (!hydrating) return get_first_child(node);
+ var child2 = get_first_child(hydrate_node);
+ if (null === child2) child2 = hydrate_node.appendChild(create_text()); else if (is_text && 3 !== child2.nodeType) {
+ var text2 = create_text();
+ null == child2 || child2.before(text2);
+ set_hydrate_node(text2);
+ return text2;
+ }
+ set_hydrate_node(child2);
+ return child2;
+}
+
+function first_child(fragment, is_text) {
+ var _a3, _b3;
+ if (!hydrating) {
+ var first = get_first_child(fragment);
+ if (first instanceof Comment && "" === first.data) return get_next_sibling(first); else return first;
+ }
+ if (is_text && 3 !== (null == (_a3 = hydrate_node) ? void 0 : _a3.nodeType)) {
+ var text2 = create_text();
+ null == (_b3 = hydrate_node) || _b3.before(text2);
+ set_hydrate_node(text2);
+ return text2;
+ }
+ return hydrate_node;
+}
+
+function sibling(node, count = 1, is_text = false) {
+ let next_sibling = hydrating ? hydrate_node : node;
+ for (var last_sibling; count--; ) {
+ last_sibling = next_sibling;
+ next_sibling = get_next_sibling(next_sibling);
+ }
+ if (!hydrating) return next_sibling;
+ var type = null == next_sibling ? void 0 : next_sibling.nodeType;
+ if (is_text && 3 !== type) {
+ var text2 = create_text();
+ if (null === next_sibling) null == last_sibling || last_sibling.after(text2); else next_sibling.before(text2);
+ set_hydrate_node(text2);
+ return text2;
+ }
+ set_hydrate_node(next_sibling);
+ return next_sibling;
+}
+
+function clear_text_content(node) {
+ node.textContent = "";
+}
+
+var handled_errors = new WeakSet, is_throwing_error = false, is_flushing = false, last_scheduled_effect = null, is_updating_effect = false, is_destroying_effect = false;
+
+function set_is_destroying_effect(value) {
+ is_destroying_effect = value;
+}
+
+var queued_root_effects = [], dev_effect_stack = [], active_reaction = null, untracking = false;
+
+function set_active_reaction(reaction) {
+ active_reaction = reaction;
+}
+
+var active_effect = null;
+
+function set_active_effect(effect2) {
+ active_effect = effect2;
+}
+
+var reaction_sources = null;
+
+function push_reaction_value(value) {
+ if (null !== active_reaction && active_reaction.f & EFFECT_IS_UPDATING) if (null === reaction_sources) reaction_sources = [ value ]; else reaction_sources.push(value);
+}
+
+var new_deps = null, skipped_deps = 0, untracked_writes = null;
+
+function set_untracked_writes(value) {
+ untracked_writes = value;
+}
+
+var write_version = 1, read_version = 0, skip_reaction = false, captured_signals = null;
+
+function increment_write_version() {
+ return ++write_version;
+}
+
+function check_dirtiness(reaction) {
+ var _a3, _b3, flags = reaction.f;
+ if (!!(flags & DIRTY)) return true;
+ if (!!(flags & MAYBE_DIRTY)) {
+ var dependencies = reaction.deps, is_unowned = !!(flags & UNOWNED);
+ if (null !== dependencies) {
+ var i, dependency, is_disconnected = !!(flags & DISCONNECTED), is_unowned_connected = is_unowned && null !== active_effect && !skip_reaction, length = dependencies.length;
+ if (is_disconnected || is_unowned_connected) {
+ var derived3 = reaction, parent = derived3.parent;
+ for (i = 0; i < length; i++) {
+ dependency = dependencies[i];
+ if (is_disconnected || !(null == (_a3 = null == dependency ? void 0 : dependency.reactions) ? void 0 : _a3.includes(derived3))) (null != (_b3 = dependency.reactions) ? _b3 : dependency.reactions = []).push(derived3);
+ }
+ if (is_disconnected) derived3.f ^= DISCONNECTED;
+ if (is_unowned_connected && null !== parent && !(parent.f & UNOWNED)) derived3.f ^= UNOWNED;
+ }
+ for (i = 0; i < length; i++) {
+ if (check_dirtiness(dependency = dependencies[i])) update_derived(dependency);
+ if (dependency.wv > reaction.wv) return true;
+ }
+ }
+ if (!is_unowned || null !== active_effect && !skip_reaction) set_signal_status(reaction, CLEAN);
+ }
+ return false;
+}
+
+function propagate_error(error, effect2) {
+ for (var current = effect2; null !== current; ) {
+ if (!!(current.f & BOUNDARY_EFFECT)) try {
+ current.fn(error);
+ return;
+ } catch (e) {
+ current.f ^= BOUNDARY_EFFECT;
+ }
+ current = current.parent;
+ }
+ is_throwing_error = false;
+ throw error;
+}
+
+function should_rethrow_error(effect2) {
+ return !(effect2.f & DESTROYED || null !== effect2.parent && effect2.parent.f & BOUNDARY_EFFECT);
+}
+
+function handle_error(error, effect2, previous_effect, component_context2) {
+ var _a3, _b3;
+ if (is_throwing_error) {
+ if (null === previous_effect) is_throwing_error = false;
+ if (should_rethrow_error(effect2)) throw error;
+ return;
+ }
+ if (null !== previous_effect) is_throwing_error = true;
+ if (!dev_fallback_default || null === component_context2 || !(error instanceof Error) || handled_errors.has(error)) {
+ propagate_error(error, effect2);
+ return;
+ }
+ handled_errors.add(error);
+ const component_stack = [], effect_name = null == (_a3 = effect2.fn) ? void 0 : _a3.name;
+ if (effect_name) component_stack.push(effect_name);
+ let current_context = component_context2;
+ for (;null !== current_context; ) {
+ if (dev_fallback_default) {
+ var filename = null == (_b3 = current_context.function) ? void 0 : _b3[FILENAME];
+ if (filename) {
+ const file = filename.split("/").pop();
+ component_stack.push(file);
+ }
+ }
+ current_context = current_context.p;
+ }
+ const indent = is_firefox ? " " : "\t";
+ define_property(error, "message", {
+ value: error.message + `\n${component_stack.map((name => `\n${indent}in ${name}`)).join("")}\n`
+ });
+ define_property(error, "component_stack", {
+ value: component_stack
+ });
+ const stack2 = error.stack;
+ if (stack2) {
+ const lines = stack2.split("\n"), new_lines = [];
+ for (let i = 0; i < lines.length; i++) {
+ const line = lines[i];
+ if (!line.includes("svelte/src/internal")) new_lines.push(line);
+ }
+ define_property(error, "stack", {
+ value: new_lines.join("\n")
+ });
+ }
+ propagate_error(error, effect2);
+ if (should_rethrow_error(effect2)) throw error;
+}
+
+function schedule_possible_effect_self_invalidation(signal, effect2, root6 = true) {
+ var reactions = signal.reactions;
+ if (null !== reactions) for (var i = 0; i < reactions.length; i++) {
+ var reaction = reactions[i];
+ if (!(null == reaction_sources ? void 0 : reaction_sources.includes(signal))) if (!!(reaction.f & DERIVED)) schedule_possible_effect_self_invalidation(reaction, effect2, false); else if (effect2 === reaction) {
+ if (root6) set_signal_status(reaction, DIRTY); else if (!!(reaction.f & CLEAN)) set_signal_status(reaction, MAYBE_DIRTY);
+ schedule_effect(reaction);
+ }
+ }
+}
+
+function update_reaction(reaction) {
+ var _a3, _b3, previous_deps = new_deps, previous_skipped_deps = skipped_deps, previous_untracked_writes = untracked_writes, previous_reaction = active_reaction, previous_skip_reaction = skip_reaction, previous_reaction_sources = reaction_sources, previous_component_context = component_context, previous_untracking = untracking, flags = reaction.f;
+ new_deps = null;
+ skipped_deps = 0;
+ untracked_writes = null;
+ skip_reaction = !!(flags & UNOWNED) && (untracking || !is_updating_effect || null === active_reaction);
+ active_reaction = !(flags & (BRANCH_EFFECT | ROOT_EFFECT)) ? reaction : null;
+ reaction_sources = null;
+ set_component_context(reaction.ctx);
+ untracking = false;
+ read_version++;
+ reaction.f |= EFFECT_IS_UPDATING;
+ try {
+ var result = (0, reaction.fn)(), deps = reaction.deps;
+ if (null !== new_deps) {
+ var i;
+ remove_reactions(reaction, skipped_deps);
+ if (null !== deps && skipped_deps > 0) {
+ deps.length = skipped_deps + new_deps.length;
+ for (i = 0; i < new_deps.length; i++) deps[skipped_deps + i] = new_deps[i];
+ } else reaction.deps = deps = new_deps;
+ if (!skip_reaction) for (i = skipped_deps; i < deps.length; i++) (null != (_b3 = (_a3 = deps[i]).reactions) ? _b3 : _a3.reactions = []).push(reaction);
+ } else if (null !== deps && skipped_deps < deps.length) {
+ remove_reactions(reaction, skipped_deps);
+ deps.length = skipped_deps;
+ }
+ if (is_runes() && null !== untracked_writes && !untracking && null !== deps && !(reaction.f & (DERIVED | MAYBE_DIRTY | DIRTY))) for (i = 0; i < untracked_writes.length; i++) schedule_possible_effect_self_invalidation(untracked_writes[i], reaction);
+ if (previous_reaction !== reaction) {
+ read_version++;
+ if (null !== untracked_writes) if (null === previous_untracked_writes) previous_untracked_writes = untracked_writes; else previous_untracked_writes.push(...untracked_writes);
+ }
+ return result;
+ } finally {
+ new_deps = previous_deps;
+ skipped_deps = previous_skipped_deps;
+ untracked_writes = previous_untracked_writes;
+ active_reaction = previous_reaction;
+ skip_reaction = previous_skip_reaction;
+ reaction_sources = previous_reaction_sources;
+ set_component_context(previous_component_context);
+ untracking = previous_untracking;
+ reaction.f ^= EFFECT_IS_UPDATING;
+ }
+}
+
+function remove_reaction(signal, dependency) {
+ let reactions = dependency.reactions;
+ if (null !== reactions) {
+ var index2 = index_of.call(reactions, signal);
+ if (-1 !== index2) {
+ var new_length = reactions.length - 1;
+ if (0 === new_length) reactions = dependency.reactions = null; else {
+ reactions[index2] = reactions[new_length];
+ reactions.pop();
+ }
+ }
+ }
+ if (!(null !== reactions || !(dependency.f & DERIVED) || null !== new_deps && new_deps.includes(dependency))) {
+ set_signal_status(dependency, MAYBE_DIRTY);
+ if (!(dependency.f & (UNOWNED | DISCONNECTED))) dependency.f ^= DISCONNECTED;
+ destroy_derived_effects(dependency);
+ remove_reactions(dependency, 0);
+ }
+}
+
+function remove_reactions(signal, start_index) {
+ var dependencies = signal.deps;
+ if (null !== dependencies) for (var i = start_index; i < dependencies.length; i++) remove_reaction(signal, dependencies[i]);
+}
+
+function update_effect(effect2) {
+ var flags = effect2.f;
+ if (!(flags & DESTROYED)) {
+ set_signal_status(effect2, CLEAN);
+ var previous_effect = active_effect, previous_component_context = component_context, was_updating_effect = is_updating_effect;
+ active_effect = effect2;
+ is_updating_effect = true;
+ if (dev_fallback_default) {
+ var previous_component_fn = dev_current_component_function;
+ set_dev_current_component_function(effect2.component_function);
+ }
+ try {
+ if (!!(flags & BLOCK_EFFECT)) destroy_block_effect_children(effect2); else destroy_effect_children(effect2);
+ execute_effect_teardown(effect2);
+ var teardown2 = update_reaction(effect2);
+ effect2.teardown = "function" == typeof teardown2 ? teardown2 : null;
+ effect2.wv = write_version;
+ var deps = effect2.deps;
+ if (dev_fallback_default && tracing_mode_flag && !!(effect2.f & DIRTY) && null !== deps) for (let i = 0; i < deps.length; i++) {
+ var dep = deps[i];
+ if (dep.trace_need_increase) {
+ dep.wv = increment_write_version();
+ dep.trace_need_increase = void 0;
+ dep.trace_v = void 0;
+ }
+ }
+ if (dev_fallback_default) dev_effect_stack.push(effect2);
+ } catch (error) {
+ handle_error(error, effect2, previous_effect, previous_component_context || effect2.ctx);
+ } finally {
+ is_updating_effect = was_updating_effect;
+ active_effect = previous_effect;
+ if (dev_fallback_default) set_dev_current_component_function(previous_component_fn);
+ }
+ }
+}
+
+function log_effect_stack() {
+ console.error("Last ten effects were: ", dev_effect_stack.slice(-10).map((d => d.fn)));
+ dev_effect_stack = [];
+}
+
+function infinite_loop_guard() {
+ try {
+ effect_update_depth_exceeded();
+ } catch (error) {
+ if (dev_fallback_default) define_property(error, "stack", {
+ value: ""
+ });
+ if (null !== last_scheduled_effect) if (dev_fallback_default) try {
+ handle_error(error, last_scheduled_effect, null, null);
+ } catch (e) {
+ log_effect_stack();
+ throw e;
+ } else handle_error(error, last_scheduled_effect, null, null); else {
+ if (dev_fallback_default) log_effect_stack();
+ throw error;
+ }
+ }
+}
+
+function flush_queued_root_effects() {
+ var was_updating_effect = is_updating_effect;
+ try {
+ var flush_count = 0;
+ is_updating_effect = true;
+ for (;queued_root_effects.length > 0; ) {
+ if (flush_count++ > 1e3) infinite_loop_guard();
+ var root_effects = queued_root_effects, length = root_effects.length;
+ queued_root_effects = [];
+ for (var i = 0; i < length; i++) flush_queued_effects(process_effects(root_effects[i]));
+ old_values.clear();
+ }
+ } finally {
+ is_flushing = false;
+ is_updating_effect = was_updating_effect;
+ last_scheduled_effect = null;
+ if (dev_fallback_default) dev_effect_stack = [];
+ }
+}
+
+function flush_queued_effects(effects) {
+ var length = effects.length;
+ if (0 !== length) for (var i = 0; i < length; i++) {
+ var effect2 = effects[i];
+ if (!(effect2.f & (DESTROYED | INERT))) try {
+ if (check_dirtiness(effect2)) {
+ update_effect(effect2);
+ if (null === effect2.deps && null === effect2.first && null === effect2.nodes_start) if (null === effect2.teardown) unlink_effect(effect2); else effect2.fn = null;
+ }
+ } catch (error) {
+ handle_error(error, effect2, null, effect2.ctx);
+ }
+ }
+}
+
+function schedule_effect(signal) {
+ if (!is_flushing) {
+ is_flushing = true;
+ queueMicrotask(flush_queued_root_effects);
+ }
+ for (var effect2 = last_scheduled_effect = signal; null !== effect2.parent; ) {
+ var flags = (effect2 = effect2.parent).f;
+ if (!!(flags & (ROOT_EFFECT | BRANCH_EFFECT))) {
+ if (!(flags & CLEAN)) return;
+ effect2.f ^= CLEAN;
+ }
+ }
+ queued_root_effects.push(effect2);
+}
+
+function process_effects(root6) {
+ for (var effects = [], effect2 = root6; null !== effect2; ) {
+ var flags = effect2.f, is_branch = !!(flags & (BRANCH_EFFECT | ROOT_EFFECT));
+ if (!(is_branch && !!(flags & CLEAN) || flags & INERT)) {
+ if (!!(flags & EFFECT)) effects.push(effect2); else if (is_branch) effect2.f ^= CLEAN; else {
+ var previous_active_reaction = active_reaction;
+ try {
+ active_reaction = effect2;
+ if (check_dirtiness(effect2)) update_effect(effect2);
+ } catch (error) {
+ handle_error(error, effect2, null, effect2.ctx);
+ } finally {
+ active_reaction = previous_active_reaction;
+ }
+ }
+ var child2 = effect2.first;
+ if (null !== child2) {
+ effect2 = child2;
+ continue;
+ }
+ }
+ var parent = effect2.parent;
+ effect2 = effect2.next;
+ for (;null === effect2 && null !== parent; ) {
+ effect2 = parent.next;
+ parent = parent.parent;
+ }
+ }
+ return effects;
+}
+
+function flushSync(fn) {
+ var result;
+ if (fn) {
+ is_flushing = true;
+ flush_queued_root_effects();
+ result = fn();
+ }
+ flush_tasks();
+ for (;queued_root_effects.length > 0; ) {
+ is_flushing = true;
+ flush_queued_root_effects();
+ flush_tasks();
+ }
+ return result;
+}
+
+function get(signal) {
+ var is_derived = !!(signal.f & DERIVED);
+ if (null !== captured_signals) captured_signals.add(signal);
+ if (null !== active_reaction && !untracking) {
+ if (!(null == reaction_sources ? void 0 : reaction_sources.includes(signal))) {
+ var deps = active_reaction.deps;
+ if (signal.rv < read_version) {
+ signal.rv = read_version;
+ if (null === new_deps && null !== deps && deps[skipped_deps] === signal) skipped_deps++; else if (null === new_deps) new_deps = [ signal ]; else if (!skip_reaction || !new_deps.includes(signal)) new_deps.push(signal);
+ }
+ }
+ } else if (is_derived && null === signal.deps && null === signal.effects) {
+ var derived3 = signal, parent = derived3.parent;
+ if (null !== parent && !(parent.f & UNOWNED)) derived3.f ^= UNOWNED;
+ }
+ if (is_derived) if (check_dirtiness(derived3 = signal)) update_derived(derived3);
+ if (dev_fallback_default && tracing_mode_flag && null !== tracing_expressions && null !== active_reaction && tracing_expressions.reaction === active_reaction) if (signal.debug) signal.debug(); else if (signal.created) {
+ var entry = tracing_expressions.entries.get(signal);
+ if (void 0 === entry) {
+ entry = {
+ read: []
+ };
+ tracing_expressions.entries.set(signal, entry);
+ }
+ entry.read.push(get_stack("TracedAt"));
+ }
+ if (is_destroying_effect && old_values.has(signal)) return old_values.get(signal); else return signal.v;
+}
+
+function untrack(fn) {
+ var previous_untracking = untracking;
+ try {
+ untracking = true;
+ return fn();
+ } finally {
+ untracking = previous_untracking;
+ }
+}
+
+var STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
+
+function set_signal_status(signal, status) {
+ signal.f = signal.f & STATUS_MASK | status;
+}
+
+function validate_effect(rune) {
+ if (null === active_effect && null === active_reaction) effect_orphan(rune);
+ if (null !== active_reaction && !!(active_reaction.f & UNOWNED) && null === active_effect) effect_in_unowned_derived();
+ if (is_destroying_effect) effect_in_teardown(rune);
+}
+
+function push_effect(effect2, parent_effect) {
+ var parent_last = parent_effect.last;
+ if (null === parent_last) parent_effect.last = parent_effect.first = effect2; else {
+ parent_last.next = effect2;
+ effect2.prev = parent_last;
+ parent_effect.last = effect2;
+ }
+}
+
+function create_effect(type, fn, sync, push2 = true) {
+ var _a3, parent = active_effect;
+ if (dev_fallback_default) for (;null !== parent && !!(parent.f & INSPECT_EFFECT); ) parent = parent.parent;
+ var effect2 = {
+ ctx: component_context,
+ deps: null,
+ nodes_start: null,
+ nodes_end: null,
+ f: type | DIRTY,
+ first: null,
+ fn,
+ last: null,
+ next: null,
+ parent,
+ prev: null,
+ teardown: null,
+ transitions: null,
+ wv: 0
+ };
+ if (dev_fallback_default) effect2.component_function = dev_current_component_function;
+ if (sync) try {
+ update_effect(effect2);
+ effect2.f |= EFFECT_RAN;
+ } catch (e) {
+ destroy_effect(effect2);
+ throw e;
+ } else if (null !== fn) schedule_effect(effect2);
+ if (!(sync && null === effect2.deps && null === effect2.first && null === effect2.nodes_start && null === effect2.teardown && !(effect2.f & (EFFECT_HAS_DERIVED | BOUNDARY_EFFECT))) && push2) {
+ if (null !== parent) push_effect(effect2, parent);
+ if (null !== active_reaction && !!(active_reaction.f & DERIVED)) {
+ var derived3 = active_reaction;
+ (null != (_a3 = derived3.effects) ? _a3 : derived3.effects = []).push(effect2);
+ }
+ }
+ return effect2;
+}
+
+function teardown(fn) {
+ const effect2 = create_effect(RENDER_EFFECT, null, false);
+ set_signal_status(effect2, CLEAN);
+ effect2.teardown = fn;
+ return effect2;
+}
+
+function user_effect(fn) {
+ var _a3;
+ validate_effect("$effect");
+ var defer = null !== active_effect && !!(active_effect.f & BRANCH_EFFECT) && null !== component_context && !component_context.m;
+ if (dev_fallback_default) define_property(fn, "name", {
+ value: "$effect"
+ });
+ if (defer) {
+ var context = component_context;
+ (null != (_a3 = context.e) ? _a3 : context.e = []).push({
+ fn,
+ effect: active_effect,
+ reaction: active_reaction
+ });
+ } else return effect(fn);
+}
+
+function effect_root(fn) {
+ const effect2 = create_effect(ROOT_EFFECT, fn, true);
+ return () => {
+ destroy_effect(effect2);
+ };
+}
+
+function component_root(fn) {
+ const effect2 = create_effect(ROOT_EFFECT, fn, true);
+ return (options = {}) => new Promise((fulfil => {
+ if (options.outro) pause_effect(effect2, (() => {
+ destroy_effect(effect2);
+ fulfil(void 0);
+ })); else {
+ destroy_effect(effect2);
+ fulfil(void 0);
+ }
+ }));
+}
+
+function effect(fn) {
+ return create_effect(EFFECT, fn, false);
+}
+
+function render_effect(fn) {
+ return create_effect(RENDER_EFFECT, fn, true);
+}
+
+function template_effect(fn, thunks = [], d = derived) {
+ const deriveds = thunks.map(d), effect2 = () => fn(...deriveds.map(get));
+ if (dev_fallback_default) define_property(effect2, "name", {
+ value: "{expression}"
+ });
+ return block(effect2);
+}
+
+function block(fn, flags = 0) {
+ return create_effect(RENDER_EFFECT | BLOCK_EFFECT | flags, fn, true);
+}
+
+function branch(fn, push2 = true) {
+ return create_effect(RENDER_EFFECT | BRANCH_EFFECT, fn, true, push2);
+}
+
+function execute_effect_teardown(effect2) {
+ var teardown2 = effect2.teardown;
+ if (null !== teardown2) {
+ const previously_destroying_effect = is_destroying_effect, previous_reaction = active_reaction;
+ set_is_destroying_effect(true);
+ set_active_reaction(null);
+ try {
+ teardown2.call(null);
+ } finally {
+ set_is_destroying_effect(previously_destroying_effect);
+ set_active_reaction(previous_reaction);
+ }
+ }
+}
+
+function destroy_effect_children(signal, remove_dom = false) {
+ var effect2 = signal.first;
+ signal.first = signal.last = null;
+ for (;null !== effect2; ) {
+ var next2 = effect2.next;
+ if (!!(effect2.f & ROOT_EFFECT)) effect2.parent = null; else destroy_effect(effect2, remove_dom);
+ effect2 = next2;
+ }
+}
+
+function destroy_block_effect_children(signal) {
+ for (var effect2 = signal.first; null !== effect2; ) {
+ var next2 = effect2.next;
+ if (!(effect2.f & BRANCH_EFFECT)) destroy_effect(effect2);
+ effect2 = next2;
+ }
+}
+
+function destroy_effect(effect2, remove_dom = true) {
+ var removed = false;
+ if ((remove_dom || !!(effect2.f & HEAD_EFFECT)) && null !== effect2.nodes_start) {
+ for (var node = effect2.nodes_start, end = effect2.nodes_end; null !== node; ) {
+ var next2 = node === end ? null : get_next_sibling(node);
+ node.remove();
+ node = next2;
+ }
+ removed = true;
+ }
+ destroy_effect_children(effect2, remove_dom && !removed);
+ remove_reactions(effect2, 0);
+ set_signal_status(effect2, DESTROYED);
+ var transitions = effect2.transitions;
+ if (null !== transitions) for (const transition2 of transitions) transition2.stop();
+ execute_effect_teardown(effect2);
+ var parent = effect2.parent;
+ if (null !== parent && null !== parent.first) unlink_effect(effect2);
+ if (dev_fallback_default) effect2.component_function = null;
+ effect2.next = effect2.prev = effect2.teardown = effect2.ctx = effect2.deps = effect2.fn = effect2.nodes_start = effect2.nodes_end = null;
+}
+
+function unlink_effect(effect2) {
+ var parent = effect2.parent, prev = effect2.prev, next2 = effect2.next;
+ if (null !== prev) prev.next = next2;
+ if (null !== next2) next2.prev = prev;
+ if (null !== parent) {
+ if (parent.first === effect2) parent.first = next2;
+ if (parent.last === effect2) parent.last = prev;
+ }
+}
+
+function pause_effect(effect2, callback) {
+ var transitions = [];
+ pause_children(effect2, transitions, true);
+ run_out_transitions(transitions, (() => {
+ destroy_effect(effect2);
+ if (callback) callback();
+ }));
+}
+
+function run_out_transitions(transitions, fn) {
+ var remaining = transitions.length;
+ if (remaining > 0) {
+ var check = () => --remaining || fn();
+ for (var transition2 of transitions) transition2.out(check);
+ } else fn();
+}
+
+function pause_children(effect2, transitions, local) {
+ if (!(effect2.f & INERT)) {
+ effect2.f ^= INERT;
+ if (null !== effect2.transitions) for (const transition2 of effect2.transitions) if (transition2.is_global || local) transitions.push(transition2);
+ for (var child2 = effect2.first; null !== child2; ) {
+ var sibling2 = child2.next;
+ pause_children(child2, transitions, !!(child2.f & EFFECT_TRANSPARENT) || !!(child2.f & BRANCH_EFFECT) ? local : false);
+ child2 = sibling2;
+ }
+ }
+}
+
+function resume_effect(effect2) {
+ resume_children(effect2, true);
+}
+
+function resume_children(effect2, local) {
+ if (effect2.f & INERT) {
+ effect2.f ^= INERT;
+ if (!(effect2.f & CLEAN)) effect2.f ^= CLEAN;
+ if (check_dirtiness(effect2)) {
+ set_signal_status(effect2, DIRTY);
+ schedule_effect(effect2);
+ }
+ for (var child2 = effect2.first; null !== child2; ) {
+ var sibling2 = child2.next;
+ resume_children(child2, !!(child2.f & EFFECT_TRANSPARENT) || !!(child2.f & BRANCH_EFFECT) ? local : false);
+ child2 = sibling2;
+ }
+ if (null !== effect2.transitions) for (const transition2 of effect2.transitions) if (transition2.is_global || local) transition2.in();
+ }
+}
+
+var regex_return_characters = /\r/g;
+
+function hash(str) {
+ let hash2 = 5381, i = (str = str.replace(regex_return_characters, "")).length;
+ for (;i--; ) hash2 = (hash2 << 5) - hash2 ^ str.charCodeAt(i);
+ return (hash2 >>> 0).toString(36);
+}
+
+var DOM_BOOLEAN_ATTRIBUTES = [ "allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "inert", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected", "webkitdirectory", "defer", "disablepictureinpicture", "disableremoteplayback" ], DOM_PROPERTIES = [ ...DOM_BOOLEAN_ATTRIBUTES, "formNoValidate", "isMap", "noModule", "playsInline", "readOnly", "value", "volume", "defaultValue", "defaultChecked", "srcObject", "noValidate", "allowFullscreen", "disablePictureInPicture", "disableRemotePlayback" ], PASSIVE_EVENTS = [ "touchstart", "touchmove" ];
+
+function is_passive_event(name) {
+ return PASSIVE_EVENTS.includes(name);
+}
+
+function sanitize_location(location) {
+ return null == location ? void 0 : location.replace(/\//g, "/");
+}
+
+var all_styles = new Map;
+
+function register_style(hash2, style) {
+ var styles = all_styles.get(hash2);
+ if (!styles) {
+ styles = new Set;
+ all_styles.set(hash2, styles);
+ }
+ styles.add(style);
+}
+
+var listening_to_form_reset = false;
+
+function add_form_reset_listener() {
+ if (!listening_to_form_reset) {
+ listening_to_form_reset = true;
+ document.addEventListener("reset", (evt => {
+ Promise.resolve().then((() => {
+ var _a3;
+ if (!evt.defaultPrevented) for (const e of evt.target.elements) null == (_a3 = e.__on_r) || _a3.call(e);
+ }));
+ }), {
+ capture: true
+ });
+ }
+}
+
+function without_reactive_context(fn) {
+ var previous_reaction = active_reaction, previous_effect = active_effect;
+ set_active_reaction(null);
+ set_active_effect(null);
+ try {
+ return fn();
+ } finally {
+ set_active_reaction(previous_reaction);
+ set_active_effect(previous_effect);
+ }
+}
+
+function listen_to_event_and_reset_event(element2, event2, handler, on_reset = handler) {
+ element2.addEventListener(event2, (() => without_reactive_context(handler)));
+ const prev = element2.__on_r;
+ if (prev) element2.__on_r = () => {
+ prev();
+ on_reset(true);
+ }; else element2.__on_r = () => on_reset(true);
+ add_form_reset_listener();
+}
+
+var head_anchor, all_registered_events = new Set, root_event_handles = new Set;
+
+function create_event(event_name, dom, handler, options = {}) {
+ function target_handler(event2) {
+ if (!options.capture) handle_event_propagation.call(dom, event2);
+ if (!event2.cancelBubble) return without_reactive_context((() => null == handler ? void 0 : handler.call(this, event2)));
+ }
+ if (event_name.startsWith("pointer") || event_name.startsWith("touch") || "wheel" === event_name) queue_micro_task((() => {
+ dom.addEventListener(event_name, target_handler, options);
+ })); else dom.addEventListener(event_name, target_handler, options);
+ return target_handler;
+}
+
+function event(event_name, dom, handler, capture, passive2) {
+ var options = {
+ capture,
+ passive: passive2
+ }, target_handler = create_event(event_name, dom, handler, options);
+ if (dom === document.body || dom === window || dom === document) teardown((() => {
+ dom.removeEventListener(event_name, target_handler, options);
+ }));
+}
+
+function delegate(events) {
+ for (var i = 0; i < events.length; i++) all_registered_events.add(events[i]);
+ for (var fn of root_event_handles) fn(events);
+}
+
+function handle_event_propagation(event2) {
+ var _a3, owner_document = this.ownerDocument, event_name = event2.type, path = (null == (_a3 = event2.composedPath) ? void 0 : _a3.call(event2)) || [], current_target = path[0] || event2.target, path_idx = 0, handled_at = event2.__root;
+ if (handled_at) {
+ var at_idx = path.indexOf(handled_at);
+ if (-1 !== at_idx && (this === document || this === window)) {
+ event2.__root = this;
+ return;
+ }
+ var handler_idx = path.indexOf(this);
+ if (-1 === handler_idx) return;
+ if (at_idx <= handler_idx) path_idx = at_idx;
+ }
+ if ((current_target = path[path_idx] || event2.target) !== this) {
+ define_property(event2, "currentTarget", {
+ configurable: true,
+ get: () => current_target || owner_document
+ });
+ var previous_reaction = active_reaction, previous_effect = active_effect;
+ set_active_reaction(null);
+ set_active_effect(null);
+ try {
+ for (var throw_error, other_errors = []; null !== current_target; ) {
+ var parent_element = current_target.assignedSlot || current_target.parentNode || current_target.host || null;
+ try {
+ var delegated = current_target["__" + event_name];
+ if (null != delegated && (!current_target.disabled || event2.target === current_target)) if (is_array(delegated)) {
+ var [fn, ...data] = delegated;
+ fn.apply(current_target, [ event2, ...data ]);
+ } else delegated.call(current_target, event2);
+ } catch (error) {
+ if (throw_error) other_errors.push(error); else throw_error = error;
+ }
+ if (event2.cancelBubble || parent_element === this || null === parent_element) break;
+ current_target = parent_element;
+ }
+ if (throw_error) {
+ for (let error of other_errors) queueMicrotask((() => {
+ throw error;
+ }));
+ throw throw_error;
+ }
+ } finally {
+ event2.__root = this;
+ delete event2.currentTarget;
+ set_active_reaction(previous_reaction);
+ set_active_effect(previous_effect);
+ }
+ }
+}
+
+function reset_head_anchor() {
+ head_anchor = void 0;
+}
+
+function create_fragment_from_html(html2) {
+ var elem = document.createElement("template");
+ elem.innerHTML = html2;
+ return elem.content;
+}
+
+function assign_nodes(start, end) {
+ var effect2 = active_effect;
+ if (null === effect2.nodes_start) {
+ effect2.nodes_start = start;
+ effect2.nodes_end = end;
+ }
+}
+
+function template(content, flags) {
+ var node, is_fragment = !!(flags & TEMPLATE_FRAGMENT), use_import_node = !!(flags & TEMPLATE_USE_IMPORT_NODE), has_start = !content.startsWith("");
+ return () => {
+ if (hydrating) {
+ assign_nodes(hydrate_node, null);
+ return hydrate_node;
+ }
+ if (void 0 === node) {
+ node = create_fragment_from_html(has_start ? content : "" + content);
+ if (!is_fragment) node = get_first_child(node);
+ }
+ var clone = use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true);
+ if (is_fragment) assign_nodes(get_first_child(clone), clone.lastChild); else assign_nodes(clone, clone);
+ return clone;
+ };
+}
+
+function ns_template(content, flags, ns = "svg") {
+ var node, has_start = !content.startsWith(""), is_fragment = !!(flags & TEMPLATE_FRAGMENT), wrapped = `<${ns}>${has_start ? content : "" + content}${ns}>`;
+ return () => {
+ if (hydrating) {
+ assign_nodes(hydrate_node, null);
+ return hydrate_node;
+ }
+ if (!node) {
+ var root6 = get_first_child(create_fragment_from_html(wrapped));
+ if (is_fragment) {
+ node = document.createDocumentFragment();
+ for (;get_first_child(root6); ) node.appendChild(get_first_child(root6));
+ } else node = get_first_child(root6);
+ }
+ var clone = node.cloneNode(true);
+ if (is_fragment) assign_nodes(get_first_child(clone), clone.lastChild); else assign_nodes(clone, clone);
+ return clone;
+ };
+}
+
+function comment() {
+ if (hydrating) {
+ assign_nodes(hydrate_node, null);
+ return hydrate_node;
+ }
+ var frag = document.createDocumentFragment(), start = document.createComment(""), anchor = create_text();
+ frag.append(start, anchor);
+ assign_nodes(start, anchor);
+ return frag;
+}
+
+function append(anchor, dom) {
+ if (!hydrating) {
+ if (null !== anchor) anchor.before(dom);
+ } else {
+ active_effect.nodes_end = hydrate_node;
+ hydrate_next();
+ }
+}
+
+var should_intro = true;
+
+function set_text(text2, value) {
+ var _a3, str = null == value ? "" : "object" == typeof value ? value + "" : value;
+ if (str !== (null != (_a3 = text2.__t) ? _a3 : text2.__t = text2.nodeValue)) {
+ text2.__t = str;
+ text2.nodeValue = str + "";
+ }
+}
+
+function mount(component2, options) {
+ return _mount(component2, options);
+}
+
+function hydrate(component2, options) {
+ var _a3;
+ init_operations();
+ options.intro = null != (_a3 = options.intro) ? _a3 : false;
+ const target = options.target, was_hydrating = hydrating, previous_hydrate_node = hydrate_node;
+ try {
+ for (var anchor = get_first_child(target); anchor && (8 !== anchor.nodeType || anchor.data !== HYDRATION_START); ) anchor = get_next_sibling(anchor);
+ if (!anchor) throw HYDRATION_ERROR;
+ set_hydrating(true);
+ set_hydrate_node(anchor);
+ hydrate_next();
+ const instance = _mount(component2, {
+ ...options,
+ anchor
+ });
+ if (null === hydrate_node || 8 !== hydrate_node.nodeType || hydrate_node.data !== HYDRATION_END) {
+ hydration_mismatch();
+ throw HYDRATION_ERROR;
+ }
+ set_hydrating(false);
+ return instance;
+ } catch (error) {
+ if (error === HYDRATION_ERROR) {
+ if (false === options.recover) hydration_failed();
+ init_operations();
+ clear_text_content(target);
+ set_hydrating(false);
+ return mount(component2, options);
+ }
+ throw error;
+ } finally {
+ set_hydrating(was_hydrating);
+ set_hydrate_node(previous_hydrate_node);
+ reset_head_anchor();
+ }
+}
+
+var document_listeners = new Map;
+
+function _mount(Component, {target, anchor, props = {}, events, context, intro = true}) {
+ init_operations();
+ var registered_events = new Set, event_handle = events2 => {
+ for (var i = 0; i < events2.length; i++) {
+ var event_name = events2[i];
+ if (!registered_events.has(event_name)) {
+ registered_events.add(event_name);
+ var passive2 = is_passive_event(event_name);
+ target.addEventListener(event_name, handle_event_propagation, {
+ passive: passive2
+ });
+ var n = document_listeners.get(event_name);
+ if (void 0 === n) {
+ document.addEventListener(event_name, handle_event_propagation, {
+ passive: passive2
+ });
+ document_listeners.set(event_name, 1);
+ } else document_listeners.set(event_name, n + 1);
+ }
+ }
+ };
+ event_handle(array_from(all_registered_events));
+ root_event_handles.add(event_handle);
+ var component2 = void 0, unmount2 = component_root((() => {
+ var anchor_node = null != anchor ? anchor : target.appendChild(create_text());
+ branch((() => {
+ if (context) {
+ push({});
+ component_context.c = context;
+ }
+ if (events) props.$$events = events;
+ if (hydrating) assign_nodes(anchor_node, null);
+ should_intro = intro;
+ component2 = Component(anchor_node, props) || {};
+ should_intro = true;
+ if (hydrating) active_effect.nodes_end = hydrate_node;
+ if (context) pop();
+ }));
+ return () => {
+ var _a3;
+ for (var event_name of registered_events) {
+ target.removeEventListener(event_name, handle_event_propagation);
+ var n = document_listeners.get(event_name);
+ if (0 == --n) {
+ document.removeEventListener(event_name, handle_event_propagation);
+ document_listeners.delete(event_name);
+ } else document_listeners.set(event_name, n);
+ }
+ root_event_handles.delete(event_handle);
+ if (anchor_node !== anchor) null == (_a3 = anchor_node.parentNode) || _a3.removeChild(anchor_node);
+ };
+ }));
+ mounted_components.set(component2, unmount2);
+ return component2;
+}
+
+var mounted_components = new WeakMap;
+
+function unmount(component2, options) {
+ const fn = mounted_components.get(component2);
+ if (fn) {
+ mounted_components.delete(component2);
+ return fn(options);
+ }
+ if (dev_fallback_default) lifecycle_double_unmount();
+ return Promise.resolve();
+}
+
+function if_block(node, fn, [root_index, hydrate_index] = [ 0, 0 ]) {
+ if (hydrating && 0 === root_index) hydrate_next();
+ var anchor = node, consequent_effect = null, alternate_effect = null, condition = UNINITIALIZED, has_branch = false;
+ const set_branch = (fn2, flag = true) => {
+ has_branch = true;
+ update_branch(flag, fn2);
+ }, update_branch = (new_condition, fn2) => {
+ if (condition === (condition = new_condition)) return;
+ let mismatch = false;
+ if (hydrating && -1 !== hydrate_index) {
+ if (0 === root_index) {
+ const data = anchor.data;
+ if (data === HYDRATION_START) hydrate_index = 0; else if (data === HYDRATION_START_ELSE) hydrate_index = 1 / 0; else if ((hydrate_index = parseInt(data.substring(1))) != hydrate_index) hydrate_index = condition ? 1 / 0 : -1;
+ }
+ if (!!condition == hydrate_index > root_index) {
+ set_hydrate_node(anchor = remove_nodes());
+ set_hydrating(false);
+ mismatch = true;
+ hydrate_index = -1;
+ }
+ }
+ if (condition) {
+ if (consequent_effect) resume_effect(consequent_effect); else if (fn2) consequent_effect = branch((() => fn2(anchor)));
+ if (alternate_effect) pause_effect(alternate_effect, (() => {
+ alternate_effect = null;
+ }));
+ } else {
+ if (alternate_effect) resume_effect(alternate_effect); else if (fn2) alternate_effect = branch((() => fn2(anchor, [ root_index + 1, hydrate_index ])));
+ if (consequent_effect) pause_effect(consequent_effect, (() => {
+ consequent_effect = null;
+ }));
+ }
+ if (mismatch) set_hydrating(true);
+ };
+ block((() => {
+ has_branch = false;
+ fn(set_branch);
+ if (!has_branch) update_branch(null, null);
+ }), root_index > 0 ? EFFECT_TRANSPARENT : 0);
+ if (hydrating) anchor = hydrate_node;
+}
+
+var current_each_item = null;
+
+function index(_, i) {
+ return i;
+}
+
+function pause_effects(state2, items, controlled_anchor, items_map) {
+ for (var transitions = [], length = items.length, i = 0; i < length; i++) pause_children(items[i].e, transitions, true);
+ var is_controlled = length > 0 && 0 === transitions.length && null !== controlled_anchor;
+ if (is_controlled) {
+ var parent_node = controlled_anchor.parentNode;
+ clear_text_content(parent_node);
+ parent_node.append(controlled_anchor);
+ items_map.clear();
+ link(state2, items[0].prev, items[length - 1].next);
+ }
+ run_out_transitions(transitions, (() => {
+ for (var i2 = 0; i2 < length; i2++) {
+ var item = items[i2];
+ if (!is_controlled) {
+ items_map.delete(item.k);
+ link(state2, item.prev, item.next);
+ }
+ destroy_effect(item.e, !is_controlled);
+ }
+ }));
+}
+
+function each(node, flags, get_collection, get_key, render_fn, fallback_fn = null) {
+ var anchor = node, state2 = {
+ flags,
+ items: new Map,
+ first: null
+ };
+ if (!!(flags & EACH_IS_CONTROLLED)) {
+ var parent_node = node;
+ anchor = hydrating ? set_hydrate_node(get_first_child(parent_node)) : parent_node.appendChild(create_text());
+ }
+ if (hydrating) hydrate_next();
+ var fallback2 = null, was_empty = false, each_array = derived_safe_equal((() => {
+ var collection = get_collection();
+ return is_array(collection) ? collection : null == collection ? [] : array_from(collection);
+ }));
+ block((() => {
+ var array = get(each_array), length = array.length;
+ if (was_empty && 0 === length) return;
+ was_empty = 0 === length;
+ let mismatch = false;
+ if (hydrating) if (anchor.data === HYDRATION_START_ELSE != (0 === length)) {
+ set_hydrate_node(anchor = remove_nodes());
+ set_hydrating(false);
+ mismatch = true;
+ }
+ if (hydrating) {
+ for (var item, prev = null, i = 0; i < length; i++) {
+ if (8 === hydrate_node.nodeType && hydrate_node.data === HYDRATION_END) {
+ anchor = hydrate_node;
+ mismatch = true;
+ set_hydrating(false);
+ break;
+ }
+ var value = array[i], key = get_key(value, i);
+ item = create_item(hydrate_node, state2, prev, null, value, key, i, render_fn, flags, get_collection);
+ state2.items.set(key, item);
+ prev = item;
+ }
+ if (length > 0) set_hydrate_node(remove_nodes());
+ }
+ if (!hydrating) reconcile(array, state2, anchor, render_fn, flags, get_key, get_collection);
+ if (null !== fallback_fn) if (0 === length) if (fallback2) resume_effect(fallback2); else fallback2 = branch((() => fallback_fn(anchor))); else if (null !== fallback2) pause_effect(fallback2, (() => {
+ fallback2 = null;
+ }));
+ if (mismatch) set_hydrating(true);
+ get(each_array);
+ }));
+ if (hydrating) anchor = hydrate_node;
+}
+
+function reconcile(array, state2, anchor, render_fn, flags, get_key, get_collection) {
+ var _a3, _b3, _c2, _d, seen, to_animate, value, key, item, i, is_animated = !!(flags & EACH_IS_ANIMATED), should_update = !!(flags & (EACH_ITEM_REACTIVE | EACH_INDEX_REACTIVE)), length = array.length, items = state2.items, current = state2.first, prev = null, matched = [], stashed = [];
+ if (is_animated) for (i = 0; i < length; i += 1) {
+ key = get_key(value = array[i], i);
+ if (void 0 !== (item = items.get(key))) {
+ null == (_a3 = item.a) || _a3.measure();
+ (null != to_animate ? to_animate : to_animate = new Set).add(item);
+ }
+ }
+ for (i = 0; i < length; i += 1) {
+ key = get_key(value = array[i], i);
+ if (void 0 !== (item = items.get(key))) {
+ if (should_update) update_item(item, value, i, flags);
+ if (!!(item.e.f & INERT)) {
+ resume_effect(item.e);
+ if (is_animated) {
+ null == (_b3 = item.a) || _b3.unfix();
+ (null != to_animate ? to_animate : to_animate = new Set).delete(item);
+ }
+ }
+ if (item !== current) {
+ if (void 0 !== seen && seen.has(item)) {
+ if (matched.length < stashed.length) {
+ var j, start = stashed[0];
+ prev = start.prev;
+ var a = matched[0], b = matched[matched.length - 1];
+ for (j = 0; j < matched.length; j += 1) move(matched[j], start, anchor);
+ for (j = 0; j < stashed.length; j += 1) seen.delete(stashed[j]);
+ link(state2, a.prev, b.next);
+ link(state2, prev, a);
+ link(state2, b, start);
+ current = start;
+ prev = b;
+ i -= 1;
+ matched = [];
+ stashed = [];
+ } else {
+ seen.delete(item);
+ move(item, current, anchor);
+ link(state2, item.prev, item.next);
+ link(state2, item, null === prev ? state2.first : prev.next);
+ link(state2, prev, item);
+ prev = item;
+ }
+ continue;
+ }
+ matched = [];
+ stashed = [];
+ for (;null !== current && current.k !== key; ) {
+ if (!(current.e.f & INERT)) (null != seen ? seen : seen = new Set).add(current);
+ stashed.push(current);
+ current = current.next;
+ }
+ if (null === current) continue;
+ item = current;
+ }
+ matched.push(item);
+ prev = item;
+ current = item.next;
+ } else {
+ prev = create_item(current ? current.e.nodes_start : anchor, state2, prev, null === prev ? state2.first : prev.next, value, key, i, render_fn, flags, get_collection);
+ items.set(key, prev);
+ matched = [];
+ stashed = [];
+ current = prev.next;
+ }
+ }
+ if (null !== current || void 0 !== seen) {
+ for (var to_destroy = void 0 === seen ? [] : array_from(seen); null !== current; ) {
+ if (!(current.e.f & INERT)) to_destroy.push(current);
+ current = current.next;
+ }
+ var destroy_length = to_destroy.length;
+ if (destroy_length > 0) {
+ var controlled_anchor = !!(flags & EACH_IS_CONTROLLED) && 0 === length ? anchor : null;
+ if (is_animated) {
+ for (i = 0; i < destroy_length; i += 1) null == (_c2 = to_destroy[i].a) || _c2.measure();
+ for (i = 0; i < destroy_length; i += 1) null == (_d = to_destroy[i].a) || _d.fix();
+ }
+ pause_effects(state2, to_destroy, controlled_anchor, items);
+ }
+ }
+ if (is_animated) queue_micro_task((() => {
+ var _a4;
+ if (void 0 !== to_animate) for (item of to_animate) null == (_a4 = item.a) || _a4.apply();
+ }));
+ active_effect.first = state2.first && state2.first.e;
+ active_effect.last = prev && prev.e;
+}
+
+function update_item(item, value, index2, type) {
+ if (!!(type & EACH_ITEM_REACTIVE)) internal_set(item.v, value);
+ if (!!(type & EACH_INDEX_REACTIVE)) internal_set(item.i, index2); else item.i = index2;
+}
+
+function create_item(anchor, state2, prev, next2, value, key, index2, render_fn, flags, get_collection) {
+ var previous_each_item = current_each_item, reactive = !!(flags & EACH_ITEM_REACTIVE), v = reactive ? !(flags & EACH_ITEM_IMMUTABLE) ? mutable_source(value) : source(value) : value, i = !(flags & EACH_INDEX_REACTIVE) ? index2 : source(index2);
+ if (dev_fallback_default && reactive) v.debug = () => {
+ var collection_index = "number" == typeof i ? index2 : i.v;
+ get_collection()[collection_index];
+ };
+ var item = {
+ i,
+ v,
+ k: key,
+ a: null,
+ e: null,
+ prev,
+ next: next2
+ };
+ current_each_item = item;
+ try {
+ item.e = branch((() => render_fn(anchor, v, i, get_collection)), hydrating);
+ item.e.prev = prev && prev.e;
+ item.e.next = next2 && next2.e;
+ if (null === prev) state2.first = item; else {
+ prev.next = item;
+ prev.e.next = item.e;
+ }
+ if (null !== next2) {
+ next2.prev = item;
+ next2.e.prev = item.e;
+ }
+ return item;
+ } finally {
+ current_each_item = previous_each_item;
+ }
+}
+
+function move(item, next2, anchor) {
+ for (var end = item.next ? item.next.e.nodes_start : anchor, dest = next2 ? next2.e.nodes_start : anchor, node = item.e.nodes_start; node !== end; ) {
+ var next_node = get_next_sibling(node);
+ dest.before(node);
+ node = next_node;
+ }
+}
+
+function link(state2, prev, next2) {
+ if (null === prev) state2.first = next2; else {
+ prev.next = next2;
+ prev.e.next = next2 && next2.e;
+ }
+ if (null !== next2) {
+ next2.prev = prev;
+ next2.e.prev = prev && prev.e;
+ }
+}
+
+function check_hash(element2, server_hash, value) {
+ var _a3, _b3;
+ if (!server_hash || server_hash === hash(String(null != value ? value : ""))) return;
+ let location;
+ const loc = null == (_a3 = element2.__svelte_meta) ? void 0 : _a3.loc;
+ if (loc) location = `near ${loc.file}:${loc.line}:${loc.column}`; else if (null == (_b3 = dev_current_component_function) ? void 0 : _b3[FILENAME]) location = `in ${dev_current_component_function[FILENAME]}`;
+ hydration_html_changed(sanitize_location(location));
+}
+
+function html(node, get_value, svg, mathml, skip_warning) {
+ var effect2, anchor = node, value = "";
+ block((() => {
+ var _a3;
+ if (value !== (value = null != (_a3 = get_value()) ? _a3 : "")) {
+ if (void 0 !== effect2) {
+ destroy_effect(effect2);
+ effect2 = void 0;
+ }
+ if ("" !== value) effect2 = branch((() => {
+ if (!hydrating) {
+ var html2 = value + "";
+ if (svg) html2 = `${html2} `; else if (mathml) html2 = `${html2} `;
+ var node2 = create_fragment_from_html(html2);
+ if (svg || mathml) node2 = get_first_child(node2);
+ assign_nodes(get_first_child(node2), node2.lastChild);
+ if (svg || mathml) for (;get_first_child(node2); ) anchor.before(get_first_child(node2)); else anchor.before(node2);
+ } else {
+ for (var hash2 = hydrate_node.data, next2 = hydrate_next(), last = next2; null !== next2 && (8 !== next2.nodeType || "" !== next2.data); ) {
+ last = next2;
+ next2 = get_next_sibling(next2);
+ }
+ if (null === next2) {
+ hydration_mismatch();
+ throw HYDRATION_ERROR;
+ }
+ if (dev_fallback_default && !skip_warning) check_hash(next2.parentNode, hash2, value);
+ assign_nodes(hydrate_node, last);
+ anchor = set_hydrate_node(next2);
+ }
+ }));
+ } else if (hydrating) hydrate_next();
+ }));
+}
+
+function snippet(node, get_snippet, ...args) {
+ var snippet_effect, anchor = node, snippet2 = noop;
+ block((() => {
+ if (snippet2 !== (snippet2 = get_snippet())) {
+ if (snippet_effect) {
+ destroy_effect(snippet_effect);
+ snippet_effect = null;
+ }
+ if (dev_fallback_default && null == snippet2) invalid_snippet();
+ snippet_effect = branch((() => snippet2(anchor, ...args)));
+ }
+ }), EFFECT_TRANSPARENT);
+ if (hydrating) anchor = hydrate_node;
+}
+
+function append_styles(anchor, css) {
+ queue_micro_task((() => {
+ var _a3, root6 = anchor.getRootNode(), target = root6.host ? root6 : null != (_a3 = root6.head) ? _a3 : root6.ownerDocument.head;
+ if (!target.querySelector("#" + css.hash)) {
+ const style = document.createElement("style");
+ style.id = css.hash;
+ style.textContent = css.code;
+ target.appendChild(style);
+ if (dev_fallback_default) register_style(css.hash, style);
+ }
+ }));
+}
+
+function r(e) {
+ var t, f, n = "";
+ if ("string" == typeof e || "number" == typeof e) n += e; else if ("object" == typeof e) if (Array.isArray(e)) {
+ var o = e.length;
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
+ return n;
+}
+
+function clsx() {
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "),
+ n += t);
+ return n;
+}
+
+function clsx2(value) {
+ if ("object" == typeof value) return clsx(value); else return null != value ? value : "";
+}
+
+var whitespace = [ ..." \t\n\r\f \v\ufeff" ];
+
+function to_class(value, hash2, directives) {
+ var classname = null == value ? "" : "" + value;
+ if (hash2) classname = classname ? classname + " " + hash2 : hash2;
+ if (directives) for (var key in directives) if (directives[key]) classname = classname ? classname + " " + key : key; else if (classname.length) for (var len = key.length, a = 0; (a = classname.indexOf(key, a)) >= 0; ) {
+ var b = a + len;
+ if ((0 === a || whitespace.includes(classname[a - 1])) && (b === classname.length || whitespace.includes(classname[b]))) classname = (0 === a ? "" : classname.substring(0, a)) + classname.substring(b + 1); else a = b;
+ }
+ return "" === classname ? null : classname;
+}
+
+function append_styles2(styles, important = false) {
+ var separator = important ? " !important;" : ";", css = "";
+ for (var key in styles) {
+ var value = styles[key];
+ if (null != value && "" !== value) css += " " + key + ": " + value + separator;
+ }
+ return css;
+}
+
+function to_css_name(name) {
+ if ("-" !== name[0] || "-" !== name[1]) return name.toLowerCase(); else return name;
+}
+
+function to_style(value, styles) {
+ if (styles) {
+ var normal_styles, important_styles, new_style = "";
+ if (Array.isArray(styles)) {
+ normal_styles = styles[0];
+ important_styles = styles[1];
+ } else normal_styles = styles;
+ if (value) {
+ value = String(value).replaceAll(/\s*\/\*.*?\*\/\s*/g, "").trim();
+ var in_str = false, in_apo = 0, in_comment = false, reserved_names = [];
+ if (normal_styles) reserved_names.push(...Object.keys(normal_styles).map(to_css_name));
+ if (important_styles) reserved_names.push(...Object.keys(important_styles).map(to_css_name));
+ var start_index = 0, name_index = -1;
+ const len = value.length;
+ for (var i = 0; i < len; i++) {
+ var c = value[i];
+ if (in_comment) {
+ if ("/" === c && "*" === value[i - 1]) in_comment = false;
+ } else if (in_str) {
+ if (in_str === c) in_str = false;
+ } else if ("/" === c && "*" === value[i + 1]) in_comment = true; else if ('"' === c || "'" === c) in_str = c; else if ("(" === c) in_apo++; else if (")" === c) in_apo--;
+ if (!in_comment && false === in_str && 0 === in_apo) if (":" === c && -1 === name_index) name_index = i; else if (";" === c || i === len - 1) {
+ if (-1 !== name_index) {
+ var name = to_css_name(value.substring(start_index, name_index).trim());
+ if (!reserved_names.includes(name)) {
+ if (";" !== c) i++;
+ new_style += " " + value.substring(start_index, i).trim() + ";";
+ }
+ }
+ start_index = i + 1;
+ name_index = -1;
+ }
+ }
+ }
+ if (normal_styles) new_style += append_styles2(normal_styles);
+ if (important_styles) new_style += append_styles2(important_styles, true);
+ return "" === (new_style = new_style.trim()) ? null : new_style;
+ }
+ return null == value ? null : String(value);
+}
+
+function set_class(dom, is_html, value, hash2, prev_classes, next_classes) {
+ var prev = dom.__className;
+ if (hydrating || prev !== value || void 0 === prev) {
+ var next_class_name = to_class(value, hash2, next_classes);
+ if (!hydrating || next_class_name !== dom.getAttribute("class")) if (null == next_class_name) dom.removeAttribute("class"); else if (is_html) dom.className = next_class_name; else dom.setAttribute("class", next_class_name);
+ dom.__className = value;
+ } else if (next_classes && prev_classes !== next_classes) for (var key in next_classes) {
+ var is_present = !!next_classes[key];
+ if (null == prev_classes || is_present !== !!prev_classes[key]) dom.classList.toggle(key, is_present);
+ }
+ return next_classes;
+}
+
+function update_styles(dom, prev = {}, next2, priority) {
+ for (var key in next2) {
+ var value = next2[key];
+ if (prev[key] !== value) if (null == next2[key]) dom.style.removeProperty(key); else dom.style.setProperty(key, value, priority);
+ }
+}
+
+function set_style(dom, value, prev_styles, next_styles) {
+ var prev = dom.__style;
+ if (hydrating || prev !== value) {
+ var next_style_attr = to_style(value, next_styles);
+ if (!hydrating || next_style_attr !== dom.getAttribute("style")) if (null == next_style_attr) dom.removeAttribute("style"); else dom.style.cssText = next_style_attr;
+ dom.__style = value;
+ } else if (next_styles) if (Array.isArray(next_styles)) {
+ update_styles(dom, null == prev_styles ? void 0 : prev_styles[0], next_styles[0]);
+ update_styles(dom, null == prev_styles ? void 0 : prev_styles[1], next_styles[1], "important");
+ } else update_styles(dom, prev_styles, next_styles);
+ return next_styles;
+}
+
+var CLASS = Symbol("class"), STYLE = Symbol("style"), IS_CUSTOM_ELEMENT = Symbol("is custom element"), IS_HTML = Symbol("is html");
+
+function remove_input_defaults(input) {
+ if (hydrating) {
+ var already_removed = false, remove_defaults = () => {
+ if (!already_removed) {
+ already_removed = true;
+ if (input.hasAttribute("value")) {
+ var value = input.value;
+ set_attribute(input, "value", null);
+ input.value = value;
+ }
+ if (input.hasAttribute("checked")) {
+ var checked = input.checked;
+ set_attribute(input, "checked", null);
+ input.checked = checked;
+ }
+ }
+ };
+ input.__on_r = remove_defaults;
+ queue_idle_task(remove_defaults);
+ add_form_reset_listener();
+ }
+}
+
+function set_attribute(element2, attribute, value, skip_warning) {
+ var attributes = get_attributes(element2);
+ if (hydrating) {
+ attributes[attribute] = element2.getAttribute(attribute);
+ if ("src" === attribute || "srcset" === attribute || "href" === attribute && "LINK" === element2.nodeName) {
+ if (!skip_warning) check_src_in_dev_hydration(element2, attribute, null != value ? value : "");
+ return;
+ }
+ }
+ if (attributes[attribute] !== (attributes[attribute] = value)) {
+ if ("loading" === attribute) element2[LOADING_ATTR_SYMBOL] = value;
+ if (null == value) element2.removeAttribute(attribute); else if ("string" != typeof value && get_setters(element2).includes(attribute)) element2[attribute] = value; else element2.setAttribute(attribute, value);
+ }
+}
+
+function get_attributes(element2) {
+ var _a3;
+ return null != (_a3 = element2.__attributes) ? _a3 : element2.__attributes = {
+ [IS_CUSTOM_ELEMENT]: element2.nodeName.includes("-"),
+ [IS_HTML]: element2.namespaceURI === NAMESPACE_HTML
+ };
+}
+
+var setters_cache = new Map;
+
+function get_setters(element2) {
+ var descriptors, setters = setters_cache.get(element2.nodeName);
+ if (setters) return setters;
+ setters_cache.set(element2.nodeName, setters = []);
+ for (var proto = element2, element_proto = Element.prototype; element_proto !== proto; ) {
+ descriptors = get_descriptors(proto);
+ for (var key in descriptors) if (descriptors[key].set) setters.push(key);
+ proto = get_prototype_of(proto);
+ }
+ return setters;
+}
+
+function check_src_in_dev_hydration(element2, attribute, value) {
+ var _a3;
+ if (dev_fallback_default) if ("srcset" !== attribute || !srcset_url_equal(element2, value)) if (!src_url_equal(null != (_a3 = element2.getAttribute(attribute)) ? _a3 : "", value)) hydration_attribute_changed(attribute, element2.outerHTML.replace(element2.innerHTML, element2.innerHTML && "..."), String(value));
+}
+
+function src_url_equal(element_src, url) {
+ if (element_src === url) return true; else return new URL(element_src, document.baseURI).href === new URL(url, document.baseURI).href;
+}
+
+function split_srcset(srcset) {
+ return srcset.split(",").map((src => src.trim().split(" ").filter(Boolean)));
+}
+
+function srcset_url_equal(element2, srcset) {
+ var element_urls = split_srcset(element2.srcset), urls = split_srcset(srcset);
+ return urls.length === element_urls.length && urls.every((([url, width], i) => width === element_urls[i][1] && (src_url_equal(element_urls[i][0], url) || src_url_equal(url, element_urls[i][0]))));
+}
+
+function bind_value(input, get3, set2 = get3) {
+ var runes = is_runes();
+ listen_to_event_and_reset_event(input, "input", (is_reset => {
+ if (dev_fallback_default && "checkbox" === input.type) bind_invalid_checkbox_value();
+ var value = is_reset ? input.defaultValue : input.value;
+ value = is_numberlike_input(input) ? to_number(value) : value;
+ set2(value);
+ if (runes && value !== (value = get3())) {
+ var start = input.selectionStart, end = input.selectionEnd;
+ input.value = null != value ? value : "";
+ if (null !== end) {
+ input.selectionStart = start;
+ input.selectionEnd = Math.min(end, input.value.length);
+ }
+ }
+ }));
+ if (hydrating && input.defaultValue !== input.value || null == untrack(get3) && input.value) set2(is_numberlike_input(input) ? to_number(input.value) : input.value);
+ render_effect((() => {
+ if (dev_fallback_default && "checkbox" === input.type) bind_invalid_checkbox_value();
+ var value = get3();
+ if (!is_numberlike_input(input) || value !== to_number(input.value)) if ("date" !== input.type || value || input.value) if (value !== input.value) input.value = null != value ? value : "";
+ }));
+}
+
+function is_numberlike_input(input) {
+ var type = input.type;
+ return "number" === type || "range" === type;
+}
+
+function to_number(value) {
+ return "" === value ? null : +value;
+}
+
+function is_bound_this(bound_value, element_or_component) {
+ return bound_value === element_or_component || (null == bound_value ? void 0 : bound_value[STATE_SYMBOL]) === element_or_component;
+}
+
+function bind_this(element_or_component = {}, update2, get_value, get_parts) {
+ effect((() => {
+ var old_parts, parts;
+ render_effect((() => {
+ old_parts = parts;
+ parts = (null == get_parts ? void 0 : get_parts()) || [];
+ untrack((() => {
+ if (element_or_component !== get_value(...parts)) {
+ update2(element_or_component, ...parts);
+ if (old_parts && is_bound_this(get_value(...old_parts), element_or_component)) update2(null, ...old_parts);
+ }
+ }));
+ }));
+ return () => {
+ queue_micro_task((() => {
+ if (parts && is_bound_this(get_value(...parts), element_or_component)) update2(null, ...parts);
+ }));
+ };
+ }));
+ return element_or_component;
+}
+
+var _events, _instance, is_store_binding = false, IS_UNMOUNTED = Symbol();
+
+function store_get(store, store_name, stores) {
+ var _a3;
+ const entry = null != (_a3 = stores[store_name]) ? _a3 : stores[store_name] = {
+ store: null,
+ source: mutable_source(void 0),
+ unsubscribe: noop
+ };
+ if (entry.store !== store && !(IS_UNMOUNTED in stores)) {
+ entry.unsubscribe();
+ entry.store = null != store ? store : null;
+ if (null == store) {
+ entry.source.v = void 0;
+ entry.unsubscribe = noop;
+ } else {
+ var is_synchronous_callback = true;
+ entry.unsubscribe = subscribe_to_store(store, (v => {
+ if (is_synchronous_callback) entry.source.v = v; else set(entry.source, v);
+ }));
+ is_synchronous_callback = false;
+ }
+ }
+ if (store && IS_UNMOUNTED in stores) return get2(store); else return get(entry.source);
+}
+
+function store_set(store, value) {
+ store.set(value);
+ return value;
+}
+
+function setup_stores() {
+ const stores = {};
+ return [ stores, function cleanup() {
+ teardown((() => {
+ for (var store_name in stores) stores[store_name].unsubscribe();
+ define_property(stores, IS_UNMOUNTED, {
+ enumerable: false,
+ value: true
+ });
+ }));
+ } ];
+}
+
+function capture_store_binding(fn) {
+ var previous_is_store_binding = is_store_binding;
+ try {
+ is_store_binding = false;
+ return [ fn(), is_store_binding ];
+ } finally {
+ is_store_binding = previous_is_store_binding;
+ }
+}
+
+function has_destroyed_component_ctx(current_value) {
+ var _a3, _b3;
+ return null != (_b3 = null == (_a3 = current_value.ctx) ? void 0 : _a3.d) ? _b3 : false;
+}
+
+function prop(props, key, flags, fallback2) {
+ var _a3, _b3, prop_value, immutable = !!(flags & PROPS_IS_IMMUTABLE), runes = !legacy_mode_flag || !!(flags & PROPS_IS_RUNES), bindable = !!(flags & PROPS_IS_BINDABLE), lazy = !!(flags & PROPS_IS_LAZY_INITIAL), is_store_sub = false;
+ if (bindable) [prop_value, is_store_sub] = capture_store_binding((() => props[key])); else prop_value = props[key];
+ var getter, is_entry_props = STATE_SYMBOL in props || LEGACY_PROPS in props, setter = bindable && (null != (_b3 = null == (_a3 = get_descriptor(props, key)) ? void 0 : _a3.set) ? _b3 : is_entry_props && key in props && (v => props[key] = v)) || void 0, fallback_value = fallback2, fallback_dirty = true, fallback_used = false, get_fallback = () => {
+ fallback_used = true;
+ if (fallback_dirty) {
+ fallback_dirty = false;
+ if (lazy) fallback_value = untrack(fallback2); else fallback_value = fallback2;
+ }
+ return fallback_value;
+ };
+ if (void 0 === prop_value && void 0 !== fallback2) {
+ if (setter && runes) props_invalid_value(key);
+ prop_value = get_fallback();
+ if (setter) setter(prop_value);
+ }
+ if (runes) getter = () => {
+ var value = props[key];
+ if (void 0 === value) return get_fallback();
+ fallback_dirty = true;
+ fallback_used = false;
+ return value;
+ }; else {
+ var derived_getter = (immutable ? derived : derived_safe_equal)((() => props[key]));
+ derived_getter.f |= LEGACY_DERIVED_PROP;
+ getter = () => {
+ var value = get(derived_getter);
+ if (void 0 !== value) fallback_value = void 0;
+ return void 0 === value ? fallback_value : value;
+ };
+ }
+ if (!(flags & PROPS_IS_UPDATED)) return getter;
+ if (setter) {
+ var legacy_parent = props.$$legacy;
+ return function(value, mutation) {
+ if (arguments.length > 0) {
+ if (!runes || !mutation || legacy_parent || is_store_sub) setter(mutation ? getter() : value);
+ return value;
+ } else return getter();
+ };
+ }
+ var from_child = false, was_from_child = false, inner_current_value = mutable_source(prop_value), current_value = derived((() => {
+ var parent_value = getter(), child_value = get(inner_current_value);
+ if (from_child) {
+ from_child = false;
+ was_from_child = true;
+ return child_value;
+ }
+ was_from_child = false;
+ return inner_current_value.v = parent_value;
+ }));
+ if (bindable) get(current_value);
+ if (!immutable) current_value.equals = safe_equals;
+ return function(value, mutation) {
+ if (null !== captured_signals) {
+ from_child = was_from_child;
+ getter();
+ get(inner_current_value);
+ }
+ if (arguments.length > 0) {
+ const new_value = mutation ? get(current_value) : runes && bindable ? proxy(value) : value;
+ if (!current_value.equals(new_value)) {
+ from_child = true;
+ set(inner_current_value, new_value);
+ if (fallback_used && void 0 !== fallback_value) fallback_value = new_value;
+ if (has_destroyed_component_ctx(current_value)) return value;
+ untrack((() => get(current_value)));
+ }
+ return value;
+ }
+ if (has_destroyed_component_ctx(current_value)) return current_value.v; else return get(current_value);
+ };
+}
+
+function createClassComponent(options) {
+ return new Svelte4Component(options);
+}
+
+var SvelteElement, Svelte4Component = class {
+ constructor(options) {
+ __privateAdd(this, _events);
+ __privateAdd(this, _instance);
+ var _a3, _b3, sources = new Map, add_source = (key, value) => {
+ var s = mutable_source(value);
+ sources.set(key, s);
+ return s;
+ };
+ const props = new Proxy({
+ ...options.props || {},
+ $$events: {}
+ }, {
+ get(target, prop2) {
+ var _a4;
+ return get(null != (_a4 = sources.get(prop2)) ? _a4 : add_source(prop2, Reflect.get(target, prop2)));
+ },
+ has(target, prop2) {
+ var _a4;
+ if (prop2 === LEGACY_PROPS) return true;
+ get(null != (_a4 = sources.get(prop2)) ? _a4 : add_source(prop2, Reflect.get(target, prop2)));
+ return Reflect.has(target, prop2);
+ },
+ set(target, prop2, value) {
+ var _a4;
+ set(null != (_a4 = sources.get(prop2)) ? _a4 : add_source(prop2, value), value);
+ return Reflect.set(target, prop2, value);
+ }
+ });
+ __privateSet(this, _instance, (options.hydrate ? hydrate : mount)(options.component, {
+ target: options.target,
+ anchor: options.anchor,
+ props,
+ context: options.context,
+ intro: null != (_a3 = options.intro) ? _a3 : false,
+ recover: options.recover
+ }));
+ if (!(null == (_b3 = null == options ? void 0 : options.props) ? void 0 : _b3.$$host) || false === options.sync) flushSync();
+ __privateSet(this, _events, props.$$events);
+ for (const key of Object.keys(__privateGet(this, _instance))) if ("$set" !== key && "$destroy" !== key && "$on" !== key) define_property(this, key, {
+ get() {
+ return __privateGet(this, _instance)[key];
+ },
+ set(value) {
+ __privateGet(this, _instance)[key] = value;
+ },
+ enumerable: true
+ });
+ __privateGet(this, _instance).$set = next2 => {
+ Object.assign(props, next2);
+ };
+ __privateGet(this, _instance).$destroy = () => {
+ unmount(__privateGet(this, _instance));
+ };
+ }
+ $set(props) {
+ __privateGet(this, _instance).$set(props);
+ }
+ $on(event2, callback) {
+ __privateGet(this, _events)[event2] = __privateGet(this, _events)[event2] || [];
+ const cb = (...args) => callback.call(this, ...args);
+ __privateGet(this, _events)[event2].push(cb);
+ return () => {
+ __privateGet(this, _events)[event2] = __privateGet(this, _events)[event2].filter((fn => fn !== cb));
+ };
+ }
+ $destroy() {
+ __privateGet(this, _instance).$destroy();
+ }
+};
+
+_events = new WeakMap;
+
+_instance = new WeakMap;
+
+if ("function" == typeof HTMLElement) SvelteElement = class extends HTMLElement {
+ constructor($$componentCtor, $$slots, use_shadow_dom) {
+ super();
+ __publicField(this, "$$ctor");
+ __publicField(this, "$$s");
+ __publicField(this, "$$c");
+ __publicField(this, "$$cn", false);
+ __publicField(this, "$$d", {});
+ __publicField(this, "$$r", false);
+ __publicField(this, "$$p_d", {});
+ __publicField(this, "$$l", {});
+ __publicField(this, "$$l_u", new Map);
+ __publicField(this, "$$me");
+ this.$$ctor = $$componentCtor;
+ this.$$s = $$slots;
+ if (use_shadow_dom) this.attachShadow({
+ mode: "open"
+ });
+ }
+ addEventListener(type, listener, options) {
+ this.$$l[type] = this.$$l[type] || [];
+ this.$$l[type].push(listener);
+ if (this.$$c) {
+ const unsub = this.$$c.$on(type, listener);
+ this.$$l_u.set(listener, unsub);
+ }
+ super.addEventListener(type, listener, options);
+ }
+ removeEventListener(type, listener, options) {
+ super.removeEventListener(type, listener, options);
+ if (this.$$c) {
+ const unsub = this.$$l_u.get(listener);
+ if (unsub) {
+ unsub();
+ this.$$l_u.delete(listener);
+ }
+ }
+ }
+ async connectedCallback() {
+ this.$$cn = true;
+ if (!this.$$c) {
+ let create_slot = function(name) {
+ return anchor => {
+ const slot2 = document.createElement("slot");
+ if ("default" !== name) slot2.name = name;
+ append(anchor, slot2);
+ };
+ };
+ await Promise.resolve();
+ if (!this.$$cn || this.$$c) return;
+ const $$slots = {}, existing_slots = get_custom_elements_slots(this);
+ for (const name of this.$$s) if (name in existing_slots) if ("default" === name && !this.$$d.children) {
+ this.$$d.children = create_slot(name);
+ $$slots.default = true;
+ } else $$slots[name] = create_slot(name);
+ for (const attribute of this.attributes) {
+ const name = this.$$g_p(attribute.name);
+ if (!(name in this.$$d)) this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp");
+ }
+ for (const key in this.$$p_d) if (!(key in this.$$d) && void 0 !== this[key]) {
+ this.$$d[key] = this[key];
+ delete this[key];
+ }
+ this.$$c = createClassComponent({
+ component: this.$$ctor,
+ target: this.shadowRoot || this,
+ props: {
+ ...this.$$d,
+ $$slots,
+ $$host: this
+ }
+ });
+ this.$$me = effect_root((() => {
+ render_effect((() => {
+ var _a3;
+ this.$$r = true;
+ for (const key of object_keys(this.$$c)) {
+ if (!(null == (_a3 = this.$$p_d[key]) ? void 0 : _a3.reflect)) continue;
+ this.$$d[key] = this.$$c[key];
+ const attribute_value = get_custom_element_value(key, this.$$d[key], this.$$p_d, "toAttribute");
+ if (null == attribute_value) this.removeAttribute(this.$$p_d[key].attribute || key); else this.setAttribute(this.$$p_d[key].attribute || key, attribute_value);
+ }
+ this.$$r = false;
+ }));
+ }));
+ for (const type in this.$$l) for (const listener of this.$$l[type]) {
+ const unsub = this.$$c.$on(type, listener);
+ this.$$l_u.set(listener, unsub);
+ }
+ this.$$l = {};
+ }
+ }
+ attributeChangedCallback(attr2, _oldValue, newValue) {
+ var _a3;
+ if (!this.$$r) {
+ attr2 = this.$$g_p(attr2);
+ this.$$d[attr2] = get_custom_element_value(attr2, newValue, this.$$p_d, "toProp");
+ null == (_a3 = this.$$c) || _a3.$set({
+ [attr2]: this.$$d[attr2]
+ });
+ }
+ }
+ disconnectedCallback() {
+ this.$$cn = false;
+ Promise.resolve().then((() => {
+ if (!this.$$cn && this.$$c) {
+ this.$$c.$destroy();
+ this.$$me();
+ this.$$c = void 0;
+ }
+ }));
+ }
+ $$g_p(attribute_name) {
+ return object_keys(this.$$p_d).find((key => this.$$p_d[key].attribute === attribute_name || !this.$$p_d[key].attribute && key.toLowerCase() === attribute_name)) || attribute_name;
+ }
+};
+
+function get_custom_element_value(prop2, value, props_definition, transform) {
+ var _a3;
+ const type = null == (_a3 = props_definition[prop2]) ? void 0 : _a3.type;
+ value = "Boolean" === type && "boolean" != typeof value ? null != value : value;
+ if (!transform || !props_definition[prop2]) return value; else if ("toAttribute" === transform) switch (type) {
+ case "Object":
+ case "Array":
+ return null == value ? null : JSON.stringify(value);
+
+ case "Boolean":
+ return value ? "" : null;
+
+ case "Number":
+ return null == value ? null : value;
+
+ default:
+ return value;
+ } else switch (type) {
+ case "Object":
+ case "Array":
+ return value && JSON.parse(value);
+
+ case "Boolean":
+ return value;
+
+ case "Number":
+ return null != value ? +value : value;
+
+ default:
+ return value;
+ }
+}
+
+function get_custom_elements_slots(element2) {
+ const result = {};
+ element2.childNodes.forEach((node => {
+ result[node.slot || "default"] = true;
+ }));
+ return result;
+}
+
+if (dev_fallback_default) {
+ let throw_rune_error = function(rune) {
+ if (!(rune in globalThis)) {
+ let value;
+ Object.defineProperty(globalThis, rune, {
+ configurable: true,
+ get: () => {
+ if (void 0 !== value) return value;
+ rune_outside_svelte(rune);
+ },
+ set: v => {
+ value = v;
+ }
+ });
+ }
+ };
+ throw_rune_error("$state");
+ throw_rune_error("$effect");
+ throw_rune_error("$derived");
+ throw_rune_error("$inspect");
+ throw_rune_error("$props");
+ throw_rune_error("$bindable");
+}
+
+function onMount(fn) {
+ if (null === component_context) lifecycle_outside_component("onMount");
+ if (legacy_mode_flag && null !== component_context.l) init_update_callbacks(component_context).m.push(fn); else user_effect((() => {
+ const cleanup = untrack(fn);
+ if ("function" == typeof cleanup) return cleanup;
+ }));
+}
+
+function onDestroy(fn) {
+ if (null === component_context) lifecycle_outside_component("onDestroy");
+ onMount((() => () => untrack(fn)));
+}
+
+function init_update_callbacks(context) {
+ var _a3, l = context.l;
+ return null != (_a3 = l.u) ? _a3 : l.u = {
+ a: [],
+ b: [],
+ m: []
+ };
+}
+
+function subscribe_to_store(store, run2, invalidate) {
+ if (null == store) {
+ run2(void 0);
+ if (invalidate) invalidate(void 0);
+ return noop;
+ }
+ const unsub = untrack((() => store.subscribe(run2, invalidate)));
+ return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
+}
+
+var subscriber_queue = [];
+
+function writable(value, start = noop) {
+ let stop = null;
+ const subscribers = new Set;
+ function set2(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) {
+ set2(fn(value));
+ }
+ return {
+ set: set2,
+ update: update2,
+ subscribe: function subscribe(run2, invalidate = noop) {
+ const subscriber = [ run2, invalidate ];
+ subscribers.add(subscriber);
+ if (1 === subscribers.size) stop = start(set2, update2) || noop;
+ run2(value);
+ return () => {
+ subscribers.delete(subscriber);
+ if (0 === subscribers.size && stop) {
+ stop();
+ stop = null;
+ }
+ };
+ }
+ };
+}
+
+function get2(store) {
+ let value;
+ subscribe_to_store(store, (_ => value = _))();
+ return value;
+}
+
+var currentFile = writable(""), maxDepth = writable(0), searchString = writable(""), tagInfo = writable({}), tagFolderSetting = writable(DEFAULT_SETTINGS), selectedTags = writable(), allViewItems = writable(), allViewItemsByLink = writable(), appliedFiles = writable(), v2expandedTags = writable(new Set), performHide = writable(0), pluginInstance = writable(void 0);
+
+function unique(items) {
+ return [ ...new Set([ ...items ]) ];
+}
+
+function trimSlash(src, keepStart = false, keepEnd = false) {
+ const st = keepStart ? 0 : "/" == src[0] ? 1 : 0, end = keepEnd ? void 0 : src.endsWith("/") ? -1 : void 0;
+ if (0 == st && null == end) return src; else return src.slice(st, end);
+}
+
+function trimPrefix(source2, prefix) {
+ if (source2.startsWith(prefix)) return source2.substring(prefix.length); else return source2;
+}
+
+function ancestorToTags(ancestors) {
+ return [ ...ancestors ].reduce(((p, i) => "/" != i[0] ? [ ...p, i ] : [ ...p, p.pop() + "/" + i.substring(1) ]), []);
+}
+
+function ancestorToLongestTag(ancestors) {
+ return ancestors.reduceRight(((a, e) => {
+ var _a3;
+ return !a ? [ e ] : (null == (_a3 = a[0]) ? void 0 : _a3.startsWith(e)) ? a : [ e, ...a ];
+ }), []);
+}
+
+function isSpecialTag(tagSrc) {
+ const tag = trimSlash(tagSrc);
+ return "_untagged" == tag || tag in tagDispDict;
+}
+
+var tagDispAlternativeDict = {};
+
+tagInfo.subscribe((tagInfo2 => {
+ tagDispAlternativeDict = {
+ ...tagDispDict
+ };
+ if (null == tagInfo2) return;
+ const items = Object.entries(tagInfo2);
+ for (const [key, info] of items) if (null == info ? void 0 : info.alt) tagDispAlternativeDict[key] = info.alt;
+}));
+
+function renderSpecialTag(tagSrc) {
+ const tag = trimSlash(tagSrc);
+ return tag in tagDispAlternativeDict ? tagDispAlternativeDict[tag] : tagSrc;
+}
+
+function secondsToFreshness(totalAsMSec) {
+ const totalAsSec = ~~(totalAsMSec / 1e3), totalSec = ~~(totalAsSec * (totalAsSec / Math.abs(totalAsSec)));
+ if (totalSec < EPOCH_HOUR) return FRESHNESS_1;
+ if (totalSec < 6 * EPOCH_HOUR) return FRESHNESS_2;
+ if (totalSec < 3 * EPOCH_DAY) return FRESHNESS_3;
+ if (totalSec < 7 * EPOCH_DAY) return FRESHNESS_4; else return FRESHNESS_5;
+}
+
+var queues = [];
+
+function waitForRequestAnimationFrame() {
+ return new Promise((res => requestAnimationFrame((() => res()))));
+}
+
+function delay(num) {
+ return new Promise((res => setTimeout((() => res()), num || 5)));
+}
+
+function nextTick() {
+ return new Promise((res => setTimeout((() => res()), 0)));
+}
+
+var waits = [ nextTick, delay, nextTick, delay, delay, nextTick ], waitIdx = 0, pumping = false, startContinuousProcessing = Date.now();
+
+async function pump() {
+ if (!pumping) try {
+ pumping = true;
+ for (;;) {
+ const proc = queues.shift();
+ if (proc) {
+ proc();
+ if (Date.now() - startContinuousProcessing > 120) {
+ const w = waits[waitIdx];
+ waitIdx = (waitIdx + 1) % waits.length;
+ await w();
+ startContinuousProcessing = Date.now();
+ }
+ } else break;
+ }
+ } finally {
+ pumping = false;
+ }
+}
+
+var doEvents = () => new Promise((res => {
+ queues.push((() => {
+ res();
+ }));
+ pump();
+}));
+
+function compare(x, y) {
+ return `${x || ""}`.localeCompare(y, void 0, {
+ numeric: true
+ });
+}
+
+function getTagName(tagName, subtreePrefix, tagInfo2, invert) {
+ if (null == tagInfo2) return tagName;
+ const prefix = -1 == invert ? "" : "", unpinned = 1 == invert ? "" : "";
+ if (tagName in tagInfo2 && tagInfo2[tagName]) if ("key" in tagInfo2[tagName]) return `${prefix}_${subtreePrefix}_-${tagInfo2[tagName].key}__${tagName}`;
+ return `${prefix}_${subtreePrefix}_${unpinned}_${tagName}`;
+}
+
+function removeIntermediatePath(paths) {
+ const passed = [];
+ for (const v of paths) {
+ const last = passed.pop();
+ if (void 0 !== last) if (!(trimTrailingSlash(v.toLowerCase()) + "/").startsWith(trimTrailingSlash(last.toLowerCase()) + "/")) passed.push(last);
+ passed.push(v);
+ }
+ return passed.reverse();
+}
+
+function getTagMark(tagInfo2) {
+ if (!tagInfo2) return "";
+ if ("key" in tagInfo2) if ("mark" in tagInfo2 && "" != tagInfo2.mark) return tagInfo2.mark; else return "📌"; else if ("mark" in tagInfo2 && "" != tagInfo2.mark) return tagInfo2.mark; else return "";
+}
+
+function escapeStringToHTML(str) {
+ if (!str) return ""; else return str.replace(/[<>&"'`]/g, (match => ({
+ "<": "<",
+ ">": ">",
+ "&": "&",
+ '"': """,
+ "'": "'",
+ "`": "`"
+ }[match])));
+}
+
+var V2FI_IDX_TAG = 0, V2FI_IDX_TAGNAME = 1, V2FI_IDX_TAGDISP = 2, V2FI_IDX_CHILDREN = 3;
+
+function selectCompareMethodTags(settings, tagInfo2) {
+ const _tagInfo = tagInfo2, invert = settings.sortTypeTag.contains("_DESC") ? -1 : 1, subTreeChar = {
+ [-1]: "",
+ [1]: "_"
+ }, sortByName = (a, b) => {
+ const isASubTree = "" == a[V2FI_IDX_TAGDISP][0], isBSubTree = "" == b[V2FI_IDX_TAGDISP][0], aName = a[V2FI_IDX_TAGNAME], bName = b[V2FI_IDX_TAGNAME], aPrefix = isASubTree ? subTreeChar[invert] : "", bPrefix = isBSubTree ? subTreeChar[invert] : "";
+ return compare(getTagName(aName, aPrefix, settings.useTagInfo ? _tagInfo : void 0, invert), getTagName(bName, bPrefix, settings.useTagInfo ? _tagInfo : void 0, invert)) * invert;
+ };
+ switch (settings.sortTypeTag) {
+ case "ITEMS_ASC":
+ case "ITEMS_DESC":
+ return (a, b) => {
+ const aName = a[V2FI_IDX_TAGNAME], bName = b[V2FI_IDX_TAGNAME], aCount = a[V2FI_IDX_CHILDREN].length - (settings.useTagInfo && aName in _tagInfo && "key" in _tagInfo[aName] ? 1e5 * invert : 0), bCount = b[V2FI_IDX_CHILDREN].length - (settings.useTagInfo && bName in _tagInfo && "key" in _tagInfo[bName] ? 1e5 * invert : 0);
+ if (aCount == bCount) return sortByName(a, b); else return (aCount - bCount) * invert;
+ };
+
+ case "NAME_ASC":
+ case "NAME_DESC":
+ return sortByName;
+
+ default:
+ console.warn("Compare method (tags) corrupted");
+ return (a, b) => {
+ const isASubTree = "" == a[V2FI_IDX_TAGDISP][0], isBSubTree = "" == b[V2FI_IDX_TAGDISP][0], aName = a[V2FI_IDX_TAGNAME], bName = b[V2FI_IDX_TAGNAME];
+ return compare((isASubTree ? subTreeChar[invert] : "") + aName, (isBSubTree ? subTreeChar[invert] : "") + bName) * invert;
+ };
+ }
+}
+
+function uniqueCaseIntensive(pieces) {
+ const delMap = new Set, ret = [];
+ for (const piece of pieces) if (!delMap.has(piece.toLowerCase())) {
+ ret.push(piece);
+ delMap.add(piece.toLowerCase());
+ }
+ return ret;
+}
+
+function _sorterTagLength(a, b, invert) {
+ const diff = a.split("/").length - b.split("/").length;
+ if (0 != diff) return diff * (invert ? -1 : 1); else return (a.length - b.length) * (invert ? -1 : 1);
+}
+
+function getExtraTags(tags, trail, reduceNestedParent) {
+ let tagsLeft = uniqueCaseIntensive(tags), removeTrailItems = [];
+ if (reduceNestedParent) removeTrailItems = trail.sort(((a, b) => _sorterTagLength(a, b, true))); else removeTrailItems = removeIntermediatePath(trail);
+ for (const t of removeTrailItems) {
+ const trimLength = t.endsWith("/") ? t.length : t.length;
+ if (reduceNestedParent) tagsLeft = tagsLeft.map((e => (e + "/").toLowerCase().startsWith(t.toLowerCase()) ? e.substring(trimLength) : e)); else {
+ const f = tagsLeft.findIndex((e => (e + "/").toLowerCase().startsWith(t.toLowerCase())));
+ if (-1 !== f) tagsLeft[f] = tagsLeft[f].substring(trimLength);
+ }
+ }
+ return tagsLeft.filter((e => "" != e.trim()));
+}
+
+function trimTrailingSlash(src) {
+ return trimSlash(src, true, false);
+}
+
+function joinPartialPath(path) {
+ return path.reduce(((p, c) => c.endsWith("/") && p.length > 0 ? [ c + p[0], ...p.slice(1) ] : [ c, ...p ]), []);
+}
+
+function pathMatch(haystackLC, needleLC) {
+ if (haystackLC == needleLC) return true;
+ if ("/" == needleLC[needleLC.length - 1]) if (0 === (haystackLC + "/").indexOf(needleLC)) return true;
+ return false;
+}
+
+function parseTagName(thisName, _tagInfo) {
+ let tagNameDisp = [ "" ];
+ const names = thisName.split("/").filter((e => "" != e.trim()));
+ let inSubTree = false, tagName = "";
+ if (names.length > 1) {
+ tagName = `${names[names.length - 1]}`;
+ inSubTree = true;
+ } else tagName = thisName;
+ if (tagName.endsWith("/")) tagName = tagName.substring(0, tagName.length - 1);
+ const tagMark = getTagMark(tagName in _tagInfo ? _tagInfo[tagName] : void 0);
+ tagNameDisp = [ `${tagMark}${renderSpecialTag(tagName)}` ];
+ if (inSubTree) tagNameDisp = [ `${tagMark}`, `${renderSpecialTag(tagName)}` ];
+ return [ tagName, tagNameDisp ];
+}
+
+function parseAllForwardReference(metaCache, filename, passed) {
+ var _a3;
+ return unique(Object.keys(null != (_a3 = null == metaCache ? void 0 : metaCache[filename]) ? _a3 : {}).filter((e => !passed.contains(e))));
+}
+
+function parseAllReverseReference(metaCache, filename, passed) {
+ return unique(Object.entries(metaCache).filter((([, links]) => filename in links)).map((([name]) => name)).filter((e => !passed.contains(e))));
+}
+
+function parseAllReference(metaCache, filename, conf) {
+ var _a3, _b3;
+ let linked = [ ...!(null == (_a3 = null == conf ? void 0 : conf.outgoing) ? void 0 : _a3.enabled) ? [] : parseAllForwardReference(metaCache, filename, []), ...!(null == (_b3 = null == conf ? void 0 : conf.incoming) ? void 0 : _b3.enabled) ? [] : parseAllReverseReference(metaCache, filename, []) ];
+ if (0 != linked.length) linked = unique([ filename, ...linked ]);
+ return linked;
+}
+
+function fileCacheToCompare(cache) {
+ if (!cache) return ""; else return {
+ l: cache.links,
+ t: cache.tags
+ };
+}
+
+var allViewItemsMap = new Map;
+
+allViewItemsByLink.subscribe((e => {
+ updateItemsLinkMap(e);
+}));
+
+function updateItemsLinkMap(e) {
+ allViewItemsMap.clear();
+ if (e) e.forEach((item => allViewItemsMap.set(item.path, item)));
+}
+
+function getViewItemFromPath(path) {
+ return allViewItemsMap.get(path);
+}
+
+function getAllLinksRecursive(item, trail) {
+ const leftLinks = item.links.filter((e => !trail.contains(e))), allChildLinks = leftLinks.flatMap((itemName => {
+ const item2 = getViewItemFromPath(itemName);
+ if (!item2) return []; else return getAllLinksRecursive(item2, [ ...trail, itemName ]);
+ }));
+ return unique([ ...leftLinks, ...allChildLinks ]);
+}
+
+var waitingProcess = new Map, runningProcess = new Set;
+
+async function scheduleOnceIfDuplicated(key, proc) {
+ if (!runningProcess.has(key)) try {
+ runningProcess.add(key);
+ await delay(3);
+ if (waitingProcess.has(key)) {
+ const nextProc = waitingProcess.get(key);
+ waitingProcess.delete(key);
+ runningProcess.delete(key);
+ return scheduleOnceIfDuplicated(key, nextProc);
+ } else await proc();
+ } finally {
+ runningProcess.delete(key);
+ } else waitingProcess.set(key, proc);
+}
+
+function isSameAny(a, b) {
+ if (typeof a != typeof b) return false;
+ switch (typeof a) {
+ case "string":
+ case "number":
+ case "bigint":
+ case "boolean":
+ case "symbol":
+ case "function":
+ case "undefined":
+ return a == b;
+
+ case "object":
+ if (a === b) return true;
+ if (a instanceof Map || a instanceof Set) {
+ if (a.size != b.size) return false;
+ const v = [ ...a ], w = [ ...b ];
+ for (let i = 0; i < v.length; i++) if (v[i] != w[i]) return false;
+ return true;
+ }
+ if (Array.isArray(a)) {
+ for (let i = 0; i < a.length; i++) if (!isSameAny(a[i], b[i])) return false;
+ return true;
+ }
+ {
+ const x = Object.values(a), y = Object.values(b);
+ if (x.length != y.length) return false;
+ for (let i = 0; i < x.length; i++) if (!isSameAny(x[i], y[i])) return false;
+ return true;
+ }
+
+ default:
+ return false;
+ }
+}
+
+var _a2, _b2, _c, import_obsidian2 = require("obsidian"), PUBLIC_VERSION = "5";
+
+if ("undefined" != typeof window) (null != (_c = (_b2 = null != (_a2 = window.__svelte) ? _a2 : window.__svelte = {}).v) ? _c : _b2.v = new Set).add(PUBLIC_VERSION);
+
+var import_obsidian = require("obsidian"), root = template('
'), $$css = {
+ hash: "svelte-1qfikme",
+ code: ".markdownBody.svelte-1qfikme {user-select:text;-webkit-user-select:text;}"
+};
+
+function ScrollViewMarkdownComponent($$anchor, $$props) {
+ push($$props, true);
+ append_styles($$anchor, $$css);
+ let file = prop($$props, "file", 19, (() => ({
+ path: ""
+ }))), el = state(void 0), renderedContent = state("");
+ function onAppearing(_) {
+ if (file().content && get(el) && get(renderedContent) != file().content) {
+ import_obsidian.MarkdownRenderer.render($$props.plugin.app, file().content, get(el), file().path, $$props.plugin);
+ set(renderedContent, file().content, true);
+ }
+ }
+ onMount((() => {
+ if (get(el) && $$props.observer) {
+ $$props.observer.observe(get(el));
+ get(el).addEventListener("appearing", onAppearing);
+ }
+ }));
+ onDestroy((() => {
+ if (get(el) && $$props.observer) {
+ $$props.observer.unobserve(get(el));
+ get(el).removeEventListener("appearing", onAppearing);
+ }
+ }));
+ user_effect((() => {
+ if (get(renderedContent) && file() && file().content && get(el) && get(renderedContent) != file().content) {
+ get(el).style.minHeight = `${get(el).clientHeight}px`;
+ get(el).innerHTML = "";
+ import_obsidian.MarkdownRenderer.render($$props.plugin.app, file().content, get(el), file().path, $$props.plugin);
+ set(renderedContent, file().content, true);
+ get(el).style.minHeight = "20px";
+ }
+ }));
+ var div = root();
+ bind_this(div, ($$value => set(el, $$value)), (() => get(el)));
+ append($$anchor, div);
+ pop();
+}
+
+var on_click = (evt, handleOpenFile, file) => handleOpenFile(evt, get(file)), root_1 = template('
'), root2 = template('
'), $$css2 = {
+ hash: "svelte-s1mg0b",
+ code: ".header.svelte-s1mg0b {background-color:var(--background-secondary-alt);position:sticky;top:0;color:var(--text-normal);margin-bottom:8px;}.file.svelte-s1mg0b {cursor:pointer;}.path.svelte-s1mg0b {font-size:75%;}hr.svelte-s1mg0b {margin:8px auto;}"
+};
+
+function ScrollViewComponent($$anchor, $$props) {
+ push($$props, true);
+ append_styles($$anchor, $$css2);
+ const [$$stores, $$cleanup] = setup_stores();
+ let store = prop($$props, "store", 19, (() => writable({
+ files: [],
+ title: "",
+ tagPath: ""
+ })));
+ const _state = user_derived((() => store_get(store(), "$store", $$stores)));
+ let files = user_derived((() => get(_state).files));
+ const tagPath = user_derived((() => get(_state).tagPath.split(", ").map((e => "#" + trimTrailingSlash(e).split("/").map((e2 => renderSpecialTag(e2.trim()))).join("/"))).join(", ")));
+ function handleOpenFile(e, file) {
+ $$props.openfile(file.path, false);
+ e.preventDefault();
+ }
+ let scrollEl = state(void 0), observer = state(void 0);
+ const onAppearing = new CustomEvent("appearing", {
+ detail: {}
+ });
+ user_effect((() => {
+ const options = {
+ root: get(scrollEl),
+ rootMargin: "10px",
+ threshold: 0
+ };
+ set(observer, new IntersectionObserver((entries => {
+ for (const entry of entries) if (entry.isIntersecting) entry.target.dispatchEvent(onAppearing);
+ }), options), true);
+ }));
+ onDestroy((() => {
+ null === get(observer) || void 0 === get(observer) || get(observer).disconnect();
+ }));
+ var div = root2(), div_1 = child(div), text2 = child(div_1);
+ reset(div_1);
+ each(sibling(div_1, 4), 17, (() => get(files)), index, (($$anchor2, file) => {
+ var div_2 = root_1();
+ div_2.__click = [ on_click, handleOpenFile, file ];
+ var div_3 = child(div_2), span = child(div_3), text_1 = child(span, true);
+ reset(span);
+ var span_1 = sibling(span, 2), text_2 = child(span_1);
+ reset(span_1);
+ reset(div_3);
+ ScrollViewMarkdownComponent(sibling(div_3, 2), {
+ get file() {
+ return get(file);
+ },
+ get observer() {
+ return get(observer);
+ },
+ get plugin() {
+ return $$props.plugin;
+ }
+ });
+ next(2);
+ reset(div_2);
+ bind_this(div_2, ($$value => set(scrollEl, $$value)), (() => get(scrollEl)));
+ template_effect((() => {
+ var _a3;
+ set_text(text_1, get(file).title);
+ set_text(text_2, `(${null != (_a3 = get(file).path) ? _a3 : ""})`);
+ }));
+ append($$anchor2, div_2);
+ }));
+ reset(div);
+ template_effect((() => {
+ var _a3;
+ return set_text(text2, `Files with ${null != (_a3 = get(tagPath)) ? _a3 : ""}`);
+ }));
+ append($$anchor, div);
+ pop();
+ $$cleanup();
+}
+
+delegate([ "click" ]);
+
+var ScrollView = class extends import_obsidian2.ItemView {
+ constructor(leaf, plugin) {
+ super(leaf);
+ this.icon = "sheets-in-box";
+ this.state = {
+ files: [],
+ title: "",
+ tagPath: ""
+ };
+ this.title = "";
+ this.navigation = true;
+ this.plugin = plugin;
+ this.store = writable({
+ files: [],
+ title: "",
+ tagPath: ""
+ });
+ }
+ getIcon() {
+ return "sheets-in-box";
+ }
+ getViewType() {
+ return VIEW_TYPE_SCROLL;
+ }
+ getDisplayText() {
+ return this.state.tagPath || "Tags scroll";
+ }
+ async setFile(filenames) {
+ this.state = {
+ ...this.state,
+ files: filenames
+ };
+ await this.updateView();
+ }
+ async setState(state2, result) {
+ this.state = {
+ ...state2
+ };
+ this.title = state2.title;
+ await this.updateView();
+ }
+ getState() {
+ return this.state;
+ }
+ isFileOpened(path) {
+ return this.state.files.some((e => e.path == path));
+ }
+ getScrollViewState() {
+ return this.state;
+ }
+ async updateView() {
+ const items = [];
+ for (const item of this.state.files) if (item.content) items.push(item); else {
+ const f = this.app.vault.getAbstractFileByPath(item.path);
+ if (null == f || !(f instanceof import_obsidian2.TFile)) {
+ console.log(`File not found:${item.path}`);
+ items.push(item);
+ continue;
+ }
+ const title = this.plugin.getFileTitle(f), w = await this.app.vault.read(f);
+ await doEvents();
+ item.content = w;
+ item.title = title;
+ items.push(item);
+ }
+ this.state = {
+ ...this.state,
+ files: [ ...items ]
+ };
+ this.store.set(this.state);
+ }
+ async onOpen() {
+ const app = mount(ScrollViewComponent, {
+ target: this.contentEl,
+ props: {
+ store: this.store,
+ openfile: this.plugin.focusFile,
+ plugin: this.plugin
+ }
+ });
+ this.component = app;
+ return await Promise.resolve();
+ }
+ async onClose() {
+ if (this.component) {
+ await unmount(this.component);
+ this.component = void 0;
+ }
+ return await Promise.resolve();
+ }
+}, import_obsidian6 = require("obsidian");
+
+function performSortExactFirst(_items, children, leftOverItems) {
+ const childrenPathsArr = children.map((e => e[V2FI_IDX_CHILDREN].map((ee => ee.path)))).flat(), childrenPaths = new Set(childrenPathsArr), exactHerePaths = new Set(_items.map((e => e.path)));
+ childrenPaths.forEach((path => exactHerePaths.delete(path)));
+ return [ ...[ ...leftOverItems ].sort(((a, b) => (exactHerePaths.has(a.path) ? -1 : 0) + (exactHerePaths.has(b.path) ? 1 : 0))) ];
+}
+
+function delay2() {
+ return new Promise((res => setTimeout((() => res()), 5)));
+}
+
+function nextTick2() {
+ return new Promise((res => setTimeout((() => res()), 0)));
+}
+
+var delays = [ nextTick2, delay2, nextTick2, waitForRequestAnimationFrame ], delayIdx = 0;
+
+async function collectChildren(previousTrail, tags, _tagInfo, _items) {
+ const previousTrailLC = previousTrail.toLowerCase(), children = [], tagPerItem = new Map, lowercaseMap = new Map;
+ for (const item of _items) item.tags.forEach((itemTag => {
+ var _a3;
+ const tagLc = null != (_a3 = lowercaseMap.get(itemTag)) ? _a3 : lowercaseMap.set(itemTag, itemTag.toLowerCase()).get(itemTag);
+ if (!tagPerItem.has(tagLc)) tagPerItem.set(tagLc, []);
+ tagPerItem.get(tagLc).push(item);
+ }));
+ for (const tag of tags) {
+ const tagLC = tag.toLowerCase(), tagNestedLC = trimPrefix(tagLC, previousTrailLC), items = [];
+ for (const [itemTag, tempItems] of tagPerItem) if (pathMatch(itemTag, tagLC)) items.push(...tempItems); else if (pathMatch(itemTag, tagNestedLC)) items.push(...tempItems);
+ children.push([ tag, ...parseTagName(tag, _tagInfo), [ ...new Set(items) ] ]);
+ delayIdx++;
+ delayIdx %= 4;
+ await delays[delayIdx]();
+ }
+ return children;
+}
+
+async function collectTreeChildren({key, expandLimit, depth, tags, trailLower, _setting, isMainTree, isSuppressibleLevel, viewType, previousTrail, _tagInfo, _items, linkedItems, isRoot, sortFunc}) {
+ let suppressLevels = [], children = [];
+ if (expandLimit && depth >= expandLimit) {
+ children = [];
+ suppressLevels = getExtraTags(tags, trailLower, _setting.reduceNestedParent);
+ } else if (!isMainTree) children = []; else if (isSuppressibleLevel) {
+ children = [];
+ suppressLevels = getExtraTags(tags, trailLower, _setting.reduceNestedParent);
+ } else {
+ let wChildren = [];
+ if ("tags" == viewType) wChildren = await collectChildren(previousTrail, tags, _tagInfo, _items); else if ("links" == viewType) wChildren = tags.map((tag => {
+ var _a3;
+ const selfInfo = getViewItemFromPath(tag), dispName = !selfInfo ? tag : selfInfo.displayName;
+ return [ tag, dispName, [ dispName ], null != (_a3 = linkedItems.get(tag)) ? _a3 : [] ];
+ }));
+ if ("tags" == viewType) {
+ if (_setting.mergeRedundantCombination) {
+ const out = [], isShown = new Set;
+ for (const [tag, tagName, tagsDisp, items] of wChildren) {
+ const list = [];
+ for (const v of items) if (!isShown.has(v.path)) {
+ list.push(v);
+ isShown.add(v.path);
+ }
+ if (0 != list.length) out.push([ tag, tagName, tagsDisp, list ]);
+ }
+ wChildren = out;
+ }
+ if (isMainTree && isRoot) {
+ const archiveTags = _setting.archiveTags.toLowerCase().replace(/[\n ]/g, "").split(",");
+ wChildren = wChildren.map((e => archiveTags.some((aTag => `${aTag}//`.startsWith(e[V2FI_IDX_TAG].toLowerCase() + "/"))) ? e : [ e[V2FI_IDX_TAG], e[V2FI_IDX_TAGNAME], e[V2FI_IDX_TAGDISP], e[V2FI_IDX_CHILDREN].filter((items => !items.tags.some((e2 => archiveTags.contains(e2.toLowerCase()))))) ])).filter((child2 => 0 != child2[V2FI_IDX_CHILDREN].length));
+ }
+ }
+ wChildren = wChildren.sort(sortFunc);
+ children = wChildren;
+ }
+ return {
+ suppressLevels,
+ children
+ };
+}
+
+var root3 = template("
");
+
+function OnDemandRender($$anchor, $$props) {
+ push($$props, true);
+ let cssClass = prop($$props, "cssClass", 3, ""), isVisible = prop($$props, "isVisible", 15, false), hidingScheduled = state(false);
+ const {observe, unobserve} = getContext("observer");
+ function setIsVisible(visibility) {
+ if (isVisible() != visibility) if (visibility) isVisible(visibility);
+ set(hidingScheduled, !visibility);
+ }
+ onMount((() => {
+ performHide.subscribe((() => {
+ if (get(hidingScheduled)) {
+ isVisible(false);
+ set(hidingScheduled, false);
+ }
+ }));
+ }));
+ onDestroy((() => {
+ if (get(_el)) unobserve(get(_el));
+ }));
+ let _el = state(void 0), el = state(void 0);
+ user_effect((() => {
+ if (get(_el) != get(el)) {
+ if (get(_el)) unobserve(get(_el));
+ set(_el, get(el), true);
+ if (get(el)) observe(get(el), setIsVisible);
+ }
+ }));
+ var div = root3();
+ snippet(child(div), (() => {
+ var _a3;
+ return null != (_a3 = $$props.children) ? _a3 : noop;
+ }), (() => ({
+ isVisible: isVisible()
+ })));
+ reset(div);
+ bind_this(div, ($$value => set(el, $$value)), (() => get(el)));
+ template_effect((() => set_class(div, 1, clsx2(cssClass()))));
+ append($$anchor, div);
+ pop();
+}
+
+var on_click2 = (evt, $$props) => $$props.openFile($$props.item.path, evt.metaKey || evt.ctrlKey), on_mouseover = (e, handleMouseover, $$props) => {
+ handleMouseover(e, $$props.item.path);
+}, on_contextmenu = (evt, $$props) => $$props.showMenu(evt, $$props.trail, void 0, [ $$props.item ]), root_2 = template('
'), root_12 = template('');
+
+function V2TreeItemComponent($$anchor, $$props) {
+ push($$props, true);
+ const [$$stores, $$cleanup] = setup_stores(), $pluginInstance = () => store_get(pluginInstance, "$pluginInstance", $$stores);
+ function handleMouseover(e, path) {
+ $$props.hoverPreview(e, path);
+ }
+ const _setting = user_derived((() => store_get(tagFolderSetting, "$tagFolderSetting", $$stores))), _currentActiveFilePath = user_derived((() => store_get(currentFile, "$currentFile", $$stores)));
+ let isActive = user_derived((() => $$props.item.path == get(_currentActiveFilePath))), isItemVisible = state(false);
+ const tagsLeft = user_derived((() => get(isItemVisible) ? uniqueCaseIntensive([ ...getExtraTags($$props.item.tags, [ ...$$props.trail ], get(_setting).reduceNestedParent), ...$$props.item.extraTags ].map((e => trimSlash(e, false, true))).map((e => e.split("/").map((ee => renderSpecialTag(ee))).join("/"))).filter((e => "" != e))) : [])), extraTagsHtml = user_derived((() => `${get(tagsLeft).map((e => `${escapeStringToHTML(e)} `)).join("")}`)), draggable = user_derived((() => !get(_setting).disableDragging)), app = user_derived((() => null === $pluginInstance() || void 0 === $pluginInstance() ? void 0 : $pluginInstance().app)), dm = user_derived((() => null === get(app) || void 0 === get(app) ? void 0 : get(app).dragManager));
+ function dragStartFile(args) {
+ if (!get(draggable)) return;
+ const file = get(app).vault.getAbstractFileByPath($$props.item.path), param = get(dm).dragFile(args, file);
+ if (param) return get(dm).onDragStart(args, param);
+ }
+ {
+ const children = ($$anchor2, $$arg0) => {
+ let isVisible = () => null == $$arg0 ? void 0 : $$arg0().isVisible;
+ var div = root_12();
+ let classes;
+ div.__click = [ on_click2, $$props ];
+ div.__mouseover = [ on_mouseover, handleMouseover, $$props ];
+ div.__contextmenu = [ on_contextmenu, $$props ];
+ var div_1 = child(div), text2 = child(div_1, true);
+ reset(div_1);
+ var node = sibling(div_1, 2), consequent = $$anchor3 => {
+ var div_2 = root_2();
+ html(child(div_2), (() => get(extraTagsHtml)), false, false);
+ reset(div_2);
+ append($$anchor3, div_2);
+ };
+ if_block(node, ($$render => {
+ if (isVisible()) $$render(consequent);
+ }));
+ reset(div);
+ template_effect(($0 => {
+ classes = set_class(div, 1, "tree-item-self is-clickable nav-file-title", null, classes, $0);
+ set_attribute(div, "draggable", get(draggable));
+ set_attribute(div, "data-path", $$props.item.path);
+ set_text(text2, isVisible() ? $$props.item.displayName : "");
+ }), [ () => ({
+ "is-active": get(isActive)
+ }) ]);
+ event("dragstart", div, dragStartFile);
+ event("focus", div, (() => {}));
+ append($$anchor2, div);
+ };
+ OnDemandRender($$anchor, {
+ cssClass: "tree-item nav-file",
+ get isVisible() {
+ return get(isItemVisible);
+ },
+ set isVisible($$value) {
+ set(isItemVisible, $$value, true);
+ },
+ children,
+ $$slots: {
+ default: true
+ }
+ });
+ }
+ pop();
+ $$cleanup();
+}
+
+delegate([ "click", "mouseover", "contextmenu" ]);
+
+function handleOpenItem(evt, viewType, $$props, filename) {
+ if ("tags" != viewType()) {
+ evt.preventDefault();
+ evt.stopPropagation();
+ $$props.openFile(get(filename), evt.metaKey || evt.ctrlKey);
+ }
+}
+
+var on_contextmenu2 = (evt, shouldResponsibleFor, $$props, trail, suppressLevels, viewType, tagName, filename, _items) => {
+ evt.stopPropagation();
+ if (shouldResponsibleFor(evt)) $$props.showMenu(evt, [ ...trail(), ...get(suppressLevels) ], "tags" == viewType() ? tagName() : get(filename), get(_items));
+}, root_22 = template(''), root_6 = ns_template(' '), root_7 = template('
'), root_8 = template('...
'), on_click3 = (e, handleOpenScroll, trail, _items) => handleOpenScroll(e, trail(), get(_items).map((e2 => e2.path))), root_4 = template('
', 1), root_10 = template(" ", 1), root_15 = template('
'), root4 = template("
");
+
+function V2TreeFolderComponent_1($$anchor, $$props) {
+ push($$props, true);
+ const [$$stores, $$cleanup] = setup_stores();
+ var _a3, _b3, _c2;
+ let viewType = prop($$props, "viewType", 3, "tags"), thisName = prop($$props, "thisName", 3, ""), items = prop($$props, "items", 19, (() => [])), tagName = prop($$props, "tagName", 11, ""), tagNameDisp = prop($$props, "tagNameDisp", 27, (() => proxy([]))), trail = prop($$props, "trail", 19, (() => [])), depth = prop($$props, "depth", 3, 1), folderIcon = prop($$props, "folderIcon", 3, ""), headerTitle = prop($$props, "headerTitle", 3, ""), _setting = user_derived((() => store_get(tagFolderSetting, "$tagFolderSetting", $$stores)));
+ const expandLimit = user_derived((() => !get(_setting).expandLimit ? 0 : "links" == viewType() ? get(_setting).expandLimit + 1 : get(_setting).expandLimit)), _tagInfo = user_derived((() => store_get(tagInfo, "$tagInfo", $$stores))), _currentActiveFilePath = user_derived((() => store_get(currentFile, "$currentFile", $$stores)));
+ function handleOpenScroll(e, trails, filePaths) {
+ if ("tags" == viewType()) $$props.openScrollView(void 0, "", joinPartialPath(removeIntermediatePath(trails)).join(", "), filePaths); else if ("links" == viewType()) $$props.openScrollView(void 0, "", `Linked to ${get(filename)}`, filePaths);
+ e.preventDefault();
+ }
+ function shouldResponsibleFor(evt) {
+ if (evt.target instanceof Element && evt.target.matchParent(".is-clickable.mod-collapsible.nav-folder-title")) return true; else return false;
+ }
+ function toggleFolder(evt) {
+ evt.stopPropagation();
+ if (shouldResponsibleFor(evt)) {
+ evt.preventDefault();
+ if (get(_setting).useMultiPaneList) selectedTags.set(trail());
+ v2expandedTags.update((evt2 => {
+ if (evt2.has(get(trailKey))) evt2.delete(get(trailKey)); else evt2.add(get(trailKey));
+ return evt2;
+ }));
+ }
+ }
+ let _lastParam, suppressLevels = state(proxy([])), children = state(proxy([])), isUpdating = state(false);
+ const viewContextID = `${null !== (_a3 = getContext("viewID")) && void 0 !== _a3 ? _a3 : ""}`;
+ let isFolderVisible = state(false);
+ function splitArrayToBatch(items2) {
+ const ret = [];
+ if (items2 && items2.length > 0) {
+ const applyItems = [ ...items2 ];
+ do {
+ const batch = applyItems.splice(0, 80);
+ if (0 == batch.length) break;
+ ret.push(batch);
+ if (batch.length < 80) break;
+ } while (applyItems.length > 0);
+ }
+ return ret;
+ }
+ function dragStartFiles(args) {
+ if (!get(draggable)) return;
+ const files = get(_items).map((e => get(app).vault.getAbstractFileByPath(e.path))), param = get(dm).dragFiles(args, files);
+ if (param) return get(dm).onDragStart(args, param);
+ }
+ function dragStartName(args) {
+ if (!get(draggable)) return;
+ if ("links" == viewType()) return function dragStartFile(args) {
+ if (!get(draggable)) return;
+ const file = get(app).vault.getAbstractFileByPath(get(filename)), param = get(dm).dragFile(args, file);
+ if (param) return get(dm).onDragStart(args, param); else return;
+ }(args);
+ const expandedTags = [ ...ancestorToLongestTag(ancestorToTags(joinPartialPath(removeIntermediatePath([ ...trail(), ...get(suppressLevels) ])))) ].map((e => trimTrailingSlash(e))).map((e => e.split("/").filter((ee => !isSpecialTag(ee))).join("/"))).filter((e => "" != e)).map((e => "#" + e)).join(" ").trim();
+ args.dataTransfer.setData("text/plain", expandedTags);
+ args.dataTransfer.setData("Text", expandedTags);
+ args.title = expandedTags;
+ args.draggable = true;
+ get(dm).onDragStart(args, args);
+ }
+ const filename = user_derived((() => "tags" == viewType() ? "" : thisName().substring(thisName().indexOf(":") + 1))), thisInfo = user_derived((() => "links" != viewType() ? void 0 : getViewItemFromPath(thisName()))), thisLinks = user_derived((() => "links" != viewType() ? [] : (null !== (_b3 = null === get(thisInfo) || void 0 === get(thisInfo) ? void 0 : get(thisInfo).links) && void 0 !== _b3 ? _b3 : []).map((e => `${e}`)))), thisNameLC = user_derived((() => thisName().toLowerCase())), tagNameLC = user_derived((() => tagName().toLowerCase())), trailKey = user_derived((() => trail().join("*"))), trailLower = user_derived((() => trail().map((e => e.toLowerCase())))), collapsed = user_derived((() => !$$props.isRoot && !store_get(v2expandedTags, "$v2expandedTags", $$stores).has(get(trailKey)))), inMiddleOfTagHierarchy = user_derived((() => trail().length >= 1 && trail()[trail().length - 1].endsWith("/"))), previousTrail = user_derived((() => get(inMiddleOfTagHierarchy) ? trail()[trail().length - 1] : "")), lastTrailTagLC = user_derived((() => trimTrailingSlash(get(previousTrail)).toLowerCase())), _items = user_derived(items), tagsAllCI = user_derived((() => uniqueCaseIntensive(get(_items).flatMap((e => e.tags))))), tagsAllLower = user_derived((() => get(tagsAllCI).map((e => e.toLowerCase())))), isInDedicatedTag = user_derived((() => get(inMiddleOfTagHierarchy) && !get(tagsAllLower).contains(get(lastTrailTagLC)))), isMixedDedicatedTag = user_derived((() => get(inMiddleOfTagHierarchy))), displayTagCandidates = user_derived((() => {
+ let tagsAll = [];
+ if ("links" == viewType()) {
+ if (!$$props.isRoot) if (!get(_setting).linkShowOnlyFDR) tagsAll = get(thisInfo) ? getAllLinksRecursive(get(thisInfo), [ ...trail() ]) : [ ...get(thisLinks) ]; else tagsAll = [ ...get(thisLinks) ]; else tagsAll = unique(get(_items).flatMap((e => e.links)));
+ if (!$$props.isRoot || get(_setting).expandUntaggedToRoot) tagsAll = tagsAll.filter((e => "_unlinked" != e));
+ tagsAll = tagsAll.filter((e => !trail().contains(e)));
+ } else {
+ tagsAll = uniqueCaseIntensive(get(_items).flatMap((e => e.tags)));
+ if (!$$props.isRoot || get(_setting).expandUntaggedToRoot) tagsAll = tagsAll.filter((e => "_untagged" != e));
+ }
+ return tagsAll;
+ })), tagsExceptAlreadyShown = user_derived((() => "tags" != viewType() ? [] : get(displayTagCandidates).filter((tag => trail().every((trail2 => trimTrailingSlash(tag.toLowerCase()) !== trimTrailingSlash(trail2.toLowerCase()))))))), passedTagWithoutThis = user_derived((() => {
+ const trimSlashedThisNameLC = "/" + trimSlash(thisName()).toLowerCase();
+ return get(tagsExceptAlreadyShown).filter((tag => {
+ const lc = tag.toLowerCase();
+ return lc != get(thisNameLC) && lc != get(tagNameLC);
+ })).filter((tag => !tag.toLowerCase().endsWith(trimSlashedThisNameLC)));
+ })), escapedPreviousTrail = user_derived((() => !get(isMixedDedicatedTag) ? get(previousTrail) : get(previousTrail).split("/").join("*"))), sparseIntermediateTags = user_derived((() => {
+ const t1 = !get(isInDedicatedTag) ? get(passedTagWithoutThis) : get(passedTagWithoutThis).filter((e => (e + "/").startsWith(get(previousTrail))));
+ if (!get(isInDedicatedTag)) return t1; else return t1.map((e => (e + "/").startsWith(get(previousTrail)) ? get(escapedPreviousTrail) + e.substring(get(previousTrail).length) : e));
+ })), tagsPhaseX1 = user_derived((() => get(sparseIntermediateTags))), $$d = user_derived((() => {
+ let isSuppressibleLevel2 = false, existTags = get(tagsPhaseX1), existTagsFiltered1 = [];
+ if (!get(_setting).doNotSimplifyTags && "links" != viewType()) if (1 == get(_items).length) {
+ existTagsFiltered1 = existTags;
+ isSuppressibleLevel2 = true;
+ } else if (1 == uniqueCaseIntensive(get(_items).map((e => [ ...e.tags ].sort().join("**")))).length) {
+ isSuppressibleLevel2 = true;
+ existTagsFiltered1 = existTags;
+ }
+ if (!isSuppressibleLevel2) {
+ const removeItems = [ get(thisNameLC) ];
+ if (get(_setting).reduceNestedParent) removeItems.push(...get(trailLower));
+ let tagsOnNextLevel = [];
+ if ("tags" == viewType()) tagsOnNextLevel = uniqueCaseIntensive(existTags.map((e => {
+ const idx = e.indexOf("/");
+ if (idx < 1) return e;
+ let piece = e.substring(0, idx + 1), idx2 = idx;
+ for (;removeItems.some((e2 => e2.startsWith(piece.toLowerCase()))); ) {
+ idx2 = e.indexOf("/", idx2 + 1);
+ if (-1 === idx2) {
+ piece = e;
+ break;
+ }
+ piece = e.substring(0, idx2 + 1);
+ }
+ return piece;
+ }))); else tagsOnNextLevel = unique(existTags);
+ const trailShortest = removeIntermediatePath(trail());
+ existTagsFiltered1 = tagsOnNextLevel.filter((tag => trailShortest.every((trail2 => trimTrailingSlash(tag.toLowerCase()) !== trimTrailingSlash(trail2.toLowerCase())))));
+ }
+ if (get(isMixedDedicatedTag) || get(isInDedicatedTag)) existTagsFiltered1 = existTagsFiltered1.map((e => e.replace(get(escapedPreviousTrail), get(previousTrail))));
+ if (get(isMixedDedicatedTag) || get(isInDedicatedTag)) existTagsFiltered1 = existTagsFiltered1.map((e => e.replace(get(escapedPreviousTrail), get(previousTrail))));
+ const existTagsFiltered1LC = existTagsFiltered1.map((e => e.toLowerCase()));
+ return {
+ filteredTags: uniqueCaseIntensive(existTagsFiltered1.map((e => existTagsFiltered1LC.contains(e.toLowerCase() + "/") ? e + "/" : e))),
+ isSuppressibleLevel: isSuppressibleLevel2
+ };
+ })), filteredTags = user_derived((() => get($$d).filteredTags)), isSuppressibleLevel = user_derived((() => get($$d).isSuppressibleLevel)), $$d_1 = user_derived((() => {
+ let tags2 = [];
+ const leftOverItemsSrc2 = [];
+ if (!get(_items)) return {
+ tags: tags2,
+ leftOverItemsSrc: leftOverItemsSrc2
+ };
+ if (!($$props.isMainTree && (!get(expandLimit) || get(expandLimit) && depth() < get(expandLimit)))) return {
+ tags: tags2,
+ leftOverItemsSrc: leftOverItemsSrc2
+ };
+ if ("links" == viewType()) {
+ const ret = get(tagsOfLinkedItems);
+ return {
+ tags: ret.tags,
+ leftOverItemsSrc: ret.leftOverItems
+ };
+ }
+ if (get(previousTrail).endsWith("/")) {
+ const existTagsFiltered4 = [];
+ for (const tag of get(filteredTags)) if (!get(filteredTags).map((e => e.toLowerCase())).contains((get(previousTrail) + tag).toLowerCase())) existTagsFiltered4.push(tag);
+ tags2 = uniqueCaseIntensive(removeIntermediatePath(existTagsFiltered4));
+ } else tags2 = uniqueCaseIntensive(removeIntermediatePath(get(filteredTags)));
+ return {
+ tags: tags2,
+ leftOverItemsSrc: leftOverItemsSrc2
+ };
+ })), tags = user_derived((() => get($$d_1).tags)), leftOverItemsSrc = user_derived((() => get($$d_1).leftOverItemsSrc)), linkedItems = user_derived((() => {
+ const ret = new Map;
+ if ("tags" == viewType()) return ret;
+ for (const tag of get(displayTagCandidates)) if ("_unlinked" == tag) ret.set(tag, get(_items).filter((e => e.links.contains(tag)))); else {
+ const wItems = get(_items).filter((e => e.path == tag));
+ ret.set(tag, wItems);
+ }
+ return ret;
+ })), tagsOfLinkedItems = user_derived((() => {
+ let leftOverItems2 = [], tags2 = [];
+ if ("tags" == viewType()) return {
+ tags: tags2,
+ leftOverItems: leftOverItems2
+ };
+ if ("_unlinked" == thisName()) leftOverItems2 = get(_items); else get(displayTagCandidates).forEach((tag => {
+ if ("_unlinked" == tag) {
+ tags2.push(tag);
+ return;
+ }
+ const x = getViewItemFromPath(tag);
+ if (null == x) return false;
+ const existLinks = x.links.filter((e => !trail().contains(e) && e != thisName())), nextDepth = !get(expandLimit) || get(expandLimit) && depth() + 1 < get(expandLimit);
+ if (existLinks.length >= 2 && nextDepth) tags2.push(tag); else leftOverItems2.push(x);
+ }));
+ return {
+ tags: tags2,
+ leftOverItems: leftOverItems2
+ };
+ })), leftOverItemsUnsorted = user_derived((() => {
+ if (get(_setting).useMultiPaneList && $$props.isMainTree) return [];
+ if ($$props.isRoot && $$props.isMainTree && !get(isSuppressibleLevel)) if (get(_setting).expandUntaggedToRoot) return get(_items).filter((e => e.tags.contains("_untagged") || e.tags.contains("_unlinked"))); else return [];
+ if ($$props.isRoot && !$$props.isMainTree) return get(_items);
+ if ("tags" == viewType()) if ("NONE" == get(_setting).hideItems) return get(_items); else if ("DEDICATED_INTERMIDIATES" == get(_setting).hideItems && get(isInDedicatedTag) || "ALL_EXCEPT_BOTTOM" == get(_setting).hideItems) return get(_items).filter((e => !get(children).map((e2 => e2[V2FI_IDX_CHILDREN])).flat().find((ee => e.path == ee.path)))); else return get(_items); else return get(leftOverItemsSrc);
+ })), leftOverItems = user_derived((() => get(_setting).sortExactFirst ? performSortExactFirst(get(_items), get(children), get(leftOverItemsUnsorted)) : get(leftOverItemsUnsorted)));
+ let isActive = user_derived((() => get(_items) && get(_items).some((e => e.path == get(_currentActiveFilePath))) || "links" == viewType() && (thisName() == get(_currentActiveFilePath) || get(tags).contains(get(_currentActiveFilePath)) || get(leftOverItems).some((e => e.path == get(_currentActiveFilePath))))));
+ const tagsDisp = user_derived((() => get(isSuppressibleLevel) && get(isInDedicatedTag) ? [ [ ...tagNameDisp(), ...get(suppressLevels).flatMap((e => e.split("/").map((e2 => renderSpecialTag(e2))))) ] ] : get(isSuppressibleLevel) ? [ tagNameDisp(), ...get(suppressLevels).map((e => e.split("/").map((e2 => renderSpecialTag(e2))))) ] : [ tagNameDisp() ])), classKey = user_derived((() => "links" == viewType() ? " tf-link" : " tf-tag")), tagsDispHtml = user_derived((() => get(isFolderVisible) ? get(tagsDisp).map((e => `${e.map((ee => `${escapeStringToHTML(ee)} `)).join("")} `)).join("") : "")), itemCount = user_derived((() => "tags" == viewType() ? null !== (_c2 = null === get(_items) || void 0 === get(_items) ? void 0 : get(_items).length) && void 0 !== _c2 ? _c2 : 0 : get(tags).length + get(leftOverItems).length)), leftOverItemsDisp = user_derived((() => splitArrayToBatch(get(leftOverItems)))), childrenDisp = user_derived((() => splitArrayToBatch(get(children)))), draggable = user_derived((() => !get(_setting).disableDragging)), app = user_derived((() => store_get(pluginInstance, "$pluginInstance", $$stores).app)), dm = user_derived((() => null === get(app) || void 0 === get(app) ? void 0 : get(app).dragManager));
+ user_effect((() => {
+ const key = get(trailKey) + ($$props.isRoot ? "-r" : "-x") + viewContextID, sortFunc = selectCompareMethodTags(get(_setting), "links" == viewType() ? {} : get(_tagInfo));
+ (function updateX(param) {
+ if (!isSameAny(param, _lastParam)) {
+ _lastParam = {
+ ...param
+ };
+ if (param.isFolderVisible || $$props.isRoot) scheduleOnceIfDuplicated("update-children-" + param.key, (async () => {
+ set(isUpdating, true);
+ const ret = await collectTreeChildren(param);
+ set(children, ret.children, true);
+ set(suppressLevels, ret.suppressLevels, true);
+ set(isUpdating, false);
+ }));
+ }
+ })({
+ key,
+ expandLimit: get(expandLimit),
+ depth: depth(),
+ tags: get(tags),
+ trailLower: get(trailLower),
+ _setting: get(_setting),
+ isMainTree: $$props.isMainTree,
+ isSuppressibleLevel: get(isSuppressibleLevel),
+ viewType: viewType(),
+ previousTrail: get(previousTrail),
+ _tagInfo: get(_tagInfo),
+ _items: get(_items),
+ linkedItems: get(linkedItems),
+ isRoot: $$props.isRoot,
+ isFolderVisible: get(isFolderVisible),
+ sortFunc
+ });
+ }));
+ var div = root4();
+ div.__click = toggleFolder;
+ div.__contextmenu = [ on_contextmenu2, shouldResponsibleFor, $$props, trail, suppressLevels, viewType, tagName, filename, _items ];
+ var node = child(div), consequent_1 = $$anchor2 => {
+ var fragment = comment(), node_1 = first_child(fragment), consequent = $$anchor3 => {
+ var div_1 = root_22(), div_2 = child(div_1), text2 = child(div_2, true);
+ reset(div_2);
+ reset(div_1);
+ template_effect((() => set_text(text2, headerTitle())));
+ append($$anchor3, div_1);
+ };
+ if_block(node_1, ($$render => {
+ if ($$props.isRoot) $$render(consequent);
+ }));
+ append($$anchor2, fragment);
+ }, alternate = $$anchor2 => {
+ const expression = user_derived((() => `tree-item-self${!$$props.isRoot ? " is-clickable mod-collapsible" : ""} nav-folder-title tag-folder-title${get(isActive) ? " is-active" : ""}`));
+ OnDemandRender($$anchor2, {
+ get cssClass() {
+ return get(expression);
+ },
+ get isVisible() {
+ return get(isFolderVisible);
+ },
+ set isVisible($$value) {
+ set(isFolderVisible, $$value, true);
+ },
+ children: ($$anchor3, $$slotProps) => {
+ var fragment_2 = root_4(), div_3 = first_child(fragment_2);
+ let classes;
+ div_3.__click = toggleFolder;
+ var node_2 = child(div_3), consequent_2 = $$anchor4 => {
+ var fragment_3 = comment();
+ html(first_child(fragment_3), folderIcon, false, false);
+ append($$anchor4, fragment_3);
+ }, alternate_1 = $$anchor4 => {
+ append($$anchor4, root_6());
+ };
+ if_block(node_2, ($$render => {
+ if (get(isFolderVisible)) $$render(consequent_2); else $$render(alternate_1, false);
+ }));
+ reset(div_3);
+ var div_4 = sibling(div_3, 2);
+ div_4.__click = [ handleOpenItem, viewType, $$props, filename ];
+ var node_4 = child(div_4), consequent_3 = $$anchor4 => {
+ var div_5 = root_7();
+ html(child(div_5), (() => get(tagsDispHtml)), false, false);
+ reset(div_5);
+ template_effect((() => set_attribute(div_5, "draggable", get(draggable))));
+ event("dragstart", div_5, dragStartName);
+ append($$anchor4, div_5);
+ }, alternate_2 = $$anchor4 => {
+ append($$anchor4, root_8());
+ };
+ if_block(node_4, ($$render => {
+ if (get(isFolderVisible)) $$render(consequent_3); else $$render(alternate_2, false);
+ }));
+ var div_7 = sibling(node_4, 2);
+ div_7.__click = [ on_click3, handleOpenScroll, trail, _items ];
+ var span = child(div_7), text_1 = child(span, true);
+ reset(span);
+ reset(div_7);
+ reset(div_4);
+ template_effect(($0 => {
+ classes = set_class(div_3, 1, "tree-item-icon collapse-icon nav-folder-collapse-indicator", null, classes, $0);
+ set_attribute(span, "draggable", get(draggable));
+ set_text(text_1, get(itemCount));
+ }), [ () => ({
+ "is-collapsed": get(collapsed)
+ }) ]);
+ event("dragstart", span, dragStartFiles);
+ append($$anchor3, fragment_2);
+ },
+ $$slots: {
+ default: true
+ }
+ });
+ };
+ if_block(node, ($$render => {
+ if ($$props.isRoot || !$$props.isMainTree) $$render(consequent_1); else $$render(alternate, false);
+ }));
+ var node_6 = sibling(node, 2), consequent_5 = $$anchor2 => {
+ var fragment_9 = comment();
+ const treeContent = ($$anchor3, childrenDisp2 = noop, leftOverItemsDisp2 = noop) => {
+ var fragment_4 = root_10(), node_7 = first_child(fragment_4);
+ each(node_7, 17, childrenDisp2, index, (($$anchor4, items2, $$index_1, $$array) => {
+ var fragment_5 = comment();
+ each(first_child(fragment_5), 17, (() => get(items2)), index, (($$anchor5, $$item, $$index, $$array_1) => {
+ let f = () => get($$item)[0];
+ const expression_1 = user_derived((() => [ ...trail(), ...get(suppressLevels), f() ])), expression_2 = user_derived((() => get(isInDedicatedTag) ? depth() : depth() + 1));
+ V2TreeFolderComponent_1($$anchor5, {
+ get viewType() {
+ return viewType();
+ },
+ get items() {
+ return get($$item)[3];
+ },
+ get thisName() {
+ return f();
+ },
+ get trail() {
+ return get(expression_1);
+ },
+ get folderIcon() {
+ return folderIcon();
+ },
+ get openFile() {
+ return $$props.openFile;
+ },
+ isRoot: false,
+ get showMenu() {
+ return $$props.showMenu;
+ },
+ get isMainTree() {
+ return $$props.isMainTree;
+ },
+ get openScrollView() {
+ return $$props.openScrollView;
+ },
+ get hoverPreview() {
+ return $$props.hoverPreview;
+ },
+ get tagName() {
+ return get($$item)[1];
+ },
+ get tagNameDisp() {
+ return get($$item)[2];
+ },
+ get depth() {
+ return get(expression_2);
+ }
+ });
+ }));
+ append($$anchor4, fragment_5);
+ }));
+ each(sibling(node_7, 2), 17, leftOverItemsDisp2, index, (($$anchor4, items2, $$index_3, $$array_2) => {
+ var fragment_7 = comment();
+ each(first_child(fragment_7), 17, (() => get(items2)), index, (($$anchor5, item) => {
+ const expression_3 = user_derived((() => $$props.isRoot ? [ ...trail() ] : [ ...trail(), ...get(suppressLevels) ]));
+ V2TreeItemComponent($$anchor5, {
+ get item() {
+ return get(item);
+ },
+ get openFile() {
+ return $$props.openFile;
+ },
+ get trail() {
+ return get(expression_3);
+ },
+ get showMenu() {
+ return $$props.showMenu;
+ },
+ get hoverPreview() {
+ return $$props.hoverPreview;
+ }
+ });
+ }));
+ append($$anchor4, fragment_7);
+ }));
+ append($$anchor3, fragment_4);
+ };
+ var node_11 = first_child(fragment_9), consequent_4 = $$anchor3 => {
+ var div_8 = root_15(), node_12 = child(div_8);
+ treeContent(node_12, (() => get(childrenDisp)), (() => get(leftOverItemsDisp)));
+ reset(div_8);
+ append($$anchor3, div_8);
+ }, alternate_3 = $$anchor3 => {
+ treeContent($$anchor3, (() => get(childrenDisp)), (() => get(leftOverItemsDisp)));
+ };
+ if_block(node_11, ($$render => {
+ if (!$$props.isRoot) $$render(consequent_4); else $$render(alternate_3, false);
+ }));
+ append($$anchor2, fragment_9);
+ };
+ if_block(node_6, ($$render => {
+ if (!get(collapsed)) $$render(consequent_5);
+ }));
+ reset(div);
+ template_effect((() => set_class(div, 1, `tree-item nav-folder${get(collapsed) ? " is-collapsed" : ""}${$$props.isRoot ? " mod-root" : ""}${get(isUpdating) ? " updating" : ""}`)));
+ append($$anchor, div);
+ pop();
+ $$cleanup();
+}
+
+delegate([ "click", "contextmenu" ]);
+
+var import_obsidian3 = require("obsidian");
+
+function toggleSearch(_, showSearch, $searchString) {
+ set(showSearch, !get(showSearch));
+ if (!get(showSearch)) store_set(searchString, "");
+}
+
+function clearSearch(__1, $searchString) {
+ store_set(searchString, "");
+}
+
+function doSwitch(__2, $$props) {
+ if ($$props.switchView) $$props.switchView();
+}
+
+function closeAllOpenedFolders() {
+ v2expandedTags.update((prev => {
+ prev.clear();
+ return prev;
+ }));
+}
+
+var root_13 = template('
', 1), root_23 = template('
'), root_3 = template('
', 1), root_42 = template('
'), root_5 = template(''), root5 = template('
', 1), $$css3 = {
+ hash: "svelte-1xm87ro",
+ code: ".nav-files-container.svelte-1xm87ro {height:100%;}"
+};
+
+function TagFolderViewComponent($$anchor, $$props) {
+ push($$props, true);
+ append_styles($$anchor, $$css3);
+ const [$$stores, $$cleanup] = setup_stores(), $searchString = () => store_get(searchString, "$searchString", $$stores);
+ let vaultName = prop($$props, "vaultName", 3, ""), title = prop($$props, "title", 15, ""), tags = prop($$props, "tags", 31, (() => proxy([]))), viewType = prop($$props, "viewType", 3, "tags");
+ const isMainTree = user_derived((() => 0 == tags().length));
+ null === $$props.stateStore || void 0 === $$props.stateStore || $$props.stateStore.subscribe((state2 => {
+ tags(state2.tags);
+ title(state2.title);
+ }));
+ let updatedFiles = state(proxy([]));
+ appliedFiles.subscribe((async filenames => {
+ set(updatedFiles, null != filenames ? filenames : [], true);
+ }));
+ const viewItemsSrc = user_derived((() => {
+ if ("tags" == viewType()) return store_get(allViewItems, "$allViewItems", $$stores); else return store_get(allViewItemsByLink, "$allViewItemsByLink", $$stores);
+ }));
+ let _setting = state(proxy(store_get(tagFolderSetting, "$tagFolderSetting", $$stores))), outgoingEnabled = state(false), incomingEnabled = state(false), bothEnabled = state(false), onlyFDREnabled = state(false);
+ tagFolderSetting.subscribe((setting => {
+ var _a3, _b3, _c2, _d, _e, _f;
+ set(_setting, setting, true);
+ const incoming = null !== (_c2 = null === (_b3 = null === (_a3 = get(_setting).linkConfig) || void 0 === _a3 ? void 0 : _a3.incoming) || void 0 === _b3 ? void 0 : _b3.enabled) && void 0 !== _c2 ? _c2 : false, outgoing = null !== (_f = null === (_e = null === (_d = get(_setting).linkConfig) || void 0 === _d ? void 0 : _d.outgoing) || void 0 === _e ? void 0 : _e.enabled) && void 0 !== _f ? _f : false;
+ if (!incoming && !outgoing) {
+ let newSet = {
+ ...get(_setting)
+ };
+ newSet.linkConfig.incoming.enabled = true;
+ newSet.linkConfig.outgoing.enabled = true;
+ if ($$props.saveSettings) $$props.saveSettings(newSet);
+ set(bothEnabled, true);
+ } else {
+ set(outgoingEnabled, !incoming && outgoing, true);
+ set(incomingEnabled, incoming && !outgoing, true);
+ set(bothEnabled, incoming && outgoing, true);
+ }
+ set(onlyFDREnabled, get(_setting).linkShowOnlyFDR, true);
+ }));
+ let observer, showSearch = state(false), iconDivEl = state(void 0), newNoteIcon = state(""), folderIcon = state(""), upAndDownArrowsIcon = state(""), stackedLevels = state(""), searchIcon = state(""), switchIcon = state(""), outgoingIcon = state(""), incomingIcon = state(""), bothIcon = state(""), linkIcon = state(""), closeAllIcon = state("");
+ async function switchIncoming() {
+ let newSet = {
+ ...get(_setting)
+ };
+ newSet.linkConfig.incoming.enabled = true;
+ newSet.linkConfig.outgoing.enabled = false;
+ if ($$props.saveSettings) await $$props.saveSettings(newSet);
+ }
+ async function switchOutgoing() {
+ let newSet = {
+ ...get(_setting)
+ };
+ newSet.linkConfig.incoming.enabled = false;
+ newSet.linkConfig.outgoing.enabled = true;
+ if ($$props.saveSettings) await $$props.saveSettings(newSet);
+ }
+ async function switchBoth() {
+ let newSet = {
+ ...get(_setting)
+ };
+ newSet.linkConfig.incoming.enabled = true;
+ newSet.linkConfig.outgoing.enabled = true;
+ if ($$props.saveSettings) await $$props.saveSettings(newSet);
+ }
+ async function switchOnlyFDR() {
+ let newSet = {
+ ...get(_setting)
+ };
+ newSet.linkShowOnlyFDR = !get(_setting).linkShowOnlyFDR;
+ if ($$props.saveSettings) await $$props.saveSettings(newSet);
+ }
+ let scrollParent, observingElements = new Map, observingElQueue = [];
+ function unobserve(el) {
+ null == observer || observer.unobserve(el);
+ }
+ function observeAllQueued() {
+ observingElQueue.forEach((el => {
+ null == observer || observer.observe(el);
+ }));
+ observingElQueue = [];
+ }
+ setContext("observer", {
+ observe: function observe(el, callback) {
+ if (!observer) observingElQueue.push(el); else if (observingElQueue.length > 0) observeAllQueued();
+ if (observingElements.has(el)) {
+ unobserve(el);
+ observingElements.delete(el);
+ }
+ observingElements.set(el, {
+ callback,
+ lastState: void 0
+ });
+ null == observer || observer.observe(el);
+ },
+ unobserve
+ });
+ onMount((() => {
+ observer = new IntersectionObserver((ex => {
+ for (const v of ex) if (observingElements.has(v.target)) {
+ const tg = observingElements.get(v.target);
+ if (tg && tg.lastState !== v.isIntersecting) {
+ tg.lastState = v.isIntersecting;
+ setTimeout((() => tg.callback(v.isIntersecting)), 10);
+ }
+ }
+ }), {
+ root: scrollParent,
+ rootMargin: "40px 0px",
+ threshold: 0
+ });
+ observeAllQueued();
+ if (get(iconDivEl)) {
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "right-triangle");
+ set(folderIcon, `${get(iconDivEl).innerHTML}`);
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "lucide-edit");
+ set(newNoteIcon, `${get(iconDivEl).innerHTML}`);
+ if (get(isMainTree)) {
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "lucide-sort-asc");
+ set(upAndDownArrowsIcon, get(iconDivEl).innerHTML, true);
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "stacked-levels");
+ set(stackedLevels, get(iconDivEl).innerHTML, true);
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "search");
+ set(searchIcon, get(iconDivEl).innerHTML, true);
+ }
+ if ("links" == viewType()) {
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "links-coming-in");
+ set(incomingIcon, get(iconDivEl).innerHTML, true);
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "links-going-out");
+ set(outgoingIcon, get(iconDivEl).innerHTML, true);
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "link");
+ set(linkIcon, get(iconDivEl).innerHTML, true);
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "lucide-link-2");
+ set(bothIcon, get(iconDivEl).innerHTML, true);
+ }
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "lucide-arrow-left-right");
+ set(switchIcon, get(iconDivEl).innerHTML, true);
+ (0, import_obsidian3.setIcon)(get(iconDivEl), "lucide-chevrons-down-up");
+ set(closeAllIcon, get(iconDivEl).innerHTML, true);
+ }
+ const int = setInterval((() => {
+ performHide.set(Date.now());
+ }), 5e3);
+ return () => {
+ clearInterval(int);
+ };
+ }));
+ onDestroy((() => {
+ null == observer || observer.disconnect();
+ }));
+ let headerTitle = user_derived((() => "" == title() ? `${"tags" == viewType() ? "Tags" : "Links"}: ${vaultName()}` : `Items: ${title()}`));
+ const viewItems = user_derived((() => {
+ var _a3;
+ if (!get(viewItemsSrc)) return [];
+ if (get(isMainTree)) return get(viewItemsSrc);
+ let items = get(viewItemsSrc);
+ const lowerTags = tags().map((e => e.toLowerCase()));
+ for (const tag of lowerTags) items = items.filter((e => e.tags.some((e2 => (e2.toLowerCase() + "/").startsWith(tag)))));
+ const firstLevel = trimTrailingSlash(null !== (_a3 = tags().first()) && void 0 !== _a3 ? _a3 : "").toLowerCase(), archiveTags = get(_setting).archiveTags.toLowerCase().replace(/[\n ]/g, "").split(",");
+ if (!archiveTags.contains(firstLevel)) items = items.filter((item => !item.tags.some((e => archiveTags.contains(e.toLowerCase())))));
+ return items;
+ }));
+ setContext("viewID", `${Math.random()}`);
+ var fragment = root5(), div = first_child(fragment);
+ bind_this(div, ($$value => set(iconDivEl, $$value)), (() => get(iconDivEl)));
+ var div_1 = sibling(div, 2), div_2 = child(div_1), div_3 = child(div_2);
+ div_3.__click = function(...$$args) {
+ var _a3;
+ null == (_a3 = $$props.newNote) || _a3.apply(this, $$args);
+ };
+ html(child(div_3), (() => get(newNoteIcon)), false, false);
+ reset(div_3);
+ var node_1 = sibling(div_3, 2), consequent = $$anchor2 => {
+ var fragment_1 = root_13(), div_4 = first_child(fragment_1);
+ div_4.__click = function(...$$args) {
+ var _a3;
+ null == (_a3 = $$props.showOrder) || _a3.apply(this, $$args);
+ };
+ html(child(div_4), (() => get(upAndDownArrowsIcon)), false, false);
+ reset(div_4);
+ var div_5 = sibling(div_4, 2);
+ div_5.__click = function(...$$args) {
+ var _a3;
+ null == (_a3 = $$props.showLevelSelect) || _a3.apply(this, $$args);
+ };
+ html(child(div_5), (() => get(stackedLevels)), false, false);
+ reset(div_5);
+ var div_6 = sibling(div_5, 2);
+ div_6.__click = [ toggleSearch, showSearch, $searchString ];
+ html(child(div_6), (() => get(searchIcon)), false, false);
+ reset(div_6);
+ template_effect((() => set_class(div_6, 1, "clickable-icon nav-action-button " + (get(showSearch) ? " is-active" : ""), "svelte-1xm87ro")));
+ append($$anchor2, fragment_1);
+ };
+ if_block(node_1, ($$render => {
+ if (get(isMainTree)) $$render(consequent);
+ }));
+ var node_5 = sibling(node_1, 2), consequent_1 = $$anchor2 => {
+ var div_7 = root_23();
+ div_7.__click = [ doSwitch, $$props ];
+ html(child(div_7), (() => get(switchIcon)), false, false);
+ reset(div_7);
+ append($$anchor2, div_7);
+ };
+ if_block(node_5, ($$render => {
+ if ($$props.isViewSwitchable) $$render(consequent_1);
+ }));
+ var node_7 = sibling(node_5, 2), consequent_2 = $$anchor2 => {
+ var fragment_2 = root_3(), div_8 = first_child(fragment_2);
+ let classes;
+ div_8.__click = switchIncoming;
+ html(child(div_8), (() => get(incomingIcon)), false, false);
+ reset(div_8);
+ var div_9 = sibling(div_8, 2);
+ let classes_1;
+ div_9.__click = switchOutgoing;
+ html(child(div_9), (() => get(outgoingIcon)), false, false);
+ reset(div_9);
+ var div_10 = sibling(div_9, 2);
+ let classes_2;
+ div_10.__click = switchBoth;
+ html(child(div_10), (() => get(bothIcon)), false, false);
+ reset(div_10);
+ var div_11 = sibling(div_10, 2);
+ let classes_3;
+ div_11.__click = switchOnlyFDR;
+ html(child(div_11), (() => get(linkIcon)), false, false);
+ reset(div_11);
+ template_effect((($0, $1, $2, $3) => {
+ classes = set_class(div_8, 1, "clickable-icon nav-action-button", null, classes, $0);
+ classes_1 = set_class(div_9, 1, "clickable-icon nav-action-button", null, classes_1, $1);
+ classes_2 = set_class(div_10, 1, "clickable-icon nav-action-button", null, classes_2, $2);
+ classes_3 = set_class(div_11, 1, "clickable-icon nav-action-button", null, classes_3, $3);
+ }), [ () => ({
+ "is-active": get(incomingEnabled)
+ }), () => ({
+ "is-active": get(outgoingEnabled)
+ }), () => ({
+ "is-active": get(bothEnabled)
+ }), () => ({
+ "is-active": get(onlyFDREnabled)
+ }) ]);
+ append($$anchor2, fragment_2);
+ };
+ if_block(node_7, ($$render => {
+ if ("links" == viewType()) $$render(consequent_2);
+ }));
+ var node_12 = sibling(node_7, 2), consequent_3 = $$anchor2 => {
+ var div_12 = root_42();
+ div_12.__click = [ closeAllOpenedFolders ];
+ html(child(div_12), (() => get(closeAllIcon)), false, false);
+ reset(div_12);
+ append($$anchor2, div_12);
+ };
+ if_block(node_12, ($$render => {
+ if (get(isMainTree)) $$render(consequent_3);
+ }));
+ reset(div_2);
+ reset(div_1);
+ var node_14 = sibling(div_1, 2), consequent_4 = $$anchor2 => {
+ var div_13 = root_5(), div_14 = child(div_13), input = child(div_14);
+ remove_input_defaults(input);
+ var div_15 = sibling(input, 2);
+ div_15.__click = [ clearSearch, $searchString ];
+ reset(div_14);
+ reset(div_13);
+ template_effect(($0 => set_style(div_15, `display:${null != $0 ? $0 : ""};`)), [ () => "" == $searchString().trim() ? "none" : "" ]);
+ bind_value(input, $searchString, ($$value => store_set(searchString, $$value)));
+ append($$anchor2, div_13);
+ };
+ if_block(node_14, ($$render => {
+ if (get(showSearch) && get(isMainTree)) $$render(consequent_4);
+ }));
+ var div_16 = sibling(node_14, 2);
+ V2TreeFolderComponent_1(child(div_16), {
+ get viewType() {
+ return viewType();
+ },
+ get items() {
+ return get(viewItems);
+ },
+ get folderIcon() {
+ return get(folderIcon);
+ },
+ thisName: "",
+ isRoot: true,
+ get showMenu() {
+ return $$props.showMenu;
+ },
+ get openFile() {
+ return $$props.openFile;
+ },
+ get isMainTree() {
+ return get(isMainTree);
+ },
+ get hoverPreview() {
+ return $$props.hoverPreview;
+ },
+ get openScrollView() {
+ return $$props.openScrollView;
+ },
+ depth: 1,
+ get headerTitle() {
+ return get(headerTitle);
+ }
+ });
+ reset(div_16);
+ bind_this(div_16, ($$value => scrollParent = $$value), (() => scrollParent));
+ append($$anchor, fragment);
+ pop();
+ $$cleanup();
+}
+
+delegate([ "click" ]);
+
+var import_obsidian5 = require("obsidian"), import_obsidian4 = require("obsidian"), askString = (app, title, placeholder, initialText) => new Promise((res => {
+ new PopoverSelectString(app, title, placeholder, initialText, (result => res(result))).open();
+})), PopoverSelectString = class extends import_obsidian4.SuggestModal {
+ constructor(app, title, placeholder, initialText, callback) {
+ super(app);
+ this.callback = () => {};
+ this.title = "";
+ this.app = app;
+ this.title = title;
+ this.setPlaceholder(null != placeholder ? placeholder : ">");
+ this.callback = callback;
+ setTimeout((() => {
+ this.inputEl.value = initialText;
+ }));
+ const parent = this.containerEl.querySelector(".prompt");
+ if (parent) parent.addClass("override-input");
+ }
+ getSuggestions(query) {
+ return [ query ];
+ }
+ renderSuggestion(value, el) {
+ el.createDiv({
+ text: `${this.title}${value}`
+ });
+ }
+ onChooseSuggestion(item, evt) {
+ var _a3;
+ null == (_a3 = this.callback) || _a3.call(this, item);
+ this.callback = void 0;
+ }
+ onClose() {
+ setTimeout((() => {
+ if (this.callback) this.callback(false);
+ }), 100);
+ }
+};
+
+function toggleObjectProp(obj, propName, value) {
+ if (false === value) {
+ const newTagInfoEntries = Object.entries(obj || {}).filter((([key]) => key != propName));
+ if (0 == newTagInfoEntries.length) return {}; else return Object.fromEntries(newTagInfoEntries);
+ } else return {
+ ...null != obj ? obj : {},
+ [propName]: value
+ };
+}
+
+var TagFolderViewBase = class extends import_obsidian5.ItemView {
+ constructor() {
+ super(...arguments);
+ this.navigation = false;
+ }
+ async saveSettings(settings) {
+ this.plugin.settings = {
+ ...this.plugin.settings,
+ ...settings
+ };
+ await this.plugin.saveSettings();
+ this.plugin.updateFileCaches();
+ }
+ showOrder(evt) {
+ const menu = new import_obsidian5.Menu;
+ menu.addItem((item => {
+ item.setTitle("Tags").setIcon("hashtag").onClick((evt2 => {
+ const menu2 = new import_obsidian5.Menu;
+ for (const key in OrderKeyTag) for (const direction in OrderDirection) menu2.addItem((item2 => {
+ const newSetting = `${key}_${direction}`;
+ item2.setTitle(OrderKeyTag[key] + " " + OrderDirection[direction]).onClick((async () => {
+ this.plugin.settings.sortTypeTag = newSetting;
+ await this.plugin.saveSettings();
+ }));
+ if (newSetting == this.plugin.settings.sortTypeTag) item2.setIcon("checkmark");
+ return item2;
+ }));
+ menu2.showAtPosition({
+ x: evt.x,
+ y: evt.y
+ });
+ }));
+ return item;
+ }));
+ menu.addItem((item => {
+ item.setTitle("Items").setIcon("document").onClick((evt2 => {
+ const menu2 = new import_obsidian5.Menu;
+ for (const key in OrderKeyItem) for (const direction in OrderDirection) menu2.addItem((item2 => {
+ const newSetting = `${key}_${direction}`;
+ item2.setTitle(OrderKeyItem[key] + " " + OrderDirection[direction]).onClick((async () => {
+ this.plugin.settings.sortType = newSetting;
+ await this.plugin.saveSettings();
+ }));
+ if (newSetting == this.plugin.settings.sortType) item2.setIcon("checkmark");
+ return item2;
+ }));
+ menu2.showAtPosition({
+ x: evt.x,
+ y: evt.y
+ });
+ }));
+ return item;
+ }));
+ menu.showAtMouseEvent(evt);
+ }
+ showLevelSelect(evt) {
+ const menu = new import_obsidian5.Menu, setLevel = async level => {
+ this.plugin.settings.expandLimit = level;
+ await this.plugin.saveSettings();
+ maxDepth.set(level);
+ };
+ for (const level of [ 2, 3, 4, 5 ]) menu.addItem((item => {
+ item.setTitle("Level " + (level - 1)).onClick((() => {
+ setLevel(level);
+ }));
+ if (this.plugin.settings.expandLimit == level) item.setIcon("checkmark");
+ return item;
+ }));
+ menu.addItem((item => {
+ item.setTitle("No limit").onClick((() => {
+ setLevel(0);
+ }));
+ if (0 == this.plugin.settings.expandLimit) item.setIcon("checkmark");
+ return item;
+ }));
+ menu.showAtMouseEvent(evt);
+ }
+ showMenu(evt, trail, targetTag, targetItems) {
+ const isTagTree = this.getViewType() == VIEW_TYPE_TAGFOLDER, menu = new import_obsidian5.Menu;
+ if (isTagTree) {
+ const expandedTagsAll = ancestorToLongestTag(ancestorToTags(joinPartialPath(removeIntermediatePath(trail)))).map((e => trimTrailingSlash(e))), expandedTags = expandedTagsAll.map((e => e.split("/").filter((ee => !isSpecialTag(ee))).join("/"))).filter((e => "" != e)).map((e => "#" + e)).join(" ").trim(), displayExpandedTags = expandedTagsAll.map((e => e.split("/").filter((ee => renderSpecialTag(ee))).join("/"))).filter((e => "" != e)).map((e => "#" + e)).join(" ").trim();
+ if (navigator && navigator.clipboard) menu.addItem((item => item.setTitle(`Copy tags:${expandedTags}`).setIcon("hashtag").onClick((async () => {
+ await navigator.clipboard.writeText(expandedTags);
+ new import_obsidian5.Notice("Copied");
+ }))));
+ menu.addItem((item => item.setTitle("New note " + (targetTag ? "in here" : "as like this")).setIcon("create-new").onClick((async () => {
+ await this.plugin.createNewNote(trail);
+ }))));
+ if (targetTag) if (this.plugin.settings.useTagInfo && null != this.plugin.tagInfo) {
+ const tag = targetTag;
+ if (tag in this.plugin.tagInfo && "key" in this.plugin.tagInfo[tag]) menu.addItem((item => item.setTitle("Unpin").setIcon("pin").onClick((async () => {
+ this.plugin.tagInfo[tag] = toggleObjectProp(this.plugin.tagInfo[tag], "key", false);
+ this.plugin.applyTagInfo();
+ await this.plugin.saveTagInfo();
+ })))); else menu.addItem((item => {
+ item.setTitle("Pin").setIcon("pin").onClick((async () => {
+ this.plugin.tagInfo[tag] = toggleObjectProp(this.plugin.tagInfo[tag], "key", "");
+ this.plugin.applyTagInfo();
+ await this.plugin.saveTagInfo();
+ }));
+ }));
+ menu.addItem((item => {
+ item.setTitle("Set an alternative label").setIcon("pencil").onClick((async () => {
+ var _a3;
+ const oldAlt = tag in this.plugin.tagInfo ? null != (_a3 = this.plugin.tagInfo[tag].alt) ? _a3 : "" : "", label = await askString(this.app, "", "", oldAlt);
+ if (false !== label) {
+ this.plugin.tagInfo[tag] = toggleObjectProp(this.plugin.tagInfo[tag], "alt", "" == label ? false : label);
+ this.plugin.applyTagInfo();
+ await this.plugin.saveTagInfo();
+ }
+ }));
+ }));
+ menu.addItem((item => {
+ item.setTitle("Change the mark").setIcon("pencil").onClick((async () => {
+ var _a3;
+ const oldMark = tag in this.plugin.tagInfo ? null != (_a3 = this.plugin.tagInfo[tag].mark) ? _a3 : "" : "", mark = await askString(this.app, "", "", oldMark);
+ if (false !== mark) {
+ this.plugin.tagInfo[tag] = toggleObjectProp(this.plugin.tagInfo[tag], "mark", "" == mark ? false : mark);
+ this.plugin.applyTagInfo();
+ await this.plugin.saveTagInfo();
+ }
+ }));
+ }));
+ menu.addItem((item => {
+ item.setTitle("Redirect this tag to ...").setIcon("pencil").onClick((async () => {
+ var _a3;
+ const oldRedirect = tag in this.plugin.tagInfo ? null != (_a3 = this.plugin.tagInfo[tag].redirect) ? _a3 : "" : "", redirect = await askString(this.app, "", "", oldRedirect);
+ if (false !== redirect) {
+ this.plugin.tagInfo[tag] = toggleObjectProp(this.plugin.tagInfo[tag], "redirect", "" == redirect ? false : redirect);
+ this.plugin.applyTagInfo();
+ await this.plugin.saveTagInfo();
+ }
+ }));
+ }));
+ if (targetItems) {
+ menu.addItem((item => {
+ item.setTitle("Open scroll view").setIcon("sheets-in-box").onClick((async () => {
+ const files = targetItems.map((e => e.path));
+ await this.plugin.openScrollView(void 0, displayExpandedTags, expandedTagsAll.join(", "), files);
+ }));
+ }));
+ menu.addItem((item => {
+ item.setTitle("Open list").setIcon("sheets-in-box").onClick((() => {
+ selectedTags.set(expandedTagsAll);
+ }));
+ }));
+ }
+ }
+ }
+ if (!targetTag && targetItems && 1 == targetItems.length) {
+ const path = targetItems[0].path, file = this.app.vault.getAbstractFileByPath(path);
+ this.app.workspace.trigger("file-menu", menu, file, "file-explorer");
+ menu.addSeparator();
+ menu.addItem((item => item.setTitle("Open in new tab").setSection("open").setIcon("lucide-file-plus").onClick((async () => {
+ await this.app.workspace.openLinkText(path, path, "tab");
+ }))));
+ menu.addItem((item => item.setTitle("Open to the right").setSection("open").setIcon("lucide-separator-vertical").onClick((async () => {
+ await this.app.workspace.openLinkText(path, path, "split");
+ }))));
+ } else if (!isTagTree && targetTag) {
+ const path = targetTag, file = this.app.vault.getAbstractFileByPath(path);
+ this.app.workspace.trigger("file-menu", menu, file, "file-explorer");
+ menu.addSeparator();
+ menu.addItem((item => item.setTitle("Open in new tab").setSection("open").setIcon("lucide-file-plus").onClick((async () => {
+ await this.app.workspace.openLinkText(path, path, "tab");
+ }))));
+ menu.addItem((item => item.setTitle("Open to the right").setSection("open").setIcon("lucide-separator-vertical").onClick((async () => {
+ await this.app.workspace.openLinkText(path, path, "split");
+ }))));
+ }
+ if ("screenX" in evt) menu.showAtPosition({
+ x: evt.pageX,
+ y: evt.pageY
+ }); else menu.showAtPosition({
+ x: evt.nativeEvent.locationX,
+ y: evt.nativeEvent.locationY
+ });
+ evt.preventDefault();
+ }
+ switchView() {
+ let viewType = VIEW_TYPE_TAGFOLDER;
+ const currentType = this.getViewType();
+ if (currentType == VIEW_TYPE_TAGFOLDER) viewType = VIEW_TYPE_TAGFOLDER_LIST; else if (currentType == VIEW_TYPE_TAGFOLDER_LINK) return; else if (currentType == VIEW_TYPE_TAGFOLDER_LIST) viewType = VIEW_TYPE_TAGFOLDER;
+ const leaves = this.app.workspace.getLeavesOfType(viewType).filter((e => !e.getViewState().pinned && e != this.leaf));
+ if (leaves.length) this.app.workspace.revealLeaf(leaves[0]);
+ }
+}, TagFolderView = class extends TagFolderViewBase {
+ constructor(leaf, plugin, viewType) {
+ super(leaf);
+ this.icon = "stacked-levels";
+ this.plugin = plugin;
+ this.showMenu = this.showMenu.bind(this);
+ this.showOrder = this.showOrder.bind(this);
+ this.newNote = this.newNote.bind(this);
+ this.showLevelSelect = this.showLevelSelect.bind(this);
+ this.switchView = this.switchView.bind(this);
+ this.treeViewType = viewType;
+ }
+ getIcon() {
+ return "stacked-levels";
+ }
+ newNote(evt) {
+ this.app.commands.executeCommandById("file-explorer:new-file");
+ }
+ getViewType() {
+ return "tags" == this.treeViewType ? VIEW_TYPE_TAGFOLDER : VIEW_TYPE_TAGFOLDER_LINK;
+ }
+ getDisplayText() {
+ return "tags" == this.treeViewType ? "Tag Folder" : "Link Folder";
+ }
+ async onOpen() {
+ this.containerEl.empty();
+ const app = mount(TagFolderViewComponent, {
+ target: this.containerEl,
+ props: {
+ openFile: this.plugin.focusFile,
+ hoverPreview: (a, b) => this.plugin.hoverPreview(a, b),
+ vaultName: this.app.vault.getName(),
+ showMenu: this.showMenu,
+ showLevelSelect: this.showLevelSelect,
+ showOrder: this.showOrder,
+ newNote: this.newNote,
+ openScrollView: this.plugin.openScrollView,
+ isViewSwitchable: this.plugin.settings.useMultiPaneList,
+ switchView: this.switchView,
+ viewType: this.treeViewType,
+ saveSettings: this.saveSettings.bind(this)
+ }
+ });
+ this.component = app;
+ return await Promise.resolve();
+ }
+ async onClose() {
+ await unmount(this.component);
+ this.component = void 0;
+ return await Promise.resolve();
+ }
+}, import_obsidian7 = require("obsidian"), TagFolderList = class extends TagFolderViewBase {
+ constructor(leaf, plugin) {
+ super(leaf);
+ this.icon = "stacked-levels";
+ this.title = "";
+ this.state = {
+ tags: [],
+ title: ""
+ };
+ this.stateStore = writable(this.state);
+ this.plugin = plugin;
+ this.showMenu = this.showMenu.bind(this);
+ this.showOrder = this.showOrder.bind(this);
+ this.newNote = this.newNote.bind(this);
+ this.showLevelSelect = this.showLevelSelect.bind(this);
+ this.switchView = this.switchView.bind(this);
+ }
+ onPaneMenu(menu, source2) {
+ super.onPaneMenu(menu, source2);
+ menu.addItem((item => {
+ item.setIcon("pin").setTitle("Pin").onClick((() => {
+ this.leaf.togglePinned();
+ }));
+ }));
+ }
+ getIcon() {
+ return "stacked-levels";
+ }
+ async setState(state2, result) {
+ this.state = {
+ ...this.state,
+ ...state2
+ };
+ this.title = state2.tags.join(",");
+ this.stateStore.set(this.state);
+ return await Promise.resolve();
+ }
+ getState() {
+ return this.state;
+ }
+ async newNote(evt) {
+ await this.plugin.createNewNote(this.state.tags);
+ }
+ getViewType() {
+ return VIEW_TYPE_TAGFOLDER_LIST;
+ }
+ getDisplayText() {
+ return `Files with ${this.state.title}`;
+ }
+ async onOpen() {
+ this.containerEl.empty();
+ this.component = mount(TagFolderViewComponent, {
+ target: this.containerEl,
+ props: {
+ openFile: this.plugin.focusFile,
+ hoverPreview: this.plugin.hoverPreview,
+ title: "",
+ showMenu: this.showMenu,
+ showLevelSelect: this.showLevelSelect,
+ showOrder: this.showOrder,
+ newNote: this.newNote,
+ openScrollView: this.plugin.openScrollView,
+ isViewSwitchable: this.plugin.settings.useMultiPaneList,
+ switchView: this.switchView,
+ saveSettings: this.saveSettings.bind(this),
+ stateStore: this.stateStore
+ }
+ });
+ return await Promise.resolve();
+ }
+ async onClose() {
+ if (this.component) {
+ await unmount(this.component);
+ this.component = void 0;
+ }
+ return await Promise.resolve();
+ }
+}, HideItemsType = {
+ NONE: "Hide nothing",
+ DEDICATED_INTERMIDIATES: "Only intermediates of nested tags",
+ ALL_EXCEPT_BOTTOM: "All intermediates"
+};
+
+function dotted(object, notation) {
+ return notation.split(".").reduce(((a, b) => a && b in a ? a[b] : null), object);
+}
+
+function getCompareMethodItems(settings) {
+ const invert = settings.sortType.contains("_DESC") ? -1 : 1;
+ switch (settings.sortType) {
+ case "DISPNAME_ASC":
+ case "DISPNAME_DESC":
+ return (a, b) => compare(a.displayName, b.displayName) * invert;
+
+ case "FULLPATH_ASC":
+ case "FULLPATH_DESC":
+ return (a, b) => compare(a.path, b.path) * invert;
+
+ case "MTIME_ASC":
+ case "MTIME_DESC":
+ return (a, b) => (a.mtime - b.mtime) * invert;
+
+ case "CTIME_ASC":
+ case "CTIME_DESC":
+ return (a, b) => (a.ctime - b.ctime) * invert;
+
+ case "NAME_ASC":
+ case "NAME_DESC":
+ return (a, b) => compare(a.filename, b.filename) * invert;
+
+ default:
+ console.warn("Compare method (items) corrupted");
+ return (a, b) => compare(a.displayName, b.displayName) * invert;
+ }
+}
+
+function onElement(el, event2, selector, callback, options) {
+ el.on(event2, selector, callback, options);
+ return () => el.off(event2, selector, callback, options);
+}
+
+var TagFolderPlugin5 = class extends import_obsidian8.Plugin {
+ constructor() {
+ super(...arguments);
+ this.settings = {
+ ...DEFAULT_SETTINGS
+ };
+ this.expandedFolders = [ "root" ];
+ this.currentOpeningFile = "";
+ this.searchString = "";
+ this.allViewItems = [];
+ this.allViewItemsByLink = [];
+ this.compareItems = (_, __) => 0;
+ this.focusFile = (path, specialKey) => {
+ if (this.currentOpeningFile == path) return;
+ const _targetFile = this.app.vault.getAbstractFileByPath(path), targetFile = _targetFile instanceof import_obsidian8.TFile ? _targetFile : this.app.vault.getFiles().find((f => f.path === path));
+ if (targetFile) if (specialKey) this.app.workspace.openLinkText(targetFile.path, targetFile.path, "tab"); else this.app.workspace.openLinkText(targetFile.path, targetFile.path);
+ };
+ this.fileCaches = [];
+ this.oldFileCache = "";
+ this.parsedFileCache = new Map;
+ this.lastSettings = "";
+ this.lastSearchString = "";
+ this.processingFileInfo = false;
+ this.loadFileQueue = [];
+ this.loadFileTimer = void 0;
+ this.tagInfo = {};
+ this.tagInfoFrontMatterBuffer = {};
+ this.skipOnce = false;
+ this.tagInfoBody = "";
+ }
+ getView() {
+ for (const leaf of this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER)) {
+ const view = leaf.view;
+ if (view instanceof TagFolderView) return view;
+ }
+ return null;
+ }
+ getLinkView() {
+ for (const leaf of this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER_LINK)) {
+ const view = leaf.view;
+ if (view instanceof TagFolderView) return view;
+ }
+ return null;
+ }
+ hoverPreview(e, path) {
+ this.app.workspace.trigger("hover-link", {
+ event: e,
+ source: "file-explorer",
+ hoverParent: this,
+ targetEl: e.target,
+ linktext: path
+ });
+ }
+ setSearchString(search) {
+ searchString.set(search);
+ }
+ getFileTitle(file) {
+ if (!this.settings.useTitle) return file.basename;
+ const metadata = this.app.metadataCache.getCache(file.path);
+ if ((null == metadata ? void 0 : metadata.frontmatter) && this.settings.frontmatterKey) {
+ const d = dotted(metadata.frontmatter, this.settings.frontmatterKey);
+ if (d) return `${d}`;
+ }
+ if (null == metadata ? void 0 : metadata.headings) {
+ const h1 = metadata.headings.find((e => 1 == e.level));
+ if (h1) return h1.heading;
+ }
+ return file.basename;
+ }
+ getDisplayName(file) {
+ const filename = this.getFileTitle(file) || file.basename;
+ if ("NAME" == this.settings.displayMethod) return filename;
+ const path = file.path.split("/");
+ path.pop();
+ const displayPath = path.join("/");
+ if ("NAME : PATH" == this.settings.displayMethod) return `${filename} : ${displayPath}`;
+ if ("PATH/NAME" == this.settings.displayMethod) return `${displayPath}/${filename}`; else return filename;
+ }
+ async onload() {
+ await this.loadSettings();
+ this.hoverPreview = this.hoverPreview.bind(this);
+ this.modifyFile = this.modifyFile.bind(this);
+ this.setSearchString = this.setSearchString.bind(this);
+ this.openScrollView = this.openScrollView.bind(this);
+ this.loadFileInfo = (0, import_obsidian8.debounce)(this.loadFileInfo.bind(this), this.settings.scanDelay, true);
+ pluginInstance.set(this);
+ this.registerView(VIEW_TYPE_TAGFOLDER, (leaf => new TagFolderView(leaf, this, "tags")));
+ this.registerView(VIEW_TYPE_TAGFOLDER_LINK, (leaf => new TagFolderView(leaf, this, "links")));
+ this.registerView(VIEW_TYPE_TAGFOLDER_LIST, (leaf => new TagFolderList(leaf, this)));
+ this.registerView(VIEW_TYPE_SCROLL, (leaf => new ScrollView(leaf, this)));
+ this.app.workspace.onLayoutReady((async () => {
+ this.loadFileInfo();
+ if (this.settings.alwaysOpen) {
+ await this.initView();
+ await this.activateView();
+ }
+ if (this.settings.useTagInfo) await this.loadTagInfo();
+ }));
+ this.addCommand({
+ id: "tagfolder-open",
+ name: "Show Tag Folder",
+ callback: () => {
+ this.activateView();
+ }
+ });
+ this.addCommand({
+ id: "tagfolder-link-open",
+ name: "Show Link Folder",
+ callback: () => {
+ this.activateViewLink();
+ }
+ });
+ this.addCommand({
+ id: "tagfolder-rebuild-tree",
+ name: "Force Rebuild",
+ callback: () => {
+ this.refreshAllTree();
+ }
+ });
+ this.addCommand({
+ id: "tagfolder-create-similar",
+ name: "Create a new note with the same tags",
+ editorCallback: async (editor, view) => {
+ var _a3;
+ const file = null == view ? void 0 : view.file;
+ if (!file) return;
+ const cache = this.app.metadataCache.getFileCache(file);
+ if (!cache) return;
+ const tagsWithoutPrefix = (null != (_a3 = (0, import_obsidian8.getAllTags)(cache)) ? _a3 : []).map((e => trimPrefix(e, "#")));
+ await this.createNewNote(tagsWithoutPrefix);
+ }
+ });
+ this.metadataCacheChanged = this.metadataCacheChanged.bind(this);
+ this.watchWorkspaceOpen = this.watchWorkspaceOpen.bind(this);
+ this.metadataCacheResolve = this.metadataCacheResolve.bind(this);
+ this.metadataCacheResolved = this.metadataCacheResolved.bind(this);
+ this.loadFileInfo = this.loadFileInfo.bind(this);
+ this.registerEvent(this.app.metadataCache.on("changed", this.metadataCacheChanged));
+ this.registerEvent(this.app.metadataCache.on("resolve", this.metadataCacheResolve));
+ this.registerEvent(this.app.metadataCache.on("resolved", this.metadataCacheResolved));
+ this.refreshAllTree = this.refreshAllTree.bind(this);
+ this.refreshTree = this.refreshTree.bind(this);
+ this.registerEvent(this.app.vault.on("rename", this.refreshTree));
+ this.registerEvent(this.app.vault.on("delete", this.refreshTree));
+ this.registerEvent(this.app.vault.on("modify", this.modifyFile));
+ this.registerEvent(this.app.workspace.on("file-open", this.watchWorkspaceOpen));
+ this.watchWorkspaceOpen(this.app.workspace.getActiveFile());
+ this.addSettingTab(new TagFolderSettingTab(this.app, this));
+ maxDepth.set(this.settings.expandLimit);
+ searchString.subscribe((search => {
+ this.searchString = search;
+ this.refreshAllTree();
+ }));
+ const setTagSearchString = (event2, tagString) => {
+ if (tagString) {
+ const regExpTagStr = new RegExp(`(^|\\s)${tagString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\s|$)`, "u"), regExpTagStrInv = new RegExp(`(^|\\s)-${tagString.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}(\\s|$)`, "u");
+ if (event2.altKey) return; else if (event2.ctrlKey && event2.shiftKey) {
+ if (this.searchString.match(regExpTagStr)) this.setSearchString(this.searchString.replace(regExpTagStr, "")); else if (!this.searchString.match(regExpTagStrInv)) this.setSearchString(this.searchString + (0 == this.searchString.length ? "" : " ") + `-${tagString}`);
+ } else if (event2.ctrlKey) {
+ if (this.searchString.match(regExpTagStrInv)) this.setSearchString(this.searchString.replace(regExpTagStrInv, "")); else if (!this.searchString.match(regExpTagStr)) this.setSearchString(this.searchString + (0 == this.searchString.length ? "" : " ") + `${tagString}`);
+ } else this.setSearchString(tagString);
+ event2.preventDefault();
+ event2.stopPropagation();
+ }
+ };
+ this.register(onElement(document, "click", 'a.tag[href^="#"]', ((event2, targetEl) => {
+ var _a3;
+ if (!this.settings.overrideTagClicking) return;
+ const tagString = targetEl.innerText.substring(1);
+ if (tagString) {
+ setTagSearchString(event2, tagString);
+ const leaf = null == (_a3 = this.getView()) ? void 0 : _a3.leaf;
+ if (leaf) this.app.workspace.revealLeaf(leaf);
+ }
+ }), {
+ capture: true
+ }));
+ this.register(onElement(document, "click", "span.cm-hashtag.cm-meta", ((event2, targetEl) => {
+ var _a3;
+ if (!this.settings.overrideTagClicking) return;
+ let enumTags = targetEl, tagString = "";
+ for (;!enumTags.classList.contains("cm-hashtag-begin"); ) {
+ enumTags = enumTags.previousElementSibling;
+ if (!enumTags) {
+ console.log("Error! start tag not found.");
+ return;
+ }
+ }
+ do {
+ if (enumTags instanceof HTMLElement) {
+ tagString += enumTags.innerText;
+ if (enumTags.classList.contains("cm-hashtag-end")) break;
+ }
+ enumTags = enumTags.nextElementSibling;
+ } while (enumTags);
+ tagString = tagString.substring(1);
+ setTagSearchString(event2, tagString);
+ const leaf = null == (_a3 = this.getView()) ? void 0 : _a3.leaf;
+ if (leaf) this.app.workspace.revealLeaf(leaf);
+ }), {
+ capture: true
+ }));
+ selectedTags.subscribe((newTags => {
+ this.openListView(newTags);
+ }));
+ }
+ watchWorkspaceOpen(file) {
+ if (file) this.currentOpeningFile = file.path; else this.currentOpeningFile = "";
+ currentFile.set(this.currentOpeningFile);
+ }
+ metadataCacheChanged(file) {
+ this.loadFileInfoAsync(file);
+ }
+ metadataCacheResolve(file) {
+ if (null != this.getLinkView()) this.loadFileInfoAsync(file);
+ }
+ metadataCacheResolved() {
+ if (null != this.getLinkView()) ;
+ }
+ refreshTree(file, oldName) {
+ if (oldName) this.refreshAllTree(); else if (file instanceof import_obsidian8.TFile) this.loadFileInfo(file);
+ }
+ refreshAllTree() {
+ this.loadFileInfo();
+ }
+ getFileCacheLinks(file) {
+ const cachedLinks = this.app.metadataCache.resolvedLinks;
+ return [ ...(null == this.getLinkView() ? [] : parseAllReference(cachedLinks, file.path, this.settings.linkConfig)).filter((e => e.endsWith(".md"))).map((e => `${e}`)) ];
+ }
+ getFileCacheData(file) {
+ const metadata = this.app.metadataCache.getFileCache(file);
+ if (!metadata) return false; else return {
+ file,
+ links: this.getFileCacheLinks(file),
+ tags: (0, import_obsidian8.getAllTags)(metadata) || []
+ };
+ }
+ updateFileCachesAll() {
+ const caches = [ ...this.app.vault.getMarkdownFiles(), ...this.app.vault.getAllLoadedFiles().filter((e => "extension" in e && "canvas" == e.extension)) ].filter((file => {
+ var _a3;
+ return null != (_a3 = this.parsedFileCache.get(file.path)) ? _a3 : 0 != file.stat.mtime;
+ })).map((entry => this.getFileCacheData(entry))).filter((e => false !== e));
+ this.fileCaches = [ ...caches ];
+ return this.isFileCacheChanged();
+ }
+ isFileCacheChanged() {
+ const fileCacheDump = JSON.stringify(this.fileCaches.map((e => ({
+ path: e.file.path,
+ links: e.links,
+ tags: e.tags
+ }))));
+ if (this.oldFileCache == fileCacheDump) return false; else {
+ this.oldFileCache = fileCacheDump;
+ return true;
+ }
+ }
+ updateFileCaches(diffs = []) {
+ let anyUpdated = false;
+ if (0 == this.fileCaches.length || 0 == diffs.length) return this.updateFileCachesAll(); else {
+ const processDiffs = [ ...diffs ];
+ let newCaches = [ ...this.fileCaches ], diff = processDiffs.shift();
+ do {
+ const procDiff = diff;
+ if (!procDiff) break;
+ const old = newCaches.find((fileCache => fileCache.file.path == procDiff.path));
+ if (old) newCaches = newCaches.filter((fileCache => fileCache !== old));
+ const newCache = this.getFileCacheData(procDiff);
+ if (newCache) {
+ if (null != this.getLinkView()) {
+ const oldLinks = (null == old ? void 0 : old.links) || [], newLinks = newCache.links, diffs2 = unique([ ...oldLinks, ...newLinks ]).filter((link2 => !oldLinks.contains(link2) || !newLinks.contains(link2)));
+ for (const filename of diffs2) {
+ const file = this.app.vault.getAbstractFileByPath(filename);
+ if (file instanceof import_obsidian8.TFile) processDiffs.push(file);
+ }
+ }
+ newCaches.push(newCache);
+ }
+ anyUpdated = anyUpdated || JSON.stringify(fileCacheToCompare(old)) != JSON.stringify(fileCacheToCompare(newCache));
+ diff = processDiffs.shift();
+ } while (void 0 !== diff);
+ this.fileCaches = newCaches;
+ }
+ return anyUpdated;
+ }
+ async getItemsList(mode) {
+ const items = [], ignoreDocTags = this.settings.ignoreDocTags.toLowerCase().replace(/[\n ]/g, "").split(","), ignoreTags = this.settings.ignoreTags.toLowerCase().replace(/[\n ]/g, "").split(","), ignoreFolders = this.settings.ignoreFolders.toLowerCase().replace(/\n/g, "").split(",").map((e => e.trim())).filter((e => !!e)), targetFolders = this.settings.targetFolders.toLowerCase().replace(/\n/g, "").split(",").map((e => e.trim())).filter((e => !!e)), searchItems = this.searchString.toLowerCase().split("|").map((ee => ee.split(" ").map((e => e.trim())))), today = Date.now(), archiveTags = this.settings.archiveTags.toLowerCase().replace(/[\n ]/g, "").split(",");
+ for (const fileCache of this.fileCaches) {
+ if (targetFolders.length > 0 && !targetFolders.some((e => "" != e && fileCache.file.path.toLowerCase().startsWith(e)))) continue;
+ if (ignoreFolders.some((e => "" != e && fileCache.file.path.toLowerCase().startsWith(e)))) continue;
+ await doEvents();
+ const tagRedirectList = {};
+ if (this.settings.useTagInfo && this.tagInfo) for (const [key, taginfo] of Object.entries(this.tagInfo)) if (null == taginfo ? void 0 : taginfo.redirect) tagRedirectList[key] = taginfo.redirect;
+ let allTags = [];
+ if ("tag" == mode) {
+ const allTagsDocs = unique(fileCache.tags);
+ allTags = unique(allTagsDocs.map((e => e.substring(1))).map((e => e in tagRedirectList ? tagRedirectList[e] : e)));
+ } else allTags = unique(fileCache.links);
+ if (this.settings.disableNestedTags && "tag" == mode) allTags = allTags.map((e => e.split("/"))).flat();
+ if (0 == allTags.length) if ("tag" == mode) allTags = [ "_untagged" ]; else if ("link" == mode) allTags = [ "_unlinked" ];
+ if ("canvas" == fileCache.file.extension) allTags.push("_VIRTUAL_TAG_CANVAS");
+ if (this.settings.useVirtualTag) {
+ const disp = secondsToFreshness(today - fileCache.file.stat.mtime);
+ allTags.push(`_VIRTUAL_TAG_FRESHNESS/${disp}`);
+ }
+ if (this.settings.displayFolderAsTag) {
+ const path = [ "_VIRTUAL_TAG_FOLDER", ...fileCache.file.path.split("/") ];
+ path.pop();
+ if (path.length > 0) allTags.push(`${path.join("/")}`);
+ }
+ allTags = uniqueCaseIntensive(allTags.map((e => e in tagRedirectList ? tagRedirectList[e] : e)));
+ if (allTags.some((tag => ignoreDocTags.contains(tag.toLowerCase())))) continue;
+ if (searchItems.map((searchItem => {
+ let bx = false;
+ if (0 == allTags.length) return false;
+ for (const searchSrc of searchItem) {
+ let search = searchSrc, func = "contains";
+ if (search.startsWith("#")) {
+ search = search.substring(1);
+ func = "startsWith";
+ }
+ if (search.startsWith("-")) bx = bx || allTags.some((tag => tag.toLowerCase()[func](search.substring(1)))); else bx = bx || allTags.every((tag => !tag.toLowerCase()[func](search)));
+ }
+ return bx;
+ })).every((e => e))) continue;
+ allTags = allTags.filter((tag => !ignoreTags.contains(tag.toLowerCase())));
+ const links = [ ...fileCache.links ];
+ if (0 == links.length) links.push("_unlinked");
+ if (this.settings.disableNarrowingDown && "tag" == mode) {
+ const archiveTagsMatched = allTags.filter((e => archiveTags.contains(e.toLowerCase()))), targetTags = 0 == archiveTagsMatched.length ? allTags : archiveTagsMatched;
+ for (const tags of targetTags) items.push({
+ tags: [ tags ],
+ extraTags: allTags.filter((e => e != tags)),
+ path: fileCache.file.path,
+ displayName: this.getDisplayName(fileCache.file),
+ ancestors: [],
+ mtime: fileCache.file.stat.mtime,
+ ctime: fileCache.file.stat.ctime,
+ filename: fileCache.file.basename,
+ links
+ });
+ } else items.push({
+ tags: allTags,
+ extraTags: [],
+ path: fileCache.file.path,
+ displayName: this.getDisplayName(fileCache.file),
+ ancestors: [],
+ mtime: fileCache.file.stat.mtime,
+ ctime: fileCache.file.stat.ctime,
+ filename: fileCache.file.basename,
+ links
+ });
+ }
+ return items;
+ }
+ loadFileInfo(diff) {
+ this.loadFileInfoAsync(diff).then((e => {}));
+ }
+ isSettingChanged() {
+ const strSetting = JSON.stringify(this.settings), isSettingChanged = strSetting != this.lastSettings, isSearchStringModified = this.searchString != this.lastSearchString;
+ if (isSettingChanged) this.lastSettings = strSetting;
+ if (isSearchStringModified) this.lastSearchString = this.searchString;
+ return isSearchStringModified || isSettingChanged;
+ }
+ async loadFileInfos(diffs) {
+ if (!this.processingFileInfo) try {
+ this.processingFileInfo = true;
+ const cacheUpdated = this.updateFileCaches(diffs);
+ if (this.isSettingChanged() || cacheUpdated) {
+ appliedFiles.set(diffs.map((e => e.path)));
+ await this.applyFileInfoToView();
+ }
+ await this.applyUpdateIntoScroll(diffs);
+ const af = this.app.workspace.getActiveFile();
+ if (af && this.currentOpeningFile != af.path) {
+ this.currentOpeningFile = af.path;
+ currentFile.set(this.currentOpeningFile);
+ }
+ } finally {
+ this.processingFileInfo = false;
+ } else diffs.forEach((e => {
+ this.loadFileInfoAsync(e);
+ }));
+ }
+ async applyFileInfoToView() {
+ const itemsSorted = (await this.getItemsList("tag")).sort(this.compareItems);
+ this.allViewItems = itemsSorted;
+ allViewItems.set(this.allViewItems);
+ if (null != this.getLinkView()) {
+ const itemsLink = await this.getItemsList("link");
+ updateItemsLinkMap(itemsLink);
+ const itemsLinkSorted = itemsLink.sort(this.compareItems);
+ this.allViewItemsByLink = itemsLinkSorted;
+ allViewItemsByLink.set(this.allViewItemsByLink);
+ }
+ }
+ async loadFileInfoAsync(diff) {
+ if (diff) {
+ if (diff && this.loadFileQueue.some((e => e.path == (null == diff ? void 0 : diff.path)))) ; else this.loadFileQueue.push(diff);
+ if (this.loadFileTimer) clearTimeout(this.loadFileTimer);
+ this.loadFileTimer = setTimeout((() => {
+ if (0 === this.loadFileQueue.length) ; else {
+ const diffs = [ ...this.loadFileQueue ];
+ this.loadFileQueue = [];
+ this.loadFileInfos(diffs);
+ }
+ }), 200);
+ } else {
+ this.loadFileQueue = [];
+ if (this.loadFileTimer) {
+ clearTimeout(this.loadFileTimer);
+ this.loadFileTimer = void 0;
+ }
+ await this.loadFileInfos([]);
+ }
+ }
+ onunload() {
+ pluginInstance.set(void 0);
+ }
+ async openScrollView(leaf, title, tagPath, files) {
+ if (!leaf) leaf = this.app.workspace.getLeaf("split");
+ await leaf.setViewState({
+ type: VIEW_TYPE_SCROLL,
+ active: true,
+ state: {
+ files: files.map((e => ({
+ path: e
+ }))),
+ title,
+ tagPath
+ }
+ });
+ this.app.workspace.revealLeaf(leaf);
+ }
+ async applyUpdateIntoScroll(files) {
+ const leaves = this.app.workspace.getLeavesOfType(VIEW_TYPE_SCROLL);
+ for (const leaf of leaves) {
+ const view = leaf.view;
+ if (!view) continue;
+ const viewState = leaf.getViewState(), scrollViewState = null == view ? void 0 : view.getScrollViewState();
+ if (!viewState || !scrollViewState) continue;
+ const viewStat = {
+ ...viewState,
+ state: {
+ ...scrollViewState
+ }
+ };
+ for (const file of files) if (file && view.isFileOpened(file.path)) {
+ const newStat = {
+ ...viewStat,
+ state: {
+ ...viewStat.state,
+ files: viewStat.state.files.map((e => e.path == file.path ? {
+ path: file.path
+ } : e))
+ }
+ };
+ await leaf.setViewState(newStat);
+ }
+ const tags = viewStat.state.tagPath.split(", ");
+ let matchedFiles = this.allViewItems;
+ for (const tag of tags) matchedFiles = matchedFiles.filter((item => item.tags.map((tag2 => tag2.toLowerCase())).some((itemTag => itemTag == tag.toLowerCase() || (itemTag + "/").startsWith(tag.toLowerCase() + (tag.endsWith("/") ? "" : "/"))))));
+ const newFilesArray = matchedFiles.map((e => e.path));
+ if (newFilesArray.sort().join("-") != viewStat.state.files.map((e => e.path)).sort().join("-")) {
+ const newStat = {
+ ...viewStat,
+ state: {
+ ...viewStat.state,
+ files: newFilesArray.map((path => {
+ const old = viewStat.state.files.find((e => e.path == path));
+ if (old) return old; else return {
+ path
+ };
+ }))
+ }
+ };
+ await leaf.setViewState(newStat);
+ }
+ }
+ }
+ async _initTagView() {
+ var _a3;
+ const leaves = this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER);
+ if (0 == leaves.length) await (null == (_a3 = this.app.workspace.getLeftLeaf(false)) ? void 0 : _a3.setViewState({
+ type: VIEW_TYPE_TAGFOLDER,
+ state: {
+ treeViewType: "tags"
+ }
+ })); else {
+ const newState = leaves[0].getViewState();
+ await leaves[0].setViewState({
+ type: VIEW_TYPE_TAGFOLDER,
+ state: {
+ ...newState,
+ treeViewType: "tags"
+ }
+ });
+ }
+ }
+ async _initLinkView() {
+ var _a3;
+ const leaves = this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER_LINK);
+ if (0 == leaves.length) await (null == (_a3 = this.app.workspace.getLeftLeaf(false)) ? void 0 : _a3.setViewState({
+ type: VIEW_TYPE_TAGFOLDER_LINK,
+ state: {
+ treeViewType: "links"
+ }
+ })); else {
+ const newState = leaves[0].getViewState();
+ await leaves[0].setViewState({
+ type: VIEW_TYPE_TAGFOLDER_LINK,
+ state: {
+ ...newState,
+ treeViewType: "links"
+ }
+ });
+ }
+ }
+ async initView() {
+ this.loadFileInfo();
+ await this._initTagView();
+ }
+ async initLinkView() {
+ this.loadFileInfo();
+ await this._initLinkView();
+ }
+ async activateView() {
+ const leaves = this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER);
+ await this.initView();
+ if (leaves.length > 0) await this.app.workspace.revealLeaf(leaves[0]);
+ }
+ async activateViewLink() {
+ const leaves = this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER_LINK);
+ await this.initLinkView();
+ if (leaves.length > 0) await this.app.workspace.revealLeaf(leaves[0]);
+ }
+ async modifyFile(file) {
+ if (this.settings.useTagInfo) if (!this.skipOnce) {
+ if (file.name == this.getTagInfoFilename()) await this.loadTagInfo();
+ } else this.skipOnce = false;
+ }
+ getTagInfoFilename() {
+ return (0, import_obsidian8.normalizePath)(this.settings.tagInfo);
+ }
+ getTagInfoFile() {
+ const file = this.app.vault.getAbstractFileByPath(this.getTagInfoFilename());
+ if (file instanceof import_obsidian8.TFile) return file; else return null;
+ }
+ applyTagInfo() {
+ if (null != this.tagInfo) if (this.settings.useTagInfo) tagInfo.set(this.tagInfo);
+ }
+ async loadTagInfo() {
+ if (!this.settings.useTagInfo) return;
+ if (null == this.tagInfo) this.tagInfo = {};
+ const file = this.getTagInfoFile();
+ if (null == file) return;
+ const data = await this.app.vault.read(file);
+ try {
+ const bodyStartIndex = data.indexOf("\n---");
+ if (!data.startsWith("---") || -1 === bodyStartIndex) return;
+ const yaml = data.substring(3, bodyStartIndex), yamlData = (0, import_obsidian8.parseYaml)(yaml), keys = Object.keys(yamlData);
+ this.tagInfoBody = data.substring(bodyStartIndex + 5);
+ this.tagInfoFrontMatterBuffer = yamlData;
+ const newTagInfo = {};
+ for (const key of keys) {
+ const w = yamlData[key];
+ if (!w) continue;
+ if ("object" != typeof w) continue;
+ const keys2 = [ "key", "mark", "alt", "redirect" ], entries = Object.entries(w).filter((([key2]) => keys2.some((e => key2.contains(e)))));
+ if (0 != entries.length) newTagInfo[key] = Object.fromEntries(entries);
+ }
+ this.tagInfo = newTagInfo;
+ this.applyTagInfo();
+ } catch (ex) {
+ console.log(ex);
+ }
+ }
+ async saveTagInfo() {
+ if (!this.settings.useTagInfo) return;
+ if (null == this.tagInfo) return;
+ let file = this.getTagInfoFile();
+ if (null == file) file = await this.app.vault.create(this.getTagInfoFilename(), "");
+ await this.app.fileManager.processFrontMatter(file, (matter => {
+ const ti = Object.entries(this.tagInfo);
+ for (const [key, value] of ti) if (void 0 === value) delete matter[key]; else matter[key] = value;
+ }));
+ }
+ async refreshAllViewItems() {
+ this.parsedFileCache.clear();
+ const itemsSorted = (await this.getItemsList("tag")).sort(this.compareItems);
+ this.allViewItems = itemsSorted;
+ allViewItems.set(this.allViewItems);
+ const itemsLinkSorted = (await this.getItemsList("link")).sort(this.compareItems);
+ this.allViewItemsByLink = itemsLinkSorted;
+ allViewItemsByLink.set(this.allViewItemsByLink);
+ }
+ async loadSettings() {
+ this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
+ await this.loadTagInfo();
+ tagFolderSetting.set(this.settings);
+ this.compareItems = getCompareMethodItems(this.settings);
+ }
+ async saveSettings() {
+ await this.saveData(this.settings);
+ await this.saveTagInfo();
+ tagFolderSetting.set(this.settings);
+ this.compareItems = getCompareMethodItems(this.settings);
+ this.refreshAllViewItems();
+ }
+ async openListView(tagSrc) {
+ var _a3, _b3;
+ if (!tagSrc) return;
+ const tags = "root" == tagSrc.first() ? tagSrc.slice(1) : tagSrc;
+ let theLeaf;
+ for (const leaf of this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER_LIST)) {
+ const state2 = leaf.getViewState();
+ if (null == (_a3 = state2.state) ? void 0 : _a3.tags) {
+ if (state2.state.tags.slice().sort().join("-") == tags.slice().sort().join("-")) {
+ this.app.workspace.setActiveLeaf(leaf, {
+ focus: true
+ });
+ return;
+ }
+ if (state2.pinned) ; else theLeaf = leaf;
+ }
+ }
+ if (!theLeaf) {
+ const parent = null == (_b3 = this.app.workspace.getLeavesOfType(VIEW_TYPE_TAGFOLDER)) ? void 0 : _b3.first();
+ if (!parent) return;
+ switch (this.settings.showListIn) {
+ case "CURRENT_PANE":
+ theLeaf = this.app.workspace.getLeaf();
+ break;
+
+ case "SPLIT_PANE":
+ theLeaf = this.app.workspace.getLeaf("split", "horizontal");
+ break;
+
+ case "":
+ default:
+ if (!import_obsidian8.Platform.isMobile) theLeaf = this.app.workspace.createLeafBySplit(parent, "horizontal", false); else theLeaf = this.app.workspace.getLeftLeaf(false);
+ break;
+ }
+ }
+ const title = tags.map((e => e.split("/").map((ee => renderSpecialTag(ee))).join("/"))).join(" ");
+ await theLeaf.setViewState({
+ type: VIEW_TYPE_TAGFOLDER_LIST,
+ active: true,
+ state: {
+ tags,
+ title
+ }
+ });
+ await this.app.workspace.revealLeaf(theLeaf);
+ }
+ async createNewNote(tags) {
+ const expandedTagsAll = ancestorToLongestTag(ancestorToTags(joinPartialPath(removeIntermediatePath(null != tags ? tags : [])))).map((e => trimTrailingSlash(e))), expandedTags = expandedTagsAll.map((e => e.split("/").filter((ee => !isSpecialTag(ee))).join("/"))).filter((e => "" != e)).map((e => "#" + e)).join(" ").trim(), ww = await this.app.fileManager.createAndOpenMarkdownFile();
+ if (this.settings.useFrontmatterTagsForNewNotes) await this.app.fileManager.processFrontMatter(ww, (matter => {
+ var _a3;
+ matter.tags = null != (_a3 = matter.tags) ? _a3 : [];
+ matter.tags = expandedTagsAll.filter((e => !isSpecialTag(e))).filter((e => matter.tags.indexOf(e) < 0)).concat(matter.tags);
+ })); else await this.app.vault.append(ww, expandedTags);
+ }
+}, TagFolderSettingTab = class extends import_obsidian8.PluginSettingTab {
+ constructor(app, plugin) {
+ super(app, plugin);
+ this.plugin = plugin;
+ }
+ hide() {
+ this.plugin.loadFileInfo();
+ }
+ display() {
+ const {containerEl} = this;
+ containerEl.empty();
+ containerEl.createEl("h2", {
+ text: "Behavior"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Always Open").setDesc("Place TagFolder on the left pane and activate it at every Obsidian launch").addToggle((toggle => toggle.setValue(this.plugin.settings.alwaysOpen).onChange((async value => {
+ this.plugin.settings.alwaysOpen = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Use pinning").setDesc("When this feature is enabled, the pin information is saved in the file set in the next configuration.").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.useTagInfo).onChange((async value => {
+ this.plugin.settings.useTagInfo = value;
+ if (this.plugin.settings.useTagInfo) await this.plugin.loadTagInfo();
+ await this.plugin.saveSettings();
+ pi.setDisabled(!value);
+ }));
+ }));
+ const pi = new import_obsidian8.Setting(containerEl).setName("Pin information file").setDisabled(!this.plugin.settings.useTagInfo).addText((text2 => {
+ text2.setValue(this.plugin.settings.tagInfo).onChange((async value => {
+ this.plugin.settings.tagInfo = value;
+ if (this.plugin.settings.useTagInfo) await this.plugin.loadTagInfo();
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Disable narrowing down").setDesc("When this feature is enabled, relevant tags will be shown with the title instead of making a sub-structure.").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.disableNarrowingDown).onChange((async value => {
+ this.plugin.settings.disableNarrowingDown = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ containerEl.createEl("h2", {
+ text: "Files"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Display method").setDesc("How to show a title of files").addDropdown((dropdown => dropdown.addOptions({
+ "PATH/NAME": "PATH/NAME",
+ NAME: "NAME",
+ "NAME : PATH": "NAME : PATH"
+ }).setValue(this.plugin.settings.displayMethod).onChange((async value => {
+ this.plugin.settings.displayMethod = value;
+ this.plugin.loadFileInfo();
+ await this.plugin.saveSettings();
+ }))));
+ const setOrderMethod = async (key, order) => {
+ const oldSetting = this.plugin.settings.sortType.split("_");
+ if (!key) key = oldSetting[0];
+ if (!order) order = oldSetting[1];
+ this.plugin.settings.sortType = `${key}_${order}`;
+ await this.plugin.saveSettings();
+ };
+ new import_obsidian8.Setting(containerEl).setName("Order method").setDesc("how to order items").addDropdown((dd => {
+ dd.addOptions(OrderKeyItem).setValue(this.plugin.settings.sortType.split("_")[0]).onChange((key => setOrderMethod(key, void 0)));
+ })).addDropdown((dd => {
+ dd.addOptions(OrderDirection).setValue(this.plugin.settings.sortType.split("_")[1]).onChange((order => setOrderMethod(void 0, order)));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Prioritize items which are not contained in sub-folder").setDesc("If this has been enabled, the items which have no more extra tags are first.").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.sortExactFirst).onChange((async value => {
+ this.plugin.settings.sortExactFirst = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Use title").setDesc("Use value in the frontmatter or first level one heading for `NAME`.").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.useTitle).onChange((async value => {
+ this.plugin.settings.useTitle = value;
+ fpath.setDisabled(!value);
+ await this.plugin.saveSettings();
+ }));
+ }));
+ const fpath = new import_obsidian8.Setting(containerEl).setName("Frontmatter path").setDisabled(!this.plugin.settings.useTitle).addText((text2 => {
+ text2.setValue(this.plugin.settings.frontmatterKey).onChange((async value => {
+ this.plugin.settings.frontmatterKey = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ containerEl.createEl("h2", {
+ text: "Tags"
+ });
+ const setOrderMethodTag = async (key, order) => {
+ const oldSetting = this.plugin.settings.sortTypeTag.split("_");
+ if (!key) key = oldSetting[0];
+ if (!order) order = oldSetting[1];
+ this.plugin.settings.sortTypeTag = `${key}_${order}`;
+ await this.plugin.saveSettings();
+ };
+ new import_obsidian8.Setting(containerEl).setName("Order method").setDesc("how to order tags").addDropdown((dd => {
+ dd.addOptions(OrderKeyTag).setValue(this.plugin.settings.sortTypeTag.split("_")[0]).onChange((key => setOrderMethodTag(key, void 0)));
+ })).addDropdown((dd => {
+ dd.addOptions(OrderDirection).setValue(this.plugin.settings.sortTypeTag.split("_")[1]).onChange((order => setOrderMethodTag(void 0, order)));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Use virtual tags").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.useVirtualTag).onChange((async value => {
+ this.plugin.settings.useVirtualTag = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Display folder as tag").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.displayFolderAsTag).onChange((async value => {
+ this.plugin.settings.displayFolderAsTag = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Store tags in frontmatter for new notes").setDesc("Otherwise, tags are stored with #hashtags at the top of the note").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.useFrontmatterTagsForNewNotes).onChange((async value => {
+ this.plugin.settings.useFrontmatterTagsForNewNotes = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ containerEl.createEl("h2", {
+ text: "Actions"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Search tags inside TagFolder when clicking tags").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.overrideTagClicking).onChange((async value => {
+ this.plugin.settings.overrideTagClicking = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("List files in a separated pane").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.useMultiPaneList).onChange((async value => {
+ this.plugin.settings.useMultiPaneList = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Show list in").setDesc("This option applies to the newly opened list").addDropdown((dropdown => {
+ dropdown.addOptions(enumShowListIn).setValue(this.plugin.settings.showListIn).onChange((async value => {
+ this.plugin.settings.showListIn = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ containerEl.createEl("h2", {
+ text: "Arrangements"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Hide Items").setDesc("Hide items on the landing or nested tags").addDropdown((dd => {
+ dd.addOptions(HideItemsType).setValue(this.plugin.settings.hideItems).onChange((async key => {
+ if ("NONE" == key || "DEDICATED_INTERMIDIATES" == key || "ALL_EXCEPT_BOTTOM" == key) this.plugin.settings.hideItems = key;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Merge redundant combinations").setDesc("When this feature is enabled, a/b and b/a are merged into a/b if there is no intermediates.").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.mergeRedundantCombination).onChange((async value => {
+ this.plugin.settings.mergeRedundantCombination = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Do not simplify empty folders").setDesc("Keep empty folders, even if they can be simplified.").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.doNotSimplifyTags).onChange((async value => {
+ this.plugin.settings.doNotSimplifyTags = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Do not treat nested tags as dedicated levels").setDesc("Treat nested tags as normal tags").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.disableNestedTags).onChange((async value => {
+ this.plugin.settings.disableNestedTags = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Reduce duplicated parents in nested tags").setDesc("If enabled, #web/css, #web/javascript will merged into web -> css -> javascript").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.reduceNestedParent).onChange((async value => {
+ this.plugin.settings.reduceNestedParent = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Keep untagged items on the root").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.expandUntaggedToRoot).onChange((async value => {
+ this.plugin.settings.expandUntaggedToRoot = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ containerEl.createEl("h2", {
+ text: "Link Folder"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Use Incoming").setDesc("").addToggle((toggle => toggle.setValue(this.plugin.settings.linkConfig.incoming.enabled).onChange((async value => {
+ this.plugin.settings.linkConfig.incoming.enabled = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Use Outgoing").setDesc("").addToggle((toggle => toggle.setValue(this.plugin.settings.linkConfig.outgoing.enabled).onChange((async value => {
+ this.plugin.settings.linkConfig.outgoing.enabled = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Hide indirectly linked notes").setDesc("").addToggle((toggle => toggle.setValue(this.plugin.settings.linkShowOnlyFDR).onChange((async value => {
+ this.plugin.settings.linkShowOnlyFDR = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Connect linked tree").setDesc("").addToggle((toggle => toggle.setValue(this.plugin.settings.linkCombineOtherTree).onChange((async value => {
+ this.plugin.settings.linkCombineOtherTree = value;
+ await this.plugin.saveSettings();
+ }))));
+ containerEl.createEl("h2", {
+ text: "Filters"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Target Folders").setDesc("If configured, the plugin will only target files in it.").addTextArea((text2 => text2.setValue(this.plugin.settings.targetFolders).setPlaceholder("study,documents/summary").onChange((async value => {
+ this.plugin.settings.targetFolders = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Ignore Folders").setDesc("Ignore documents in specific folders.").addTextArea((text2 => text2.setValue(this.plugin.settings.ignoreFolders).setPlaceholder("template,list/standard_tags").onChange((async value => {
+ this.plugin.settings.ignoreFolders = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Ignore note Tag").setDesc("If the note has the tag listed below, the note would be treated as there was not.").addTextArea((text2 => text2.setValue(this.plugin.settings.ignoreDocTags).setPlaceholder("test,test1,test2").onChange((async value => {
+ this.plugin.settings.ignoreDocTags = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Ignore Tag").setDesc("Tags in the list would be treated as there were not.").addTextArea((text2 => text2.setValue(this.plugin.settings.ignoreTags).setPlaceholder("test,test1,test2").onChange((async value => {
+ this.plugin.settings.ignoreTags = value;
+ await this.plugin.saveSettings();
+ }))));
+ new import_obsidian8.Setting(containerEl).setName("Archive tags").setDesc("If configured, notes with these tags will be moved under the tag.").addTextArea((text2 => text2.setValue(this.plugin.settings.archiveTags).setPlaceholder("archived, discontinued").onChange((async value => {
+ this.plugin.settings.archiveTags = value;
+ await this.plugin.saveSettings();
+ }))));
+ containerEl.createEl("h2", {
+ text: "Misc"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Tag scanning delay").setDesc("Sets the delay for reflecting metadata changes to the tag tree. (Plugin reload is required.)").addText((text2 => {
+ (text2 = text2.setValue(this.plugin.settings.scanDelay + "").onChange((async value => {
+ const newDelay = Number.parseInt(value, 10);
+ if (newDelay) {
+ this.plugin.settings.scanDelay = newDelay;
+ await this.plugin.saveSettings();
+ }
+ }))).inputEl.setAttribute("type", "number");
+ text2.inputEl.setAttribute("min", "250");
+ return text2;
+ }));
+ new import_obsidian8.Setting(containerEl).setName("Disable dragging tags").setDesc("The `Dragging tags` is using internal APIs. If something happens, please disable this once and try again.").addToggle((toggle => {
+ toggle.setValue(this.plugin.settings.disableDragging).onChange((async value => {
+ this.plugin.settings.disableDragging = value;
+ await this.plugin.saveSettings();
+ }));
+ }));
+ containerEl.createEl("h2", {
+ text: "Utilities"
+ });
+ new import_obsidian8.Setting(containerEl).setName("Dumping tags for reporting bugs").setDesc("If you want to open an issue to the GitHub, this information can be useful. and, also if you want to keep secrets about names of tags, you can use `disguised`.").addButton((button => button.setButtonText("Copy tags").setDisabled(false).onClick((async () => {
+ const items = (await this.plugin.getItemsList("tag")).map((e => e.tags.filter((e2 => "_untagged" != e2)))).filter((e => e.length));
+ await navigator.clipboard.writeText(items.map((e => e.map((e2 => `#${e2}`)).join(", "))).join("\n"));
+ new import_obsidian8.Notice("Copied to clipboard");
+ })))).addButton((button => button.setButtonText("Copy disguised tags").setDisabled(false).onClick((async () => {
+ const x = new Map;
+ let i = 0;
+ const items = (await this.plugin.getItemsList("tag")).map((e => e.tags.filter((e2 => "_untagged" != e2)).map((e2 => e2.split("/").map((e3 => e3.startsWith("_VIRTUAL") ? e3 : x.has(e3) ? x.get(e3) : (x.set(e3, "tag" + i++),
+ i))).join("/"))).filter((e2 => e2.length))));
+ await navigator.clipboard.writeText(items.map((e => e.map((e2 => `#${e2}`)).join(", "))).join("\n"));
+ new import_obsidian8.Notice("Copied to clipboard");
+ }))));
+ }
+};
+/* nosourcemap */
\ No newline at end of file
diff --git a/.obsidian/plugins/obsidian-tagfolder/manifest.json b/.obsidian/plugins/obsidian-tagfolder/manifest.json
new file mode 100644
index 0000000..33b391d
--- /dev/null
+++ b/.obsidian/plugins/obsidian-tagfolder/manifest.json
@@ -0,0 +1,10 @@
+{
+ "id": "obsidian-tagfolder",
+ "name": "TagFolder",
+ "version": "0.18.11",
+ "minAppVersion": "0.12.0",
+ "description": "Show tags as folder",
+ "author": "vorotamoroz",
+ "authorUrl": "https://github.com/vrtmrz",
+ "isDesktopOnly": false
+}
diff --git a/.obsidian/plugins/obsidian-tagfolder/styles.css b/.obsidian/plugins/obsidian-tagfolder/styles.css
new file mode 100644
index 0000000..b90a1b1
--- /dev/null
+++ b/.obsidian/plugins/obsidian-tagfolder/styles.css
@@ -0,0 +1,139 @@
+.workspace-leaf-content[data-type="tagfolder-view"]>.view-content,
+.workspace-leaf-content[data-type="tagfolder-view-list"]>.view-content {
+ padding: 0;
+ height: 100%;
+ overflow: unset;
+}
+
+.override-input {
+ flex-direction: column-reverse;
+}
+
+.tagfolder-tag::before {
+ all: inherit;
+ color: inherit;
+ font: inherit;
+}
+
+.tagfolder-tag.tag-tag::before {
+ margin-left: 0px;
+ margin-right: 0px;
+}
+
+.tagfolder-tag.tag-tag span.tf-tag-each:empty {
+ display: none;
+}
+
+.tagfolder-tag.tag-tag.tf-tag span.tf-tag-each:first-child:not(:empty):before {
+ content: "#";
+ margin-left: 0.3em;
+}
+
+.tagfolder-tag.tag-tag.tf-link span.tf-tag-each:first-child:not(:empty):before {
+ content: "";
+ margin-left: 0.3em;
+}
+
+.tagfolder-tag.tag-tag.tf-link.link-cross span.tf-tag-each:first-child:not(:empty):before {
+ content: "⇔ ";
+ margin-left: 0.3em;
+}
+
+.tagfolder-tag.tag-tag.tf-link.link-forward span.tf-tag-each:first-child:not(:empty):before {
+ content: "⇒ ";
+ margin-left: 0.3em;
+}
+
+.tagfolder-tag.tag-tag.tf-link.link-reverse span.tf-tag-each:first-child:not(:empty):before {
+ content: "⇐ ";
+ margin-left: 0.3em;
+}
+
+.tagfolder-tag.tag-tag span.tf-tag-each::before {
+ content: "→ ";
+ margin-left: 0;
+ margin-right: 0;
+}
+
+
+.tf-taglist {
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ display: inline-block;
+ flex-shrink: 100;
+ margin-left: auto;
+ text-align: right;
+}
+
+.tf-taglist:not(:empty) {
+ min-width: 3em;
+}
+
+.tf-taglist .tf-tag {
+ background-color: var(--background-secondary-alt);
+ border-radius: 4px;
+ padding: 2px 4px;
+ margin-left: 4px;
+ color: var(--nav-item-color);
+}
+
+.nav-folder-title:hover .tagfolder-quantity,
+.nav-file-title:hover .tf-taglist {
+ color: var(--text-on-accent);
+}
+
+.nav-folder-title:hover .tagfolder-quantity span,
+.nav-file-title:hover .tf-taglist span.tf-tag {
+ color: var(--text-on-accent);
+ background-color: var(--interactive-accent-hover);
+}
+
+
+.lsl-f {
+ flex-direction: row;
+ display: flex;
+ flex-grow: 1;
+ overflow: hidden;
+ flex-shrink: 1;
+}
+
+.lsl-f:not(:last-child) {
+ min-width: 3em;
+}
+
+.lsl-f:empty::before {
+ content: "...";
+}
+
+.tagfolder-titletagname {
+ flex-grow: 1;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ overflow: hidden;
+}
+
+.tagfolder-quantity span {
+ background-color: var(--background-secondary-alt);
+ color: var(--nav-item-color);
+ border-radius: 4px;
+ padding: 2px 4px;
+}
+
+.tagfolder-quantity {
+ width: 3em;
+ text-align: right;
+ cursor: pointer;
+ margin-left: auto;
+}
+
+.tag-folder-title {
+ max-width: 100%;
+}
+
+.tree-item.nav-folder.updating {
+ background: linear-gradient(135deg, var(--interactive-accent-hover) 0%, var(--interactive-accent-hover) 50%, rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0) 100%);
+ background-repeat: no-repeat;
+ background-position: 0 0;
+ background-size: 10px 10px;
+}
\ No newline at end of file
diff --git a/blog/2025-07-18_estimating-isnt-engineering.md b/2025-07-18_estimating-isnt-engineering.md
similarity index 97%
rename from blog/2025-07-18_estimating-isnt-engineering.md
rename to 2025-07-18_estimating-isnt-engineering.md
index 8065c06..6d27876 100644
--- a/blog/2025-07-18_estimating-isnt-engineering.md
+++ b/2025-07-18_estimating-isnt-engineering.md
@@ -1,7 +1,8 @@
---
id: 2025-07-18_estimating-isnt-engineering
aliases: []
-tags: []
+tags:
+ - anecdote
---
# Estimating Isn't Engineering
diff --git a/new-additions/314.028_pull-and-junction-boxes.md b/NFPA70_314.028_pull-and-junction-boxes.md
similarity index 99%
rename from new-additions/314.028_pull-and-junction-boxes.md
rename to NFPA70_314.028_pull-and-junction-boxes.md
index f4ba5e7..51957b5 100644
--- a/new-additions/314.028_pull-and-junction-boxes.md
+++ b/NFPA70_314.028_pull-and-junction-boxes.md
@@ -1,7 +1,8 @@
---
id:
aliases: []
-tags: []
+tags:
+ - media
---
# 314.28 Pull and Junction Boxes and Conduit Bodies.
diff --git a/README.md b/README.md
index 885821a..d74667a 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,10 @@
+---
+id:
+aliases:
+ - home
+tags:
+ - meta
+---
# zmVault
This obsidian vault collects my thoughts on my most developed [[supertopics|supertopic]],
@@ -5,12 +12,14 @@ which I would call "[[construction-estimating]]",
but that includes fields far more disparate
than my peers would traditionally consider relevant.
+See [[this-notebook]].
+
## Purpose
I want to be involved construction estimating for the rest of my working life.
Current discourse on the subject is self-similar and sanitized.
I'd like to be known as an innovator in [[estimating-philosophy]],
-and for solving some of its [[open-problems]].
+and for solving some of its [[open-problems-in-estimating]].
## Contents
diff --git a/accubid-setup.md b/accubid-setup.md
new file mode 100644
index 0000000..615e150
--- /dev/null
+++ b/accubid-setup.md
@@ -0,0 +1,49 @@
+---
+id:
+aliases: []
+tags:
+ - guide
+---
+# Accubid Setup
+
+## Sequence
+
+### Create LiveCount Project
+
+1. In [Trimble Connect](https://web.connect.trimble.com),
+ find the project "CONEST TEMPLATE",
+ open its context menu,
+ then click "Use as template for a new project".
+
+2. Ensure all checkboxes are checked,
+ then click `Next`.
+
+3. Name with format "{Project Name} - ConEst".
+
+Refresh the page and open the newly created project.
+
+### Upload Drawings to LiveCount
+
+```
+# Extract drawings to ".\Trimble Connect (Plans)"
+```
+
+Upload extracted drawings to LiveCount
+
+### Create Accubid Job
+
+> [!important]
+> The LiveCount project must be created **before** creating the Accubid job.
+
+* Create a new Accubid job:
+ Path: "\\EgnyteDrive\Shared\Trimble\Accubid\Bid\{Project Name} - ConEst.es16"
+
+### Add Drawings to Accubid Job
+
+* In the LiveCount window, find `Document Manager` > `Select Existing Project`.
+ Add all previously uploaded drawings.
+
+### Setup Breakdowns
+
+> [!important]
+> Do not copy Systems from WBS Accubid Setup.
diff --git a/new-additions/automation/assembly-objects.md b/assembly-objects.md
similarity index 93%
rename from new-additions/automation/assembly-objects.md
rename to assembly-objects.md
index 28a7fec..dcf9b39 100644
--- a/new-additions/automation/assembly-objects.md
+++ b/assembly-objects.md
@@ -1,7 +1,9 @@
---
id:
aliases: []
-tags: []
+tags:
+ - automation
+ - software
---
# Assembly Objects
diff --git a/new-additions/automation/award-analysis.md b/award-analysis.md
similarity index 89%
rename from new-additions/automation/award-analysis.md
rename to award-analysis.md
index 4377fdb..7866b11 100644
--- a/new-additions/automation/award-analysis.md
+++ b/award-analysis.md
@@ -1,3 +1,10 @@
+---
+id:
+aliases: []
+tags:
+ - professional
+ - automation
+---
# Award Analysis
BPM > Reports > Awards
diff --git a/media-commentary/construction-estimating-using-excel.md b/construction-estimating-using-excel.md
similarity index 100%
rename from media-commentary/construction-estimating-using-excel.md
rename to construction-estimating-using-excel.md
diff --git a/construction-estimating.md b/construction-estimating.md
index f412343..6816399 100644
--- a/construction-estimating.md
+++ b/construction-estimating.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - estimating
+---
# Construction Estimating
Construction estimating is a subset of cost estimation.
@@ -16,7 +22,7 @@ which would take far longer than allotted for bid,
> For some owners, money is no object,
> and standardization is far more important
> than any potential construction savings.
->
+>
> These owners can be expected to decline every [[value-engineering]] option offered
> (see [[gold-plating]]).
diff --git a/design-build-budget.md b/design-build-budget.md
new file mode 100644
index 0000000..c08c73a
--- /dev/null
+++ b/design-build-budget.md
@@ -0,0 +1,47 @@
+---
+id:
+aliases: []
+tags:
+ - guide
+---
+# Design Build Budget
+
+## Sequence
+
+### 2. Takeoff
+
+#### Misc Budgets
+
+From [[misc-budgets]], takeoff:
+
+* Temporary Power & Lighting
+* Irrigation
+
+#### Feeders
+
+##### Primaries & Secondaries
+
+See [[feeders]].
+
+##### Feeders
+
+Budget per Unit Count. Compare to Bid Sheet.
+
+Alternate method as described by Joel:
+Takeoff unit risers normally
+with length * 1.5 to cover house panel feeders.
+
+#### Switchgear
+
+Budget per Unit Count. Compare to Bid Sheet.
+
+##### Generator
+
+See [[switchgear#Generator]].
+
+#### Subfeeds
+
+Budget per Unit Count. Compare to Bid Sheet.
+
+Alternate method as described by Joel:
+Takeoff per [[subfeeds]], use average for length.
diff --git a/media-commentary/electrical-estimating-methods.md b/electrical-estimating-methods.md
similarity index 100%
rename from media-commentary/electrical-estimating-methods.md
rename to electrical-estimating-methods.md
diff --git a/media-commentary/electrical-estimators-manual.md b/electrical-estimators-manual.md
similarity index 100%
rename from media-commentary/electrical-estimators-manual.md
rename to electrical-estimators-manual.md
diff --git a/electrical.md b/electrical.md
new file mode 100644
index 0000000..1f38fd9
--- /dev/null
+++ b/electrical.md
@@ -0,0 +1,59 @@
+---
+id: electrical
+aliases: []
+tags:
+ - systems/electrical
+---
+# Electrical
+
+## Sequence
+
+### 1. Estimate preparation
+
+2. Read about the project specifications and construction type
+3. Locate Equipment Schedules
+
+4. Device specs (Decora or Standard)
+
+### 2. Takeoff
+
+1. Takeoff all equipment that is not #12
+2. Go by Drawing in chronological order
+3. Takeoff Enlarged Drawings
+4. Do final checklist in electrical takeoff notes
+
+> [!tip]
+> It is sometimes easier to rebuild a designation than to modify it.
+> For designations with existing takeoffs, Right-Click > `Empty Designation`.
+> The build process can then be completed anew.
+
+### 3. Extension (Review and Checking)
+
+1. Count Car chargers and location
+
+## Takeoff
+
+### Lighting Control
+
+By PDI convention, [[lighting-controls]] are generally "Electrical", not "Lighting".
+
+### Receptacles
+
+### Mechanical Connections
+
+#### CU/IP
+
+* Units Condensing Unit
+* Mechanical Connection
+
+#### Trash Chute
+
+Horizontal:
+* Check if shown on power drawings as mech connection
+ * If not, use 100ft length
+
+Vertical (Riser):
+* Takeoff: `COMMON ASSEMBLIES`/`MISC ASSEMBLIES`/`TRASH CHUTE RISER CIRCUIT...`
+* Uncheck Link 'Enable Livecount'
+* Takeoff in Typical
+ * Length = average floor to floor height
diff --git a/estimating-detail.md b/estimating-detail.md
index 7e4d6ce..f96cbdd 100644
--- a/estimating-detail.md
+++ b/estimating-detail.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - estimating
+---
# Estimating Detail
In [[construction-estimating]], the acceptable level of detail of an estimate is a contentious subject.
@@ -15,7 +21,7 @@ A commonality of both is the implication that more time ought to be preferred,
when the reality is that when considering larger organizational factors (strategy),
ideal estimate certainty is likely far lower than most expect.
-The *correct* correct answer involves optimizing for these factors:
+The _correct_ correct answer involves optimizing for these factors:
* value of increased bid certainty
* value of increased estimate volume
%%
diff --git a/estimating-workflow.md b/estimating-workflow.md
new file mode 100644
index 0000000..0414314
--- /dev/null
+++ b/estimating-workflow.md
@@ -0,0 +1,34 @@
+---
+id:
+aliases: []
+tags:
+ - guide
+ - professional
+next: project-setup
+---
+# Estimating Workflow
+
+## Sequence
+
+### 1. Estimate preparation
+
+[[project-setup]]
+
+### 2. Takeoff
+
+#### Stage 1
+
+1. [[feeders]]
+2. [[subfeeds]]
+3. [[switchgear]]
+
+#### Stage 2
+
+4. [[units]]
+5. [[fixtures]]
+6. [[electrical]]
+7. [[low-voltage]]
+8. [[lightning-protection]]
+9. [[misc-budgets]]
+
+### 3. Extension (Review and Checking)
diff --git a/new-additions/excel-macros.md b/excel-macros.md
similarity index 97%
rename from new-additions/excel-macros.md
rename to excel-macros.md
index f062c48..e75bf4c 100644
--- a/new-additions/excel-macros.md
+++ b/excel-macros.md
@@ -1,7 +1,9 @@
---
id: excel-macros
aliases: []
-tags: []
+tags:
+ - software
+ - guide
---
# Excel Macros
@@ -28,7 +30,7 @@ Developer > Code > Record Macro
Set `Store macro in:` to `Personal Macro Workbook`
and click `OK`, then `Stop Recording`.
-## 3.
+## 3.
```menu
Developer > Visual Basic
@@ -66,4 +68,3 @@ End Sub
Use `Ctrl+S` or the save icon to save the edits
then close the Visual Basic window.
-
diff --git a/new-additions/automation/feeder-verification.md b/feeder-verification.md
similarity index 78%
rename from new-additions/automation/feeder-verification.md
rename to feeder-verification.md
index 658496b..4eae4ee 100644
--- a/new-additions/automation/feeder-verification.md
+++ b/feeder-verification.md
@@ -1,13 +1,20 @@
+---
+id:
+aliases: []
+tags:
+ - automation
+ - professional
+---
# Feeder Verification Automation
> * Filter by Feeders system in Takeoff
> * Highlight everything and copy into excel
> * Erase the everything except the description, length, and count
> * Make a note of any typicals
-> * Redo the same process but with USF, Primaries, and Secondaries
+> * Redo the same process but with USF, Primaries, and Secondaries
> * Save as and rename to NAME - Feeder Verification in the PSN folder
Breakdown selection is straightforward.
To select all takeoffs:
-Get top left corner of pane, offset down and right.
\ No newline at end of file
+Get top left corner of pane, offset down and right.
diff --git a/new-additions/takeoff/feeders.md b/feeders.md
similarity index 59%
rename from new-additions/takeoff/feeders.md
rename to feeders.md
index be946eb..3e7093f 100644
--- a/new-additions/takeoff/feeders.md
+++ b/feeders.md
@@ -1,16 +1,55 @@
---
-id:
+id: feeders
aliases: []
-tags: []
+tags:
+ - systems/feeders
---
# Feeders
-* Use 15ft adders for site runs
- (primaries, secondaries, etc.),
- as opposed to standard 10ft adder,
- to account for variability.
+## Info
-## Cable Support
+## Sequence
+
+### 1. Estimate preparation
+
+Read about the project specifications and construction type:
+* Delivery Method (Plans & Specs, Design Build, Design Assist, Preliminary Budget)
+* Deck thickness
+* Wiring method
+* Conductor material (Aluminum/Copper)
+
+Locate:
+* Riser Diagram
+* Feeder Schedule (if present)
+* Main Electrical rooms and panel locations
+* Routing (if present)
+
+### 2. Takeoff
+
+* Choose a starting point on the riser
+* Determine wire & Conduit makeup (3Ph/1Ph, AL/CU, Conduit)
+* Measure off the length of the feed _ADDERS_
+ * Square corners, use corridors if possible
+
+> [!important]
+> All takeoffs in Systems with names including "site"
+> should be in "Site" Area, Phase, and Bid Item breakdowns.
+
+> [!important]
+> Use 15ft adders for site runs
+> (primaries, secondaries, etc.),
+> as opposed to standard 10ft adder,
+> to account for variability.
+
+#### Primaries
+
+#### Secondaries
+
+#### Feeders
+
+#### Bus Duct
+
+#### Cable Support
> [!quote] 300.19 Supporting Conductors in Vertical Raceways.
> **(A) Spacing Intervals -- Maximum.**
@@ -34,7 +73,7 @@ tags: []
> | Over 500 kcmil through 750 kcmil | 95ft | 40ft |
> | Over 750 kcmil | 85ft | 35ft |
-## Sleeving
+#### Sleeving
Provide sleeves for all feeder conduits passing through floors.
@@ -42,3 +81,5 @@ Provide sleeves for all feeder conduits passing through floors.
* P = Plastic => Concrete
* M = Metal => Wood Frame
* Round 1" to 2"
+
+### 3. Extension (Review and Checking)
diff --git a/fire-alarm.md b/fire-alarm.md
new file mode 100644
index 0000000..97155e5
--- /dev/null
+++ b/fire-alarm.md
@@ -0,0 +1,224 @@
+---
+id:
+aliases: []
+tags:
+ - systems/fire-alarm
+---
+# Fire Alarm
+
+## Sequence
+
+### 1. Estimate preparation
+
+1. Initial the OneNote
+2. Read about the project specifications and construction type
+3. Find Fire Alarm plans (if present)
+4. Locate the following rooms:
+ * Fire Command Center (FCC)
+ * Generator Room
+ * Fire Pump Room
+ * Elevator Control Rooms
+ * Elevator Shafts
+ * Stairwells
+
+### 2. Takeoff
+
+#### Riser
+
+##### Fire Command Center
+
+{Building Type} Head End CA.30.23.X
+
+##### Generator Room
+
+CA.30.22.2
+
+##### Fire Pump Room
+
+CA.30.22.4
+
+##### FACR to Elevator Shafts
+
+Elevator Shafts (CA.30.22.8)
+
+FACR TO ELEV SHAFT 1 ½" (CA.30.22.10/11)
+
+Measure Length from the most distant points of the FACR and each shaft.
+Input adder length to reach the bottom of the pit
+(Minimum 15ft adder).
+
+```
+| 1 shaft | 2 shafts |
+| || +--------+ +--------+ || | || +--------+ || +--------+ || |
+| || | Elev 1 | | Elev 2 | || | || | Elev 1 | || | Elev 2 | || |
+| || +--------+ +--------+ || | || +--------+ || +--------+ || |
+| ||=======================|| | ||============||============|| |
+| | |
+```
+
+##### FACR to Elevator Control Rooms
+
+Elevator Control Room (CA.30.22.6)
+
+FACR/FCC TO ELEV CONTROL ROOM (CA.30.22.13/14)
+
+* Measure the Horizontal and Vertical Distance from the FACR to the ECR.
+* Use Typicals for the vertical riser. (Ex// 10' per floor)
+
+##### FACR to Stairwells
+
+FACR TO STAIRWELLS 1" PVC (CA.30.22.17)
+
+* Measure from the furthest end of FACR to the furthest end of the stairwell to find length
+
+* This is for the Flow/Tamper modules in the stairwells
+
+##### Terminal Cabinets
+
+TERMINAL CABINETS (2) 2" EMT/PVC (CA.30.26. __)
+
+Horizontal:
+* Measure from the Fire Command room to all electrical rooms
+
+Vertical:
+* Use 10ft Riser in Typical
+* GA or HD - 1" conduit / HR - (2) 2" conduits)
+
+##### Annunciator Panels
+
+* Fire Alarm Annunciator (FAA),
+* Fire Alarm Annunciator Panel (FAAP)
+
+ANNUNCIATORS (CA.30.27.2/3)
+
+Remote Serial Annunciator, LCD Display - PVC
+
+* Measure from the Fire Command Room to FAA or Lobby
+
+##### Sleeving
+
+#### Devices
+
+1. Takeoff floor plans in order
+2. Takeoff enlarged drawings
+
+##### Smoke Detectors
+
+_Design Build:_
+Count every stairwell at every level.
+
+##### Pull Stations
+
+_Design Build:_
+Count every stairwell at every level
+and every exterior exit.
+
+##### Flow-Tamper Switches
+
+No free air. if wood frame, take off as EMT.
+
+_Design Build:_
+Count every stairwell at every level.
+
+##### Magnetic Door Holders
+
+Mech Connection - PVC AL Flex - 20 A
+
+_Design Build:_
+Count every set of double doors.
+(Typical of elevator lobbies and corridors)
+
+##### Speaker Strobes
+
+_Design Build:_
+* Count every 75 ft,
+ * measure with circles on Bluebeam
+ * or divide relevant SF area by 4415
+ * $\pi(\frac{75}{2})^2 \approx 4415$
+* every elevator lobby,
+* and every BOH room on the first floor and garage levels.
+
+#### Fire Smoke Dampers (FSD's)
+
+Take off both FA and Electrical
+* Misc Assemblies
+
+#### Area of Refuge (AoR) / Two-Way
+
+PROPOSAL "STAND ALONE SYSTEMS"
+
+CA.31.27. 4/7
+
+##### Horizontal
+
+Take off once
+* Length:
+ * If shown on Plans (FA/Systems/ etc.)
+ * based on FCR to Elevator Lobbies & FCR to Stairwells* (Whichever is longer)
+* Count: Number of boxes run to. If not shown, use the largest count between Elev. & Strwlls.
+
+##### Vertical
+
+Typical on all floors
+* Length: 15ft x per count
+* Count: match Horizontal
+
+#### Responder Radio / DAS
+
+##### FACR to Every Elev. Shaft
+
+FACR TO ELEV PIT = 2" PVC40
+CA.28.31.5
+
+Match Fire Alarm takeoff Length and Count
+
+##### FACR to Every Staircase
+
+FACR TO STAIRWELL = 2" PVC40
+CA.28.31.8
+
+Match Fire Alarm takeoff Length and Count
+
+##### Stairwell Riser Every 2 Floors
+
+STAIRWELL RISER EVERY 2 FLRS = 1 1/2" EMT (20') W/ 16X16X6 BOX
+CA.28.31.12
+
+Create a Stairwell typical on every other floor
+
+##### FACR to Electric Room
+
+FACR TO 2HR-RATED RM = 2" PVC40
+CA.28.31.14
+
+Match Fire Alarm takeoff Length
+
+##### Electric Room Riser to Every Floor
+
+2HR-RATED RM RISER TO EVERY FLR = 2" EMT (15') W/ 16X16X6 BOX
+CA.28.31.18
+
+Takeoff in every Electric Room
+
+##### Top 2H Rated Room To Roof
+
+FACR TO ROOF = 2" EMT W/ RMC WEATHERHEAD & IMC STUB
+CA.28.31.18
+
+Use 15' or Height of ceiling on last building level
+
+##### Horizontal
+
+CORRIDORS EMT OH = 1 1/2" EMT W/ 16X16X6 BOX EVERY 80'
+CA.28.31.23
+
+CORRIDORS DECK = 1 1/2" PVC40, STUBBY, FLEX W/ 16X16X6 BOX EVERY 80'
+CA.28.31.21
+
+1-1/2 through corridors w/ 16x16x6 J-Box
+
+Length for every corridor/garage
+
+### 3. Extension (Review and Checking)
+
+* Sleeving
diff --git a/new-additions/takeoff/lighting.md b/fixture-designations.md
similarity index 57%
rename from new-additions/takeoff/lighting.md
rename to fixture-designations.md
index bbf19bf..6bef02b 100644
--- a/new-additions/takeoff/lighting.md
+++ b/fixture-designations.md
@@ -1,19 +1,14 @@
---
id:
aliases: []
-tags: []
+tags:
+ - systems/fixtures
---
-# Lighting (Fixtures)
+# Fixture Designations
-## Info
+## Naming
-## Scope
-
-### Building Designations
-
-#### Naming
-
-##### Format
+### Format
```regex
- (\: )?( - )? \(\)( )* ft
@@ -22,7 +17,7 @@ tags: []
> [!example]
> `A - Surface: Pendant - 2.0hrs (MC) LV 20ft`
-#### Order
+## Order
Use empty designations to separate phases.
@@ -40,52 +35,42 @@ Use empty designations to separate phases.
> CU - Surface: Wall (MC) LV 25ft
> ```
-#### Fixture Labor
+## Fixture Labor
-> | Fixture Type | Labor |
-> | ------------ | -------------- |
-> | Paddle Fan | 1.5 hrs/ea |
-> | Pendant | 1-4 hrs/ea[^6] |
-> | Strip/Cove | 0.083 hrs/ft |
-> | Site Poles | 1.5 hrs/ea |
-> | Festoon | 2 hrs/ea |
-> | All Others | 1 hrs/ea |
->
-> [^6]: Determine exact labor from fixture and size.
+| Fixture Type | Labor |
+| ------------ | -------------- |
+| Paddle Fan | 1.5 hrs/ea |
+| Pendant | 1-4 hrs/ea[^1] |
+| Strip/Cove | 0.083 hrs/ft |
+| Site Poles | 1.5 hrs/ea |
+| Festoon | 2 hrs/ea |
+| All Others | 1 hrs/ea |
-#### Fixture Branch Length
+## Fixture Branch Length
-> | Case | Standard Length |
-> | ------------- | --------------- |
-> | Site/Courtyard | 50ft[^6] |
-> | Garage | 50ft |
-> | BOH | 40ft |
-> | Corridors | 40ft |
-> | Interior Amenity | 40ft[^7] |
-> | Office/Retail | 50ft |
-> | Exterior Amenity | 50ft |
-> | Units | 20ft |
->
-> [^6]: Locate the panel and come up with avg. length
->
-> [^7]: See fixture types below for special cases.
+| Case | Standard Length |
+| ------------- | --------------- |
+| Site/Courtyard | 50ft[^1] |
+| Garage | 50ft |
+| BOH | 40ft |
+| Corridors | 40ft |
+| Interior Amenity | 40ft[^2] |
+| Office/Retail | 50ft |
+| Exterior Amenity | 50ft |
+| Units | 20ft |
-#### Fixture Branch Wire size
+## Fixture Branch Wire size
-> | Case | Wire Size |
-> | -------------- | --------- |
-> | Site/Courtyard | #10[^6] |
-> | Garage | #10 |
-> | NM Cable | #14[^7] |
-> | All Others | #12 |
->
-> [^6]: Refer to panel schedules or Site Pole Detail for Site Pole wire size
->
-> [^7]: Kitchen and bathroom fixtures shall be #12 (NOT #14) on wood frame (NM) projects.
+| Case | Wire Size |
+| -------------- | --------- |
+| Site/Courtyard | #10[^1] |
+| Garage | #10 |
+| NM Cable | #14[^2] |
+| All Others | #12 |
-#### Garage
+## Garage
-#### Fixtures
+## Fixtures
Use ENT Assembly unless spec requires otherwise.
@@ -99,7 +84,7 @@ If PVC, use following assemblies:
| Ceiling | `PVC/ENT ASSEMBLIES`/`... - SLAB BOX / 45 DEG STUBBY` |
| Wall | `PVC/ENT ASSEMBLIES`/`... - STL BOX & TILE RING / 45 DEG STUBBY/ ENT DROP` |
-#### Homeruns
+## Homeruns
> `System` = "EL - Electrical"
@@ -107,7 +92,7 @@ Use 1 Homerun for every 3 circuits in Garage
Use assembly `Common Assemblies`/`Device Homeruns in Slab/Deck`
-#### Surface Mount
+## Surface Mount
> [!info] Surface Mount Fixtures
> * Wall Mount (Sconce)
@@ -116,18 +101,18 @@ Use assembly `Common Assemblies`/`Device Homeruns in Slab/Deck`
> * Tape
> * Track
-| Wiring Method | Assembly Path |
-| ---------------------------------------------------------------------------- |
-| NM Cable | `NM ASSEMBLIES`/`RND BOX BAR HNGR...` |
-| MC Cable | `MC ASSEMBLIES`/`SQ BOX, ROUND P RING & MNTG BRKT...` |
-| PVC in Ceiling | `PVC/ENT ASSEMBLIES`/`... - SLAB BOX / 45 DEG STUBBY` |
-| PVC in Wall | `PVC/ENT ASSEMBLIES`/`3/4" PVC W/ 3#12 - STL BOX/TILE RING` |
-| EMT | `EMT ASSEMBLIES`/`... - SQ BOX & ROUND P RING` |
+| Wiring Method | Assembly Path |
+| -------------- | ----------------------------------------------------------- |
+| NM Cable | `NM ASSEMBLIES`/`RND BOX BAR HNGR...` |
+| MC Cable | `MC ASSEMBLIES`/`SQ BOX, ROUND P RING & MNTG BRKT...` |
+| PVC in Ceiling | `PVC/ENT ASSEMBLIES`/`... - SLAB BOX / 45 DEG STUBBY` |
+| PVC in Wall | `PVC/ENT ASSEMBLIES`/`3/4" PVC W/ 3#12 - STL BOX/TILE RING` |
+| EMT | `EMT ASSEMBLIES`/`... - SQ BOX & ROUND P RING` |
> [!note]
> Use lighting control cable assemblies in Amenity areas
-##### Tape Lighting
+### Tape Lighting
Also called "cove" or "strip",
however those terms are less specific
@@ -156,7 +141,7 @@ A - Surface: Tape - 4.0hr (43-48ft) - MC #12 40ft
A - Surface: Tape - 4.5hr (49-54ft) - MC #12 40ft
```
-#### Recessed
+## Recessed
> [!info] Recessed Fixtures
> * recessed downlight
@@ -176,7 +161,7 @@ round up to the nearest 5ft
> [!note]
> "HI HAT" refers to a recessed can fixture.
-#### Undercabinet Fixtures
+## Undercabinet Fixtures
| Wiring Method | Assembly Path |
| ------------- | ------------------------------------- |
@@ -188,7 +173,7 @@ round up to the nearest 5ft
Use 10ft \#12/2 for MC & NM
-#### Paddle Fans
+## Paddle Fans
| Wiring Method | Assembly Path |
| ------------- | ----------------------------------------------------- |
@@ -196,58 +181,57 @@ Use 10ft \#12/2 for MC & NM
| MC Cable | `MC ASSEMBLIES`/`FAN RATED OCT BOX W/ BAR HNGR - ...` |
| PVC | `PVC/ENT ASSEMBLIES`/`... - SLAB BOX / 45 DEG STUBBY` |
-#### Stairwells & Elevators
+## Stairwells & Elevators
`PVC/ENT ASSEMBLIES`/`... - SLAB BOX / 45 DEG STUBBY`
-#### Facade
+## Facade
> `Phase` = "Facade"
Length and Labor will be more than a normal fixture in BOH/Amenity
-> | Fixture Type | Labor (hrs) |
-> | ------------ | ----------- |
-> | Non-Linear | 2 |
-> | Linear | See above |
+| Fixture Type | Labor (hrs) |
+| ------------ | ----------- |
+| Non-Linear | 2 |
+| Linear | See above |
> 1. `3/4" PVC W/ 3#10 - STL BOX & TILE RING / 45 DEG STUBBY/ ENT DROP`
> * `Length per Unit` = Distance to panel
-#### Porte Cochere (Drive up Area)
+## Porte Cochere (Drive up Area)
Create its own breakout in WBS, and phase in Accubid
> [!quote]
> This is not technically exposed or drop ceiling, but still use PVC
-#### FAA Lighting
+## FAA Lighting
> 1. `FIXTURE LABOR`/`FIXTURE LABOR 1HR`
> 2. `FESTOON & ROOF ASSEMBLIES`/`Aircraft Warning, 3/4" Conduit GRC/PVC 2#10, 1#10G`
-### Site & Courtyard
+## Site & Courtyard
-#### Breakdowns
+### Breakdowns
> System: "FML - Site Fixtures Material & Labor"
-#### Fixture Assemblies
+### Fixture Assemblies
-> | Fixture Type | Assembly Path |
-> | ------------------------------------ | -------------------------------------------------------------------------------- |
-> | Step Light | `COURTYARDS & LANDSCAPE`/`STEP FIX, 3/4" CONDUIT - PVC40 - ...` |
-> | Bollard | `COURTYARDS & LANDSCAPE`/`BOLLARD, 3/4" CONDUIT - PVC40 - ...`[^6] |
-> | Up-light | `COURTYARDS & LANDSCAPE`/`PERMA POST, 3/4" CONDUIT - PVC40 - ...` |
-> | In-grade up-light | `COURTYARDS & LANDSCAPE`/`3/4" CONDUIT - PVC40, IMC Elbow, ...` |
-> | Fixtures built into cabanas/pergolas | `COURTYARDS & LANDSCAPE`/`ALUM BOX W/ FLEX FIX, 3/4" CONDUIT - PVC40 - ...` |
-> | Handrail light | `COURTYARDS & LANDSCAPE`/`ALUM BOX W/ FLEX FIX, 3/4" CONDUIT - PVC40 - ...`[^7] |
->
-> [^6]: If we don't own concrete, delete Pre-cast bollard base from assembly
->
-> [^7]: Per Corwin: Hand rail lights should have a rigid 90 stub up and some flex
+| Fixture Type | Assembly Path |
+| ------------------------------------ | -------------------------------------------------------------------------------- |
+| Step Light | `COURTYARDS & LANDSCAPE`/`STEP FIX, 3/4" CONDUIT - PVC40 - ...` |
+| Bollard | `COURTYARDS & LANDSCAPE`/`BOLLARD, 3/4" CONDUIT - PVC40 - ...`[^1] |
+| Up-light | `COURTYARDS & LANDSCAPE`/`PERMA POST, 3/4" CONDUIT - PVC40 - ...` |
+| In-grade up-light | `COURTYARDS & LANDSCAPE`/`3/4" CONDUIT - PVC40, IMC Elbow, ...` |
+| Fixtures built into cabanas/pergolas | `COURTYARDS & LANDSCAPE`/`ALUM BOX W/ FLEX FIX, 3/4" CONDUIT - PVC40 - ...` |
+| Handrail light | `COURTYARDS & LANDSCAPE`/`ALUM BOX W/ FLEX FIX, 3/4" CONDUIT - PVC40 - ...`[^2] |
-##### Festoon Lighting
+[^1]: If we don't own concrete, delete Pre-cast bollard base from assembly
+[^2]: Per Corwin: Hand rail lights should have a rigid 90 stub up and some flex
+
+### Festoon Lighting
> AKA "string" or "market" lights
@@ -256,5 +240,3 @@ Create its own breakout in WBS, and phase in Accubid
> * `Length per Unit` = Light string length
> 3. `COURTYARDS & LANDSCAPE`/`ALUM BOX W/ FLEX FIX, 3/4" CONDUIT - PVC40 - ...`
> * `Length per Unit` = Distance to panel + 15ft
-
-### Takeoff
diff --git a/fixtures.md b/fixtures.md
new file mode 100644
index 0000000..1358dc2
--- /dev/null
+++ b/fixtures.md
@@ -0,0 +1,32 @@
+---
+id:
+aliases: []
+tags:
+ - systems/fixtures
+---
+# Fixtures
+
+## Info
+
+## Sequence
+
+### 1. Estimate preparation
+
+1. Read about the project specifications and construction type
+2. In drawings, locate:
+ * Fixture Schedule
+ * Reflected Ceiling Plans
+
+### 2. Takeoff
+
+See [[fixture-designations]].
+
+1. Takeoff floor plans in order
+2. Takeoff enlarged drawings
+
+### 3. Extension (Review and Checking)
+
+1. Garage Homeruns
+2. Luminaire in Amenity Areas
+3. Ensure appropriate breakdowns
+ * Site lighting in System =="Site Misc. Fixtures"==
diff --git a/gold-plating.md b/gold-plating.md
index 8132040..7ec3b41 100644
--- a/gold-plating.md
+++ b/gold-plating.md
@@ -1,6 +1,8 @@
---
+id:
+aliases: []
tags:
-
+ - risk
---
# Gold Plating
diff --git a/gut-feel.md b/gut-feel.md
index c013751..4707f92 100644
--- a/gut-feel.md
+++ b/gut-feel.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - risk
+---
# Gut Feel
Gut feel is the sensation one acquires with subject experience
diff --git a/new-additions/takeoff/lighting-controls.md b/lighting-controls.md
similarity index 80%
rename from new-additions/takeoff/lighting-controls.md
rename to lighting-controls.md
index 6e46079..3cc3739 100644
--- a/new-additions/takeoff/lighting-controls.md
+++ b/lighting-controls.md
@@ -1,7 +1,8 @@
---
-id:
-aliases: []
-tags: []
+id:
+aliases:
+tags:
+ - systems/electrical
---
# Lighting Controls
@@ -17,8 +18,6 @@ All these control methods are likely to appear in drawings.
## Conventions
-By PDI convention, lighting controls are generally "Electrical", not "Lighting".
-
> [!info] "Local Control" as a PDI proposal qualification
> The term "local control only" is sometimes used to indicate
> no consideration for _any_ lighting control beyond standard devices,
@@ -33,4 +32,4 @@ By PDI convention, lighting controls are generally "Electrical", not "Lighting".
#### Custom Switch Boxes
For switch combinations not in `COMMON ASSEMBLIES`,
-create heating [[designations]] based on the most similar.
+create heating designations based on the most similar.
diff --git a/new-additions/takeoff/lightning-protection.md b/lightning-protection.md
similarity index 97%
rename from new-additions/takeoff/lightning-protection.md
rename to lightning-protection.md
index 50649ce..a8df591 100644
--- a/new-additions/takeoff/lightning-protection.md
+++ b/lightning-protection.md
@@ -1,7 +1,8 @@
---
id:
aliases: []
-tags: []
+tags:
+ - systems/lightning-protection
---
# Lightning Protection
diff --git a/low-voltage.md b/low-voltage.md
new file mode 100644
index 0000000..965347d
--- /dev/null
+++ b/low-voltage.md
@@ -0,0 +1,60 @@
+---
+id:
+aliases: []
+tags:
+ - systems/low-voltage
+---
+# Low Voltage
+
+## Sequence
+
+### 1. Estimate preparation
+
+## Telecom - Riser
+
+1. Service entrance conduit "Site Low Voltage Ductbank (SLVDB)"
+2. Riser throughout building
+3. Sleeving for riser
+
+## Telecom - Devices
+
+1. Locate Proposal/Scope of Work. Determine ownership and takeoff responsibility:
+ * Cabling
+ * Conduit & Pathways
+ * Sleeving
+2. Locate which plans the LV is taken off on
+3. Locate LV Details
+4. Read about the project specifications and construction type
+5. Fill out OneNote
+
+### 2. Takeoff
+
+1. Takeoff devices as shown throughout the building
+2. Takeoff Conduit Riser as needed
+
+### 3. Extension (Review and Checking)
+
+1. Sleeving
+
+## Low Voltage
+
+### 1. Estimate preparation
+
+1. Locate Proposal/Scope of Work. Determine ownership and takeoff responsibility:
+ * Cabling
+ * Conduit & Pathways
+ * Sleeving
+2. In the drawings, locate:
+ * Floor plans where LV scope is shown
+ * LV Details
+3. Read about the project specifications and construction type
+4. Fill out OneNote
+
+### 2. Takeoff
+
+1. Takeoff devices as shown throughout the building
+2. Takeoff riser conduit as needed
+
+### 3. Extension (Review and Checking)
+
+1. Sleeving for riser
diff --git a/media-commentary/mike-holts-illustrated-guide-to-electrical-estimating.md b/mike-holts-illustrated-guide-to-electrical-estimating.md
similarity index 100%
rename from media-commentary/mike-holts-illustrated-guide-to-electrical-estimating.md
rename to mike-holts-illustrated-guide-to-electrical-estimating.md
diff --git a/new-additions/takeoff/electrical.md b/misc-budgets.md
similarity index 70%
rename from new-additions/takeoff/electrical.md
rename to misc-budgets.md
index 852b979..bd8474c 100644
--- a/new-additions/takeoff/electrical.md
+++ b/misc-budgets.md
@@ -1,28 +1,12 @@
---
-id: electrical
+id:
aliases: []
-tags: []
+tags:
+ - systems
---
-# Final SOE
+# Misc Budgets
-## 1. Trash Chute
-
-Horizontal:
-* Check if shown on power drawings as mech connection
- * If not, use 100ft length
-
-Vertical (Riser):
-* Takeoff: `COMMON ASSEMBLIES`/`MISC ASSEMBLIES`/`TRASH CHUTE RISER CIRCUIT...`
-* Uncheck Link 'Enable Livecount'
-* Takeoff in Typical
- * Length = average floor to floor height
-
-## 2. CU/IP
-
-* Units Condensing Unit
-* Mechanical Connection
-
-## 3. Slab Deck
+## Slab Deck
Create Area Typicals for every Concrete slab floor:
@@ -36,9 +20,9 @@ Create Area Typicals for every Concrete slab floor:
* Takeoff: `ITEM DATABASE`/`MISC PDI PRODUCT`/`MISC MATERIAL - SLAB/DECK & FEEDER`/`MISC MATERIAL - SLAB/DECK (NAILS, PAINT, TAPE, ETC = $250)`
* 1 Takeoff each Typical, Count = 1
-## 4. Temporary Power & Lighting
+## Temporary Power & Lighting
-### 4.1 Temp Power
+### Temp Power
```
Area = "2 - Site"
@@ -50,7 +34,7 @@ BidItem = "1 - Site"
Hoxton Hotel (aka Nashville Hotel)
* Takeoff: `ITEM DATABASE`/`TEMPORARY POWER`/`TEMPORARY POWER - * SERVICE`
-### 4.2A Temp Lighting (Building)
+### Temp Lighting (Building)
```
Area = "01 - Temp Power Distribution Building"
@@ -66,7 +50,7 @@ Garden Styles:
* Takeoff: `ITEM DATABASE`/`TEMPORARY POWER`/`TEMPORARY POWER - T POLE (EACH)`
* _Count_ = 1 per 150' per building
-### 4.2B Temp Lighting (Garage)
+### Temp Lighting (Garage)
```
Area = "01 - Temp Power Distribution Building"
@@ -78,7 +62,7 @@ BidItem = "3 - Building"
* Takeoff: `ITEM DATABASE`/`TEMPORARY POWER`/`* - TEMPORARY LIGHTING / PWR PNL (PER BLDG AREA SFT)`
* _Count_ = Garage SF
-## 5. Irrigation pumps
+## Irrigation pumps
```
Area = "2 - Site"
@@ -87,5 +71,5 @@ System = `MISC - Site Miscellaneous`
BidItem = "1 - Site"
```
-* (3) 3Phase 30A 200' Mech. Con.
+* (3) 3Phase 30A 200' Mech. Con. EMT Carflex
* Append to name: "Irrigation Pump - "
diff --git a/monte-carlo-methods.md b/monte-carlo-methods.md
index c94b51f..03265c3 100644
--- a/monte-carlo-methods.md
+++ b/monte-carlo-methods.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - risk
+---
# Monte Carlo Methods
> [!quote]
diff --git a/new-additions/automation/necessary-automation.md b/necessary-automation.md
similarity index 97%
rename from new-additions/automation/necessary-automation.md
rename to necessary-automation.md
index 50b9465..18ed89f 100644
--- a/new-additions/automation/necessary-automation.md
+++ b/necessary-automation.md
@@ -1,5 +1,9 @@
---
+id:
+aliases: []
tags:
+ - automation
+ - professional
- software
---
# Necessary Automation
@@ -73,4 +77,4 @@ Sublime is a friendly option for non-technical users.
```
3#12 #12G 3/4"C
-```
\ No newline at end of file
+```
diff --git a/new-additions/abbreviations.md b/new-additions/abbreviations.md
deleted file mode 100644
index 263ef33..0000000
--- a/new-additions/abbreviations.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-id: abbreviations
-aliases:
-tags:
----
-# Abbreviations
-
-## Americans with Disabilities Act (ADA)
-
-* hearing impaired (HI or H.I.)
-* mobility features (MF or M.F.)
-* accessible (Acc.)
- * usually refers to mobility features.
-
diff --git a/new-additions/reprogramming/general.md b/new-additions/reprogramming/general.md
deleted file mode 100644
index 25c3fdd..0000000
--- a/new-additions/reprogramming/general.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# General Reprogramming
-
-## "WBS"
-
-What is called a "WBS" is not one and is not intended to be.
-It is a macro monolith excel document
-used to extend or replace Accubid's default closeout.
diff --git a/new-additions/takeoff/breakdowns.md b/new-additions/takeoff/breakdowns.md
deleted file mode 100644
index bc88b3d..0000000
--- a/new-additions/takeoff/breakdowns.md
+++ /dev/null
@@ -1,82 +0,0 @@
----
-id: breakdowns
-aliases: []
-tags: []
----
-# Breakdowns
-
-Managing breakdowns is the most time consuming part of takeoff.
-Assembly selection is comparatively quick compared to Anywhere.
-
-## Site
-
-Area: "2 - Site"
-Phase: "Site"
-
-## Garage
-
-### General
-
-Area: "XX - Level P1 Garage"
-Phase: "Garage"
-
-### Stairwells
-
-Area: "S - Stairwells Garage"
-Phase: "Garage"
-
-## Building
-
-### General
-
-Area: "XX - Level XX Building"
-Phase: "Building - BOH, Storage & Common"
-
-### Corridors
-
-Area: "XX - Level XX Building"
-Phase: "Building - Corridors"
-
-### Stairwells
-
-Area: "S - Stairwells Building"
-Phase: "Building - BOH, Storage & Common"
-
-### Rentable
-
-#### Residential
-
-Area: "XX - Level XX Building"
-Phase: "Unit Residential"
-
-#### Hotel
-
-Area: "XX - Level XX Building"
-Phase: "Unit Key"
-
-### Interior Amenity
-
-#### General
-
-Area: "XX - Level XX Amenity Building"
-Phase: "Interior Amenity"
-
-#### Kitchen
-
-Area: "XX - Level XX Kitchen Building"
-Phase: "Kitchen"
-
-#### Retail
-
-Area: "XX - Level XX Retail Building"
-Phase: "Retail"
-
-#### Ballroom
-
-Area: "XX - Level XX Ballroom Building"
-Phase: "Ballrooms"
-
-### Exterior Amenity
-
-Area: "XX - Level XX Exterior Amenity Building"
-Phase: "Exterior Amenity (Courtyards, Pool Decks)"
diff --git a/new-additions/takeoff/designations.md b/new-additions/takeoff/designations.md
deleted file mode 100644
index 120a6c8..0000000
--- a/new-additions/takeoff/designations.md
+++ /dev/null
@@ -1,15 +0,0 @@
----
-id: designations
-aliases: []
-tags: []
----
-# Designations
-
-## Building Designations
-
-## Modifying Designations
-
-> [!tip]
-> It is generally easier to rebuild a designation than to modify it.
-> For designations with existing takeoffs, Right-Click > `Empty Designation`.
-> The build process can then be completed anew.
diff --git a/new-additions/takeoff/project-setup.md b/new-additions/takeoff/project-setup.md
deleted file mode 100644
index b7a9c3d..0000000
--- a/new-additions/takeoff/project-setup.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Project Setup
-
-## Create Project Folder
-
-```pwsh
-# Copy template folder to
-Set-Location "\\EgnyteDrive\Shared\Estimating\7 ConEst Team\Projects\ConEst 2025\"
-Copy-Item ".\z.Template Folder\" ".\$region\$projectName"
-```
-
-## Download Project Documents
-
-```
-Set-Location ".\$region\$projectName"
-# Download docs from BPM to ".\3. Plans & Spec's"
-# TODO: Automate
-
-# copying from "\\EgnyteDrive\Shared\Estimating\$region\00 Open Bids\$projectName"
-# may be more practical
-```
-
-## Create Unit Matrix
-
-See Architecturals
-
-## Create Area Breakout
-
-`SF Calcs.xlsx`
-
-## Create Blank WBS
-
-```pwsh
-Set-Location "\\EgnyteDrive\Shared\Estimating\19 WBS Agreement GP"
-Copy-Item ".\1. Wizard Template - WBS\MEP Wizard v3.111.4 (7-21-2025)(Summary Adjustments).xlsm" \
- ".\2. Blank Project WBS\2025\$projectName WBS $date.xlsm"
-```
-
-## Create LiveCount Project
-
-- In [Trimble Connect](https://web.connect.trimble.com),
- find the project "CONEST TEMPLATE",
- open its context menu,
- then click "Use as template for a new project".
-- Ensure all checkboxes are checked,
- then click `Next`.
-- Name with format "{Project Name} - ConEst".
-
-Refresh the page and open the newly created project.
-
-## Upload Drawings to LiveCount
-
-```
-# Extract drawings to ".\Trimble Connect (Plans)"
-```
-
-Upload extracted drawings to LiveCount
-
-## Create Accubid Job
-
-> [!important]
-> The LiveCount project must be created **before** creating the Accubid job.
-
-- Create a new Accubid job:
- Path: "\\EgnyteDrive\Shared\Trimble\Accubid\Bid\{Project Name} - ConEst.es16"
-
-## Add Drawings to Accubid Job
-
-- In the LiveCount window, find `Document Manager` > `Select Existing Project`.
- Add all previously uploaded drawings.
diff --git a/new-additions/takeoff/sequence.md b/new-additions/takeoff/sequence.md
deleted file mode 100644
index 49ca519..0000000
--- a/new-additions/takeoff/sequence.md
+++ /dev/null
@@ -1,287 +0,0 @@
----
-id:
-aliases: []
-tags: []
----
-# Sequence
-
-## Electrical
-
-### 1. Estimate preparation
-
-2. Read about the project specifications and construction type
-3. Locate Equipment Schedules
-
-4. Device specs (Decora or Standard)
-
-### 2. Takeoff
-
-1. Takeoff all equipment that is not #12
-2. Go by Drawing in chronological order
-3. Takeoff Enlarged Drawings
-4. Do final checklist in electrical takeoff notes
-
-### 3. Extension (Review and Checking)
-
-1. Count Car chargers and location
-
-## Feeders
-
-### 1. Estimate preparation
-
-Read about the project specifications and construction type
-
-* Delivery Method: (Plans & Specs, Design Build, Design Assist, Preliminary Budget)
-* Deck thickness
-* Wiring method
-* Conductor material (Aluminum/Copper)
-
-Locate:
-* Riser Diagram
-* Feeder Schedule (if present)
-* Main Electrical rooms and panel locations
-* Routing (if present)
-
-### 2. Takeoff
-
-* Choose a starting point on the riser
-* Determine wire & Conduit makeup (3Ph/1Ph, AL/CU, Conduit)
-* Measure off the length of the feed _ADDERS_
- * Square corners, use corridors if possible
-
-Bus Duct
-
-### 3. Extension (Review and Checking)
-
-## Fire Alarm - Riser
-
-### 1. Estimate preparation
-
-1. Initial the OneNote
-2. Find Fire Alarm plans (If Applicable)
-3. Locate Fire Command Center (FCC)
-
-### 2. Takeoff
-
-1. Use the FA Riser Script
-2. Takeoff Devices
-
-### 3. Extension (Review and Checking)
-
-1. Sleeving for riser?
-2. Are Two-Way/DAS Included?
-
-## Fire Alarm - Devices
-
-### 1. Estimate preparation
-
-2. Read about the project specifications and construction type
-3. Find FA drawings or where they are shown
-
-### 2. Takeoff
-
-1. Takeoff floor plans in order
-2. Takeoff enlarged drawings
-
-### 3. Extension (Review and Checking)
-
-8. Fire Smoke Dampers (FSD's) FA or electrical?
-9. Sleeving?
-
-## Lighting
-
-### 1. Estimate preparation
-
-1. Read about the project specifications and construction type
-2. In drawings, locate:
- * Fixture Schedule
- * Reflected Ceiling Plans
-
-### 2. Takeoff
-
-1. Takeoff floor plans in order
-2. Takeoff enlarged drawings
-
-### 3. Extension (Review and Checking)
-
-1. Garage Homeruns
-2. Luminaire in Amenity Areas
-3. Ensure appropriate breakdowns
- * Site lighting in System =="Site Misc. Fixtures"==
-
-## Units
-
-### 1. Estimate preparation
-
-1. Locate Unit panels and relevant keynotes
- * Bus amps
-
-2. Read about the project specifications and construction type
- * Wood or Metal studs
- * Wiring Method
- * NM or MC
- * Wiring device plates
- * Decora or Standard
- * Wiring device specs
- * are 15A devices allowed?
- * Equipment (20A Kitchen and bath)
-
-3. Fill out OneNote
-
-### 2. Takeoff
-
-1. Kitchen and Bath
-2. General assemblies
-3. Low Voltage
-4. Lighting Control
-5. Lighting Fixtures
-
-Copy paste original takeoff and adjust to changes
-
-### 3. Extension (Review and Checking)
-
-1. Scroll through with Area selected and make sure there is takeoff for each unit type
-
-## Telecom - Devices
-
-### 1. Estimate preparation
-
-1. Locate Proposal/Scope of Work. Determine ownership and takeoff responsibility:
- * Cabling
- * Conduit & Pathways
- * Sleeving
-2. Locate which plans the LV is taken off on
-3. Locate LV Details
-4. Read about the project specifications and construction type
-5. Fill out OneNote
-
-### 2. Takeoff
-
-1. Takeoff devices as shown throughout the building
-2. Takeoff Conduit Riser as needed
-
-### 3. Extension (Review and Checking)
-
-1. Sleeving
-
-## Telecom - Riser
-
-1. Service entrance conduit "Site Low Voltage Ductbank (SLVDB)"
-2. Riser throughout building
-3. Sleeving for riser
-
-## Subfeeds
-
-### 1. Estimate preparation
-
-1. Read about the project specifications and construction type
- * Delivery Method: (Plans & Specs, Design Build, Design Assist, Preliminary Budget)
- * Deck Thickness
- * Corridor Ceiling type
-
-2. In the drawings, locate:
- * Unit Panel Schedules
- * Unit Load Calculations
- * Riser Diagram
- * Subfeed schedule (if present)
-
-### 2. Takeoff
-
-1. Determine wiring method
-
- | Construction Type | Wiring Method | Subfeed Options |
- | ----------------- | ------------- | --------------- |
- | 1,2 | MC Cable | MC, PVC, EMT |
- | 3,4,5 | NM Cable | SER, EMT |
-
- %%
- TODO: Create flow chart for wiring methods.
- Some cases to mention:
- * Deck thickness (minimum 3x conduit outer diameter)
- * Renovations (may not be able to run in slab)
- %%
-
-2. Route subfeeds to the Meter Centers using appropriate adder lengths
-
- > [!tip]
- > Identify if and where typicals can be used
-
-3. Assign material to lengths and apply Voltage drop if applicable
-
-4. Pigtails and Wireway Troughs if applicable
-
-### 3. Extension (Review and Checking)
-
-1. Use the extension tab to determine the Correct Quantity
-
-## Switchgear
-
-### 1. Estimate preparation
-
-1. Initial the OneNote
-2. In the drawings, locate:
- * Riser Diagrams
- * House Panels
-
-### 2. Takeoff
-
-1. Copy over the Temporary assemblies from "Ben -1"
-2. Build Items in Distribution:
- * Panelboards
- * Switchboards
- * Transfer SWs
- * Meter centers
- * Generator
-3. Takeoff Common Assemblies:
- * XFMRs
- * Disconnect Switches
- * Bus Duct
-4. Takeoff Items in Item Database:
- * Wireway (Trough/Gutter)
-5. Takeoff Temp Assemblies:
- * CT Cabinet
- * Meter
- * Fire Pump
- * Fire Pump Controller
- * SPD/TVSS
-
-When building panelboards/switchboards,
-add terminations according to an example from the schedules.
-Do not include feeder terminations.
-
-Items to Avoid:
-* Tap Boxes
-* Bus Duct
-* Vault Room
-* Anything FPL
-* Grounding
-* Elevator Room
-
-### 3. Extension (Review and Checking)
-
-1. Generator
- * Ensure takeoff is in the generator Area and System breakdowns
- * Put location, quantity, and type on OneNote
-
-## Low Voltage
-
-### 1. Estimate preparation
-
-1. Locate Proposal/Scope of Work. Determine ownership and takeoff responsibility:
- * Cabling
- * Conduit & Pathways
- * Sleeving
-2. In the drawings, locate:
- * Floor plans where LV scope is shown
- * LV Details
-3. Read about the project specifications and construction type
-4. Fill out OneNote
-
-### 2. Takeoff
-
-1. Takeoff devices as shown throughout the building
-2. Takeoff riser conduit as needed
-
-### 3. Extension (Review and Checking)
-
-1. Sleeving for riser
diff --git a/new-additions/takeoff/units.md b/new-additions/takeoff/units.md
deleted file mode 100644
index 64ea70f..0000000
--- a/new-additions/takeoff/units.md
+++ /dev/null
@@ -1,24 +0,0 @@
-# Unit Takeoff
-
-"Units" includes [hotel](#hotel) and [residential](#residential) spaces.
-
-> [!tip] Preparing for Unit Takeoff
-> Units generally have very little variation.
-> It is usually best to copy-paste takeoffs
-> rather than re-build them for each unit.
-
-## Hotel
-
-> [!info] Also Known As
-> * Guestrooms
-> * Keys
-
-> [!trivia]
-> The origin of the term "key" as a synonym of "hotel room"
-> ...
-> %% TODO: %%
-
-## Residential
-
-> [!info] Also Known As
-> * Condos
\ No newline at end of file
diff --git a/new-additions/new-hire.md b/new-hire.md
similarity index 87%
rename from new-additions/new-hire.md
rename to new-hire.md
index 975df94..e9fc61d 100644
--- a/new-additions/new-hire.md
+++ b/new-hire.md
@@ -1,3 +1,10 @@
+---
+id:
+aliases: []
+tags:
+ - professional
+ - media
+---
# NEW HIRE - ESTIMATOR
| | |
@@ -44,5 +51,5 @@
## Goals
-- Complete a full-take-off within first 6 months of start
-- Complete Accubid tabs within first year of start
\ No newline at end of file
+* Complete a full-take-off within first 6 months of start
+* Complete Accubid tabs within first year of start
diff --git a/open-problems.md b/open-problems-in-estimating.md
similarity index 72%
rename from open-problems.md
rename to open-problems-in-estimating.md
index 64fdf82..074f881 100644
--- a/open-problems.md
+++ b/open-problems-in-estimating.md
@@ -1,4 +1,10 @@
-# Open Problems
+---
+id:
+aliases: []
+tags:
+ - estimating
+---
+# Open Problems in Estimating
[[construction-estimating]] being a nascent and unstudied field,
there are several fundamental questions of the craft
diff --git a/perfect-information.md b/perfect-information.md
index 13c662a..59deba3 100644
--- a/perfect-information.md
+++ b/perfect-information.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - risk
+---
# Perfect Information
In [[strategy]], perfect information is hypothetical information
@@ -9,10 +15,10 @@ Expected value of perfect information (EVPI)
is the price that one would be willing to pay
in order to gain access to perfect information.
-The perceived *value* of decreased uncertainty
-must be weighed against its *cost*.
+The perceived _value_ of decreased uncertainty
+must be weighed against its _cost_.
-This concept provides the basis for the solution of one or more [[open-problems]].
+This concept provides the basis for the solution of one or more [[open-problems-in-estimating]].
To reduce [[risk]] in [[construction-estimating]],
an organization pays in estimator hours.
These hours have a direct cost in salary and benefits,
diff --git a/new-additions/automation/portable-tools.md b/portable-tools.md
similarity index 100%
rename from new-additions/automation/portable-tools.md
rename to portable-tools.md
diff --git a/new-additions/automation/possible-automation.md b/possible-automation.md
similarity index 97%
rename from new-additions/automation/possible-automation.md
rename to possible-automation.md
index e96644f..860b352 100644
--- a/new-additions/automation/possible-automation.md
+++ b/possible-automation.md
@@ -1,5 +1,8 @@
---
+id:
+aliases: []
tags:
+ - automation
- software
---
# Possible Automation
diff --git a/new-additions/automation/powershell-document-conversion-module.md b/powershell-document-conversion-module.md
similarity index 93%
rename from new-additions/automation/powershell-document-conversion-module.md
rename to powershell-document-conversion-module.md
index 64e44f7..b16548d 100644
--- a/new-additions/automation/powershell-document-conversion-module.md
+++ b/powershell-document-conversion-module.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - automation
+---
# PowerShell Document Conversion
PowerShell module to allow fluent conversion of "document" files,
@@ -44,7 +50,7 @@ Run format specific linter on document.
## `Import-Document`
-Return PSCustomObject with appropriate properties.
+Return PSCustomObject with appropriate properties.
***
diff --git a/new-additions/automation/project-info.md b/project-info.md
similarity index 87%
rename from new-additions/automation/project-info.md
rename to project-info.md
index b83b4d7..50b0682 100644
--- a/new-additions/automation/project-info.md
+++ b/project-info.md
@@ -1,3 +1,10 @@
+---
+id:
+aliases: []
+tags:
+ - automation
+ - professional
+---
# Project Info
Standardize formatting and input methods for common
@@ -21,4 +28,3 @@ To calculate regular quantities
* conductor support
* by area
* temp power
-
diff --git a/project-setup.md b/project-setup.md
new file mode 100644
index 0000000..08a47fd
--- /dev/null
+++ b/project-setup.md
@@ -0,0 +1,57 @@
+---
+id:
+aliases: []
+tags:
+ - guide
+ - professional
+next: setup-accubid
+---
+# Project Setup
+
+## Create Project Folder
+
+```pwsh
+# Copy template folder to
+Set-Location "\\EgnyteDrive\Shared\Estimating\7 ConEst Team\Projects\ConEst 2025\"
+Copy-Item ".\z.Template Folder\" ".\$region\$projectName"
+```
+
+## Download Project Documents
+
+```
+Set-Location ".\$region\$projectName"
+# Download docs from BPM to ".\3. Plans & Spec's"
+# TODO: Automate
+
+# copying from "\\EgnyteDrive\Shared\Estimating\$region\00 Open Bids\$projectName"
+# may be more practical
+```
+
+## Create Unit Matrix
+
+See Architecturals
+
+## Create Area Breakout
+
+`SF Calcs.xlsx`
+
+## Setup WBS
+
+> [!info] "WBS"
+> What is called a "WBS" is not one and is not intended to be.
+> It is a macro monolith excel document
+> used to extend/replace Accubid's default closeout.
+
+```pwsh
+Set-Location "\\EgnyteDrive\Shared\Estimating\19 WBS Agreement GP"
+Copy-Item ".\1. Wizard Template - WBS\MEP Wizard v3.111.4 (7-21-2025)(Summary Adjustments).xlsm" \
+ ".\2. Blank Project WBS\2025\$projectName WBS $date.xlsm"
+```
+
+%%
+TODO: Continue WBS sequence.
+%%
+
+## Setup Accubid
+
+See [[accubid-setup]].
diff --git a/new-additions/raceway-terms.md b/raceway-terms.md
similarity index 99%
rename from new-additions/raceway-terms.md
rename to raceway-terms.md
index a3e16d0..4184bcc 100644
--- a/new-additions/raceway-terms.md
+++ b/raceway-terms.md
@@ -1,7 +1,8 @@
---
id:
aliases: []
-tags: []
+tags:
+ - terminology
---
# Raceway Terms
diff --git a/risk-oriented-estimating.md b/risk-oriented-estimating.md
index 4d2521f..e878fc5 100644
--- a/risk-oriented-estimating.md
+++ b/risk-oriented-estimating.md
@@ -1,9 +1,10 @@
---
id: risk-oriented-estimating
aliases: []
-tags: []
+tags:
+ - estimating
+ - risk
---
-
# Risk Oriented Estimating
Risk-Oriented Estimating (ROE), is a methodology for [[construction-estimating]] which
@@ -19,6 +20,7 @@ as these ultimately _increase_ risk by inflating the apparent project cost,
increasing the probability of loss to a competitor.
%%
+
## Scratch
Bid risk may fit a [Taleb distribution](https://en.wikipedia.org/wiki/Taleb_distribution).
@@ -42,6 +44,7 @@ given an organization's [[risk#Risk Tolerance]].
## EVPI Takeoff
%%
+
## Scratch
Expected value of perfect information (EVPI)
@@ -51,8 +54,8 @@ Count-based takeoff speed increases with count.
Optimizing the takeoff process means:
-* *Minimizing* the need for information outside of drawings
-* *Maximizing* organizational consistency
+* _Minimizing_ the need for information outside of drawings
+* _Maximizing_ organizational consistency
> [!note]
> Recent events have complicated my philosophy above.
@@ -61,4 +64,4 @@ Optimizing the takeoff process means:
> [!note] Naming Conventions (Use Case vs. Description)
> Naming by use case is intuitive for those without estimating or field experience,
-> but has the side effect that those accustomed to the names will inevitably *treat them as descriptive*.
+> but has the side effect that those accustomed to the names will inevitably _treat them as descriptive_.
diff --git a/risk.md b/risk.md
index 84bc50d..1e89687 100644
--- a/risk.md
+++ b/risk.md
@@ -1,6 +1,6 @@
---
tags:
-
+ - risk
---
# Risk
diff --git a/separation-of-concerns.md b/separation-of-concerns.md
index 6592dc3..04e6d9d 100644
--- a/separation-of-concerns.md
+++ b/separation-of-concerns.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - organization
+---
# Separation of Concerns
Separation of concerns is a design philosophy
diff --git a/strategy.md b/strategy.md
index 7de49d3..f7c47b4 100644
--- a/strategy.md
+++ b/strategy.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - risk
+---
# Strategy
The field of strategy is concerned with the optimal solutions of problematic scenarios.
@@ -34,4 +40,4 @@ Project cost certainty
#### Expected Competition
-### Estimation Strategy
\ No newline at end of file
+### Estimation Strategy
diff --git a/subfeeds.md b/subfeeds.md
new file mode 100644
index 0000000..6ca8e29
--- /dev/null
+++ b/subfeeds.md
@@ -0,0 +1,51 @@
+---
+id:
+aliases: []
+tags:
+ - systems/subfeeds
+---
+# Subfeeds
+
+## Sequence
+
+### 1. Estimate preparation
+
+1. Read about the project specifications and construction type
+ * Delivery Method: (Plans & Specs, Design Build, Design Assist, Preliminary Budget)
+ * Deck Thickness
+ * Corridor Ceiling type
+
+2. In the drawings, locate:
+ * Unit Panel Schedules
+ * Unit Load Calculations
+ * Riser Diagram
+ * Subfeed schedule (if present)
+
+### 2. Takeoff
+
+1. Determine wiring method
+
+ | Construction Type | Wiring Method | Subfeed Options |
+ | ----------------- | ------------- | --------------- |
+ | 1,2 | MC Cable | MC, PVC, EMT |
+ | 3,4,5 | NM Cable | SER, EMT |
+
+ %%
+ TODO: Create flow chart for wiring methods.
+ Some cases to mention:
+ * Deck thickness (minimum 3x conduit outer diameter)
+ * Renovations (may not be able to run in slab)
+ %%
+
+2. Route subfeeds to the Meter Centers using appropriate adder lengths
+
+ > [!tip]
+ > Identify if and where typicals can be used
+
+3. Assign material to lengths and apply Voltage drop if applicable
+
+4. Pigtails and Wireway Troughs if applicable
+
+### 3. Extension (Review and Checking)
+
+1. Use the extension tab to determine the Correct Quantity
diff --git a/supertopics.md b/supertopics.md
index cb1001e..d80b4f1 100644
--- a/supertopics.md
+++ b/supertopics.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - organization
+---
# Supertopics
Supertopics are a concept that I use
@@ -5,4 +11,4 @@ to visualize and categorize my knowledge and interests.
They are a group of topics that,
while they may seem disparate in a vacuum,
-are all fundamental to a greater understanding of the whole.
\ No newline at end of file
+are all fundamental to a greater understanding of the whole.
diff --git a/switchgear.md b/switchgear.md
new file mode 100644
index 0000000..9f9849c
--- /dev/null
+++ b/switchgear.md
@@ -0,0 +1,61 @@
+---
+id:
+aliases: []
+tags:
+ - systems/switchgear
+---
+# Switchgear
+
+## Sequence
+
+### 1. Estimate preparation
+
+1. Initial the OneNote
+2. In the drawings, locate:
+ * Riser Diagrams
+ * House Panels
+3. Copy over the Temporary assemblies from "Ben -1"
+
+### 2. Takeoff
+
+1. Build Items in Distribution:
+ * Panelboards
+ * Switchboards
+ * Transfer SWs
+ * Meter centers
+ * Generator
+
+2. Takeoff Common Assemblies:
+ * XFMRs
+ * Disconnect Switches
+ * Bus Duct
+
+3. Takeoff Items in Item Database:
+ * Wireway (Trough/Gutter)
+
+4. Takeoff Temp Assemblies:
+ * CT Cabinet
+ * Meter
+ * Fire Pump
+ * Fire Pump Controller
+ * SPD/TVSS
+
+When building panelboards/switchboards,
+add terminations according to an example from the schedules.
+**Do not include feeder terminations.**
+
+Items to Avoid:
+* Tap Boxes
+* Bus Duct
+* Vault Room
+* Anything FPL
+* Grounding
+* Elevator Room
+
+#### Generator
+
+### 3. Extension (Review and Checking)
+
+1. Generator
+ * Ensure takeoff is in the generator Area and System breakdowns
+ * Put location, quantity, and type on OneNote
diff --git a/systems.md b/systems.md
new file mode 100644
index 0000000..dba6435
--- /dev/null
+++ b/systems.md
@@ -0,0 +1,17 @@
+---
+id:
+aliases:
+ - '#systems'
+tags:
+ - systems
+---
+# Systems
+
+* [[electrical]]
+* [[feeders]]
+* [[fire-alarm]]
+* [[fixtures]]
+* [[lightning-protection]]
+* [[low-voltage]]
+* [[subfeeds]]
+* [[units]]
diff --git a/templates/System.md b/templates/System.md
deleted file mode 100644
index a9f65c8..0000000
--- a/templates/System.md
+++ /dev/null
@@ -1,16 +0,0 @@
----
-id: {{title}}
-aliases: []
-tags: [
- - system
-]
----
-# {{title}}
-
-## Info
-
-## Conventions
-
-## Scope
-
-### Takeoff
\ No newline at end of file
diff --git a/media-commentary/the-failure-of-risk-management.md b/the-failure-of-risk-management.md
similarity index 100%
rename from media-commentary/the-failure-of-risk-management.md
rename to the-failure-of-risk-management.md
diff --git a/this-notebook.md b/this-notebook.md
index 39eca32..011d329 100644
--- a/this-notebook.md
+++ b/this-notebook.md
@@ -1,11 +1,9 @@
---
tags:
-
+ - meta
---
# This Notebook
-#meta
-
This journal is for [[me|my]] rough ideas that I'm likely to change my opinion on
as my understanding of them develops.
diff --git a/traditional-estimating-methods.md b/traditional-estimating-methods.md
index 94951c1..6ee5cca 100644
--- a/traditional-estimating-methods.md
+++ b/traditional-estimating-methods.md
@@ -1,3 +1,9 @@
+---
+id:
+aliases: []
+tags:
+ - estimating
+---
# Traditional Estimating Methods
Also "single-point estimation" as opposed to the standard three-point.
@@ -5,7 +11,7 @@ Also "single-point estimation" as opposed to the standard three-point.
"Traditional estimating methods" as referenced frequently in [[this notebook]]
are those [[construction-estimating]] methods that produce:
-* an *exhaustive* and *specific* bill of material
+* an _exhaustive_ and _specific_ bill of material
* a single, definitive final price for each bid item
Such methods lack the ability to intelligently express [[uncertainty]].
diff --git a/uncertainty.md b/uncertainty.md
index 78a68a8..37cba88 100644
--- a/uncertainty.md
+++ b/uncertainty.md
@@ -1,7 +1,8 @@
---
id: uncertainty
aliases: []
-tags: []
+tags:
+ - risk
---
# Uncertainty
diff --git a/units.md b/units.md
new file mode 100644
index 0000000..761f5ec
--- /dev/null
+++ b/units.md
@@ -0,0 +1,71 @@
+---
+id:
+aliases: []
+tags:
+ - systems/units
+---
+# Unit Takeoff
+
+## Info
+
+"Units" includes [hotel](#hotel) and [residential](#residential) spaces.
+
+> [!tip] Preparing for Unit Takeoff
+> Units generally have very little variation.
+> It is usually best to copy-paste takeoffs
+> rather than re-build them for each unit.
+
+> [!info] Americans with Disabilities Act (ADA) Terms
+> * hearing impaired (HI or H.I.)
+> * mobility features (MF or M.F.)
+> * accessible (Acc.)
+> * usually refers to mobility features.
+
+### Hotel
+
+> [!info] Also Known As
+> * Guestrooms
+> * Keys
+
+> [!trivia]
+> The origin of the term "key" as a synonym of "hotel room"
+> ...
+> %% TODO: %%
+
+### Residential
+
+> [!info] Also Known As
+> * Condos
+
+## Sequence
+
+### 1. Estimate preparation
+
+1. Locate Unit panels and relevant keynotes
+ * Bus amps
+
+2. Read about the project specifications and construction type
+ * Wood or Metal studs
+ * Wiring Method
+ * NM or MC
+ * Wiring device plates
+ * Decora or Standard
+ * Wiring device specs
+ * are 15A devices allowed?
+ * Equipment (20A Kitchen and bath)
+
+3. Fill out OneNote
+
+### 2. Takeoff
+
+1. Kitchen and Bath
+2. General assemblies
+3. Low Voltage
+4. Lighting Control
+5. Lighting Fixtures
+
+Copy paste original takeoff and adjust to changes
+
+### 3. Extension (Review and Checking)
+
+1. Scroll through with Area selected and make sure there is takeoff for each unit type