diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json index b8d7bc05..128795e5 100644 --- a/.obsidian/appearance.json +++ b/.obsidian/appearance.json @@ -6,5 +6,6 @@ "translucency": false, "textFontFamily": "霞鹜文楷等宽,微软雅黑", "monospaceFontFamily": "霞鹜文楷等宽,微软雅黑", - "baseFontSizeAction": true + "baseFontSizeAction": true, + "accentColor": "" } \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index 246e4bbb..79856891 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -1,7 +1,6 @@ [ "calendar", "obsidian-hider", - "code-block-copy", "templater-obsidian", "obsidian-mind-map", "periodic-notes", diff --git a/.obsidian/plugins/code-block-copy/main.js b/.obsidian/plugins/code-block-copy/main.js deleted file mode 100644 index a1e5ad4d..00000000 --- a/.obsidian/plugins/code-block-copy/main.js +++ /dev/null @@ -1,130 +0,0 @@ -'use strict'; - -var obsidian = require('obsidian'); - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var excludeLangs = [ - "todoist" -]; -var CMSyntaxHighlightPlugin = /** @class */ (function (_super) { - __extends(CMSyntaxHighlightPlugin, _super); - function CMSyntaxHighlightPlugin(app, pluginManifest) { - return _super.call(this, app, pluginManifest) || this; - } - // all I need to do is import the modes. - CMSyntaxHighlightPlugin.prototype.onload = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.registerInterval(window.setInterval(this.injectButtons.bind(this), 1000)); - return [2 /*return*/]; - }); - }); - }; - CMSyntaxHighlightPlugin.prototype.injectButtons = function () { - this.addCopyButtons(navigator.clipboard); - }; - CMSyntaxHighlightPlugin.prototype.addCopyButtons = function (clipboard) { - document.querySelectorAll('pre > code').forEach(function (codeBlock) { - var pre = codeBlock.parentNode; - // check for excluded langs - for (var _i = 0, excludeLangs_1 = excludeLangs; _i < excludeLangs_1.length; _i++) { - var lang = excludeLangs_1[_i]; - if (pre.classList.contains("language-" + lang)) - return; - } - // Dont add more than once - if (pre.parentNode.classList.contains('has-copy-button')) { - return; - } - pre.parentNode.classList.add('has-copy-button'); - var button = document.createElement('button'); - button.className = 'copy-code-button'; - button.type = 'button'; - button.innerText = 'Copy'; - button.addEventListener('click', function () { - clipboard.writeText(codeBlock.innerText).then(function () { - /* Chrome doesn't seem to blur automatically, - leaving the button in a focused state. */ - button.blur(); - button.innerText = 'copied!'; - setTimeout(function () { - button.innerText = 'copy'; - }, 2000); - }, function (error) { - button.innerText = 'Error'; - }); - }); - pre.appendChild(button); - }); - }; - return CMSyntaxHighlightPlugin; -}(obsidian.Plugin)); - -module.exports = CMSyntaxHighlightPlugin; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1bGVzL3RzbGliL3RzbGliLmVzN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gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodCAmJiBfLmxhYmVsIDwgdFsyXSkgeyBfLmxhYmVsID0gdFsyXTsgXy5vcHMucHVzaChvcCk7IGJyZWFrOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRbMl0pIF8ub3BzLnBvcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIF8udHJ5cy5wb3AoKTsgY29udGludWU7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgb3AgPSBib2R5LmNhbGwodGhpc0FyZywgXyk7XHJcbiAgICAgICAgfSBjYXRjaCAoZSkgeyBvcCA9IFs2LCBlXTsgeSA9IDA7IH0gZmluYWxseSB7IGYgPSB0ID0gMDsgfVxyXG4gICAgICAgIGlmIChvcFswXSAmIDUpIHRocm93IG9wWzFdOyByZXR1cm4geyB2YWx1ZTogb3BbMF0gPyBvcFsxXSA6IHZvaWQgMCwgZG9uZTogdHJ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AgICBwcmUucGFyZW50Tm9kZS5jbGFzc0xpc3QuYWRkKCAnaGFzLWNvcHktYnV0dG9uJyApO1xuXG4gICAgICAgIHZhciBidXR0b24gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdidXR0b24nKTtcbiAgICAgICAgYnV0dG9uLmNsYXNzTmFtZSA9ICdjb3B5LWNvZGUtYnV0dG9uJztcbiAgICAgICAgYnV0dG9uLnR5cGUgPSAnYnV0dG9uJztcbiAgICAgICAgYnV0dG9uLmlubmVyVGV4dCA9ICdDb3B5JztcbiAgXG4gICAgICAgIGJ1dHRvbi5hZGRFdmVudExpc3RlbmVyKCdjbGljaycsIGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgIGNsaXBib2FyZC53cml0ZVRleHQoY29kZUJsb2NrLmlubmVyVGV4dCkudGhlbihmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgLyogQ2hyb21lIGRvZXNuJ3Qgc2VlbSB0byBibHVyIGF1dG9tYXRpY2FsbHksXG4gICAgICAgICAgICAgICAgICAgbGVhdmluZyB0aGUgYnV0dG9uIGluIGEgZm9jdXNlZCBzdGF0ZS4gKi9cbiAgICAgICAgICAgICAgICBidXR0b24uYmx1cigpO1xuICBcbiAgICAgICAgICAgICAgICBidXR0b24uaW5uZXJUZXh0ID0gJ2NvcGllZCEnO1xuICBcbiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgYnV0dG9uLmlubmVyVGV4dCA9ICdjb3B5JztcbiAgICAgICAgICAgICAgICB9LCAyMDAwKTtcbiAgICAgICAgICAgIH0sIGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgICAgIGJ1dHRvbi5pbm5lclRleHQgPSAnRXJyb3InO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICBcbiAgICAgICAgcHJlLmFwcGVuZENoaWxkKGJ1dHRvbik7XG4gICAgICAgIFxuIC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FBQzs7O29CQUcxQyxNQUFNLENBQUMsSUFBSSxFQUFFLENBQUM7b0JBRWQsTUFBTSxDQUFDLFNBQVMsR0FBRyxTQUFTLENBQUM7b0JBRTdCLFVBQVUsQ0FBQzt3QkFDUCxNQUFNLENBQUMsU0FBUyxHQUFHLE1BQU0sQ0FBQztxQkFDN0IsRUFBRSxJQUFJLENBQUMsQ0FBQztpQkFDWixFQUFFLFVBQVUsS0FBSztvQkFDZCxNQUFNLENBQUMsU0FBUyxHQUFHLE9BQU8sQ0FBQztpQkFDOUIsQ0FBQyxDQUFDO2FBQ04sQ0FBQyxDQUFDO1lBRUgsR0FBRyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsQ0FBQztTQUUzQixDQUFDLENBQUM7S0FDSjtJQUVILDhCQUFDO0FBQUQsQ0E5REEsQ0FBcURBLGVBQU07Ozs7In0= diff --git a/.obsidian/plugins/code-block-copy/manifest.json b/.obsidian/plugins/code-block-copy/manifest.json deleted file mode 100644 index 53c096c1..00000000 --- a/.obsidian/plugins/code-block-copy/manifest.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "id": "code-block-copy", - "name": "Copy button for code blocks", - "author": "Daniel Brandenburg", - "description": "Copy button for code blocks", - "isDesktopOnly": false, - "version": "0.1.0" -} diff --git a/.obsidian/plugins/code-block-copy/styles.css b/.obsidian/plugins/code-block-copy/styles.css deleted file mode 100644 index 7a3b79c0..00000000 --- a/.obsidian/plugins/code-block-copy/styles.css +++ /dev/null @@ -1,41 +0,0 @@ -.copy-code-button { - color: var(--background-primary); - background-color: var(--text-faint); - border-radius: 1px 1px 0px 0px; - /* right-align */ - display: block; - margin-left: auto; - margin-right: 0; - margin-bottom: -2px; - padding: 3px 8px; - font-size: 0.8em; - position: absolute; - top: 0px; - right: 0px; -} - -.copy-code-button:hover { - cursor: pointer; - background-color: var(--text-normal); -} - -.copy-code-button:focus { - /* Avoid an ugly focus outline on click in Chrome, - but darken the button for accessibility. - See https://stackoverflow.com/a/25298082/1481479 */ - background-color: var(--text-normal); - outline: 0; -} - -.copy-code-button:active { - background-color: var(--text-normal); -} - -.highlight pre { - /* Avoid pushing up the copy buttons. */ - margin: 0; -} - -.has-copy-button { - position: relative; -} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/data.json b/.obsidian/plugins/obsidian-git/data.json index 7e8814c9..af69f182 100644 --- a/.obsidian/plugins/obsidian-git/data.json +++ b/.obsidian/plugins/obsidian-git/data.json @@ -13,12 +13,15 @@ "showStatusBar": true, "updateSubmodules": false, "syncMethod": "merge", - "gitPath": "", "customMessageOnAutoBackup": false, "autoBackupAfterFileChange": false, "treeStructure": false, "refreshSourceControl": true, "basePath": "", "differentIntervalCommitAndPush": false, - "changedFilesInStatusBar": true + "changedFilesInStatusBar": true, + "username": "", + "showedMobileNotice": true, + "refreshSourceControlTimer": 7000, + "showBranchStatusBar": true } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js index 88b21ecd..61f132ad 100644 --- a/.obsidian/plugins/obsidian-git/main.js +++ b/.obsidian/plugins/obsidian-git/main.js @@ -1,32 +1,18 @@ /* THIS IS A GENERATED/BUNDLED FILE BY ESBUILD -if you want to view the source visit the plugins github repository (https://github.com/phibr0/obsidian-dictionary) +if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git) */ var __create = Object.create; var __defProp = Object.defineProperty; -var __defProps = Object.defineProperties; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames = Object.getOwnPropertyNames; -var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; -var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; -var __spreadValues = (a, b) => { - for (var prop in b || (b = {})) - if (__hasOwnProp.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b)) { - if (__propIsEnum.call(b, prop)) - __defNormalProp(a, prop, b[prop]); - } - return a; -}; -var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[Object.keys(fn)[0]])(fn = 0)), res; +}; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; @@ -46,30 +32,7202 @@ var __reExport = (target, module2, desc) => { var __toModule = (module2) => { return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); }; -var __async = (__this, __arguments, generator) => { - return new Promise((resolve, reject) => { - var fulfilled = (value) => { + +// node_modules/base64-js/index.js +var require_base64_js = __commonJS({ + "node_modules/base64-js/index.js"(exports) { + init_polyfill_buffer(); + "use strict"; + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; + var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + for (i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + var i; + var len; + revLookup["-".charCodeAt(0)] = 62; + revLookup["_".charCodeAt(0)] = 63; + function getLens(b64) { + var len2 = b64.length; + if (len2 % 4 > 0) { + throw new Error("Invalid string. Length must be a multiple of 4"); + } + var validLen = b64.indexOf("="); + if (validLen === -1) + validLen = len2; + var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i2; + for (i2 = 0; i2 < len2; i2 += 4) { + tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)]; + arr[curByte++] = tmp >> 16 & 255; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4; + arr[curByte++] = tmp & 255; + } + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 255; + arr[curByte++] = tmp & 255; + } + return arr; + } + function tripletToBase64(num2) { + return lookup[num2 >> 18 & 63] + lookup[num2 >> 12 & 63] + lookup[num2 >> 6 & 63] + lookup[num2 & 63]; + } + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + for (var i2 = start; i2 < end; i2 += 3) { + tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255); + output.push(tripletToBase64(tmp)); + } + return output.join(""); + } + function fromByteArray(uint8) { + var tmp; + var len2 = uint8.length; + var extraBytes = len2 % 3; + var parts = []; + var maxChunkLength = 16383; + for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) { + parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength)); + } + if (extraBytes === 1) { + tmp = uint8[len2 - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="); + } else if (extraBytes === 2) { + tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="); + } + return parts.join(""); + } + } +}); + +// node_modules/ieee754/index.js +var require_ieee754 = __commonJS({ + "node_modules/ieee754/index.js"(exports) { + init_polyfill_buffer(); + exports.read = function(buffer2, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer2[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + for (; nBits > 0; e = e * 256 + buffer2[offset + i], i += d, nBits -= 8) { + } + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + for (; nBits > 0; m = m * 256 + buffer2[offset + i], i += d, nBits -= 8) { + } + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + exports.write = function(buffer2, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + if (value * c >= 2) { + e++; + c /= 2; + } + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + for (; mLen >= 8; buffer2[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) { + } + e = e << mLen | m; + eLen += mLen; + for (; eLen > 0; buffer2[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) { + } + buffer2[offset + i - d] |= s * 128; + }; + } +}); + +// node_modules/buffer/index.js +var require_buffer = __commonJS({ + "node_modules/buffer/index.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var base64 = require_base64_js(); + var ieee754 = require_ieee754(); + var customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null; + exports.Buffer = Buffer3; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 2147483647; + exports.kMaxLength = K_MAX_LENGTH; + Buffer3.TYPED_ARRAY_SUPPORT = typedArraySupport(); + if (!Buffer3.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") { + console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); + } + function typedArraySupport() { try { - step(generator.next(value)); + const arr = new Uint8Array(1); + const proto = { foo: function() { + return 42; + } }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; } catch (e) { - reject(e); + return false; + } + } + Object.defineProperty(Buffer3.prototype, "parent", { + enumerable: true, + get: function() { + if (!Buffer3.isBuffer(this)) + return void 0; + return this.buffer; + } + }); + Object.defineProperty(Buffer3.prototype, "offset", { + enumerable: true, + get: function() { + if (!Buffer3.isBuffer(this)) + return void 0; + return this.byteOffset; + } + }); + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + const buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer3.prototype); + return buf; + } + function Buffer3(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + if (typeof encodingOrOffset === "string") { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + return allocUnsafe(arg); + } + return from(arg, encodingOrOffset, length); + } + Buffer3.poolSize = 8192; + function from(value, encodingOrOffset, length) { + if (typeof value === "string") { + return fromString(value, encodingOrOffset); + } + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + if (typeof value === "number") { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + const valueOf = value.valueOf && value.valueOf(); + if (valueOf != null && valueOf !== value) { + return Buffer3.from(valueOf, encodingOrOffset, length); + } + const b = fromObject(value); + if (b) + return b; + if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") { + return Buffer3.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length); + } + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + Buffer3.from = function(value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; + Object.setPrototypeOf(Buffer3.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer3, Uint8Array); + function assertSize(size) { + if (typeof size !== "number") { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + function alloc(size, fill, encoding) { + assertSize(size); + if (size <= 0) { + return createBuffer(size); + } + if (fill !== void 0) { + return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + return createBuffer(size); + } + Buffer3.alloc = function(size, fill, encoding) { + return alloc(size, fill, encoding); + }; + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + Buffer3.allocUnsafe = function(size) { + return allocUnsafe(size); + }; + Buffer3.allocUnsafeSlow = function(size) { + return allocUnsafe(size); + }; + function fromString(string, encoding) { + if (typeof encoding !== "string" || encoding === "") { + encoding = "utf8"; + } + if (!Buffer3.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + const length = byteLength(string, encoding) | 0; + let buf = createBuffer(length); + const actual = buf.write(string, encoding); + if (actual !== length) { + buf = buf.slice(0, actual); + } + return buf; + } + function fromArrayLike(array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0; + const buf = createBuffer(length); + for (let i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + return buf; + } + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy2 = new Uint8Array(arrayView); + return fromArrayBuffer(copy2.buffer, copy2.byteOffset, copy2.byteLength); + } + return fromArrayLike(arrayView); + } + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + let buf; + if (byteOffset === void 0 && length === void 0) { + buf = new Uint8Array(array); + } else if (length === void 0) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + Object.setPrototypeOf(buf, Buffer3.prototype); + return buf; + } + function fromObject(obj) { + if (Buffer3.isBuffer(obj)) { + const len = checked(obj.length) | 0; + const buf = createBuffer(len); + if (buf.length === 0) { + return buf; + } + obj.copy(buf, 0, 0, len); + return buf; + } + if (obj.length !== void 0) { + if (typeof obj.length !== "number" || numberIsNaN(obj.length)) { + return createBuffer(0); + } + return fromArrayLike(obj); + } + if (obj.type === "Buffer" && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + function checked(length) { + if (length >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes"); + } + return length | 0; + } + function SlowBuffer(length) { + if (+length != length) { + length = 0; + } + return Buffer3.alloc(+length); + } + Buffer3.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer3.prototype; + }; + Buffer3.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) + a = Buffer3.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) + b = Buffer3.from(b, b.offset, b.byteLength); + if (!Buffer3.isBuffer(a) || !Buffer3.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + if (a === b) + return 0; + let x = a.length; + let y = b.length; + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + Buffer3.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case "hex": + case "utf8": + case "utf-8": + case "ascii": + case "latin1": + case "binary": + case "base64": + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return true; + default: + return false; } }; - var rejected = (value) => { - try { - step(generator.throw(value)); - } catch (e) { - reject(e); + Buffer3.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + if (list.length === 0) { + return Buffer3.alloc(0); + } + let i; + if (length === void 0) { + length = 0; + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + const buffer2 = Buffer3.allocUnsafe(length); + let pos = 0; + for (i = 0; i < list.length; ++i) { + let buf = list[i]; + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer2.length) { + if (!Buffer3.isBuffer(buf)) + buf = Buffer3.from(buf); + buf.copy(buffer2, pos); + } else { + Uint8Array.prototype.set.call(buffer2, buf, pos); + } + } else if (!Buffer3.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer2, pos); + } + pos += buf.length; + } + return buffer2; + }; + function byteLength(string, encoding) { + if (Buffer3.isBuffer(string)) { + return string.length; + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + if (typeof string !== "string") { + throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof string); + } + const len = string.length; + const mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) + return 0; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "ascii": + case "latin1": + case "binary": + return len; + case "utf8": + case "utf-8": + return utf8ToBytes(string).length; + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return len * 2; + case "hex": + return len >>> 1; + case "base64": + return base64ToBytes(string).length; + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; + } + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } + } + } + Buffer3.byteLength = byteLength; + function slowToString(encoding, start, end) { + let loweredCase = false; + if (start === void 0 || start < 0) { + start = 0; + } + if (start > this.length) { + return ""; + } + if (end === void 0 || end > this.length) { + end = this.length; + } + if (end <= 0) { + return ""; + } + end >>>= 0; + start >>>= 0; + if (end <= start) { + return ""; + } + if (!encoding) + encoding = "utf8"; + while (true) { + switch (encoding) { + case "hex": + return hexSlice(this, start, end); + case "utf8": + case "utf-8": + return utf8Slice(this, start, end); + case "ascii": + return asciiSlice(this, start, end); + case "latin1": + case "binary": + return latin1Slice(this, start, end); + case "base64": + return base64Slice(this, start, end); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return utf16leSlice(this, start, end); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = (encoding + "").toLowerCase(); + loweredCase = true; + } + } + } + Buffer3.prototype._isBuffer = true; + function swap(b, n, m) { + const i = b[n]; + b[n] = b[m]; + b[m] = i; + } + Buffer3.prototype.swap16 = function swap16() { + const len = this.length; + if (len % 2 !== 0) { + throw new RangeError("Buffer size must be a multiple of 16-bits"); + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + return this; + }; + Buffer3.prototype.swap32 = function swap32() { + const len = this.length; + if (len % 4 !== 0) { + throw new RangeError("Buffer size must be a multiple of 32-bits"); + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + return this; + }; + Buffer3.prototype.swap64 = function swap64() { + const len = this.length; + if (len % 8 !== 0) { + throw new RangeError("Buffer size must be a multiple of 64-bits"); + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + return this; + }; + Buffer3.prototype.toString = function toString() { + const length = this.length; + if (length === 0) + return ""; + if (arguments.length === 0) + return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + Buffer3.prototype.toLocaleString = Buffer3.prototype.toString; + Buffer3.prototype.equals = function equals2(b) { + if (!Buffer3.isBuffer(b)) + throw new TypeError("Argument must be a Buffer"); + if (this === b) + return true; + return Buffer3.compare(this, b) === 0; + }; + Buffer3.prototype.inspect = function inspect() { + let str = ""; + const max = exports.INSPECT_MAX_BYTES; + str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim(); + if (this.length > max) + str += " ... "; + return ""; + }; + if (customInspectSymbol) { + Buffer3.prototype[customInspectSymbol] = Buffer3.prototype.inspect; + } + Buffer3.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer3.from(target, target.offset, target.byteLength); + } + if (!Buffer3.isBuffer(target)) { + throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof target); + } + if (start === void 0) { + start = 0; + } + if (end === void 0) { + end = target ? target.length : 0; + } + if (thisStart === void 0) { + thisStart = 0; + } + if (thisEnd === void 0) { + thisEnd = this.length; + } + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError("out of range index"); + } + if (thisStart >= thisEnd && start >= end) { + return 0; + } + if (thisStart >= thisEnd) { + return -1; + } + if (start >= end) { + return 1; + } + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) + return 0; + let x = thisEnd - thisStart; + let y = end - start; + const len = Math.min(x, y); + const thisCopy = this.slice(thisStart, thisEnd); + const targetCopy = target.slice(start, end); + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + if (x < y) + return -1; + if (y < x) + return 1; + return 0; + }; + function bidirectionalIndexOf(buffer2, val, byteOffset, encoding, dir) { + if (buffer2.length === 0) + return -1; + if (typeof byteOffset === "string") { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 2147483647) { + byteOffset = 2147483647; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + byteOffset = +byteOffset; + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer2.length - 1; + } + if (byteOffset < 0) + byteOffset = buffer2.length + byteOffset; + if (byteOffset >= buffer2.length) { + if (dir) + return -1; + else + byteOffset = buffer2.length - 1; + } else if (byteOffset < 0) { + if (dir) + byteOffset = 0; + else + return -1; + } + if (typeof val === "string") { + val = Buffer3.from(val, encoding); + } + if (Buffer3.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + return arrayIndexOf(buffer2, val, byteOffset, encoding, dir); + } else if (typeof val === "number") { + val = val & 255; + if (typeof Uint8Array.prototype.indexOf === "function") { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer2, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer2, val, byteOffset); + } + } + return arrayIndexOf(buffer2, [val], byteOffset, encoding, dir); + } + throw new TypeError("val must be string, number or Buffer"); + } + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + let indexSize = 1; + let arrLength = arr.length; + let valLength = val.length; + if (encoding !== void 0) { + encoding = String(encoding).toLowerCase(); + if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") { + if (arr.length < 2 || val.length < 2) { + return -1; + } + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + function read(buf, i2) { + if (indexSize === 1) { + return buf[i2]; + } else { + return buf.readUInt16BE(i2 * indexSize); + } + } + let i; + if (dir) { + let foundIndex = -1; + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) + foundIndex = i; + if (i - foundIndex + 1 === valLength) + return foundIndex * indexSize; + } else { + if (foundIndex !== -1) + i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) + byteOffset = arrLength - valLength; + for (i = byteOffset; i >= 0; i--) { + let found = true; + for (let j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + if (found) + return i; + } + } + return -1; + } + Buffer3.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + Buffer3.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + Buffer3.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + const remaining = buf.length - offset; + if (!length) { + length = remaining; + } else { + length = Number(length); + if (length > remaining) { + length = remaining; + } + } + const strLen = string.length; + if (length > strLen / 2) { + length = strLen / 2; + } + let i; + for (i = 0; i < length; ++i) { + const parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) + return i; + buf[offset + i] = parsed; + } + return i; + } + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + Buffer3.prototype.write = function write(string, offset, length, encoding) { + if (offset === void 0) { + encoding = "utf8"; + length = this.length; + offset = 0; + } else if (length === void 0 && typeof offset === "string") { + encoding = offset; + length = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + if (isFinite(length)) { + length = length >>> 0; + if (encoding === void 0) + encoding = "utf8"; + } else { + encoding = length; + length = void 0; + } + } else { + throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported"); + } + const remaining = this.length - offset; + if (length === void 0 || length > remaining) + length = remaining; + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError("Attempt to write outside buffer bounds"); + } + if (!encoding) + encoding = "utf8"; + let loweredCase = false; + for (; ; ) { + switch (encoding) { + case "hex": + return hexWrite(this, string, offset, length); + case "utf8": + case "utf-8": + return utf8Write(this, string, offset, length); + case "ascii": + case "latin1": + case "binary": + return asciiWrite(this, string, offset, length); + case "base64": + return base64Write(this, string, offset, length); + case "ucs2": + case "ucs-2": + case "utf16le": + case "utf-16le": + return ucs2Write(this, string, offset, length); + default: + if (loweredCase) + throw new TypeError("Unknown encoding: " + encoding); + encoding = ("" + encoding).toLowerCase(); + loweredCase = true; + } } }; - var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); - step((generator = generator.apply(__this, __arguments)).next()); - }); -}; + Buffer3.prototype.toJSON = function toJSON() { + return { + type: "Buffer", + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf); + } else { + return base64.fromByteArray(buf.slice(start, end)); + } + } + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + const res = []; + let i = start; + while (i < end) { + const firstByte = buf[i]; + let codePoint = null; + let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1; + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint; + switch (bytesPerSequence) { + case 1: + if (firstByte < 128) { + codePoint = firstByte; + } + break; + case 2: + secondByte = buf[i + 1]; + if ((secondByte & 192) === 128) { + tempCodePoint = (firstByte & 31) << 6 | secondByte & 63; + if (tempCodePoint > 127) { + codePoint = tempCodePoint; + } + } + break; + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63; + if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) { + codePoint = tempCodePoint; + } + } + break; + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) { + tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63; + if (tempCodePoint > 65535 && tempCodePoint < 1114112) { + codePoint = tempCodePoint; + } + } + } + } + if (codePoint === null) { + codePoint = 65533; + bytesPerSequence = 1; + } else if (codePoint > 65535) { + codePoint -= 65536; + res.push(codePoint >>> 10 & 1023 | 55296); + codePoint = 56320 | codePoint & 1023; + } + res.push(codePoint); + i += bytesPerSequence; + } + return decodeCodePointsArray(res); + } + var MAX_ARGUMENTS_LENGTH = 4096; + function decodeCodePointsArray(codePoints) { + const len = codePoints.length; + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + let res = ""; + let i = 0; + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + return res; + } + function asciiSlice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 127); + } + return ret; + } + function latin1Slice(buf, start, end) { + let ret = ""; + end = Math.min(buf.length, end); + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + return ret; + } + function hexSlice(buf, start, end) { + const len = buf.length; + if (!start || start < 0) + start = 0; + if (!end || end < 0 || end > len) + end = len; + let out = ""; + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + return out; + } + function utf16leSlice(buf, start, end) { + const bytes = buf.slice(start, end); + let res = ""; + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + return res; + } + Buffer3.prototype.slice = function slice(start, end) { + const len = this.length; + start = ~~start; + end = end === void 0 ? len : ~~end; + if (start < 0) { + start += len; + if (start < 0) + start = 0; + } else if (start > len) { + start = len; + } + if (end < 0) { + end += len; + if (end < 0) + end = 0; + } else if (end > len) { + end = len; + } + if (end < start) + end = start; + const newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer3.prototype); + return newBuf; + }; + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) + throw new RangeError("offset is not uint"); + if (offset + ext > length) + throw new RangeError("Trying to access beyond buffer length"); + } + Buffer3.prototype.readUintLE = Buffer3.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + return val; + }; + Buffer3.prototype.readUintBE = Buffer3.prototype.readUIntBE = function readUIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + checkOffset(offset, byteLength2, this.length); + } + let val = this[offset + --byteLength2]; + let mul = 1; + while (byteLength2 > 0 && (mul *= 256)) { + val += this[offset + --byteLength2] * mul; + } + return val; + }; + Buffer3.prototype.readUint8 = Buffer3.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + return this[offset]; + }; + Buffer3.prototype.readUint16LE = Buffer3.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + Buffer3.prototype.readUint16BE = Buffer3.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + Buffer3.prototype.readUint32LE = Buffer3.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216; + }; + Buffer3.prototype.readUint32BE = Buffer3.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + Buffer3.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first2 = this[offset]; + const last2 = this[offset + 7]; + if (first2 === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const lo = first2 + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24; + const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last2 * 2 ** 24; + return BigInt(lo) + (BigInt(hi) << BigInt(32)); + }); + Buffer3.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first2 = this[offset]; + const last2 = this[offset + 7]; + if (first2 === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const hi = first2 * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2; + return (BigInt(hi) << BigInt(32)) + BigInt(lo); + }); + Buffer3.prototype.readIntLE = function readIntLE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let val = this[offset]; + let mul = 1; + let i = 0; + while (++i < byteLength2 && (mul *= 256)) { + val += this[offset + i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer3.prototype.readIntBE = function readIntBE(offset, byteLength2, noAssert) { + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) + checkOffset(offset, byteLength2, this.length); + let i = byteLength2; + let mul = 1; + let val = this[offset + --i]; + while (i > 0 && (mul *= 256)) { + val += this[offset + --i] * mul; + } + mul *= 128; + if (val >= mul) + val -= Math.pow(2, 8 * byteLength2); + return val; + }; + Buffer3.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 1, this.length); + if (!(this[offset] & 128)) + return this[offset]; + return (255 - this[offset] + 1) * -1; + }; + Buffer3.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset] | this[offset + 1] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer3.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 2, this.length); + const val = this[offset + 1] | this[offset] << 8; + return val & 32768 ? val | 4294901760 : val; + }; + Buffer3.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + Buffer3.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + Buffer3.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first2 = this[offset]; + const last2 = this[offset + 7]; + if (first2 === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last2 << 24); + return (BigInt(val) << BigInt(32)) + BigInt(first2 + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24); + }); + Buffer3.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE(offset) { + offset = offset >>> 0; + validateNumber(offset, "offset"); + const first2 = this[offset]; + const last2 = this[offset + 7]; + if (first2 === void 0 || last2 === void 0) { + boundsError(offset, this.length - 8); + } + const val = (first2 << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset]; + return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last2); + }); + Buffer3.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, true, 23, 4); + }; + Buffer3.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 4, this.length); + return ieee754.read(this, offset, false, 23, 4); + }; + Buffer3.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, true, 52, 8); + }; + Buffer3.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) + checkOffset(offset, 8, this.length); + return ieee754.read(this, offset, false, 52, 8); + }; + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer3.isBuffer(buf)) + throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) + throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + } + Buffer3.prototype.writeUintLE = Buffer3.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let mul = 1; + let i = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer3.prototype.writeUintBE = Buffer3.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength2 = byteLength2 >>> 0; + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength2) - 1; + checkInt(this, value, offset, byteLength2, maxBytes, 0); + } + let i = byteLength2 - 1; + let mul = 1; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + this[offset + i] = value / mul & 255; + } + return offset + byteLength2; + }; + Buffer3.prototype.writeUint8 = Buffer3.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 255, 0); + this[offset] = value & 255; + return offset + 1; + }; + Buffer3.prototype.writeUint16LE = Buffer3.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer3.prototype.writeUint16BE = Buffer3.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 65535, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer3.prototype.writeUint32LE = Buffer3.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 255; + return offset + 4; + }; + Buffer3.prototype.writeUint32BE = Buffer3.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 4294967295, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + function wrtBigUInt64LE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + lo = lo >> 8; + buf[offset++] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + hi = hi >> 8; + buf[offset++] = hi; + return offset; + } + function wrtBigUInt64BE(buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7); + let lo = Number(value & BigInt(4294967295)); + buf[offset + 7] = lo; + lo = lo >> 8; + buf[offset + 6] = lo; + lo = lo >> 8; + buf[offset + 5] = lo; + lo = lo >> 8; + buf[offset + 4] = lo; + let hi = Number(value >> BigInt(32) & BigInt(4294967295)); + buf[offset + 3] = hi; + hi = hi >> 8; + buf[offset + 2] = hi; + hi = hi >> 8; + buf[offset + 1] = hi; + hi = hi >> 8; + buf[offset] = hi; + return offset + 8; + } + Buffer3.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer3.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff")); + }); + Buffer3.prototype.writeIntLE = function writeIntLE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = 0; + let mul = 1; + let sub = 0; + this[offset] = value & 255; + while (++i < byteLength2 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer3.prototype.writeIntBE = function writeIntBE(value, offset, byteLength2, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + const limit = Math.pow(2, 8 * byteLength2 - 1); + checkInt(this, value, offset, byteLength2, limit - 1, -limit); + } + let i = byteLength2 - 1; + let mul = 1; + let sub = 0; + this[offset + i] = value & 255; + while (--i >= 0 && (mul *= 256)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + this[offset + i] = (value / mul >> 0) - sub & 255; + } + return offset + byteLength2; + }; + Buffer3.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 1, 127, -128); + if (value < 0) + value = 255 + value + 1; + this[offset] = value & 255; + return offset + 1; + }; + Buffer3.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + Buffer3.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 2, 32767, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 255; + return offset + 2; + }; + Buffer3.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + this[offset] = value & 255; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + Buffer3.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) + checkInt(this, value, offset, 4, 2147483647, -2147483648); + if (value < 0) + value = 4294967295 + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 255; + return offset + 4; + }; + Buffer3.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE(value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + Buffer3.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE(value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff")); + }); + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) + throw new RangeError("Index out of range"); + if (offset < 0) + throw new RangeError("Index out of range"); + } + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 34028234663852886e22, -34028234663852886e22); + } + ieee754.write(buf, value, offset, littleEndian, 23, 4); + return offset + 4; + } + Buffer3.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + Buffer3.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 17976931348623157e292, -17976931348623157e292); + } + ieee754.write(buf, value, offset, littleEndian, 52, 8); + return offset + 8; + } + Buffer3.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + Buffer3.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + Buffer3.prototype.copy = function copy2(target, targetStart, start, end) { + if (!Buffer3.isBuffer(target)) + throw new TypeError("argument should be a Buffer"); + if (!start) + start = 0; + if (!end && end !== 0) + end = this.length; + if (targetStart >= target.length) + targetStart = target.length; + if (!targetStart) + targetStart = 0; + if (end > 0 && end < start) + end = start; + if (end === start) + return 0; + if (target.length === 0 || this.length === 0) + return 0; + if (targetStart < 0) { + throw new RangeError("targetStart out of bounds"); + } + if (start < 0 || start >= this.length) + throw new RangeError("Index out of range"); + if (end < 0) + throw new RangeError("sourceEnd out of bounds"); + if (end > this.length) + end = this.length; + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + const len = end - start; + if (this === target && typeof Uint8Array.prototype.copyWithin === "function") { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + return len; + }; + Buffer3.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === "string") { + if (typeof start === "string") { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === "string") { + encoding = end; + end = this.length; + } + if (encoding !== void 0 && typeof encoding !== "string") { + throw new TypeError("encoding must be a string"); + } + if (typeof encoding === "string" && !Buffer3.isEncoding(encoding)) { + throw new TypeError("Unknown encoding: " + encoding); + } + if (val.length === 1) { + const code = val.charCodeAt(0); + if (encoding === "utf8" && code < 128 || encoding === "latin1") { + val = code; + } + } + } else if (typeof val === "number") { + val = val & 255; + } else if (typeof val === "boolean") { + val = Number(val); + } + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError("Out of range index"); + } + if (end <= start) { + return this; + } + start = start >>> 0; + end = end === void 0 ? this.length : end >>> 0; + if (!val) + val = 0; + let i; + if (typeof val === "number") { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + const bytes = Buffer3.isBuffer(val) ? val : Buffer3.from(val, encoding); + const len = bytes.length; + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + return this; + }; + var errors = {}; + function E(sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor() { + super(); + Object.defineProperty(this, "message", { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }); + this.name = `${this.name} [${sym}]`; + this.stack; + delete this.name; + } + get code() { + return sym; + } + set code(value) { + Object.defineProperty(this, "code", { + configurable: true, + enumerable: true, + value, + writable: true + }); + } + toString() { + return `${this.name} [${sym}]: ${this.message}`; + } + }; + } + E("ERR_BUFFER_OUT_OF_BOUNDS", function(name) { + if (name) { + return `${name} is outside of buffer bounds`; + } + return "Attempt to access memory outside buffer bounds"; + }, RangeError); + E("ERR_INVALID_ARG_TYPE", function(name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}`; + }, TypeError); + E("ERR_OUT_OF_RANGE", function(str, range, input) { + let msg = `The value of "${str}" is out of range.`; + let received = input; + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)); + } else if (typeof input === "bigint") { + received = String(input); + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received); + } + received += "n"; + } + msg += ` It must be ${range}. Received ${received}`; + return msg; + }, RangeError); + function addNumericalSeparator(val) { + let res = ""; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}`; + } + return `${val.slice(0, i)}${res}`; + } + function checkBounds(buf, offset, byteLength2) { + validateNumber(offset, "offset"); + if (buf[offset] === void 0 || buf[offset + byteLength2] === void 0) { + boundsError(offset, buf.length - (byteLength2 + 1)); + } + } + function checkIntBI(value, min, max, buf, offset, byteLength2) { + if (value > max || value < min) { + const n = typeof min === "bigint" ? "n" : ""; + let range; + if (byteLength2 > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength2 + 1) * 8}${n}`; + } else { + range = `>= -(2${n} ** ${(byteLength2 + 1) * 8 - 1}${n}) and < 2 ** ${(byteLength2 + 1) * 8 - 1}${n}`; + } + } else { + range = `>= ${min}${n} and <= ${max}${n}`; + } + throw new errors.ERR_OUT_OF_RANGE("value", range, value); + } + checkBounds(buf, offset, byteLength2); + } + function validateNumber(value, name) { + if (typeof value !== "number") { + throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value); + } + } + function boundsError(value, length, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type); + throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value); + } + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS(); + } + throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length}`, value); + } + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + function base64clean(str) { + str = str.split("=")[0]; + str = str.trim().replace(INVALID_BASE64_RE, ""); + if (str.length < 2) + return ""; + while (str.length % 4 !== 0) { + str = str + "="; + } + return str; + } + function utf8ToBytes(string, units) { + units = units || Infinity; + let codePoint; + const length = string.length; + let leadSurrogate = null; + const bytes = []; + for (let i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + if (codePoint > 55295 && codePoint < 57344) { + if (!leadSurrogate) { + if (codePoint > 56319) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } else if (i + 1 === length) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + continue; + } + leadSurrogate = codePoint; + continue; + } + if (codePoint < 56320) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + leadSurrogate = codePoint; + continue; + } + codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536; + } else if (leadSurrogate) { + if ((units -= 3) > -1) + bytes.push(239, 191, 189); + } + leadSurrogate = null; + if (codePoint < 128) { + if ((units -= 1) < 0) + break; + bytes.push(codePoint); + } else if (codePoint < 2048) { + if ((units -= 2) < 0) + break; + bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128); + } else if (codePoint < 65536) { + if ((units -= 3) < 0) + break; + bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else if (codePoint < 1114112) { + if ((units -= 4) < 0) + break; + bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128); + } else { + throw new Error("Invalid code point"); + } + } + return bytes; + } + function asciiToBytes(str) { + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 255); + } + return byteArray; + } + function utf16leToBytes(str, units) { + let c, hi, lo; + const byteArray = []; + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) + break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + return byteArray; + } + function base64ToBytes(str) { + return base64.toByteArray(base64clean(str)); + } + function blitBuffer(src, dst, offset, length) { + let i; + for (i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) + break; + dst[i + offset] = src[i]; + } + return i; + } + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + function numberIsNaN(obj) { + return obj !== obj; + } + var hexSliceLookupTable = function() { + const alphabet = "0123456789abcdef"; + const table = new Array(256); + for (let i = 0; i < 16; ++i) { + const i16 = i * 16; + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + return table; + }(); + function defineBigIntMethod(fn) { + return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn; + } + function BufferBigIntNotDefined() { + throw new Error("BigInt not supported"); + } + } +}); + +// polyfill_buffer.js +var import_obsidian, buffer, Buffer2; +var init_polyfill_buffer = __esm({ + "polyfill_buffer.js"() { + import_obsidian = __toModule(require("obsidian")); + if (import_obsidian.Platform.isMobileApp) { + buffer = require_buffer().Buffer; + } else { + buffer = global.Buffer; + } + Buffer2 = buffer; + } +}); + +// node_modules/async-lock/lib/index.js +var require_lib = __commonJS({ + "node_modules/async-lock/lib/index.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + var AsyncLock2 = function(opts) { + opts = opts || {}; + this.Promise = opts.Promise || Promise; + this.queues = Object.create(null); + this.domainReentrant = opts.domainReentrant || false; + if (this.domainReentrant) { + if (typeof process === "undefined" || typeof process.domain === "undefined") { + throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill."); + } + this.domains = Object.create(null); + } + this.timeout = opts.timeout || AsyncLock2.DEFAULT_TIMEOUT; + this.maxOccupationTime = opts.maxOccupationTime || AsyncLock2.DEFAULT_MAX_OCCUPATION_TIME; + if (opts.maxPending === Infinity || Number.isInteger(opts.maxPending) && opts.maxPending >= 0) { + this.maxPending = opts.maxPending; + } else { + this.maxPending = AsyncLock2.DEFAULT_MAX_PENDING; + } + }; + AsyncLock2.DEFAULT_TIMEOUT = 0; + AsyncLock2.DEFAULT_MAX_OCCUPATION_TIME = 0; + AsyncLock2.DEFAULT_MAX_PENDING = 1e3; + AsyncLock2.prototype.acquire = function(key2, fn, cb, opts) { + if (Array.isArray(key2)) { + return this._acquireBatch(key2, fn, cb, opts); + } + if (typeof fn !== "function") { + throw new Error("You must pass a function to execute"); + } + var deferredResolve = null; + var deferredReject = null; + var deferred2 = null; + if (typeof cb !== "function") { + opts = cb; + cb = null; + deferred2 = new this.Promise(function(resolve, reject) { + deferredResolve = resolve; + deferredReject = reject; + }); + } + opts = opts || {}; + var resolved = false; + var timer = null; + var occupationTimer = null; + var self3 = this; + var done = function(locked, err, ret) { + if (occupationTimer) { + clearTimeout(occupationTimer); + occupationTimer = null; + } + if (locked) { + if (!!self3.queues[key2] && self3.queues[key2].length === 0) { + delete self3.queues[key2]; + } + if (self3.domainReentrant) { + delete self3.domains[key2]; + } + } + if (!resolved) { + if (!deferred2) { + if (typeof cb === "function") { + cb(err, ret); + } + } else { + if (err) { + deferredReject(err); + } else { + deferredResolve(ret); + } + } + resolved = true; + } + if (locked) { + if (!!self3.queues[key2] && self3.queues[key2].length > 0) { + self3.queues[key2].shift()(); + } + } + }; + var exec = function(locked) { + if (resolved) { + return done(locked); + } + if (timer) { + clearTimeout(timer); + timer = null; + } + if (self3.domainReentrant && locked) { + self3.domains[key2] = process.domain; + } + if (fn.length === 1) { + var called = false; + try { + fn(function(err, ret) { + if (!called) { + called = true; + done(locked, err, ret); + } + }); + } catch (err) { + if (!called) { + called = true; + done(locked, err); + } + } + } else { + self3._promiseTry(function() { + return fn(); + }).then(function(ret) { + done(locked, void 0, ret); + }, function(error) { + done(locked, error); + }); + } + }; + if (self3.domainReentrant && !!process.domain) { + exec = process.domain.bind(exec); + } + if (!self3.queues[key2]) { + self3.queues[key2] = []; + exec(true); + } else if (self3.domainReentrant && !!process.domain && process.domain === self3.domains[key2]) { + exec(false); + } else if (self3.queues[key2].length >= self3.maxPending) { + done(false, new Error("Too many pending tasks in queue " + key2)); + } else { + var taskFn = function() { + exec(true); + }; + if (opts.skipQueue) { + self3.queues[key2].unshift(taskFn); + } else { + self3.queues[key2].push(taskFn); + } + var timeout = opts.timeout || self3.timeout; + if (timeout) { + timer = setTimeout(function() { + timer = null; + done(false, new Error("async-lock timed out in queue " + key2)); + }, timeout); + } + } + var maxOccupationTime = opts.maxOccupationTime || self3.maxOccupationTime; + if (maxOccupationTime) { + occupationTimer = setTimeout(function() { + if (!!self3.queues[key2]) { + done(false, new Error("Maximum occupation time is exceeded in queue " + key2)); + } + }, maxOccupationTime); + } + if (deferred2) { + return deferred2; + } + }; + AsyncLock2.prototype._acquireBatch = function(keys, fn, cb, opts) { + if (typeof cb !== "function") { + opts = cb; + cb = null; + } + var self3 = this; + var getFn = function(key2, fn2) { + return function(cb2) { + self3.acquire(key2, fn2, cb2, opts); + }; + }; + var fnx = keys.reduceRight(function(prev, key2) { + return getFn(key2, prev); + }, fn); + if (typeof cb === "function") { + fnx(cb); + } else { + return new this.Promise(function(resolve, reject) { + if (fnx.length === 1) { + fnx(function(err, ret) { + if (err) { + reject(err); + } else { + resolve(ret); + } + }); + } else { + resolve(fnx()); + } + }); + } + }; + AsyncLock2.prototype.isBusy = function(key2) { + if (!key2) { + return Object.keys(this.queues).length > 0; + } else { + return !!this.queues[key2]; + } + }; + AsyncLock2.prototype._promiseTry = function(fn) { + try { + return this.Promise.resolve(fn()); + } catch (e) { + return this.Promise.reject(e); + } + }; + module2.exports = AsyncLock2; + } +}); + +// node_modules/async-lock/index.js +var require_async_lock = __commonJS({ + "node_modules/async-lock/index.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + module2.exports = require_lib(); + } +}); + +// node_modules/inherits/inherits_browser.js +var require_inherits_browser = __commonJS({ + "node_modules/inherits/inherits_browser.js"(exports, module2) { + init_polyfill_buffer(); + if (typeof Object.create === "function") { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + } + }; + } else { + module2.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor; + var TempCtor = function() { + }; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; + } + }; + } + } +}); + +// node_modules/safe-buffer/index.js +var require_safe_buffer = __commonJS({ + "node_modules/safe-buffer/index.js"(exports, module2) { + init_polyfill_buffer(); + var buffer2 = require_buffer(); + var Buffer3 = buffer2.Buffer; + function copyProps(src, dst) { + for (var key2 in src) { + dst[key2] = src[key2]; + } + } + if (Buffer3.from && Buffer3.alloc && Buffer3.allocUnsafe && Buffer3.allocUnsafeSlow) { + module2.exports = buffer2; + } else { + copyProps(buffer2, exports); + exports.Buffer = SafeBuffer; + } + function SafeBuffer(arg, encodingOrOffset, length) { + return Buffer3(arg, encodingOrOffset, length); + } + SafeBuffer.prototype = Object.create(Buffer3.prototype); + copyProps(Buffer3, SafeBuffer); + SafeBuffer.from = function(arg, encodingOrOffset, length) { + if (typeof arg === "number") { + throw new TypeError("Argument must not be a number"); + } + return Buffer3(arg, encodingOrOffset, length); + }; + SafeBuffer.alloc = function(size, fill, encoding) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + var buf = Buffer3(size); + if (fill !== void 0) { + if (typeof encoding === "string") { + buf.fill(fill, encoding); + } else { + buf.fill(fill); + } + } else { + buf.fill(0); + } + return buf; + }; + SafeBuffer.allocUnsafe = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return Buffer3(size); + }; + SafeBuffer.allocUnsafeSlow = function(size) { + if (typeof size !== "number") { + throw new TypeError("Argument must be a number"); + } + return buffer2.SlowBuffer(size); + }; + } +}); + +// node_modules/sha.js/hash.js +var require_hash = __commonJS({ + "node_modules/sha.js/hash.js"(exports, module2) { + init_polyfill_buffer(); + var Buffer3 = require_safe_buffer().Buffer; + function Hash2(blockSize, finalSize) { + this._block = Buffer3.alloc(blockSize); + this._finalSize = finalSize; + this._blockSize = blockSize; + this._len = 0; + } + Hash2.prototype.update = function(data, enc) { + if (typeof data === "string") { + enc = enc || "utf8"; + data = Buffer3.from(data, enc); + } + var block = this._block; + var blockSize = this._blockSize; + var length = data.length; + var accum = this._len; + for (var offset = 0; offset < length; ) { + var assigned = accum % blockSize; + var remainder = Math.min(length - offset, blockSize - assigned); + for (var i = 0; i < remainder; i++) { + block[assigned + i] = data[offset + i]; + } + accum += remainder; + offset += remainder; + if (accum % blockSize === 0) { + this._update(block); + } + } + this._len += length; + return this; + }; + Hash2.prototype.digest = function(enc) { + var rem = this._len % this._blockSize; + this._block[rem] = 128; + this._block.fill(0, rem + 1); + if (rem >= this._finalSize) { + this._update(this._block); + this._block.fill(0); + } + var bits = this._len * 8; + if (bits <= 4294967295) { + this._block.writeUInt32BE(bits, this._blockSize - 4); + } else { + var lowBits = (bits & 4294967295) >>> 0; + var highBits = (bits - lowBits) / 4294967296; + this._block.writeUInt32BE(highBits, this._blockSize - 8); + this._block.writeUInt32BE(lowBits, this._blockSize - 4); + } + this._update(this._block); + var hash2 = this._hash(); + return enc ? hash2.toString(enc) : hash2; + }; + Hash2.prototype._update = function() { + throw new Error("_update must be implemented by subclass"); + }; + module2.exports = Hash2; + } +}); + +// node_modules/sha.js/sha1.js +var require_sha1 = __commonJS({ + "node_modules/sha.js/sha1.js"(exports, module2) { + init_polyfill_buffer(); + var inherits = require_inherits_browser(); + var Hash2 = require_hash(); + var Buffer3 = require_safe_buffer().Buffer; + var K = [ + 1518500249, + 1859775393, + 2400959708 | 0, + 3395469782 | 0 + ]; + var W = new Array(80); + function Sha1() { + this.init(); + this._w = W; + Hash2.call(this, 64, 56); + } + inherits(Sha1, Hash2); + Sha1.prototype.init = function() { + this._a = 1732584193; + this._b = 4023233417; + this._c = 2562383102; + this._d = 271733878; + this._e = 3285377520; + return this; + }; + function rotl1(num2) { + return num2 << 1 | num2 >>> 31; + } + function rotl5(num2) { + return num2 << 5 | num2 >>> 27; + } + function rotl30(num2) { + return num2 << 30 | num2 >>> 2; + } + function ft(s, b, c, d) { + if (s === 0) + return b & c | ~b & d; + if (s === 2) + return b & c | b & d | c & d; + return b ^ c ^ d; + } + Sha1.prototype._update = function(M) { + var W2 = this._w; + var a = this._a | 0; + var b = this._b | 0; + var c = this._c | 0; + var d = this._d | 0; + var e = this._e | 0; + for (var i = 0; i < 16; ++i) + W2[i] = M.readInt32BE(i * 4); + for (; i < 80; ++i) + W2[i] = rotl1(W2[i - 3] ^ W2[i - 8] ^ W2[i - 14] ^ W2[i - 16]); + for (var j = 0; j < 80; ++j) { + var s = ~~(j / 20); + var t = rotl5(a) + ft(s, b, c, d) + e + W2[j] + K[s] | 0; + e = d; + d = c; + c = rotl30(b); + b = a; + a = t; + } + this._a = a + this._a | 0; + this._b = b + this._b | 0; + this._c = c + this._c | 0; + this._d = d + this._d | 0; + this._e = e + this._e | 0; + }; + Sha1.prototype._hash = function() { + var H = Buffer3.allocUnsafe(20); + H.writeInt32BE(this._a | 0, 0); + H.writeInt32BE(this._b | 0, 4); + H.writeInt32BE(this._c | 0, 8); + H.writeInt32BE(this._d | 0, 12); + H.writeInt32BE(this._e | 0, 16); + return H; + }; + module2.exports = Sha1; + } +}); + +// node_modules/crc-32/crc32.js +var require_crc32 = __commonJS({ + "node_modules/crc-32/crc32.js"(exports) { + init_polyfill_buffer(); + var CRC32; + (function(factory) { + if (typeof DO_NOT_EXPORT_CRC === "undefined") { + if (typeof exports === "object") { + factory(exports); + } else if (typeof define === "function" && define.amd) { + define(function() { + var module3 = {}; + factory(module3); + return module3; + }); + } else { + factory(CRC32 = {}); + } + } else { + factory(CRC32 = {}); + } + })(function(CRC322) { + CRC322.version = "1.2.2"; + function signed_crc_table() { + var c = 0, table = new Array(256); + for (var n = 0; n != 256; ++n) { + c = n; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + c = c & 1 ? -306674912 ^ c >>> 1 : c >>> 1; + table[n] = c; + } + return typeof Int32Array !== "undefined" ? new Int32Array(table) : table; + } + var T0 = signed_crc_table(); + function slice_by_16_tables(T) { + var c = 0, v = 0, n = 0, table = typeof Int32Array !== "undefined" ? new Int32Array(4096) : new Array(4096); + for (n = 0; n != 256; ++n) + table[n] = T[n]; + for (n = 0; n != 256; ++n) { + v = T[n]; + for (c = 256 + n; c < 4096; c += 256) + v = table[c] = v >>> 8 ^ T[v & 255]; + } + var out = []; + for (n = 1; n != 16; ++n) + out[n - 1] = typeof Int32Array !== "undefined" ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256); + return out; + } + var TT = slice_by_16_tables(T0); + var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4]; + var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9]; + var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14]; + function crc32_bstr(bstr, seed) { + var C = seed ^ -1; + for (var i = 0, L = bstr.length; i < L; ) + C = C >>> 8 ^ T0[(C ^ bstr.charCodeAt(i++)) & 255]; + return ~C; + } + function crc32_buf(B, seed) { + var C = seed ^ -1, L = B.length - 15, i = 0; + for (; i < L; ) + C = Tf[B[i++] ^ C & 255] ^ Te[B[i++] ^ C >> 8 & 255] ^ Td[B[i++] ^ C >> 16 & 255] ^ Tc[B[i++] ^ C >>> 24] ^ Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^ T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^ T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]]; + L += 15; + while (i < L) + C = C >>> 8 ^ T0[(C ^ B[i++]) & 255]; + return ~C; + } + function crc32_str(str, seed) { + var C = seed ^ -1; + for (var i = 0, L = str.length, c = 0, d = 0; i < L; ) { + c = str.charCodeAt(i++); + if (c < 128) { + C = C >>> 8 ^ T0[(C ^ c) & 255]; + } else if (c < 2048) { + C = C >>> 8 ^ T0[(C ^ (192 | c >> 6 & 31)) & 255]; + C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255]; + } else if (c >= 55296 && c < 57344) { + c = (c & 1023) + 64; + d = str.charCodeAt(i++) & 1023; + C = C >>> 8 ^ T0[(C ^ (240 | c >> 8 & 7)) & 255]; + C = C >>> 8 ^ T0[(C ^ (128 | c >> 2 & 63)) & 255]; + C = C >>> 8 ^ T0[(C ^ (128 | d >> 6 & 15 | (c & 3) << 4)) & 255]; + C = C >>> 8 ^ T0[(C ^ (128 | d & 63)) & 255]; + } else { + C = C >>> 8 ^ T0[(C ^ (224 | c >> 12 & 15)) & 255]; + C = C >>> 8 ^ T0[(C ^ (128 | c >> 6 & 63)) & 255]; + C = C >>> 8 ^ T0[(C ^ (128 | c & 63)) & 255]; + } + } + return ~C; + } + CRC322.table = T0; + CRC322.bstr = crc32_bstr; + CRC322.buf = crc32_buf; + CRC322.str = crc32_str; + }); + } +}); + +// node_modules/pako/lib/utils/common.js +var require_common = __commonJS({ + "node_modules/pako/lib/utils/common.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; + function _has(obj, key2) { + return Object.prototype.hasOwnProperty.call(obj, key2); + } + exports.assign = function(obj) { + var sources = Array.prototype.slice.call(arguments, 1); + while (sources.length) { + var source = sources.shift(); + if (!source) { + continue; + } + if (typeof source !== "object") { + throw new TypeError(source + "must be non-object"); + } + for (var p in source) { + if (_has(source, p)) { + obj[p] = source[p]; + } + } + } + return obj; + }; + exports.shrinkBuf = function(buf, size) { + if (buf.length === size) { + return buf; + } + if (buf.subarray) { + return buf.subarray(0, size); + } + buf.length = size; + return buf; + }; + var fnTyped = { + arraySet: function(dest, src, src_offs, len, dest_offs) { + if (src.subarray && dest.subarray) { + dest.set(src.subarray(src_offs, src_offs + len), dest_offs); + return; + } + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + flattenChunks: function(chunks) { + var i, l, len, pos, chunk, result; + len = 0; + for (i = 0, l = chunks.length; i < l; i++) { + len += chunks[i].length; + } + result = new Uint8Array(len); + pos = 0; + for (i = 0, l = chunks.length; i < l; i++) { + chunk = chunks[i]; + result.set(chunk, pos); + pos += chunk.length; + } + return result; + } + }; + var fnUntyped = { + arraySet: function(dest, src, src_offs, len, dest_offs) { + for (var i = 0; i < len; i++) { + dest[dest_offs + i] = src[src_offs + i]; + } + }, + flattenChunks: function(chunks) { + return [].concat.apply([], chunks); + } + }; + exports.setTyped = function(on) { + if (on) { + exports.Buf8 = Uint8Array; + exports.Buf16 = Uint16Array; + exports.Buf32 = Int32Array; + exports.assign(exports, fnTyped); + } else { + exports.Buf8 = Array; + exports.Buf16 = Array; + exports.Buf32 = Array; + exports.assign(exports, fnUntyped); + } + }; + exports.setTyped(TYPED_OK); + } +}); + +// node_modules/pako/lib/zlib/trees.js +var require_trees = __commonJS({ + "node_modules/pako/lib/zlib/trees.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var utils = require_common(); + var Z_FIXED = 4; + var Z_BINARY = 0; + var Z_TEXT = 1; + var Z_UNKNOWN = 2; + function zero(buf) { + var len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + } + var STORED_BLOCK = 0; + var STATIC_TREES = 1; + var DYN_TREES = 2; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var LENGTH_CODES = 29; + var LITERALS = 256; + var L_CODES = LITERALS + 1 + LENGTH_CODES; + var D_CODES = 30; + var BL_CODES = 19; + var HEAP_SIZE = 2 * L_CODES + 1; + var MAX_BITS = 15; + var Buf_size = 16; + var MAX_BL_BITS = 7; + var END_BLOCK = 256; + var REP_3_6 = 16; + var REPZ_3_10 = 17; + var REPZ_11_138 = 18; + var extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]; + var extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]; + var extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]; + var bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + var DIST_CODE_LEN = 512; + var static_ltree = new Array((L_CODES + 2) * 2); + zero(static_ltree); + var static_dtree = new Array(D_CODES * 2); + zero(static_dtree); + var _dist_code = new Array(DIST_CODE_LEN); + zero(_dist_code); + var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1); + zero(_length_code); + var base_length = new Array(LENGTH_CODES); + zero(base_length); + var base_dist = new Array(D_CODES); + zero(base_dist); + function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) { + this.static_tree = static_tree; + this.extra_bits = extra_bits; + this.extra_base = extra_base; + this.elems = elems; + this.max_length = max_length; + this.has_stree = static_tree && static_tree.length; + } + var static_l_desc; + var static_d_desc; + var static_bl_desc; + function TreeDesc(dyn_tree, stat_desc) { + this.dyn_tree = dyn_tree; + this.max_code = 0; + this.stat_desc = stat_desc; + } + function d_code(dist) { + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)]; + } + function put_short(s, w) { + s.pending_buf[s.pending++] = w & 255; + s.pending_buf[s.pending++] = w >>> 8 & 255; + } + function send_bits(s, value, length) { + if (s.bi_valid > Buf_size - length) { + s.bi_buf |= value << s.bi_valid & 65535; + put_short(s, s.bi_buf); + s.bi_buf = value >> Buf_size - s.bi_valid; + s.bi_valid += length - Buf_size; + } else { + s.bi_buf |= value << s.bi_valid & 65535; + s.bi_valid += length; + } + } + function send_code(s, c, tree) { + send_bits(s, tree[c * 2], tree[c * 2 + 1]); + } + function bi_reverse(code, len) { + var res = 0; + do { + res |= code & 1; + code >>>= 1; + res <<= 1; + } while (--len > 0); + return res >>> 1; + } + function bi_flush(s) { + if (s.bi_valid === 16) { + put_short(s, s.bi_buf); + s.bi_buf = 0; + s.bi_valid = 0; + } else if (s.bi_valid >= 8) { + s.pending_buf[s.pending++] = s.bi_buf & 255; + s.bi_buf >>= 8; + s.bi_valid -= 8; + } + } + function gen_bitlen(s, desc) { + var tree = desc.dyn_tree; + var max_code = desc.max_code; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var extra = desc.stat_desc.extra_bits; + var base = desc.stat_desc.extra_base; + var max_length = desc.stat_desc.max_length; + var h; + var n, m; + var bits; + var xbits; + var f; + var overflow = 0; + for (bits = 0; bits <= MAX_BITS; bits++) { + s.bl_count[bits] = 0; + } + tree[s.heap[s.heap_max] * 2 + 1] = 0; + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) { + n = s.heap[h]; + bits = tree[tree[n * 2 + 1] * 2 + 1] + 1; + if (bits > max_length) { + bits = max_length; + overflow++; + } + tree[n * 2 + 1] = bits; + if (n > max_code) { + continue; + } + s.bl_count[bits]++; + xbits = 0; + if (n >= base) { + xbits = extra[n - base]; + } + f = tree[n * 2]; + s.opt_len += f * (bits + xbits); + if (has_stree) { + s.static_len += f * (stree[n * 2 + 1] + xbits); + } + } + if (overflow === 0) { + return; + } + do { + bits = max_length - 1; + while (s.bl_count[bits] === 0) { + bits--; + } + s.bl_count[bits]--; + s.bl_count[bits + 1] += 2; + s.bl_count[max_length]--; + overflow -= 2; + } while (overflow > 0); + for (bits = max_length; bits !== 0; bits--) { + n = s.bl_count[bits]; + while (n !== 0) { + m = s.heap[--h]; + if (m > max_code) { + continue; + } + if (tree[m * 2 + 1] !== bits) { + s.opt_len += (bits - tree[m * 2 + 1]) * tree[m * 2]; + tree[m * 2 + 1] = bits; + } + n--; + } + } + } + function gen_codes(tree, max_code, bl_count) { + var next_code = new Array(MAX_BITS + 1); + var code = 0; + var bits; + var n; + for (bits = 1; bits <= MAX_BITS; bits++) { + next_code[bits] = code = code + bl_count[bits - 1] << 1; + } + for (n = 0; n <= max_code; n++) { + var len = tree[n * 2 + 1]; + if (len === 0) { + continue; + } + tree[n * 2] = bi_reverse(next_code[len]++, len); + } + } + function tr_static_init() { + var n; + var bits; + var length; + var code; + var dist; + var bl_count = new Array(MAX_BITS + 1); + length = 0; + for (code = 0; code < LENGTH_CODES - 1; code++) { + base_length[code] = length; + for (n = 0; n < 1 << extra_lbits[code]; n++) { + _length_code[length++] = code; + } + } + _length_code[length - 1] = code; + dist = 0; + for (code = 0; code < 16; code++) { + base_dist[code] = dist; + for (n = 0; n < 1 << extra_dbits[code]; n++) { + _dist_code[dist++] = code; + } + } + dist >>= 7; + for (; code < D_CODES; code++) { + base_dist[code] = dist << 7; + for (n = 0; n < 1 << extra_dbits[code] - 7; n++) { + _dist_code[256 + dist++] = code; + } + } + for (bits = 0; bits <= MAX_BITS; bits++) { + bl_count[bits] = 0; + } + n = 0; + while (n <= 143) { + static_ltree[n * 2 + 1] = 8; + n++; + bl_count[8]++; + } + while (n <= 255) { + static_ltree[n * 2 + 1] = 9; + n++; + bl_count[9]++; + } + while (n <= 279) { + static_ltree[n * 2 + 1] = 7; + n++; + bl_count[7]++; + } + while (n <= 287) { + static_ltree[n * 2 + 1] = 8; + n++; + bl_count[8]++; + } + gen_codes(static_ltree, L_CODES + 1, bl_count); + for (n = 0; n < D_CODES; n++) { + static_dtree[n * 2 + 1] = 5; + static_dtree[n * 2] = bi_reverse(n, 5); + } + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS); + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS); + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS); + } + function init_block(s) { + var n; + for (n = 0; n < L_CODES; n++) { + s.dyn_ltree[n * 2] = 0; + } + for (n = 0; n < D_CODES; n++) { + s.dyn_dtree[n * 2] = 0; + } + for (n = 0; n < BL_CODES; n++) { + s.bl_tree[n * 2] = 0; + } + s.dyn_ltree[END_BLOCK * 2] = 1; + s.opt_len = s.static_len = 0; + s.last_lit = s.matches = 0; + } + function bi_windup(s) { + if (s.bi_valid > 8) { + put_short(s, s.bi_buf); + } else if (s.bi_valid > 0) { + s.pending_buf[s.pending++] = s.bi_buf; + } + s.bi_buf = 0; + s.bi_valid = 0; + } + function copy_block(s, buf, len, header) { + bi_windup(s); + if (header) { + put_short(s, len); + put_short(s, ~len); + } + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending); + s.pending += len; + } + function smaller(tree, n, m, depth) { + var _n2 = n * 2; + var _m2 = m * 2; + return tree[_n2] < tree[_m2] || tree[_n2] === tree[_m2] && depth[n] <= depth[m]; + } + function pqdownheap(s, tree, k) { + var v = s.heap[k]; + var j = k << 1; + while (j <= s.heap_len) { + if (j < s.heap_len && smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) { + j++; + } + if (smaller(tree, v, s.heap[j], s.depth)) { + break; + } + s.heap[k] = s.heap[j]; + k = j; + j <<= 1; + } + s.heap[k] = v; + } + function compress_block(s, ltree, dtree) { + var dist; + var lc; + var lx = 0; + var code; + var extra; + if (s.last_lit !== 0) { + do { + dist = s.pending_buf[s.d_buf + lx * 2] << 8 | s.pending_buf[s.d_buf + lx * 2 + 1]; + lc = s.pending_buf[s.l_buf + lx]; + lx++; + if (dist === 0) { + send_code(s, lc, ltree); + } else { + code = _length_code[lc]; + send_code(s, code + LITERALS + 1, ltree); + extra = extra_lbits[code]; + if (extra !== 0) { + lc -= base_length[code]; + send_bits(s, lc, extra); + } + dist--; + code = d_code(dist); + send_code(s, code, dtree); + extra = extra_dbits[code]; + if (extra !== 0) { + dist -= base_dist[code]; + send_bits(s, dist, extra); + } + } + } while (lx < s.last_lit); + } + send_code(s, END_BLOCK, ltree); + } + function build_tree(s, desc) { + var tree = desc.dyn_tree; + var stree = desc.stat_desc.static_tree; + var has_stree = desc.stat_desc.has_stree; + var elems = desc.stat_desc.elems; + var n, m; + var max_code = -1; + var node; + s.heap_len = 0; + s.heap_max = HEAP_SIZE; + for (n = 0; n < elems; n++) { + if (tree[n * 2] !== 0) { + s.heap[++s.heap_len] = max_code = n; + s.depth[n] = 0; + } else { + tree[n * 2 + 1] = 0; + } + } + while (s.heap_len < 2) { + node = s.heap[++s.heap_len] = max_code < 2 ? ++max_code : 0; + tree[node * 2] = 1; + s.depth[node] = 0; + s.opt_len--; + if (has_stree) { + s.static_len -= stree[node * 2 + 1]; + } + } + desc.max_code = max_code; + for (n = s.heap_len >> 1; n >= 1; n--) { + pqdownheap(s, tree, n); + } + node = elems; + do { + n = s.heap[1]; + s.heap[1] = s.heap[s.heap_len--]; + pqdownheap(s, tree, 1); + m = s.heap[1]; + s.heap[--s.heap_max] = n; + s.heap[--s.heap_max] = m; + tree[node * 2] = tree[n * 2] + tree[m * 2]; + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1; + tree[n * 2 + 1] = tree[m * 2 + 1] = node; + s.heap[1] = node++; + pqdownheap(s, tree, 1); + } while (s.heap_len >= 2); + s.heap[--s.heap_max] = s.heap[1]; + gen_bitlen(s, desc); + gen_codes(tree, max_code, s.bl_count); + } + function scan_tree(s, tree, max_code) { + var n; + var prevlen = -1; + var curlen; + var nextlen = tree[0 * 2 + 1]; + var count = 0; + var max_count = 7; + var min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + tree[(max_code + 1) * 2 + 1] = 65535; + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen === nextlen) { + continue; + } else if (count < min_count) { + s.bl_tree[curlen * 2] += count; + } else if (curlen !== 0) { + if (curlen !== prevlen) { + s.bl_tree[curlen * 2]++; + } + s.bl_tree[REP_3_6 * 2]++; + } else if (count <= 10) { + s.bl_tree[REPZ_3_10 * 2]++; + } else { + s.bl_tree[REPZ_11_138 * 2]++; + } + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + } + function send_tree(s, tree, max_code) { + var n; + var prevlen = -1; + var curlen; + var nextlen = tree[0 * 2 + 1]; + var count = 0; + var max_count = 7; + var min_count = 4; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } + for (n = 0; n <= max_code; n++) { + curlen = nextlen; + nextlen = tree[(n + 1) * 2 + 1]; + if (++count < max_count && curlen === nextlen) { + continue; + } else if (count < min_count) { + do { + send_code(s, curlen, s.bl_tree); + } while (--count !== 0); + } else if (curlen !== 0) { + if (curlen !== prevlen) { + send_code(s, curlen, s.bl_tree); + count--; + } + send_code(s, REP_3_6, s.bl_tree); + send_bits(s, count - 3, 2); + } else if (count <= 10) { + send_code(s, REPZ_3_10, s.bl_tree); + send_bits(s, count - 3, 3); + } else { + send_code(s, REPZ_11_138, s.bl_tree); + send_bits(s, count - 11, 7); + } + count = 0; + prevlen = curlen; + if (nextlen === 0) { + max_count = 138; + min_count = 3; + } else if (curlen === nextlen) { + max_count = 6; + min_count = 3; + } else { + max_count = 7; + min_count = 4; + } + } + } + function build_bl_tree(s) { + var max_blindex; + scan_tree(s, s.dyn_ltree, s.l_desc.max_code); + scan_tree(s, s.dyn_dtree, s.d_desc.max_code); + build_tree(s, s.bl_desc); + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) { + if (s.bl_tree[bl_order[max_blindex] * 2 + 1] !== 0) { + break; + } + } + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4; + return max_blindex; + } + function send_all_trees(s, lcodes, dcodes, blcodes) { + var rank; + send_bits(s, lcodes - 257, 5); + send_bits(s, dcodes - 1, 5); + send_bits(s, blcodes - 4, 4); + for (rank = 0; rank < blcodes; rank++) { + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1], 3); + } + send_tree(s, s.dyn_ltree, lcodes - 1); + send_tree(s, s.dyn_dtree, dcodes - 1); + } + function detect_data_type(s) { + var black_mask = 4093624447; + var n; + for (n = 0; n <= 31; n++, black_mask >>>= 1) { + if (black_mask & 1 && s.dyn_ltree[n * 2] !== 0) { + return Z_BINARY; + } + } + if (s.dyn_ltree[9 * 2] !== 0 || s.dyn_ltree[10 * 2] !== 0 || s.dyn_ltree[13 * 2] !== 0) { + return Z_TEXT; + } + for (n = 32; n < LITERALS; n++) { + if (s.dyn_ltree[n * 2] !== 0) { + return Z_TEXT; + } + } + return Z_BINARY; + } + var static_init_done = false; + function _tr_init(s) { + if (!static_init_done) { + tr_static_init(); + static_init_done = true; + } + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc); + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc); + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc); + s.bi_buf = 0; + s.bi_valid = 0; + init_block(s); + } + function _tr_stored_block(s, buf, stored_len, last2) { + send_bits(s, (STORED_BLOCK << 1) + (last2 ? 1 : 0), 3); + copy_block(s, buf, stored_len, true); + } + function _tr_align(s) { + send_bits(s, STATIC_TREES << 1, 3); + send_code(s, END_BLOCK, static_ltree); + bi_flush(s); + } + function _tr_flush_block(s, buf, stored_len, last2) { + var opt_lenb, static_lenb; + var max_blindex = 0; + if (s.level > 0) { + if (s.strm.data_type === Z_UNKNOWN) { + s.strm.data_type = detect_data_type(s); + } + build_tree(s, s.l_desc); + build_tree(s, s.d_desc); + max_blindex = build_bl_tree(s); + opt_lenb = s.opt_len + 3 + 7 >>> 3; + static_lenb = s.static_len + 3 + 7 >>> 3; + if (static_lenb <= opt_lenb) { + opt_lenb = static_lenb; + } + } else { + opt_lenb = static_lenb = stored_len + 5; + } + if (stored_len + 4 <= opt_lenb && buf !== -1) { + _tr_stored_block(s, buf, stored_len, last2); + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) { + send_bits(s, (STATIC_TREES << 1) + (last2 ? 1 : 0), 3); + compress_block(s, static_ltree, static_dtree); + } else { + send_bits(s, (DYN_TREES << 1) + (last2 ? 1 : 0), 3); + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1); + compress_block(s, s.dyn_ltree, s.dyn_dtree); + } + init_block(s); + if (last2) { + bi_windup(s); + } + } + function _tr_tally(s, dist, lc) { + s.pending_buf[s.d_buf + s.last_lit * 2] = dist >>> 8 & 255; + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 255; + s.pending_buf[s.l_buf + s.last_lit] = lc & 255; + s.last_lit++; + if (dist === 0) { + s.dyn_ltree[lc * 2]++; + } else { + s.matches++; + dist--; + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]++; + s.dyn_dtree[d_code(dist) * 2]++; + } + return s.last_lit === s.lit_bufsize - 1; + } + exports._tr_init = _tr_init; + exports._tr_stored_block = _tr_stored_block; + exports._tr_flush_block = _tr_flush_block; + exports._tr_tally = _tr_tally; + exports._tr_align = _tr_align; + } +}); + +// node_modules/pako/lib/zlib/adler32.js +var require_adler32 = __commonJS({ + "node_modules/pako/lib/zlib/adler32.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + function adler32(adler, buf, len, pos) { + var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n = 0; + while (len !== 0) { + n = len > 2e3 ? 2e3 : len; + len -= n; + do { + s1 = s1 + buf[pos++] | 0; + s2 = s2 + s1 | 0; + } while (--n); + s1 %= 65521; + s2 %= 65521; + } + return s1 | s2 << 16 | 0; + } + module2.exports = adler32; + } +}); + +// node_modules/pako/lib/zlib/crc32.js +var require_crc322 = __commonJS({ + "node_modules/pako/lib/zlib/crc32.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + function makeTable() { + var c, table = []; + for (var n = 0; n < 256; n++) { + c = n; + for (var k = 0; k < 8; k++) { + c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1; + } + table[n] = c; + } + return table; + } + var crcTable = makeTable(); + function crc322(crc, buf, len, pos) { + var t = crcTable, end = pos + len; + crc ^= -1; + for (var i = pos; i < end; i++) { + crc = crc >>> 8 ^ t[(crc ^ buf[i]) & 255]; + } + return crc ^ -1; + } + module2.exports = crc322; + } +}); + +// node_modules/pako/lib/zlib/messages.js +var require_messages = __commonJS({ + "node_modules/pako/lib/zlib/messages.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + module2.exports = { + 2: "need dictionary", + 1: "stream end", + 0: "", + "-1": "file error", + "-2": "stream error", + "-3": "data error", + "-4": "insufficient memory", + "-5": "buffer error", + "-6": "incompatible version" + }; + } +}); + +// node_modules/pako/lib/zlib/deflate.js +var require_deflate = __commonJS({ + "node_modules/pako/lib/zlib/deflate.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var utils = require_common(); + var trees = require_trees(); + var adler32 = require_adler32(); + var crc322 = require_crc322(); + var msg = require_messages(); + var Z_NO_FLUSH = 0; + var Z_PARTIAL_FLUSH = 1; + var Z_FULL_FLUSH = 3; + var Z_FINISH = 4; + var Z_BLOCK = 5; + var Z_OK = 0; + var Z_STREAM_END = 1; + var Z_STREAM_ERROR = -2; + var Z_DATA_ERROR = -3; + var Z_BUF_ERROR = -5; + var Z_DEFAULT_COMPRESSION = -1; + var Z_FILTERED = 1; + var Z_HUFFMAN_ONLY = 2; + var Z_RLE = 3; + var Z_FIXED = 4; + var Z_DEFAULT_STRATEGY = 0; + var Z_UNKNOWN = 2; + var Z_DEFLATED = 8; + var MAX_MEM_LEVEL = 9; + var MAX_WBITS = 15; + var DEF_MEM_LEVEL = 8; + var LENGTH_CODES = 29; + var LITERALS = 256; + var L_CODES = LITERALS + 1 + LENGTH_CODES; + var D_CODES = 30; + var BL_CODES = 19; + var HEAP_SIZE = 2 * L_CODES + 1; + var MAX_BITS = 15; + var MIN_MATCH = 3; + var MAX_MATCH = 258; + var MIN_LOOKAHEAD = MAX_MATCH + MIN_MATCH + 1; + var PRESET_DICT = 32; + var INIT_STATE = 42; + var EXTRA_STATE = 69; + var NAME_STATE = 73; + var COMMENT_STATE = 91; + var HCRC_STATE = 103; + var BUSY_STATE = 113; + var FINISH_STATE = 666; + var BS_NEED_MORE = 1; + var BS_BLOCK_DONE = 2; + var BS_FINISH_STARTED = 3; + var BS_FINISH_DONE = 4; + var OS_CODE = 3; + function err(strm, errorCode) { + strm.msg = msg[errorCode]; + return errorCode; + } + function rank(f) { + return (f << 1) - (f > 4 ? 9 : 0); + } + function zero(buf) { + var len = buf.length; + while (--len >= 0) { + buf[len] = 0; + } + } + function flush_pending(strm) { + var s = strm.state; + var len = s.pending; + if (len > strm.avail_out) { + len = strm.avail_out; + } + if (len === 0) { + return; + } + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out); + strm.next_out += len; + s.pending_out += len; + strm.total_out += len; + strm.avail_out -= len; + s.pending -= len; + if (s.pending === 0) { + s.pending_out = 0; + } + } + function flush_block_only(s, last2) { + trees._tr_flush_block(s, s.block_start >= 0 ? s.block_start : -1, s.strstart - s.block_start, last2); + s.block_start = s.strstart; + flush_pending(s.strm); + } + function put_byte(s, b) { + s.pending_buf[s.pending++] = b; + } + function putShortMSB(s, b) { + s.pending_buf[s.pending++] = b >>> 8 & 255; + s.pending_buf[s.pending++] = b & 255; + } + function read_buf(strm, buf, start, size) { + var len = strm.avail_in; + if (len > size) { + len = size; + } + if (len === 0) { + return 0; + } + strm.avail_in -= len; + utils.arraySet(buf, strm.input, strm.next_in, len, start); + if (strm.state.wrap === 1) { + strm.adler = adler32(strm.adler, buf, len, start); + } else if (strm.state.wrap === 2) { + strm.adler = crc322(strm.adler, buf, len, start); + } + strm.next_in += len; + strm.total_in += len; + return len; + } + function longest_match(s, cur_match) { + var chain_length = s.max_chain_length; + var scan = s.strstart; + var match; + var len; + var best_len = s.prev_length; + var nice_match = s.nice_match; + var limit = s.strstart > s.w_size - MIN_LOOKAHEAD ? s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0; + var _win = s.window; + var wmask = s.w_mask; + var prev = s.prev; + var strend = s.strstart + MAX_MATCH; + var scan_end1 = _win[scan + best_len - 1]; + var scan_end = _win[scan + best_len]; + if (s.prev_length >= s.good_match) { + chain_length >>= 2; + } + if (nice_match > s.lookahead) { + nice_match = s.lookahead; + } + do { + match = cur_match; + if (_win[match + best_len] !== scan_end || _win[match + best_len - 1] !== scan_end1 || _win[match] !== _win[scan] || _win[++match] !== _win[scan + 1]) { + continue; + } + scan += 2; + match++; + do { + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && _win[++scan] === _win[++match] && scan < strend); + len = MAX_MATCH - (strend - scan); + scan = strend - MAX_MATCH; + if (len > best_len) { + s.match_start = cur_match; + best_len = len; + if (len >= nice_match) { + break; + } + scan_end1 = _win[scan + best_len - 1]; + scan_end = _win[scan + best_len]; + } + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0); + if (best_len <= s.lookahead) { + return best_len; + } + return s.lookahead; + } + function fill_window(s) { + var _w_size = s.w_size; + var p, n, m, more, str; + do { + more = s.window_size - s.lookahead - s.strstart; + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) { + utils.arraySet(s.window, s.window, _w_size, _w_size, 0); + s.match_start -= _w_size; + s.strstart -= _w_size; + s.block_start -= _w_size; + n = s.hash_size; + p = n; + do { + m = s.head[--p]; + s.head[p] = m >= _w_size ? m - _w_size : 0; + } while (--n); + n = _w_size; + p = n; + do { + m = s.prev[--p]; + s.prev[p] = m >= _w_size ? m - _w_size : 0; + } while (--n); + more += _w_size; + } + if (s.strm.avail_in === 0) { + break; + } + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more); + s.lookahead += n; + if (s.lookahead + s.insert >= MIN_MATCH) { + str = s.strstart - s.insert; + s.ins_h = s.window[str]; + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + 1]) & s.hash_mask; + while (s.insert) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + s.insert--; + if (s.lookahead + s.insert < MIN_MATCH) { + break; + } + } + } + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0); + } + function deflate_stored(s, flush2) { + var max_block_size = 65535; + if (max_block_size > s.pending_buf_size - 5) { + max_block_size = s.pending_buf_size - 5; + } + for (; ; ) { + if (s.lookahead <= 1) { + fill_window(s); + if (s.lookahead === 0 && flush2 === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + s.strstart += s.lookahead; + s.lookahead = 0; + var max_start = s.block_start + max_block_size; + if (s.strstart === 0 || s.strstart >= max_start) { + s.lookahead = s.strstart - max_start; + s.strstart = max_start; + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + if (s.strstart - s.block_start >= s.w_size - MIN_LOOKAHEAD) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush2 === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.strstart > s.block_start) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_NEED_MORE; + } + function deflate_fast(s, flush2) { + var hash_head; + var bflush; + for (; ; ) { + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush2 === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s.lookahead >= MIN_MATCH) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + if (hash_head !== 0 && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { + s.match_length = longest_match(s, hash_head); + } + if (s.match_length >= MIN_MATCH) { + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH); + s.lookahead -= s.match_length; + if (s.match_length <= s.max_lazy_match && s.lookahead >= MIN_MATCH) { + s.match_length--; + do { + s.strstart++; + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } while (--s.match_length !== 0); + s.strstart++; + } else { + s.strstart += s.match_length; + s.match_length = 0; + s.ins_h = s.window[s.strstart]; + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + 1]) & s.hash_mask; + } + } else { + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + } + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush2 === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_slow(s, flush2) { + var hash_head; + var bflush; + var max_insert; + for (; ; ) { + if (s.lookahead < MIN_LOOKAHEAD) { + fill_window(s); + if (s.lookahead < MIN_LOOKAHEAD && flush2 === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + hash_head = 0; + if (s.lookahead >= MIN_MATCH) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + s.prev_length = s.match_length; + s.prev_match = s.match_start; + s.match_length = MIN_MATCH - 1; + if (hash_head !== 0 && s.prev_length < s.max_lazy_match && s.strstart - hash_head <= s.w_size - MIN_LOOKAHEAD) { + s.match_length = longest_match(s, hash_head); + if (s.match_length <= 5 && (s.strategy === Z_FILTERED || s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096)) { + s.match_length = MIN_MATCH - 1; + } + } + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) { + max_insert = s.strstart + s.lookahead - MIN_MATCH; + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH); + s.lookahead -= s.prev_length - 1; + s.prev_length -= 2; + do { + if (++s.strstart <= max_insert) { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask; + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = s.strstart; + } + } while (--s.prev_length !== 0); + s.match_available = 0; + s.match_length = MIN_MATCH - 1; + s.strstart++; + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } else if (s.match_available) { + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + if (bflush) { + flush_block_only(s, false); + } + s.strstart++; + s.lookahead--; + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } else { + s.match_available = 1; + s.strstart++; + s.lookahead--; + } + } + if (s.match_available) { + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]); + s.match_available = 0; + } + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1; + if (flush2 === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_rle(s, flush2) { + var bflush; + var prev; + var scan, strend; + var _win = s.window; + for (; ; ) { + if (s.lookahead <= MAX_MATCH) { + fill_window(s); + if (s.lookahead <= MAX_MATCH && flush2 === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + if (s.lookahead === 0) { + break; + } + } + s.match_length = 0; + if (s.lookahead >= MIN_MATCH && s.strstart > 0) { + scan = s.strstart - 1; + prev = _win[scan]; + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) { + strend = s.strstart + MAX_MATCH; + do { + } while (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan] && scan < strend); + s.match_length = MAX_MATCH - (strend - scan); + if (s.match_length > s.lookahead) { + s.match_length = s.lookahead; + } + } + } + if (s.match_length >= MIN_MATCH) { + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH); + s.lookahead -= s.match_length; + s.strstart += s.match_length; + s.match_length = 0; + } else { + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + } + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush2 === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function deflate_huff(s, flush2) { + var bflush; + for (; ; ) { + if (s.lookahead === 0) { + fill_window(s); + if (s.lookahead === 0) { + if (flush2 === Z_NO_FLUSH) { + return BS_NEED_MORE; + } + break; + } + } + s.match_length = 0; + bflush = trees._tr_tally(s, 0, s.window[s.strstart]); + s.lookahead--; + s.strstart++; + if (bflush) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + } + s.insert = 0; + if (flush2 === Z_FINISH) { + flush_block_only(s, true); + if (s.strm.avail_out === 0) { + return BS_FINISH_STARTED; + } + return BS_FINISH_DONE; + } + if (s.last_lit) { + flush_block_only(s, false); + if (s.strm.avail_out === 0) { + return BS_NEED_MORE; + } + } + return BS_BLOCK_DONE; + } + function Config(good_length, max_lazy, nice_length, max_chain, func) { + this.good_length = good_length; + this.max_lazy = max_lazy; + this.nice_length = nice_length; + this.max_chain = max_chain; + this.func = func; + } + var configuration_table; + configuration_table = [ + new Config(0, 0, 0, 0, deflate_stored), + new Config(4, 4, 8, 4, deflate_fast), + new Config(4, 5, 16, 8, deflate_fast), + new Config(4, 6, 32, 32, deflate_fast), + new Config(4, 4, 16, 16, deflate_slow), + new Config(8, 16, 32, 32, deflate_slow), + new Config(8, 16, 128, 128, deflate_slow), + new Config(8, 32, 128, 256, deflate_slow), + new Config(32, 128, 258, 1024, deflate_slow), + new Config(32, 258, 258, 4096, deflate_slow) + ]; + function lm_init(s) { + s.window_size = 2 * s.w_size; + zero(s.head); + s.max_lazy_match = configuration_table[s.level].max_lazy; + s.good_match = configuration_table[s.level].good_length; + s.nice_match = configuration_table[s.level].nice_length; + s.max_chain_length = configuration_table[s.level].max_chain; + s.strstart = 0; + s.block_start = 0; + s.lookahead = 0; + s.insert = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + s.ins_h = 0; + } + function DeflateState() { + this.strm = null; + this.status = 0; + this.pending_buf = null; + this.pending_buf_size = 0; + this.pending_out = 0; + this.pending = 0; + this.wrap = 0; + this.gzhead = null; + this.gzindex = 0; + this.method = Z_DEFLATED; + this.last_flush = -1; + this.w_size = 0; + this.w_bits = 0; + this.w_mask = 0; + this.window = null; + this.window_size = 0; + this.prev = null; + this.head = null; + this.ins_h = 0; + this.hash_size = 0; + this.hash_bits = 0; + this.hash_mask = 0; + this.hash_shift = 0; + this.block_start = 0; + this.match_length = 0; + this.prev_match = 0; + this.match_available = 0; + this.strstart = 0; + this.match_start = 0; + this.lookahead = 0; + this.prev_length = 0; + this.max_chain_length = 0; + this.max_lazy_match = 0; + this.level = 0; + this.strategy = 0; + this.good_match = 0; + this.nice_match = 0; + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2); + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2); + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2); + zero(this.dyn_ltree); + zero(this.dyn_dtree); + zero(this.bl_tree); + this.l_desc = null; + this.d_desc = null; + this.bl_desc = null; + this.bl_count = new utils.Buf16(MAX_BITS + 1); + this.heap = new utils.Buf16(2 * L_CODES + 1); + zero(this.heap); + this.heap_len = 0; + this.heap_max = 0; + this.depth = new utils.Buf16(2 * L_CODES + 1); + zero(this.depth); + this.l_buf = 0; + this.lit_bufsize = 0; + this.last_lit = 0; + this.d_buf = 0; + this.opt_len = 0; + this.static_len = 0; + this.matches = 0; + this.insert = 0; + this.bi_buf = 0; + this.bi_valid = 0; + } + function deflateResetKeep(strm) { + var s; + if (!strm || !strm.state) { + return err(strm, Z_STREAM_ERROR); + } + strm.total_in = strm.total_out = 0; + strm.data_type = Z_UNKNOWN; + s = strm.state; + s.pending = 0; + s.pending_out = 0; + if (s.wrap < 0) { + s.wrap = -s.wrap; + } + s.status = s.wrap ? INIT_STATE : BUSY_STATE; + strm.adler = s.wrap === 2 ? 0 : 1; + s.last_flush = Z_NO_FLUSH; + trees._tr_init(s); + return Z_OK; + } + function deflateReset(strm) { + var ret = deflateResetKeep(strm); + if (ret === Z_OK) { + lm_init(strm.state); + } + return ret; + } + function deflateSetHeader(strm, head) { + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + if (strm.state.wrap !== 2) { + return Z_STREAM_ERROR; + } + strm.state.gzhead = head; + return Z_OK; + } + function deflateInit2(strm, level, method, windowBits, memLevel, strategy) { + if (!strm) { + return Z_STREAM_ERROR; + } + var wrap = 1; + if (level === Z_DEFAULT_COMPRESSION) { + level = 6; + } + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } else if (windowBits > 15) { + wrap = 2; + windowBits -= 16; + } + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { + return err(strm, Z_STREAM_ERROR); + } + if (windowBits === 8) { + windowBits = 9; + } + var s = new DeflateState(); + strm.state = s; + s.strm = strm; + s.wrap = wrap; + s.gzhead = null; + s.w_bits = windowBits; + s.w_size = 1 << s.w_bits; + s.w_mask = s.w_size - 1; + s.hash_bits = memLevel + 7; + s.hash_size = 1 << s.hash_bits; + s.hash_mask = s.hash_size - 1; + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH); + s.window = new utils.Buf8(s.w_size * 2); + s.head = new utils.Buf16(s.hash_size); + s.prev = new utils.Buf16(s.w_size); + s.lit_bufsize = 1 << memLevel + 6; + s.pending_buf_size = s.lit_bufsize * 4; + s.pending_buf = new utils.Buf8(s.pending_buf_size); + s.d_buf = 1 * s.lit_bufsize; + s.l_buf = (1 + 2) * s.lit_bufsize; + s.level = level; + s.strategy = strategy; + s.method = method; + return deflateReset(strm); + } + function deflateInit(strm, level) { + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY); + } + function deflate2(strm, flush2) { + var old_flush, s; + var beg, val; + if (!strm || !strm.state || flush2 > Z_BLOCK || flush2 < 0) { + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR; + } + s = strm.state; + if (!strm.output || !strm.input && strm.avail_in !== 0 || s.status === FINISH_STATE && flush2 !== Z_FINISH) { + return err(strm, strm.avail_out === 0 ? Z_BUF_ERROR : Z_STREAM_ERROR); + } + s.strm = strm; + old_flush = s.last_flush; + s.last_flush = flush2; + if (s.status === INIT_STATE) { + if (s.wrap === 2) { + strm.adler = 0; + put_byte(s, 31); + put_byte(s, 139); + put_byte(s, 8); + if (!s.gzhead) { + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, 0); + put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); + put_byte(s, OS_CODE); + s.status = BUSY_STATE; + } else { + put_byte(s, (s.gzhead.text ? 1 : 0) + (s.gzhead.hcrc ? 2 : 0) + (!s.gzhead.extra ? 0 : 4) + (!s.gzhead.name ? 0 : 8) + (!s.gzhead.comment ? 0 : 16)); + put_byte(s, s.gzhead.time & 255); + put_byte(s, s.gzhead.time >> 8 & 255); + put_byte(s, s.gzhead.time >> 16 & 255); + put_byte(s, s.gzhead.time >> 24 & 255); + put_byte(s, s.level === 9 ? 2 : s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ? 4 : 0); + put_byte(s, s.gzhead.os & 255); + if (s.gzhead.extra && s.gzhead.extra.length) { + put_byte(s, s.gzhead.extra.length & 255); + put_byte(s, s.gzhead.extra.length >> 8 & 255); + } + if (s.gzhead.hcrc) { + strm.adler = crc322(strm.adler, s.pending_buf, s.pending, 0); + } + s.gzindex = 0; + s.status = EXTRA_STATE; + } + } else { + var header = Z_DEFLATED + (s.w_bits - 8 << 4) << 8; + var level_flags = -1; + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) { + level_flags = 0; + } else if (s.level < 6) { + level_flags = 1; + } else if (s.level === 6) { + level_flags = 2; + } else { + level_flags = 3; + } + header |= level_flags << 6; + if (s.strstart !== 0) { + header |= PRESET_DICT; + } + header += 31 - header % 31; + s.status = BUSY_STATE; + putShortMSB(s, header); + if (s.strstart !== 0) { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 65535); + } + strm.adler = 1; + } + } + if (s.status === EXTRA_STATE) { + if (s.gzhead.extra) { + beg = s.pending; + while (s.gzindex < (s.gzhead.extra.length & 65535)) { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + break; + } + } + put_byte(s, s.gzhead.extra[s.gzindex] & 255); + s.gzindex++; + } + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (s.gzindex === s.gzhead.extra.length) { + s.gzindex = 0; + s.status = NAME_STATE; + } + } else { + s.status = NAME_STATE; + } + } + if (s.status === NAME_STATE) { + if (s.gzhead.name) { + beg = s.pending; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + if (s.gzindex < s.gzhead.name.length) { + val = s.gzhead.name.charCodeAt(s.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.gzindex = 0; + s.status = COMMENT_STATE; + } + } else { + s.status = COMMENT_STATE; + } + } + if (s.status === COMMENT_STATE) { + if (s.gzhead.comment) { + beg = s.pending; + do { + if (s.pending === s.pending_buf_size) { + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); + } + flush_pending(strm); + beg = s.pending; + if (s.pending === s.pending_buf_size) { + val = 1; + break; + } + } + if (s.gzindex < s.gzhead.comment.length) { + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 255; + } else { + val = 0; + } + put_byte(s, val); + } while (val !== 0); + if (s.gzhead.hcrc && s.pending > beg) { + strm.adler = crc322(strm.adler, s.pending_buf, s.pending - beg, beg); + } + if (val === 0) { + s.status = HCRC_STATE; + } + } else { + s.status = HCRC_STATE; + } + } + if (s.status === HCRC_STATE) { + if (s.gzhead.hcrc) { + if (s.pending + 2 > s.pending_buf_size) { + flush_pending(strm); + } + if (s.pending + 2 <= s.pending_buf_size) { + put_byte(s, strm.adler & 255); + put_byte(s, strm.adler >> 8 & 255); + strm.adler = 0; + s.status = BUSY_STATE; + } + } else { + s.status = BUSY_STATE; + } + } + if (s.pending !== 0) { + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; + return Z_OK; + } + } else if (strm.avail_in === 0 && rank(flush2) <= rank(old_flush) && flush2 !== Z_FINISH) { + return err(strm, Z_BUF_ERROR); + } + if (s.status === FINISH_STATE && strm.avail_in !== 0) { + return err(strm, Z_BUF_ERROR); + } + if (strm.avail_in !== 0 || s.lookahead !== 0 || flush2 !== Z_NO_FLUSH && s.status !== FINISH_STATE) { + var bstate = s.strategy === Z_HUFFMAN_ONLY ? deflate_huff(s, flush2) : s.strategy === Z_RLE ? deflate_rle(s, flush2) : configuration_table[s.level].func(s, flush2); + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) { + s.status = FINISH_STATE; + } + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) { + if (strm.avail_out === 0) { + s.last_flush = -1; + } + return Z_OK; + } + if (bstate === BS_BLOCK_DONE) { + if (flush2 === Z_PARTIAL_FLUSH) { + trees._tr_align(s); + } else if (flush2 !== Z_BLOCK) { + trees._tr_stored_block(s, 0, 0, false); + if (flush2 === Z_FULL_FLUSH) { + zero(s.head); + if (s.lookahead === 0) { + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + } + } + flush_pending(strm); + if (strm.avail_out === 0) { + s.last_flush = -1; + return Z_OK; + } + } + } + if (flush2 !== Z_FINISH) { + return Z_OK; + } + if (s.wrap <= 0) { + return Z_STREAM_END; + } + if (s.wrap === 2) { + put_byte(s, strm.adler & 255); + put_byte(s, strm.adler >> 8 & 255); + put_byte(s, strm.adler >> 16 & 255); + put_byte(s, strm.adler >> 24 & 255); + put_byte(s, strm.total_in & 255); + put_byte(s, strm.total_in >> 8 & 255); + put_byte(s, strm.total_in >> 16 & 255); + put_byte(s, strm.total_in >> 24 & 255); + } else { + putShortMSB(s, strm.adler >>> 16); + putShortMSB(s, strm.adler & 65535); + } + flush_pending(strm); + if (s.wrap > 0) { + s.wrap = -s.wrap; + } + return s.pending !== 0 ? Z_OK : Z_STREAM_END; + } + function deflateEnd(strm) { + var status2; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + status2 = strm.state.status; + if (status2 !== INIT_STATE && status2 !== EXTRA_STATE && status2 !== NAME_STATE && status2 !== COMMENT_STATE && status2 !== HCRC_STATE && status2 !== BUSY_STATE && status2 !== FINISH_STATE) { + return err(strm, Z_STREAM_ERROR); + } + strm.state = null; + return status2 === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK; + } + function deflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + var s; + var str, n; + var wrap; + var avail; + var next; + var input; + var tmpDict; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + s = strm.state; + wrap = s.wrap; + if (wrap === 2 || wrap === 1 && s.status !== INIT_STATE || s.lookahead) { + return Z_STREAM_ERROR; + } + if (wrap === 1) { + strm.adler = adler32(strm.adler, dictionary, dictLength, 0); + } + s.wrap = 0; + if (dictLength >= s.w_size) { + if (wrap === 0) { + zero(s.head); + s.strstart = 0; + s.block_start = 0; + s.insert = 0; + } + tmpDict = new utils.Buf8(s.w_size); + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0); + dictionary = tmpDict; + dictLength = s.w_size; + } + avail = strm.avail_in; + next = strm.next_in; + input = strm.input; + strm.avail_in = dictLength; + strm.next_in = 0; + strm.input = dictionary; + fill_window(s); + while (s.lookahead >= MIN_MATCH) { + str = s.strstart; + n = s.lookahead - (MIN_MATCH - 1); + do { + s.ins_h = (s.ins_h << s.hash_shift ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask; + s.prev[str & s.w_mask] = s.head[s.ins_h]; + s.head[s.ins_h] = str; + str++; + } while (--n); + s.strstart = str; + s.lookahead = MIN_MATCH - 1; + fill_window(s); + } + s.strstart += s.lookahead; + s.block_start = s.strstart; + s.insert = s.lookahead; + s.lookahead = 0; + s.match_length = s.prev_length = MIN_MATCH - 1; + s.match_available = 0; + strm.next_in = next; + strm.input = input; + strm.avail_in = avail; + s.wrap = wrap; + return Z_OK; + } + exports.deflateInit = deflateInit; + exports.deflateInit2 = deflateInit2; + exports.deflateReset = deflateReset; + exports.deflateResetKeep = deflateResetKeep; + exports.deflateSetHeader = deflateSetHeader; + exports.deflate = deflate2; + exports.deflateEnd = deflateEnd; + exports.deflateSetDictionary = deflateSetDictionary; + exports.deflateInfo = "pako deflate (from Nodeca project)"; + } +}); + +// node_modules/pako/lib/utils/strings.js +var require_strings = __commonJS({ + "node_modules/pako/lib/utils/strings.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var utils = require_common(); + var STR_APPLY_OK = true; + var STR_APPLY_UIA_OK = true; + try { + String.fromCharCode.apply(null, [0]); + } catch (__) { + STR_APPLY_OK = false; + } + try { + String.fromCharCode.apply(null, new Uint8Array(1)); + } catch (__) { + STR_APPLY_UIA_OK = false; + } + var _utf8len = new utils.Buf8(256); + for (q = 0; q < 256; q++) { + _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1; + } + var q; + _utf8len[254] = _utf8len[254] = 1; + exports.string2buf = function(str) { + var buf, c, c2, m_pos, i, str_len = str.length, buf_len = 0; + for (m_pos = 0; m_pos < str_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + buf_len += c < 128 ? 1 : c < 2048 ? 2 : c < 65536 ? 3 : 4; + } + buf = new utils.Buf8(buf_len); + for (i = 0, m_pos = 0; i < buf_len; m_pos++) { + c = str.charCodeAt(m_pos); + if ((c & 64512) === 55296 && m_pos + 1 < str_len) { + c2 = str.charCodeAt(m_pos + 1); + if ((c2 & 64512) === 56320) { + c = 65536 + (c - 55296 << 10) + (c2 - 56320); + m_pos++; + } + } + if (c < 128) { + buf[i++] = c; + } else if (c < 2048) { + buf[i++] = 192 | c >>> 6; + buf[i++] = 128 | c & 63; + } else if (c < 65536) { + buf[i++] = 224 | c >>> 12; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } else { + buf[i++] = 240 | c >>> 18; + buf[i++] = 128 | c >>> 12 & 63; + buf[i++] = 128 | c >>> 6 & 63; + buf[i++] = 128 | c & 63; + } + } + return buf; + }; + function buf2binstring(buf, len) { + if (len < 65534) { + if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) { + return String.fromCharCode.apply(null, utils.shrinkBuf(buf, len)); + } + } + var result = ""; + for (var i = 0; i < len; i++) { + result += String.fromCharCode(buf[i]); + } + return result; + } + exports.buf2binstring = function(buf) { + return buf2binstring(buf, buf.length); + }; + exports.binstring2buf = function(str) { + var buf = new utils.Buf8(str.length); + for (var i = 0, len = buf.length; i < len; i++) { + buf[i] = str.charCodeAt(i); + } + return buf; + }; + exports.buf2string = function(buf, max) { + var i, out, c, c_len; + var len = max || buf.length; + var utf16buf = new Array(len * 2); + for (out = 0, i = 0; i < len; ) { + c = buf[i++]; + if (c < 128) { + utf16buf[out++] = c; + continue; + } + c_len = _utf8len[c]; + if (c_len > 4) { + utf16buf[out++] = 65533; + i += c_len - 1; + continue; + } + c &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; + while (c_len > 1 && i < len) { + c = c << 6 | buf[i++] & 63; + c_len--; + } + if (c_len > 1) { + utf16buf[out++] = 65533; + continue; + } + if (c < 65536) { + utf16buf[out++] = c; + } else { + c -= 65536; + utf16buf[out++] = 55296 | c >> 10 & 1023; + utf16buf[out++] = 56320 | c & 1023; + } + } + return buf2binstring(utf16buf, out); + }; + exports.utf8border = function(buf, max) { + var pos; + max = max || buf.length; + if (max > buf.length) { + max = buf.length; + } + pos = max - 1; + while (pos >= 0 && (buf[pos] & 192) === 128) { + pos--; + } + if (pos < 0) { + return max; + } + if (pos === 0) { + return max; + } + return pos + _utf8len[buf[pos]] > max ? pos : max; + }; + } +}); + +// node_modules/pako/lib/zlib/zstream.js +var require_zstream = __commonJS({ + "node_modules/pako/lib/zlib/zstream.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + function ZStream() { + this.input = null; + this.next_in = 0; + this.avail_in = 0; + this.total_in = 0; + this.output = null; + this.next_out = 0; + this.avail_out = 0; + this.total_out = 0; + this.msg = ""; + this.state = null; + this.data_type = 2; + this.adler = 0; + } + module2.exports = ZStream; + } +}); + +// node_modules/pako/lib/deflate.js +var require_deflate2 = __commonJS({ + "node_modules/pako/lib/deflate.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var zlib_deflate = require_deflate(); + var utils = require_common(); + var strings = require_strings(); + var msg = require_messages(); + var ZStream = require_zstream(); + var toString = Object.prototype.toString; + var Z_NO_FLUSH = 0; + var Z_FINISH = 4; + var Z_OK = 0; + var Z_STREAM_END = 1; + var Z_SYNC_FLUSH = 2; + var Z_DEFAULT_COMPRESSION = -1; + var Z_DEFAULT_STRATEGY = 0; + var Z_DEFLATED = 8; + function Deflate(options) { + if (!(this instanceof Deflate)) + return new Deflate(options); + this.options = utils.assign({ + level: Z_DEFAULT_COMPRESSION, + method: Z_DEFLATED, + chunkSize: 16384, + windowBits: 15, + memLevel: 8, + strategy: Z_DEFAULT_STRATEGY, + to: "" + }, options || {}); + var opt = this.options; + if (opt.raw && opt.windowBits > 0) { + opt.windowBits = -opt.windowBits; + } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) { + opt.windowBits += 16; + } + this.err = 0; + this.msg = ""; + this.ended = false; + this.chunks = []; + this.strm = new ZStream(); + this.strm.avail_out = 0; + var status2 = zlib_deflate.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy); + if (status2 !== Z_OK) { + throw new Error(msg[status2]); + } + if (opt.header) { + zlib_deflate.deflateSetHeader(this.strm, opt.header); + } + if (opt.dictionary) { + var dict; + if (typeof opt.dictionary === "string") { + dict = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { + dict = new Uint8Array(opt.dictionary); + } else { + dict = opt.dictionary; + } + status2 = zlib_deflate.deflateSetDictionary(this.strm, dict); + if (status2 !== Z_OK) { + throw new Error(msg[status2]); + } + this._dict_set = true; + } + } + Deflate.prototype.push = function(data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var status2, _mode; + if (this.ended) { + return false; + } + _mode = mode === ~~mode ? mode : mode === true ? Z_FINISH : Z_NO_FLUSH; + if (typeof data === "string") { + strm.input = strings.string2buf(data); + } else if (toString.call(data) === "[object ArrayBuffer]") { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + strm.next_in = 0; + strm.avail_in = strm.input.length; + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status2 = zlib_deflate.deflate(strm, _mode); + if (status2 !== Z_STREAM_END && status2 !== Z_OK) { + this.onEnd(status2); + this.ended = true; + return false; + } + if (strm.avail_out === 0 || strm.avail_in === 0 && (_mode === Z_FINISH || _mode === Z_SYNC_FLUSH)) { + if (this.options.to === "string") { + this.onData(strings.buf2binstring(utils.shrinkBuf(strm.output, strm.next_out))); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status2 !== Z_STREAM_END); + if (_mode === Z_FINISH) { + status2 = zlib_deflate.deflateEnd(this.strm); + this.onEnd(status2); + this.ended = true; + return status2 === Z_OK; + } + if (_mode === Z_SYNC_FLUSH) { + this.onEnd(Z_OK); + strm.avail_out = 0; + return true; + } + return true; + }; + Deflate.prototype.onData = function(chunk) { + this.chunks.push(chunk); + }; + Deflate.prototype.onEnd = function(status2) { + if (status2 === Z_OK) { + if (this.options.to === "string") { + this.result = this.chunks.join(""); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status2; + this.msg = this.strm.msg; + }; + function deflate2(input, options) { + var deflator = new Deflate(options); + deflator.push(input, true); + if (deflator.err) { + throw deflator.msg || msg[deflator.err]; + } + return deflator.result; + } + function deflateRaw(input, options) { + options = options || {}; + options.raw = true; + return deflate2(input, options); + } + function gzip(input, options) { + options = options || {}; + options.gzip = true; + return deflate2(input, options); + } + exports.Deflate = Deflate; + exports.deflate = deflate2; + exports.deflateRaw = deflateRaw; + exports.gzip = gzip; + } +}); + +// node_modules/pako/lib/zlib/inffast.js +var require_inffast = __commonJS({ + "node_modules/pako/lib/zlib/inffast.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + var BAD = 30; + var TYPE = 12; + module2.exports = function inflate_fast(strm, start) { + var state; + var _in; + var last2; + var _out; + var beg; + var end; + var dmax; + var wsize; + var whave; + var wnext; + var s_window; + var hold; + var bits; + var lcode; + var dcode; + var lmask; + var dmask; + var here; + var op; + var len; + var dist; + var from; + var from_source; + var input, output; + state = strm.state; + _in = strm.next_in; + input = strm.input; + last2 = _in + (strm.avail_in - 5); + _out = strm.next_out; + output = strm.output; + beg = _out - (start - strm.avail_out); + end = _out + (strm.avail_out - 257); + dmax = state.dmax; + wsize = state.wsize; + whave = state.whave; + wnext = state.wnext; + s_window = state.window; + hold = state.hold; + bits = state.bits; + lcode = state.lencode; + dcode = state.distcode; + lmask = (1 << state.lenbits) - 1; + dmask = (1 << state.distbits) - 1; + top: + do { + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = lcode[hold & lmask]; + dolen: + for (; ; ) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op === 0) { + output[_out++] = here & 65535; + } else if (op & 16) { + len = here & 65535; + op &= 15; + if (op) { + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + len += hold & (1 << op) - 1; + hold >>>= op; + bits -= op; + } + if (bits < 15) { + hold += input[_in++] << bits; + bits += 8; + hold += input[_in++] << bits; + bits += 8; + } + here = dcode[hold & dmask]; + dodist: + for (; ; ) { + op = here >>> 24; + hold >>>= op; + bits -= op; + op = here >>> 16 & 255; + if (op & 16) { + dist = here & 65535; + op &= 15; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + if (bits < op) { + hold += input[_in++] << bits; + bits += 8; + } + } + dist += hold & (1 << op) - 1; + if (dist > dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break top; + } + hold >>>= op; + bits -= op; + op = _out - beg; + if (dist > op) { + op = dist - op; + if (op > whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break top; + } + } + from = 0; + from_source = s_window; + if (wnext === 0) { + from += wsize - op; + if (op < len) { + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } else if (wnext < op) { + from += wsize + wnext - op; + op -= wnext; + if (op < len) { + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = 0; + if (wnext < len) { + op = wnext; + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } + } else { + from += wnext - op; + if (op < len) { + len -= op; + do { + output[_out++] = s_window[from++]; + } while (--op); + from = _out - dist; + from_source = output; + } + } + while (len > 2) { + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + output[_out++] = from_source[from++]; + len -= 3; + } + if (len) { + output[_out++] = from_source[from++]; + if (len > 1) { + output[_out++] = from_source[from++]; + } + } + } else { + from = _out - dist; + do { + output[_out++] = output[from++]; + output[_out++] = output[from++]; + output[_out++] = output[from++]; + len -= 3; + } while (len > 2); + if (len) { + output[_out++] = output[from++]; + if (len > 1) { + output[_out++] = output[from++]; + } + } + } + } else if ((op & 64) === 0) { + here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dodist; + } else { + strm.msg = "invalid distance code"; + state.mode = BAD; + break top; + } + break; + } + } else if ((op & 64) === 0) { + here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; + continue dolen; + } else if (op & 32) { + state.mode = TYPE; + break top; + } else { + strm.msg = "invalid literal/length code"; + state.mode = BAD; + break top; + } + break; + } + } while (_in < last2 && _out < end); + len = bits >> 3; + _in -= len; + bits -= len << 3; + hold &= (1 << bits) - 1; + strm.next_in = _in; + strm.next_out = _out; + strm.avail_in = _in < last2 ? 5 + (last2 - _in) : 5 - (_in - last2); + strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); + state.hold = hold; + state.bits = bits; + return; + }; + } +}); + +// node_modules/pako/lib/zlib/inftrees.js +var require_inftrees = __commonJS({ + "node_modules/pako/lib/zlib/inftrees.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + var utils = require_common(); + var MAXBITS = 15; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + var CODES = 0; + var LENS = 1; + var DISTS = 2; + var lbase = [ + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 13, + 15, + 17, + 19, + 23, + 27, + 31, + 35, + 43, + 51, + 59, + 67, + 83, + 99, + 115, + 131, + 163, + 195, + 227, + 258, + 0, + 0 + ]; + var lext = [ + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 16, + 17, + 17, + 17, + 17, + 18, + 18, + 18, + 18, + 19, + 19, + 19, + 19, + 20, + 20, + 20, + 20, + 21, + 21, + 21, + 21, + 16, + 72, + 78 + ]; + var dbase = [ + 1, + 2, + 3, + 4, + 5, + 7, + 9, + 13, + 17, + 25, + 33, + 49, + 65, + 97, + 129, + 193, + 257, + 385, + 513, + 769, + 1025, + 1537, + 2049, + 3073, + 4097, + 6145, + 8193, + 12289, + 16385, + 24577, + 0, + 0 + ]; + var dext = [ + 16, + 16, + 16, + 16, + 17, + 17, + 18, + 18, + 19, + 19, + 20, + 20, + 21, + 21, + 22, + 22, + 23, + 23, + 24, + 24, + 25, + 25, + 26, + 26, + 27, + 27, + 28, + 28, + 29, + 29, + 64, + 64 + ]; + module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { + var bits = opts.bits; + var len = 0; + var sym = 0; + var min = 0, max = 0; + var root = 0; + var curr = 0; + var drop = 0; + var left = 0; + var used = 0; + var huff = 0; + var incr; + var fill; + var low; + var mask; + var next; + var base = null; + var base_index = 0; + var end; + var count = new utils.Buf16(MAXBITS + 1); + var offs = new utils.Buf16(MAXBITS + 1); + var extra = null; + var extra_index = 0; + var here_bits, here_op, here_val; + for (len = 0; len <= MAXBITS; len++) { + count[len] = 0; + } + for (sym = 0; sym < codes; sym++) { + count[lens[lens_index + sym]]++; + } + root = bits; + for (max = MAXBITS; max >= 1; max--) { + if (count[max] !== 0) { + break; + } + } + if (root > max) { + root = max; + } + if (max === 0) { + table[table_index++] = 1 << 24 | 64 << 16 | 0; + table[table_index++] = 1 << 24 | 64 << 16 | 0; + opts.bits = 1; + return 0; + } + for (min = 1; min < max; min++) { + if (count[min] !== 0) { + break; + } + } + if (root < min) { + root = min; + } + left = 1; + for (len = 1; len <= MAXBITS; len++) { + left <<= 1; + left -= count[len]; + if (left < 0) { + return -1; + } + } + if (left > 0 && (type === CODES || max !== 1)) { + return -1; + } + offs[1] = 0; + for (len = 1; len < MAXBITS; len++) { + offs[len + 1] = offs[len] + count[len]; + } + for (sym = 0; sym < codes; sym++) { + if (lens[lens_index + sym] !== 0) { + work[offs[lens[lens_index + sym]]++] = sym; + } + } + if (type === CODES) { + base = extra = work; + end = 19; + } else if (type === LENS) { + base = lbase; + base_index -= 257; + extra = lext; + extra_index -= 257; + end = 256; + } else { + base = dbase; + extra = dext; + end = -1; + } + huff = 0; + sym = 0; + len = min; + next = table_index; + curr = root; + drop = 0; + low = -1; + used = 1 << root; + mask = used - 1; + if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + return 1; + } + for (; ; ) { + here_bits = len - drop; + if (work[sym] < end) { + here_op = 0; + here_val = work[sym]; + } else if (work[sym] > end) { + here_op = extra[extra_index + work[sym]]; + here_val = base[base_index + work[sym]]; + } else { + here_op = 32 + 64; + here_val = 0; + } + incr = 1 << len - drop; + fill = 1 << curr; + min = fill; + do { + fill -= incr; + table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; + } while (fill !== 0); + incr = 1 << len - 1; + while (huff & incr) { + incr >>= 1; + } + if (incr !== 0) { + huff &= incr - 1; + huff += incr; + } else { + huff = 0; + } + sym++; + if (--count[len] === 0) { + if (len === max) { + break; + } + len = lens[lens_index + work[sym]]; + } + if (len > root && (huff & mask) !== low) { + if (drop === 0) { + drop = root; + } + next += min; + curr = len - drop; + left = 1 << curr; + while (curr + drop < max) { + left -= count[curr + drop]; + if (left <= 0) { + break; + } + curr++; + left <<= 1; + } + used += 1 << curr; + if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { + return 1; + } + low = huff & mask; + table[low] = root << 24 | curr << 16 | next - table_index | 0; + } + } + if (huff !== 0) { + table[next + huff] = len - drop << 24 | 64 << 16 | 0; + } + opts.bits = root; + return 0; + }; + } +}); + +// node_modules/pako/lib/zlib/inflate.js +var require_inflate = __commonJS({ + "node_modules/pako/lib/zlib/inflate.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var utils = require_common(); + var adler32 = require_adler32(); + var crc322 = require_crc322(); + var inflate_fast = require_inffast(); + var inflate_table = require_inftrees(); + var CODES = 0; + var LENS = 1; + var DISTS = 2; + var Z_FINISH = 4; + var Z_BLOCK = 5; + var Z_TREES = 6; + var Z_OK = 0; + var Z_STREAM_END = 1; + var Z_NEED_DICT = 2; + var Z_STREAM_ERROR = -2; + var Z_DATA_ERROR = -3; + var Z_MEM_ERROR = -4; + var Z_BUF_ERROR = -5; + var Z_DEFLATED = 8; + var HEAD = 1; + var FLAGS = 2; + var TIME = 3; + var OS = 4; + var EXLEN = 5; + var EXTRA = 6; + var NAME = 7; + var COMMENT = 8; + var HCRC = 9; + var DICTID = 10; + var DICT = 11; + var TYPE = 12; + var TYPEDO = 13; + var STORED = 14; + var COPY_ = 15; + var COPY = 16; + var TABLE = 17; + var LENLENS = 18; + var CODELENS = 19; + var LEN_ = 20; + var LEN = 21; + var LENEXT = 22; + var DIST = 23; + var DISTEXT = 24; + var MATCH = 25; + var LIT = 26; + var CHECK = 27; + var LENGTH = 28; + var DONE = 29; + var BAD = 30; + var MEM = 31; + var SYNC = 32; + var ENOUGH_LENS = 852; + var ENOUGH_DISTS = 592; + var MAX_WBITS = 15; + var DEF_WBITS = MAX_WBITS; + function zswap32(q) { + return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); + } + function InflateState() { + this.mode = 0; + this.last = false; + this.wrap = 0; + this.havedict = false; + this.flags = 0; + this.dmax = 0; + this.check = 0; + this.total = 0; + this.head = null; + this.wbits = 0; + this.wsize = 0; + this.whave = 0; + this.wnext = 0; + this.window = null; + this.hold = 0; + this.bits = 0; + this.length = 0; + this.offset = 0; + this.extra = 0; + this.lencode = null; + this.distcode = null; + this.lenbits = 0; + this.distbits = 0; + this.ncode = 0; + this.nlen = 0; + this.ndist = 0; + this.have = 0; + this.next = null; + this.lens = new utils.Buf16(320); + this.work = new utils.Buf16(288); + this.lendyn = null; + this.distdyn = null; + this.sane = 0; + this.back = 0; + this.was = 0; + } + function inflateResetKeep(strm) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + strm.total_in = strm.total_out = state.total = 0; + strm.msg = ""; + if (state.wrap) { + strm.adler = state.wrap & 1; + } + state.mode = HEAD; + state.last = 0; + state.havedict = 0; + state.dmax = 32768; + state.head = null; + state.hold = 0; + state.bits = 0; + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS); + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS); + state.sane = 1; + state.back = -1; + return Z_OK; + } + function inflateReset(strm) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + state.wsize = 0; + state.whave = 0; + state.wnext = 0; + return inflateResetKeep(strm); + } + function inflateReset2(strm, windowBits) { + var wrap; + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + if (windowBits < 0) { + wrap = 0; + windowBits = -windowBits; + } else { + wrap = (windowBits >> 4) + 1; + if (windowBits < 48) { + windowBits &= 15; + } + } + if (windowBits && (windowBits < 8 || windowBits > 15)) { + return Z_STREAM_ERROR; + } + if (state.window !== null && state.wbits !== windowBits) { + state.window = null; + } + state.wrap = wrap; + state.wbits = windowBits; + return inflateReset(strm); + } + function inflateInit2(strm, windowBits) { + var ret; + var state; + if (!strm) { + return Z_STREAM_ERROR; + } + state = new InflateState(); + strm.state = state; + state.window = null; + ret = inflateReset2(strm, windowBits); + if (ret !== Z_OK) { + strm.state = null; + } + return ret; + } + function inflateInit(strm) { + return inflateInit2(strm, DEF_WBITS); + } + var virgin = true; + var lenfix; + var distfix; + function fixedtables(state) { + if (virgin) { + var sym; + lenfix = new utils.Buf32(512); + distfix = new utils.Buf32(32); + sym = 0; + while (sym < 144) { + state.lens[sym++] = 8; + } + while (sym < 256) { + state.lens[sym++] = 9; + } + while (sym < 280) { + state.lens[sym++] = 7; + } + while (sym < 288) { + state.lens[sym++] = 8; + } + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 }); + sym = 0; + while (sym < 32) { + state.lens[sym++] = 5; + } + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 }); + virgin = false; + } + state.lencode = lenfix; + state.lenbits = 9; + state.distcode = distfix; + state.distbits = 5; + } + function updatewindow(strm, src, end, copy2) { + var dist; + var state = strm.state; + if (state.window === null) { + state.wsize = 1 << state.wbits; + state.wnext = 0; + state.whave = 0; + state.window = new utils.Buf8(state.wsize); + } + if (copy2 >= state.wsize) { + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0); + state.wnext = 0; + state.whave = state.wsize; + } else { + dist = state.wsize - state.wnext; + if (dist > copy2) { + dist = copy2; + } + utils.arraySet(state.window, src, end - copy2, dist, state.wnext); + copy2 -= dist; + if (copy2) { + utils.arraySet(state.window, src, end - copy2, copy2, 0); + state.wnext = copy2; + state.whave = state.wsize; + } else { + state.wnext += dist; + if (state.wnext === state.wsize) { + state.wnext = 0; + } + if (state.whave < state.wsize) { + state.whave += dist; + } + } + } + return 0; + } + function inflate2(strm, flush2) { + var state; + var input, output; + var next; + var put; + var have, left; + var hold; + var bits; + var _in, _out; + var copy2; + var from; + var from_source; + var here = 0; + var here_bits, here_op, here_val; + var last_bits, last_op, last_val; + var len; + var ret; + var hbuf = new utils.Buf8(4); + var opts; + var n; + var order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; + if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { + return Z_STREAM_ERROR; + } + state = strm.state; + if (state.mode === TYPE) { + state.mode = TYPEDO; + } + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + _in = have; + _out = left; + ret = Z_OK; + inf_leave: + for (; ; ) { + switch (state.mode) { + case HEAD: + if (state.wrap === 0) { + state.mode = TYPEDO; + break; + } + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.wrap & 2 && hold === 35615) { + state.check = 0; + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc322(state.check, hbuf, 2, 0); + hold = 0; + bits = 0; + state.mode = FLAGS; + break; + } + state.flags = 0; + if (state.head) { + state.head.done = false; + } + if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) { + strm.msg = "incorrect header check"; + state.mode = BAD; + break; + } + if ((hold & 15) !== Z_DEFLATED) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + hold >>>= 4; + bits -= 4; + len = (hold & 15) + 8; + if (state.wbits === 0) { + state.wbits = len; + } else if (len > state.wbits) { + strm.msg = "invalid window size"; + state.mode = BAD; + break; + } + state.dmax = 1 << len; + strm.adler = state.check = 1; + state.mode = hold & 512 ? DICTID : TYPE; + hold = 0; + bits = 0; + break; + case FLAGS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.flags = hold; + if ((state.flags & 255) !== Z_DEFLATED) { + strm.msg = "unknown compression method"; + state.mode = BAD; + break; + } + if (state.flags & 57344) { + strm.msg = "unknown header flags set"; + state.mode = BAD; + break; + } + if (state.head) { + state.head.text = hold >> 8 & 1; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc322(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = TIME; + case TIME: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.time = hold; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + hbuf[2] = hold >>> 16 & 255; + hbuf[3] = hold >>> 24 & 255; + state.check = crc322(state.check, hbuf, 4, 0); + } + hold = 0; + bits = 0; + state.mode = OS; + case OS: + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (state.head) { + state.head.xflags = hold & 255; + state.head.os = hold >> 8; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc322(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + state.mode = EXLEN; + case EXLEN: + if (state.flags & 1024) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length = hold; + if (state.head) { + state.head.extra_len = hold; + } + if (state.flags & 512) { + hbuf[0] = hold & 255; + hbuf[1] = hold >>> 8 & 255; + state.check = crc322(state.check, hbuf, 2, 0); + } + hold = 0; + bits = 0; + } else if (state.head) { + state.head.extra = null; + } + state.mode = EXTRA; + case EXTRA: + if (state.flags & 1024) { + copy2 = state.length; + if (copy2 > have) { + copy2 = have; + } + if (copy2) { + if (state.head) { + len = state.head.extra_len - state.length; + if (!state.head.extra) { + state.head.extra = new Array(state.head.extra_len); + } + utils.arraySet(state.head.extra, input, next, copy2, len); + } + if (state.flags & 512) { + state.check = crc322(state.check, input, copy2, next); + } + have -= copy2; + next += copy2; + state.length -= copy2; + } + if (state.length) { + break inf_leave; + } + } + state.length = 0; + state.mode = NAME; + case NAME: + if (state.flags & 2048) { + if (have === 0) { + break inf_leave; + } + copy2 = 0; + do { + len = input[next + copy2++]; + if (state.head && len && state.length < 65536) { + state.head.name += String.fromCharCode(len); + } + } while (len && copy2 < have); + if (state.flags & 512) { + state.check = crc322(state.check, input, copy2, next); + } + have -= copy2; + next += copy2; + if (len) { + break inf_leave; + } + } else if (state.head) { + state.head.name = null; + } + state.length = 0; + state.mode = COMMENT; + case COMMENT: + if (state.flags & 4096) { + if (have === 0) { + break inf_leave; + } + copy2 = 0; + do { + len = input[next + copy2++]; + if (state.head && len && state.length < 65536) { + state.head.comment += String.fromCharCode(len); + } + } while (len && copy2 < have); + if (state.flags & 512) { + state.check = crc322(state.check, input, copy2, next); + } + have -= copy2; + next += copy2; + if (len) { + break inf_leave; + } + } else if (state.head) { + state.head.comment = null; + } + state.mode = HCRC; + case HCRC: + if (state.flags & 512) { + while (bits < 16) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (hold !== (state.check & 65535)) { + strm.msg = "header crc mismatch"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + if (state.head) { + state.head.hcrc = state.flags >> 9 & 1; + state.head.done = true; + } + strm.adler = state.check = 0; + state.mode = TYPE; + break; + case DICTID: + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + strm.adler = state.check = zswap32(hold); + hold = 0; + bits = 0; + state.mode = DICT; + case DICT: + if (state.havedict === 0) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + return Z_NEED_DICT; + } + strm.adler = state.check = 1; + state.mode = TYPE; + case TYPE: + if (flush2 === Z_BLOCK || flush2 === Z_TREES) { + break inf_leave; + } + case TYPEDO: + if (state.last) { + hold >>>= bits & 7; + bits -= bits & 7; + state.mode = CHECK; + break; + } + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.last = hold & 1; + hold >>>= 1; + bits -= 1; + switch (hold & 3) { + case 0: + state.mode = STORED; + break; + case 1: + fixedtables(state); + state.mode = LEN_; + if (flush2 === Z_TREES) { + hold >>>= 2; + bits -= 2; + break inf_leave; + } + break; + case 2: + state.mode = TABLE; + break; + case 3: + strm.msg = "invalid block type"; + state.mode = BAD; + } + hold >>>= 2; + bits -= 2; + break; + case STORED: + hold >>>= bits & 7; + bits -= bits & 7; + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { + strm.msg = "invalid stored block lengths"; + state.mode = BAD; + break; + } + state.length = hold & 65535; + hold = 0; + bits = 0; + state.mode = COPY_; + if (flush2 === Z_TREES) { + break inf_leave; + } + case COPY_: + state.mode = COPY; + case COPY: + copy2 = state.length; + if (copy2) { + if (copy2 > have) { + copy2 = have; + } + if (copy2 > left) { + copy2 = left; + } + if (copy2 === 0) { + break inf_leave; + } + utils.arraySet(output, input, next, copy2, put); + have -= copy2; + next += copy2; + left -= copy2; + put += copy2; + state.length -= copy2; + break; + } + state.mode = TYPE; + break; + case TABLE: + while (bits < 14) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.nlen = (hold & 31) + 257; + hold >>>= 5; + bits -= 5; + state.ndist = (hold & 31) + 1; + hold >>>= 5; + bits -= 5; + state.ncode = (hold & 15) + 4; + hold >>>= 4; + bits -= 4; + if (state.nlen > 286 || state.ndist > 30) { + strm.msg = "too many length or distance symbols"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = LENLENS; + case LENLENS: + while (state.have < state.ncode) { + while (bits < 3) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.lens[order[state.have++]] = hold & 7; + hold >>>= 3; + bits -= 3; + } + while (state.have < 19) { + state.lens[order[state.have++]] = 0; + } + state.lencode = state.lendyn; + state.lenbits = 7; + opts = { bits: state.lenbits }; + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid code lengths set"; + state.mode = BAD; + break; + } + state.have = 0; + state.mode = CODELENS; + case CODELENS: + while (state.have < state.nlen + state.ndist) { + for (; ; ) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_val < 16) { + hold >>>= here_bits; + bits -= here_bits; + state.lens[state.have++] = here_val; + } else { + if (here_val === 16) { + n = here_bits + 2; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + if (state.have === 0) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + len = state.lens[state.have - 1]; + copy2 = 3 + (hold & 3); + hold >>>= 2; + bits -= 2; + } else if (here_val === 17) { + n = here_bits + 3; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy2 = 3 + (hold & 7); + hold >>>= 3; + bits -= 3; + } else { + n = here_bits + 7; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= here_bits; + bits -= here_bits; + len = 0; + copy2 = 11 + (hold & 127); + hold >>>= 7; + bits -= 7; + } + if (state.have + copy2 > state.nlen + state.ndist) { + strm.msg = "invalid bit length repeat"; + state.mode = BAD; + break; + } + while (copy2--) { + state.lens[state.have++] = len; + } + } + } + if (state.mode === BAD) { + break; + } + if (state.lens[256] === 0) { + strm.msg = "invalid code -- missing end-of-block"; + state.mode = BAD; + break; + } + state.lenbits = 9; + opts = { bits: state.lenbits }; + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts); + state.lenbits = opts.bits; + if (ret) { + strm.msg = "invalid literal/lengths set"; + state.mode = BAD; + break; + } + state.distbits = 6; + state.distcode = state.distdyn; + opts = { bits: state.distbits }; + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts); + state.distbits = opts.bits; + if (ret) { + strm.msg = "invalid distances set"; + state.mode = BAD; + break; + } + state.mode = LEN_; + if (flush2 === Z_TREES) { + break inf_leave; + } + case LEN_: + state.mode = LEN; + case LEN: + if (have >= 6 && left >= 258) { + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + inflate_fast(strm, _out); + put = strm.next_out; + output = strm.output; + left = strm.avail_out; + next = strm.next_in; + input = strm.input; + have = strm.avail_in; + hold = state.hold; + bits = state.bits; + if (state.mode === TYPE) { + state.back = -1; + } + break; + } + state.back = 0; + for (; ; ) { + here = state.lencode[hold & (1 << state.lenbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (here_op && (here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (; ; ) { + here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + state.length = here_val; + if (here_op === 0) { + state.mode = LIT; + break; + } + if (here_op & 32) { + state.back = -1; + state.mode = TYPE; + break; + } + if (here_op & 64) { + strm.msg = "invalid literal/length code"; + state.mode = BAD; + break; + } + state.extra = here_op & 15; + state.mode = LENEXT; + case LENEXT: + if (state.extra) { + n = state.extra; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.length += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + state.was = state.length; + state.mode = DIST; + case DIST: + for (; ; ) { + here = state.distcode[hold & (1 << state.distbits) - 1]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if ((here_op & 240) === 0) { + last_bits = here_bits; + last_op = here_op; + last_val = here_val; + for (; ; ) { + here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; + here_bits = here >>> 24; + here_op = here >>> 16 & 255; + here_val = here & 65535; + if (last_bits + here_bits <= bits) { + break; + } + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + hold >>>= last_bits; + bits -= last_bits; + state.back += last_bits; + } + hold >>>= here_bits; + bits -= here_bits; + state.back += here_bits; + if (here_op & 64) { + strm.msg = "invalid distance code"; + state.mode = BAD; + break; + } + state.offset = here_val; + state.extra = here_op & 15; + state.mode = DISTEXT; + case DISTEXT: + if (state.extra) { + n = state.extra; + while (bits < n) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + state.offset += hold & (1 << state.extra) - 1; + hold >>>= state.extra; + bits -= state.extra; + state.back += state.extra; + } + if (state.offset > state.dmax) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + state.mode = MATCH; + case MATCH: + if (left === 0) { + break inf_leave; + } + copy2 = _out - left; + if (state.offset > copy2) { + copy2 = state.offset - copy2; + if (copy2 > state.whave) { + if (state.sane) { + strm.msg = "invalid distance too far back"; + state.mode = BAD; + break; + } + } + if (copy2 > state.wnext) { + copy2 -= state.wnext; + from = state.wsize - copy2; + } else { + from = state.wnext - copy2; + } + if (copy2 > state.length) { + copy2 = state.length; + } + from_source = state.window; + } else { + from_source = output; + from = put - state.offset; + copy2 = state.length; + } + if (copy2 > left) { + copy2 = left; + } + left -= copy2; + state.length -= copy2; + do { + output[put++] = from_source[from++]; + } while (--copy2); + if (state.length === 0) { + state.mode = LEN; + } + break; + case LIT: + if (left === 0) { + break inf_leave; + } + output[put++] = state.length; + left--; + state.mode = LEN; + break; + case CHECK: + if (state.wrap) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold |= input[next++] << bits; + bits += 8; + } + _out -= left; + strm.total_out += _out; + state.total += _out; + if (_out) { + strm.adler = state.check = state.flags ? crc322(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out); + } + _out = left; + if ((state.flags ? hold : zswap32(hold)) !== state.check) { + strm.msg = "incorrect data check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = LENGTH; + case LENGTH: + if (state.wrap && state.flags) { + while (bits < 32) { + if (have === 0) { + break inf_leave; + } + have--; + hold += input[next++] << bits; + bits += 8; + } + if (hold !== (state.total & 4294967295)) { + strm.msg = "incorrect length check"; + state.mode = BAD; + break; + } + hold = 0; + bits = 0; + } + state.mode = DONE; + case DONE: + ret = Z_STREAM_END; + break inf_leave; + case BAD: + ret = Z_DATA_ERROR; + break inf_leave; + case MEM: + return Z_MEM_ERROR; + case SYNC: + default: + return Z_STREAM_ERROR; + } + } + strm.next_out = put; + strm.avail_out = left; + strm.next_in = next; + strm.avail_in = have; + state.hold = hold; + state.bits = bits; + if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush2 !== Z_FINISH)) { + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) { + state.mode = MEM; + return Z_MEM_ERROR; + } + } + _in -= strm.avail_in; + _out -= strm.avail_out; + strm.total_in += _in; + strm.total_out += _out; + state.total += _out; + if (state.wrap && _out) { + strm.adler = state.check = state.flags ? crc322(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out); + } + strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); + if ((_in === 0 && _out === 0 || flush2 === Z_FINISH) && ret === Z_OK) { + ret = Z_BUF_ERROR; + } + return ret; + } + function inflateEnd(strm) { + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + var state = strm.state; + if (state.window) { + state.window = null; + } + strm.state = null; + return Z_OK; + } + function inflateGetHeader(strm, head) { + var state; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + if ((state.wrap & 2) === 0) { + return Z_STREAM_ERROR; + } + state.head = head; + head.done = false; + return Z_OK; + } + function inflateSetDictionary(strm, dictionary) { + var dictLength = dictionary.length; + var state; + var dictid; + var ret; + if (!strm || !strm.state) { + return Z_STREAM_ERROR; + } + state = strm.state; + if (state.wrap !== 0 && state.mode !== DICT) { + return Z_STREAM_ERROR; + } + if (state.mode === DICT) { + dictid = 1; + dictid = adler32(dictid, dictionary, dictLength, 0); + if (dictid !== state.check) { + return Z_DATA_ERROR; + } + } + ret = updatewindow(strm, dictionary, dictLength, dictLength); + if (ret) { + state.mode = MEM; + return Z_MEM_ERROR; + } + state.havedict = 1; + return Z_OK; + } + exports.inflateReset = inflateReset; + exports.inflateReset2 = inflateReset2; + exports.inflateResetKeep = inflateResetKeep; + exports.inflateInit = inflateInit; + exports.inflateInit2 = inflateInit2; + exports.inflate = inflate2; + exports.inflateEnd = inflateEnd; + exports.inflateGetHeader = inflateGetHeader; + exports.inflateSetDictionary = inflateSetDictionary; + exports.inflateInfo = "pako inflate (from Nodeca project)"; + } +}); + +// node_modules/pako/lib/zlib/constants.js +var require_constants = __commonJS({ + "node_modules/pako/lib/zlib/constants.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + module2.exports = { + Z_NO_FLUSH: 0, + Z_PARTIAL_FLUSH: 1, + Z_SYNC_FLUSH: 2, + Z_FULL_FLUSH: 3, + Z_FINISH: 4, + Z_BLOCK: 5, + Z_TREES: 6, + Z_OK: 0, + Z_STREAM_END: 1, + Z_NEED_DICT: 2, + Z_ERRNO: -1, + Z_STREAM_ERROR: -2, + Z_DATA_ERROR: -3, + Z_BUF_ERROR: -5, + Z_NO_COMPRESSION: 0, + Z_BEST_SPEED: 1, + Z_BEST_COMPRESSION: 9, + Z_DEFAULT_COMPRESSION: -1, + Z_FILTERED: 1, + Z_HUFFMAN_ONLY: 2, + Z_RLE: 3, + Z_FIXED: 4, + Z_DEFAULT_STRATEGY: 0, + Z_BINARY: 0, + Z_TEXT: 1, + Z_UNKNOWN: 2, + Z_DEFLATED: 8 + }; + } +}); + +// node_modules/pako/lib/zlib/gzheader.js +var require_gzheader = __commonJS({ + "node_modules/pako/lib/zlib/gzheader.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + function GZheader() { + this.text = 0; + this.time = 0; + this.xflags = 0; + this.os = 0; + this.extra = null; + this.extra_len = 0; + this.name = ""; + this.comment = ""; + this.hcrc = 0; + this.done = false; + } + module2.exports = GZheader; + } +}); + +// node_modules/pako/lib/inflate.js +var require_inflate2 = __commonJS({ + "node_modules/pako/lib/inflate.js"(exports) { + init_polyfill_buffer(); + "use strict"; + var zlib_inflate = require_inflate(); + var utils = require_common(); + var strings = require_strings(); + var c = require_constants(); + var msg = require_messages(); + var ZStream = require_zstream(); + var GZheader = require_gzheader(); + var toString = Object.prototype.toString; + function Inflate(options) { + if (!(this instanceof Inflate)) + return new Inflate(options); + this.options = utils.assign({ + chunkSize: 16384, + windowBits: 0, + to: "" + }, options || {}); + var opt = this.options; + if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { + opt.windowBits = -opt.windowBits; + if (opt.windowBits === 0) { + opt.windowBits = -15; + } + } + if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) { + opt.windowBits += 32; + } + if (opt.windowBits > 15 && opt.windowBits < 48) { + if ((opt.windowBits & 15) === 0) { + opt.windowBits |= 15; + } + } + this.err = 0; + this.msg = ""; + this.ended = false; + this.chunks = []; + this.strm = new ZStream(); + this.strm.avail_out = 0; + var status2 = zlib_inflate.inflateInit2(this.strm, opt.windowBits); + if (status2 !== c.Z_OK) { + throw new Error(msg[status2]); + } + this.header = new GZheader(); + zlib_inflate.inflateGetHeader(this.strm, this.header); + if (opt.dictionary) { + if (typeof opt.dictionary === "string") { + opt.dictionary = strings.string2buf(opt.dictionary); + } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { + opt.dictionary = new Uint8Array(opt.dictionary); + } + if (opt.raw) { + status2 = zlib_inflate.inflateSetDictionary(this.strm, opt.dictionary); + if (status2 !== c.Z_OK) { + throw new Error(msg[status2]); + } + } + } + } + Inflate.prototype.push = function(data, mode) { + var strm = this.strm; + var chunkSize = this.options.chunkSize; + var dictionary = this.options.dictionary; + var status2, _mode; + var next_out_utf8, tail, utf8str; + var allowBufError = false; + if (this.ended) { + return false; + } + _mode = mode === ~~mode ? mode : mode === true ? c.Z_FINISH : c.Z_NO_FLUSH; + if (typeof data === "string") { + strm.input = strings.binstring2buf(data); + } else if (toString.call(data) === "[object ArrayBuffer]") { + strm.input = new Uint8Array(data); + } else { + strm.input = data; + } + strm.next_in = 0; + strm.avail_in = strm.input.length; + do { + if (strm.avail_out === 0) { + strm.output = new utils.Buf8(chunkSize); + strm.next_out = 0; + strm.avail_out = chunkSize; + } + status2 = zlib_inflate.inflate(strm, c.Z_NO_FLUSH); + if (status2 === c.Z_NEED_DICT && dictionary) { + status2 = zlib_inflate.inflateSetDictionary(this.strm, dictionary); + } + if (status2 === c.Z_BUF_ERROR && allowBufError === true) { + status2 = c.Z_OK; + allowBufError = false; + } + if (status2 !== c.Z_STREAM_END && status2 !== c.Z_OK) { + this.onEnd(status2); + this.ended = true; + return false; + } + if (strm.next_out) { + if (strm.avail_out === 0 || status2 === c.Z_STREAM_END || strm.avail_in === 0 && (_mode === c.Z_FINISH || _mode === c.Z_SYNC_FLUSH)) { + if (this.options.to === "string") { + next_out_utf8 = strings.utf8border(strm.output, strm.next_out); + tail = strm.next_out - next_out_utf8; + utf8str = strings.buf2string(strm.output, next_out_utf8); + strm.next_out = tail; + strm.avail_out = chunkSize - tail; + if (tail) { + utils.arraySet(strm.output, strm.output, next_out_utf8, tail, 0); + } + this.onData(utf8str); + } else { + this.onData(utils.shrinkBuf(strm.output, strm.next_out)); + } + } + } + if (strm.avail_in === 0 && strm.avail_out === 0) { + allowBufError = true; + } + } while ((strm.avail_in > 0 || strm.avail_out === 0) && status2 !== c.Z_STREAM_END); + if (status2 === c.Z_STREAM_END) { + _mode = c.Z_FINISH; + } + if (_mode === c.Z_FINISH) { + status2 = zlib_inflate.inflateEnd(this.strm); + this.onEnd(status2); + this.ended = true; + return status2 === c.Z_OK; + } + if (_mode === c.Z_SYNC_FLUSH) { + this.onEnd(c.Z_OK); + strm.avail_out = 0; + return true; + } + return true; + }; + Inflate.prototype.onData = function(chunk) { + this.chunks.push(chunk); + }; + Inflate.prototype.onEnd = function(status2) { + if (status2 === c.Z_OK) { + if (this.options.to === "string") { + this.result = this.chunks.join(""); + } else { + this.result = utils.flattenChunks(this.chunks); + } + } + this.chunks = []; + this.err = status2; + this.msg = this.strm.msg; + }; + function inflate2(input, options) { + var inflator = new Inflate(options); + inflator.push(input, true); + if (inflator.err) { + throw inflator.msg || msg[inflator.err]; + } + return inflator.result; + } + function inflateRaw(input, options) { + options = options || {}; + options.raw = true; + return inflate2(input, options); + } + exports.Inflate = Inflate; + exports.inflate = inflate2; + exports.inflateRaw = inflateRaw; + exports.ungzip = inflate2; + } +}); + +// node_modules/pako/index.js +var require_pako = __commonJS({ + "node_modules/pako/index.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + var assign2 = require_common().assign; + var deflate2 = require_deflate2(); + var inflate2 = require_inflate2(); + var constants = require_constants(); + var pako2 = {}; + assign2(pako2, deflate2, inflate2, constants); + module2.exports = pako2; + } +}); + +// node_modules/ignore/index.js +var require_ignore = __commonJS({ + "node_modules/ignore/index.js"(exports, module2) { + init_polyfill_buffer(); + function makeArray(subject) { + return Array.isArray(subject) ? subject : [subject]; + } + var EMPTY = ""; + var SPACE = " "; + var ESCAPE = "\\"; + var REGEX_TEST_BLANK_LINE = /^\s+$/; + var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; + var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; + var REGEX_SPLITALL_CRLF = /\r?\n/g; + var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; + var SLASH = "/"; + var KEY_IGNORE = typeof Symbol !== "undefined" ? Symbol.for("node-ignore") : "node-ignore"; + var define2 = (object, key2, value) => Object.defineProperty(object, key2, { value }); + var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; + var RETURN_FALSE = () => false; + var sanitizeRange = (range) => range.replace(REGEX_REGEXP_RANGE, (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY); + var cleanRangeBackSlash = (slashes) => { + const { length } = slashes; + return slashes.slice(0, length - length % 2); + }; + var REPLACERS = [ + [ + /\\?\s+$/, + (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY + ], + [ + /\\\s/g, + () => SPACE + ], + [ + /[\\$.|*+(){^]/g, + (match) => `\\${match}` + ], + [ + /(?!\\)\?/g, + () => "[^/]" + ], + [ + /^\//, + () => "^" + ], + [ + /\//g, + () => "\\/" + ], + [ + /^\^*\\\*\\\*\\\//, + () => "^(?:.*\\/)?" + ], + [ + /^(?=[^^])/, + function startingReplacer() { + return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; + } + ], + [ + /\\\/\\\*\\\*(?=\\\/|$)/g, + (_, index2, str) => index2 + 6 < str.length ? "(?:\\/[^\\/]+)*" : "\\/.+" + ], + [ + /(^|[^\\]+)\\\*(?=.+)/g, + (_, p1) => `${p1}[^\\/]*` + ], + [ + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + [ + /\\\\/g, + () => ESCAPE + ], + [ + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]" + ], + [ + /(?:[^*])$/, + (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` + ], + [ + /(\^|\\\/)?\\\*$/, + (_, p1) => { + const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; + return `${prefix}(?=$|\\/$)`; + } + ] + ]; + var regexCache = Object.create(null); + var makeRegex = (pattern, ignoreCase) => { + let source = regexCache[pattern]; + if (!source) { + source = REPLACERS.reduce((prev, current) => prev.replace(current[0], current[1].bind(pattern)), pattern); + regexCache[pattern] = source; + } + return ignoreCase ? new RegExp(source, "i") : new RegExp(source); + }; + var isString = (subject) => typeof subject === "string"; + var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && pattern.indexOf("#") !== 0; + var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF); + var IgnoreRule = class { + constructor(origin, pattern, negative, regex2) { + this.origin = origin; + this.pattern = pattern; + this.negative = negative; + this.regex = regex2; + } + }; + var createRule = (pattern, ignoreCase) => { + const origin = pattern; + let negative = false; + if (pattern.indexOf("!") === 0) { + negative = true; + pattern = pattern.substr(1); + } + pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); + const regex2 = makeRegex(pattern, ignoreCase); + return new IgnoreRule(origin, pattern, negative, regex2); + }; + var throwError = (message, Ctor) => { + throw new Ctor(message); + }; + var checkPath = (path2, originalPath, doThrow) => { + if (!isString(path2)) { + return doThrow(`path must be a string, but got \`${originalPath}\``, TypeError); + } + if (!path2) { + return doThrow(`path must not be empty`, TypeError); + } + if (checkPath.isNotRelative(path2)) { + const r = "`path.relative()`d"; + return doThrow(`path should be a ${r} string, but got "${originalPath}"`, RangeError); + } + return true; + }; + var isNotRelative = (path2) => REGEX_TEST_INVALID_PATH.test(path2); + checkPath.isNotRelative = isNotRelative; + checkPath.convert = (p) => p; + var Ignore = class { + constructor({ + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false + } = {}) { + define2(this, KEY_IGNORE, true); + this._rules = []; + this._ignoreCase = ignoreCase; + this._allowRelativePaths = allowRelativePaths; + this._initCache(); + } + _initCache() { + this._ignoreCache = Object.create(null); + this._testCache = Object.create(null); + } + _addPattern(pattern) { + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } + } + add(pattern) { + this._added = false; + makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this); + if (this._added) { + this._initCache(); + } + return this; + } + addPattern(pattern) { + return this.add(pattern); + } + _testOne(path2, checkUnignored) { + let ignored = false; + let unignored = false; + this._rules.forEach((rule) => { + const { negative } = rule; + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + const matched = rule.regex.test(path2); + if (matched) { + ignored = !negative; + unignored = negative; + } + }); + return { + ignored, + unignored + }; + } + _test(originalPath, cache, checkUnignored, slices) { + const path2 = originalPath && checkPath.convert(originalPath); + checkPath(path2, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError); + return this._t(path2, cache, checkUnignored, slices); + } + _t(path2, cache, checkUnignored, slices) { + if (path2 in cache) { + return cache[path2]; + } + if (!slices) { + slices = path2.split(SLASH); + } + slices.pop(); + if (!slices.length) { + return cache[path2] = this._testOne(path2, checkUnignored); + } + const parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices); + return cache[path2] = parent.ignored ? parent : this._testOne(path2, checkUnignored); + } + ignores(path2) { + return this._test(path2, this._ignoreCache, false).ignored; + } + createFilter() { + return (path2) => !this.ignores(path2); + } + filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } + test(path2) { + return this._test(path2, this._testCache, true); + } + }; + var factory = (options) => new Ignore(options); + var isPathValid = (path2) => checkPath(path2 && checkPath.convert(path2), path2, RETURN_FALSE); + factory.isPathValid = isPathValid; + factory.default = factory; + module2.exports = factory; + if (typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) { + const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/"); + checkPath.convert = makePosix; + const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = (path2) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path2) || isNotRelative(path2); + } + } +}); + +// node_modules/pify/index.js +var require_pify = __commonJS({ + "node_modules/pify/index.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + var processFn = (fn, options) => function(...args) { + const P = options.promiseModule; + return new P((resolve, reject) => { + if (options.multiArgs) { + args.push((...result) => { + if (options.errorFirst) { + if (result[0]) { + reject(result); + } else { + result.shift(); + resolve(result); + } + } else { + resolve(result); + } + }); + } else if (options.errorFirst) { + args.push((error, result) => { + if (error) { + reject(error); + } else { + resolve(result); + } + }); + } else { + args.push(resolve); + } + fn.apply(this, args); + }); + }; + module2.exports = (input, options) => { + options = Object.assign({ + exclude: [/.+(Sync|Stream)$/], + errorFirst: true, + promiseModule: Promise + }, options); + const objType = typeof input; + if (!(input !== null && (objType === "object" || objType === "function"))) { + throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${input === null ? "null" : objType}\``); + } + const filter = (key2) => { + const match = (pattern) => typeof pattern === "string" ? key2 === pattern : pattern.test(key2); + return options.include ? options.include.some(match) : !options.exclude.some(match); + }; + let ret; + if (objType === "function") { + ret = function(...args) { + return options.excludeMain ? input(...args) : processFn(input, options).apply(this, args); + }; + } else { + ret = Object.create(Object.getPrototypeOf(input)); + } + for (const key2 in input) { + const property = input[key2]; + ret[key2] = typeof property === "function" && filter(key2) ? processFn(property, options) : property; + } + return ret; + }; + } +}); + +// node_modules/clean-git-ref/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/clean-git-ref/lib/index.js"(exports, module2) { + init_polyfill_buffer(); + "use strict"; + function escapeRegExp(string) { + return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + } + function replaceAll(str, search, replacement) { + search = search instanceof RegExp ? search : new RegExp(escapeRegExp(search), "g"); + return str.replace(search, replacement); + } + var CleanGitRef = { + clean: function clean(value) { + if (typeof value !== "string") { + throw new Error("Expected a string, received: " + value); + } + value = replaceAll(value, "./", "/"); + value = replaceAll(value, "..", "."); + value = replaceAll(value, " ", "-"); + value = replaceAll(value, /^[~^:?*\\\-]/g, ""); + value = replaceAll(value, /[~^:?*\\]/g, "-"); + value = replaceAll(value, /[~^:?*\\\-]$/g, ""); + value = replaceAll(value, "@{", "-"); + value = replaceAll(value, /\.$/g, ""); + value = replaceAll(value, /\/$/g, ""); + value = replaceAll(value, /\.lock$/g, ""); + return value; + } + }; + module2.exports = CleanGitRef; + } +}); + +// node_modules/diff3/onp.js +var require_onp = __commonJS({ + "node_modules/diff3/onp.js"(exports, module2) { + init_polyfill_buffer(); + module2.exports = function(a_, b_) { + var a = a_, b = b_, m = a.length, n = b.length, reverse = false, ed = null, offset = m + 1, path2 = [], pathposi = [], ses = [], lcs = "", SES_DELETE = -1, SES_COMMON = 0, SES_ADD = 1; + var tmp1, tmp2; + var init3 = function() { + if (m >= n) { + tmp1 = a; + tmp2 = m; + a = b; + b = tmp1; + m = n; + n = tmp2; + reverse = true; + offset = m + 1; + } + }; + var P = function(x, y, k) { + return { + "x": x, + "y": y, + "k": k + }; + }; + var seselem = function(elem, t) { + return { + "elem": elem, + "t": t + }; + }; + var snake = function(k, p, pp) { + var r, x, y; + if (p > pp) { + r = path2[k - 1 + offset]; + } else { + r = path2[k + 1 + offset]; + } + y = Math.max(p, pp); + x = y - k; + while (x < m && y < n && a[x] === b[y]) { + ++x; + ++y; + } + path2[k + offset] = pathposi.length; + pathposi[pathposi.length] = new P(x, y, r); + return y; + }; + var recordseq = function(epc) { + var x_idx, y_idx, px_idx, py_idx, i; + x_idx = y_idx = 1; + px_idx = py_idx = 0; + for (i = epc.length - 1; i >= 0; --i) { + while (px_idx < epc[i].x || py_idx < epc[i].y) { + if (epc[i].y - epc[i].x > py_idx - px_idx) { + if (reverse) { + ses[ses.length] = new seselem(b[py_idx], SES_DELETE); + } else { + ses[ses.length] = new seselem(b[py_idx], SES_ADD); + } + ++y_idx; + ++py_idx; + } else if (epc[i].y - epc[i].x < py_idx - px_idx) { + if (reverse) { + ses[ses.length] = new seselem(a[px_idx], SES_ADD); + } else { + ses[ses.length] = new seselem(a[px_idx], SES_DELETE); + } + ++x_idx; + ++px_idx; + } else { + ses[ses.length] = new seselem(a[px_idx], SES_COMMON); + lcs += a[px_idx]; + ++x_idx; + ++y_idx; + ++px_idx; + ++py_idx; + } + } + } + }; + init3(); + return { + SES_DELETE: -1, + SES_COMMON: 0, + SES_ADD: 1, + editdistance: function() { + return ed; + }, + getlcs: function() { + return lcs; + }, + getses: function() { + return ses; + }, + compose: function() { + var delta, size, fp, p, r, epc, i, k; + delta = n - m; + size = m + n + 3; + fp = {}; + for (i = 0; i < size; ++i) { + fp[i] = -1; + path2[i] = -1; + } + p = -1; + do { + ++p; + for (k = -p; k <= delta - 1; ++k) { + fp[k + offset] = snake(k, fp[k - 1 + offset] + 1, fp[k + 1 + offset]); + } + for (k = delta + p; k >= delta + 1; --k) { + fp[k + offset] = snake(k, fp[k - 1 + offset] + 1, fp[k + 1 + offset]); + } + fp[delta + offset] = snake(delta, fp[delta - 1 + offset] + 1, fp[delta + 1 + offset]); + } while (fp[delta + offset] !== n); + ed = delta + 2 * p; + r = path2[delta + offset]; + epc = []; + while (r !== -1) { + epc[epc.length] = new P(pathposi[r].x, pathposi[r].y, null); + r = pathposi[r].k; + } + recordseq(epc); + } + }; + }; + } +}); + +// node_modules/diff3/diff3.js +var require_diff3 = __commonJS({ + "node_modules/diff3/diff3.js"(exports, module2) { + init_polyfill_buffer(); + var onp = require_onp(); + function longestCommonSubsequence(file1, file2) { + var diff2 = new onp(file1, file2); + diff2.compose(); + var ses = diff2.getses(); + var root; + var prev; + var file1RevIdx = file1.length - 1, file2RevIdx = file2.length - 1; + for (var i = ses.length - 1; i >= 0; --i) { + if (ses[i].t === diff2.SES_COMMON) { + if (prev) { + prev.chain = { + file1index: file1RevIdx, + file2index: file2RevIdx, + chain: null + }; + prev = prev.chain; + } else { + root = { + file1index: file1RevIdx, + file2index: file2RevIdx, + chain: null + }; + prev = root; + } + file1RevIdx--; + file2RevIdx--; + } else if (ses[i].t === diff2.SES_DELETE) { + file1RevIdx--; + } else if (ses[i].t === diff2.SES_ADD) { + file2RevIdx--; + } + } + var tail = { + file1index: -1, + file2index: -1, + chain: null + }; + if (!prev) { + return tail; + } + prev.chain = tail; + return root; + } + function diffIndices(file1, file2) { + var result = []; + var tail1 = file1.length; + var tail2 = file2.length; + for (var candidate = longestCommonSubsequence(file1, file2); candidate !== null; candidate = candidate.chain) { + var mismatchLength1 = tail1 - candidate.file1index - 1; + var mismatchLength2 = tail2 - candidate.file2index - 1; + tail1 = candidate.file1index; + tail2 = candidate.file2index; + if (mismatchLength1 || mismatchLength2) { + result.push({ + file1: [tail1 + 1, mismatchLength1], + file2: [tail2 + 1, mismatchLength2] + }); + } + } + result.reverse(); + return result; + } + function diff3MergeIndices(a, o, b) { + var i; + var m1 = diffIndices(o, a); + var m2 = diffIndices(o, b); + var hunks = []; + function addHunk(h, side2) { + hunks.push([h.file1[0], side2, h.file1[1], h.file2[0], h.file2[1]]); + } + for (i = 0; i < m1.length; i++) { + addHunk(m1[i], 0); + } + for (i = 0; i < m2.length; i++) { + addHunk(m2[i], 2); + } + hunks.sort(function(x, y) { + return x[0] - y[0]; + }); + var result = []; + var commonOffset = 0; + function copyCommon(targetOffset) { + if (targetOffset > commonOffset) { + result.push([1, commonOffset, targetOffset - commonOffset]); + commonOffset = targetOffset; + } + } + for (var hunkIndex = 0; hunkIndex < hunks.length; hunkIndex++) { + var firstHunkIndex = hunkIndex; + var hunk = hunks[hunkIndex]; + var regionLhs = hunk[0]; + var regionRhs = regionLhs + hunk[2]; + while (hunkIndex < hunks.length - 1) { + var maybeOverlapping = hunks[hunkIndex + 1]; + var maybeLhs = maybeOverlapping[0]; + if (maybeLhs > regionRhs) + break; + regionRhs = Math.max(regionRhs, maybeLhs + maybeOverlapping[2]); + hunkIndex++; + } + copyCommon(regionLhs); + if (firstHunkIndex == hunkIndex) { + if (hunk[4] > 0) { + result.push([hunk[1], hunk[3], hunk[4]]); + } + } else { + var regions = { + 0: [a.length, -1, o.length, -1], + 2: [b.length, -1, o.length, -1] + }; + for (i = firstHunkIndex; i <= hunkIndex; i++) { + hunk = hunks[i]; + var side = hunk[1]; + var r = regions[side]; + var oLhs = hunk[0]; + var oRhs = oLhs + hunk[2]; + var abLhs = hunk[3]; + var abRhs = abLhs + hunk[4]; + r[0] = Math.min(abLhs, r[0]); + r[1] = Math.max(abRhs, r[1]); + r[2] = Math.min(oLhs, r[2]); + r[3] = Math.max(oRhs, r[3]); + } + var aLhs = regions[0][0] + (regionLhs - regions[0][2]); + var aRhs = regions[0][1] + (regionRhs - regions[0][3]); + var bLhs = regions[2][0] + (regionLhs - regions[2][2]); + var bRhs = regions[2][1] + (regionRhs - regions[2][3]); + result.push([ + -1, + aLhs, + aRhs - aLhs, + regionLhs, + regionRhs - regionLhs, + bLhs, + bRhs - bLhs + ]); + } + commonOffset = regionRhs; + } + copyCommon(o.length); + return result; + } + function diff3Merge2(a, o, b) { + var result = []; + var files = [a, o, b]; + var indices = diff3MergeIndices(a, o, b); + var okLines = []; + function flushOk() { + if (okLines.length) { + result.push({ + ok: okLines + }); + } + okLines = []; + } + function pushOk(xs) { + for (var j = 0; j < xs.length; j++) { + okLines.push(xs[j]); + } + } + function isTrueConflict(rec) { + if (rec[2] != rec[6]) + return true; + var aoff = rec[1]; + var boff = rec[5]; + for (var j = 0; j < rec[2]; j++) { + if (a[j + aoff] != b[j + boff]) + return true; + } + return false; + } + for (var i = 0; i < indices.length; i++) { + var x = indices[i]; + var side = x[0]; + if (side == -1) { + if (!isTrueConflict(x)) { + pushOk(files[0].slice(x[1], x[1] + x[2])); + } else { + flushOk(); + result.push({ + conflict: { + a: a.slice(x[1], x[1] + x[2]), + aIndex: x[1], + o: o.slice(x[3], x[3] + x[4]), + oIndex: x[3], + b: b.slice(x[5], x[5] + x[6]), + bIndex: x[5] + } + }); + } + } else { + pushOk(files[side].slice(x[1], x[1] + x[2])); + } + } + flushOk(); + return result; + } + module2.exports = diff3Merge2; + } +}); // node_modules/ms/index.js var require_ms = __commonJS({ "node_modules/ms/index.js"(exports, module2) { + init_polyfill_buffer(); var s = 1e3; var m = s * 60; var h = m * 60; @@ -80,13 +7238,13 @@ var require_ms = __commonJS({ options = options || {}; var type = typeof val; if (type === "string" && val.length > 0) { - return parse(val); + return parse2(val); } else if (type === "number" && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(val)); }; - function parse(str) { + function parse2(str) { str = String(str); if (str.length > 100) { return; @@ -180,8 +7338,9 @@ var require_ms = __commonJS({ }); // node_modules/debug/src/common.js -var require_common = __commonJS({ +var require_common2 = __commonJS({ "node_modules/debug/src/common.js"(exports, module2) { + init_polyfill_buffer(); function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; @@ -226,18 +7385,18 @@ var require_common = __commonJS({ if (typeof args[0] !== "string") { args.unshift("%O"); } - let index = 0; + let index2 = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { if (match === "%%") { return "%"; } - index++; + index2++; const formatter = createDebug.formatters[format]; if (typeof formatter === "function") { - const val = args[index]; + const val = args[index2]; match = formatter.call(self3, val); - args.splice(index, 1); - index--; + args.splice(index2, 1); + index2--; } return match; }); @@ -345,6 +7504,7 @@ var require_common = __commonJS({ // node_modules/debug/src/browser.js var require_browser = __commonJS({ "node_modules/debug/src/browser.js"(exports, module2) { + init_polyfill_buffer(); exports.formatArgs = formatArgs; exports.save = save; exports.load = load; @@ -453,15 +7613,15 @@ var require_browser = __commonJS({ } const c = "color: " + this.color; args.splice(1, 0, c, "color: inherit"); - let index = 0; + let index2 = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match) => { if (match === "%%") { return; } - index++; + index2++; if (match === "%c") { - lastC = index; + lastC = index2; } }); args.splice(lastC, 0, c); @@ -495,7 +7655,7 @@ var require_browser = __commonJS({ } catch (error) { } } - module2.exports = require_common()(exports); + module2.exports = require_common2()(exports); var { formatters } = module2.exports; formatters.j = function(v) { try { @@ -507,339 +7667,43 @@ var require_browser = __commonJS({ } }); -// node_modules/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports, module2) { - "use strict"; - module2.exports = (flag, argv = process.argv) => { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); - }; - } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports, module2) { - "use strict"; - var os = require("os"); - var tty = require("tty"); - var hasFlag = require_has_flag(); - var { env } = process; - var forceColor; - if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - forceColor = 0; - } else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - forceColor = 1; - } - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - forceColor = 1; - } else if (env.FORCE_COLOR === "false") { - forceColor = 0; - } else { - forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3); - } - } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; - } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (process.platform === "win32") { - const osRelease = os.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": - return version >= 3 ? 3 : 2; - case "Apple_Terminal": - return 2; - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; - } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) - }; - } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports, module2) { - var tty = require("tty"); - var util = require("util"); - exports.init = init2; - exports.log = log; - exports.formatArgs = formatArgs; - exports.save = save; - exports.load = load; - exports.useColors = useColors; - exports.destroy = util.deprecate(() => { - }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."); - exports.colors = [6, 2, 3, 4, 5, 1]; - try { - const supportsColor = require_supports_color(); - if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { - exports.colors = [ - 20, - 21, - 26, - 27, - 32, - 33, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 56, - 57, - 62, - 63, - 68, - 69, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 92, - 93, - 98, - 99, - 112, - 113, - 128, - 129, - 134, - 135, - 148, - 149, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 178, - 179, - 184, - 185, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 214, - 215, - 220, - 221 - ]; - } - } catch (error) { - } - exports.inspectOpts = Object.keys(process.env).filter((key2) => { - return /^debug_/i.test(key2); - }).reduce((obj, key2) => { - const prop = key2.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => { - return k.toUpperCase(); - }); - let val = process.env[key2]; - if (/^(yes|on|true|enabled)$/i.test(val)) { - val = true; - } else if (/^(no|off|false|disabled)$/i.test(val)) { - val = false; - } else if (val === "null") { - val = null; - } else { - val = Number(val); - } - obj[prop] = val; - return obj; - }, {}); - function useColors() { - return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd); - } - function formatArgs(args) { - const { namespace: name, useColors: useColors2 } = this; - if (useColors2) { - const c = this.color; - const colorCode = "[3" + (c < 8 ? c : "8;5;" + c); - const prefix = ` ${colorCode};1m${name} `; - args[0] = prefix + args[0].split("\n").join("\n" + prefix); - args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + ""); - } else { - args[0] = getDate() + name + " " + args[0]; - } - } - function getDate() { - if (exports.inspectOpts.hideDate) { - return ""; - } - return new Date().toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.format(...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } - } - function load() { - return process.env.DEBUG; - } - function init2(debug2) { - debug2.inspectOpts = {}; - const keys = Object.keys(exports.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug2.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; - } - } - module2.exports = require_common()(exports); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); - }; - } -}); - -// node_modules/debug/src/index.js -var require_src = __commonJS({ - "node_modules/debug/src/index.js"(exports, module2) { - if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) { - module2.exports = require_browser(); - } else { - module2.exports = require_node(); - } - } -}); - // node_modules/@kwsites/file-exists/dist/src/index.js -var require_src2 = __commonJS({ +var require_src = __commonJS({ "node_modules/@kwsites/file-exists/dist/src/index.js"(exports) { + init_polyfill_buffer(); "use strict"; - var __importDefault2 = exports && exports.__importDefault || function(mod) { + var __importDefault = exports && exports.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var fs_1 = require("fs"); - var debug_1 = __importDefault2(require_src()); - var log = debug_1.default("@kwsites/file-exists"); - function check(path3, isFile, isDirectory) { - log(`checking %s`, path3); + var debug_1 = __importDefault(require_browser()); + var log2 = debug_1.default("@kwsites/file-exists"); + function check(path2, isFile, isDirectory) { + log2(`checking %s`, path2); try { - const stat = fs_1.statSync(path3); + const stat = fs_1.statSync(path2); if (stat.isFile() && isFile) { - log(`[OK] path represents a file`); + log2(`[OK] path represents a file`); return true; } if (stat.isDirectory() && isDirectory) { - log(`[OK] path represents a directory`); + log2(`[OK] path represents a directory`); return true; } - log(`[FAIL] path represents something other than a file or directory`); + log2(`[FAIL] path represents something other than a file or directory`); return false; } catch (e) { if (e.code === "ENOENT") { - log(`[FAIL] path is not accessible: %o`, e); + log2(`[FAIL] path is not accessible: %o`, e); return false; } - log(`[FATAL] %o`, e); + log2(`[FATAL] %o`, e); throw e; } } - function exists2(path3, type = exports.READABLE) { - return check(path3, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0); + function exists2(path2, type = exports.READABLE) { + return check(path2, (type & exports.FILE) > 0, (type & exports.FOLDER) > 0); } exports.exists = exists2; exports.FILE = 1; @@ -851,6 +7715,7 @@ var require_src2 = __commonJS({ // node_modules/@kwsites/file-exists/dist/index.js var require_dist = __commonJS({ "node_modules/@kwsites/file-exists/dist/index.js"(exports) { + init_polyfill_buffer(); "use strict"; function __export3(m) { for (var p in m) @@ -858,20 +7723,21 @@ var require_dist = __commonJS({ exports[p] = m[p]; } Object.defineProperty(exports, "__esModule", { value: true }); - __export3(require_src2()); + __export3(require_src()); } }); // node_modules/@kwsites/promise-deferred/dist/index.js var require_dist2 = __commonJS({ "node_modules/@kwsites/promise-deferred/dist/index.js"(exports) { + init_polyfill_buffer(); "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createDeferred = exports.deferred = void 0; function deferred2() { let done; let fail; - let status = "pending"; + let status2 = "pending"; const promise2 = new Promise((_done, _fail) => { done = _done; fail = _fail; @@ -879,22 +7745,22 @@ var require_dist2 = __commonJS({ return { promise: promise2, done(result) { - if (status === "pending") { - status = "resolved"; + if (status2 === "pending") { + status2 = "resolved"; done(result); } }, fail(error) { - if (status === "pending") { - status = "rejected"; + if (status2 === "pending") { + status2 = "rejected"; fail(error); } }, get fulfilled() { - return status !== "pending"; + return status2 !== "pending"; }, get status() { - return status; + return status2; } }; } @@ -904,2835 +7770,13 @@ var require_dist2 = __commonJS({ } }); -// node_modules/diff2html/lib/types.js -var require_types = __commonJS({ - "node_modules/diff2html/lib/types.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.DiffStyleType = exports.LineMatchingType = exports.OutputFormatType = exports.LineType = void 0; - var LineType; - (function(LineType2) { - LineType2["INSERT"] = "insert"; - LineType2["DELETE"] = "delete"; - LineType2["CONTEXT"] = "context"; - })(LineType = exports.LineType || (exports.LineType = {})); - exports.OutputFormatType = { - LINE_BY_LINE: "line-by-line", - SIDE_BY_SIDE: "side-by-side" - }; - exports.LineMatchingType = { - LINES: "lines", - WORDS: "words", - NONE: "none" - }; - exports.DiffStyleType = { - WORD: "word", - CHAR: "char" - }; - } -}); - -// node_modules/diff2html/lib/utils.js -var require_utils = __commonJS({ - "node_modules/diff2html/lib/utils.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.hashCode = exports.unifyPath = exports.escapeForRegExp = void 0; - var specials = [ - "-", - "[", - "]", - "/", - "{", - "}", - "(", - ")", - "*", - "+", - "?", - ".", - "\\", - "^", - "$", - "|" - ]; - var regex = RegExp("[" + specials.join("\\") + "]", "g"); - function escapeForRegExp(str) { - return str.replace(regex, "\\$&"); - } - exports.escapeForRegExp = escapeForRegExp; - function unifyPath(path3) { - return path3 ? path3.replace(/\\/g, "/") : path3; - } - exports.unifyPath = unifyPath; - function hashCode(text2) { - var i, chr, len; - var hash2 = 0; - for (i = 0, len = text2.length; i < len; i++) { - chr = text2.charCodeAt(i); - hash2 = (hash2 << 5) - hash2 + chr; - hash2 |= 0; - } - return hash2; - } - exports.hashCode = hashCode; - } -}); - -// node_modules/diff2html/lib/diff-parser.js -var require_diff_parser = __commonJS({ - "node_modules/diff2html/lib/diff-parser.js"(exports) { - "use strict"; - var __spreadArray2 = exports && exports.__spreadArray || function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.parse = void 0; - var types_1 = require_types(); - var utils_1 = require_utils(); - function getExtension(filename, language) { - var filenameParts = filename.split("."); - return filenameParts.length > 1 ? filenameParts[filenameParts.length - 1] : language; - } - function startsWithAny(str, prefixes) { - return prefixes.reduce(function(startsWith, prefix) { - return startsWith || str.startsWith(prefix); - }, false); - } - var baseDiffFilenamePrefixes = ["a/", "b/", "i/", "w/", "c/", "o/"]; - function getFilename(line, linePrefix, extraPrefix) { - var prefixes = extraPrefix !== void 0 ? __spreadArray2(__spreadArray2([], baseDiffFilenamePrefixes, true), [extraPrefix], false) : baseDiffFilenamePrefixes; - var FilenameRegExp = linePrefix ? new RegExp("^".concat((0, utils_1.escapeForRegExp)(linePrefix), ' "?(.+?)"?$')) : new RegExp('^"?(.+?)"?$'); - var _a2 = FilenameRegExp.exec(line) || [], _b = _a2[1], filename = _b === void 0 ? "" : _b; - var matchingPrefix = prefixes.find(function(p) { - return filename.indexOf(p) === 0; - }); - var fnameWithoutPrefix = matchingPrefix ? filename.slice(matchingPrefix.length) : filename; - return fnameWithoutPrefix.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/, ""); - } - function getSrcFilename(line, srcPrefix) { - return getFilename(line, "---", srcPrefix); - } - function getDstFilename(line, dstPrefix) { - return getFilename(line, "+++", dstPrefix); - } - function parse(diffInput, config) { - if (config === void 0) { - config = {}; - } - var files = []; - var currentFile = null; - var currentBlock = null; - var oldLine = null; - var oldLine2 = null; - var newLine = null; - var possibleOldName = null; - var possibleNewName = null; - var oldFileNameHeader = "--- "; - var newFileNameHeader = "+++ "; - var hunkHeaderPrefix = "@@"; - var oldMode = /^old mode (\d{6})/; - var newMode = /^new mode (\d{6})/; - var deletedFileMode = /^deleted file mode (\d{6})/; - var newFileMode = /^new file mode (\d{6})/; - var copyFrom = /^copy from "?(.+)"?/; - var copyTo = /^copy to "?(.+)"?/; - var renameFrom = /^rename from "?(.+)"?/; - var renameTo = /^rename to "?(.+)"?/; - var similarityIndex = /^similarity index (\d+)%/; - var dissimilarityIndex = /^dissimilarity index (\d+)%/; - var index = /^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/; - var binaryFiles = /^Binary files (.*) and (.*) differ/; - var binaryDiff = /^GIT binary patch/; - var combinedIndex = /^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/; - var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; - var combinedNewFile = /^new file mode (\d{6})/; - var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/; - var diffLines = diffInput.replace(/\\ No newline at end of file/g, "").replace(/\r\n?/g, "\n").split("\n"); - function saveBlock() { - if (currentBlock !== null && currentFile !== null) { - currentFile.blocks.push(currentBlock); - currentBlock = null; - } - } - function saveFile() { - if (currentFile !== null) { - if (!currentFile.oldName && possibleOldName !== null) { - currentFile.oldName = possibleOldName; - } - if (!currentFile.newName && possibleNewName !== null) { - currentFile.newName = possibleNewName; - } - if (currentFile.newName) { - files.push(currentFile); - currentFile = null; - } - } - possibleOldName = null; - possibleNewName = null; - } - function startFile() { - saveBlock(); - saveFile(); - currentFile = { - blocks: [], - deletedLines: 0, - addedLines: 0 - }; - } - function startBlock(line) { - saveBlock(); - var values; - if (currentFile !== null) { - if (values = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(line)) { - currentFile.isCombined = false; - oldLine = parseInt(values[1], 10); - newLine = parseInt(values[2], 10); - } else if (values = /^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(line)) { - currentFile.isCombined = true; - oldLine = parseInt(values[1], 10); - oldLine2 = parseInt(values[2], 10); - newLine = parseInt(values[3], 10); - } else { - if (line.startsWith(hunkHeaderPrefix)) { - console.error("Failed to parse lines, starting in 0!"); - } - oldLine = 0; - newLine = 0; - currentFile.isCombined = false; - } - } - currentBlock = { - lines: [], - oldStartLine: oldLine, - oldStartLine2: oldLine2, - newStartLine: newLine, - header: line - }; - } - function createLine(line) { - if (currentFile === null || currentBlock === null || oldLine === null || newLine === null) - return; - var currentLine = { - content: line - }; - var addedPrefixes = currentFile.isCombined ? ["+ ", " +", "++"] : ["+"]; - var deletedPrefixes = currentFile.isCombined ? ["- ", " -", "--"] : ["-"]; - if (startsWithAny(line, addedPrefixes)) { - currentFile.addedLines++; - currentLine.type = types_1.LineType.INSERT; - currentLine.oldNumber = void 0; - currentLine.newNumber = newLine++; - } else if (startsWithAny(line, deletedPrefixes)) { - currentFile.deletedLines++; - currentLine.type = types_1.LineType.DELETE; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = void 0; - } else { - currentLine.type = types_1.LineType.CONTEXT; - currentLine.oldNumber = oldLine++; - currentLine.newNumber = newLine++; - } - currentBlock.lines.push(currentLine); - } - function existHunkHeader(line, lineIdx) { - var idx = lineIdx; - while (idx < diffLines.length - 3) { - if (line.startsWith("diff")) { - return false; - } - if (diffLines[idx].startsWith(oldFileNameHeader) && diffLines[idx + 1].startsWith(newFileNameHeader) && diffLines[idx + 2].startsWith(hunkHeaderPrefix)) { - return true; - } - idx++; - } - return false; - } - diffLines.forEach(function(line, lineIndex) { - if (!line || line.startsWith("*")) { - return; - } - var values; - var prevLine = diffLines[lineIndex - 1]; - var nxtLine = diffLines[lineIndex + 1]; - var afterNxtLine = diffLines[lineIndex + 2]; - if (line.startsWith("diff")) { - startFile(); - var gitDiffStart = /^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/; - if (values = gitDiffStart.exec(line)) { - possibleOldName = getFilename(values[1], void 0, config.dstPrefix); - possibleNewName = getFilename(values[2], void 0, config.srcPrefix); - } - if (currentFile === null) { - throw new Error("Where is my file !!!"); - } - currentFile.isGitDiff = true; - return; - } - if (!currentFile || !currentFile.isGitDiff && currentFile && line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) && afterNxtLine.startsWith(hunkHeaderPrefix)) { - startFile(); - } - if (currentFile === null || currentFile === void 0 ? void 0 : currentFile.isTooBig) { - return; - } - if (currentFile && (typeof config.diffMaxChanges === "number" && currentFile.addedLines + currentFile.deletedLines > config.diffMaxChanges || typeof config.diffMaxLineLength === "number" && line.length > config.diffMaxLineLength)) { - currentFile.isTooBig = true; - currentFile.addedLines = 0; - currentFile.deletedLines = 0; - currentFile.blocks = []; - currentBlock = null; - var message = typeof config.diffTooBigMessage === "function" ? config.diffTooBigMessage(files.length) : "Diff too big to be displayed"; - startBlock(message); - return; - } - if (line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) || line.startsWith(newFileNameHeader) && prevLine.startsWith(oldFileNameHeader)) { - if (currentFile && !currentFile.oldName && line.startsWith("--- ") && (values = getSrcFilename(line, config.srcPrefix))) { - currentFile.oldName = values; - currentFile.language = getExtension(currentFile.oldName, currentFile.language); - return; - } - if (currentFile && !currentFile.newName && line.startsWith("+++ ") && (values = getDstFilename(line, config.dstPrefix))) { - currentFile.newName = values; - currentFile.language = getExtension(currentFile.newName, currentFile.language); - return; - } - } - if (currentFile && (line.startsWith(hunkHeaderPrefix) || currentFile.isGitDiff && currentFile.oldName && currentFile.newName && !currentBlock)) { - startBlock(line); - return; - } - if (currentBlock && (line.startsWith("+") || line.startsWith("-") || line.startsWith(" "))) { - createLine(line); - return; - } - var doesNotExistHunkHeader = !existHunkHeader(line, lineIndex); - if (currentFile === null) { - throw new Error("Where is my file !!!"); - } - if (values = oldMode.exec(line)) { - currentFile.oldMode = values[1]; - } else if (values = newMode.exec(line)) { - currentFile.newMode = values[1]; - } else if (values = deletedFileMode.exec(line)) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } else if (values = newFileMode.exec(line)) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if (values = copyFrom.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isCopy = true; - } else if (values = copyTo.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isCopy = true; - } else if (values = renameFrom.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.oldName = values[1]; - } - currentFile.isRename = true; - } else if (values = renameTo.exec(line)) { - if (doesNotExistHunkHeader) { - currentFile.newName = values[1]; - } - currentFile.isRename = true; - } else if (values = binaryFiles.exec(line)) { - currentFile.isBinary = true; - currentFile.oldName = getFilename(values[1], void 0, config.srcPrefix); - currentFile.newName = getFilename(values[2], void 0, config.dstPrefix); - startBlock("Binary file"); - } else if (binaryDiff.test(line)) { - currentFile.isBinary = true; - startBlock(line); - } else if (values = similarityIndex.exec(line)) { - currentFile.unchangedPercentage = parseInt(values[1], 10); - } else if (values = dissimilarityIndex.exec(line)) { - currentFile.changedPercentage = parseInt(values[1], 10); - } else if (values = index.exec(line)) { - currentFile.checksumBefore = values[1]; - currentFile.checksumAfter = values[2]; - values[3] && (currentFile.mode = values[3]); - } else if (values = combinedIndex.exec(line)) { - currentFile.checksumBefore = [values[2], values[3]]; - currentFile.checksumAfter = values[1]; - } else if (values = combinedMode.exec(line)) { - currentFile.oldMode = [values[2], values[3]]; - currentFile.newMode = values[1]; - } else if (values = combinedNewFile.exec(line)) { - currentFile.newFileMode = values[1]; - currentFile.isNew = true; - } else if (values = combinedDeletedFile.exec(line)) { - currentFile.deletedFileMode = values[1]; - currentFile.isDeleted = true; - } - }); - saveBlock(); - saveFile(); - return files; - } - exports.parse = parse; - } -}); - -// node_modules/diff/lib/diff/base.js -var require_base = __commonJS({ - "node_modules/diff/lib/diff/base.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = Diff; - function Diff() { - } - Diff.prototype = { - diff: function diff(oldString, newString) { - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - var callback = options.callback; - if (typeof options === "function") { - callback = options; - options = {}; - } - this.options = options; - var self3 = this; - function done(value) { - if (callback) { - setTimeout(function() { - callback(void 0, value); - }, 0); - return true; - } else { - return value; - } - } - oldString = this.castInput(oldString); - newString = this.castInput(newString); - oldString = this.removeEmpty(this.tokenize(oldString)); - newString = this.removeEmpty(this.tokenize(newString)); - var newLen = newString.length, oldLen = oldString.length; - var editLength = 1; - var maxEditLength = newLen + oldLen; - if (options.maxEditLength) { - maxEditLength = Math.min(maxEditLength, options.maxEditLength); - } - var bestPath = [{ - newPos: -1, - components: [] - }]; - var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); - if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { - return done([{ - value: this.join(newString), - count: newString.length - }]); - } - function execEditLength() { - for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { - var basePath = void 0; - var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; - if (addPath) { - bestPath[diagonalPath - 1] = void 0; - } - var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; - if (!canAdd && !canRemove) { - bestPath[diagonalPath] = void 0; - continue; - } - if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { - basePath = clonePath(removePath); - self3.pushComponent(basePath.components, void 0, true); - } else { - basePath = addPath; - basePath.newPos++; - self3.pushComponent(basePath.components, true, void 0); - } - _oldPos = self3.extractCommon(basePath, newString, oldString, diagonalPath); - if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { - return done(buildValues(self3, basePath.components, newString, oldString, self3.useLongestToken)); - } else { - bestPath[diagonalPath] = basePath; - } - } - editLength++; - } - if (callback) { - (function exec() { - setTimeout(function() { - if (editLength > maxEditLength) { - return callback(); - } - if (!execEditLength()) { - exec(); - } - }, 0); - })(); - } else { - while (editLength <= maxEditLength) { - var ret = execEditLength(); - if (ret) { - return ret; - } - } - } - }, - pushComponent: function pushComponent(components, added, removed) { - var last2 = components[components.length - 1]; - if (last2 && last2.added === added && last2.removed === removed) { - components[components.length - 1] = { - count: last2.count + 1, - added, - removed - }; - } else { - components.push({ - count: 1, - added, - removed - }); - } - }, - extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { - var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; - while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { - newPos++; - oldPos++; - commonCount++; - } - if (commonCount) { - basePath.components.push({ - count: commonCount - }); - } - basePath.newPos = newPos; - return oldPos; - }, - equals: function equals(left, right) { - if (this.options.comparator) { - return this.options.comparator(left, right); - } else { - return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); - } - }, - removeEmpty: function removeEmpty(array) { - var ret = []; - for (var i = 0; i < array.length; i++) { - if (array[i]) { - ret.push(array[i]); - } - } - return ret; - }, - castInput: function castInput(value) { - return value; - }, - tokenize: function tokenize(value) { - return value.split(""); - }, - join: function join2(chars) { - return chars.join(""); - } - }; - function buildValues(diff, components, newString, oldString, useLongestToken) { - var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; - for (; componentPos < componentLen; componentPos++) { - var component = components[componentPos]; - if (!component.removed) { - if (!component.added && useLongestToken) { - var value = newString.slice(newPos, newPos + component.count); - value = value.map(function(value2, i) { - var oldValue = oldString[oldPos + i]; - return oldValue.length > value2.length ? oldValue : value2; - }); - component.value = diff.join(value); - } else { - component.value = diff.join(newString.slice(newPos, newPos + component.count)); - } - newPos += component.count; - if (!component.added) { - oldPos += component.count; - } - } else { - component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); - oldPos += component.count; - if (componentPos && components[componentPos - 1].added) { - var tmp = components[componentPos - 1]; - components[componentPos - 1] = components[componentPos]; - components[componentPos] = tmp; - } - } - } - var lastComponent = components[componentLen - 1]; - if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff.equals("", lastComponent.value)) { - components[componentLen - 2].value += lastComponent.value; - components.pop(); - } - return components; - } - function clonePath(path3) { - return { - newPos: path3.newPos, - components: path3.components.slice(0) - }; - } - } -}); - -// node_modules/diff/lib/diff/character.js -var require_character = __commonJS({ - "node_modules/diff/lib/diff/character.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffChars = diffChars; - exports.characterDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var characterDiff = new _base["default"](); - exports.characterDiff = characterDiff; - function diffChars(oldStr, newStr, options) { - return characterDiff.diff(oldStr, newStr, options); - } - } -}); - -// node_modules/diff/lib/util/params.js -var require_params = __commonJS({ - "node_modules/diff/lib/util/params.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.generateOptions = generateOptions; - function generateOptions(options, defaults) { - if (typeof options === "function") { - defaults.callback = options; - } else if (options) { - for (var name in options) { - if (options.hasOwnProperty(name)) { - defaults[name] = options[name]; - } - } - } - return defaults; - } - } -}); - -// node_modules/diff/lib/diff/word.js -var require_word = __commonJS({ - "node_modules/diff/lib/diff/word.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffWords = diffWords; - exports.diffWordsWithSpace = diffWordsWithSpace; - exports.wordDiff = void 0; - var _base = _interopRequireDefault(require_base()); - var _params = require_params(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; - var reWhitespace = /\S/; - var wordDiff = new _base["default"](); - exports.wordDiff = wordDiff; - wordDiff.equals = function(left, right) { - if (this.options.ignoreCase) { - left = left.toLowerCase(); - right = right.toLowerCase(); - } - return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); - }; - wordDiff.tokenize = function(value) { - var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); - for (var i = 0; i < tokens.length - 1; i++) { - if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { - tokens[i] += tokens[i + 2]; - tokens.splice(i + 1, 2); - i--; - } - } - return tokens; - }; - function diffWords(oldStr, newStr, options) { - options = (0, _params.generateOptions)(options, { - ignoreWhitespace: true - }); - return wordDiff.diff(oldStr, newStr, options); - } - function diffWordsWithSpace(oldStr, newStr, options) { - return wordDiff.diff(oldStr, newStr, options); - } - } -}); - -// node_modules/diff/lib/diff/line.js -var require_line = __commonJS({ - "node_modules/diff/lib/diff/line.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffLines = diffLines; - exports.diffTrimmedLines = diffTrimmedLines; - exports.lineDiff = void 0; - var _base = _interopRequireDefault(require_base()); - var _params = require_params(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var lineDiff = new _base["default"](); - exports.lineDiff = lineDiff; - lineDiff.tokenize = function(value) { - var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); - if (!linesAndNewlines[linesAndNewlines.length - 1]) { - linesAndNewlines.pop(); - } - for (var i = 0; i < linesAndNewlines.length; i++) { - var line = linesAndNewlines[i]; - if (i % 2 && !this.options.newlineIsToken) { - retLines[retLines.length - 1] += line; - } else { - if (this.options.ignoreWhitespace) { - line = line.trim(); - } - retLines.push(line); - } - } - return retLines; - }; - function diffLines(oldStr, newStr, callback) { - return lineDiff.diff(oldStr, newStr, callback); - } - function diffTrimmedLines(oldStr, newStr, callback) { - var options = (0, _params.generateOptions)(callback, { - ignoreWhitespace: true - }); - return lineDiff.diff(oldStr, newStr, options); - } - } -}); - -// node_modules/diff/lib/diff/sentence.js -var require_sentence = __commonJS({ - "node_modules/diff/lib/diff/sentence.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffSentences = diffSentences; - exports.sentenceDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var sentenceDiff = new _base["default"](); - exports.sentenceDiff = sentenceDiff; - sentenceDiff.tokenize = function(value) { - return value.split(/(\S.+?[.!?])(?=\s+|$)/); - }; - function diffSentences(oldStr, newStr, callback) { - return sentenceDiff.diff(oldStr, newStr, callback); - } - } -}); - -// node_modules/diff/lib/diff/css.js -var require_css = __commonJS({ - "node_modules/diff/lib/diff/css.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffCss = diffCss; - exports.cssDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var cssDiff = new _base["default"](); - exports.cssDiff = cssDiff; - cssDiff.tokenize = function(value) { - return value.split(/([{}:;,]|\s+)/); - }; - function diffCss(oldStr, newStr, callback) { - return cssDiff.diff(oldStr, newStr, callback); - } - } -}); - -// node_modules/diff/lib/diff/json.js -var require_json = __commonJS({ - "node_modules/diff/lib/diff/json.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffJson = diffJson; - exports.canonicalize = canonicalize; - exports.jsonDiff = void 0; - var _base = _interopRequireDefault(require_base()); - var _line = require_line(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function _typeof(obj) { - "@babel/helpers - typeof"; - if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { - _typeof = function _typeof2(obj2) { - return typeof obj2; - }; - } else { - _typeof = function _typeof2(obj2) { - return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; - }; - } - return _typeof(obj); - } - var objectPrototypeToString = Object.prototype.toString; - var jsonDiff = new _base["default"](); - exports.jsonDiff = jsonDiff; - jsonDiff.useLongestToken = true; - jsonDiff.tokenize = _line.lineDiff.tokenize; - jsonDiff.castInput = function(value) { - var _this$options = this.options, undefinedReplacement = _this$options.undefinedReplacement, _this$options$stringi = _this$options.stringifyReplacer, stringifyReplacer = _this$options$stringi === void 0 ? function(k, v) { - return typeof v === "undefined" ? undefinedReplacement : v; - } : _this$options$stringi; - return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " "); - }; - jsonDiff.equals = function(left, right) { - return _base["default"].prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1")); - }; - function diffJson(oldObj, newObj, options) { - return jsonDiff.diff(oldObj, newObj, options); - } - function canonicalize(obj, stack, replacementStack, replacer, key2) { - stack = stack || []; - replacementStack = replacementStack || []; - if (replacer) { - obj = replacer(key2, obj); - } - var i; - for (i = 0; i < stack.length; i += 1) { - if (stack[i] === obj) { - return replacementStack[i]; - } - } - var canonicalizedObj; - if (objectPrototypeToString.call(obj) === "[object Array]") { - stack.push(obj); - canonicalizedObj = new Array(obj.length); - replacementStack.push(canonicalizedObj); - for (i = 0; i < obj.length; i += 1) { - canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key2); - } - stack.pop(); - replacementStack.pop(); - return canonicalizedObj; - } - if (obj && obj.toJSON) { - obj = obj.toJSON(); - } - if (_typeof(obj) === "object" && obj !== null) { - stack.push(obj); - canonicalizedObj = {}; - replacementStack.push(canonicalizedObj); - var sortedKeys = [], _key; - for (_key in obj) { - if (obj.hasOwnProperty(_key)) { - sortedKeys.push(_key); - } - } - sortedKeys.sort(); - for (i = 0; i < sortedKeys.length; i += 1) { - _key = sortedKeys[i]; - canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); - } - stack.pop(); - replacementStack.pop(); - } else { - canonicalizedObj = obj; - } - return canonicalizedObj; - } - } -}); - -// node_modules/diff/lib/diff/array.js -var require_array = __commonJS({ - "node_modules/diff/lib/diff/array.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.diffArrays = diffArrays; - exports.arrayDiff = void 0; - var _base = _interopRequireDefault(require_base()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - var arrayDiff = new _base["default"](); - exports.arrayDiff = arrayDiff; - arrayDiff.tokenize = function(value) { - return value.slice(); - }; - arrayDiff.join = arrayDiff.removeEmpty = function(value) { - return value; - }; - function diffArrays(oldArr, newArr, callback) { - return arrayDiff.diff(oldArr, newArr, callback); - } - } -}); - -// node_modules/diff/lib/patch/parse.js -var require_parse = __commonJS({ - "node_modules/diff/lib/patch/parse.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.parsePatch = parsePatch; - function parsePatch(uniDiff) { - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; - var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], list = [], i = 0; - function parseIndex() { - var index = {}; - list.push(index); - while (i < diffstr.length) { - var line = diffstr[i]; - if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { - break; - } - var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); - if (header) { - index.index = header[1]; - } - i++; - } - parseFileHeader(index); - parseFileHeader(index); - index.hunks = []; - while (i < diffstr.length) { - var _line = diffstr[i]; - if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { - break; - } else if (/^@@/.test(_line)) { - index.hunks.push(parseHunk()); - } else if (_line && options.strict) { - throw new Error("Unknown line " + (i + 1) + " " + JSON.stringify(_line)); - } else { - i++; - } - } - } - function parseFileHeader(index) { - var fileHeader = /^(---|\+\+\+)\s+(.*)$/.exec(diffstr[i]); - if (fileHeader) { - var keyPrefix = fileHeader[1] === "---" ? "old" : "new"; - var data = fileHeader[2].split(" ", 2); - var fileName = data[0].replace(/\\\\/g, "\\"); - if (/^".*"$/.test(fileName)) { - fileName = fileName.substr(1, fileName.length - 2); - } - index[keyPrefix + "FileName"] = fileName; - index[keyPrefix + "Header"] = (data[1] || "").trim(); - i++; - } - } - function parseHunk() { - var chunkHeaderIndex = i, chunkHeaderLine = diffstr[i++], chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); - var hunk = { - oldStart: +chunkHeader[1], - oldLines: typeof chunkHeader[2] === "undefined" ? 1 : +chunkHeader[2], - newStart: +chunkHeader[3], - newLines: typeof chunkHeader[4] === "undefined" ? 1 : +chunkHeader[4], - lines: [], - linedelimiters: [] - }; - if (hunk.oldLines === 0) { - hunk.oldStart += 1; - } - if (hunk.newLines === 0) { - hunk.newStart += 1; - } - var addCount = 0, removeCount = 0; - for (; i < diffstr.length; i++) { - if (diffstr[i].indexOf("--- ") === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf("+++ ") === 0 && diffstr[i + 2].indexOf("@@") === 0) { - break; - } - var operation = diffstr[i].length == 0 && i != diffstr.length - 1 ? " " : diffstr[i][0]; - if (operation === "+" || operation === "-" || operation === " " || operation === "\\") { - hunk.lines.push(diffstr[i]); - hunk.linedelimiters.push(delimiters[i] || "\n"); - if (operation === "+") { - addCount++; - } else if (operation === "-") { - removeCount++; - } else if (operation === " ") { - addCount++; - removeCount++; - } - } else { - break; - } - } - if (!addCount && hunk.newLines === 1) { - hunk.newLines = 0; - } - if (!removeCount && hunk.oldLines === 1) { - hunk.oldLines = 0; - } - if (options.strict) { - if (addCount !== hunk.newLines) { - throw new Error("Added line count did not match for hunk at line " + (chunkHeaderIndex + 1)); - } - if (removeCount !== hunk.oldLines) { - throw new Error("Removed line count did not match for hunk at line " + (chunkHeaderIndex + 1)); - } - } - return hunk; - } - while (i < diffstr.length) { - parseIndex(); - } - return list; - } - } -}); - -// node_modules/diff/lib/util/distance-iterator.js -var require_distance_iterator = __commonJS({ - "node_modules/diff/lib/util/distance-iterator.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports["default"] = _default; - function _default(start, minLine, maxLine) { - var wantForward = true, backwardExhausted = false, forwardExhausted = false, localOffset = 1; - return function iterator() { - if (wantForward && !forwardExhausted) { - if (backwardExhausted) { - localOffset++; - } else { - wantForward = false; - } - if (start + localOffset <= maxLine) { - return localOffset; - } - forwardExhausted = true; - } - if (!backwardExhausted) { - if (!forwardExhausted) { - wantForward = true; - } - if (minLine <= start - localOffset) { - return -localOffset++; - } - backwardExhausted = true; - return iterator(); - } - }; - } - } -}); - -// node_modules/diff/lib/patch/apply.js -var require_apply = __commonJS({ - "node_modules/diff/lib/patch/apply.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.applyPatch = applyPatch; - exports.applyPatches = applyPatches; - var _parse = require_parse(); - var _distanceIterator = _interopRequireDefault(require_distance_iterator()); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - function applyPatch(source, uniDiff) { - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; - if (typeof uniDiff === "string") { - uniDiff = (0, _parse.parsePatch)(uniDiff); - } - if (Array.isArray(uniDiff)) { - if (uniDiff.length > 1) { - throw new Error("applyPatch only works with a single input."); - } - uniDiff = uniDiff[0]; - } - var lines = source.split(/\r\n|[\n\v\f\r\x85]/), delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], hunks = uniDiff.hunks, compareLine = options.compareLine || function(lineNumber, line2, operation2, patchContent) { - return line2 === patchContent; - }, errorCount = 0, fuzzFactor = options.fuzzFactor || 0, minLine = 0, offset = 0, removeEOFNL, addEOFNL; - function hunkFits(hunk2, toPos2) { - for (var j2 = 0; j2 < hunk2.lines.length; j2++) { - var line2 = hunk2.lines[j2], operation2 = line2.length > 0 ? line2[0] : " ", content2 = line2.length > 0 ? line2.substr(1) : line2; - if (operation2 === " " || operation2 === "-") { - if (!compareLine(toPos2 + 1, lines[toPos2], operation2, content2)) { - errorCount++; - if (errorCount > fuzzFactor) { - return false; - } - } - toPos2++; - } - } - return true; - } - for (var i = 0; i < hunks.length; i++) { - var hunk = hunks[i], maxLine = lines.length - hunk.oldLines, localOffset = 0, toPos = offset + hunk.oldStart - 1; - var iterator = (0, _distanceIterator["default"])(toPos, minLine, maxLine); - for (; localOffset !== void 0; localOffset = iterator()) { - if (hunkFits(hunk, toPos + localOffset)) { - hunk.offset = offset += localOffset; - break; - } - } - if (localOffset === void 0) { - return false; - } - minLine = hunk.offset + hunk.oldStart + hunk.oldLines; - } - var diffOffset = 0; - for (var _i = 0; _i < hunks.length; _i++) { - var _hunk = hunks[_i], _toPos = _hunk.oldStart + _hunk.offset + diffOffset - 1; - diffOffset += _hunk.newLines - _hunk.oldLines; - for (var j = 0; j < _hunk.lines.length; j++) { - var line = _hunk.lines[j], operation = line.length > 0 ? line[0] : " ", content = line.length > 0 ? line.substr(1) : line, delimiter = _hunk.linedelimiters[j]; - if (operation === " ") { - _toPos++; - } else if (operation === "-") { - lines.splice(_toPos, 1); - delimiters.splice(_toPos, 1); - } else if (operation === "+") { - lines.splice(_toPos, 0, content); - delimiters.splice(_toPos, 0, delimiter); - _toPos++; - } else if (operation === "\\") { - var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; - if (previousOperation === "+") { - removeEOFNL = true; - } else if (previousOperation === "-") { - addEOFNL = true; - } - } - } - } - if (removeEOFNL) { - while (!lines[lines.length - 1]) { - lines.pop(); - delimiters.pop(); - } - } else if (addEOFNL) { - lines.push(""); - delimiters.push("\n"); - } - for (var _k = 0; _k < lines.length - 1; _k++) { - lines[_k] = lines[_k] + delimiters[_k]; - } - return lines.join(""); - } - function applyPatches(uniDiff, options) { - if (typeof uniDiff === "string") { - uniDiff = (0, _parse.parsePatch)(uniDiff); - } - var currentIndex = 0; - function processIndex() { - var index = uniDiff[currentIndex++]; - if (!index) { - return options.complete(); - } - options.loadFile(index, function(err, data) { - if (err) { - return options.complete(err); - } - var updatedContent = applyPatch(data, index, options); - options.patched(index, updatedContent, function(err2) { - if (err2) { - return options.complete(err2); - } - processIndex(); - }); - }); - } - processIndex(); - } - } -}); - -// node_modules/diff/lib/patch/create.js -var require_create = __commonJS({ - "node_modules/diff/lib/patch/create.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.structuredPatch = structuredPatch; - exports.formatPatch = formatPatch; - exports.createTwoFilesPatch = createTwoFilesPatch; - exports.createPatch = createPatch; - var _line = require_line(); - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) - return _arrayLikeToArray(arr); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - if (!options) { - options = {}; - } - if (typeof options.context === "undefined") { - options.context = 4; - } - var diff = (0, _line.diffLines)(oldStr, newStr, options); - if (!diff) { - return; - } - diff.push({ - value: "", - lines: [] - }); - function contextLines(lines) { - return lines.map(function(entry) { - return " " + entry; - }); - } - var hunks = []; - var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; - var _loop = function _loop2(i2) { - var current = diff[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n"); - current.lines = lines; - if (current.added || current.removed) { - var _curRange; - if (!oldRangeStart) { - var prev = diff[i2 - 1]; - oldRangeStart = oldLine; - newRangeStart = newLine; - if (prev) { - curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; - oldRangeStart -= curRange.length; - newRangeStart -= curRange.length; - } - } - (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) { - return (current.added ? "+" : "-") + entry; - }))); - if (current.added) { - newLine += lines.length; - } else { - oldLine += lines.length; - } - } else { - if (oldRangeStart) { - if (lines.length <= options.context * 2 && i2 < diff.length - 2) { - var _curRange2; - (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); - } else { - var _curRange3; - var contextSize = Math.min(lines.length, options.context); - (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); - var hunk = { - oldStart: oldRangeStart, - oldLines: oldLine - oldRangeStart + contextSize, - newStart: newRangeStart, - newLines: newLine - newRangeStart + contextSize, - lines: curRange - }; - if (i2 >= diff.length - 2 && lines.length <= options.context) { - var oldEOFNewline = /\n$/.test(oldStr); - var newEOFNewline = /\n$/.test(newStr); - var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; - if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) { - curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file"); - } - if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { - curRange.push("\\ No newline at end of file"); - } - } - hunks.push(hunk); - oldRangeStart = 0; - newRangeStart = 0; - curRange = []; - } - } - oldLine += lines.length; - newLine += lines.length; - } - }; - for (var i = 0; i < diff.length; i++) { - _loop(i); - } - return { - oldFileName, - newFileName, - oldHeader, - newHeader, - hunks - }; - } - function formatPatch(diff) { - var ret = []; - if (diff.oldFileName == diff.newFileName) { - ret.push("Index: " + diff.oldFileName); - } - ret.push("==================================================================="); - ret.push("--- " + diff.oldFileName + (typeof diff.oldHeader === "undefined" ? "" : " " + diff.oldHeader)); - ret.push("+++ " + diff.newFileName + (typeof diff.newHeader === "undefined" ? "" : " " + diff.newHeader)); - for (var i = 0; i < diff.hunks.length; i++) { - var hunk = diff.hunks[i]; - if (hunk.oldLines === 0) { - hunk.oldStart -= 1; - } - if (hunk.newLines === 0) { - hunk.newStart -= 1; - } - ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@"); - ret.push.apply(ret, hunk.lines); - } - return ret.join("\n") + "\n"; - } - function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { - return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)); - } - function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { - return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); - } - } -}); - -// node_modules/diff/lib/util/array.js -var require_array2 = __commonJS({ - "node_modules/diff/lib/util/array.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.arrayEqual = arrayEqual; - exports.arrayStartsWith = arrayStartsWith; - function arrayEqual(a, b) { - if (a.length !== b.length) { - return false; - } - return arrayStartsWith(a, b); - } - function arrayStartsWith(array, start) { - if (start.length > array.length) { - return false; - } - for (var i = 0; i < start.length; i++) { - if (start[i] !== array[i]) { - return false; - } - } - return true; - } - } -}); - -// node_modules/diff/lib/patch/merge.js -var require_merge = __commonJS({ - "node_modules/diff/lib/patch/merge.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.calcLineCount = calcLineCount; - exports.merge = merge; - var _create = require_create(); - var _parse = require_parse(); - var _array = require_array2(); - function _toConsumableArray(arr) { - return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); - } - function _nonIterableSpread() { - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); - } - function _unsupportedIterableToArray(o, minLen) { - if (!o) - return; - if (typeof o === "string") - return _arrayLikeToArray(o, minLen); - var n = Object.prototype.toString.call(o).slice(8, -1); - if (n === "Object" && o.constructor) - n = o.constructor.name; - if (n === "Map" || n === "Set") - return Array.from(o); - if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) - return _arrayLikeToArray(o, minLen); - } - function _iterableToArray(iter) { - if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) - return Array.from(iter); - } - function _arrayWithoutHoles(arr) { - if (Array.isArray(arr)) - return _arrayLikeToArray(arr); - } - function _arrayLikeToArray(arr, len) { - if (len == null || len > arr.length) - len = arr.length; - for (var i = 0, arr2 = new Array(len); i < len; i++) { - arr2[i] = arr[i]; - } - return arr2; - } - function calcLineCount(hunk) { - var _calcOldNewLineCount = calcOldNewLineCount(hunk.lines), oldLines = _calcOldNewLineCount.oldLines, newLines = _calcOldNewLineCount.newLines; - if (oldLines !== void 0) { - hunk.oldLines = oldLines; - } else { - delete hunk.oldLines; - } - if (newLines !== void 0) { - hunk.newLines = newLines; - } else { - delete hunk.newLines; - } - } - function merge(mine, theirs, base) { - mine = loadPatch(mine, base); - theirs = loadPatch(theirs, base); - var ret = {}; - if (mine.index || theirs.index) { - ret.index = mine.index || theirs.index; - } - if (mine.newFileName || theirs.newFileName) { - if (!fileNameChanged(mine)) { - ret.oldFileName = theirs.oldFileName || mine.oldFileName; - ret.newFileName = theirs.newFileName || mine.newFileName; - ret.oldHeader = theirs.oldHeader || mine.oldHeader; - ret.newHeader = theirs.newHeader || mine.newHeader; - } else if (!fileNameChanged(theirs)) { - ret.oldFileName = mine.oldFileName; - ret.newFileName = mine.newFileName; - ret.oldHeader = mine.oldHeader; - ret.newHeader = mine.newHeader; - } else { - ret.oldFileName = selectField(ret, mine.oldFileName, theirs.oldFileName); - ret.newFileName = selectField(ret, mine.newFileName, theirs.newFileName); - ret.oldHeader = selectField(ret, mine.oldHeader, theirs.oldHeader); - ret.newHeader = selectField(ret, mine.newHeader, theirs.newHeader); - } - } - ret.hunks = []; - var mineIndex = 0, theirsIndex = 0, mineOffset = 0, theirsOffset = 0; - while (mineIndex < mine.hunks.length || theirsIndex < theirs.hunks.length) { - var mineCurrent = mine.hunks[mineIndex] || { - oldStart: Infinity - }, theirsCurrent = theirs.hunks[theirsIndex] || { - oldStart: Infinity - }; - if (hunkBefore(mineCurrent, theirsCurrent)) { - ret.hunks.push(cloneHunk(mineCurrent, mineOffset)); - mineIndex++; - theirsOffset += mineCurrent.newLines - mineCurrent.oldLines; - } else if (hunkBefore(theirsCurrent, mineCurrent)) { - ret.hunks.push(cloneHunk(theirsCurrent, theirsOffset)); - theirsIndex++; - mineOffset += theirsCurrent.newLines - theirsCurrent.oldLines; - } else { - var mergedHunk = { - oldStart: Math.min(mineCurrent.oldStart, theirsCurrent.oldStart), - oldLines: 0, - newStart: Math.min(mineCurrent.newStart + mineOffset, theirsCurrent.oldStart + theirsOffset), - newLines: 0, - lines: [] - }; - mergeLines(mergedHunk, mineCurrent.oldStart, mineCurrent.lines, theirsCurrent.oldStart, theirsCurrent.lines); - theirsIndex++; - mineIndex++; - ret.hunks.push(mergedHunk); - } - } - return ret; - } - function loadPatch(param, base) { - if (typeof param === "string") { - if (/^@@/m.test(param) || /^Index:/m.test(param)) { - return (0, _parse.parsePatch)(param)[0]; - } - if (!base) { - throw new Error("Must provide a base reference or pass in a patch"); - } - return (0, _create.structuredPatch)(void 0, void 0, base, param); - } - return param; - } - function fileNameChanged(patch) { - return patch.newFileName && patch.newFileName !== patch.oldFileName; - } - function selectField(index, mine, theirs) { - if (mine === theirs) { - return mine; - } else { - index.conflict = true; - return { - mine, - theirs - }; - } - } - function hunkBefore(test, check) { - return test.oldStart < check.oldStart && test.oldStart + test.oldLines < check.oldStart; - } - function cloneHunk(hunk, offset) { - return { - oldStart: hunk.oldStart, - oldLines: hunk.oldLines, - newStart: hunk.newStart + offset, - newLines: hunk.newLines, - lines: hunk.lines - }; - } - function mergeLines(hunk, mineOffset, mineLines, theirOffset, theirLines) { - var mine = { - offset: mineOffset, - lines: mineLines, - index: 0 - }, their = { - offset: theirOffset, - lines: theirLines, - index: 0 - }; - insertLeading(hunk, mine, their); - insertLeading(hunk, their, mine); - while (mine.index < mine.lines.length && their.index < their.lines.length) { - var mineCurrent = mine.lines[mine.index], theirCurrent = their.lines[their.index]; - if ((mineCurrent[0] === "-" || mineCurrent[0] === "+") && (theirCurrent[0] === "-" || theirCurrent[0] === "+")) { - mutualChange(hunk, mine, their); - } else if (mineCurrent[0] === "+" && theirCurrent[0] === " ") { - var _hunk$lines; - (_hunk$lines = hunk.lines).push.apply(_hunk$lines, _toConsumableArray(collectChange(mine))); - } else if (theirCurrent[0] === "+" && mineCurrent[0] === " ") { - var _hunk$lines2; - (_hunk$lines2 = hunk.lines).push.apply(_hunk$lines2, _toConsumableArray(collectChange(their))); - } else if (mineCurrent[0] === "-" && theirCurrent[0] === " ") { - removal(hunk, mine, their); - } else if (theirCurrent[0] === "-" && mineCurrent[0] === " ") { - removal(hunk, their, mine, true); - } else if (mineCurrent === theirCurrent) { - hunk.lines.push(mineCurrent); - mine.index++; - their.index++; - } else { - conflict(hunk, collectChange(mine), collectChange(their)); - } - } - insertTrailing(hunk, mine); - insertTrailing(hunk, their); - calcLineCount(hunk); - } - function mutualChange(hunk, mine, their) { - var myChanges = collectChange(mine), theirChanges = collectChange(their); - if (allRemoves(myChanges) && allRemoves(theirChanges)) { - if ((0, _array.arrayStartsWith)(myChanges, theirChanges) && skipRemoveSuperset(their, myChanges, myChanges.length - theirChanges.length)) { - var _hunk$lines3; - (_hunk$lines3 = hunk.lines).push.apply(_hunk$lines3, _toConsumableArray(myChanges)); - return; - } else if ((0, _array.arrayStartsWith)(theirChanges, myChanges) && skipRemoveSuperset(mine, theirChanges, theirChanges.length - myChanges.length)) { - var _hunk$lines4; - (_hunk$lines4 = hunk.lines).push.apply(_hunk$lines4, _toConsumableArray(theirChanges)); - return; - } - } else if ((0, _array.arrayEqual)(myChanges, theirChanges)) { - var _hunk$lines5; - (_hunk$lines5 = hunk.lines).push.apply(_hunk$lines5, _toConsumableArray(myChanges)); - return; - } - conflict(hunk, myChanges, theirChanges); - } - function removal(hunk, mine, their, swap) { - var myChanges = collectChange(mine), theirChanges = collectContext(their, myChanges); - if (theirChanges.merged) { - var _hunk$lines6; - (_hunk$lines6 = hunk.lines).push.apply(_hunk$lines6, _toConsumableArray(theirChanges.merged)); - } else { - conflict(hunk, swap ? theirChanges : myChanges, swap ? myChanges : theirChanges); - } - } - function conflict(hunk, mine, their) { - hunk.conflict = true; - hunk.lines.push({ - conflict: true, - mine, - theirs: their - }); - } - function insertLeading(hunk, insert2, their) { - while (insert2.offset < their.offset && insert2.index < insert2.lines.length) { - var line = insert2.lines[insert2.index++]; - hunk.lines.push(line); - insert2.offset++; - } - } - function insertTrailing(hunk, insert2) { - while (insert2.index < insert2.lines.length) { - var line = insert2.lines[insert2.index++]; - hunk.lines.push(line); - } - } - function collectChange(state) { - var ret = [], operation = state.lines[state.index][0]; - while (state.index < state.lines.length) { - var line = state.lines[state.index]; - if (operation === "-" && line[0] === "+") { - operation = "+"; - } - if (operation === line[0]) { - ret.push(line); - state.index++; - } else { - break; - } - } - return ret; - } - function collectContext(state, matchChanges) { - var changes = [], merged = [], matchIndex = 0, contextChanges = false, conflicted = false; - while (matchIndex < matchChanges.length && state.index < state.lines.length) { - var change = state.lines[state.index], match = matchChanges[matchIndex]; - if (match[0] === "+") { - break; - } - contextChanges = contextChanges || change[0] !== " "; - merged.push(match); - matchIndex++; - if (change[0] === "+") { - conflicted = true; - while (change[0] === "+") { - changes.push(change); - change = state.lines[++state.index]; - } - } - if (match.substr(1) === change.substr(1)) { - changes.push(change); - state.index++; - } else { - conflicted = true; - } - } - if ((matchChanges[matchIndex] || "")[0] === "+" && contextChanges) { - conflicted = true; - } - if (conflicted) { - return changes; - } - while (matchIndex < matchChanges.length) { - merged.push(matchChanges[matchIndex++]); - } - return { - merged, - changes - }; - } - function allRemoves(changes) { - return changes.reduce(function(prev, change) { - return prev && change[0] === "-"; - }, true); - } - function skipRemoveSuperset(state, removeChanges, delta) { - for (var i = 0; i < delta; i++) { - var changeContent = removeChanges[removeChanges.length - delta + i].substr(1); - if (state.lines[state.index + i] !== " " + changeContent) { - return false; - } - } - state.index += delta; - return true; - } - function calcOldNewLineCount(lines) { - var oldLines = 0; - var newLines = 0; - lines.forEach(function(line) { - if (typeof line !== "string") { - var myCount = calcOldNewLineCount(line.mine); - var theirCount = calcOldNewLineCount(line.theirs); - if (oldLines !== void 0) { - if (myCount.oldLines === theirCount.oldLines) { - oldLines += myCount.oldLines; - } else { - oldLines = void 0; - } - } - if (newLines !== void 0) { - if (myCount.newLines === theirCount.newLines) { - newLines += myCount.newLines; - } else { - newLines = void 0; - } - } - } else { - if (newLines !== void 0 && (line[0] === "+" || line[0] === " ")) { - newLines++; - } - if (oldLines !== void 0 && (line[0] === "-" || line[0] === " ")) { - oldLines++; - } - } - }); - return { - oldLines, - newLines - }; - } - } -}); - -// node_modules/diff/lib/convert/dmp.js -var require_dmp = __commonJS({ - "node_modules/diff/lib/convert/dmp.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.convertChangesToDMP = convertChangesToDMP; - function convertChangesToDMP(changes) { - var ret = [], change, operation; - for (var i = 0; i < changes.length; i++) { - change = changes[i]; - if (change.added) { - operation = 1; - } else if (change.removed) { - operation = -1; - } else { - operation = 0; - } - ret.push([operation, change.value]); - } - return ret; - } - } -}); - -// node_modules/diff/lib/convert/xml.js -var require_xml = __commonJS({ - "node_modules/diff/lib/convert/xml.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.convertChangesToXML = convertChangesToXML; - function convertChangesToXML(changes) { - var ret = []; - for (var i = 0; i < changes.length; i++) { - var change = changes[i]; - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - ret.push(escapeHTML(change.value)); - if (change.added) { - ret.push(""); - } else if (change.removed) { - ret.push(""); - } - } - return ret.join(""); - } - function escapeHTML(s) { - var n = s; - n = n.replace(/&/g, "&"); - n = n.replace(//g, ">"); - n = n.replace(/"/g, """); - return n; - } - } -}); - -// node_modules/diff/lib/index.js -var require_lib = __commonJS({ - "node_modules/diff/lib/index.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "Diff", { - enumerable: true, - get: function get() { - return _base["default"]; - } - }); - Object.defineProperty(exports, "diffChars", { - enumerable: true, - get: function get() { - return _character.diffChars; - } - }); - Object.defineProperty(exports, "diffWords", { - enumerable: true, - get: function get() { - return _word.diffWords; - } - }); - Object.defineProperty(exports, "diffWordsWithSpace", { - enumerable: true, - get: function get() { - return _word.diffWordsWithSpace; - } - }); - Object.defineProperty(exports, "diffLines", { - enumerable: true, - get: function get() { - return _line.diffLines; - } - }); - Object.defineProperty(exports, "diffTrimmedLines", { - enumerable: true, - get: function get() { - return _line.diffTrimmedLines; - } - }); - Object.defineProperty(exports, "diffSentences", { - enumerable: true, - get: function get() { - return _sentence.diffSentences; - } - }); - Object.defineProperty(exports, "diffCss", { - enumerable: true, - get: function get() { - return _css.diffCss; - } - }); - Object.defineProperty(exports, "diffJson", { - enumerable: true, - get: function get() { - return _json.diffJson; - } - }); - Object.defineProperty(exports, "canonicalize", { - enumerable: true, - get: function get() { - return _json.canonicalize; - } - }); - Object.defineProperty(exports, "diffArrays", { - enumerable: true, - get: function get() { - return _array.diffArrays; - } - }); - Object.defineProperty(exports, "applyPatch", { - enumerable: true, - get: function get() { - return _apply.applyPatch; - } - }); - Object.defineProperty(exports, "applyPatches", { - enumerable: true, - get: function get() { - return _apply.applyPatches; - } - }); - Object.defineProperty(exports, "parsePatch", { - enumerable: true, - get: function get() { - return _parse.parsePatch; - } - }); - Object.defineProperty(exports, "merge", { - enumerable: true, - get: function get() { - return _merge.merge; - } - }); - Object.defineProperty(exports, "structuredPatch", { - enumerable: true, - get: function get() { - return _create.structuredPatch; - } - }); - Object.defineProperty(exports, "createTwoFilesPatch", { - enumerable: true, - get: function get() { - return _create.createTwoFilesPatch; - } - }); - Object.defineProperty(exports, "createPatch", { - enumerable: true, - get: function get() { - return _create.createPatch; - } - }); - Object.defineProperty(exports, "convertChangesToDMP", { - enumerable: true, - get: function get() { - return _dmp.convertChangesToDMP; - } - }); - Object.defineProperty(exports, "convertChangesToXML", { - enumerable: true, - get: function get() { - return _xml.convertChangesToXML; - } - }); - var _base = _interopRequireDefault(require_base()); - var _character = require_character(); - var _word = require_word(); - var _line = require_line(); - var _sentence = require_sentence(); - var _css = require_css(); - var _json = require_json(); - var _array = require_array(); - var _apply = require_apply(); - var _parse = require_parse(); - var _merge = require_merge(); - var _create = require_create(); - var _dmp = require_dmp(); - var _xml = require_xml(); - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; - } - } -}); - -// node_modules/diff2html/lib/rematch.js -var require_rematch = __commonJS({ - "node_modules/diff2html/lib/rematch.js"(exports) { - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.newMatcherFn = exports.newDistanceFn = exports.levenshtein = void 0; - function levenshtein(a, b) { - if (a.length === 0) { - return b.length; - } - if (b.length === 0) { - return a.length; - } - var matrix = []; - var i; - for (i = 0; i <= b.length; i++) { - matrix[i] = [i]; - } - var j; - for (j = 0; j <= a.length; j++) { - matrix[0][j] = j; - } - for (i = 1; i <= b.length; i++) { - for (j = 1; j <= a.length; j++) { - if (b.charAt(i - 1) === a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1]; - } else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1)); - } - } - } - return matrix[b.length][a.length]; - } - exports.levenshtein = levenshtein; - function newDistanceFn(str) { - return function(x, y) { - var xValue = str(x).trim(); - var yValue = str(y).trim(); - var lev = levenshtein(xValue, yValue); - return lev / (xValue.length + yValue.length); - }; - } - exports.newDistanceFn = newDistanceFn; - function newMatcherFn(distance) { - function findBestMatch(a, b, cache) { - if (cache === void 0) { - cache = new Map(); - } - var bestMatchDist = Infinity; - var bestMatch; - for (var i = 0; i < a.length; ++i) { - for (var j = 0; j < b.length; ++j) { - var cacheKey = JSON.stringify([a[i], b[j]]); - var md = void 0; - if (!(cache.has(cacheKey) && (md = cache.get(cacheKey)))) { - md = distance(a[i], b[j]); - cache.set(cacheKey, md); - } - if (md < bestMatchDist) { - bestMatchDist = md; - bestMatch = { indexA: i, indexB: j, score: bestMatchDist }; - } - } - } - return bestMatch; - } - function group(a, b, level, cache) { - if (level === void 0) { - level = 0; - } - if (cache === void 0) { - cache = new Map(); - } - var bm = findBestMatch(a, b, cache); - if (!bm || a.length + b.length < 3) { - return [[a, b]]; - } - var a1 = a.slice(0, bm.indexA); - var b1 = b.slice(0, bm.indexB); - var aMatch = [a[bm.indexA]]; - var bMatch = [b[bm.indexB]]; - var tailA = bm.indexA + 1; - var tailB = bm.indexB + 1; - var a2 = a.slice(tailA); - var b2 = b.slice(tailB); - var group1 = group(a1, b1, level + 1, cache); - var groupMatch = group(aMatch, bMatch, level + 1, cache); - var group2 = group(a2, b2, level + 1, cache); - var result = groupMatch; - if (bm.indexA > 0 || bm.indexB > 0) { - result = group1.concat(result); - } - if (a.length > tailA || b.length > tailB) { - result = result.concat(group2); - } - return result; - } - return group; - } - exports.newMatcherFn = newMatcherFn; - } -}); - -// node_modules/diff2html/lib/render-utils.js -var require_render_utils = __commonJS({ - "node_modules/diff2html/lib/render-utils.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.diffHighlight = exports.getFileIcon = exports.getHtmlId = exports.filenameDiff = exports.deconstructLine = exports.escapeForHtml = exports.toCSSClass = exports.defaultRenderConfig = exports.CSSLineClass = void 0; - var jsDiff = __importStar2(require_lib()); - var utils_1 = require_utils(); - var rematch = __importStar2(require_rematch()); - var types_1 = require_types(); - exports.CSSLineClass = { - INSERTS: "d2h-ins", - DELETES: "d2h-del", - CONTEXT: "d2h-cntx", - INFO: "d2h-info", - INSERT_CHANGES: "d2h-ins d2h-change", - DELETE_CHANGES: "d2h-del d2h-change" - }; - exports.defaultRenderConfig = { - matching: types_1.LineMatchingType.NONE, - matchWordsThreshold: 0.25, - maxLineLengthHighlight: 1e4, - diffStyle: types_1.DiffStyleType.WORD - }; - var separator = "/"; - var distance = rematch.newDistanceFn(function(change) { - return change.value; - }); - var matcher = rematch.newMatcherFn(distance); - function isDevNullName(name) { - return name.indexOf("dev/null") !== -1; - } - function removeInsElements(line) { - return line.replace(/(]*>((.|\n)*?)<\/ins>)/g, ""); - } - function removeDelElements(line) { - return line.replace(/(]*>((.|\n)*?)<\/del>)/g, ""); - } - function toCSSClass(lineType) { - switch (lineType) { - case types_1.LineType.CONTEXT: - return exports.CSSLineClass.CONTEXT; - case types_1.LineType.INSERT: - return exports.CSSLineClass.INSERTS; - case types_1.LineType.DELETE: - return exports.CSSLineClass.DELETES; - } - } - exports.toCSSClass = toCSSClass; - function prefixLength(isCombined) { - return isCombined ? 2 : 1; - } - function escapeForHtml(str) { - return str.slice(0).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/"); - } - exports.escapeForHtml = escapeForHtml; - function deconstructLine(line, isCombined, escape) { - if (escape === void 0) { - escape = true; - } - var indexToSplit = prefixLength(isCombined); - return { - prefix: line.substring(0, indexToSplit), - content: escape ? escapeForHtml(line.substring(indexToSplit)) : line.substring(indexToSplit) - }; - } - exports.deconstructLine = deconstructLine; - function filenameDiff(file) { - var oldFilename = (0, utils_1.unifyPath)(file.oldName); - var newFilename = (0, utils_1.unifyPath)(file.newName); - if (oldFilename !== newFilename && !isDevNullName(oldFilename) && !isDevNullName(newFilename)) { - var prefixPaths = []; - var suffixPaths = []; - var oldFilenameParts = oldFilename.split(separator); - var newFilenameParts = newFilename.split(separator); - var oldFilenamePartsSize = oldFilenameParts.length; - var newFilenamePartsSize = newFilenameParts.length; - var i = 0; - var j = oldFilenamePartsSize - 1; - var k = newFilenamePartsSize - 1; - while (i < j && i < k) { - if (oldFilenameParts[i] === newFilenameParts[i]) { - prefixPaths.push(newFilenameParts[i]); - i += 1; - } else { - break; - } - } - while (j > i && k > i) { - if (oldFilenameParts[j] === newFilenameParts[k]) { - suffixPaths.unshift(newFilenameParts[k]); - j -= 1; - k -= 1; - } else { - break; - } - } - var finalPrefix = prefixPaths.join(separator); - var finalSuffix = suffixPaths.join(separator); - var oldRemainingPath = oldFilenameParts.slice(i, j + 1).join(separator); - var newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator); - if (finalPrefix.length && finalSuffix.length) { - return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; - } else if (finalPrefix.length) { - return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}"; - } else if (finalSuffix.length) { - return "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; - } - return oldFilename + " \u2192 " + newFilename; - } else if (!isDevNullName(newFilename)) { - return newFilename; - } else { - return oldFilename; - } - } - exports.filenameDiff = filenameDiff; - function getHtmlId(file) { - return "d2h-".concat((0, utils_1.hashCode)(filenameDiff(file)).toString().slice(-6)); - } - exports.getHtmlId = getHtmlId; - function getFileIcon(file) { - var templateName = "file-changed"; - if (file.isRename) { - templateName = "file-renamed"; - } else if (file.isCopy) { - templateName = "file-renamed"; - } else if (file.isNew) { - templateName = "file-added"; - } else if (file.isDeleted) { - templateName = "file-deleted"; - } else if (file.newName !== file.oldName) { - templateName = "file-renamed"; - } - return templateName; - } - exports.getFileIcon = getFileIcon; - function diffHighlight(diffLine1, diffLine2, isCombined, config) { - if (config === void 0) { - config = {}; - } - var _a2 = __assign2(__assign2({}, exports.defaultRenderConfig), config), matching = _a2.matching, maxLineLengthHighlight = _a2.maxLineLengthHighlight, matchWordsThreshold = _a2.matchWordsThreshold, diffStyle = _a2.diffStyle; - var line1 = deconstructLine(diffLine1, isCombined, false); - var line2 = deconstructLine(diffLine2, isCombined, false); - if (line1.content.length > maxLineLengthHighlight || line2.content.length > maxLineLengthHighlight) { - return { - oldLine: { - prefix: line1.prefix, - content: escapeForHtml(line1.content) - }, - newLine: { - prefix: line2.prefix, - content: escapeForHtml(line2.content) - } - }; - } - var diff = diffStyle === "char" ? jsDiff.diffChars(line1.content, line2.content) : jsDiff.diffWordsWithSpace(line1.content, line2.content); - var changedWords = []; - if (diffStyle === "word" && matching === "words") { - var removed = diff.filter(function(element2) { - return element2.removed; - }); - var added = diff.filter(function(element2) { - return element2.added; - }); - var chunks = matcher(added, removed); - chunks.forEach(function(chunk) { - if (chunk[0].length === 1 && chunk[1].length === 1) { - var dist = distance(chunk[0][0], chunk[1][0]); - if (dist < matchWordsThreshold) { - changedWords.push(chunk[0][0]); - changedWords.push(chunk[1][0]); - } - } - }); - } - var highlightedLine = diff.reduce(function(highlightedLine2, part) { - var elemType = part.added ? "ins" : part.removed ? "del" : null; - var addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ""; - var escapedValue = escapeForHtml(part.value); - return elemType !== null ? "".concat(highlightedLine2, "<").concat(elemType).concat(addClass, ">").concat(escapedValue, "") : "".concat(highlightedLine2).concat(escapedValue); - }, ""); - return { - oldLine: { - prefix: line1.prefix, - content: removeInsElements(highlightedLine) - }, - newLine: { - prefix: line2.prefix, - content: removeDelElements(highlightedLine) - } - }; - } - exports.diffHighlight = diffHighlight; - } -}); - -// node_modules/diff2html/lib/file-list-renderer.js -var require_file_list_renderer = __commonJS({ - "node_modules/diff2html/lib/file-list-renderer.js"(exports) { - "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.render = void 0; - var renderUtils = __importStar2(require_render_utils()); - var baseTemplatesPath = "file-summary"; - var iconsBaseTemplatesPath = "icon"; - function render(diffFiles, hoganUtils) { - var files = diffFiles.map(function(file) { - return hoganUtils.render(baseTemplatesPath, "line", { - fileHtmlId: renderUtils.getHtmlId(file), - oldName: file.oldName, - newName: file.newName, - fileName: renderUtils.filenameDiff(file), - deletedLines: "-" + file.deletedLines, - addedLines: "+" + file.addedLines - }, { - fileIcon: hoganUtils.template(iconsBaseTemplatesPath, renderUtils.getFileIcon(file)) - }); - }).join("\n"); - return hoganUtils.render(baseTemplatesPath, "wrapper", { - filesNumber: diffFiles.length, - files - }); - } - exports.render = render; - } -}); - -// node_modules/diff2html/lib/line-by-line-renderer.js -var require_line_by_line_renderer = __commonJS({ - "node_modules/diff2html/lib/line-by-line-renderer.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultLineByLineRendererConfig = void 0; - var Rematch = __importStar2(require_rematch()); - var renderUtils = __importStar2(require_render_utils()); - var types_1 = require_types(); - exports.defaultLineByLineRendererConfig = __assign2(__assign2({}, renderUtils.defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); - var genericTemplatesPath = "generic"; - var baseTemplatesPath = "line-by-line"; - var iconsBaseTemplatesPath = "icon"; - var tagsBaseTemplatesPath = "tag"; - var LineByLineRenderer = function() { - function LineByLineRenderer2(hoganUtils, config) { - if (config === void 0) { - config = {}; - } - this.hoganUtils = hoganUtils; - this.config = __assign2(__assign2({}, exports.defaultLineByLineRendererConfig), config); - } - LineByLineRenderer2.prototype.render = function(diffFiles) { - var _this = this; - var diffsHtml = diffFiles.map(function(file) { - var diffs; - if (file.blocks.length) { - diffs = _this.generateFileHtml(file); - } else { - diffs = _this.generateEmptyDiff(); - } - return _this.makeFileDiffHtml(file, diffs); - }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath, "wrapper", { content: diffsHtml }); - }; - LineByLineRenderer2.prototype.makeFileDiffHtml = function(file, diffs) { - if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) - return ""; - var fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath, "file-diff"); - var filePathTemplate = this.hoganUtils.template(genericTemplatesPath, "file-path"); - var fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath, "file"); - var fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath, renderUtils.getFileIcon(file)); - return fileDiffTemplate.render({ - file, - fileHtmlId: renderUtils.getHtmlId(file), - diffs, - filePath: filePathTemplate.render({ - fileDiffName: renderUtils.filenameDiff(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - }; - LineByLineRenderer2.prototype.generateEmptyDiff = function() { - return this.hoganUtils.render(genericTemplatesPath, "empty-diff", { - contentClass: "d2h-code-line", - CSSLineClass: renderUtils.CSSLineClass - }); - }; - LineByLineRenderer2.prototype.generateFileHtml = function(file) { - var _this = this; - var matcher = Rematch.newMatcherFn(Rematch.newDistanceFn(function(e) { - return renderUtils.deconstructLine(e.content, file.isCombined).content; - })); - return file.blocks.map(function(block) { - var lines = _this.hoganUtils.render(genericTemplatesPath, "block-header", { - CSSLineClass: renderUtils.CSSLineClass, - blockHeader: file.isTooBig ? block.header : renderUtils.escapeForHtml(block.header), - lineClass: "d2h-code-linenumber", - contentClass: "d2h-code-line" - }); - _this.applyLineGroupping(block).forEach(function(_a2) { - var contextLines = _a2[0], oldLines = _a2[1], newLines = _a2[2]; - if (oldLines.length && newLines.length && !contextLines.length) { - _this.applyRematchMatching(oldLines, newLines, matcher).map(function(_a3) { - var oldLines2 = _a3[0], newLines2 = _a3[1]; - var _b2 = _this.processChangedLines(file.isCombined, oldLines2, newLines2), left2 = _b2.left, right2 = _b2.right; - lines += left2; - lines += right2; - }); - } else if (contextLines.length) { - contextLines.forEach(function(line) { - var _a3 = renderUtils.deconstructLine(line.content, file.isCombined), prefix = _a3.prefix, content = _a3.content; - lines += _this.generateSingleLineHtml({ - type: renderUtils.CSSLineClass.CONTEXT, - prefix, - content, - oldNumber: line.oldNumber, - newNumber: line.newNumber - }); - }); - } else if (oldLines.length || newLines.length) { - var _b = _this.processChangedLines(file.isCombined, oldLines, newLines), left = _b.left, right = _b.right; - lines += left; - lines += right; - } else { - console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); - } - }); - return lines; - }).join("\n"); - }; - LineByLineRenderer2.prototype.applyLineGroupping = function(block) { - var blockLinesGroups = []; - var oldLines = []; - var newLines = []; - for (var i = 0; i < block.lines.length; i++) { - var diffLine = block.lines[i]; - if (diffLine.type !== types_1.LineType.INSERT && newLines.length || diffLine.type === types_1.LineType.CONTEXT && oldLines.length > 0) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - if (diffLine.type === types_1.LineType.CONTEXT) { - blockLinesGroups.push([[diffLine], [], []]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length === 0) { - blockLinesGroups.push([[], [], [diffLine]]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length > 0) { - newLines.push(diffLine); - } else if (diffLine.type === types_1.LineType.DELETE) { - oldLines.push(diffLine); - } - } - if (oldLines.length || newLines.length) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - return blockLinesGroups; - }; - LineByLineRenderer2.prototype.applyRematchMatching = function(oldLines, newLines, matcher) { - var comparisons = oldLines.length * newLines.length; - var maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map(function(elem) { - return elem.content.length; - }))); - var doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); - return doMatching ? matcher(oldLines, newLines) : [[oldLines, newLines]]; - }; - LineByLineRenderer2.prototype.processChangedLines = function(isCombined, oldLines, newLines) { - var fileHtml = { - right: "", - left: "" - }; - var maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (var i = 0; i < maxLinesNumber; i++) { - var oldLine = oldLines[i]; - var newLine = newLines[i]; - var diff = oldLine !== void 0 && newLine !== void 0 ? renderUtils.diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - var preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.oldLine.prefix, - content: diff.oldLine.content, - type: renderUtils.CSSLineClass.DELETE_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(oldLine.content, isCombined)), { type: renderUtils.toCSSClass(oldLine.type) })), { oldNumber: oldLine.oldNumber, newNumber: oldLine.newNumber }) : void 0; - var preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.newLine.prefix, - content: diff.newLine.content, - type: renderUtils.CSSLineClass.INSERT_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(newLine.content, isCombined)), { type: renderUtils.toCSSClass(newLine.type) })), { oldNumber: newLine.oldNumber, newNumber: newLine.newNumber }) : void 0; - var _a2 = this.generateLineHtml(preparedOldLine, preparedNewLine), left = _a2.left, right = _a2.right; - fileHtml.left += left; - fileHtml.right += right; - } - return fileHtml; - }; - LineByLineRenderer2.prototype.generateLineHtml = function(oldLine, newLine) { - return { - left: this.generateSingleLineHtml(oldLine), - right: this.generateSingleLineHtml(newLine) - }; - }; - LineByLineRenderer2.prototype.generateSingleLineHtml = function(line) { - if (line === void 0) - return ""; - var lineNumberHtml = this.hoganUtils.render(baseTemplatesPath, "numbers", { - oldNumber: line.oldNumber || "", - newNumber: line.newNumber || "" - }); - return this.hoganUtils.render(genericTemplatesPath, "line", { - type: line.type, - lineClass: "d2h-code-linenumber", - contentClass: "d2h-code-line", - prefix: line.prefix === " " ? " " : line.prefix, - content: line.content, - lineNumber: lineNumberHtml - }); - }; - return LineByLineRenderer2; - }(); - exports.default = LineByLineRenderer; - } -}); - -// node_modules/diff2html/lib/side-by-side-renderer.js -var require_side_by_side_renderer = __commonJS({ - "node_modules/diff2html/lib/side-by-side-renderer.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultSideBySideRendererConfig = void 0; - var Rematch = __importStar2(require_rematch()); - var renderUtils = __importStar2(require_render_utils()); - var types_1 = require_types(); - exports.defaultSideBySideRendererConfig = __assign2(__assign2({}, renderUtils.defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); - var genericTemplatesPath = "generic"; - var baseTemplatesPath = "side-by-side"; - var iconsBaseTemplatesPath = "icon"; - var tagsBaseTemplatesPath = "tag"; - var SideBySideRenderer = function() { - function SideBySideRenderer2(hoganUtils, config) { - if (config === void 0) { - config = {}; - } - this.hoganUtils = hoganUtils; - this.config = __assign2(__assign2({}, exports.defaultSideBySideRendererConfig), config); - } - SideBySideRenderer2.prototype.render = function(diffFiles) { - var _this = this; - var diffsHtml = diffFiles.map(function(file) { - var diffs; - if (file.blocks.length) { - diffs = _this.generateFileHtml(file); - } else { - diffs = _this.generateEmptyDiff(); - } - return _this.makeFileDiffHtml(file, diffs); - }).join("\n"); - return this.hoganUtils.render(genericTemplatesPath, "wrapper", { content: diffsHtml }); - }; - SideBySideRenderer2.prototype.makeFileDiffHtml = function(file, diffs) { - if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) - return ""; - var fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath, "file-diff"); - var filePathTemplate = this.hoganUtils.template(genericTemplatesPath, "file-path"); - var fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath, "file"); - var fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath, renderUtils.getFileIcon(file)); - return fileDiffTemplate.render({ - file, - fileHtmlId: renderUtils.getHtmlId(file), - diffs, - filePath: filePathTemplate.render({ - fileDiffName: renderUtils.filenameDiff(file) - }, { - fileIcon: fileIconTemplate, - fileTag: fileTagTemplate - }) - }); - }; - SideBySideRenderer2.prototype.generateEmptyDiff = function() { - return { - right: "", - left: this.hoganUtils.render(genericTemplatesPath, "empty-diff", { - contentClass: "d2h-code-side-line", - CSSLineClass: renderUtils.CSSLineClass - }) - }; - }; - SideBySideRenderer2.prototype.generateFileHtml = function(file) { - var _this = this; - var matcher = Rematch.newMatcherFn(Rematch.newDistanceFn(function(e) { - return renderUtils.deconstructLine(e.content, file.isCombined).content; - })); - return file.blocks.map(function(block) { - var fileHtml = { - left: _this.makeHeaderHtml(block.header, file), - right: _this.makeHeaderHtml("") - }; - _this.applyLineGroupping(block).forEach(function(_a2) { - var contextLines = _a2[0], oldLines = _a2[1], newLines = _a2[2]; - if (oldLines.length && newLines.length && !contextLines.length) { - _this.applyRematchMatching(oldLines, newLines, matcher).map(function(_a3) { - var oldLines2 = _a3[0], newLines2 = _a3[1]; - var _b2 = _this.processChangedLines(file.isCombined, oldLines2, newLines2), left2 = _b2.left, right2 = _b2.right; - fileHtml.left += left2; - fileHtml.right += right2; - }); - } else if (contextLines.length) { - contextLines.forEach(function(line) { - var _a3 = renderUtils.deconstructLine(line.content, file.isCombined), prefix = _a3.prefix, content = _a3.content; - var _b2 = _this.generateLineHtml({ - type: renderUtils.CSSLineClass.CONTEXT, - prefix, - content, - number: line.oldNumber - }, { - type: renderUtils.CSSLineClass.CONTEXT, - prefix, - content, - number: line.newNumber - }), left2 = _b2.left, right2 = _b2.right; - fileHtml.left += left2; - fileHtml.right += right2; - }); - } else if (oldLines.length || newLines.length) { - var _b = _this.processChangedLines(file.isCombined, oldLines, newLines), left = _b.left, right = _b.right; - fileHtml.left += left; - fileHtml.right += right; - } else { - console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); - } - }); - return fileHtml; - }).reduce(function(accomulated, html2) { - return { left: accomulated.left + html2.left, right: accomulated.right + html2.right }; - }, { left: "", right: "" }); - }; - SideBySideRenderer2.prototype.applyLineGroupping = function(block) { - var blockLinesGroups = []; - var oldLines = []; - var newLines = []; - for (var i = 0; i < block.lines.length; i++) { - var diffLine = block.lines[i]; - if (diffLine.type !== types_1.LineType.INSERT && newLines.length || diffLine.type === types_1.LineType.CONTEXT && oldLines.length > 0) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - if (diffLine.type === types_1.LineType.CONTEXT) { - blockLinesGroups.push([[diffLine], [], []]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length === 0) { - blockLinesGroups.push([[], [], [diffLine]]); - } else if (diffLine.type === types_1.LineType.INSERT && oldLines.length > 0) { - newLines.push(diffLine); - } else if (diffLine.type === types_1.LineType.DELETE) { - oldLines.push(diffLine); - } - } - if (oldLines.length || newLines.length) { - blockLinesGroups.push([[], oldLines, newLines]); - oldLines = []; - newLines = []; - } - return blockLinesGroups; - }; - SideBySideRenderer2.prototype.applyRematchMatching = function(oldLines, newLines, matcher) { - var comparisons = oldLines.length * newLines.length; - var maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map(function(elem) { - return elem.content.length; - }))); - var doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); - return doMatching ? matcher(oldLines, newLines) : [[oldLines, newLines]]; - }; - SideBySideRenderer2.prototype.makeHeaderHtml = function(blockHeader, file) { - return this.hoganUtils.render(genericTemplatesPath, "block-header", { - CSSLineClass: renderUtils.CSSLineClass, - blockHeader: (file === null || file === void 0 ? void 0 : file.isTooBig) ? blockHeader : renderUtils.escapeForHtml(blockHeader), - lineClass: "d2h-code-side-linenumber", - contentClass: "d2h-code-side-line" - }); - }; - SideBySideRenderer2.prototype.processChangedLines = function(isCombined, oldLines, newLines) { - var fileHtml = { - right: "", - left: "" - }; - var maxLinesNumber = Math.max(oldLines.length, newLines.length); - for (var i = 0; i < maxLinesNumber; i++) { - var oldLine = oldLines[i]; - var newLine = newLines[i]; - var diff = oldLine !== void 0 && newLine !== void 0 ? renderUtils.diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; - var preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.oldLine.prefix, - content: diff.oldLine.content, - type: renderUtils.CSSLineClass.DELETE_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(oldLine.content, isCombined)), { type: renderUtils.toCSSClass(oldLine.type) })), { number: oldLine.oldNumber }) : void 0; - var preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? __assign2(__assign2({}, diff !== void 0 ? { - prefix: diff.newLine.prefix, - content: diff.newLine.content, - type: renderUtils.CSSLineClass.INSERT_CHANGES - } : __assign2(__assign2({}, renderUtils.deconstructLine(newLine.content, isCombined)), { type: renderUtils.toCSSClass(newLine.type) })), { number: newLine.newNumber }) : void 0; - var _a2 = this.generateLineHtml(preparedOldLine, preparedNewLine), left = _a2.left, right = _a2.right; - fileHtml.left += left; - fileHtml.right += right; - } - return fileHtml; - }; - SideBySideRenderer2.prototype.generateLineHtml = function(oldLine, newLine) { - return { - left: this.generateSingleHtml(oldLine), - right: this.generateSingleHtml(newLine) - }; - }; - SideBySideRenderer2.prototype.generateSingleHtml = function(line) { - var lineClass = "d2h-code-side-linenumber"; - var contentClass = "d2h-code-side-line"; - return this.hoganUtils.render(genericTemplatesPath, "line", { - type: (line === null || line === void 0 ? void 0 : line.type) || "".concat(renderUtils.CSSLineClass.CONTEXT, " d2h-emptyplaceholder"), - lineClass: line !== void 0 ? lineClass : "".concat(lineClass, " d2h-code-side-emptyplaceholder"), - contentClass: line !== void 0 ? contentClass : "".concat(contentClass, " d2h-code-side-emptyplaceholder"), - prefix: (line === null || line === void 0 ? void 0 : line.prefix) === " " ? " " : line === null || line === void 0 ? void 0 : line.prefix, - content: line === null || line === void 0 ? void 0 : line.content, - lineNumber: line === null || line === void 0 ? void 0 : line.number - }); - }; - return SideBySideRenderer2; - }(); - exports.default = SideBySideRenderer; - } -}); - // node_modules/hogan.js/lib/compiler.js var require_compiler = __commonJS({ "node_modules/hogan.js/lib/compiler.js"(exports) { - (function(Hogan2) { + init_polyfill_buffer(); + (function(Hogan4) { var rIsWhitespace = /\S/, rQuot = /\"/g, rNewline = /\n/g, rCr = /\r/g, rSlash = /\\/g, rLineSep = /\u2028/, rParagraphSep = /\u2029/; - Hogan2.tags = { + Hogan4.tags = { "#": 1, "^": 2, "<": 3, @@ -3746,8 +7790,8 @@ var require_compiler = __commonJS({ "&": 11, "_t": 12 }; - Hogan2.scan = function scan(text2, delimiters) { - var len = text2.length, IN_TEXT = 0, IN_TAG_TYPE = 1, IN_TAG = 2, state = IN_TEXT, tagType = null, tag = null, buf = "", tokens = [], seenTag = false, i = 0, lineStart = 0, otag = "{{", ctag = "}}"; + Hogan4.scan = function scan(text2, delimiters) { + var len = text2.length, IN_TEXT = 0, IN_TAG_TYPE = 1, IN_TAG = 2, state = IN_TEXT, tagType = null, tag2 = null, buf = "", tokens = [], seenTag = false, i = 0, lineStart = 0, otag = "{{", ctag = "}}"; function addBuf() { if (buf.length > 0) { tokens.push({ tag: "_t", text: new String(buf) }); @@ -3757,7 +7801,7 @@ var require_compiler = __commonJS({ function lineIsWhitespace() { var isAllWhitespace = true; for (var j = lineStart; j < tokens.length; j++) { - isAllWhitespace = Hogan2.tags[tokens[j].tag] < Hogan2.tags["_v"] || tokens[j].tag == "_t" && tokens[j].text.match(rIsWhitespace) === null; + isAllWhitespace = Hogan4.tags[tokens[j].tag] < Hogan4.tags["_v"] || tokens[j].tag == "_t" && tokens[j].text.match(rIsWhitespace) === null; if (!isAllWhitespace) { return false; } @@ -3781,8 +7825,8 @@ var require_compiler = __commonJS({ seenTag = false; lineStart = tokens.length; } - function changeDelimiters(text3, index) { - var close = "=" + ctag, closeIndex = text3.indexOf(close, index), delimiters2 = trim(text3.substring(text3.indexOf("=", index) + 1, closeIndex)).split(" "); + function changeDelimiters(text3, index2) { + var close = "=" + ctag, closeIndex = text3.indexOf(close, index2), delimiters2 = trim(text3.substring(text3.indexOf("=", index2) + 1, closeIndex)).split(" "); otag = delimiters2[0]; ctag = delimiters2[delimiters2.length - 1]; return closeIndex + close.length - 1; @@ -3807,13 +7851,13 @@ var require_compiler = __commonJS({ } } else if (state == IN_TAG_TYPE) { i += otag.length - 1; - tag = Hogan2.tags[text2.charAt(i + 1)]; - tagType = tag ? text2.charAt(i + 1) : "_v"; + tag2 = Hogan4.tags[text2.charAt(i + 1)]; + tagType = tag2 ? text2.charAt(i + 1) : "_v"; if (tagType == "=") { i = changeDelimiters(text2, i); state = IN_TEXT; } else { - if (tag) { + if (tag2) { i++; } state = IN_TAG; @@ -3857,12 +7901,12 @@ var require_compiler = __commonJS({ } return s.replace(/^\s*|\s*$/g, ""); } - function tagChange(tag, text2, index) { - if (text2.charAt(index) != tag.charAt(0)) { + function tagChange(tag2, text2, index2) { + if (text2.charAt(index2) != tag2.charAt(0)) { return false; } - for (var i = 1, l = tag.length; i < l; i++) { - if (text2.charAt(index + i) != tag.charAt(i)) { + for (var i = 1, l = tag2.length; i < l; i++) { + if (text2.charAt(index2 + i) != tag2.charAt(i)) { return false; } } @@ -3877,7 +7921,7 @@ var require_compiler = __commonJS({ if (tail && tail.tag == "<" && !(token.tag in allowedInSuper)) { throw new Error("Illegal content in < super tag."); } - if (Hogan2.tags[token.tag] <= Hogan2.tags["$"] || isOpener(token, customTags)) { + if (Hogan4.tags[token.tag] <= Hogan4.tags["$"] || isOpener(token, customTags)) { stack.push(token); token.nodes = buildTree(tokens, token.tag, stack, customTags); } else if (token.tag == "/") { @@ -3929,29 +7973,29 @@ var require_compiler = __commonJS({ } return "partials: {" + partials.join(",") + "}, subs: " + stringifySubstitutions(codeObj.subs); } - Hogan2.stringify = function(codeObj, text2, options) { - return "{code: function (c,p,i) { " + Hogan2.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}"; + Hogan4.stringify = function(codeObj, text2, options) { + return "{code: function (c,p,i) { " + Hogan4.wrapMain(codeObj.code) + " }," + stringifyPartials(codeObj) + "}"; }; var serialNo = 0; - Hogan2.generate = function(tree, text2, options) { + Hogan4.generate = function(tree, text2, options) { serialNo = 0; var context = { code: "", subs: {}, partials: {} }; - Hogan2.walk(tree, context); + Hogan4.walk(tree, context); if (options.asString) { return this.stringify(context, text2, options); } return this.makeTemplate(context, text2, options); }; - Hogan2.wrapMain = function(code) { + Hogan4.wrapMain = function(code) { return 'var t=this;t.b(i=i||"");' + code + "return t.fl();"; }; - Hogan2.template = Hogan2.Template; - Hogan2.makeTemplate = function(codeObj, text2, options) { + Hogan4.template = Hogan4.Template; + Hogan4.makeTemplate = function(codeObj, text2, options) { var template = this.makePartials(codeObj); template.code = new Function("c", "p", "i", this.wrapMain(codeObj.code)); return new this.template(template, text2, this, options); }; - Hogan2.makePartials = function(codeObj) { + Hogan4.makePartials = function(codeObj) { var key2, template = { subs: {}, partials: codeObj.partials, name: codeObj.name }; for (key2 in template.partials) { template.partials[key2] = this.makePartials(template.partials[key2]); @@ -3974,28 +8018,28 @@ var require_compiler = __commonJS({ context.code += 't.b(t.rp("' + esc(sym) + '",c,p,"' + (node.indent || "") + '"));'; return sym; } - Hogan2.codegen = { + Hogan4.codegen = { "#": function(node, context) { context.code += "if(t.s(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,0,' + node.i + "," + node.end + ',"' + node.otag + " " + node.ctag + '")){t.rs(c,p,function(c,p,t){'; - Hogan2.walk(node.nodes, context); + Hogan4.walk(node.nodes, context); context.code += "});c.pop();}"; }, "^": function(node, context) { context.code += "if(!t.s(t." + chooseMethod(node.n) + '("' + esc(node.n) + '",c,p,1),c,p,1,0,0,"")){'; - Hogan2.walk(node.nodes, context); + Hogan4.walk(node.nodes, context); context.code += "};"; }, ">": createPartial, "<": function(node, context) { var ctx = { partials: {}, code: "", subs: {}, inPartial: true }; - Hogan2.walk(node.nodes, ctx); + Hogan4.walk(node.nodes, ctx); var template = context.partials[createPartial(node, context)]; template.subs = ctx.subs; template.partials = ctx.partials; }, "$": function(node, context) { var ctx = { subs: {}, code: "", partials: context.partials, prefix: node.n }; - Hogan2.walk(node.nodes, ctx); + Hogan4.walk(node.nodes, ctx); context.subs[node.n] = ctx.code; if (!context.inPartial) { context.code += 't.sub("' + esc(node.n) + '",c,p,i);'; @@ -4019,25 +8063,25 @@ var require_compiler = __commonJS({ function write(s) { return "t.b(" + s + ");"; } - Hogan2.walk = function(nodelist, context) { + Hogan4.walk = function(nodelist, context) { var func; for (var i = 0, l = nodelist.length; i < l; i++) { - func = Hogan2.codegen[nodelist[i].tag]; + func = Hogan4.codegen[nodelist[i].tag]; func && func(nodelist[i], context); } return context; }; - Hogan2.parse = function(tokens, text2, options) { + Hogan4.parse = function(tokens, text2, options) { options = options || {}; return buildTree(tokens, "", [], options.sectionTags || []); }; - Hogan2.cache = {}; - Hogan2.cacheKey = function(text2, options) { + Hogan4.cache = {}; + Hogan4.cacheKey = function(text2, options) { return [text2, !!options.asString, !!options.disableLambda, options.delimiters, !!options.modelGet].join("||"); }; - Hogan2.compile = function(text2, options) { + Hogan4.compile = function(text2, options) { options = options || {}; - var key2 = Hogan2.cacheKey(text2, options); + var key2 = Hogan4.cacheKey(text2, options); var template = this.cache[key2]; if (template) { var partials = template.partials; @@ -4056,9 +8100,10 @@ var require_compiler = __commonJS({ // node_modules/hogan.js/lib/template.js var require_template = __commonJS({ "node_modules/hogan.js/lib/template.js"(exports) { - var Hogan2 = {}; - (function(Hogan3) { - Hogan3.Template = function(codeObj, text2, compiler, options) { + init_polyfill_buffer(); + var Hogan4 = {}; + (function(Hogan5) { + Hogan5.Template = function(codeObj, text2, compiler, options) { codeObj = codeObj || {}; this.r = codeObj.code || this.r; this.c = compiler; @@ -4068,17 +8113,17 @@ var require_template = __commonJS({ this.subs = codeObj.subs || {}; this.buf = ""; }; - Hogan3.Template.prototype = { - r: function(context, partials, indent) { + Hogan5.Template.prototype = { + r: function(context, partials, indent2) { return ""; }, v: hoganEscape, t: coerceToString, - render: function render(context, partials, indent) { - return this.ri([context], partials || {}, indent); + render: function render2(context, partials, indent2) { + return this.ri([context], partials || {}, indent2); }, - ri: function(context, partials, indent) { - return this.r(context, partials, indent); + ri: function(context, partials, indent2) { + return this.r(context, partials, indent2); }, ep: function(symbol, partials) { var partial = this.partials[symbol]; @@ -4109,12 +8154,12 @@ var require_template = __commonJS({ this.partials[symbol].instance = template; return template; }, - rp: function(symbol, context, partials, indent) { + rp: function(symbol, context, partials, indent2) { var partial = this.ep(symbol, partials); if (!partial) { return ""; } - return partial.ri(context, partials, indent); + return partial.ri(context, partials, indent2); }, rs: function(context, partials, section) { var tail = context[context.length - 1]; @@ -4226,11 +8271,11 @@ var require_template = __commonJS({ } return result; }, - sub: function(name, context, partials, indent) { + sub: function(name, context, partials, indent2) { var f = this.subs[name]; if (f) { this.activeSub = name; - f(context, partials, this, indent); + f(context, partials, this, indent2); this.activeSub = false; } } @@ -4246,15 +8291,15 @@ var require_template = __commonJS({ } return val; } - function createSpecializedPartial(instance5, subs, partials, stackSubs, stackPartials, stackText) { + function createSpecializedPartial(instance6, subs, partials, stackSubs, stackPartials, stackText) { function PartialTemplate() { } ; - PartialTemplate.prototype = instance5; + PartialTemplate.prototype = instance6; function Substitutions() { } ; - Substitutions.prototype = instance5.subs; + Substitutions.prototype = instance6.subs; var key2; var partial = new PartialTemplate(); partial.subs = new Substitutions(); @@ -4292,1065 +8337,25 @@ var require_template = __commonJS({ var isArray = Array.isArray || function(a) { return Object.prototype.toString.call(a) === "[object Array]"; }; - })(typeof exports !== "undefined" ? exports : Hogan2); + })(typeof exports !== "undefined" ? exports : Hogan4); } }); // node_modules/hogan.js/lib/hogan.js var require_hogan = __commonJS({ "node_modules/hogan.js/lib/hogan.js"(exports, module2) { - var Hogan2 = require_compiler(); - Hogan2.Template = require_template().Template; - Hogan2.template = Hogan2.Template; - module2.exports = Hogan2; - } -}); - -// node_modules/diff2html/lib/diff2html-templates.js -var require_diff2html_templates = __commonJS({ - "node_modules/diff2html/lib/diff2html-templates.js"(exports) { - "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.defaultTemplates = void 0; - var Hogan2 = __importStar2(require_hogan()); - exports.defaultTemplates = {}; - exports.defaultTemplates["file-summary-line"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
  • '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(t.rp("'); - t.b(t.v(t.f("fileName", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b(t.v(t.f("addedLines", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b(t.v(t.f("deletedLines", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
  • "); - return t.fl(); - }, partials: { "'); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' Files changed ('); - t.b(t.v(t.f("filesNumber", c, p, 0))); - t.b(")"); - t.b("\n" + i); - t.b(' hide'); - t.b("\n" + i); - t.b(' show'); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
      '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("files", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-block-header"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b(t.t(t.f("blockHeader", c, p, 0))); - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-empty-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" File without changes"); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-file-path"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b(''); - t.b("\n" + i); - t.b(t.rp("'); - t.b(t.v(t.f("fileDiffName", c, p, 0))); - t.b(""); - t.b("\n" + i); - t.b(t.rp(""); - t.b("\n" + i); - t.b('"); - return t.fl(); - }, partials: { ""); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("lineNumber", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - if (t.s(t.f("prefix", c, p, 1), c, p, 0, 162, 238, "{{ }}")) { - t.rs(c, p, function(c2, p2, t2) { - t2.b(' '); - t2.b(t2.t(t2.f("prefix", c2, p2, 0))); - t2.b(""); - t2.b("\n" + i); - }); - c.pop(); - } - if (!t.s(t.f("prefix", c, p, 1), c, p, 1, 0, 0, "")) { - t.b('  '); - t.b("\n" + i); - } - ; - if (t.s(t.f("content", c, p, 1), c, p, 0, 371, 445, "{{ }}")) { - t.rs(c, p, function(c2, p2, t2) { - t2.b(' '); - t2.b(t2.t(t2.f("content", c2, p2, 0))); - t2.b(""); - t2.b("\n" + i); - }); - c.pop(); - } - if (!t.s(t.f("content", c, p, 1), c, p, 1, 0, 0, "")) { - t.b('
    '); - t.b("\n" + i); - } - ; - t.b("
    "); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b(""); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["generic-wrapper"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("content", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-added"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["icon-file"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('"); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["line-by-line-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("filePath", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("diffs", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["line-by-line-numbers"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b(t.v(t.f("oldNumber", c, p, 0))); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b(t.v(t.f("newNumber", c, p, 0))); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["side-by-side-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.f("filePath", c, p, 0))); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.d("diffs.left", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b('
    '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(' '); - t.b("\n" + i); - t.b(" "); - t.b(t.t(t.d("diffs.right", c, p, 0))); - t.b("\n" + i); - t.b(" "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - t.b("\n" + i); - t.b("
    "); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-added"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('ADDED'); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('CHANGED'); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('DELETED'); - return t.fl(); - }, partials: {}, subs: {} }); - exports.defaultTemplates["tag-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { - var t = this; - t.b(i = i || ""); - t.b('RENAMED'); - return t.fl(); - }, partials: {}, subs: {} }); - } -}); - -// node_modules/diff2html/lib/hoganjs-utils.js -var require_hoganjs_utils = __commonJS({ - "node_modules/diff2html/lib/hoganjs-utils.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - var Hogan2 = __importStar2(require_hogan()); - var diff2html_templates_1 = require_diff2html_templates(); - var HoganJsUtils = function() { - function HoganJsUtils2(_a2) { - var _b = _a2.compiledTemplates, compiledTemplates = _b === void 0 ? {} : _b, _c = _a2.rawTemplates, rawTemplates = _c === void 0 ? {} : _c; - var compiledRawTemplates = Object.entries(rawTemplates).reduce(function(previousTemplates, _a3) { - var _b2; - var name = _a3[0], templateString = _a3[1]; - var compiledTemplate = Hogan2.compile(templateString, { asString: false }); - return __assign2(__assign2({}, previousTemplates), (_b2 = {}, _b2[name] = compiledTemplate, _b2)); - }, {}); - this.preCompiledTemplates = __assign2(__assign2(__assign2({}, diff2html_templates_1.defaultTemplates), compiledTemplates), compiledRawTemplates); - } - HoganJsUtils2.compile = function(templateString) { - return Hogan2.compile(templateString, { asString: false }); - }; - HoganJsUtils2.prototype.render = function(namespace, view, params, partials, indent) { - var templateKey = this.templateKey(namespace, view); - try { - var template = this.preCompiledTemplates[templateKey]; - return template.render(params, partials, indent); - } catch (e) { - throw new Error("Could not find template to render '".concat(templateKey, "'")); - } - }; - HoganJsUtils2.prototype.template = function(namespace, view) { - return this.preCompiledTemplates[this.templateKey(namespace, view)]; - }; - HoganJsUtils2.prototype.templateKey = function(namespace, view) { - return "".concat(namespace, "-").concat(view); - }; - return HoganJsUtils2; - }(); - exports.default = HoganJsUtils; - } -}); - -// node_modules/diff2html/lib/diff2html.js -var require_diff2html = __commonJS({ - "node_modules/diff2html/lib/diff2html.js"(exports) { - "use strict"; - var __assign2 = exports && exports.__assign || function() { - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign2.apply(this, arguments); - }; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }); - var __importStar2 = exports && exports.__importStar || function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - var __importDefault2 = exports && exports.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.html = exports.parse = exports.defaultDiff2HtmlConfig = void 0; - var DiffParser = __importStar2(require_diff_parser()); - var fileListPrinter = __importStar2(require_file_list_renderer()); - var line_by_line_renderer_1 = __importStar2(require_line_by_line_renderer()); - var side_by_side_renderer_1 = __importStar2(require_side_by_side_renderer()); - var types_1 = require_types(); - var hoganjs_utils_1 = __importDefault2(require_hoganjs_utils()); - exports.defaultDiff2HtmlConfig = __assign2(__assign2(__assign2({}, line_by_line_renderer_1.defaultLineByLineRendererConfig), side_by_side_renderer_1.defaultSideBySideRendererConfig), { outputFormat: types_1.OutputFormatType.LINE_BY_LINE, drawFileList: true }); - function parse(diffInput, configuration) { - if (configuration === void 0) { - configuration = {}; - } - return DiffParser.parse(diffInput, __assign2(__assign2({}, exports.defaultDiff2HtmlConfig), configuration)); - } - exports.parse = parse; - function html2(diffInput, configuration) { - if (configuration === void 0) { - configuration = {}; - } - var config = __assign2(__assign2({}, exports.defaultDiff2HtmlConfig), configuration); - var diffJson = typeof diffInput === "string" ? DiffParser.parse(diffInput, config) : diffInput; - var hoganUtils = new hoganjs_utils_1.default(config); - var fileList = config.drawFileList ? fileListPrinter.render(diffJson, hoganUtils) : ""; - var diffOutput = config.outputFormat === "side-by-side" ? new side_by_side_renderer_1.default(hoganUtils, config).render(diffJson) : new line_by_line_renderer_1.default(hoganUtils, config).render(diffJson); - return fileList + diffOutput; - } - exports.html = html2; - } -}); - -// node_modules/tslib/tslib.js -var require_tslib = __commonJS({ - "node_modules/tslib/tslib.js"(exports, module2) { - var __extends2; - var __assign2; - var __rest2; - var __decorate2; - var __param2; - var __metadata2; - var __awaiter2; - var __generator2; - var __exportStar2; - var __values2; - var __read2; - var __spread2; - var __spreadArrays2; - var __spreadArray2; - var __await2; - var __asyncGenerator2; - var __asyncDelegator2; - var __asyncValues2; - var __makeTemplateObject2; - var __importStar2; - var __importDefault2; - var __classPrivateFieldGet2; - var __classPrivateFieldSet2; - var __classPrivateFieldIn2; - var __createBinding2; - (function(factory) { - var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {}; - if (typeof define === "function" && define.amd) { - define("tslib", ["exports"], function(exports2) { - factory(createExporter(root, createExporter(exports2))); - }); - } else if (typeof module2 === "object" && typeof module2.exports === "object") { - factory(createExporter(root, createExporter(module2.exports))); - } else { - factory(createExporter(root)); - } - function createExporter(exports2, previous) { - if (exports2 !== root) { - if (typeof Object.create === "function") { - Object.defineProperty(exports2, "__esModule", { value: true }); - } else { - exports2.__esModule = true; - } - } - return function(id, v) { - return exports2[id] = previous ? previous(id, v) : v; - }; - } - })(function(exporter) { - var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) { - d.__proto__ = b; - } || function(d, b) { - for (var p in b) - if (Object.prototype.hasOwnProperty.call(b, p)) - d[p] = b[p]; - }; - __extends2 = function(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; - __assign2 = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - __rest2 = function(s, e) { - var t = {}; - for (var p in s) - if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; - }; - __decorate2 = function(decorators, target, key2, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key2) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") - r = Reflect.decorate(decorators, target, key2, desc); - else - for (var i = decorators.length - 1; i >= 0; i--) - if (d = decorators[i]) - r = (c < 3 ? d(r) : c > 3 ? d(target, key2, r) : d(target, key2)) || r; - return c > 3 && r && Object.defineProperty(target, key2, r), r; - }; - __param2 = function(paramIndex, decorator) { - return function(target, key2) { - decorator(target, key2, paramIndex); - }; - }; - __metadata2 = function(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") - return Reflect.metadata(metadataKey, metadataValue); - }; - __awaiter2 = 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()); - }); - }; - __generator2 = function(thisArg, body) { - var _ = { label: 0, sent: function() { - if (t[0] & 1) - throw t[1]; - return t[1]; - }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { - return this; - }), g; - function verb(n) { - return function(v) { - return step([n, v]); - }; - } - function step(op) { - if (f) - throw new TypeError("Generator is already executing."); - while (_) - try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) - return t; - if (y = 0, t) - op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: - case 1: - t = op; - break; - case 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) - _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; - } - if (op[0] & 5) - throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } - }; - __exportStar2 = function(m, o) { - for (var p in m) - if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) - __createBinding2(o, m, p); - }; - __createBinding2 = Object.create ? function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m[k]; - } }; - } - Object.defineProperty(o, k2, desc); - } : function(o, m, k, k2) { - if (k2 === void 0) - k2 = k; - o[k2] = m[k]; - }; - __values2 = function(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) - return m.call(o); - if (o && typeof o.length === "number") - return { - next: function() { - if (o && i >= o.length) - o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); - }; - __read2 = function(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) - return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) - ar.push(r.value); - } catch (error) { - e = { error }; - } finally { - try { - if (r && !r.done && (m = i["return"])) - m.call(i); - } finally { - if (e) - throw e.error; - } - } - return ar; - }; - __spread2 = function() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; - }; - __spreadArrays2 = function() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) - s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; - }; - __spreadArray2 = function(to, from, pack) { - if (pack || arguments.length === 2) - for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) - ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); - }; - __await2 = function(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); - }; - __asyncGenerator2 = function(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) - i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); - } - function reject(value) { - resume("throw", value); - } - function settle(f, v) { - if (f(v), q.shift(), q.length) - resume(q[0][0], q[0][1]); - } - }; - __asyncDelegator2 = function(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function(e) { - throw e; - }), verb("return"), i[Symbol.iterator] = function() { - return this; - }, i; - function verb(n, f) { - i[n] = o[n] ? function(v) { - return (p = !p) ? { value: __await2(o[n](v)), done: n === "return" } : f ? f(v) : v; - } : f; - } - }; - __asyncValues2 = function(o) { - if (!Symbol.asyncIterator) - throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values2 === "function" ? __values2(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i); - function verb(n) { - i[n] = o[n] && function(v) { - return new Promise(function(resolve, reject) { - v = o[n](v), settle(resolve, reject, v.done, v.value); - }); - }; - } - function settle(resolve, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve({ value: v2, done: d }); - }, reject); - } - }; - __makeTemplateObject2 = function(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; - }; - var __setModuleDefault = Object.create ? function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - } : function(o, v) { - o["default"] = v; - }; - __importStar2 = function(mod) { - if (mod && mod.__esModule) - return mod; - var result = {}; - if (mod != null) { - for (var k in mod) - if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding2(result, mod, k); - } - __setModuleDefault(result, mod); - return result; - }; - __importDefault2 = function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - __classPrivateFieldGet2 = function(receiver, state, kind, f) { - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); - }; - __classPrivateFieldSet2 = function(receiver, state, value, kind, f) { - if (kind === "m") - throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) - throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) - throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value; - }; - __classPrivateFieldIn2 = function(state, receiver) { - if (receiver === null || typeof receiver !== "object" && typeof receiver !== "function") - throw new TypeError("Cannot use 'in' operator on non-object"); - return typeof state === "function" ? receiver === state : state.has(receiver); - }; - exporter("__extends", __extends2); - exporter("__assign", __assign2); - exporter("__rest", __rest2); - exporter("__decorate", __decorate2); - exporter("__param", __param2); - exporter("__metadata", __metadata2); - exporter("__awaiter", __awaiter2); - exporter("__generator", __generator2); - exporter("__exportStar", __exportStar2); - exporter("__createBinding", __createBinding2); - exporter("__values", __values2); - exporter("__read", __read2); - exporter("__spread", __spread2); - exporter("__spreadArrays", __spreadArrays2); - exporter("__spreadArray", __spreadArray2); - exporter("__await", __await2); - exporter("__asyncGenerator", __asyncGenerator2); - exporter("__asyncDelegator", __asyncDelegator2); - exporter("__asyncValues", __asyncValues2); - exporter("__makeTemplateObject", __makeTemplateObject2); - exporter("__importStar", __importStar2); - exporter("__importDefault", __importDefault2); - exporter("__classPrivateFieldGet", __classPrivateFieldGet2); - exporter("__classPrivateFieldSet", __classPrivateFieldSet2); - exporter("__classPrivateFieldIn", __classPrivateFieldIn2); - }); + init_polyfill_buffer(); + var Hogan4 = require_compiler(); + Hogan4.Template = require_template().Template; + Hogan4.template = Hogan4.Template; + module2.exports = Hogan4; } }); // node_modules/feather-icons/dist/feather.js var require_feather = __commonJS({ "node_modules/feather-icons/dist/feather.js"(exports, module2) { + init_polyfill_buffer(); (function webpackUniversalModuleDefinition(root, factory) { if (typeof exports === "object" && typeof module2 === "object") module2.exports = factory(); @@ -5423,8 +8428,8 @@ var require_feather = __commonJS({ } } var hasOwn = {}.hasOwnProperty; - function _parseNumber(resultSet, num) { - resultSet[num] = true; + function _parseNumber(resultSet, num2) { + resultSet[num2] = true; } function _parseObject(resultSet, object) { for (var k in object) { @@ -5486,8 +8491,8 @@ var require_feather = __commonJS({ "./node_modules/core-js/es/array/from.js": function(module3, exports2, __webpack_require__) { __webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"); __webpack_require__("./node_modules/core-js/modules/es.array.from.js"); - var path3 = __webpack_require__("./node_modules/core-js/internals/path.js"); - module3.exports = path3.Array.from; + var path2 = __webpack_require__("./node_modules/core-js/internals/path.js"); + module3.exports = path2.Array.from; }, "./node_modules/core-js/internals/a-function.js": function(module3, exports2) { module3.exports = function(it) { @@ -5521,7 +8526,7 @@ var require_feather = __commonJS({ var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : void 0; var mapping = mapfn !== void 0; - var index = 0; + var index2 = 0; var iteratorMethod = getIteratorMethod(O); var length, result, step, iterator; if (mapping) @@ -5529,17 +8534,17 @@ var require_feather = __commonJS({ if (iteratorMethod != void 0 && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { iterator = iteratorMethod.call(O); result = new C(); - for (; !(step = iterator.next()).done; index++) { - createProperty(result, index, mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value); + for (; !(step = iterator.next()).done; index2++) { + createProperty(result, index2, mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index2], true) : step.value); } } else { length = toLength(O.length); result = new C(length); - for (; length > index; index++) { - createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + for (; length > index2; index2++) { + createProperty(result, index2, mapping ? mapfn(O[index2], index2) : O[index2]); } } - result.length = index; + result.length = index2; return result; }; }, @@ -5551,19 +8556,19 @@ var require_feather = __commonJS({ return function($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); - var index = toAbsoluteIndex(fromIndex, length); + var index2 = toAbsoluteIndex(fromIndex, length); var value; if (IS_INCLUDES && el != el) - while (length > index) { - value = O[index++]; + while (length > index2) { + value = O[index2++]; if (value != value) return true; } else - for (; length > index; index++) - if (IS_INCLUDES || index in O) { - if (O[index] === el) - return IS_INCLUDES || index || 0; + for (; length > index2; index2++) + if (IS_INCLUDES || index2 in O) { + if (O[index2] === el) + return IS_INCLUDES || index2 || 0; } return !IS_INCLUDES && -1; }; @@ -5672,8 +8677,8 @@ var require_feather = __commonJS({ } }; module3.exports = function(it) { - var O, tag, result; - return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : result; + var O, tag2, result; + return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag2 = tryGet(O = Object(it), TO_STRING_TAG)) == "string" ? tag2 : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : result; }; }, "./node_modules/core-js/internals/copy-constructor-properties.js": function(module3, exports2, __webpack_require__) { @@ -6059,10 +9064,10 @@ var require_feather = __commonJS({ var fails = __webpack_require__("./node_modules/core-js/internals/fails.js"); var replacement = /#|\.prototype\./; var isForced = function(feature, detection) { - var value = data[normalize2(feature)]; + var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == "function" ? fails(detection) : !!detection; }; - var normalize2 = isForced.normalize = function(string) { + var normalize = isForced.normalize = function(string) { return String(string).replace(replacement, ".").toLowerCase(); }; var data = isForced.data = {}; @@ -6321,8 +9326,8 @@ var require_feather = __commonJS({ var getOwnPropertyNamesModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-names.js"); var getOwnPropertySymbolsModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-symbols.js"); var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js"); - var Reflect2 = global2.Reflect; - module3.exports = Reflect2 && Reflect2.ownKeys || function ownKeys(it) { + var Reflect = global2.Reflect; + module3.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; @@ -6443,8 +9448,8 @@ var require_feather = __commonJS({ var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js"); var max = Math.max; var min = Math.min; - module3.exports = function(index, length) { - var integer = toInteger(index); + module3.exports = function(index2, length) { + var integer = toInteger(index2); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; }, @@ -6546,11 +9551,11 @@ var require_feather = __commonJS({ }, function next() { var state = getInternalState(this); var string = state.string; - var index = state.index; + var index2 = state.index; var point; - if (index >= string.length) + if (index2 >= string.length) return { value: void 0, done: true }; - point = codePointAt(string, index, true); + point = codePointAt(string, index2, true); state.index += point.length; return { value: point, done: false }; }); @@ -6613,8 +9618,8 @@ var require_feather = __commonJS({ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function _classCallCheck(instance5, Constructor) { - if (!(instance5 instanceof Constructor)) { + function _classCallCheck(instance6, Constructor) { + if (!(instance6 instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -6773,10 +9778,8897 @@ var require_feather = __commonJS({ __export(exports, { default: () => ObsidianGit }); -var import_obsidian15 = __toModule(require("obsidian")); -var path2 = __toModule(require("path")); +init_polyfill_buffer(); + +// node_modules/isomorphic-git/index.js +init_polyfill_buffer(); +var import_async_lock = __toModule(require_async_lock()); +var import_sha1 = __toModule(require_sha1()); +var import_crc_32 = __toModule(require_crc32()); +var import_pako = __toModule(require_pako()); +var import_ignore = __toModule(require_ignore()); +var import_pify = __toModule(require_pify()); +var import_clean_git_ref = __toModule(require_lib2()); +var import_diff3 = __toModule(require_diff3()); +var BaseError = class extends Error { + constructor(message) { + super(message); + this.caller = ""; + } + toJSON() { + return { + code: this.code, + data: this.data, + caller: this.caller, + message: this.message, + stack: this.stack + }; + } + fromJSON(json) { + const e = new BaseError(json.message); + e.code = json.code; + e.data = json.data; + e.caller = json.caller; + e.stack = json.stack; + return e; + } + get isIsomorphicGitError() { + return true; + } +}; +var InternalError = class extends BaseError { + constructor(message) { + super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${message}`); + this.code = this.name = InternalError.code; + this.data = { message }; + } +}; +InternalError.code = "InternalError"; +var UnsafeFilepathError = class extends BaseError { + constructor(filepath) { + super(`The filepath "${filepath}" contains unsafe character sequences`); + this.code = this.name = UnsafeFilepathError.code; + this.data = { filepath }; + } +}; +UnsafeFilepathError.code = "UnsafeFilepathError"; +var BufferCursor = class { + constructor(buffer2) { + this.buffer = buffer2; + this._start = 0; + } + eof() { + return this._start >= this.buffer.length; + } + tell() { + return this._start; + } + seek(n) { + this._start = n; + } + slice(n) { + const r = this.buffer.slice(this._start, this._start + n); + this._start += n; + return r; + } + toString(enc, length) { + const r = this.buffer.toString(enc, this._start, this._start + length); + this._start += length; + return r; + } + write(value, length, enc) { + const r = this.buffer.write(value, this._start, length, enc); + this._start += length; + return r; + } + copy(source, start, end) { + const r = source.copy(this.buffer, this._start, start, end); + this._start += r; + return r; + } + readUInt8() { + const r = this.buffer.readUInt8(this._start); + this._start += 1; + return r; + } + writeUInt8(value) { + const r = this.buffer.writeUInt8(value, this._start); + this._start += 1; + return r; + } + readUInt16BE() { + const r = this.buffer.readUInt16BE(this._start); + this._start += 2; + return r; + } + writeUInt16BE(value) { + const r = this.buffer.writeUInt16BE(value, this._start); + this._start += 2; + return r; + } + readUInt32BE() { + const r = this.buffer.readUInt32BE(this._start); + this._start += 4; + return r; + } + writeUInt32BE(value) { + const r = this.buffer.writeUInt32BE(value, this._start); + this._start += 4; + return r; + } +}; +function compareStrings(a, b) { + return -(a < b) || +(a > b); +} +function comparePath(a, b) { + return compareStrings(a.path, b.path); +} +function normalizeMode(mode) { + let type = mode > 0 ? mode >> 12 : 0; + if (type !== 4 && type !== 8 && type !== 10 && type !== 14) { + type = 8; + } + let permissions = mode & 511; + if (permissions & 73) { + permissions = 493; + } else { + permissions = 420; + } + if (type !== 8) + permissions = 0; + return (type << 12) + permissions; +} +var MAX_UINT32 = 2 ** 32; +function SecondsNanoseconds(givenSeconds, givenNanoseconds, milliseconds, date) { + if (givenSeconds !== void 0 && givenNanoseconds !== void 0) { + return [givenSeconds, givenNanoseconds]; + } + if (milliseconds === void 0) { + milliseconds = date.valueOf(); + } + const seconds = Math.floor(milliseconds / 1e3); + const nanoseconds = (milliseconds - seconds * 1e3) * 1e6; + return [seconds, nanoseconds]; +} +function normalizeStats(e) { + const [ctimeSeconds, ctimeNanoseconds] = SecondsNanoseconds(e.ctimeSeconds, e.ctimeNanoseconds, e.ctimeMs, e.ctime); + const [mtimeSeconds, mtimeNanoseconds] = SecondsNanoseconds(e.mtimeSeconds, e.mtimeNanoseconds, e.mtimeMs, e.mtime); + return { + ctimeSeconds: ctimeSeconds % MAX_UINT32, + ctimeNanoseconds: ctimeNanoseconds % MAX_UINT32, + mtimeSeconds: mtimeSeconds % MAX_UINT32, + mtimeNanoseconds: mtimeNanoseconds % MAX_UINT32, + dev: e.dev % MAX_UINT32, + ino: e.ino % MAX_UINT32, + mode: normalizeMode(e.mode % MAX_UINT32), + uid: e.uid % MAX_UINT32, + gid: e.gid % MAX_UINT32, + size: e.size > -1 ? e.size % MAX_UINT32 : 0 + }; +} +function toHex(buffer2) { + let hex = ""; + for (const byte of new Uint8Array(buffer2)) { + if (byte < 16) + hex += "0"; + hex += byte.toString(16); + } + return hex; +} +var supportsSubtleSHA1 = null; +async function shasum(buffer2) { + if (supportsSubtleSHA1 === null) { + supportsSubtleSHA1 = await testSubtleSHA1(); + } + return supportsSubtleSHA1 ? subtleSHA1(buffer2) : shasumSync(buffer2); +} +function shasumSync(buffer2) { + return new import_sha1.default().update(buffer2).digest("hex"); +} +async function subtleSHA1(buffer2) { + const hash2 = await crypto.subtle.digest("SHA-1", buffer2); + return toHex(hash2); +} +async function testSubtleSHA1() { + try { + const hash2 = await subtleSHA1(new Uint8Array([])); + if (hash2 === "da39a3ee5e6b4b0d3255bfef95601890afd80709") + return true; + } catch (_) { + } + return false; +} +function parseCacheEntryFlags(bits) { + return { + assumeValid: Boolean(bits & 32768), + extended: Boolean(bits & 16384), + stage: (bits & 12288) >> 12, + nameLength: bits & 4095 + }; +} +function renderCacheEntryFlags(entry) { + const flags = entry.flags; + flags.extended = false; + flags.nameLength = Math.min(Buffer2.from(entry.path).length, 4095); + return (flags.assumeValid ? 32768 : 0) + (flags.extended ? 16384 : 0) + ((flags.stage & 3) << 12) + (flags.nameLength & 4095); +} +var GitIndex = class { + constructor(entries) { + this._dirty = false; + this._entries = entries || new Map(); + } + static async from(buffer2) { + if (Buffer2.isBuffer(buffer2)) { + return GitIndex.fromBuffer(buffer2); + } else if (buffer2 === null) { + return new GitIndex(null); + } else { + throw new InternalError("invalid type passed to GitIndex.from"); + } + } + static async fromBuffer(buffer2) { + const shaComputed = await shasum(buffer2.slice(0, -20)); + const shaClaimed = buffer2.slice(-20).toString("hex"); + if (shaClaimed !== shaComputed) { + throw new InternalError(`Invalid checksum in GitIndex buffer: expected ${shaClaimed} but saw ${shaComputed}`); + } + const reader = new BufferCursor(buffer2); + const _entries = new Map(); + const magic = reader.toString("utf8", 4); + if (magic !== "DIRC") { + throw new InternalError(`Inavlid dircache magic file number: ${magic}`); + } + const version2 = reader.readUInt32BE(); + if (version2 !== 2) { + throw new InternalError(`Unsupported dircache version: ${version2}`); + } + const numEntries = reader.readUInt32BE(); + let i = 0; + while (!reader.eof() && i < numEntries) { + const entry = {}; + entry.ctimeSeconds = reader.readUInt32BE(); + entry.ctimeNanoseconds = reader.readUInt32BE(); + entry.mtimeSeconds = reader.readUInt32BE(); + entry.mtimeNanoseconds = reader.readUInt32BE(); + entry.dev = reader.readUInt32BE(); + entry.ino = reader.readUInt32BE(); + entry.mode = reader.readUInt32BE(); + entry.uid = reader.readUInt32BE(); + entry.gid = reader.readUInt32BE(); + entry.size = reader.readUInt32BE(); + entry.oid = reader.slice(20).toString("hex"); + const flags = reader.readUInt16BE(); + entry.flags = parseCacheEntryFlags(flags); + const pathlength = buffer2.indexOf(0, reader.tell() + 1) - reader.tell(); + if (pathlength < 1) { + throw new InternalError(`Got a path length of: ${pathlength}`); + } + entry.path = reader.toString("utf8", pathlength); + if (entry.path.includes("..\\") || entry.path.includes("../")) { + throw new UnsafeFilepathError(entry.path); + } + let padding = 8 - (reader.tell() - 12) % 8; + if (padding === 0) + padding = 8; + while (padding--) { + const tmp = reader.readUInt8(); + if (tmp !== 0) { + throw new InternalError(`Expected 1-8 null characters but got '${tmp}' after ${entry.path}`); + } else if (reader.eof()) { + throw new InternalError("Unexpected end of file"); + } + } + _entries.set(entry.path, entry); + i++; + } + return new GitIndex(_entries); + } + get entries() { + return [...this._entries.values()].sort(comparePath); + } + get entriesMap() { + return this._entries; + } + *[Symbol.iterator]() { + for (const entry of this.entries) { + yield entry; + } + } + insert({ filepath, stats, oid }) { + stats = normalizeStats(stats); + const bfilepath = Buffer2.from(filepath); + const entry = { + ctimeSeconds: stats.ctimeSeconds, + ctimeNanoseconds: stats.ctimeNanoseconds, + mtimeSeconds: stats.mtimeSeconds, + mtimeNanoseconds: stats.mtimeNanoseconds, + dev: stats.dev, + ino: stats.ino, + mode: stats.mode || 33188, + uid: stats.uid, + gid: stats.gid, + size: stats.size, + path: filepath, + oid, + flags: { + assumeValid: false, + extended: false, + stage: 0, + nameLength: bfilepath.length < 4095 ? bfilepath.length : 4095 + } + }; + this._entries.set(entry.path, entry); + this._dirty = true; + } + delete({ filepath }) { + if (this._entries.has(filepath)) { + this._entries.delete(filepath); + } else { + for (const key2 of this._entries.keys()) { + if (key2.startsWith(filepath + "/")) { + this._entries.delete(key2); + } + } + } + this._dirty = true; + } + clear() { + this._entries.clear(); + this._dirty = true; + } + has({ filepath }) { + return this._entries.has(filepath); + } + render() { + return this.entries.map((entry) => `${entry.mode.toString(8)} ${entry.oid} ${entry.path}`).join("\n"); + } + async toObject() { + const header = Buffer2.alloc(12); + const writer = new BufferCursor(header); + writer.write("DIRC", 4, "utf8"); + writer.writeUInt32BE(2); + writer.writeUInt32BE(this.entries.length); + const body = Buffer2.concat(this.entries.map((entry) => { + const bpath = Buffer2.from(entry.path); + const length = Math.ceil((62 + bpath.length + 1) / 8) * 8; + const written = Buffer2.alloc(length); + const writer2 = new BufferCursor(written); + const stat = normalizeStats(entry); + writer2.writeUInt32BE(stat.ctimeSeconds); + writer2.writeUInt32BE(stat.ctimeNanoseconds); + writer2.writeUInt32BE(stat.mtimeSeconds); + writer2.writeUInt32BE(stat.mtimeNanoseconds); + writer2.writeUInt32BE(stat.dev); + writer2.writeUInt32BE(stat.ino); + writer2.writeUInt32BE(stat.mode); + writer2.writeUInt32BE(stat.uid); + writer2.writeUInt32BE(stat.gid); + writer2.writeUInt32BE(stat.size); + writer2.write(entry.oid, 20, "hex"); + writer2.writeUInt16BE(renderCacheEntryFlags(entry)); + writer2.write(entry.path, bpath.length, "utf8"); + return written; + })); + const main = Buffer2.concat([header, body]); + const sum = await shasum(main); + return Buffer2.concat([main, Buffer2.from(sum, "hex")]); + } +}; +function compareStats(entry, stats) { + const e = normalizeStats(entry); + const s = normalizeStats(stats); + const staleness = e.mode !== s.mode || e.mtimeSeconds !== s.mtimeSeconds || e.ctimeSeconds !== s.ctimeSeconds || e.uid !== s.uid || e.gid !== s.gid || e.ino !== s.ino || e.size !== s.size; + return staleness; +} +var lock = null; +var IndexCache = Symbol("IndexCache"); +function createCache() { + return { + map: new Map(), + stats: new Map() + }; +} +async function updateCachedIndexFile(fs, filepath, cache) { + const stat = await fs.lstat(filepath); + const rawIndexFile = await fs.read(filepath); + const index2 = await GitIndex.from(rawIndexFile); + cache.map.set(filepath, index2); + cache.stats.set(filepath, stat); +} +async function isIndexStale(fs, filepath, cache) { + const savedStats = cache.stats.get(filepath); + if (savedStats === void 0) + return true; + const currStats = await fs.lstat(filepath); + if (savedStats === null) + return false; + if (currStats === null) + return false; + return compareStats(savedStats, currStats); +} +var GitIndexManager = class { + static async acquire({ fs, gitdir, cache }, closure) { + if (!cache[IndexCache]) + cache[IndexCache] = createCache(); + const filepath = `${gitdir}/index`; + if (lock === null) + lock = new import_async_lock.default({ maxPending: Infinity }); + let result; + await lock.acquire(filepath, async () => { + if (await isIndexStale(fs, filepath, cache[IndexCache])) { + await updateCachedIndexFile(fs, filepath, cache[IndexCache]); + } + const index2 = cache[IndexCache].map.get(filepath); + result = await closure(index2); + if (index2._dirty) { + const buffer2 = await index2.toObject(); + await fs.write(filepath, buffer2); + cache[IndexCache].stats.set(filepath, await fs.lstat(filepath)); + index2._dirty = false; + } + }); + return result; + } +}; +function basename(path2) { + const last2 = Math.max(path2.lastIndexOf("/"), path2.lastIndexOf("\\")); + if (last2 > -1) { + path2 = path2.slice(last2 + 1); + } + return path2; +} +function dirname(path2) { + const last2 = Math.max(path2.lastIndexOf("/"), path2.lastIndexOf("\\")); + if (last2 === -1) + return "."; + if (last2 === 0) + return "/"; + return path2.slice(0, last2); +} +function flatFileListToDirectoryStructure(files) { + const inodes = new Map(); + const mkdir = function(name) { + if (!inodes.has(name)) { + const dir = { + type: "tree", + fullpath: name, + basename: basename(name), + metadata: {}, + children: [] + }; + inodes.set(name, dir); + dir.parent = mkdir(dirname(name)); + if (dir.parent && dir.parent !== dir) + dir.parent.children.push(dir); + } + return inodes.get(name); + }; + const mkfile = function(name, metadata) { + if (!inodes.has(name)) { + const file = { + type: "blob", + fullpath: name, + basename: basename(name), + metadata, + parent: mkdir(dirname(name)), + children: [] + }; + if (file.parent) + file.parent.children.push(file); + inodes.set(name, file); + } + return inodes.get(name); + }; + mkdir("."); + for (const file of files) { + mkfile(file.path, file); + } + return inodes; +} +function mode2type(mode) { + switch (mode) { + case 16384: + return "tree"; + case 33188: + return "blob"; + case 33261: + return "blob"; + case 40960: + return "blob"; + case 57344: + return "commit"; + } + throw new InternalError(`Unexpected GitTree entry mode: ${mode.toString(8)}`); +} +var GitWalkerIndex = class { + constructor({ fs, gitdir, cache }) { + this.treePromise = GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + return flatFileListToDirectoryStructure(index2.entries); + }); + const walker = this; + this.ConstructEntry = class StageEntry { + constructor(fullpath) { + this._fullpath = fullpath; + this._type = false; + this._mode = false; + this._stat = false; + this._oid = false; + } + async type() { + return walker.type(this); + } + async mode() { + return walker.mode(this); + } + async stat() { + return walker.stat(this); + } + async content() { + return walker.content(this); + } + async oid() { + return walker.oid(this); + } + }; + } + async readdir(entry) { + const filepath = entry._fullpath; + const tree = await this.treePromise; + const inode = tree.get(filepath); + if (!inode) + return null; + if (inode.type === "blob") + return null; + if (inode.type !== "tree") { + throw new Error(`ENOTDIR: not a directory, scandir '${filepath}'`); + } + const names = inode.children.map((inode2) => inode2.fullpath); + names.sort(compareStrings); + return names; + } + async type(entry) { + if (entry._type === false) { + await entry.stat(); + } + return entry._type; + } + async mode(entry) { + if (entry._mode === false) { + await entry.stat(); + } + return entry._mode; + } + async stat(entry) { + if (entry._stat === false) { + const tree = await this.treePromise; + const inode = tree.get(entry._fullpath); + if (!inode) { + throw new Error(`ENOENT: no such file or directory, lstat '${entry._fullpath}'`); + } + const stats = inode.type === "tree" ? {} : normalizeStats(inode.metadata); + entry._type = inode.type === "tree" ? "tree" : mode2type(stats.mode); + entry._mode = stats.mode; + if (inode.type === "tree") { + entry._stat = void 0; + } else { + entry._stat = stats; + } + } + return entry._stat; + } + async content(_entry) { + } + async oid(entry) { + if (entry._oid === false) { + const tree = await this.treePromise; + const inode = tree.get(entry._fullpath); + entry._oid = inode.metadata.oid; + } + return entry._oid; + } +}; +var GitWalkSymbol = Symbol("GitWalkSymbol"); +function STAGE() { + const o = Object.create(null); + Object.defineProperty(o, GitWalkSymbol, { + value: function({ fs, gitdir, cache }) { + return new GitWalkerIndex({ fs, gitdir, cache }); + } + }); + Object.freeze(o); + return o; +} +var NotFoundError = class extends BaseError { + constructor(what) { + super(`Could not find ${what}.`); + this.code = this.name = NotFoundError.code; + this.data = { what }; + } +}; +NotFoundError.code = "NotFoundError"; +var ObjectTypeError = class extends BaseError { + constructor(oid, actual, expected, filepath) { + super(`Object ${oid} ${filepath ? `at ${filepath}` : ""}was anticipated to be a ${expected} but it is a ${actual}.`); + this.code = this.name = ObjectTypeError.code; + this.data = { oid, actual, expected, filepath }; + } +}; +ObjectTypeError.code = "ObjectTypeError"; +var InvalidOidError = class extends BaseError { + constructor(value) { + super(`Expected a 40-char hex object id but saw "${value}".`); + this.code = this.name = InvalidOidError.code; + this.data = { value }; + } +}; +InvalidOidError.code = "InvalidOidError"; +var NoRefspecError = class extends BaseError { + constructor(remote) { + super(`Could not find a fetch refspec for remote "${remote}". Make sure the config file has an entry like the following: +[remote "${remote}"] + fetch = +refs/heads/*:refs/remotes/origin/* +`); + this.code = this.name = NoRefspecError.code; + this.data = { remote }; + } +}; +NoRefspecError.code = "NoRefspecError"; +var GitPackedRefs = class { + constructor(text2) { + this.refs = new Map(); + this.parsedConfig = []; + if (text2) { + let key2 = null; + this.parsedConfig = text2.trim().split("\n").map((line) => { + if (/^\s*#/.test(line)) { + return { line, comment: true }; + } + const i = line.indexOf(" "); + if (line.startsWith("^")) { + const value = line.slice(1); + this.refs.set(key2 + "^{}", value); + return { line, ref: key2, peeled: value }; + } else { + const value = line.slice(0, i); + key2 = line.slice(i + 1); + this.refs.set(key2, value); + return { line, ref: key2, oid: value }; + } + }); + } + return this; + } + static from(text2) { + return new GitPackedRefs(text2); + } + delete(ref) { + this.parsedConfig = this.parsedConfig.filter((entry) => entry.ref !== ref); + this.refs.delete(ref); + } + toString() { + return this.parsedConfig.map(({ line }) => line).join("\n") + "\n"; + } +}; +var GitRefSpec = class { + constructor({ remotePath, localPath, force, matchPrefix }) { + Object.assign(this, { + remotePath, + localPath, + force, + matchPrefix + }); + } + static from(refspec) { + const [ + forceMatch, + remotePath, + remoteGlobMatch, + localPath, + localGlobMatch + ] = refspec.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1); + const force = forceMatch === "+"; + const remoteIsGlob = remoteGlobMatch === "*"; + const localIsGlob = localGlobMatch === "*"; + if (remoteIsGlob !== localIsGlob) { + throw new InternalError("Invalid refspec"); + } + return new GitRefSpec({ + remotePath, + localPath, + force, + matchPrefix: remoteIsGlob + }); + } + translate(remoteBranch) { + if (this.matchPrefix) { + if (remoteBranch.startsWith(this.remotePath)) { + return this.localPath + remoteBranch.replace(this.remotePath, ""); + } + } else { + if (remoteBranch === this.remotePath) + return this.localPath; + } + return null; + } + reverseTranslate(localBranch) { + if (this.matchPrefix) { + if (localBranch.startsWith(this.localPath)) { + return this.remotePath + localBranch.replace(this.localPath, ""); + } + } else { + if (localBranch === this.localPath) + return this.remotePath; + } + return null; + } +}; +var GitRefSpecSet = class { + constructor(rules = []) { + this.rules = rules; + } + static from(refspecs) { + const rules = []; + for (const refspec of refspecs) { + rules.push(GitRefSpec.from(refspec)); + } + return new GitRefSpecSet(rules); + } + add(refspec) { + const rule = GitRefSpec.from(refspec); + this.rules.push(rule); + } + translate(remoteRefs) { + const result = []; + for (const rule of this.rules) { + for (const remoteRef of remoteRefs) { + const localRef = rule.translate(remoteRef); + if (localRef) { + result.push([remoteRef, localRef]); + } + } + } + return result; + } + translateOne(remoteRef) { + let result = null; + for (const rule of this.rules) { + const localRef = rule.translate(remoteRef); + if (localRef) { + result = localRef; + } + } + return result; + } + localNamespaces() { + return this.rules.filter((rule) => rule.matchPrefix).map((rule) => rule.localPath.replace(/\/$/, "")); + } +}; +function compareRefNames(a, b) { + const _a2 = a.replace(/\^\{\}$/, ""); + const _b = b.replace(/\^\{\}$/, ""); + const tmp = -(_a2 < _b) || +(_a2 > _b); + if (tmp === 0) { + return a.endsWith("^{}") ? 1 : -1; + } + return tmp; +} +function normalizePath(path2) { + return path2.replace(/\/\.\//g, "/").replace(/\/{2,}/g, "/").replace(/^\/\.$/, "/").replace(/^\.\/$/, ".").replace(/^\.\//, "").replace(/\/\.$/, "").replace(/(.+)\/$/, "$1").replace(/^$/, "."); +} +function join(...parts) { + return normalizePath(parts.map(normalizePath).join("/")); +} +var num = (val) => { + val = val.toLowerCase(); + let n = parseInt(val); + if (val.endsWith("k")) + n *= 1024; + if (val.endsWith("m")) + n *= 1024 * 1024; + if (val.endsWith("g")) + n *= 1024 * 1024 * 1024; + return n; +}; +var bool = (val) => { + val = val.trim().toLowerCase(); + if (val === "true" || val === "yes" || val === "on") + return true; + if (val === "false" || val === "no" || val === "off") + return false; + throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${val}`); +}; +var schema = { + core: { + filemode: bool, + bare: bool, + logallrefupdates: bool, + symlinks: bool, + ignorecase: bool, + bigFileThreshold: num + } +}; +var SECTION_LINE_REGEX = /^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/; +var SECTION_REGEX = /^[A-Za-z0-9-.]+$/; +var VARIABLE_LINE_REGEX = /^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/; +var VARIABLE_NAME_REGEX = /^[A-Za-z][A-Za-z-]*$/; +var VARIABLE_VALUE_COMMENT_REGEX = /^(.*?)( *[#;].*)$/; +var extractSectionLine = (line) => { + const matches = SECTION_LINE_REGEX.exec(line); + if (matches != null) { + const [section, subsection] = matches.slice(1); + return [section, subsection]; + } + return null; +}; +var extractVariableLine = (line) => { + const matches = VARIABLE_LINE_REGEX.exec(line); + if (matches != null) { + const [name, rawValue = "true"] = matches.slice(1); + const valueWithoutComments = removeComments(rawValue); + const valueWithoutQuotes = removeQuotes(valueWithoutComments); + return [name, valueWithoutQuotes]; + } + return null; +}; +var removeComments = (rawValue) => { + const commentMatches = VARIABLE_VALUE_COMMENT_REGEX.exec(rawValue); + if (commentMatches == null) { + return rawValue; + } + const [valueWithoutComment, comment] = commentMatches.slice(1); + if (hasOddNumberOfQuotes(valueWithoutComment) && hasOddNumberOfQuotes(comment)) { + return `${valueWithoutComment}${comment}`; + } + return valueWithoutComment; +}; +var hasOddNumberOfQuotes = (text2) => { + const numberOfQuotes = (text2.match(/(?:^|[^\\])"/g) || []).length; + return numberOfQuotes % 2 !== 0; +}; +var removeQuotes = (text2) => { + return text2.split("").reduce((newText, c, idx, text3) => { + const isQuote = c === '"' && text3[idx - 1] !== "\\"; + const isEscapeForQuote = c === "\\" && text3[idx + 1] === '"'; + if (isQuote || isEscapeForQuote) { + return newText; + } + return newText + c; + }, ""); +}; +var lower = (text2) => { + return text2 != null ? text2.toLowerCase() : null; +}; +var getPath = (section, subsection, name) => { + return [lower(section), subsection, lower(name)].filter((a) => a != null).join("."); +}; +var normalizePath$1 = (path2) => { + const pathSegments = path2.split("."); + const section = pathSegments.shift(); + const name = pathSegments.pop(); + const subsection = pathSegments.length ? pathSegments.join(".") : void 0; + return { + section, + subsection, + name, + path: getPath(section, subsection, name), + sectionPath: getPath(section, subsection, null) + }; +}; +var findLastIndex = (array, callback) => { + return array.reduce((lastIndex, item, index2) => { + return callback(item) ? index2 : lastIndex; + }, -1); +}; +var GitConfig = class { + constructor(text2) { + let section = null; + let subsection = null; + this.parsedConfig = text2.split("\n").map((line) => { + let name = null; + let value = null; + const trimmedLine = line.trim(); + const extractedSection = extractSectionLine(trimmedLine); + const isSection = extractedSection != null; + if (isSection) { + ; + [section, subsection] = extractedSection; + } else { + const extractedVariable = extractVariableLine(trimmedLine); + const isVariable = extractedVariable != null; + if (isVariable) { + ; + [name, value] = extractedVariable; + } + } + const path2 = getPath(section, subsection, name); + return { line, isSection, section, subsection, name, value, path: path2 }; + }); + } + static from(text2) { + return new GitConfig(text2); + } + async get(path2, getall = false) { + const normalizedPath = normalizePath$1(path2).path; + const allValues = this.parsedConfig.filter((config) => config.path === normalizedPath).map(({ section, name, value }) => { + const fn = schema[section] && schema[section][name]; + return fn ? fn(value) : value; + }); + return getall ? allValues : allValues.pop(); + } + async getall(path2) { + return this.get(path2, true); + } + async getSubsections(section) { + return this.parsedConfig.filter((config) => config.section === section && config.isSection).map((config) => config.subsection); + } + async deleteSection(section, subsection) { + this.parsedConfig = this.parsedConfig.filter((config) => !(config.section === section && config.subsection === subsection)); + } + async append(path2, value) { + return this.set(path2, value, true); + } + async set(path2, value, append3 = false) { + const { + section, + subsection, + name, + path: normalizedPath, + sectionPath + } = normalizePath$1(path2); + const configIndex = findLastIndex(this.parsedConfig, (config) => config.path === normalizedPath); + if (value == null) { + if (configIndex !== -1) { + this.parsedConfig.splice(configIndex, 1); + } + } else { + if (configIndex !== -1) { + const config = this.parsedConfig[configIndex]; + const modifiedConfig = Object.assign({}, config, { + name, + value, + modified: true + }); + if (append3) { + this.parsedConfig.splice(configIndex + 1, 0, modifiedConfig); + } else { + this.parsedConfig[configIndex] = modifiedConfig; + } + } else { + const sectionIndex = this.parsedConfig.findIndex((config) => config.path === sectionPath); + const newConfig = { + section, + subsection, + name, + value, + modified: true, + path: normalizedPath + }; + if (SECTION_REGEX.test(section) && VARIABLE_NAME_REGEX.test(name)) { + if (sectionIndex >= 0) { + this.parsedConfig.splice(sectionIndex + 1, 0, newConfig); + } else { + const newSection = { + section, + subsection, + modified: true, + path: sectionPath + }; + this.parsedConfig.push(newSection, newConfig); + } + } + } + } + } + toString() { + return this.parsedConfig.map(({ line, section, subsection, name, value, modified: modified2 = false }) => { + if (!modified2) { + return line; + } + if (name != null && value != null) { + if (typeof value === "string" && /[#;]/.test(value)) { + return ` ${name} = "${value}"`; + } + return ` ${name} = ${value}`; + } + if (subsection != null) { + return `[${section} "${subsection}"]`; + } + return `[${section}]`; + }).join("\n"); + } +}; +var GitConfigManager = class { + static async get({ fs, gitdir }) { + const text2 = await fs.read(`${gitdir}/config`, { encoding: "utf8" }); + return GitConfig.from(text2); + } + static async save({ fs, gitdir, config }) { + await fs.write(`${gitdir}/config`, config.toString(), { + encoding: "utf8" + }); + } +}; +var refpaths = (ref) => [ + `${ref}`, + `refs/${ref}`, + `refs/tags/${ref}`, + `refs/heads/${ref}`, + `refs/remotes/${ref}`, + `refs/remotes/${ref}/HEAD` +]; +var GIT_FILES = ["config", "description", "index", "shallow", "commondir"]; +var GitRefManager = class { + static async updateRemoteRefs({ + fs, + gitdir, + remote, + refs, + symrefs, + tags, + refspecs = void 0, + prune = false, + pruneTags = false + }) { + for (const value of refs.values()) { + if (!value.match(/[0-9a-f]{40}/)) { + throw new InvalidOidError(value); + } + } + const config = await GitConfigManager.get({ fs, gitdir }); + if (!refspecs) { + refspecs = await config.getall(`remote.${remote}.fetch`); + if (refspecs.length === 0) { + throw new NoRefspecError(remote); + } + refspecs.unshift(`+HEAD:refs/remotes/${remote}/HEAD`); + } + const refspec = GitRefSpecSet.from(refspecs); + const actualRefsToWrite = new Map(); + if (pruneTags) { + const tags2 = await GitRefManager.listRefs({ + fs, + gitdir, + filepath: "refs/tags" + }); + await GitRefManager.deleteRefs({ + fs, + gitdir, + refs: tags2.map((tag2) => `refs/tags/${tag2}`) + }); + } + if (tags) { + for (const serverRef of refs.keys()) { + if (serverRef.startsWith("refs/tags") && !serverRef.endsWith("^{}")) { + if (!await GitRefManager.exists({ fs, gitdir, ref: serverRef })) { + const oid = refs.get(serverRef); + actualRefsToWrite.set(serverRef, oid); + } + } + } + } + const refTranslations = refspec.translate([...refs.keys()]); + for (const [serverRef, translatedRef] of refTranslations) { + const value = refs.get(serverRef); + actualRefsToWrite.set(translatedRef, value); + } + const symrefTranslations = refspec.translate([...symrefs.keys()]); + for (const [serverRef, translatedRef] of symrefTranslations) { + const value = symrefs.get(serverRef); + const symtarget = refspec.translateOne(value); + if (symtarget) { + actualRefsToWrite.set(translatedRef, `ref: ${symtarget}`); + } + } + const pruned = []; + if (prune) { + for (const filepath of refspec.localNamespaces()) { + const refs2 = (await GitRefManager.listRefs({ + fs, + gitdir, + filepath + })).map((file) => `${filepath}/${file}`); + for (const ref of refs2) { + if (!actualRefsToWrite.has(ref)) { + pruned.push(ref); + } + } + } + if (pruned.length > 0) { + await GitRefManager.deleteRefs({ fs, gitdir, refs: pruned }); + } + } + for (const [key2, value] of actualRefsToWrite) { + await fs.write(join(gitdir, key2), `${value.trim()} +`, "utf8"); + } + return { pruned }; + } + static async writeRef({ fs, gitdir, ref, value }) { + if (!value.match(/[0-9a-f]{40}/)) { + throw new InvalidOidError(value); + } + await fs.write(join(gitdir, ref), `${value.trim()} +`, "utf8"); + } + static async writeSymbolicRef({ fs, gitdir, ref, value }) { + await fs.write(join(gitdir, ref), `ref: ${value.trim()} +`, "utf8"); + } + static async deleteRef({ fs, gitdir, ref }) { + return GitRefManager.deleteRefs({ fs, gitdir, refs: [ref] }); + } + static async deleteRefs({ fs, gitdir, refs }) { + await Promise.all(refs.map((ref) => fs.rm(join(gitdir, ref)))); + let text2 = await fs.read(`${gitdir}/packed-refs`, { encoding: "utf8" }); + const packed = GitPackedRefs.from(text2); + const beforeSize = packed.refs.size; + for (const ref of refs) { + if (packed.refs.has(ref)) { + packed.delete(ref); + } + } + if (packed.refs.size < beforeSize) { + text2 = packed.toString(); + await fs.write(`${gitdir}/packed-refs`, text2, { encoding: "utf8" }); + } + } + static async resolve({ fs, gitdir, ref, depth = void 0 }) { + if (depth !== void 0) { + depth--; + if (depth === -1) { + return ref; + } + } + let sha; + if (ref.startsWith("ref: ")) { + ref = ref.slice("ref: ".length); + return GitRefManager.resolve({ fs, gitdir, ref, depth }); + } + if (ref.length === 40 && /[0-9a-f]{40}/.test(ref)) { + return ref; + } + const packedMap = await GitRefManager.packedRefs({ fs, gitdir }); + const allpaths = refpaths(ref).filter((p) => !GIT_FILES.includes(p)); + for (const ref2 of allpaths) { + sha = await fs.read(`${gitdir}/${ref2}`, { encoding: "utf8" }) || packedMap.get(ref2); + if (sha) { + return GitRefManager.resolve({ fs, gitdir, ref: sha.trim(), depth }); + } + } + throw new NotFoundError(ref); + } + static async exists({ fs, gitdir, ref }) { + try { + await GitRefManager.expand({ fs, gitdir, ref }); + return true; + } catch (err) { + return false; + } + } + static async expand({ fs, gitdir, ref }) { + if (ref.length === 40 && /[0-9a-f]{40}/.test(ref)) { + return ref; + } + const packedMap = await GitRefManager.packedRefs({ fs, gitdir }); + const allpaths = refpaths(ref); + for (const ref2 of allpaths) { + if (await fs.exists(`${gitdir}/${ref2}`)) + return ref2; + if (packedMap.has(ref2)) + return ref2; + } + throw new NotFoundError(ref); + } + static async expandAgainstMap({ ref, map }) { + const allpaths = refpaths(ref); + for (const ref2 of allpaths) { + if (await map.has(ref2)) + return ref2; + } + throw new NotFoundError(ref); + } + static resolveAgainstMap({ ref, fullref = ref, depth = void 0, map }) { + if (depth !== void 0) { + depth--; + if (depth === -1) { + return { fullref, oid: ref }; + } + } + if (ref.startsWith("ref: ")) { + ref = ref.slice("ref: ".length); + return GitRefManager.resolveAgainstMap({ ref, fullref, depth, map }); + } + if (ref.length === 40 && /[0-9a-f]{40}/.test(ref)) { + return { fullref, oid: ref }; + } + const allpaths = refpaths(ref); + for (const ref2 of allpaths) { + const sha = map.get(ref2); + if (sha) { + return GitRefManager.resolveAgainstMap({ + ref: sha.trim(), + fullref: ref2, + depth, + map + }); + } + } + throw new NotFoundError(ref); + } + static async packedRefs({ fs, gitdir }) { + const text2 = await fs.read(`${gitdir}/packed-refs`, { encoding: "utf8" }); + const packed = GitPackedRefs.from(text2); + return packed.refs; + } + static async listRefs({ fs, gitdir, filepath }) { + const packedMap = GitRefManager.packedRefs({ fs, gitdir }); + let files = null; + try { + files = await fs.readdirDeep(`${gitdir}/${filepath}`); + files = files.map((x) => x.replace(`${gitdir}/${filepath}/`, "")); + } catch (err) { + files = []; + } + for (let key2 of (await packedMap).keys()) { + if (key2.startsWith(filepath)) { + key2 = key2.replace(filepath + "/", ""); + if (!files.includes(key2)) { + files.push(key2); + } + } + } + files.sort(compareRefNames); + return files; + } + static async listBranches({ fs, gitdir, remote }) { + if (remote) { + return GitRefManager.listRefs({ + fs, + gitdir, + filepath: `refs/remotes/${remote}` + }); + } else { + return GitRefManager.listRefs({ fs, gitdir, filepath: `refs/heads` }); + } + } + static async listTags({ fs, gitdir }) { + const tags = await GitRefManager.listRefs({ + fs, + gitdir, + filepath: `refs/tags` + }); + return tags.filter((x) => !x.endsWith("^{}")); + } +}; +function compareTreeEntryPath(a, b) { + return compareStrings(appendSlashIfDir(a), appendSlashIfDir(b)); +} +function appendSlashIfDir(entry) { + return entry.mode === "040000" ? entry.path + "/" : entry.path; +} +function mode2type$1(mode) { + switch (mode) { + case "040000": + return "tree"; + case "100644": + return "blob"; + case "100755": + return "blob"; + case "120000": + return "blob"; + case "160000": + return "commit"; + } + throw new InternalError(`Unexpected GitTree entry mode: ${mode}`); +} +function parseBuffer(buffer2) { + const _entries = []; + let cursor = 0; + while (cursor < buffer2.length) { + const space2 = buffer2.indexOf(32, cursor); + if (space2 === -1) { + throw new InternalError(`GitTree: Error parsing buffer at byte location ${cursor}: Could not find the next space character.`); + } + const nullchar = buffer2.indexOf(0, cursor); + if (nullchar === -1) { + throw new InternalError(`GitTree: Error parsing buffer at byte location ${cursor}: Could not find the next null character.`); + } + let mode = buffer2.slice(cursor, space2).toString("utf8"); + if (mode === "40000") + mode = "040000"; + const type = mode2type$1(mode); + const path2 = buffer2.slice(space2 + 1, nullchar).toString("utf8"); + if (path2.includes("\\") || path2.includes("/")) { + throw new UnsafeFilepathError(path2); + } + const oid = buffer2.slice(nullchar + 1, nullchar + 21).toString("hex"); + cursor = nullchar + 21; + _entries.push({ mode, path: path2, oid, type }); + } + return _entries; +} +function limitModeToAllowed(mode) { + if (typeof mode === "number") { + mode = mode.toString(8); + } + if (mode.match(/^0?4.*/)) + return "040000"; + if (mode.match(/^1006.*/)) + return "100644"; + if (mode.match(/^1007.*/)) + return "100755"; + if (mode.match(/^120.*/)) + return "120000"; + if (mode.match(/^160.*/)) + return "160000"; + throw new InternalError(`Could not understand file mode: ${mode}`); +} +function nudgeIntoShape(entry) { + if (!entry.oid && entry.sha) { + entry.oid = entry.sha; + } + entry.mode = limitModeToAllowed(entry.mode); + if (!entry.type) { + entry.type = mode2type$1(entry.mode); + } + return entry; +} +var GitTree = class { + constructor(entries) { + if (Buffer2.isBuffer(entries)) { + this._entries = parseBuffer(entries); + } else if (Array.isArray(entries)) { + this._entries = entries.map(nudgeIntoShape); + } else { + throw new InternalError("invalid type passed to GitTree constructor"); + } + this._entries.sort(comparePath); + } + static from(tree) { + return new GitTree(tree); + } + render() { + return this._entries.map((entry) => `${entry.mode} ${entry.type} ${entry.oid} ${entry.path}`).join("\n"); + } + toObject() { + const entries = [...this._entries]; + entries.sort(compareTreeEntryPath); + return Buffer2.concat(entries.map((entry) => { + const mode = Buffer2.from(entry.mode.replace(/^0/, "")); + const space2 = Buffer2.from(" "); + const path2 = Buffer2.from(entry.path, "utf8"); + const nullchar = Buffer2.from([0]); + const oid = Buffer2.from(entry.oid, "hex"); + return Buffer2.concat([mode, space2, path2, nullchar, oid]); + })); + } + entries() { + return this._entries; + } + *[Symbol.iterator]() { + for (const entry of this._entries) { + yield entry; + } + } +}; +var GitObject = class { + static wrap({ type, object }) { + return Buffer2.concat([ + Buffer2.from(`${type} ${object.byteLength.toString()}\0`), + Buffer2.from(object) + ]); + } + static unwrap(buffer2) { + const s = buffer2.indexOf(32); + const i = buffer2.indexOf(0); + const type = buffer2.slice(0, s).toString("utf8"); + const length = buffer2.slice(s + 1, i).toString("utf8"); + const actualLength = buffer2.length - (i + 1); + if (parseInt(length) !== actualLength) { + throw new InternalError(`Length mismatch: expected ${length} bytes but got ${actualLength} instead.`); + } + return { + type, + object: Buffer2.from(buffer2.slice(i + 1)) + }; + } +}; +async function readObjectLoose({ fs, gitdir, oid }) { + const source = `objects/${oid.slice(0, 2)}/${oid.slice(2)}`; + const file = await fs.read(`${gitdir}/${source}`); + if (!file) { + return null; + } + return { object: file, format: "deflated", source }; +} +function applyDelta(delta, source) { + const reader = new BufferCursor(delta); + const sourceSize = readVarIntLE(reader); + if (sourceSize !== source.byteLength) { + throw new InternalError(`applyDelta expected source buffer to be ${sourceSize} bytes but the provided buffer was ${source.length} bytes`); + } + const targetSize = readVarIntLE(reader); + let target; + const firstOp = readOp(reader, source); + if (firstOp.byteLength === targetSize) { + target = firstOp; + } else { + target = Buffer2.alloc(targetSize); + const writer = new BufferCursor(target); + writer.copy(firstOp); + while (!reader.eof()) { + writer.copy(readOp(reader, source)); + } + const tell = writer.tell(); + if (targetSize !== tell) { + throw new InternalError(`applyDelta expected target buffer to be ${targetSize} bytes but the resulting buffer was ${tell} bytes`); + } + } + return target; +} +function readVarIntLE(reader) { + let result = 0; + let shift = 0; + let byte = null; + do { + byte = reader.readUInt8(); + result |= (byte & 127) << shift; + shift += 7; + } while (byte & 128); + return result; +} +function readCompactLE(reader, flags, size) { + let result = 0; + let shift = 0; + while (size--) { + if (flags & 1) { + result |= reader.readUInt8() << shift; + } + flags >>= 1; + shift += 8; + } + return result; +} +function readOp(reader, source) { + const byte = reader.readUInt8(); + const COPY = 128; + const OFFS = 15; + const SIZE = 112; + if (byte & COPY) { + const offset = readCompactLE(reader, byte & OFFS, 4); + let size = readCompactLE(reader, (byte & SIZE) >> 4, 3); + if (size === 0) + size = 65536; + return source.slice(offset, offset + size); + } else { + return reader.slice(byte); + } +} +function fromValue(value) { + let queue = [value]; + return { + next() { + return Promise.resolve({ done: queue.length === 0, value: queue.pop() }); + }, + return() { + queue = []; + return {}; + }, + [Symbol.asyncIterator]() { + return this; + } + }; +} +function getIterator(iterable) { + if (iterable[Symbol.asyncIterator]) { + return iterable[Symbol.asyncIterator](); + } + if (iterable[Symbol.iterator]) { + return iterable[Symbol.iterator](); + } + if (iterable.next) { + return iterable; + } + return fromValue(iterable); +} +var StreamReader = class { + constructor(stream) { + this.stream = getIterator(stream); + this.buffer = null; + this.cursor = 0; + this.undoCursor = 0; + this.started = false; + this._ended = false; + this._discardedBytes = 0; + } + eof() { + return this._ended && this.cursor === this.buffer.length; + } + tell() { + return this._discardedBytes + this.cursor; + } + async byte() { + if (this.eof()) + return; + if (!this.started) + await this._init(); + if (this.cursor === this.buffer.length) { + await this._loadnext(); + if (this._ended) + return; + } + this._moveCursor(1); + return this.buffer[this.undoCursor]; + } + async chunk() { + if (this.eof()) + return; + if (!this.started) + await this._init(); + if (this.cursor === this.buffer.length) { + await this._loadnext(); + if (this._ended) + return; + } + this._moveCursor(this.buffer.length); + return this.buffer.slice(this.undoCursor, this.cursor); + } + async read(n) { + if (this.eof()) + return; + if (!this.started) + await this._init(); + if (this.cursor + n > this.buffer.length) { + this._trim(); + await this._accumulate(n); + } + this._moveCursor(n); + return this.buffer.slice(this.undoCursor, this.cursor); + } + async skip(n) { + if (this.eof()) + return; + if (!this.started) + await this._init(); + if (this.cursor + n > this.buffer.length) { + this._trim(); + await this._accumulate(n); + } + this._moveCursor(n); + } + async undo() { + this.cursor = this.undoCursor; + } + async _next() { + this.started = true; + let { done, value } = await this.stream.next(); + if (done) { + this._ended = true; + } + if (value) { + value = Buffer2.from(value); + } + return value; + } + _trim() { + this.buffer = this.buffer.slice(this.undoCursor); + this.cursor -= this.undoCursor; + this._discardedBytes += this.undoCursor; + this.undoCursor = 0; + } + _moveCursor(n) { + this.undoCursor = this.cursor; + this.cursor += n; + if (this.cursor > this.buffer.length) { + this.cursor = this.buffer.length; + } + } + async _accumulate(n) { + if (this._ended) + return; + const buffers = [this.buffer]; + while (this.cursor + n > lengthBuffers(buffers)) { + const nextbuffer = await this._next(); + if (this._ended) + break; + buffers.push(nextbuffer); + } + this.buffer = Buffer2.concat(buffers); + } + async _loadnext() { + this._discardedBytes += this.buffer.length; + this.undoCursor = 0; + this.cursor = 0; + this.buffer = await this._next(); + } + async _init() { + this.buffer = await this._next(); + } +}; +function lengthBuffers(buffers) { + return buffers.reduce((acc, buffer2) => acc + buffer2.length, 0); +} +async function listpack(stream, onData) { + const reader = new StreamReader(stream); + let PACK = await reader.read(4); + PACK = PACK.toString("utf8"); + if (PACK !== "PACK") { + throw new InternalError(`Invalid PACK header '${PACK}'`); + } + let version2 = await reader.read(4); + version2 = version2.readUInt32BE(0); + if (version2 !== 2) { + throw new InternalError(`Invalid packfile version: ${version2}`); + } + let numObjects = await reader.read(4); + numObjects = numObjects.readUInt32BE(0); + if (numObjects < 1) + return; + while (!reader.eof() && numObjects--) { + const offset = reader.tell(); + const { type, length, ofs, reference } = await parseHeader(reader); + const inflator = new import_pako.default.Inflate(); + while (!inflator.result) { + const chunk = await reader.chunk(); + if (!chunk) + break; + inflator.push(chunk, false); + if (inflator.err) { + throw new InternalError(`Pako error: ${inflator.msg}`); + } + if (inflator.result) { + if (inflator.result.length !== length) { + throw new InternalError(`Inflated object size is different from that stated in packfile.`); + } + await reader.undo(); + await reader.read(chunk.length - inflator.strm.avail_in); + const end = reader.tell(); + await onData({ + data: inflator.result, + type, + num: numObjects, + offset, + end, + reference, + ofs + }); + } + } + } +} +async function parseHeader(reader) { + let byte = await reader.byte(); + const type = byte >> 4 & 7; + let length = byte & 15; + if (byte & 128) { + let shift = 4; + do { + byte = await reader.byte(); + length |= (byte & 127) << shift; + shift += 7; + } while (byte & 128); + } + let ofs; + let reference; + if (type === 6) { + let shift = 0; + ofs = 0; + const bytes = []; + do { + byte = await reader.byte(); + ofs |= (byte & 127) << shift; + shift += 7; + bytes.push(byte); + } while (byte & 128); + reference = Buffer2.from(bytes); + } + if (type === 7) { + const buf = await reader.read(20); + reference = buf; + } + return { type, length, ofs, reference }; +} +var supportsDecompressionStream = false; +async function inflate(buffer2) { + if (supportsDecompressionStream === null) { + supportsDecompressionStream = testDecompressionStream(); + } + return supportsDecompressionStream ? browserInflate(buffer2) : import_pako.default.inflate(buffer2); +} +async function browserInflate(buffer2) { + const ds = new DecompressionStream("deflate"); + const d = new Blob([buffer2]).stream().pipeThrough(ds); + return new Uint8Array(await new Response(d).arrayBuffer()); +} +function testDecompressionStream() { + try { + const ds = new DecompressionStream("deflate"); + if (ds) + return true; + } catch (_) { + } + return false; +} +function decodeVarInt(reader) { + const bytes = []; + let byte = 0; + let multibyte = 0; + do { + byte = reader.readUInt8(); + const lastSeven = byte & 127; + bytes.push(lastSeven); + multibyte = byte & 128; + } while (multibyte); + return bytes.reduce((a, b) => a + 1 << 7 | b, -1); +} +function otherVarIntDecode(reader, startWith) { + let result = startWith; + let shift = 4; + let byte = null; + do { + byte = reader.readUInt8(); + result |= (byte & 127) << shift; + shift += 7; + } while (byte & 128); + return result; +} +var GitPackIndex = class { + constructor(stuff) { + Object.assign(this, stuff); + this.offsetCache = {}; + } + static async fromIdx({ idx, getExternalRefDelta }) { + const reader = new BufferCursor(idx); + const magic = reader.slice(4).toString("hex"); + if (magic !== "ff744f63") { + return; + } + const version2 = reader.readUInt32BE(); + if (version2 !== 2) { + throw new InternalError(`Unable to read version ${version2} packfile IDX. (Only version 2 supported)`); + } + if (idx.byteLength > 2048 * 1024 * 1024) { + throw new InternalError(`To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.`); + } + reader.seek(reader.tell() + 4 * 255); + const size = reader.readUInt32BE(); + const hashes = []; + for (let i = 0; i < size; i++) { + const hash2 = reader.slice(20).toString("hex"); + hashes[i] = hash2; + } + reader.seek(reader.tell() + 4 * size); + const offsets = new Map(); + for (let i = 0; i < size; i++) { + offsets.set(hashes[i], reader.readUInt32BE()); + } + const packfileSha = reader.slice(20).toString("hex"); + return new GitPackIndex({ + hashes, + crcs: {}, + offsets, + packfileSha, + getExternalRefDelta + }); + } + static async fromPack({ pack, getExternalRefDelta, onProgress }) { + const listpackTypes = { + 1: "commit", + 2: "tree", + 3: "blob", + 4: "tag", + 6: "ofs-delta", + 7: "ref-delta" + }; + const offsetToObject = {}; + const packfileSha = pack.slice(-20).toString("hex"); + const hashes = []; + const crcs = {}; + const offsets = new Map(); + let totalObjectCount = null; + let lastPercent = null; + await listpack([pack], async ({ data, type, reference, offset, num: num2 }) => { + if (totalObjectCount === null) + totalObjectCount = num2; + const percent = Math.floor((totalObjectCount - num2) * 100 / totalObjectCount); + if (percent !== lastPercent) { + if (onProgress) { + await onProgress({ + phase: "Receiving objects", + loaded: totalObjectCount - num2, + total: totalObjectCount + }); + } + } + lastPercent = percent; + type = listpackTypes[type]; + if (["commit", "tree", "blob", "tag"].includes(type)) { + offsetToObject[offset] = { + type, + offset + }; + } else if (type === "ofs-delta") { + offsetToObject[offset] = { + type, + offset + }; + } else if (type === "ref-delta") { + offsetToObject[offset] = { + type, + offset + }; + } + }); + const offsetArray = Object.keys(offsetToObject).map(Number); + for (const [i, start] of offsetArray.entries()) { + const end = i + 1 === offsetArray.length ? pack.byteLength - 20 : offsetArray[i + 1]; + const o = offsetToObject[start]; + const crc = import_crc_32.default.buf(pack.slice(start, end)) >>> 0; + o.end = end; + o.crc = crc; + } + const p = new GitPackIndex({ + pack: Promise.resolve(pack), + packfileSha, + crcs, + hashes, + offsets, + getExternalRefDelta + }); + lastPercent = null; + let count = 0; + const objectsByDepth = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + for (let offset in offsetToObject) { + offset = Number(offset); + const percent = Math.floor(count * 100 / totalObjectCount); + if (percent !== lastPercent) { + if (onProgress) { + await onProgress({ + phase: "Resolving deltas", + loaded: count, + total: totalObjectCount + }); + } + } + count++; + lastPercent = percent; + const o = offsetToObject[offset]; + if (o.oid) + continue; + try { + p.readDepth = 0; + p.externalReadDepth = 0; + const { type, object } = await p.readSlice({ start: offset }); + objectsByDepth[p.readDepth] += 1; + const oid = await shasum(GitObject.wrap({ type, object })); + o.oid = oid; + hashes.push(oid); + offsets.set(oid, offset); + crcs[oid] = o.crc; + } catch (err) { + continue; + } + } + hashes.sort(); + return p; + } + async toBuffer() { + const buffers = []; + const write = (str, encoding) => { + buffers.push(Buffer2.from(str, encoding)); + }; + write("ff744f63", "hex"); + write("00000002", "hex"); + const fanoutBuffer = new BufferCursor(Buffer2.alloc(256 * 4)); + for (let i = 0; i < 256; i++) { + let count = 0; + for (const hash2 of this.hashes) { + if (parseInt(hash2.slice(0, 2), 16) <= i) + count++; + } + fanoutBuffer.writeUInt32BE(count); + } + buffers.push(fanoutBuffer.buffer); + for (const hash2 of this.hashes) { + write(hash2, "hex"); + } + const crcsBuffer = new BufferCursor(Buffer2.alloc(this.hashes.length * 4)); + for (const hash2 of this.hashes) { + crcsBuffer.writeUInt32BE(this.crcs[hash2]); + } + buffers.push(crcsBuffer.buffer); + const offsetsBuffer = new BufferCursor(Buffer2.alloc(this.hashes.length * 4)); + for (const hash2 of this.hashes) { + offsetsBuffer.writeUInt32BE(this.offsets.get(hash2)); + } + buffers.push(offsetsBuffer.buffer); + write(this.packfileSha, "hex"); + const totalBuffer = Buffer2.concat(buffers); + const sha = await shasum(totalBuffer); + const shaBuffer = Buffer2.alloc(20); + shaBuffer.write(sha, "hex"); + return Buffer2.concat([totalBuffer, shaBuffer]); + } + async load({ pack }) { + this.pack = pack; + } + async unload() { + this.pack = null; + } + async read({ oid }) { + if (!this.offsets.get(oid)) { + if (this.getExternalRefDelta) { + this.externalReadDepth++; + return this.getExternalRefDelta(oid); + } else { + throw new InternalError(`Could not read object ${oid} from packfile`); + } + } + const start = this.offsets.get(oid); + return this.readSlice({ start }); + } + async readSlice({ start }) { + if (this.offsetCache[start]) { + return Object.assign({}, this.offsetCache[start]); + } + this.readDepth++; + const types2 = { + 16: "commit", + 32: "tree", + 48: "blob", + 64: "tag", + 96: "ofs_delta", + 112: "ref_delta" + }; + if (!this.pack) { + throw new InternalError("Tried to read from a GitPackIndex with no packfile loaded into memory"); + } + const raw = (await this.pack).slice(start); + const reader = new BufferCursor(raw); + const byte = reader.readUInt8(); + const btype = byte & 112; + let type = types2[btype]; + if (type === void 0) { + throw new InternalError("Unrecognized type: 0b" + btype.toString(2)); + } + const lastFour = byte & 15; + let length = lastFour; + const multibyte = byte & 128; + if (multibyte) { + length = otherVarIntDecode(reader, lastFour); + } + let base = null; + let object = null; + if (type === "ofs_delta") { + const offset = decodeVarInt(reader); + const baseOffset = start - offset; + ({ object: base, type } = await this.readSlice({ start: baseOffset })); + } + if (type === "ref_delta") { + const oid = reader.slice(20).toString("hex"); + ({ object: base, type } = await this.read({ oid })); + } + const buffer2 = raw.slice(reader.tell()); + object = Buffer2.from(await inflate(buffer2)); + if (object.byteLength !== length) { + throw new InternalError(`Packfile told us object would have length ${length} but it had length ${object.byteLength}`); + } + if (base) { + object = Buffer2.from(applyDelta(object, base)); + } + if (this.readDepth > 3) { + this.offsetCache[start] = { type, object }; + } + return { type, format: "content", object }; + } +}; +var PackfileCache = Symbol("PackfileCache"); +async function loadPackIndex({ + fs, + filename, + getExternalRefDelta, + emitter, + emitterPrefix +}) { + const idx = await fs.read(filename); + return GitPackIndex.fromIdx({ idx, getExternalRefDelta }); +} +function readPackIndex({ + fs, + cache, + filename, + getExternalRefDelta, + emitter, + emitterPrefix +}) { + if (!cache[PackfileCache]) + cache[PackfileCache] = new Map(); + let p = cache[PackfileCache].get(filename); + if (!p) { + p = loadPackIndex({ + fs, + filename, + getExternalRefDelta, + emitter, + emitterPrefix + }); + cache[PackfileCache].set(filename, p); + } + return p; +} +async function readObjectPacked({ + fs, + cache, + gitdir, + oid, + format = "content", + getExternalRefDelta +}) { + let list = await fs.readdir(join(gitdir, "objects/pack")); + list = list.filter((x) => x.endsWith(".idx")); + for (const filename of list) { + const indexFile = `${gitdir}/objects/pack/${filename}`; + const p = await readPackIndex({ + fs, + cache, + filename: indexFile, + getExternalRefDelta + }); + if (p.error) + throw new InternalError(p.error); + if (p.offsets.has(oid)) { + if (!p.pack) { + const packFile = indexFile.replace(/idx$/, "pack"); + p.pack = fs.read(packFile); + } + const result = await p.read({ oid, getExternalRefDelta }); + result.format = "content"; + result.source = `objects/pack/${filename.replace(/idx$/, "pack")}`; + return result; + } + } + return null; +} +async function _readObject({ + fs, + cache, + gitdir, + oid, + format = "content" +}) { + const getExternalRefDelta = (oid2) => _readObject({ fs, cache, gitdir, oid: oid2 }); + let result; + if (oid === "4b825dc642cb6eb9a060e54bf8d69288fbee4904") { + result = { format: "wrapped", object: Buffer2.from(`tree 0\0`) }; + } + if (!result) { + result = await readObjectLoose({ fs, gitdir, oid }); + } + if (!result) { + result = await readObjectPacked({ + fs, + cache, + gitdir, + oid, + getExternalRefDelta + }); + } + if (!result) { + throw new NotFoundError(oid); + } + if (format === "deflated") { + return result; + } + if (result.format === "deflated") { + result.object = Buffer2.from(await inflate(result.object)); + result.format = "wrapped"; + } + if (result.format === "wrapped") { + if (format === "wrapped" && result.format === "wrapped") { + return result; + } + const sha = await shasum(result.object); + if (sha !== oid) { + throw new InternalError(`SHA check failed! Expected ${oid}, computed ${sha}`); + } + const { object, type } = GitObject.unwrap(result.object); + result.type = type; + result.object = object; + result.format = "content"; + } + if (result.format === "content") { + if (format === "content") + return result; + return; + } + throw new InternalError(`invalid format "${result.format}"`); +} +var AlreadyExistsError = class extends BaseError { + constructor(noun, where, canForce = true) { + super(`Failed to create ${noun} at ${where} because it already exists.${canForce ? ` (Hint: use 'force: true' parameter to overwrite existing ${noun}.)` : ""}`); + this.code = this.name = AlreadyExistsError.code; + this.data = { noun, where, canForce }; + } +}; +AlreadyExistsError.code = "AlreadyExistsError"; +var AmbiguousError = class extends BaseError { + constructor(nouns, short, matches) { + super(`Found multiple ${nouns} matching "${short}" (${matches.join(", ")}). Use a longer abbreviation length to disambiguate them.`); + this.code = this.name = AmbiguousError.code; + this.data = { nouns, short, matches }; + } +}; +AmbiguousError.code = "AmbiguousError"; +var CheckoutConflictError = class extends BaseError { + constructor(filepaths) { + super(`Your local changes to the following files would be overwritten by checkout: ${filepaths.join(", ")}`); + this.code = this.name = CheckoutConflictError.code; + this.data = { filepaths }; + } +}; +CheckoutConflictError.code = "CheckoutConflictError"; +var CommitNotFetchedError = class extends BaseError { + constructor(ref, oid) { + super(`Failed to checkout "${ref}" because commit ${oid} is not available locally. Do a git fetch to make the branch available locally.`); + this.code = this.name = CommitNotFetchedError.code; + this.data = { ref, oid }; + } +}; +CommitNotFetchedError.code = "CommitNotFetchedError"; +var EmptyServerResponseError = class extends BaseError { + constructor() { + super(`Empty response from git server.`); + this.code = this.name = EmptyServerResponseError.code; + this.data = {}; + } +}; +EmptyServerResponseError.code = "EmptyServerResponseError"; +var FastForwardError = class extends BaseError { + constructor() { + super(`A simple fast-forward merge was not possible.`); + this.code = this.name = FastForwardError.code; + this.data = {}; + } +}; +FastForwardError.code = "FastForwardError"; +var GitPushError = class extends BaseError { + constructor(prettyDetails, result) { + super(`One or more branches were not updated: ${prettyDetails}`); + this.code = this.name = GitPushError.code; + this.data = { prettyDetails, result }; + } +}; +GitPushError.code = "GitPushError"; +var HttpError = class extends BaseError { + constructor(statusCode, statusMessage, response) { + super(`HTTP Error: ${statusCode} ${statusMessage}`); + this.code = this.name = HttpError.code; + this.data = { statusCode, statusMessage, response }; + } +}; +HttpError.code = "HttpError"; +var InvalidFilepathError = class extends BaseError { + constructor(reason) { + let message = "invalid filepath"; + if (reason === "leading-slash" || reason === "trailing-slash") { + message = `"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.`; + } else if (reason === "directory") { + message = `"filepath" should not be a directory.`; + } + super(message); + this.code = this.name = InvalidFilepathError.code; + this.data = { reason }; + } +}; +InvalidFilepathError.code = "InvalidFilepathError"; +var InvalidRefNameError = class extends BaseError { + constructor(ref, suggestion) { + super(`"${ref}" would be an invalid git reference. (Hint: a valid alternative would be "${suggestion}".)`); + this.code = this.name = InvalidRefNameError.code; + this.data = { ref, suggestion }; + } +}; +InvalidRefNameError.code = "InvalidRefNameError"; +var MaxDepthError = class extends BaseError { + constructor(depth) { + super(`Maximum search depth of ${depth} exceeded.`); + this.code = this.name = MaxDepthError.code; + this.data = { depth }; + } +}; +MaxDepthError.code = "MaxDepthError"; +var MergeNotSupportedError = class extends BaseError { + constructor() { + super(`Merges with conflicts are not supported yet.`); + this.code = this.name = MergeNotSupportedError.code; + this.data = {}; + } +}; +MergeNotSupportedError.code = "MergeNotSupportedError"; +var MergeConflictError = class extends BaseError { + constructor(filepaths) { + super(`Automatic merge failed with one or more merge conflicts in the following files: ${filepaths.toString()}. Fix conflicts then commit the result.`); + this.code = this.name = MergeConflictError.code; + this.data = { filepaths }; + } +}; +MergeConflictError.code = "MergeConflictError"; +var MissingNameError = class extends BaseError { + constructor(role) { + super(`No name was provided for ${role} in the argument or in the .git/config file.`); + this.code = this.name = MissingNameError.code; + this.data = { role }; + } +}; +MissingNameError.code = "MissingNameError"; +var MissingParameterError = class extends BaseError { + constructor(parameter) { + super(`The function requires a "${parameter}" parameter but none was provided.`); + this.code = this.name = MissingParameterError.code; + this.data = { parameter }; + } +}; +MissingParameterError.code = "MissingParameterError"; +var MultipleGitError = class extends BaseError { + constructor(errors) { + super(`There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more`); + this.code = this.name = MultipleGitError.code; + this.data = { errors }; + this.errors = errors; + } +}; +MultipleGitError.code = "MultipleGitError"; +var ParseError = class extends BaseError { + constructor(expected, actual) { + super(`Expected "${expected}" but received "${actual}".`); + this.code = this.name = ParseError.code; + this.data = { expected, actual }; + } +}; +ParseError.code = "ParseError"; +var PushRejectedError = class extends BaseError { + constructor(reason) { + let message = ""; + if (reason === "not-fast-forward") { + message = " because it was not a simple fast-forward"; + } else if (reason === "tag-exists") { + message = " because tag already exists"; + } + super(`Push rejected${message}. Use "force: true" to override.`); + this.code = this.name = PushRejectedError.code; + this.data = { reason }; + } +}; +PushRejectedError.code = "PushRejectedError"; +var RemoteCapabilityError = class extends BaseError { + constructor(capability, parameter) { + super(`Remote does not support the "${capability}" so the "${parameter}" parameter cannot be used.`); + this.code = this.name = RemoteCapabilityError.code; + this.data = { capability, parameter }; + } +}; +RemoteCapabilityError.code = "RemoteCapabilityError"; +var SmartHttpError = class extends BaseError { + constructor(preview, response) { + super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${preview}`); + this.code = this.name = SmartHttpError.code; + this.data = { preview, response }; + } +}; +SmartHttpError.code = "SmartHttpError"; +var UnknownTransportError = class extends BaseError { + constructor(url, transport, suggestion) { + super(`Git remote "${url}" uses an unrecognized transport protocol: "${transport}"`); + this.code = this.name = UnknownTransportError.code; + this.data = { url, transport, suggestion }; + } +}; +UnknownTransportError.code = "UnknownTransportError"; +var UrlParseError = class extends BaseError { + constructor(url) { + super(`Cannot parse remote URL: "${url}"`); + this.code = this.name = UrlParseError.code; + this.data = { url }; + } +}; +UrlParseError.code = "UrlParseError"; +var UserCanceledError = class extends BaseError { + constructor() { + super(`The operation was canceled.`); + this.code = this.name = UserCanceledError.code; + this.data = {}; + } +}; +UserCanceledError.code = "UserCanceledError"; +var Errors = /* @__PURE__ */ Object.freeze({ + __proto__: null, + AlreadyExistsError, + AmbiguousError, + CheckoutConflictError, + CommitNotFetchedError, + EmptyServerResponseError, + FastForwardError, + GitPushError, + HttpError, + InternalError, + InvalidFilepathError, + InvalidOidError, + InvalidRefNameError, + MaxDepthError, + MergeNotSupportedError, + MergeConflictError, + MissingNameError, + MissingParameterError, + MultipleGitError, + NoRefspecError, + NotFoundError, + ObjectTypeError, + ParseError, + PushRejectedError, + RemoteCapabilityError, + SmartHttpError, + UnknownTransportError, + UnsafeFilepathError, + UrlParseError, + UserCanceledError +}); +function formatAuthor({ name, email, timestamp, timezoneOffset }) { + timezoneOffset = formatTimezoneOffset(timezoneOffset); + return `${name} <${email}> ${timestamp} ${timezoneOffset}`; +} +function formatTimezoneOffset(minutes) { + const sign = simpleSign(negateExceptForZero(minutes)); + minutes = Math.abs(minutes); + const hours = Math.floor(minutes / 60); + minutes -= hours * 60; + let strHours = String(hours); + let strMinutes = String(minutes); + if (strHours.length < 2) + strHours = "0" + strHours; + if (strMinutes.length < 2) + strMinutes = "0" + strMinutes; + return (sign === -1 ? "-" : "+") + strHours + strMinutes; +} +function simpleSign(n) { + return Math.sign(n) || (Object.is(n, -0) ? -1 : 1); +} +function negateExceptForZero(n) { + return n === 0 ? n : -n; +} +function normalizeNewlines(str) { + str = str.replace(/\r/g, ""); + str = str.replace(/^\n+/, ""); + str = str.replace(/\n+$/, "") + "\n"; + return str; +} +function parseAuthor(author) { + const [, name, email, timestamp, offset] = author.match(/^(.*) <(.*)> (.*) (.*)$/); + return { + name, + email, + timestamp: Number(timestamp), + timezoneOffset: parseTimezoneOffset(offset) + }; +} +function parseTimezoneOffset(offset) { + let [, sign, hours, minutes] = offset.match(/(\+|-)(\d\d)(\d\d)/); + minutes = (sign === "+" ? 1 : -1) * (Number(hours) * 60 + Number(minutes)); + return negateExceptForZero$1(minutes); +} +function negateExceptForZero$1(n) { + return n === 0 ? n : -n; +} +var GitAnnotatedTag = class { + constructor(tag2) { + if (typeof tag2 === "string") { + this._tag = tag2; + } else if (Buffer2.isBuffer(tag2)) { + this._tag = tag2.toString("utf8"); + } else if (typeof tag2 === "object") { + this._tag = GitAnnotatedTag.render(tag2); + } else { + throw new InternalError("invalid type passed to GitAnnotatedTag constructor"); + } + } + static from(tag2) { + return new GitAnnotatedTag(tag2); + } + static render(obj) { + return `object ${obj.object} +type ${obj.type} +tag ${obj.tag} +tagger ${formatAuthor(obj.tagger)} + +${obj.message} +${obj.gpgsig ? obj.gpgsig : ""}`; + } + justHeaders() { + return this._tag.slice(0, this._tag.indexOf("\n\n")); + } + message() { + const tag2 = this.withoutSignature(); + return tag2.slice(tag2.indexOf("\n\n") + 2); + } + parse() { + return Object.assign(this.headers(), { + message: this.message(), + gpgsig: this.gpgsig() + }); + } + render() { + return this._tag; + } + headers() { + const headers = this.justHeaders().split("\n"); + const hs = []; + for (const h of headers) { + if (h[0] === " ") { + hs[hs.length - 1] += "\n" + h.slice(1); + } else { + hs.push(h); + } + } + const obj = {}; + for (const h of hs) { + const key2 = h.slice(0, h.indexOf(" ")); + const value = h.slice(h.indexOf(" ") + 1); + if (Array.isArray(obj[key2])) { + obj[key2].push(value); + } else { + obj[key2] = value; + } + } + if (obj.tagger) { + obj.tagger = parseAuthor(obj.tagger); + } + if (obj.committer) { + obj.committer = parseAuthor(obj.committer); + } + return obj; + } + withoutSignature() { + const tag2 = normalizeNewlines(this._tag); + if (tag2.indexOf("\n-----BEGIN PGP SIGNATURE-----") === -1) + return tag2; + return tag2.slice(0, tag2.lastIndexOf("\n-----BEGIN PGP SIGNATURE-----")); + } + gpgsig() { + if (this._tag.indexOf("\n-----BEGIN PGP SIGNATURE-----") === -1) + return; + const signature = this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"), this._tag.indexOf("-----END PGP SIGNATURE-----") + "-----END PGP SIGNATURE-----".length); + return normalizeNewlines(signature); + } + payload() { + return this.withoutSignature() + "\n"; + } + toObject() { + return Buffer2.from(this._tag, "utf8"); + } + static async sign(tag2, sign, secretKey) { + const payload = tag2.payload(); + let { signature } = await sign({ payload, secretKey }); + signature = normalizeNewlines(signature); + const signedTag = payload + signature; + return GitAnnotatedTag.from(signedTag); + } +}; +function indent(str) { + return str.trim().split("\n").map((x) => " " + x).join("\n") + "\n"; +} +function outdent(str) { + return str.split("\n").map((x) => x.replace(/^ /, "")).join("\n"); +} +var GitCommit = class { + constructor(commit2) { + if (typeof commit2 === "string") { + this._commit = commit2; + } else if (Buffer2.isBuffer(commit2)) { + this._commit = commit2.toString("utf8"); + } else if (typeof commit2 === "object") { + this._commit = GitCommit.render(commit2); + } else { + throw new InternalError("invalid type passed to GitCommit constructor"); + } + } + static fromPayloadSignature({ payload, signature }) { + const headers = GitCommit.justHeaders(payload); + const message = GitCommit.justMessage(payload); + const commit2 = normalizeNewlines(headers + "\ngpgsig" + indent(signature) + "\n" + message); + return new GitCommit(commit2); + } + static from(commit2) { + return new GitCommit(commit2); + } + toObject() { + return Buffer2.from(this._commit, "utf8"); + } + headers() { + return this.parseHeaders(); + } + message() { + return GitCommit.justMessage(this._commit); + } + parse() { + return Object.assign({ message: this.message() }, this.headers()); + } + static justMessage(commit2) { + return normalizeNewlines(commit2.slice(commit2.indexOf("\n\n") + 2)); + } + static justHeaders(commit2) { + return commit2.slice(0, commit2.indexOf("\n\n")); + } + parseHeaders() { + const headers = GitCommit.justHeaders(this._commit).split("\n"); + const hs = []; + for (const h of headers) { + if (h[0] === " ") { + hs[hs.length - 1] += "\n" + h.slice(1); + } else { + hs.push(h); + } + } + const obj = { + parent: [] + }; + for (const h of hs) { + const key2 = h.slice(0, h.indexOf(" ")); + const value = h.slice(h.indexOf(" ") + 1); + if (Array.isArray(obj[key2])) { + obj[key2].push(value); + } else { + obj[key2] = value; + } + } + if (obj.author) { + obj.author = parseAuthor(obj.author); + } + if (obj.committer) { + obj.committer = parseAuthor(obj.committer); + } + return obj; + } + static renderHeaders(obj) { + let headers = ""; + if (obj.tree) { + headers += `tree ${obj.tree} +`; + } else { + headers += `tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +`; + } + if (obj.parent) { + if (obj.parent.length === void 0) { + throw new InternalError(`commit 'parent' property should be an array`); + } + for (const p of obj.parent) { + headers += `parent ${p} +`; + } + } + const author = obj.author; + headers += `author ${formatAuthor(author)} +`; + const committer = obj.committer || obj.author; + headers += `committer ${formatAuthor(committer)} +`; + if (obj.gpgsig) { + headers += "gpgsig" + indent(obj.gpgsig); + } + return headers; + } + static render(obj) { + return GitCommit.renderHeaders(obj) + "\n" + normalizeNewlines(obj.message); + } + render() { + return this._commit; + } + withoutSignature() { + const commit2 = normalizeNewlines(this._commit); + if (commit2.indexOf("\ngpgsig") === -1) + return commit2; + const headers = commit2.slice(0, commit2.indexOf("\ngpgsig")); + const message = commit2.slice(commit2.indexOf("-----END PGP SIGNATURE-----\n") + "-----END PGP SIGNATURE-----\n".length); + return normalizeNewlines(headers + "\n" + message); + } + isolateSignature() { + const signature = this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"), this._commit.indexOf("-----END PGP SIGNATURE-----") + "-----END PGP SIGNATURE-----".length); + return outdent(signature); + } + static async sign(commit2, sign, secretKey) { + const payload = commit2.withoutSignature(); + const message = GitCommit.justMessage(commit2._commit); + let { signature } = await sign({ payload, secretKey }); + signature = normalizeNewlines(signature); + const headers = GitCommit.justHeaders(commit2._commit); + const signedCommit = headers + "\ngpgsig" + indent(signature) + "\n" + message; + return GitCommit.from(signedCommit); + } +}; +async function resolveTree({ fs, cache, gitdir, oid }) { + if (oid === "4b825dc642cb6eb9a060e54bf8d69288fbee4904") { + return { tree: GitTree.from([]), oid }; + } + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + if (type === "tag") { + oid = GitAnnotatedTag.from(object).parse().object; + return resolveTree({ fs, cache, gitdir, oid }); + } + if (type === "commit") { + oid = GitCommit.from(object).parse().tree; + return resolveTree({ fs, cache, gitdir, oid }); + } + if (type !== "tree") { + throw new ObjectTypeError(oid, type, "tree"); + } + return { tree: GitTree.from(object), oid }; +} +var GitWalkerRepo = class { + constructor({ fs, gitdir, ref, cache }) { + this.fs = fs; + this.cache = cache; + this.gitdir = gitdir; + this.mapPromise = (async () => { + const map = new Map(); + let oid; + try { + oid = await GitRefManager.resolve({ fs, gitdir, ref }); + } catch (e) { + if (e instanceof NotFoundError) { + oid = "4b825dc642cb6eb9a060e54bf8d69288fbee4904"; + } + } + const tree = await resolveTree({ fs, cache: this.cache, gitdir, oid }); + tree.type = "tree"; + tree.mode = "40000"; + map.set(".", tree); + return map; + })(); + const walker = this; + this.ConstructEntry = class TreeEntry { + constructor(fullpath) { + this._fullpath = fullpath; + this._type = false; + this._mode = false; + this._stat = false; + this._content = false; + this._oid = false; + } + async type() { + return walker.type(this); + } + async mode() { + return walker.mode(this); + } + async stat() { + return walker.stat(this); + } + async content() { + return walker.content(this); + } + async oid() { + return walker.oid(this); + } + }; + } + async readdir(entry) { + const filepath = entry._fullpath; + const { fs, cache, gitdir } = this; + const map = await this.mapPromise; + const obj = map.get(filepath); + if (!obj) + throw new Error(`No obj for ${filepath}`); + const oid = obj.oid; + if (!oid) + throw new Error(`No oid for obj ${JSON.stringify(obj)}`); + if (obj.type !== "tree") { + return null; + } + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + if (type !== obj.type) { + throw new ObjectTypeError(oid, type, obj.type); + } + const tree = GitTree.from(object); + for (const entry2 of tree) { + map.set(join(filepath, entry2.path), entry2); + } + return tree.entries().map((entry2) => join(filepath, entry2.path)); + } + async type(entry) { + if (entry._type === false) { + const map = await this.mapPromise; + const { type } = map.get(entry._fullpath); + entry._type = type; + } + return entry._type; + } + async mode(entry) { + if (entry._mode === false) { + const map = await this.mapPromise; + const { mode } = map.get(entry._fullpath); + entry._mode = normalizeMode(parseInt(mode, 8)); + } + return entry._mode; + } + async stat(_entry) { + } + async content(entry) { + if (entry._content === false) { + const map = await this.mapPromise; + const { fs, cache, gitdir } = this; + const obj = map.get(entry._fullpath); + const oid = obj.oid; + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + if (type !== "blob") { + entry._content = void 0; + } else { + entry._content = new Uint8Array(object); + } + } + return entry._content; + } + async oid(entry) { + if (entry._oid === false) { + const map = await this.mapPromise; + const obj = map.get(entry._fullpath); + entry._oid = obj.oid; + } + return entry._oid; + } +}; +function TREE({ ref = "HEAD" } = {}) { + const o = Object.create(null); + Object.defineProperty(o, GitWalkSymbol, { + value: function({ fs, gitdir, cache }) { + return new GitWalkerRepo({ fs, gitdir, ref, cache }); + } + }); + Object.freeze(o); + return o; +} +var GitWalkerFs = class { + constructor({ fs, dir, gitdir, cache }) { + this.fs = fs; + this.cache = cache; + this.dir = dir; + this.gitdir = gitdir; + const walker = this; + this.ConstructEntry = class WorkdirEntry { + constructor(fullpath) { + this._fullpath = fullpath; + this._type = false; + this._mode = false; + this._stat = false; + this._content = false; + this._oid = false; + } + async type() { + return walker.type(this); + } + async mode() { + return walker.mode(this); + } + async stat() { + return walker.stat(this); + } + async content() { + return walker.content(this); + } + async oid() { + return walker.oid(this); + } + }; + } + async readdir(entry) { + const filepath = entry._fullpath; + const { fs, dir } = this; + const names = await fs.readdir(join(dir, filepath)); + if (names === null) + return null; + return names.map((name) => join(filepath, name)); + } + async type(entry) { + if (entry._type === false) { + await entry.stat(); + } + return entry._type; + } + async mode(entry) { + if (entry._mode === false) { + await entry.stat(); + } + return entry._mode; + } + async stat(entry) { + if (entry._stat === false) { + const { fs, dir } = this; + let stat = await fs.lstat(`${dir}/${entry._fullpath}`); + if (!stat) { + throw new Error(`ENOENT: no such file or directory, lstat '${entry._fullpath}'`); + } + let type = stat.isDirectory() ? "tree" : "blob"; + if (type === "blob" && !stat.isFile() && !stat.isSymbolicLink()) { + type = "special"; + } + entry._type = type; + stat = normalizeStats(stat); + entry._mode = stat.mode; + if (stat.size === -1 && entry._actualSize) { + stat.size = entry._actualSize; + } + entry._stat = stat; + } + return entry._stat; + } + async content(entry) { + if (entry._content === false) { + const { fs, dir } = this; + if (await entry.type() === "tree") { + entry._content = void 0; + } else { + const content = await fs.read(`${dir}/${entry._fullpath}`); + entry._actualSize = content.length; + if (entry._stat && entry._stat.size === -1) { + entry._stat.size = entry._actualSize; + } + entry._content = new Uint8Array(content); + } + } + return entry._content; + } + async oid(entry) { + if (entry._oid === false) { + const { fs, gitdir, cache } = this; + let oid; + await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + const stage = index2.entriesMap.get(entry._fullpath); + const stats = await entry.stat(); + if (!stage || compareStats(stats, stage)) { + const content = await entry.content(); + if (content === void 0) { + oid = void 0; + } else { + oid = await shasum(GitObject.wrap({ type: "blob", object: await entry.content() })); + if (stage && oid === stage.oid && stats.mode === stage.mode && compareStats(stats, stage)) { + index2.insert({ + filepath: entry._fullpath, + stats, + oid + }); + } + } + } else { + oid = stage.oid; + } + }); + entry._oid = oid; + } + return entry._oid; + } +}; +function WORKDIR() { + const o = Object.create(null); + Object.defineProperty(o, GitWalkSymbol, { + value: function({ fs, dir, gitdir, cache }) { + return new GitWalkerFs({ fs, dir, gitdir, cache }); + } + }); + Object.freeze(o); + return o; +} +var GitIgnoreManager = class { + static async isIgnored({ fs, dir, gitdir = join(dir, ".git"), filepath }) { + if (basename(filepath) === ".git") + return true; + if (filepath === ".") + return false; + let excludes = ""; + const excludesFile = join(gitdir, "info", "exclude"); + if (await fs.exists(excludesFile)) { + excludes = await fs.read(excludesFile, "utf8"); + } + const pairs = [ + { + gitignore: join(dir, ".gitignore"), + filepath + } + ]; + const pieces = filepath.split("/").filter(Boolean); + for (let i = 1; i < pieces.length; i++) { + const folder = pieces.slice(0, i).join("/"); + const file = pieces.slice(i).join("/"); + pairs.push({ + gitignore: join(dir, folder, ".gitignore"), + filepath: file + }); + } + let ignoredStatus = false; + for (const p of pairs) { + let file; + try { + file = await fs.read(p.gitignore, "utf8"); + } catch (err) { + if (err.code === "NOENT") + continue; + } + const ign = (0, import_ignore.default)().add(excludes); + ign.add(file); + const parentdir = dirname(p.filepath); + if (parentdir !== "." && ign.ignores(parentdir)) + return true; + if (ignoredStatus) { + ignoredStatus = !ign.test(p.filepath).unignored; + } else { + ignoredStatus = ign.test(p.filepath).ignored; + } + } + return ignoredStatus; + } +}; +async function rmRecursive(fs, filepath) { + const entries = await fs.readdir(filepath); + if (entries == null) { + await fs.rm(filepath); + } else if (entries.length) { + await Promise.all(entries.map((entry) => { + const subpath = join(filepath, entry); + return fs.lstat(subpath).then((stat) => { + if (!stat) + return; + return stat.isDirectory() ? rmRecursive(fs, subpath) : fs.rm(subpath); + }); + })).then(() => fs.rmdir(filepath)); + } else { + await fs.rmdir(filepath); + } +} +var FileSystem = class { + constructor(fs) { + if (typeof fs._original_unwrapped_fs !== "undefined") + return fs; + const promises = Object.getOwnPropertyDescriptor(fs, "promises"); + if (promises && promises.enumerable) { + this._readFile = fs.promises.readFile.bind(fs.promises); + this._writeFile = fs.promises.writeFile.bind(fs.promises); + this._mkdir = fs.promises.mkdir.bind(fs.promises); + if (fs.promises.rm) { + this._rm = fs.promises.rm.bind(fs.promises); + } else if (fs.promises.rmdir.length > 1) { + this._rm = fs.promises.rmdir.bind(fs.promises); + } else { + this._rm = rmRecursive.bind(null, this); + } + this._rmdir = fs.promises.rmdir.bind(fs.promises); + this._unlink = fs.promises.unlink.bind(fs.promises); + this._stat = fs.promises.stat.bind(fs.promises); + this._lstat = fs.promises.lstat.bind(fs.promises); + this._readdir = fs.promises.readdir.bind(fs.promises); + this._readlink = fs.promises.readlink.bind(fs.promises); + this._symlink = fs.promises.symlink.bind(fs.promises); + } else { + this._readFile = (0, import_pify.default)(fs.readFile.bind(fs)); + this._writeFile = (0, import_pify.default)(fs.writeFile.bind(fs)); + this._mkdir = (0, import_pify.default)(fs.mkdir.bind(fs)); + if (fs.rm) { + this._rm = (0, import_pify.default)(fs.rm.bind(fs)); + } else if (fs.rmdir.length > 2) { + this._rm = (0, import_pify.default)(fs.rmdir.bind(fs)); + } else { + this._rm = rmRecursive.bind(null, this); + } + this._rmdir = (0, import_pify.default)(fs.rmdir.bind(fs)); + this._unlink = (0, import_pify.default)(fs.unlink.bind(fs)); + this._stat = (0, import_pify.default)(fs.stat.bind(fs)); + this._lstat = (0, import_pify.default)(fs.lstat.bind(fs)); + this._readdir = (0, import_pify.default)(fs.readdir.bind(fs)); + this._readlink = (0, import_pify.default)(fs.readlink.bind(fs)); + this._symlink = (0, import_pify.default)(fs.symlink.bind(fs)); + } + this._original_unwrapped_fs = fs; + } + async exists(filepath, options = {}) { + try { + await this._stat(filepath); + return true; + } catch (err) { + if (err.code === "ENOENT" || err.code === "ENOTDIR") { + return false; + } else { + console.log('Unhandled error in "FileSystem.exists()" function', err); + throw err; + } + } + } + async read(filepath, options = {}) { + try { + let buffer2 = await this._readFile(filepath, options); + if (typeof buffer2 !== "string") { + buffer2 = Buffer2.from(buffer2); + } + return buffer2; + } catch (err) { + return null; + } + } + async write(filepath, contents, options = {}) { + try { + await this._writeFile(filepath, contents, options); + return; + } catch (err) { + await this.mkdir(dirname(filepath)); + await this._writeFile(filepath, contents, options); + } + } + async mkdir(filepath, _selfCall = false) { + try { + await this._mkdir(filepath); + return; + } catch (err) { + if (err === null) + return; + if (err.code === "EEXIST") + return; + if (_selfCall) + throw err; + if (err.code === "ENOENT") { + const parent = dirname(filepath); + if (parent === "." || parent === "/" || parent === filepath) + throw err; + await this.mkdir(parent); + await this.mkdir(filepath, true); + } + } + } + async rm(filepath) { + try { + await this._unlink(filepath); + } catch (err) { + if (err.code !== "ENOENT") + throw err; + } + } + async rmdir(filepath, opts) { + try { + if (opts && opts.recursive) { + await this._rm(filepath, opts); + } else { + await this._rmdir(filepath); + } + } catch (err) { + if (err.code !== "ENOENT") + throw err; + } + } + async readdir(filepath) { + try { + const names = await this._readdir(filepath); + names.sort(compareStrings); + return names; + } catch (err) { + if (err.code === "ENOTDIR") + return null; + return []; + } + } + async readdirDeep(dir) { + const subdirs = await this._readdir(dir); + const files = await Promise.all(subdirs.map(async (subdir) => { + const res = dir + "/" + subdir; + return (await this._stat(res)).isDirectory() ? this.readdirDeep(res) : res; + })); + return files.reduce((a, f) => a.concat(f), []); + } + async lstat(filename) { + try { + const stats = await this._lstat(filename); + return stats; + } catch (err) { + if (err.code === "ENOENT") { + return null; + } + throw err; + } + } + async readlink(filename, opts = { encoding: "buffer" }) { + try { + const link = await this._readlink(filename, opts); + return Buffer2.isBuffer(link) ? link : Buffer2.from(link); + } catch (err) { + if (err.code === "ENOENT") { + return null; + } + throw err; + } + } + async writelink(filename, buffer2) { + return this._symlink(buffer2.toString("utf8"), filename); + } +}; +async function writeObjectLoose({ fs, gitdir, object, format, oid }) { + if (format !== "deflated") { + throw new InternalError("GitObjectStoreLoose expects objects to write to be in deflated format"); + } + const source = `objects/${oid.slice(0, 2)}/${oid.slice(2)}`; + const filepath = `${gitdir}/${source}`; + if (!await fs.exists(filepath)) + await fs.write(filepath, object); +} +var supportsCompressionStream = null; +async function deflate(buffer2) { + if (supportsCompressionStream === null) { + supportsCompressionStream = testCompressionStream(); + } + return supportsCompressionStream ? browserDeflate(buffer2) : import_pako.default.deflate(buffer2); +} +async function browserDeflate(buffer2) { + const cs = new CompressionStream("deflate"); + const c = new Blob([buffer2]).stream().pipeThrough(cs); + return new Uint8Array(await new Response(c).arrayBuffer()); +} +function testCompressionStream() { + try { + const cs = new CompressionStream("deflate"); + new Blob([]).stream(); + if (cs) + return true; + } catch (_) { + } + return false; +} +async function _writeObject({ + fs, + gitdir, + type, + object, + format = "content", + oid = void 0, + dryRun = false +}) { + if (format !== "deflated") { + if (format !== "wrapped") { + object = GitObject.wrap({ type, object }); + } + oid = await shasum(object); + object = Buffer2.from(await deflate(object)); + } + if (!dryRun) { + await writeObjectLoose({ fs, gitdir, object, format: "deflated", oid }); + } + return oid; +} +function assertParameter(name, value) { + if (value === void 0) { + throw new MissingParameterError(name); + } +} +function posixifyPathBuffer(buffer2) { + let idx; + while (~(idx = buffer2.indexOf(92))) + buffer2[idx] = 47; + return buffer2; +} +async function add({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + filepath, + cache = {}, + force = false +}) { + try { + assertParameter("fs", _fs); + assertParameter("dir", dir); + assertParameter("gitdir", gitdir); + assertParameter("filepath", filepath); + const fs = new FileSystem(_fs); + await GitIndexManager.acquire({ fs, gitdir, cache }, async (index2) => { + return addToIndex({ dir, gitdir, fs, filepath, index: index2, force }); + }); + } catch (err) { + err.caller = "git.add"; + throw err; + } +} +async function addToIndex({ dir, gitdir, fs, filepath, index: index2, force }) { + filepath = Array.isArray(filepath) ? filepath : [filepath]; + const promises = filepath.map(async (currentFilepath) => { + if (!force) { + const ignored = await GitIgnoreManager.isIgnored({ + fs, + dir, + gitdir, + filepath: currentFilepath + }); + if (ignored) + return; + } + const stats = await fs.lstat(join(dir, currentFilepath)); + if (!stats) + throw new NotFoundError(currentFilepath); + if (stats.isDirectory()) { + const children2 = await fs.readdir(join(dir, currentFilepath)); + const promises2 = children2.map((child) => addToIndex({ + dir, + gitdir, + fs, + filepath: [join(currentFilepath, child)], + index: index2, + force + })); + await Promise.all(promises2); + } else { + const object = stats.isSymbolicLink() ? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer) : await fs.read(join(dir, currentFilepath)); + if (object === null) + throw new NotFoundError(currentFilepath); + const oid = await _writeObject({ fs, gitdir, type: "blob", object }); + index2.insert({ filepath: currentFilepath, stats, oid }); + } + }); + const settledPromises = await Promise.allSettled(promises); + const rejectedPromises = settledPromises.filter((settle) => settle.status === "rejected").map((settle) => settle.reason); + if (rejectedPromises.length > 1) { + throw new MultipleGitError(rejectedPromises); + } + if (rejectedPromises.length === 1) { + throw rejectedPromises[0]; + } + const fulfilledPromises = settledPromises.filter((settle) => settle.status === "fulfilled" && settle.value).map((settle) => settle.value); + return fulfilledPromises; +} +async function _commit({ + fs, + cache, + onSign, + gitdir, + message, + author, + committer, + signingKey, + dryRun = false, + noUpdateBranch = false, + ref, + parent, + tree +}) { + if (!ref) { + ref = await GitRefManager.resolve({ + fs, + gitdir, + ref: "HEAD", + depth: 2 + }); + } + return GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + const inodes = flatFileListToDirectoryStructure(index2.entries); + const inode = inodes.get("."); + if (!tree) { + tree = await constructTree({ fs, gitdir, inode, dryRun }); + } + if (!parent) { + try { + parent = [ + await GitRefManager.resolve({ + fs, + gitdir, + ref + }) + ]; + } catch (err) { + parent = []; + } + } else { + parent = await Promise.all(parent.map((p) => { + return GitRefManager.resolve({ fs, gitdir, ref: p }); + })); + } + let comm = GitCommit.from({ + tree, + parent, + author, + committer, + message + }); + if (signingKey) { + comm = await GitCommit.sign(comm, onSign, signingKey); + } + const oid = await _writeObject({ + fs, + gitdir, + type: "commit", + object: comm.toObject(), + dryRun + }); + if (!noUpdateBranch && !dryRun) { + await GitRefManager.writeRef({ + fs, + gitdir, + ref, + value: oid + }); + } + return oid; + }); +} +async function constructTree({ fs, gitdir, inode, dryRun }) { + const children2 = inode.children; + for (const inode2 of children2) { + if (inode2.type === "tree") { + inode2.metadata.mode = "040000"; + inode2.metadata.oid = await constructTree({ fs, gitdir, inode: inode2, dryRun }); + } + } + const entries = children2.map((inode2) => ({ + mode: inode2.metadata.mode, + path: inode2.basename, + oid: inode2.metadata.oid, + type: inode2.type + })); + const tree = GitTree.from(entries); + const oid = await _writeObject({ + fs, + gitdir, + type: "tree", + object: tree.toObject(), + dryRun + }); + return oid; +} +async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) { + if (filepath.startsWith("/")) { + throw new InvalidFilepathError("leading-slash"); + } else if (filepath.endsWith("/")) { + throw new InvalidFilepathError("trailing-slash"); + } + const _oid = oid; + const result = await resolveTree({ fs, cache, gitdir, oid }); + const tree = result.tree; + if (filepath === "") { + oid = result.oid; + } else { + const pathArray = filepath.split("/"); + oid = await _resolveFilepath({ + fs, + cache, + gitdir, + tree, + pathArray, + oid: _oid, + filepath + }); + } + return oid; +} +async function _resolveFilepath({ + fs, + cache, + gitdir, + tree, + pathArray, + oid, + filepath +}) { + const name = pathArray.shift(); + for (const entry of tree) { + if (entry.path === name) { + if (pathArray.length === 0) { + return entry.oid; + } else { + const { type, object } = await _readObject({ + fs, + cache, + gitdir, + oid: entry.oid + }); + if (type !== "tree") { + throw new ObjectTypeError(oid, type, "blob", filepath); + } + tree = GitTree.from(object); + return _resolveFilepath({ + fs, + cache, + gitdir, + tree, + pathArray, + oid, + filepath + }); + } + } + } + throw new NotFoundError(`file or directory found at "${oid}:${filepath}"`); +} +async function _readTree({ + fs, + cache, + gitdir, + oid, + filepath = void 0 +}) { + if (filepath !== void 0) { + oid = await resolveFilepath({ fs, cache, gitdir, oid, filepath }); + } + const { tree, oid: treeOid } = await resolveTree({ fs, cache, gitdir, oid }); + const result = { + oid: treeOid, + tree: tree.entries() + }; + return result; +} +async function _writeTree({ fs, gitdir, tree }) { + const object = GitTree.from(tree).toObject(); + const oid = await _writeObject({ + fs, + gitdir, + type: "tree", + object, + format: "content" + }); + return oid; +} +async function _addNote({ + fs, + cache, + onSign, + gitdir, + ref, + oid, + note, + force, + author, + committer, + signingKey +}) { + let parent; + try { + parent = await GitRefManager.resolve({ gitdir, fs, ref }); + } catch (err) { + if (!(err instanceof NotFoundError)) { + throw err; + } + } + const result = await _readTree({ + fs, + cache, + gitdir, + oid: parent || "4b825dc642cb6eb9a060e54bf8d69288fbee4904" + }); + let tree = result.tree; + if (force) { + tree = tree.filter((entry) => entry.path !== oid); + } else { + for (const entry of tree) { + if (entry.path === oid) { + throw new AlreadyExistsError("note", oid); + } + } + } + if (typeof note === "string") { + note = Buffer2.from(note, "utf8"); + } + const noteOid = await _writeObject({ + fs, + gitdir, + type: "blob", + object: note, + format: "content" + }); + tree.push({ mode: "100644", path: oid, oid: noteOid, type: "blob" }); + const treeOid = await _writeTree({ + fs, + gitdir, + tree + }); + const commitOid = await _commit({ + fs, + cache, + onSign, + gitdir, + ref, + tree: treeOid, + parent: parent && [parent], + message: `Note added by 'isomorphic-git addNote' +`, + author, + committer, + signingKey + }); + return commitOid; +} +async function _getConfig({ fs, gitdir, path: path2 }) { + const config = await GitConfigManager.get({ fs, gitdir }); + return config.get(path2); +} +async function normalizeAuthorObject({ fs, gitdir, author = {} }) { + let { name, email, timestamp, timezoneOffset } = author; + name = name || await _getConfig({ fs, gitdir, path: "user.name" }); + email = email || await _getConfig({ fs, gitdir, path: "user.email" }) || ""; + if (name === void 0) { + return void 0; + } + timestamp = timestamp != null ? timestamp : Math.floor(Date.now() / 1e3); + timezoneOffset = timezoneOffset != null ? timezoneOffset : new Date(timestamp * 1e3).getTimezoneOffset(); + return { name, email, timestamp, timezoneOffset }; +} +async function normalizeCommitterObject({ + fs, + gitdir, + author, + committer +}) { + committer = Object.assign({}, committer || author); + if (author) { + committer.timestamp = committer.timestamp || author.timestamp; + committer.timezoneOffset = committer.timezoneOffset || author.timezoneOffset; + } + committer = await normalizeAuthorObject({ fs, gitdir, author: committer }); + return committer; +} +async function addNote({ + fs: _fs, + onSign, + dir, + gitdir = join(dir, ".git"), + ref = "refs/notes/commits", + oid, + note, + force, + author: _author, + committer: _committer, + signingKey, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + assertParameter("note", note); + if (signingKey) { + assertParameter("onSign", onSign); + } + const fs = new FileSystem(_fs); + const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); + if (!author) + throw new MissingNameError("author"); + const committer = await normalizeCommitterObject({ + fs, + gitdir, + author, + committer: _committer + }); + if (!committer) + throw new MissingNameError("committer"); + return await _addNote({ + fs: new FileSystem(fs), + cache, + onSign, + gitdir, + ref, + oid, + note, + force, + author, + committer, + signingKey + }); + } catch (err) { + err.caller = "git.addNote"; + throw err; + } +} +async function _addRemote({ fs, gitdir, remote, url, force }) { + if (remote !== import_clean_git_ref.default.clean(remote)) { + throw new InvalidRefNameError(remote, import_clean_git_ref.default.clean(remote)); + } + const config = await GitConfigManager.get({ fs, gitdir }); + if (!force) { + const remoteNames = await config.getSubsections("remote"); + if (remoteNames.includes(remote)) { + if (url !== await config.get(`remote.${remote}.url`)) { + throw new AlreadyExistsError("remote", remote); + } + } + } + await config.set(`remote.${remote}.url`, url); + await config.set(`remote.${remote}.fetch`, `+refs/heads/*:refs/remotes/${remote}/*`); + await GitConfigManager.save({ fs, gitdir, config }); +} +async function addRemote({ + fs, + dir, + gitdir = join(dir, ".git"), + remote, + url, + force = false +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("remote", remote); + assertParameter("url", url); + return await _addRemote({ + fs: new FileSystem(fs), + gitdir, + remote, + url, + force + }); + } catch (err) { + err.caller = "git.addRemote"; + throw err; + } +} +async function _annotatedTag({ + fs, + cache, + onSign, + gitdir, + ref, + tagger, + message = ref, + gpgsig, + object, + signingKey, + force = false +}) { + ref = ref.startsWith("refs/tags/") ? ref : `refs/tags/${ref}`; + if (!force && await GitRefManager.exists({ fs, gitdir, ref })) { + throw new AlreadyExistsError("tag", ref); + } + const oid = await GitRefManager.resolve({ + fs, + gitdir, + ref: object || "HEAD" + }); + const { type } = await _readObject({ fs, cache, gitdir, oid }); + let tagObject = GitAnnotatedTag.from({ + object: oid, + type, + tag: ref.replace("refs/tags/", ""), + tagger, + message, + gpgsig + }); + if (signingKey) { + tagObject = await GitAnnotatedTag.sign(tagObject, onSign, signingKey); + } + const value = await _writeObject({ + fs, + gitdir, + type: "tag", + object: tagObject.toObject() + }); + await GitRefManager.writeRef({ fs, gitdir, ref, value }); +} +async function annotatedTag({ + fs: _fs, + onSign, + dir, + gitdir = join(dir, ".git"), + ref, + tagger: _tagger, + message = ref, + gpgsig, + object, + signingKey, + force = false, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + if (signingKey) { + assertParameter("onSign", onSign); + } + const fs = new FileSystem(_fs); + const tagger = await normalizeAuthorObject({ fs, gitdir, author: _tagger }); + if (!tagger) + throw new MissingNameError("tagger"); + return await _annotatedTag({ + fs, + cache, + onSign, + gitdir, + ref, + tagger, + message, + gpgsig, + object, + signingKey, + force + }); + } catch (err) { + err.caller = "git.annotatedTag"; + throw err; + } +} +async function _branch({ + fs, + gitdir, + ref, + object, + checkout: checkout2 = false, + force = false +}) { + if (ref !== import_clean_git_ref.default.clean(ref)) { + throw new InvalidRefNameError(ref, import_clean_git_ref.default.clean(ref)); + } + const fullref = `refs/heads/${ref}`; + if (!force) { + const exist = await GitRefManager.exists({ fs, gitdir, ref: fullref }); + if (exist) { + throw new AlreadyExistsError("branch", ref, false); + } + } + let oid; + try { + oid = await GitRefManager.resolve({ fs, gitdir, ref: object || "HEAD" }); + } catch (e) { + } + if (oid) { + await GitRefManager.writeRef({ fs, gitdir, ref: fullref, value: oid }); + } + if (checkout2) { + await GitRefManager.writeSymbolicRef({ + fs, + gitdir, + ref: "HEAD", + value: fullref + }); + } +} +async function branch({ + fs, + dir, + gitdir = join(dir, ".git"), + ref, + object, + checkout: checkout2 = false, + force = false +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + return await _branch({ + fs: new FileSystem(fs), + gitdir, + ref, + object, + checkout: checkout2, + force + }); + } catch (err) { + err.caller = "git.branch"; + throw err; + } +} +function arrayRange(start, end) { + const length = end - start; + return Array.from({ length }, (_, i) => start + i); +} +var flat = typeof Array.prototype.flat === "undefined" ? (entries) => entries.reduce((acc, x) => acc.concat(x), []) : (entries) => entries.flat(); +var RunningMinimum = class { + constructor() { + this.value = null; + } + consider(value) { + if (value === null || value === void 0) + return; + if (this.value === null) { + this.value = value; + } else if (value < this.value) { + this.value = value; + } + } + reset() { + this.value = null; + } +}; +function* unionOfIterators(sets) { + const min = new RunningMinimum(); + let minimum; + const heads = []; + const numsets = sets.length; + for (let i = 0; i < numsets; i++) { + heads[i] = sets[i].next().value; + if (heads[i] !== void 0) { + min.consider(heads[i]); + } + } + if (min.value === null) + return; + while (true) { + const result = []; + minimum = min.value; + min.reset(); + for (let i = 0; i < numsets; i++) { + if (heads[i] !== void 0 && heads[i] === minimum) { + result[i] = heads[i]; + heads[i] = sets[i].next().value; + } else { + result[i] = null; + } + if (heads[i] !== void 0) { + min.consider(heads[i]); + } + } + yield result; + if (min.value === null) + return; + } +} +async function _walk({ + fs, + cache, + dir, + gitdir, + trees, + map = async (_, entry) => entry, + reduce = async (parent, children2) => { + const flatten = flat(children2); + if (parent !== void 0) + flatten.unshift(parent); + return flatten; + }, + iterate = (walk2, children2) => Promise.all([...children2].map(walk2)) +}) { + const walkers = trees.map((proxy) => proxy[GitWalkSymbol]({ fs, dir, gitdir, cache })); + const root = new Array(walkers.length).fill("."); + const range = arrayRange(0, walkers.length); + const unionWalkerFromReaddir = async (entries) => { + range.map((i) => { + entries[i] = entries[i] && new walkers[i].ConstructEntry(entries[i]); + }); + const subdirs = await Promise.all(range.map((i) => entries[i] ? walkers[i].readdir(entries[i]) : [])); + const iterators = subdirs.map((array) => array === null ? [] : array).map((array) => array[Symbol.iterator]()); + return { + entries, + children: unionOfIterators(iterators) + }; + }; + const walk2 = async (root2) => { + const { entries, children: children2 } = await unionWalkerFromReaddir(root2); + const fullpath = entries.find((entry) => entry && entry._fullpath)._fullpath; + const parent = await map(fullpath, entries); + if (parent !== null) { + let walkedChildren = await iterate(walk2, children2); + walkedChildren = walkedChildren.filter((x) => x !== void 0); + return reduce(parent, walkedChildren); + } + }; + return walk2(root); +} +var worthWalking = (filepath, root) => { + if (filepath === "." || root == null || root.length === 0 || root === ".") { + return true; + } + if (root.length >= filepath.length) { + return root.startsWith(filepath); + } else { + return filepath.startsWith(root); + } +}; +async function _checkout({ + fs, + cache, + onProgress, + dir, + gitdir, + remote, + ref, + filepaths, + noCheckout, + noUpdateHead, + dryRun, + force, + track = true +}) { + let oid; + try { + oid = await GitRefManager.resolve({ fs, gitdir, ref }); + } catch (err) { + if (ref === "HEAD") + throw err; + const remoteRef = `${remote}/${ref}`; + oid = await GitRefManager.resolve({ + fs, + gitdir, + ref: remoteRef + }); + if (track) { + const config = await GitConfigManager.get({ fs, gitdir }); + await config.set(`branch.${ref}.remote`, remote); + await config.set(`branch.${ref}.merge`, `refs/heads/${ref}`); + await GitConfigManager.save({ fs, gitdir, config }); + } + await GitRefManager.writeRef({ + fs, + gitdir, + ref: `refs/heads/${ref}`, + value: oid + }); + } + if (!noCheckout) { + let ops; + try { + ops = await analyze({ + fs, + cache, + onProgress, + dir, + gitdir, + ref, + force, + filepaths + }); + } catch (err) { + if (err instanceof NotFoundError && err.data.what === oid) { + throw new CommitNotFetchedError(ref, oid); + } else { + throw err; + } + } + const conflicts2 = ops.filter(([method]) => method === "conflict").map(([method, fullpath]) => fullpath); + if (conflicts2.length > 0) { + throw new CheckoutConflictError(conflicts2); + } + const errors = ops.filter(([method]) => method === "error").map(([method, fullpath]) => fullpath); + if (errors.length > 0) { + throw new InternalError(errors.join(", ")); + } + if (dryRun) { + return; + } + let count = 0; + const total = ops.length; + await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + await Promise.all(ops.filter(([method]) => method === "delete" || method === "delete-index").map(async function([method, fullpath]) { + const filepath = `${dir}/${fullpath}`; + if (method === "delete") { + await fs.rm(filepath); + } + index2.delete({ filepath: fullpath }); + if (onProgress) { + await onProgress({ + phase: "Updating workdir", + loaded: ++count, + total + }); + } + })); + }); + await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + for (const [method, fullpath] of ops) { + if (method === "rmdir" || method === "rmdir-index") { + const filepath = `${dir}/${fullpath}`; + try { + if (method === "rmdir-index") { + index2.delete({ filepath: fullpath }); + } + await fs.rmdir(filepath); + if (onProgress) { + await onProgress({ + phase: "Updating workdir", + loaded: ++count, + total + }); + } + } catch (e) { + if (e.code === "ENOTEMPTY") { + console.log(`Did not delete ${fullpath} because directory is not empty`); + } else { + throw e; + } + } + } + } + }); + await Promise.all(ops.filter(([method]) => method === "mkdir" || method === "mkdir-index").map(async function([_, fullpath]) { + const filepath = `${dir}/${fullpath}`; + await fs.mkdir(filepath); + if (onProgress) { + await onProgress({ + phase: "Updating workdir", + loaded: ++count, + total + }); + } + })); + await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + await Promise.all(ops.filter(([method]) => method === "create" || method === "create-index" || method === "update" || method === "mkdir-index").map(async function([method, fullpath, oid2, mode, chmod]) { + const filepath = `${dir}/${fullpath}`; + try { + if (method !== "create-index" && method !== "mkdir-index") { + const { object } = await _readObject({ fs, cache, gitdir, oid: oid2 }); + if (chmod) { + await fs.rm(filepath); + } + if (mode === 33188) { + await fs.write(filepath, object); + } else if (mode === 33261) { + await fs.write(filepath, object, { mode: 511 }); + } else if (mode === 40960) { + await fs.writelink(filepath, object); + } else { + throw new InternalError(`Invalid mode 0o${mode.toString(8)} detected in blob ${oid2}`); + } + } + const stats = await fs.lstat(filepath); + if (mode === 33261) { + stats.mode = 493; + } + if (method === "mkdir-index") { + stats.mode = 57344; + } + index2.insert({ + filepath: fullpath, + stats, + oid: oid2 + }); + if (onProgress) { + await onProgress({ + phase: "Updating workdir", + loaded: ++count, + total + }); + } + } catch (e) { + console.log(e); + } + })); + }); + } + if (!noUpdateHead) { + const fullRef = await GitRefManager.expand({ fs, gitdir, ref }); + if (fullRef.startsWith("refs/heads")) { + await GitRefManager.writeSymbolicRef({ + fs, + gitdir, + ref: "HEAD", + value: fullRef + }); + } else { + await GitRefManager.writeRef({ fs, gitdir, ref: "HEAD", value: oid }); + } + } +} +async function analyze({ + fs, + cache, + onProgress, + dir, + gitdir, + ref, + force, + filepaths +}) { + let count = 0; + return _walk({ + fs, + cache, + dir, + gitdir, + trees: [TREE({ ref }), WORKDIR(), STAGE()], + map: async function(fullpath, [commit2, workdir, stage]) { + if (fullpath === ".") + return; + if (filepaths && !filepaths.some((base) => worthWalking(fullpath, base))) { + return null; + } + if (onProgress) { + await onProgress({ phase: "Analyzing workdir", loaded: ++count }); + } + const key2 = [!!stage, !!commit2, !!workdir].map(Number).join(""); + switch (key2) { + case "000": + return; + case "001": + if (force && filepaths && filepaths.includes(fullpath)) { + return ["delete", fullpath]; + } + return; + case "010": { + switch (await commit2.type()) { + case "tree": { + return ["mkdir", fullpath]; + } + case "blob": { + return [ + "create", + fullpath, + await commit2.oid(), + await commit2.mode() + ]; + } + case "commit": { + return [ + "mkdir-index", + fullpath, + await commit2.oid(), + await commit2.mode() + ]; + } + default: { + return [ + "error", + `new entry Unhandled type ${await commit2.type()}` + ]; + } + } + } + case "011": { + switch (`${await commit2.type()}-${await workdir.type()}`) { + case "tree-tree": { + return; + } + case "tree-blob": + case "blob-tree": { + return ["conflict", fullpath]; + } + case "blob-blob": { + if (await commit2.oid() !== await workdir.oid()) { + if (force) { + return [ + "update", + fullpath, + await commit2.oid(), + await commit2.mode(), + await commit2.mode() !== await workdir.mode() + ]; + } else { + return ["conflict", fullpath]; + } + } else { + if (await commit2.mode() !== await workdir.mode()) { + if (force) { + return [ + "update", + fullpath, + await commit2.oid(), + await commit2.mode(), + true + ]; + } else { + return ["conflict", fullpath]; + } + } else { + return [ + "create-index", + fullpath, + await commit2.oid(), + await commit2.mode() + ]; + } + } + } + case "commit-tree": { + return; + } + case "commit-blob": { + return ["conflict", fullpath]; + } + default: { + return ["error", `new entry Unhandled type ${commit2.type}`]; + } + } + } + case "100": { + return ["delete-index", fullpath]; + } + case "101": { + switch (await stage.type()) { + case "tree": { + return ["rmdir", fullpath]; + } + case "blob": { + if (await stage.oid() !== await workdir.oid()) { + if (force) { + return ["delete", fullpath]; + } else { + return ["conflict", fullpath]; + } + } else { + return ["delete", fullpath]; + } + } + case "commit": { + return ["rmdir-index", fullpath]; + } + default: { + return [ + "error", + `delete entry Unhandled type ${await stage.type()}` + ]; + } + } + } + case "110": + case "111": { + switch (`${await stage.type()}-${await commit2.type()}`) { + case "tree-tree": { + return; + } + case "blob-blob": { + if (await stage.oid() === await commit2.oid() && await stage.mode() === await commit2.mode() && !force) { + return; + } + if (workdir) { + if (await workdir.oid() !== await stage.oid() && await workdir.oid() !== await commit2.oid()) { + if (force) { + return [ + "update", + fullpath, + await commit2.oid(), + await commit2.mode(), + await commit2.mode() !== await workdir.mode() + ]; + } else { + return ["conflict", fullpath]; + } + } + } else if (force) { + return [ + "update", + fullpath, + await commit2.oid(), + await commit2.mode(), + await commit2.mode() !== await stage.mode() + ]; + } + if (await commit2.mode() !== await stage.mode()) { + return [ + "update", + fullpath, + await commit2.oid(), + await commit2.mode(), + true + ]; + } + if (await commit2.oid() !== await stage.oid()) { + return [ + "update", + fullpath, + await commit2.oid(), + await commit2.mode(), + false + ]; + } else { + return; + } + } + case "tree-blob": { + return ["update-dir-to-blob", fullpath, await commit2.oid()]; + } + case "blob-tree": { + return ["update-blob-to-tree", fullpath]; + } + case "commit-commit": { + return [ + "mkdir-index", + fullpath, + await commit2.oid(), + await commit2.mode() + ]; + } + default: { + return [ + "error", + `update entry Unhandled type ${await stage.type()}-${await commit2.type()}` + ]; + } + } + } + } + }, + reduce: async function(parent, children2) { + children2 = flat(children2); + if (!parent) { + return children2; + } else if (parent && parent[0] === "rmdir") { + children2.push(parent); + return children2; + } else { + children2.unshift(parent); + return children2; + } + } + }); +} +async function checkout({ + fs, + onProgress, + dir, + gitdir = join(dir, ".git"), + remote = "origin", + ref: _ref, + filepaths, + noCheckout = false, + noUpdateHead = _ref === void 0, + dryRun = false, + force = false, + track = true, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("dir", dir); + assertParameter("gitdir", gitdir); + const ref = _ref || "HEAD"; + return await _checkout({ + fs: new FileSystem(fs), + cache, + onProgress, + dir, + gitdir, + remote, + ref, + filepaths, + noCheckout, + noUpdateHead, + dryRun, + force, + track + }); + } catch (err) { + err.caller = "git.checkout"; + throw err; + } +} +var abbreviateRx = new RegExp("^refs/(heads/|tags/|remotes/)?(.*)"); +function abbreviateRef(ref) { + const match = abbreviateRx.exec(ref); + if (match) { + if (match[1] === "remotes/" && ref.endsWith("/HEAD")) { + return match[2].slice(0, -5); + } else { + return match[2]; + } + } + return ref; +} +async function _currentBranch({ + fs, + gitdir, + fullname = false, + test = false +}) { + const ref = await GitRefManager.resolve({ + fs, + gitdir, + ref: "HEAD", + depth: 2 + }); + if (test) { + try { + await GitRefManager.resolve({ fs, gitdir, ref }); + } catch (_) { + return; + } + } + if (!ref.startsWith("refs/")) + return; + return fullname ? ref : abbreviateRef(ref); +} +function translateSSHtoHTTP(url) { + url = url.replace(/^git@([^:]+):/, "https://$1/"); + url = url.replace(/^ssh:\/\//, "https://"); + return url; +} +function calculateBasicAuthHeader({ username = "", password = "" }) { + return `Basic ${Buffer2.from(`${username}:${password}`).toString("base64")}`; +} +async function forAwait(iterable, cb) { + const iter = getIterator(iterable); + while (true) { + const { value, done } = await iter.next(); + if (value) + await cb(value); + if (done) + break; + } + if (iter.return) + iter.return(); +} +async function collect(iterable) { + let size = 0; + const buffers = []; + await forAwait(iterable, (value) => { + buffers.push(value); + size += value.byteLength; + }); + const result = new Uint8Array(size); + let nextIndex = 0; + for (const buffer2 of buffers) { + result.set(buffer2, nextIndex); + nextIndex += buffer2.byteLength; + } + return result; +} +function extractAuthFromUrl(url) { + let userpass = url.match(/^https?:\/\/([^/]+)@/); + if (userpass == null) + return { url, auth: {} }; + userpass = userpass[1]; + const [username, password] = userpass.split(":"); + url = url.replace(`${userpass}@`, ""); + return { url, auth: { username, password } }; +} +function padHex(b, n) { + const s = n.toString(16); + return "0".repeat(b - s.length) + s; +} +var GitPktLine = class { + static flush() { + return Buffer2.from("0000", "utf8"); + } + static delim() { + return Buffer2.from("0001", "utf8"); + } + static encode(line) { + if (typeof line === "string") { + line = Buffer2.from(line); + } + const length = line.length + 4; + const hexlength = padHex(4, length); + return Buffer2.concat([Buffer2.from(hexlength, "utf8"), line]); + } + static streamReader(stream) { + const reader = new StreamReader(stream); + return async function read() { + try { + let length = await reader.read(4); + if (length == null) + return true; + length = parseInt(length.toString("utf8"), 16); + if (length === 0) + return null; + if (length === 1) + return null; + const buffer2 = await reader.read(length - 4); + if (buffer2 == null) + return true; + return buffer2; + } catch (err) { + console.log("error", err); + return true; + } + }; + } +}; +async function parseCapabilitiesV2(read) { + const capabilities2 = {}; + let line; + while (true) { + line = await read(); + if (line === true) + break; + if (line === null) + continue; + line = line.toString("utf8").replace(/\n$/, ""); + const i = line.indexOf("="); + if (i > -1) { + const key2 = line.slice(0, i); + const value = line.slice(i + 1); + capabilities2[key2] = value; + } else { + capabilities2[line] = true; + } + } + return { protocolVersion: 2, capabilities2 }; +} +async function parseRefsAdResponse(stream, { service }) { + const capabilities = new Set(); + const refs = new Map(); + const symrefs = new Map(); + const read = GitPktLine.streamReader(stream); + let lineOne = await read(); + while (lineOne === null) + lineOne = await read(); + if (lineOne === true) + throw new EmptyServerResponseError(); + if (lineOne.includes("version 2")) { + return parseCapabilitiesV2(read); + } + if (lineOne.toString("utf8").replace(/\n$/, "") !== `# service=${service}`) { + throw new ParseError(`# service=${service}\\n`, lineOne.toString("utf8")); + } + let lineTwo = await read(); + while (lineTwo === null) + lineTwo = await read(); + if (lineTwo === true) + return { capabilities, refs, symrefs }; + lineTwo = lineTwo.toString("utf8"); + if (lineTwo.includes("version 2")) { + return parseCapabilitiesV2(read); + } + const [firstRef, capabilitiesLine] = splitAndAssert(lineTwo, "\0", "\\x00"); + capabilitiesLine.split(" ").map((x) => capabilities.add(x)); + const [ref, name] = splitAndAssert(firstRef, " ", " "); + refs.set(name, ref); + while (true) { + const line = await read(); + if (line === true) + break; + if (line !== null) { + const [ref2, name2] = splitAndAssert(line.toString("utf8"), " ", " "); + refs.set(name2, ref2); + } + } + for (const cap of capabilities) { + if (cap.startsWith("symref=")) { + const m = cap.match(/symref=([^:]+):(.*)/); + if (m.length === 3) { + symrefs.set(m[1], m[2]); + } + } + } + return { protocolVersion: 1, capabilities, refs, symrefs }; +} +function splitAndAssert(line, sep2, expected) { + const split = line.trim().split(sep2); + if (split.length !== 2) { + throw new ParseError(`Two strings separated by '${expected}'`, line.toString("utf8")); + } + return split; +} +var corsProxify = (corsProxy, url) => corsProxy.endsWith("?") ? `${corsProxy}${url}` : `${corsProxy}/${url.replace(/^https?:\/\//, "")}`; +var updateHeaders = (headers, auth) => { + if (auth.username || auth.password) { + headers.Authorization = calculateBasicAuthHeader(auth); + } + if (auth.headers) { + Object.assign(headers, auth.headers); + } +}; +var stringifyBody = async (res) => { + try { + const data = Buffer2.from(await collect(res.body)); + const response = data.toString("utf8"); + const preview = response.length < 256 ? response : response.slice(0, 256) + "..."; + return { preview, response, data }; + } catch (e) { + return {}; + } +}; +var GitRemoteHTTP = class { + static async capabilities() { + return ["discover", "connect"]; + } + static async discover({ + http, + onProgress, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + service, + url: _origUrl, + headers, + protocolVersion + }) { + let { url, auth } = extractAuthFromUrl(_origUrl); + const proxifiedURL = corsProxy ? corsProxify(corsProxy, url) : url; + if (auth.username || auth.password) { + headers.Authorization = calculateBasicAuthHeader(auth); + } + if (protocolVersion === 2) { + headers["Git-Protocol"] = "version=2"; + } + let res; + let tryAgain; + let providedAuthBefore = false; + do { + res = await http.request({ + onProgress, + method: "GET", + url: `${proxifiedURL}/info/refs?service=${service}`, + headers + }); + tryAgain = false; + if (res.statusCode === 401 || res.statusCode === 203) { + const getAuth = providedAuthBefore ? onAuthFailure : onAuth; + if (getAuth) { + auth = await getAuth(url, { + ...auth, + headers: { ...headers } + }); + if (auth && auth.cancel) { + throw new UserCanceledError(); + } else if (auth) { + updateHeaders(headers, auth); + providedAuthBefore = true; + tryAgain = true; + } + } + } else if (res.statusCode === 200 && providedAuthBefore && onAuthSuccess) { + await onAuthSuccess(url, auth); + } + } while (tryAgain); + if (res.statusCode !== 200) { + const { response } = await stringifyBody(res); + throw new HttpError(res.statusCode, res.statusMessage, response); + } + if (res.headers["content-type"] === `application/x-${service}-advertisement`) { + const remoteHTTP = await parseRefsAdResponse(res.body, { service }); + remoteHTTP.auth = auth; + return remoteHTTP; + } else { + const { preview, response, data } = await stringifyBody(res); + try { + const remoteHTTP = await parseRefsAdResponse([data], { service }); + remoteHTTP.auth = auth; + return remoteHTTP; + } catch (e) { + throw new SmartHttpError(preview, response); + } + } + } + static async connect({ + http, + onProgress, + corsProxy, + service, + url, + auth, + body, + headers + }) { + const urlAuth = extractAuthFromUrl(url); + if (urlAuth) + url = urlAuth.url; + if (corsProxy) + url = corsProxify(corsProxy, url); + headers["content-type"] = `application/x-${service}-request`; + headers.accept = `application/x-${service}-result`; + updateHeaders(headers, auth); + const res = await http.request({ + onProgress, + method: "POST", + url: `${url}/${service}`, + body, + headers + }); + if (res.statusCode !== 200) { + const { response } = stringifyBody(res); + throw new HttpError(res.statusCode, res.statusMessage, response); + } + return res; + } +}; +function parseRemoteUrl({ url }) { + if (url.startsWith("git@")) { + return { + transport: "ssh", + address: url + }; + } + const matches = url.match(/(\w+)(:\/\/|::)(.*)/); + if (matches === null) + return; + if (matches[2] === "://") { + return { + transport: matches[1], + address: matches[0] + }; + } + if (matches[2] === "::") { + return { + transport: matches[1], + address: matches[3] + }; + } +} +var GitRemoteManager = class { + static getRemoteHelperFor({ url }) { + const remoteHelpers = new Map(); + remoteHelpers.set("http", GitRemoteHTTP); + remoteHelpers.set("https", GitRemoteHTTP); + const parts = parseRemoteUrl({ url }); + if (!parts) { + throw new UrlParseError(url); + } + if (remoteHelpers.has(parts.transport)) { + return remoteHelpers.get(parts.transport); + } + throw new UnknownTransportError(url, parts.transport, parts.transport === "ssh" ? translateSSHtoHTTP(url) : void 0); + } +}; +var lock$1 = null; +var GitShallowManager = class { + static async read({ fs, gitdir }) { + if (lock$1 === null) + lock$1 = new import_async_lock.default(); + const filepath = join(gitdir, "shallow"); + const oids = new Set(); + await lock$1.acquire(filepath, async function() { + const text2 = await fs.read(filepath, { encoding: "utf8" }); + if (text2 === null) + return oids; + if (text2.trim() === "") + return oids; + text2.trim().split("\n").map((oid) => oids.add(oid)); + }); + return oids; + } + static async write({ fs, gitdir, oids }) { + if (lock$1 === null) + lock$1 = new import_async_lock.default(); + const filepath = join(gitdir, "shallow"); + if (oids.size > 0) { + const text2 = [...oids].join("\n") + "\n"; + await lock$1.acquire(filepath, async function() { + await fs.write(filepath, text2, { + encoding: "utf8" + }); + }); + } else { + await lock$1.acquire(filepath, async function() { + await fs.rm(filepath); + }); + } + } +}; +async function hasObjectLoose({ fs, gitdir, oid }) { + const source = `objects/${oid.slice(0, 2)}/${oid.slice(2)}`; + return fs.exists(`${gitdir}/${source}`); +} +async function hasObjectPacked({ + fs, + cache, + gitdir, + oid, + getExternalRefDelta +}) { + let list = await fs.readdir(join(gitdir, "objects/pack")); + list = list.filter((x) => x.endsWith(".idx")); + for (const filename of list) { + const indexFile = `${gitdir}/objects/pack/${filename}`; + const p = await readPackIndex({ + fs, + cache, + filename: indexFile, + getExternalRefDelta + }); + if (p.error) + throw new InternalError(p.error); + if (p.offsets.has(oid)) { + return true; + } + } + return false; +} +async function hasObject({ + fs, + cache, + gitdir, + oid, + format = "content" +}) { + const getExternalRefDelta = (oid2) => _readObject({ fs, cache, gitdir, oid: oid2 }); + let result = await hasObjectLoose({ fs, gitdir, oid }); + if (!result) { + result = await hasObjectPacked({ + fs, + cache, + gitdir, + oid, + getExternalRefDelta + }); + } + return result; +} +function emptyPackfile(pack) { + const pheader = "5041434b"; + const version2 = "00000002"; + const obCount = "00000000"; + const header = pheader + version2 + obCount; + return pack.slice(0, 12).toString("hex") === header; +} +function filterCapabilities(server, client) { + const serverNames = server.map((cap) => cap.split("=", 1)[0]); + return client.filter((cap) => { + const name = cap.split("=", 1)[0]; + return serverNames.includes(name); + }); +} +var pkg = { + name: "isomorphic-git", + version: "1.21.0", + agent: "git/isomorphic-git@1.21.0" +}; +var FIFO = class { + constructor() { + this._queue = []; + } + write(chunk) { + if (this._ended) { + throw Error("You cannot write to a FIFO that has already been ended!"); + } + if (this._waiting) { + const resolve = this._waiting; + this._waiting = null; + resolve({ value: chunk }); + } else { + this._queue.push(chunk); + } + } + end() { + this._ended = true; + if (this._waiting) { + const resolve = this._waiting; + this._waiting = null; + resolve({ done: true }); + } + } + destroy(err) { + this._ended = true; + this.error = err; + } + async next() { + if (this._queue.length > 0) { + return { value: this._queue.shift() }; + } + if (this._ended) { + return { done: true }; + } + if (this._waiting) { + throw Error("You cannot call read until the previous call to read has returned!"); + } + return new Promise((resolve) => { + this._waiting = resolve; + }); + } +}; +function findSplit(str) { + const r = str.indexOf("\r"); + const n = str.indexOf("\n"); + if (r === -1 && n === -1) + return -1; + if (r === -1) + return n + 1; + if (n === -1) + return r + 1; + if (n === r + 1) + return n + 1; + return Math.min(r, n) + 1; +} +function splitLines(input) { + const output = new FIFO(); + let tmp = ""; + (async () => { + await forAwait(input, (chunk) => { + chunk = chunk.toString("utf8"); + tmp += chunk; + while (true) { + const i = findSplit(tmp); + if (i === -1) + break; + output.write(tmp.slice(0, i)); + tmp = tmp.slice(i); + } + }); + if (tmp.length > 0) { + output.write(tmp); + } + output.end(); + })(); + return output; +} +var GitSideBand = class { + static demux(input) { + const read = GitPktLine.streamReader(input); + const packetlines = new FIFO(); + const packfile = new FIFO(); + const progress = new FIFO(); + const nextBit = async function() { + const line = await read(); + if (line === null) + return nextBit(); + if (line === true) { + packetlines.end(); + progress.end(); + packfile.end(); + return; + } + switch (line[0]) { + case 1: { + packfile.write(line.slice(1)); + break; + } + case 2: { + progress.write(line.slice(1)); + break; + } + case 3: { + const error = line.slice(1); + progress.write(error); + packfile.destroy(new Error(error.toString("utf8"))); + return; + } + default: { + packetlines.write(line.slice(0)); + } + } + nextBit(); + }; + nextBit(); + return { + packetlines, + packfile, + progress + }; + } +}; +async function parseUploadPackResponse(stream) { + const { packetlines, packfile, progress } = GitSideBand.demux(stream); + const shallows = []; + const unshallows = []; + const acks = []; + let nak = false; + let done = false; + return new Promise((resolve, reject) => { + forAwait(packetlines, (data) => { + const line = data.toString("utf8").trim(); + if (line.startsWith("shallow")) { + const oid = line.slice(-41).trim(); + if (oid.length !== 40) { + reject(new InvalidOidError(oid)); + } + shallows.push(oid); + } else if (line.startsWith("unshallow")) { + const oid = line.slice(-41).trim(); + if (oid.length !== 40) { + reject(new InvalidOidError(oid)); + } + unshallows.push(oid); + } else if (line.startsWith("ACK")) { + const [, oid, status2] = line.split(" "); + acks.push({ oid, status: status2 }); + if (!status2) + done = true; + } else if (line.startsWith("NAK")) { + nak = true; + done = true; + } + if (done) { + resolve({ shallows, unshallows, acks, nak, packfile, progress }); + } + }); + }); +} +function writeUploadPackRequest({ + capabilities = [], + wants = [], + haves = [], + shallows = [], + depth = null, + since = null, + exclude = [] +}) { + const packstream = []; + wants = [...new Set(wants)]; + let firstLineCapabilities = ` ${capabilities.join(" ")}`; + for (const oid of wants) { + packstream.push(GitPktLine.encode(`want ${oid}${firstLineCapabilities} +`)); + firstLineCapabilities = ""; + } + for (const oid of shallows) { + packstream.push(GitPktLine.encode(`shallow ${oid} +`)); + } + if (depth !== null) { + packstream.push(GitPktLine.encode(`deepen ${depth} +`)); + } + if (since !== null) { + packstream.push(GitPktLine.encode(`deepen-since ${Math.floor(since.valueOf() / 1e3)} +`)); + } + for (const oid of exclude) { + packstream.push(GitPktLine.encode(`deepen-not ${oid} +`)); + } + packstream.push(GitPktLine.flush()); + for (const oid of haves) { + packstream.push(GitPktLine.encode(`have ${oid} +`)); + } + packstream.push(GitPktLine.encode(`done +`)); + return packstream; +} +async function _fetch({ + fs, + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + gitdir, + ref: _ref, + remoteRef: _remoteRef, + remote: _remote, + url: _url, + corsProxy, + depth = null, + since = null, + exclude = [], + relative = false, + tags = false, + singleBranch = false, + headers = {}, + prune = false, + pruneTags = false +}) { + const ref = _ref || await _currentBranch({ fs, gitdir, test: true }); + const config = await GitConfigManager.get({ fs, gitdir }); + const remote = _remote || ref && await config.get(`branch.${ref}.remote`) || "origin"; + const url = _url || await config.get(`remote.${remote}.url`); + if (typeof url === "undefined") { + throw new MissingParameterError("remote OR url"); + } + const remoteRef = _remoteRef || ref && await config.get(`branch.${ref}.merge`) || _ref || "HEAD"; + if (corsProxy === void 0) { + corsProxy = await config.get("http.corsProxy"); + } + const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); + const remoteHTTP = await GitRemoteHTTP2.discover({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + service: "git-upload-pack", + url, + headers, + protocolVersion: 1 + }); + const auth = remoteHTTP.auth; + const remoteRefs = remoteHTTP.refs; + if (remoteRefs.size === 0) { + return { + defaultBranch: null, + fetchHead: null, + fetchHeadDescription: null + }; + } + if (depth !== null && !remoteHTTP.capabilities.has("shallow")) { + throw new RemoteCapabilityError("shallow", "depth"); + } + if (since !== null && !remoteHTTP.capabilities.has("deepen-since")) { + throw new RemoteCapabilityError("deepen-since", "since"); + } + if (exclude.length > 0 && !remoteHTTP.capabilities.has("deepen-not")) { + throw new RemoteCapabilityError("deepen-not", "exclude"); + } + if (relative === true && !remoteHTTP.capabilities.has("deepen-relative")) { + throw new RemoteCapabilityError("deepen-relative", "relative"); + } + const { oid, fullref } = GitRefManager.resolveAgainstMap({ + ref: remoteRef, + map: remoteRefs + }); + for (const remoteRef2 of remoteRefs.keys()) { + if (remoteRef2 === fullref || remoteRef2 === "HEAD" || remoteRef2.startsWith("refs/heads/") || tags && remoteRef2.startsWith("refs/tags/")) { + continue; + } + remoteRefs.delete(remoteRef2); + } + const capabilities = filterCapabilities([...remoteHTTP.capabilities], [ + "multi_ack_detailed", + "no-done", + "side-band-64k", + "ofs-delta", + `agent=${pkg.agent}` + ]); + if (relative) + capabilities.push("deepen-relative"); + const wants = singleBranch ? [oid] : remoteRefs.values(); + const haveRefs = singleBranch ? [ref] : await GitRefManager.listRefs({ + fs, + gitdir, + filepath: `refs` + }); + let haves = []; + for (let ref2 of haveRefs) { + try { + ref2 = await GitRefManager.expand({ fs, gitdir, ref: ref2 }); + const oid2 = await GitRefManager.resolve({ fs, gitdir, ref: ref2 }); + if (await hasObject({ fs, cache, gitdir, oid: oid2 })) { + haves.push(oid2); + } + } catch (err) { + } + } + haves = [...new Set(haves)]; + const oids = await GitShallowManager.read({ fs, gitdir }); + const shallows = remoteHTTP.capabilities.has("shallow") ? [...oids] : []; + const packstream = writeUploadPackRequest({ + capabilities, + wants, + haves, + shallows, + depth, + since, + exclude + }); + const packbuffer = Buffer2.from(await collect(packstream)); + const raw = await GitRemoteHTTP2.connect({ + http, + onProgress, + corsProxy, + service: "git-upload-pack", + url, + auth, + body: [packbuffer], + headers + }); + const response = await parseUploadPackResponse(raw.body); + if (raw.headers) { + response.headers = raw.headers; + } + for (const oid2 of response.shallows) { + if (!oids.has(oid2)) { + try { + const { object } = await _readObject({ fs, cache, gitdir, oid: oid2 }); + const commit2 = new GitCommit(object); + const hasParents = await Promise.all(commit2.headers().parent.map((oid3) => hasObject({ fs, cache, gitdir, oid: oid3 }))); + const haveAllParents = hasParents.length === 0 || hasParents.every((has) => has); + if (!haveAllParents) { + oids.add(oid2); + } + } catch (err) { + oids.add(oid2); + } + } + } + for (const oid2 of response.unshallows) { + oids.delete(oid2); + } + await GitShallowManager.write({ fs, gitdir, oids }); + if (singleBranch) { + const refs = new Map([[fullref, oid]]); + const symrefs = new Map(); + let bail = 10; + let key2 = fullref; + while (bail--) { + const value = remoteHTTP.symrefs.get(key2); + if (value === void 0) + break; + symrefs.set(key2, value); + key2 = value; + } + const realRef = remoteRefs.get(key2); + if (realRef) { + refs.set(key2, realRef); + } + const { pruned } = await GitRefManager.updateRemoteRefs({ + fs, + gitdir, + remote, + refs, + symrefs, + tags, + prune + }); + if (prune) { + response.pruned = pruned; + } + } else { + const { pruned } = await GitRefManager.updateRemoteRefs({ + fs, + gitdir, + remote, + refs: remoteRefs, + symrefs: remoteHTTP.symrefs, + tags, + prune, + pruneTags + }); + if (prune) { + response.pruned = pruned; + } + } + response.HEAD = remoteHTTP.symrefs.get("HEAD"); + if (response.HEAD === void 0) { + const { oid: oid2 } = GitRefManager.resolveAgainstMap({ + ref: "HEAD", + map: remoteRefs + }); + for (const [key2, value] of remoteRefs.entries()) { + if (key2 !== "HEAD" && value === oid2) { + response.HEAD = key2; + break; + } + } + } + const noun = fullref.startsWith("refs/tags") ? "tag" : "branch"; + response.FETCH_HEAD = { + oid, + description: `${noun} '${abbreviateRef(fullref)}' of ${url}` + }; + if (onProgress || onMessage) { + const lines = splitLines(response.progress); + forAwait(lines, async (line) => { + if (onMessage) + await onMessage(line); + if (onProgress) { + const matches = line.match(/([^:]*).*\((\d+?)\/(\d+?)\)/); + if (matches) { + await onProgress({ + phase: matches[1].trim(), + loaded: parseInt(matches[2], 10), + total: parseInt(matches[3], 10) + }); + } + } + }); + } + const packfile = Buffer2.from(await collect(response.packfile)); + const packfileSha = packfile.slice(-20).toString("hex"); + const res = { + defaultBranch: response.HEAD, + fetchHead: response.FETCH_HEAD.oid, + fetchHeadDescription: response.FETCH_HEAD.description + }; + if (response.headers) { + res.headers = response.headers; + } + if (prune) { + res.pruned = response.pruned; + } + if (packfileSha !== "" && !emptyPackfile(packfile)) { + res.packfile = `objects/pack/pack-${packfileSha}.pack`; + const fullpath = join(gitdir, res.packfile); + await fs.write(fullpath, packfile); + const getExternalRefDelta = (oid2) => _readObject({ fs, cache, gitdir, oid: oid2 }); + const idx = await GitPackIndex.fromPack({ + pack: packfile, + getExternalRefDelta, + onProgress + }); + await fs.write(fullpath.replace(/\.pack$/, ".idx"), await idx.toBuffer()); + } + return res; +} +async function _init({ + fs, + bare = false, + dir, + gitdir = bare ? dir : join(dir, ".git"), + defaultBranch = "master" +}) { + if (await fs.exists(gitdir + "/config")) + return; + let folders = [ + "hooks", + "info", + "objects/info", + "objects/pack", + "refs/heads", + "refs/tags" + ]; + folders = folders.map((dir2) => gitdir + "/" + dir2); + for (const folder of folders) { + await fs.mkdir(folder); + } + await fs.write(gitdir + "/config", `[core] + repositoryformatversion = 0 + filemode = false + bare = ${bare} +` + (bare ? "" : " logallrefupdates = true\n") + " symlinks = false\n ignorecase = true\n"); + await fs.write(gitdir + "/HEAD", `ref: refs/heads/${defaultBranch} +`); +} +async function _clone({ + fs, + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir, + url, + corsProxy, + ref, + remote, + depth, + since, + exclude, + relative, + singleBranch, + noCheckout, + noTags, + headers +}) { + try { + await _init({ fs, gitdir }); + await _addRemote({ fs, gitdir, remote, url, force: false }); + if (corsProxy) { + const config = await GitConfigManager.get({ fs, gitdir }); + await config.set(`http.corsProxy`, corsProxy); + await GitConfigManager.save({ fs, gitdir, config }); + } + const { defaultBranch, fetchHead } = await _fetch({ + fs, + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + gitdir, + ref, + remote, + corsProxy, + depth, + since, + exclude, + relative, + singleBranch, + headers, + tags: !noTags + }); + if (fetchHead === null) + return; + ref = ref || defaultBranch; + ref = ref.replace("refs/heads/", ""); + await _checkout({ + fs, + cache, + onProgress, + dir, + gitdir, + ref, + remote, + noCheckout + }); + } catch (err) { + await fs.rmdir(gitdir, { recursive: true, maxRetries: 10 }).catch(() => void 0); + throw err; + } +} +async function clone({ + fs, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir = join(dir, ".git"), + url, + corsProxy = void 0, + ref = void 0, + remote = "origin", + depth = void 0, + since = void 0, + exclude = [], + relative = false, + singleBranch = false, + noCheckout = false, + noTags = false, + headers = {}, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("http", http); + assertParameter("gitdir", gitdir); + if (!noCheckout) { + assertParameter("dir", dir); + } + assertParameter("url", url); + return await _clone({ + fs: new FileSystem(fs), + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir, + url, + corsProxy, + ref, + remote, + depth, + since, + exclude, + relative, + singleBranch, + noCheckout, + noTags, + headers + }); + } catch (err) { + err.caller = "git.clone"; + throw err; + } +} +async function commit({ + fs: _fs, + onSign, + dir, + gitdir = join(dir, ".git"), + message, + author: _author, + committer: _committer, + signingKey, + dryRun = false, + noUpdateBranch = false, + ref, + parent, + tree, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("message", message); + if (signingKey) { + assertParameter("onSign", onSign); + } + const fs = new FileSystem(_fs); + const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); + if (!author) + throw new MissingNameError("author"); + const committer = await normalizeCommitterObject({ + fs, + gitdir, + author, + committer: _committer + }); + if (!committer) + throw new MissingNameError("committer"); + return await _commit({ + fs, + cache, + onSign, + gitdir, + message, + author, + committer, + signingKey, + dryRun, + noUpdateBranch, + ref, + parent, + tree + }); + } catch (err) { + err.caller = "git.commit"; + throw err; + } +} +async function currentBranch({ + fs, + dir, + gitdir = join(dir, ".git"), + fullname = false, + test = false +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + return await _currentBranch({ + fs: new FileSystem(fs), + gitdir, + fullname, + test + }); + } catch (err) { + err.caller = "git.currentBranch"; + throw err; + } +} +async function _deleteBranch({ fs, gitdir, ref }) { + const exist = await GitRefManager.exists({ fs, gitdir, ref }); + if (!exist) { + throw new NotFoundError(ref); + } + const fullRef = await GitRefManager.expand({ fs, gitdir, ref }); + const currentRef = await _currentBranch({ fs, gitdir, fullname: true }); + if (fullRef === currentRef) { + const value = await GitRefManager.resolve({ fs, gitdir, ref: fullRef }); + await GitRefManager.writeRef({ fs, gitdir, ref: "HEAD", value }); + } + await GitRefManager.deleteRef({ fs, gitdir, ref: fullRef }); +} +async function deleteBranch({ + fs, + dir, + gitdir = join(dir, ".git"), + ref +}) { + try { + assertParameter("fs", fs); + assertParameter("ref", ref); + return await _deleteBranch({ + fs: new FileSystem(fs), + gitdir, + ref + }); + } catch (err) { + err.caller = "git.deleteBranch"; + throw err; + } +} +async function deleteRef({ fs, dir, gitdir = join(dir, ".git"), ref }) { + try { + assertParameter("fs", fs); + assertParameter("ref", ref); + await GitRefManager.deleteRef({ fs: new FileSystem(fs), gitdir, ref }); + } catch (err) { + err.caller = "git.deleteRef"; + throw err; + } +} +async function _deleteRemote({ fs, gitdir, remote }) { + const config = await GitConfigManager.get({ fs, gitdir }); + await config.deleteSection("remote", remote); + await GitConfigManager.save({ fs, gitdir, config }); +} +async function deleteRemote({ + fs, + dir, + gitdir = join(dir, ".git"), + remote +}) { + try { + assertParameter("fs", fs); + assertParameter("remote", remote); + return await _deleteRemote({ + fs: new FileSystem(fs), + gitdir, + remote + }); + } catch (err) { + err.caller = "git.deleteRemote"; + throw err; + } +} +async function _deleteTag({ fs, gitdir, ref }) { + ref = ref.startsWith("refs/tags/") ? ref : `refs/tags/${ref}`; + await GitRefManager.deleteRef({ fs, gitdir, ref }); +} +async function deleteTag({ fs, dir, gitdir = join(dir, ".git"), ref }) { + try { + assertParameter("fs", fs); + assertParameter("ref", ref); + return await _deleteTag({ + fs: new FileSystem(fs), + gitdir, + ref + }); + } catch (err) { + err.caller = "git.deleteTag"; + throw err; + } +} +async function expandOidLoose({ fs, gitdir, oid: short }) { + const prefix = short.slice(0, 2); + const objectsSuffixes = await fs.readdir(`${gitdir}/objects/${prefix}`); + return objectsSuffixes.map((suffix) => `${prefix}${suffix}`).filter((_oid) => _oid.startsWith(short)); +} +async function expandOidPacked({ + fs, + cache, + gitdir, + oid: short, + getExternalRefDelta +}) { + const results = []; + let list = await fs.readdir(join(gitdir, "objects/pack")); + list = list.filter((x) => x.endsWith(".idx")); + for (const filename of list) { + const indexFile = `${gitdir}/objects/pack/${filename}`; + const p = await readPackIndex({ + fs, + cache, + filename: indexFile, + getExternalRefDelta + }); + if (p.error) + throw new InternalError(p.error); + for (const oid of p.offsets.keys()) { + if (oid.startsWith(short)) + results.push(oid); + } + } + return results; +} +async function _expandOid({ fs, cache, gitdir, oid: short }) { + const getExternalRefDelta = (oid) => _readObject({ fs, cache, gitdir, oid }); + const results1 = await expandOidLoose({ fs, gitdir, oid: short }); + const results2 = await expandOidPacked({ + fs, + cache, + gitdir, + oid: short, + getExternalRefDelta + }); + const results = results1.concat(results2); + if (results.length === 1) { + return results[0]; + } + if (results.length > 1) { + throw new AmbiguousError("oids", short, results); + } + throw new NotFoundError(`an object matching "${short}"`); +} +async function expandOid({ + fs, + dir, + gitdir = join(dir, ".git"), + oid, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + return await _expandOid({ + fs: new FileSystem(fs), + cache, + gitdir, + oid + }); + } catch (err) { + err.caller = "git.expandOid"; + throw err; + } +} +async function expandRef({ fs, dir, gitdir = join(dir, ".git"), ref }) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + return await GitRefManager.expand({ + fs: new FileSystem(fs), + gitdir, + ref + }); + } catch (err) { + err.caller = "git.expandRef"; + throw err; + } +} +async function _findMergeBase({ fs, cache, gitdir, oids }) { + const visits = {}; + const passes = oids.length; + let heads = oids.map((oid, index2) => ({ index: index2, oid })); + while (heads.length) { + const result = new Set(); + for (const { oid, index: index2 } of heads) { + if (!visits[oid]) + visits[oid] = new Set(); + visits[oid].add(index2); + if (visits[oid].size === passes) { + result.add(oid); + } + } + if (result.size > 0) { + return [...result]; + } + const newheads = new Map(); + for (const { oid, index: index2 } of heads) { + try { + const { object } = await _readObject({ fs, cache, gitdir, oid }); + const commit2 = GitCommit.from(object); + const { parent } = commit2.parseHeaders(); + for (const oid2 of parent) { + if (!visits[oid2] || !visits[oid2].has(index2)) { + newheads.set(oid2 + ":" + index2, { oid: oid2, index: index2 }); + } + } + } catch (err) { + } + } + heads = Array.from(newheads.values()); + } + return []; +} +var LINEBREAKS = /^.*(\r?\n|$)/gm; +function mergeFile({ branches, contents }) { + const ourName = branches[1]; + const theirName = branches[2]; + const baseContent = contents[0]; + const ourContent = contents[1]; + const theirContent = contents[2]; + const ours = ourContent.match(LINEBREAKS); + const base = baseContent.match(LINEBREAKS); + const theirs = theirContent.match(LINEBREAKS); + const result = (0, import_diff3.default)(ours, base, theirs); + const markerSize = 7; + let mergedText = ""; + let cleanMerge = true; + for (const item of result) { + if (item.ok) { + mergedText += item.ok.join(""); + } + if (item.conflict) { + cleanMerge = false; + mergedText += `${"<".repeat(markerSize)} ${ourName} +`; + mergedText += item.conflict.a.join(""); + mergedText += `${"=".repeat(markerSize)} +`; + mergedText += item.conflict.b.join(""); + mergedText += `${">".repeat(markerSize)} ${theirName} +`; + } + } + return { cleanMerge, mergedText }; +} +async function mergeTree({ + fs, + cache, + dir, + gitdir = join(dir, ".git"), + ourOid, + baseOid, + theirOid, + ourName = "ours", + baseName = "base", + theirName = "theirs", + dryRun = false, + abortOnConflict = true, + mergeDriver +}) { + const ourTree = TREE({ ref: ourOid }); + const baseTree = TREE({ ref: baseOid }); + const theirTree = TREE({ ref: theirOid }); + const unmergedFiles = []; + let cleanMerge = true; + const results = await _walk({ + fs, + cache, + dir, + gitdir, + trees: [ourTree, baseTree, theirTree], + map: async function(filepath, [ours, base, theirs]) { + const path2 = basename(filepath); + const ourChange = await modified(ours, base); + const theirChange = await modified(theirs, base); + switch (`${ourChange}-${theirChange}`) { + case "false-false": { + return { + mode: await base.mode(), + path: path2, + oid: await base.oid(), + type: await base.type() + }; + } + case "false-true": { + return theirs ? { + mode: await theirs.mode(), + path: path2, + oid: await theirs.oid(), + type: await theirs.type() + } : void 0; + } + case "true-false": { + return ours ? { + mode: await ours.mode(), + path: path2, + oid: await ours.oid(), + type: await ours.type() + } : void 0; + } + case "true-true": { + if (ours && base && theirs && await ours.type() === "blob" && await base.type() === "blob" && await theirs.type() === "blob") { + return mergeBlobs({ + fs, + gitdir, + path: path2, + ours, + base, + theirs, + ourName, + baseName, + theirName, + mergeDriver + }).then((r) => { + cleanMerge = cleanMerge && r.cleanMerge; + unmergedFiles.push(filepath); + return r.mergeResult; + }); + } + throw new MergeNotSupportedError(); + } + } + }, + reduce: async (parent, children2) => { + const entries = children2.filter(Boolean); + if (!parent) + return; + if (parent && parent.type === "tree" && entries.length === 0) + return; + if (entries.length > 0) { + const tree = new GitTree(entries); + const object = tree.toObject(); + const oid = await _writeObject({ + fs, + gitdir, + type: "tree", + object, + dryRun + }); + parent.oid = oid; + } + return parent; + } + }); + if (!cleanMerge) { + if (dir && !abortOnConflict) { + await _walk({ + fs, + cache, + dir, + gitdir, + trees: [TREE({ ref: results.oid })], + map: async function(filepath, [entry]) { + const path2 = `${dir}/${filepath}`; + if (await entry.type() === "blob") { + const mode = await entry.mode(); + const content = new TextDecoder().decode(await entry.content()); + await fs.write(path2, content, { mode }); + } + return true; + } + }); + } + throw new MergeConflictError(unmergedFiles); + } + return results.oid; +} +async function modified(entry, base) { + if (!entry && !base) + return false; + if (entry && !base) + return true; + if (!entry && base) + return true; + if (await entry.type() === "tree" && await base.type() === "tree") { + return false; + } + if (await entry.type() === await base.type() && await entry.mode() === await base.mode() && await entry.oid() === await base.oid()) { + return false; + } + return true; +} +async function mergeBlobs({ + fs, + gitdir, + path: path2, + ours, + base, + theirs, + ourName, + theirName, + baseName, + dryRun, + mergeDriver = mergeFile +}) { + const type = "blob"; + const mode = await base.mode() === await ours.mode() ? await theirs.mode() : await ours.mode(); + if (await ours.oid() === await theirs.oid()) { + return { + cleanMerge: true, + mergeResult: { mode, path: path2, oid: await ours.oid(), type } + }; + } + if (await ours.oid() === await base.oid()) { + return { + cleanMerge: true, + mergeResult: { mode, path: path2, oid: await theirs.oid(), type } + }; + } + if (await theirs.oid() === await base.oid()) { + return { + cleanMerge: true, + mergeResult: { mode, path: path2, oid: await ours.oid(), type } + }; + } + const ourContent = Buffer2.from(await ours.content()).toString("utf8"); + const baseContent = Buffer2.from(await base.content()).toString("utf8"); + const theirContent = Buffer2.from(await theirs.content()).toString("utf8"); + const { mergedText, cleanMerge } = await mergeDriver({ + branches: [baseName, ourName, theirName], + contents: [baseContent, ourContent, theirContent], + path: path2 + }); + const oid = await _writeObject({ + fs, + gitdir, + type: "blob", + object: Buffer2.from(mergedText, "utf8"), + dryRun + }); + return { cleanMerge, mergeResult: { mode, path: path2, oid, type } }; +} +async function _merge({ + fs, + cache, + dir, + gitdir, + ours, + theirs, + fastForward: fastForward2 = true, + fastForwardOnly = false, + dryRun = false, + noUpdateBranch = false, + abortOnConflict = true, + message, + author, + committer, + signingKey, + onSign, + mergeDriver +}) { + if (ours === void 0) { + ours = await _currentBranch({ fs, gitdir, fullname: true }); + } + ours = await GitRefManager.expand({ + fs, + gitdir, + ref: ours + }); + theirs = await GitRefManager.expand({ + fs, + gitdir, + ref: theirs + }); + const ourOid = await GitRefManager.resolve({ + fs, + gitdir, + ref: ours + }); + const theirOid = await GitRefManager.resolve({ + fs, + gitdir, + ref: theirs + }); + const baseOids = await _findMergeBase({ + fs, + cache, + gitdir, + oids: [ourOid, theirOid] + }); + if (baseOids.length !== 1) { + throw new MergeNotSupportedError(); + } + const baseOid = baseOids[0]; + if (baseOid === theirOid) { + return { + oid: ourOid, + alreadyMerged: true + }; + } + if (fastForward2 && baseOid === ourOid) { + if (!dryRun && !noUpdateBranch) { + await GitRefManager.writeRef({ fs, gitdir, ref: ours, value: theirOid }); + } + return { + oid: theirOid, + fastForward: true + }; + } else { + if (fastForwardOnly) { + throw new FastForwardError(); + } + const tree = await mergeTree({ + fs, + cache, + dir, + gitdir, + ourOid, + theirOid, + baseOid, + ourName: abbreviateRef(ours), + baseName: "base", + theirName: abbreviateRef(theirs), + dryRun, + abortOnConflict, + mergeDriver + }); + if (!message) { + message = `Merge branch '${abbreviateRef(theirs)}' into ${abbreviateRef(ours)}`; + } + const oid = await _commit({ + fs, + cache, + gitdir, + message, + ref: ours, + tree, + parent: [ourOid, theirOid], + author, + committer, + signingKey, + onSign, + dryRun, + noUpdateBranch + }); + return { + oid, + tree, + mergeCommit: true + }; + } +} +async function _pull({ + fs, + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir, + ref, + url, + remote, + remoteRef, + prune, + pruneTags, + fastForward: fastForward2, + fastForwardOnly, + corsProxy, + singleBranch, + headers, + author, + committer, + signingKey +}) { + try { + if (!ref) { + const head = await _currentBranch({ fs, gitdir }); + if (!head) { + throw new MissingParameterError("ref"); + } + ref = head; + } + const { fetchHead, fetchHeadDescription } = await _fetch({ + fs, + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + gitdir, + corsProxy, + ref, + url, + remote, + remoteRef, + singleBranch, + headers, + prune, + pruneTags + }); + await _merge({ + fs, + cache, + gitdir, + ours: ref, + theirs: fetchHead, + fastForward: fastForward2, + fastForwardOnly, + message: `Merge ${fetchHeadDescription}`, + author, + committer, + signingKey, + dryRun: false, + noUpdateBranch: false + }); + await _checkout({ + fs, + cache, + onProgress, + dir, + gitdir, + ref, + remote, + noCheckout: false + }); + } catch (err) { + err.caller = "git.pull"; + throw err; + } +} +async function fastForward({ + fs, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir = join(dir, ".git"), + ref, + url, + remote, + remoteRef, + corsProxy, + singleBranch, + headers = {}, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("http", http); + assertParameter("gitdir", gitdir); + const thisWillNotBeUsed = { + name: "", + email: "", + timestamp: Date.now(), + timezoneOffset: 0 + }; + return await _pull({ + fs: new FileSystem(fs), + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir, + ref, + url, + remote, + remoteRef, + fastForwardOnly: true, + corsProxy, + singleBranch, + headers, + author: thisWillNotBeUsed, + committer: thisWillNotBeUsed + }); + } catch (err) { + err.caller = "git.fastForward"; + throw err; + } +} +async function fetch({ + fs, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir = join(dir, ".git"), + ref, + remote, + remoteRef, + url, + corsProxy, + depth = null, + since = null, + exclude = [], + relative = false, + tags = false, + singleBranch = false, + headers = {}, + prune = false, + pruneTags = false, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("http", http); + assertParameter("gitdir", gitdir); + return await _fetch({ + fs: new FileSystem(fs), + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + gitdir, + ref, + remote, + remoteRef, + url, + corsProxy, + depth, + since, + exclude, + relative, + tags, + singleBranch, + headers, + prune, + pruneTags + }); + } catch (err) { + err.caller = "git.fetch"; + throw err; + } +} +async function findMergeBase({ + fs, + dir, + gitdir = join(dir, ".git"), + oids, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oids", oids); + return await _findMergeBase({ + fs: new FileSystem(fs), + cache, + gitdir, + oids + }); + } catch (err) { + err.caller = "git.findMergeBase"; + throw err; + } +} +async function _findRoot({ fs, filepath }) { + if (await fs.exists(join(filepath, ".git"))) { + return filepath; + } else { + const parent = dirname(filepath); + if (parent === filepath) { + throw new NotFoundError(`git root for ${filepath}`); + } + return _findRoot({ fs, filepath: parent }); + } +} +async function findRoot({ fs, filepath }) { + try { + assertParameter("fs", fs); + assertParameter("filepath", filepath); + return await _findRoot({ fs: new FileSystem(fs), filepath }); + } catch (err) { + err.caller = "git.findRoot"; + throw err; + } +} +async function getConfig({ fs, dir, gitdir = join(dir, ".git"), path: path2 }) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("path", path2); + return await _getConfig({ + fs: new FileSystem(fs), + gitdir, + path: path2 + }); + } catch (err) { + err.caller = "git.getConfig"; + throw err; + } +} +async function _getConfigAll({ fs, gitdir, path: path2 }) { + const config = await GitConfigManager.get({ fs, gitdir }); + return config.getall(path2); +} +async function getConfigAll({ + fs, + dir, + gitdir = join(dir, ".git"), + path: path2 +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("path", path2); + return await _getConfigAll({ + fs: new FileSystem(fs), + gitdir, + path: path2 + }); + } catch (err) { + err.caller = "git.getConfigAll"; + throw err; + } +} +async function getRemoteInfo({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + url, + headers = {}, + forPush = false +}) { + try { + assertParameter("http", http); + assertParameter("url", url); + const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); + const remote = await GitRemoteHTTP2.discover({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + service: forPush ? "git-receive-pack" : "git-upload-pack", + url, + headers, + protocolVersion: 1 + }); + const result = { + capabilities: [...remote.capabilities] + }; + for (const [ref, oid] of remote.refs) { + const parts = ref.split("/"); + const last2 = parts.pop(); + let o = result; + for (const part of parts) { + o[part] = o[part] || {}; + o = o[part]; + } + o[last2] = oid; + } + for (const [symref, ref] of remote.symrefs) { + const parts = symref.split("/"); + const last2 = parts.pop(); + let o = result; + for (const part of parts) { + o[part] = o[part] || {}; + o = o[part]; + } + o[last2] = ref; + } + return result; + } catch (err) { + err.caller = "git.getRemoteInfo"; + throw err; + } +} +function formatInfoRefs(remote, prefix, symrefs, peelTags) { + const refs = []; + for (const [key2, value] of remote.refs) { + if (prefix && !key2.startsWith(prefix)) + continue; + if (key2.endsWith("^{}")) { + if (peelTags) { + const _key = key2.replace("^{}", ""); + const last2 = refs[refs.length - 1]; + const r = last2.ref === _key ? last2 : refs.find((x) => x.ref === _key); + if (r === void 0) { + throw new Error("I did not expect this to happen"); + } + r.peeled = value; + } + continue; + } + const ref = { ref: key2, oid: value }; + if (symrefs) { + if (remote.symrefs.has(key2)) { + ref.target = remote.symrefs.get(key2); + } + } + refs.push(ref); + } + return refs; +} +async function getRemoteInfo2({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + url, + headers = {}, + forPush = false, + protocolVersion = 2 +}) { + try { + assertParameter("http", http); + assertParameter("url", url); + const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); + const remote = await GitRemoteHTTP2.discover({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + service: forPush ? "git-receive-pack" : "git-upload-pack", + url, + headers, + protocolVersion + }); + if (remote.protocolVersion === 2) { + return { + protocolVersion: remote.protocolVersion, + capabilities: remote.capabilities2 + }; + } + const capabilities = {}; + for (const cap of remote.capabilities) { + const [key2, value] = cap.split("="); + if (value) { + capabilities[key2] = value; + } else { + capabilities[key2] = true; + } + } + return { + protocolVersion: 1, + capabilities, + refs: formatInfoRefs(remote, void 0, true, true) + }; + } catch (err) { + err.caller = "git.getRemoteInfo2"; + throw err; + } +} +async function hashObject({ + type, + object, + format = "content", + oid = void 0 +}) { + if (format !== "deflated") { + if (format !== "wrapped") { + object = GitObject.wrap({ type, object }); + } + oid = await shasum(object); + } + return { oid, object }; +} +async function hashBlob({ object }) { + try { + assertParameter("object", object); + if (typeof object === "string") { + object = Buffer2.from(object, "utf8"); + } else { + object = Buffer2.from(object); + } + const type = "blob"; + const { oid, object: _object } = await hashObject({ + type: "blob", + format: "content", + object + }); + return { oid, type, object: new Uint8Array(_object), format: "wrapped" }; + } catch (err) { + err.caller = "git.hashBlob"; + throw err; + } +} +async function _indexPack({ + fs, + cache, + onProgress, + dir, + gitdir, + filepath +}) { + try { + filepath = join(dir, filepath); + const pack = await fs.read(filepath); + const getExternalRefDelta = (oid) => _readObject({ fs, cache, gitdir, oid }); + const idx = await GitPackIndex.fromPack({ + pack, + getExternalRefDelta, + onProgress + }); + await fs.write(filepath.replace(/\.pack$/, ".idx"), await idx.toBuffer()); + return { + oids: [...idx.hashes] + }; + } catch (err) { + err.caller = "git.indexPack"; + throw err; + } +} +async function indexPack({ + fs, + onProgress, + dir, + gitdir = join(dir, ".git"), + filepath, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("dir", dir); + assertParameter("gitdir", dir); + assertParameter("filepath", filepath); + return await _indexPack({ + fs: new FileSystem(fs), + cache, + onProgress, + dir, + gitdir, + filepath + }); + } catch (err) { + err.caller = "git.indexPack"; + throw err; + } +} +async function init({ + fs, + bare = false, + dir, + gitdir = bare ? dir : join(dir, ".git"), + defaultBranch = "master" +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + if (!bare) { + assertParameter("dir", dir); + } + return await _init({ + fs: new FileSystem(fs), + bare, + dir, + gitdir, + defaultBranch + }); + } catch (err) { + err.caller = "git.init"; + throw err; + } +} +async function _isDescendent({ + fs, + cache, + gitdir, + oid, + ancestor, + depth +}) { + const shallows = await GitShallowManager.read({ fs, gitdir }); + if (!oid) { + throw new MissingParameterError("oid"); + } + if (!ancestor) { + throw new MissingParameterError("ancestor"); + } + if (oid === ancestor) + return false; + const queue = [oid]; + const visited = new Set(); + let searchdepth = 0; + while (queue.length) { + if (searchdepth++ === depth) { + throw new MaxDepthError(depth); + } + const oid2 = queue.shift(); + const { type, object } = await _readObject({ + fs, + cache, + gitdir, + oid: oid2 + }); + if (type !== "commit") { + throw new ObjectTypeError(oid2, type, "commit"); + } + const commit2 = GitCommit.from(object).parse(); + for (const parent of commit2.parent) { + if (parent === ancestor) + return true; + } + if (!shallows.has(oid2)) { + for (const parent of commit2.parent) { + if (!visited.has(parent)) { + queue.push(parent); + visited.add(parent); + } + } + } + } + return false; +} +async function isDescendent({ + fs, + dir, + gitdir = join(dir, ".git"), + oid, + ancestor, + depth = -1, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + assertParameter("ancestor", ancestor); + return await _isDescendent({ + fs: new FileSystem(fs), + cache, + gitdir, + oid, + ancestor, + depth + }); + } catch (err) { + err.caller = "git.isDescendent"; + throw err; + } +} +async function isIgnored({ + fs, + dir, + gitdir = join(dir, ".git"), + filepath +}) { + try { + assertParameter("fs", fs); + assertParameter("dir", dir); + assertParameter("gitdir", gitdir); + assertParameter("filepath", filepath); + return GitIgnoreManager.isIgnored({ + fs: new FileSystem(fs), + dir, + gitdir, + filepath + }); + } catch (err) { + err.caller = "git.isIgnored"; + throw err; + } +} +async function listBranches({ + fs, + dir, + gitdir = join(dir, ".git"), + remote +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + return GitRefManager.listBranches({ + fs: new FileSystem(fs), + gitdir, + remote + }); + } catch (err) { + err.caller = "git.listBranches"; + throw err; + } +} +async function _listFiles({ fs, gitdir, ref, cache }) { + if (ref) { + const oid = await GitRefManager.resolve({ gitdir, fs, ref }); + const filenames = []; + await accumulateFilesFromOid({ + fs, + cache, + gitdir, + oid, + filenames, + prefix: "" + }); + return filenames; + } else { + return GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + return index2.entries.map((x) => x.path); + }); + } +} +async function accumulateFilesFromOid({ + fs, + cache, + gitdir, + oid, + filenames, + prefix +}) { + const { tree } = await _readTree({ fs, cache, gitdir, oid }); + for (const entry of tree) { + if (entry.type === "tree") { + await accumulateFilesFromOid({ + fs, + cache, + gitdir, + oid: entry.oid, + filenames, + prefix: join(prefix, entry.path) + }); + } else { + filenames.push(join(prefix, entry.path)); + } + } +} +async function listFiles({ + fs, + dir, + gitdir = join(dir, ".git"), + ref, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + return await _listFiles({ + fs: new FileSystem(fs), + cache, + gitdir, + ref + }); + } catch (err) { + err.caller = "git.listFiles"; + throw err; + } +} +async function _listNotes({ fs, cache, gitdir, ref }) { + let parent; + try { + parent = await GitRefManager.resolve({ gitdir, fs, ref }); + } catch (err) { + if (err instanceof NotFoundError) { + return []; + } + } + const result = await _readTree({ + fs, + cache, + gitdir, + oid: parent + }); + const notes = result.tree.map((entry) => ({ + target: entry.path, + note: entry.oid + })); + return notes; +} +async function listNotes({ + fs, + dir, + gitdir = join(dir, ".git"), + ref = "refs/notes/commits", + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + return await _listNotes({ + fs: new FileSystem(fs), + cache, + gitdir, + ref + }); + } catch (err) { + err.caller = "git.listNotes"; + throw err; + } +} +async function _listRemotes({ fs, gitdir }) { + const config = await GitConfigManager.get({ fs, gitdir }); + const remoteNames = await config.getSubsections("remote"); + const remotes = Promise.all(remoteNames.map(async (remote) => { + const url = await config.get(`remote.${remote}.url`); + return { remote, url }; + })); + return remotes; +} +async function listRemotes({ fs, dir, gitdir = join(dir, ".git") }) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + return await _listRemotes({ + fs: new FileSystem(fs), + gitdir + }); + } catch (err) { + err.caller = "git.listRemotes"; + throw err; + } +} +async function parseListRefsResponse(stream) { + const read = GitPktLine.streamReader(stream); + const refs = []; + let line; + while (true) { + line = await read(); + if (line === true) + break; + if (line === null) + continue; + line = line.toString("utf8").replace(/\n$/, ""); + const [oid, ref, ...attrs] = line.split(" "); + const r = { ref, oid }; + for (const attr2 of attrs) { + const [name, value] = attr2.split(":"); + if (name === "symref-target") { + r.target = value; + } else if (name === "peeled") { + r.peeled = value; + } + } + refs.push(r); + } + return refs; +} +async function writeListRefsRequest({ prefix, symrefs, peelTags }) { + const packstream = []; + packstream.push(GitPktLine.encode("command=ls-refs\n")); + packstream.push(GitPktLine.encode(`agent=${pkg.agent} +`)); + if (peelTags || symrefs || prefix) { + packstream.push(GitPktLine.delim()); + } + if (peelTags) + packstream.push(GitPktLine.encode("peel")); + if (symrefs) + packstream.push(GitPktLine.encode("symrefs")); + if (prefix) + packstream.push(GitPktLine.encode(`ref-prefix ${prefix}`)); + packstream.push(GitPktLine.flush()); + return packstream; +} +async function listServerRefs({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + url, + headers = {}, + forPush = false, + protocolVersion = 2, + prefix, + symrefs, + peelTags +}) { + try { + assertParameter("http", http); + assertParameter("url", url); + const remote = await GitRemoteHTTP.discover({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + service: forPush ? "git-receive-pack" : "git-upload-pack", + url, + headers, + protocolVersion + }); + if (remote.protocolVersion === 1) { + return formatInfoRefs(remote, prefix, symrefs, peelTags); + } + const body = await writeListRefsRequest({ prefix, symrefs, peelTags }); + const res = await GitRemoteHTTP.connect({ + http, + auth: remote.auth, + headers, + corsProxy, + service: forPush ? "git-receive-pack" : "git-upload-pack", + url, + body + }); + return parseListRefsResponse(res.body); + } catch (err) { + err.caller = "git.listServerRefs"; + throw err; + } +} +async function listTags({ fs, dir, gitdir = join(dir, ".git") }) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + return GitRefManager.listTags({ fs: new FileSystem(fs), gitdir }); + } catch (err) { + err.caller = "git.listTags"; + throw err; + } +} +async function resolveCommit({ fs, cache, gitdir, oid }) { + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + if (type === "tag") { + oid = GitAnnotatedTag.from(object).parse().object; + return resolveCommit({ fs, cache, gitdir, oid }); + } + if (type !== "commit") { + throw new ObjectTypeError(oid, type, "commit"); + } + return { commit: GitCommit.from(object), oid }; +} +async function _readCommit({ fs, cache, gitdir, oid }) { + const { commit: commit2, oid: commitOid } = await resolveCommit({ + fs, + cache, + gitdir, + oid + }); + const result = { + oid: commitOid, + commit: commit2.parse(), + payload: commit2.withoutSignature() + }; + return result; +} +function compareAge(a, b) { + return a.committer.timestamp - b.committer.timestamp; +} +var EMPTY_OID = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"; +async function resolveFileIdInTree({ fs, cache, gitdir, oid, fileId }) { + if (fileId === EMPTY_OID) + return; + const _oid = oid; + let filepath; + const result = await resolveTree({ fs, cache, gitdir, oid }); + const tree = result.tree; + if (fileId === result.oid) { + filepath = result.path; + } else { + filepath = await _resolveFileId({ + fs, + cache, + gitdir, + tree, + fileId, + oid: _oid + }); + if (Array.isArray(filepath)) { + if (filepath.length === 0) + filepath = void 0; + else if (filepath.length === 1) + filepath = filepath[0]; + } + } + return filepath; +} +async function _resolveFileId({ + fs, + cache, + gitdir, + tree, + fileId, + oid, + filepaths = [], + parentPath = "" +}) { + const walks = tree.entries().map(function(entry) { + let result; + if (entry.oid === fileId) { + result = join(parentPath, entry.path); + filepaths.push(result); + } else if (entry.type === "tree") { + result = _readObject({ + fs, + cache, + gitdir, + oid: entry.oid + }).then(function({ object }) { + return _resolveFileId({ + fs, + cache, + gitdir, + tree: GitTree.from(object), + fileId, + oid, + filepaths, + parentPath: join(parentPath, entry.path) + }); + }); + } + return result; + }); + await Promise.all(walks); + return filepaths; +} +async function _log({ + fs, + cache, + gitdir, + filepath, + ref, + depth, + since, + force, + follow +}) { + const sinceTimestamp = typeof since === "undefined" ? void 0 : Math.floor(since.valueOf() / 1e3); + const commits = []; + const shallowCommits = await GitShallowManager.read({ fs, gitdir }); + const oid = await GitRefManager.resolve({ fs, gitdir, ref }); + const tips = [await _readCommit({ fs, cache, gitdir, oid })]; + let lastFileOid; + let lastCommit; + let isOk; + function endCommit(commit2) { + if (isOk && filepath) + commits.push(commit2); + } + while (tips.length > 0) { + const commit2 = tips.pop(); + if (sinceTimestamp !== void 0 && commit2.commit.committer.timestamp <= sinceTimestamp) { + break; + } + if (filepath) { + let vFileOid; + try { + vFileOid = await resolveFilepath({ + fs, + cache, + gitdir, + oid: commit2.commit.tree, + filepath + }); + if (lastCommit && lastFileOid !== vFileOid) { + commits.push(lastCommit); + } + lastFileOid = vFileOid; + lastCommit = commit2; + isOk = true; + } catch (e) { + if (e instanceof NotFoundError) { + let found = follow && lastFileOid; + if (found) { + found = await resolveFileIdInTree({ + fs, + cache, + gitdir, + oid: commit2.commit.tree, + fileId: lastFileOid + }); + if (found) { + if (Array.isArray(found)) { + if (lastCommit) { + const lastFound = await resolveFileIdInTree({ + fs, + cache, + gitdir, + oid: lastCommit.commit.tree, + fileId: lastFileOid + }); + if (Array.isArray(lastFound)) { + found = found.filter((p) => lastFound.indexOf(p) === -1); + if (found.length === 1) { + found = found[0]; + filepath = found; + if (lastCommit) + commits.push(lastCommit); + } else { + found = false; + if (lastCommit) + commits.push(lastCommit); + break; + } + } + } + } else { + filepath = found; + if (lastCommit) + commits.push(lastCommit); + } + } + } + if (!found) { + if (isOk && lastFileOid) { + commits.push(lastCommit); + if (!force) + break; + } + if (!force && !follow) + throw e; + } + lastCommit = commit2; + isOk = false; + } else + throw e; + } + } else { + commits.push(commit2); + } + if (depth !== void 0 && commits.length === depth) { + endCommit(commit2); + break; + } + if (!shallowCommits.has(commit2.oid)) { + for (const oid2 of commit2.commit.parent) { + const commit3 = await _readCommit({ fs, cache, gitdir, oid: oid2 }); + if (!tips.map((commit4) => commit4.oid).includes(commit3.oid)) { + tips.push(commit3); + } + } + } + if (tips.length === 0) { + endCommit(commit2); + } + tips.sort((a, b) => compareAge(a.commit, b.commit)); + } + return commits; +} +async function log({ + fs, + dir, + gitdir = join(dir, ".git"), + filepath, + ref = "HEAD", + depth, + since, + force, + follow, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + return await _log({ + fs: new FileSystem(fs), + cache, + gitdir, + filepath, + ref, + depth, + since, + force, + follow + }); + } catch (err) { + err.caller = "git.log"; + throw err; + } +} +async function merge({ + fs: _fs, + onSign, + dir, + gitdir = join(dir, ".git"), + ours, + theirs, + fastForward: fastForward2 = true, + fastForwardOnly = false, + dryRun = false, + noUpdateBranch = false, + abortOnConflict = true, + message, + author: _author, + committer: _committer, + signingKey, + cache = {}, + mergeDriver +}) { + try { + assertParameter("fs", _fs); + if (signingKey) { + assertParameter("onSign", onSign); + } + const fs = new FileSystem(_fs); + const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); + if (!author && (!fastForwardOnly || !fastForward2)) { + throw new MissingNameError("author"); + } + const committer = await normalizeCommitterObject({ + fs, + gitdir, + author, + committer: _committer + }); + if (!committer && (!fastForwardOnly || !fastForward2)) { + throw new MissingNameError("committer"); + } + return await _merge({ + fs, + cache, + dir, + gitdir, + ours, + theirs, + fastForward: fastForward2, + fastForwardOnly, + dryRun, + noUpdateBranch, + abortOnConflict, + message, + author, + committer, + signingKey, + onSign, + mergeDriver + }); + } catch (err) { + err.caller = "git.merge"; + throw err; + } +} +var types = { + commit: 16, + tree: 32, + blob: 48, + tag: 64, + ofs_delta: 96, + ref_delta: 112 +}; +async function _pack({ + fs, + cache, + dir, + gitdir = join(dir, ".git"), + oids +}) { + const hash2 = new import_sha1.default(); + const outputStream = []; + function write(chunk, enc) { + const buff = Buffer2.from(chunk, enc); + outputStream.push(buff); + hash2.update(buff); + } + async function writeObject2({ stype, object }) { + const type = types[stype]; + let length = object.length; + let multibyte = length > 15 ? 128 : 0; + const lastFour = length & 15; + length = length >>> 4; + let byte = (multibyte | type | lastFour).toString(16); + write(byte, "hex"); + while (multibyte) { + multibyte = length > 127 ? 128 : 0; + byte = multibyte | length & 127; + write(padHex(2, byte), "hex"); + length = length >>> 7; + } + write(Buffer2.from(await deflate(object))); + } + write("PACK"); + write("00000002", "hex"); + write(padHex(8, oids.length), "hex"); + for (const oid of oids) { + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + await writeObject2({ write, object, stype: type }); + } + const digest = hash2.digest(); + outputStream.push(digest); + return outputStream; +} +async function _packObjects({ fs, cache, gitdir, oids, write }) { + const buffers = await _pack({ fs, cache, gitdir, oids }); + const packfile = Buffer2.from(await collect(buffers)); + const packfileSha = packfile.slice(-20).toString("hex"); + const filename = `pack-${packfileSha}.pack`; + if (write) { + await fs.write(join(gitdir, `objects/pack/${filename}`), packfile); + return { filename }; + } + return { + filename, + packfile: new Uint8Array(packfile) + }; +} +async function packObjects({ + fs, + dir, + gitdir = join(dir, ".git"), + oids, + write = false, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oids", oids); + return await _packObjects({ + fs: new FileSystem(fs), + cache, + gitdir, + oids, + write + }); + } catch (err) { + err.caller = "git.packObjects"; + throw err; + } +} +async function pull({ + fs: _fs, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir = join(dir, ".git"), + ref, + url, + remote, + remoteRef, + prune = false, + pruneTags = false, + fastForward: fastForward2 = true, + fastForwardOnly = false, + corsProxy, + singleBranch, + headers = {}, + author: _author, + committer: _committer, + signingKey, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + const fs = new FileSystem(_fs); + const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); + if (!author) + throw new MissingNameError("author"); + const committer = await normalizeCommitterObject({ + fs, + gitdir, + author, + committer: _committer + }); + if (!committer) + throw new MissingNameError("committer"); + return await _pull({ + fs, + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir, + ref, + url, + remote, + remoteRef, + fastForward: fastForward2, + fastForwardOnly, + corsProxy, + singleBranch, + headers, + author, + committer, + signingKey, + prune, + pruneTags + }); + } catch (err) { + err.caller = "git.pull"; + throw err; + } +} +async function listCommitsAndTags({ + fs, + cache, + dir, + gitdir = join(dir, ".git"), + start, + finish +}) { + const shallows = await GitShallowManager.read({ fs, gitdir }); + const startingSet = new Set(); + const finishingSet = new Set(); + for (const ref of start) { + startingSet.add(await GitRefManager.resolve({ fs, gitdir, ref })); + } + for (const ref of finish) { + try { + const oid = await GitRefManager.resolve({ fs, gitdir, ref }); + finishingSet.add(oid); + } catch (err) { + } + } + const visited = new Set(); + async function walk2(oid) { + visited.add(oid); + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + if (type === "tag") { + const tag2 = GitAnnotatedTag.from(object); + const commit2 = tag2.headers().object; + return walk2(commit2); + } + if (type !== "commit") { + throw new ObjectTypeError(oid, type, "commit"); + } + if (!shallows.has(oid)) { + const commit2 = GitCommit.from(object); + const parents = commit2.headers().parent; + for (oid of parents) { + if (!finishingSet.has(oid) && !visited.has(oid)) { + await walk2(oid); + } + } + } + } + for (const oid of startingSet) { + await walk2(oid); + } + return visited; +} +async function listObjects({ + fs, + cache, + dir, + gitdir = join(dir, ".git"), + oids +}) { + const visited = new Set(); + async function walk2(oid) { + if (visited.has(oid)) + return; + visited.add(oid); + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + if (type === "tag") { + const tag2 = GitAnnotatedTag.from(object); + const obj = tag2.headers().object; + await walk2(obj); + } else if (type === "commit") { + const commit2 = GitCommit.from(object); + const tree = commit2.headers().tree; + await walk2(tree); + } else if (type === "tree") { + const tree = GitTree.from(object); + for (const entry of tree) { + if (entry.type === "blob") { + visited.add(entry.oid); + } + if (entry.type === "tree") { + await walk2(entry.oid); + } + } + } + } + for (const oid of oids) { + await walk2(oid); + } + return visited; +} +async function parseReceivePackResponse(packfile) { + const result = {}; + let response = ""; + const read = GitPktLine.streamReader(packfile); + let line = await read(); + while (line !== true) { + if (line !== null) + response += line.toString("utf8") + "\n"; + line = await read(); + } + const lines = response.toString("utf8").split("\n"); + line = lines.shift(); + if (!line.startsWith("unpack ")) { + throw new ParseError('unpack ok" or "unpack [error message]', line); + } + result.ok = line === "unpack ok"; + if (!result.ok) { + result.error = line.slice("unpack ".length); + } + result.refs = {}; + for (const line2 of lines) { + if (line2.trim() === "") + continue; + const status2 = line2.slice(0, 2); + const refAndMessage = line2.slice(3); + let space2 = refAndMessage.indexOf(" "); + if (space2 === -1) + space2 = refAndMessage.length; + const ref = refAndMessage.slice(0, space2); + const error = refAndMessage.slice(space2 + 1); + result.refs[ref] = { + ok: status2 === "ok", + error + }; + } + return result; +} +async function writeReceivePackRequest({ + capabilities = [], + triplets = [] +}) { + const packstream = []; + let capsFirstLine = `\0 ${capabilities.join(" ")}`; + for (const trip of triplets) { + packstream.push(GitPktLine.encode(`${trip.oldoid} ${trip.oid} ${trip.fullRef}${capsFirstLine} +`)); + capsFirstLine = ""; + } + packstream.push(GitPktLine.flush()); + return packstream; +} +async function _push({ + fs, + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + gitdir, + ref: _ref, + remoteRef: _remoteRef, + remote, + url: _url, + force = false, + delete: _delete = false, + corsProxy, + headers = {} +}) { + const ref = _ref || await _currentBranch({ fs, gitdir }); + if (typeof ref === "undefined") { + throw new MissingParameterError("ref"); + } + const config = await GitConfigManager.get({ fs, gitdir }); + remote = remote || await config.get(`branch.${ref}.pushRemote`) || await config.get("remote.pushDefault") || await config.get(`branch.${ref}.remote`) || "origin"; + const url = _url || await config.get(`remote.${remote}.pushurl`) || await config.get(`remote.${remote}.url`); + if (typeof url === "undefined") { + throw new MissingParameterError("remote OR url"); + } + const remoteRef = _remoteRef || await config.get(`branch.${ref}.merge`); + if (typeof url === "undefined") { + throw new MissingParameterError("remoteRef"); + } + if (corsProxy === void 0) { + corsProxy = await config.get("http.corsProxy"); + } + const fullRef = await GitRefManager.expand({ fs, gitdir, ref }); + const oid = _delete ? "0000000000000000000000000000000000000000" : await GitRefManager.resolve({ fs, gitdir, ref: fullRef }); + const GitRemoteHTTP2 = GitRemoteManager.getRemoteHelperFor({ url }); + const httpRemote = await GitRemoteHTTP2.discover({ + http, + onAuth, + onAuthSuccess, + onAuthFailure, + corsProxy, + service: "git-receive-pack", + url, + headers, + protocolVersion: 1 + }); + const auth = httpRemote.auth; + let fullRemoteRef; + if (!remoteRef) { + fullRemoteRef = fullRef; + } else { + try { + fullRemoteRef = await GitRefManager.expandAgainstMap({ + ref: remoteRef, + map: httpRemote.refs + }); + } catch (err) { + if (err instanceof NotFoundError) { + fullRemoteRef = remoteRef.startsWith("refs/") ? remoteRef : `refs/heads/${remoteRef}`; + } else { + throw err; + } + } + } + const oldoid = httpRemote.refs.get(fullRemoteRef) || "0000000000000000000000000000000000000000"; + const thinPack = !httpRemote.capabilities.has("no-thin"); + let objects = new Set(); + if (!_delete) { + const finish = [...httpRemote.refs.values()]; + let skipObjects = new Set(); + if (oldoid !== "0000000000000000000000000000000000000000") { + const mergebase = await _findMergeBase({ + fs, + cache, + gitdir, + oids: [oid, oldoid] + }); + for (const oid2 of mergebase) + finish.push(oid2); + if (thinPack) { + skipObjects = await listObjects({ fs, cache, gitdir, oids: mergebase }); + } + } + if (!finish.includes(oid)) { + const commits = await listCommitsAndTags({ + fs, + cache, + gitdir, + start: [oid], + finish + }); + objects = await listObjects({ fs, cache, gitdir, oids: commits }); + } + if (thinPack) { + try { + const ref2 = await GitRefManager.resolve({ + fs, + gitdir, + ref: `refs/remotes/${remote}/HEAD`, + depth: 2 + }); + const { oid: oid2 } = await GitRefManager.resolveAgainstMap({ + ref: ref2.replace(`refs/remotes/${remote}/`, ""), + fullref: ref2, + map: httpRemote.refs + }); + const oids = [oid2]; + for (const oid3 of await listObjects({ fs, cache, gitdir, oids })) { + skipObjects.add(oid3); + } + } catch (e) { + } + for (const oid2 of skipObjects) { + objects.delete(oid2); + } + } + if (oid === oldoid) + force = true; + if (!force) { + if (fullRef.startsWith("refs/tags") && oldoid !== "0000000000000000000000000000000000000000") { + throw new PushRejectedError("tag-exists"); + } + if (oid !== "0000000000000000000000000000000000000000" && oldoid !== "0000000000000000000000000000000000000000" && !await _isDescendent({ + fs, + cache, + gitdir, + oid, + ancestor: oldoid, + depth: -1 + })) { + throw new PushRejectedError("not-fast-forward"); + } + } + } + const capabilities = filterCapabilities([...httpRemote.capabilities], ["report-status", "side-band-64k", `agent=${pkg.agent}`]); + const packstream1 = await writeReceivePackRequest({ + capabilities, + triplets: [{ oldoid, oid, fullRef: fullRemoteRef }] + }); + const packstream2 = _delete ? [] : await _pack({ + fs, + cache, + gitdir, + oids: [...objects] + }); + const res = await GitRemoteHTTP2.connect({ + http, + onProgress, + corsProxy, + service: "git-receive-pack", + url, + auth, + headers, + body: [...packstream1, ...packstream2] + }); + const { packfile, progress } = await GitSideBand.demux(res.body); + if (onMessage) { + const lines = splitLines(progress); + forAwait(lines, async (line) => { + await onMessage(line); + }); + } + const result = await parseReceivePackResponse(packfile); + if (res.headers) { + result.headers = res.headers; + } + if (remote && result.ok && result.refs[fullRemoteRef].ok) { + const ref2 = `refs/remotes/${remote}/${fullRemoteRef.replace("refs/heads", "")}`; + if (_delete) { + await GitRefManager.deleteRef({ fs, gitdir, ref: ref2 }); + } else { + await GitRefManager.writeRef({ fs, gitdir, ref: ref2, value: oid }); + } + } + if (result.ok && Object.values(result.refs).every((result2) => result2.ok)) { + return result; + } else { + const prettyDetails = Object.entries(result.refs).filter(([k, v]) => !v.ok).map(([k, v]) => ` + - ${k}: ${v.error}`).join(""); + throw new GitPushError(prettyDetails, result); + } +} +async function push({ + fs, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + dir, + gitdir = join(dir, ".git"), + ref, + remoteRef, + remote = "origin", + url, + force = false, + delete: _delete = false, + corsProxy, + headers = {}, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("http", http); + assertParameter("gitdir", gitdir); + return await _push({ + fs: new FileSystem(fs), + cache, + http, + onProgress, + onMessage, + onAuth, + onAuthSuccess, + onAuthFailure, + gitdir, + ref, + remoteRef, + remote, + url, + force, + delete: _delete, + corsProxy, + headers + }); + } catch (err) { + err.caller = "git.push"; + throw err; + } +} +async function resolveBlob({ fs, cache, gitdir, oid }) { + const { type, object } = await _readObject({ fs, cache, gitdir, oid }); + if (type === "tag") { + oid = GitAnnotatedTag.from(object).parse().object; + return resolveBlob({ fs, cache, gitdir, oid }); + } + if (type !== "blob") { + throw new ObjectTypeError(oid, type, "blob"); + } + return { oid, blob: new Uint8Array(object) }; +} +async function _readBlob({ + fs, + cache, + gitdir, + oid, + filepath = void 0 +}) { + if (filepath !== void 0) { + oid = await resolveFilepath({ fs, cache, gitdir, oid, filepath }); + } + const blob = await resolveBlob({ + fs, + cache, + gitdir, + oid + }); + return blob; +} +async function readBlob({ + fs, + dir, + gitdir = join(dir, ".git"), + oid, + filepath, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + return await _readBlob({ + fs: new FileSystem(fs), + cache, + gitdir, + oid, + filepath + }); + } catch (err) { + err.caller = "git.readBlob"; + throw err; + } +} +async function readCommit({ + fs, + dir, + gitdir = join(dir, ".git"), + oid, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + return await _readCommit({ + fs: new FileSystem(fs), + cache, + gitdir, + oid + }); + } catch (err) { + err.caller = "git.readCommit"; + throw err; + } +} +async function _readNote({ + fs, + cache, + gitdir, + ref = "refs/notes/commits", + oid +}) { + const parent = await GitRefManager.resolve({ gitdir, fs, ref }); + const { blob } = await _readBlob({ + fs, + cache, + gitdir, + oid: parent, + filepath: oid + }); + return blob; +} +async function readNote({ + fs, + dir, + gitdir = join(dir, ".git"), + ref = "refs/notes/commits", + oid, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + assertParameter("oid", oid); + return await _readNote({ + fs: new FileSystem(fs), + cache, + gitdir, + ref, + oid + }); + } catch (err) { + err.caller = "git.readNote"; + throw err; + } +} +async function readObject({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + oid, + format = "parsed", + filepath = void 0, + encoding = void 0, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + const fs = new FileSystem(_fs); + if (filepath !== void 0) { + oid = await resolveFilepath({ + fs, + cache, + gitdir, + oid, + filepath + }); + } + const _format = format === "parsed" ? "content" : format; + const result = await _readObject({ + fs, + cache, + gitdir, + oid, + format: _format + }); + result.oid = oid; + if (format === "parsed") { + result.format = "parsed"; + switch (result.type) { + case "commit": + result.object = GitCommit.from(result.object).parse(); + break; + case "tree": + result.object = GitTree.from(result.object).entries(); + break; + case "blob": + if (encoding) { + result.object = result.object.toString(encoding); + } else { + result.object = new Uint8Array(result.object); + result.format = "content"; + } + break; + case "tag": + result.object = GitAnnotatedTag.from(result.object).parse(); + break; + default: + throw new ObjectTypeError(result.oid, result.type, "blob|commit|tag|tree"); + } + } else if (result.format === "deflated" || result.format === "wrapped") { + result.type = result.format; + } + return result; + } catch (err) { + err.caller = "git.readObject"; + throw err; + } +} +async function _readTag({ fs, cache, gitdir, oid }) { + const { type, object } = await _readObject({ + fs, + cache, + gitdir, + oid, + format: "content" + }); + if (type !== "tag") { + throw new ObjectTypeError(oid, type, "tag"); + } + const tag2 = GitAnnotatedTag.from(object); + const result = { + oid, + tag: tag2.parse(), + payload: tag2.payload() + }; + return result; +} +async function readTag({ + fs, + dir, + gitdir = join(dir, ".git"), + oid, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + return await _readTag({ + fs: new FileSystem(fs), + cache, + gitdir, + oid + }); + } catch (err) { + err.caller = "git.readTag"; + throw err; + } +} +async function readTree({ + fs, + dir, + gitdir = join(dir, ".git"), + oid, + filepath = void 0, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + return await _readTree({ + fs: new FileSystem(fs), + cache, + gitdir, + oid, + filepath + }); + } catch (err) { + err.caller = "git.readTree"; + throw err; + } +} +async function remove({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + filepath, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("filepath", filepath); + await GitIndexManager.acquire({ fs: new FileSystem(_fs), gitdir, cache }, async function(index2) { + index2.delete({ filepath }); + }); + } catch (err) { + err.caller = "git.remove"; + throw err; + } +} +async function _removeNote({ + fs, + cache, + onSign, + gitdir, + ref = "refs/notes/commits", + oid, + author, + committer, + signingKey +}) { + let parent; + try { + parent = await GitRefManager.resolve({ gitdir, fs, ref }); + } catch (err) { + if (!(err instanceof NotFoundError)) { + throw err; + } + } + const result = await _readTree({ + fs, + gitdir, + oid: parent || "4b825dc642cb6eb9a060e54bf8d69288fbee4904" + }); + let tree = result.tree; + tree = tree.filter((entry) => entry.path !== oid); + const treeOid = await _writeTree({ + fs, + gitdir, + tree + }); + const commitOid = await _commit({ + fs, + cache, + onSign, + gitdir, + ref, + tree: treeOid, + parent: parent && [parent], + message: `Note removed by 'isomorphic-git removeNote' +`, + author, + committer, + signingKey + }); + return commitOid; +} +async function removeNote({ + fs: _fs, + onSign, + dir, + gitdir = join(dir, ".git"), + ref = "refs/notes/commits", + oid, + author: _author, + committer: _committer, + signingKey, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("oid", oid); + const fs = new FileSystem(_fs); + const author = await normalizeAuthorObject({ fs, gitdir, author: _author }); + if (!author) + throw new MissingNameError("author"); + const committer = await normalizeCommitterObject({ + fs, + gitdir, + author, + committer: _committer + }); + if (!committer) + throw new MissingNameError("committer"); + return await _removeNote({ + fs, + cache, + onSign, + gitdir, + ref, + oid, + author, + committer, + signingKey + }); + } catch (err) { + err.caller = "git.removeNote"; + throw err; + } +} +async function _renameBranch({ + fs, + gitdir, + oldref, + ref, + checkout: checkout2 = false +}) { + if (ref !== import_clean_git_ref.default.clean(ref)) { + throw new InvalidRefNameError(ref, import_clean_git_ref.default.clean(ref)); + } + if (oldref !== import_clean_git_ref.default.clean(oldref)) { + throw new InvalidRefNameError(oldref, import_clean_git_ref.default.clean(oldref)); + } + const fulloldref = `refs/heads/${oldref}`; + const fullnewref = `refs/heads/${ref}`; + const newexist = await GitRefManager.exists({ fs, gitdir, ref: fullnewref }); + if (newexist) { + throw new AlreadyExistsError("branch", ref, false); + } + const value = await GitRefManager.resolve({ + fs, + gitdir, + ref: fulloldref, + depth: 1 + }); + await GitRefManager.writeRef({ fs, gitdir, ref: fullnewref, value }); + await GitRefManager.deleteRef({ fs, gitdir, ref: fulloldref }); + if (checkout2) { + await GitRefManager.writeSymbolicRef({ + fs, + gitdir, + ref: "HEAD", + value: fullnewref + }); + } +} +async function renameBranch({ + fs, + dir, + gitdir = join(dir, ".git"), + ref, + oldref, + checkout: checkout2 = false +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + assertParameter("oldref", oldref); + return await _renameBranch({ + fs: new FileSystem(fs), + gitdir, + ref, + oldref, + checkout: checkout2 + }); + } catch (err) { + err.caller = "git.renameBranch"; + throw err; + } +} +async function hashObject$1({ gitdir, type, object }) { + return shasum(GitObject.wrap({ type, object })); +} +async function resetIndex({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + filepath, + ref, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("filepath", filepath); + const fs = new FileSystem(_fs); + let oid; + let workdirOid; + try { + oid = await GitRefManager.resolve({ fs, gitdir, ref: ref || "HEAD" }); + } catch (e) { + if (ref) { + throw e; + } + } + if (oid) { + try { + oid = await resolveFilepath({ + fs, + cache, + gitdir, + oid, + filepath + }); + } catch (e) { + oid = null; + } + } + let stats = { + ctime: new Date(0), + mtime: new Date(0), + dev: 0, + ino: 0, + mode: 0, + uid: 0, + gid: 0, + size: 0 + }; + const object = dir && await fs.read(join(dir, filepath)); + if (object) { + workdirOid = await hashObject$1({ + gitdir, + type: "blob", + object + }); + if (oid === workdirOid) { + stats = await fs.lstat(join(dir, filepath)); + } + } + await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + index2.delete({ filepath }); + if (oid) { + index2.insert({ filepath, stats, oid }); + } + }); + } catch (err) { + err.caller = "git.reset"; + throw err; + } +} +async function resolveRef({ + fs, + dir, + gitdir = join(dir, ".git"), + ref, + depth +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + const oid = await GitRefManager.resolve({ + fs: new FileSystem(fs), + gitdir, + ref, + depth + }); + return oid; + } catch (err) { + err.caller = "git.resolveRef"; + throw err; + } +} +async function setConfig({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + path: path2, + value, + append: append3 = false +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("path", path2); + const fs = new FileSystem(_fs); + const config = await GitConfigManager.get({ fs, gitdir }); + if (append3) { + await config.append(path2, value); + } else { + await config.set(path2, value); + } + await GitConfigManager.save({ fs, gitdir, config }); + } catch (err) { + err.caller = "git.setConfig"; + throw err; + } +} +async function status({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + filepath, + cache = {} +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("filepath", filepath); + const fs = new FileSystem(_fs); + const ignored = await GitIgnoreManager.isIgnored({ + fs, + gitdir, + dir, + filepath + }); + if (ignored) { + return "ignored"; + } + const headTree = await getHeadTree({ fs, cache, gitdir }); + const treeOid = await getOidAtPath({ + fs, + cache, + gitdir, + tree: headTree, + path: filepath + }); + const indexEntry = await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + for (const entry of index2) { + if (entry.path === filepath) + return entry; + } + return null; + }); + const stats = await fs.lstat(join(dir, filepath)); + const H = treeOid !== null; + const I = indexEntry !== null; + const W = stats !== null; + const getWorkdirOid = async () => { + if (I && !compareStats(indexEntry, stats)) { + return indexEntry.oid; + } else { + const object = await fs.read(join(dir, filepath)); + const workdirOid = await hashObject$1({ + gitdir, + type: "blob", + object + }); + if (I && indexEntry.oid === workdirOid) { + if (stats.size !== -1) { + GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + index2.insert({ filepath, stats, oid: workdirOid }); + }); + } + } + return workdirOid; + } + }; + if (!H && !W && !I) + return "absent"; + if (!H && !W && I) + return "*absent"; + if (!H && W && !I) + return "*added"; + if (!H && W && I) { + const workdirOid = await getWorkdirOid(); + return workdirOid === indexEntry.oid ? "added" : "*added"; + } + if (H && !W && !I) + return "deleted"; + if (H && !W && I) { + return treeOid === indexEntry.oid ? "*deleted" : "*deleted"; + } + if (H && W && !I) { + const workdirOid = await getWorkdirOid(); + return workdirOid === treeOid ? "*undeleted" : "*undeletemodified"; + } + if (H && W && I) { + const workdirOid = await getWorkdirOid(); + if (workdirOid === treeOid) { + return workdirOid === indexEntry.oid ? "unmodified" : "*unmodified"; + } else { + return workdirOid === indexEntry.oid ? "modified" : "*modified"; + } + } + } catch (err) { + err.caller = "git.status"; + throw err; + } +} +async function getOidAtPath({ fs, cache, gitdir, tree, path: path2 }) { + if (typeof path2 === "string") + path2 = path2.split("/"); + const dirname2 = path2.shift(); + for (const entry of tree) { + if (entry.path === dirname2) { + if (path2.length === 0) { + return entry.oid; + } + const { type, object } = await _readObject({ + fs, + cache, + gitdir, + oid: entry.oid + }); + if (type === "tree") { + const tree2 = GitTree.from(object); + return getOidAtPath({ fs, cache, gitdir, tree: tree2, path: path2 }); + } + if (type === "blob") { + throw new ObjectTypeError(entry.oid, type, "blob", path2.join("/")); + } + } + } + return null; +} +async function getHeadTree({ fs, cache, gitdir }) { + let oid; + try { + oid = await GitRefManager.resolve({ fs, gitdir, ref: "HEAD" }); + } catch (e) { + if (e instanceof NotFoundError) { + return []; + } + } + const { tree } = await _readTree({ fs, cache, gitdir, oid }); + return tree; +} +async function statusMatrix({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + ref = "HEAD", + filepaths = ["."], + filter, + cache = {}, + ignored: shouldIgnore = false +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + const fs = new FileSystem(_fs); + return await _walk({ + fs, + cache, + dir, + gitdir, + trees: [TREE({ ref }), WORKDIR(), STAGE()], + map: async function(filepath, [head, workdir, stage]) { + if (!head && !stage && workdir) { + if (!shouldIgnore) { + const isIgnored2 = await GitIgnoreManager.isIgnored({ + fs, + dir, + filepath + }); + if (isIgnored2) { + return null; + } + } + } + if (!filepaths.some((base) => worthWalking(filepath, base))) { + return null; + } + if (filter) { + if (!filter(filepath)) + return; + } + const [headType, workdirType, stageType] = await Promise.all([ + head && head.type(), + workdir && workdir.type(), + stage && stage.type() + ]); + const isBlob = [headType, workdirType, stageType].includes("blob"); + if ((headType === "tree" || headType === "special") && !isBlob) + return; + if (headType === "commit") + return null; + if ((workdirType === "tree" || workdirType === "special") && !isBlob) + return; + if (stageType === "commit") + return null; + if ((stageType === "tree" || stageType === "special") && !isBlob) + return; + const headOid = headType === "blob" ? await head.oid() : void 0; + const stageOid = stageType === "blob" ? await stage.oid() : void 0; + let workdirOid; + if (headType !== "blob" && workdirType === "blob" && stageType !== "blob") { + workdirOid = "42"; + } else if (workdirType === "blob") { + workdirOid = await workdir.oid(); + } + const entry = [void 0, headOid, workdirOid, stageOid]; + const result = entry.map((value) => entry.indexOf(value)); + result.shift(); + return [filepath, ...result]; + } + }); + } catch (err) { + err.caller = "git.statusMatrix"; + throw err; + } +} +async function tag({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + ref, + object, + force = false +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + const fs = new FileSystem(_fs); + if (ref === void 0) { + throw new MissingParameterError("ref"); + } + ref = ref.startsWith("refs/tags/") ? ref : `refs/tags/${ref}`; + const value = await GitRefManager.resolve({ + fs, + gitdir, + ref: object || "HEAD" + }); + if (!force && await GitRefManager.exists({ fs, gitdir, ref })) { + throw new AlreadyExistsError("tag", ref); + } + await GitRefManager.writeRef({ fs, gitdir, ref, value }); + } catch (err) { + err.caller = "git.tag"; + throw err; + } +} +async function updateIndex({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + cache = {}, + filepath, + oid, + mode, + add: add2, + remove: remove3, + force +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("filepath", filepath); + const fs = new FileSystem(_fs); + if (remove3) { + return await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + let fileStats2; + if (!force) { + fileStats2 = await fs.lstat(join(dir, filepath)); + if (fileStats2) { + if (fileStats2.isDirectory()) { + throw new InvalidFilepathError("directory"); + } + return; + } + } + if (index2.has({ filepath })) { + index2.delete({ + filepath + }); + } + }); + } + let fileStats; + if (!oid) { + fileStats = await fs.lstat(join(dir, filepath)); + if (!fileStats) { + throw new NotFoundError(`file at "${filepath}" on disk and "remove" not set`); + } + if (fileStats.isDirectory()) { + throw new InvalidFilepathError("directory"); + } + } + return await GitIndexManager.acquire({ fs, gitdir, cache }, async function(index2) { + if (!add2 && !index2.has({ filepath })) { + throw new NotFoundError(`file at "${filepath}" in index and "add" not set`); + } + let stats = { + ctime: new Date(0), + mtime: new Date(0), + dev: 0, + ino: 0, + mode, + uid: 0, + gid: 0, + size: 0 + }; + if (!oid) { + stats = fileStats; + const object = stats.isSymbolicLink() ? await fs.readlink(join(dir, filepath)) : await fs.read(join(dir, filepath)); + oid = await _writeObject({ + fs, + gitdir, + type: "blob", + format: "content", + object + }); + } + index2.insert({ + filepath, + oid, + stats + }); + return oid; + }); + } catch (err) { + err.caller = "git.updateIndex"; + throw err; + } +} +function version() { + try { + return pkg.version; + } catch (err) { + err.caller = "git.version"; + throw err; + } +} +async function walk({ + fs, + dir, + gitdir = join(dir, ".git"), + trees, + map, + reduce, + iterate, + cache = {} +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("trees", trees); + return await _walk({ + fs: new FileSystem(fs), + cache, + dir, + gitdir, + trees, + map, + reduce, + iterate + }); + } catch (err) { + err.caller = "git.walk"; + throw err; + } +} +async function writeBlob({ fs, dir, gitdir = join(dir, ".git"), blob }) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("blob", blob); + return await _writeObject({ + fs: new FileSystem(fs), + gitdir, + type: "blob", + object: blob, + format: "content" + }); + } catch (err) { + err.caller = "git.writeBlob"; + throw err; + } +} +async function _writeCommit({ fs, gitdir, commit: commit2 }) { + const object = GitCommit.from(commit2).toObject(); + const oid = await _writeObject({ + fs, + gitdir, + type: "commit", + object, + format: "content" + }); + return oid; +} +async function writeCommit({ + fs, + dir, + gitdir = join(dir, ".git"), + commit: commit2 +}) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("commit", commit2); + return await _writeCommit({ + fs: new FileSystem(fs), + gitdir, + commit: commit2 + }); + } catch (err) { + err.caller = "git.writeCommit"; + throw err; + } +} +async function writeObject({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + type, + object, + format = "parsed", + oid, + encoding = void 0 +}) { + try { + const fs = new FileSystem(_fs); + if (format === "parsed") { + switch (type) { + case "commit": + object = GitCommit.from(object).toObject(); + break; + case "tree": + object = GitTree.from(object).toObject(); + break; + case "blob": + object = Buffer2.from(object, encoding); + break; + case "tag": + object = GitAnnotatedTag.from(object).toObject(); + break; + default: + throw new ObjectTypeError(oid || "", type, "blob|commit|tag|tree"); + } + format = "content"; + } + oid = await _writeObject({ + fs, + gitdir, + type, + object, + oid, + format + }); + return oid; + } catch (err) { + err.caller = "git.writeObject"; + throw err; + } +} +async function writeRef({ + fs: _fs, + dir, + gitdir = join(dir, ".git"), + ref, + value, + force = false, + symbolic = false +}) { + try { + assertParameter("fs", _fs); + assertParameter("gitdir", gitdir); + assertParameter("ref", ref); + assertParameter("value", value); + const fs = new FileSystem(_fs); + if (ref !== import_clean_git_ref.default.clean(ref)) { + throw new InvalidRefNameError(ref, import_clean_git_ref.default.clean(ref)); + } + if (!force && await GitRefManager.exists({ fs, gitdir, ref })) { + throw new AlreadyExistsError("ref", ref); + } + if (symbolic) { + await GitRefManager.writeSymbolicRef({ + fs, + gitdir, + ref, + value + }); + } else { + value = await GitRefManager.resolve({ + fs, + gitdir, + ref: value + }); + await GitRefManager.writeRef({ + fs, + gitdir, + ref, + value + }); + } + } catch (err) { + err.caller = "git.writeRef"; + throw err; + } +} +async function _writeTag({ fs, gitdir, tag: tag2 }) { + const object = GitAnnotatedTag.from(tag2).toObject(); + const oid = await _writeObject({ + fs, + gitdir, + type: "tag", + object, + format: "content" + }); + return oid; +} +async function writeTag({ fs, dir, gitdir = join(dir, ".git"), tag: tag2 }) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("tag", tag2); + return await _writeTag({ + fs: new FileSystem(fs), + gitdir, + tag: tag2 + }); + } catch (err) { + err.caller = "git.writeTag"; + throw err; + } +} +async function writeTree({ fs, dir, gitdir = join(dir, ".git"), tree }) { + try { + assertParameter("fs", fs); + assertParameter("gitdir", gitdir); + assertParameter("tree", tree); + return await _writeTree({ + fs: new FileSystem(fs), + gitdir, + tree + }); + } catch (err) { + err.caller = "git.writeTree"; + throw err; + } +} +var index = { + Errors, + STAGE, + TREE, + WORKDIR, + add, + addNote, + addRemote, + annotatedTag, + branch, + checkout, + clone, + commit, + getConfig, + getConfigAll, + setConfig, + currentBranch, + deleteBranch, + deleteRef, + deleteRemote, + deleteTag, + expandOid, + expandRef, + fastForward, + fetch, + findMergeBase, + findRoot, + getRemoteInfo, + getRemoteInfo2, + hashBlob, + indexPack, + init, + isDescendent, + isIgnored, + listBranches, + listFiles, + listNotes, + listRemotes, + listServerRefs, + listTags, + log, + merge, + packObjects, + pull, + push, + readBlob, + readCommit, + readNote, + readObject, + readTag, + readTree, + remove, + removeNote, + renameBranch, + resetIndex, + updateIndex, + resolveRef, + status, + statusMatrix, + tag, + version, + walk, + writeBlob, + writeCommit, + writeObject, + writeRef, + writeTag, + writeTree +}; +var isomorphic_git_default = index; + +// src/main.ts +var import_obsidian23 = __toModule(require("obsidian")); // src/promiseQueue.ts +init_polyfill_buffer(); var PromiseQueue = class { constructor() { this.tasks = []; @@ -6787,227 +18679,805 @@ var PromiseQueue = class { this.handleTask(); } } - handleTask() { - return __async(this, null, function* () { - if (this.tasks.length > 0) { - this.tasks[0]().finally(() => { - this.tasks.shift(); - this.handleTask(); - }); - } - }); + async handleTask() { + if (this.tasks.length > 0) { + this.tasks[0]().finally(() => { + this.tasks.shift(); + this.handleTask(); + }); + } } }; // src/settings.ts -var import_obsidian = __toModule(require("obsidian")); -var ObsidianGitSettingsTab = class extends import_obsidian.PluginSettingTab { - display() { - let { containerEl } = this; - const plugin = this.plugin; - containerEl.empty(); - containerEl.createEl("h2", { text: "Git Backup settings" }); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Automatic" }); - const commitOrBackup = plugin.settings.differentIntervalCommitAndPush ? "commit" : "backup"; - new import_obsidian.Setting(containerEl).setName("Split automatic commit and push").setDesc("Enable to use separate timer for commit and push").addToggle((toggle) => toggle.setValue(plugin.settings.differentIntervalCommitAndPush).onChange((value) => { - plugin.settings.differentIntervalCommitAndPush = value; - plugin.saveSettings(); - plugin.clearAutoBackup(); - plugin.clearAutoPush(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - } - if (value && plugin.settings.autoPushInterval > 0) { - plugin.startAutoPush(plugin.settings.autoPushInterval); - } - this.display(); - })); - new import_obsidian.Setting(containerEl).setName(`Vault ${commitOrBackup} interval (minutes)`).setDesc(`${plugin.settings.differentIntervalCommitAndPush ? "Commit" : "Commit and push"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText((text2) => text2.setValue(String(plugin.settings.autoSaveInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoSaveInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.clearAutoBackup(); - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - new import_obsidian.Notice(`Automatic ${commitOrBackup} enabled! Every ${plugin.settings.autoSaveInterval} minutes.`); - } else if (plugin.settings.autoSaveInterval <= 0) { - plugin.clearAutoBackup() && new import_obsidian.Notice(`Automatic ${commitOrBackup} disabled!`); - } +init_polyfill_buffer(); +var import_obsidian7 = __toModule(require("obsidian")); + +// src/isomorphicGit.ts +init_polyfill_buffer(); + +// node_modules/diff/lib/index.mjs +init_polyfill_buffer(); +function Diff() { +} +Diff.prototype = { + diff: function diff(oldString, newString) { + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; + var callback = options.callback; + if (typeof options === "function") { + callback = options; + options = {}; + } + this.options = options; + var self3 = this; + function done(value) { + if (callback) { + setTimeout(function() { + callback(void 0, value); + }, 0); + return true; } else { - new import_obsidian.Notice("Please specify a valid number."); + return value; } - })); - new import_obsidian.Setting(containerEl).setName(`If turned on, do auto ${commitOrBackup} every X minutes after last change. Prevents auto ${commitOrBackup} while editing a file. If turned off, do auto ${commitOrBackup} every X minutes. It's independent from last change.`).addToggle((toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => { - plugin.settings.autoBackupAfterFileChange = value; - plugin.saveSettings(); - plugin.clearAutoBackup(); - if (plugin.settings.autoSaveInterval > 0) { - plugin.startAutoBackup(plugin.settings.autoSaveInterval); - } - })); - if (plugin.settings.differentIntervalCommitAndPush) { - new import_obsidian.Setting(containerEl).setName(`Vault push interval (minutes)`).setDesc("Push changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPushInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoPushInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoPushInterval > 0) { - plugin.clearAutoPush(); - plugin.startAutoPush(plugin.settings.autoPushInterval); - new import_obsidian.Notice(`Automatic push enabled! Every ${plugin.settings.autoPushInterval} minutes.`); - } else if (plugin.settings.autoPushInterval <= 0) { - plugin.clearAutoPush() && new import_obsidian.Notice("Automatic push disabled!"); - } + } + oldString = this.castInput(oldString); + newString = this.castInput(newString); + oldString = this.removeEmpty(this.tokenize(oldString)); + newString = this.removeEmpty(this.tokenize(newString)); + var newLen = newString.length, oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + if (options.maxEditLength) { + maxEditLength = Math.min(maxEditLength, options.maxEditLength); + } + var bestPath = [{ + newPos: -1, + components: [] + }]; + var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); + if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + return done([{ + value: this.join(newString), + count: newString.length + }]); + } + function execEditLength() { + for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { + var basePath = void 0; + var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; + if (addPath) { + bestPath[diagonalPath - 1] = void 0; + } + var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; + if (!canAdd && !canRemove) { + bestPath[diagonalPath] = void 0; + continue; + } + if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { + basePath = clonePath(removePath); + self3.pushComponent(basePath.components, void 0, true); } else { - new import_obsidian.Notice("Please specify a valid number."); + basePath = addPath; + basePath.newPos++; + self3.pushComponent(basePath.components, true, void 0); } - })); + _oldPos = self3.extractCommon(basePath, newString, oldString, diagonalPath); + if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { + return done(buildValues(self3, basePath.components, newString, oldString, self3.useLongestToken)); + } else { + bestPath[diagonalPath] = basePath; + } + } + editLength++; } - new import_obsidian.Setting(containerEl).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPullInterval)).onChange((value) => { - if (!isNaN(Number(value))) { - plugin.settings.autoPullInterval = Number(value); - plugin.saveSettings(); - if (plugin.settings.autoPullInterval > 0) { - plugin.clearAutoPull(); - plugin.startAutoPull(plugin.settings.autoPullInterval); - new import_obsidian.Notice(`Automatic pull enabled! Every ${plugin.settings.autoPullInterval} minutes.`); - } else if (plugin.settings.autoPullInterval <= 0) { - plugin.clearAutoPull() && new import_obsidian.Notice("Automatic pull disabled!"); - } - } else { - new import_obsidian.Notice("Please specify a valid number."); - } - })); - new import_obsidian.Setting(containerEl).setName("Commit message on manual backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.commitMessage ? plugin.settings.commitMessage : "").onChange((value) => { - plugin.settings.commitMessage = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Specify custom commit message on auto backup").setDesc("You will get a pop up to specify your message").addToggle((toggle) => toggle.setValue(plugin.settings.customMessageOnAutoBackup).onChange((value) => { - plugin.settings.customMessageOnAutoBackup = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Commit message on auto backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.autoCommitMessage).onChange((value) => { - plugin.settings.autoCommitMessage = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Commit message" }); - new import_obsidian.Setting(containerEl).setName("{{date}} placeholder format").setDesc('Specify custom date format. E.g. "YYYY-MM-DD HH:mm:ss"').addText((text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange((value) => __async(this, null, function* () { - plugin.settings.commitDateFormat = value; - yield plugin.saveSettings(); - }))); - new import_obsidian.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText((text2) => text2.setValue(localStorage.getItem(plugin.manifest.id + ":hostname")).onChange((value) => __async(this, null, function* () { - localStorage.setItem(plugin.manifest.id + ":hostname", value); - }))); - new import_obsidian.Setting(containerEl).setName("Preview commit message").addButton((button) => button.setButtonText("Preview").onClick(() => __async(this, null, function* () { - let commitMessagePreview = yield plugin.gitManager.formatCommitMessage(plugin.settings.commitMessage); - new import_obsidian.Notice(`${commitMessagePreview}`); - }))); - new import_obsidian.Setting(containerEl).setName("List filenames affected by commit in the commit body").addToggle((toggle) => toggle.setValue(plugin.settings.listChangedFilesInMessageBody).onChange((value) => { - plugin.settings.listChangedFilesInMessageBody = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Backup" }); - new import_obsidian.Setting(containerEl).setName("Sync Method").setDesc("Selects the method used for handling new changes found in your remote git repository.").addDropdown((dropdown) => { - const options = { - "merge": "Merge", - "rebase": "Rebase", - "reset": "Other sync service (Only updates the HEAD without touching the working directory)" - }; - dropdown.addOptions(options); - dropdown.setValue(plugin.settings.syncMethod); - dropdown.onChange((option) => __async(this, null, function* () { - plugin.settings.syncMethod = option; - plugin.saveSettings(); - })); - }); - new import_obsidian.Setting(containerEl).setName("Pull updates on startup").setDesc("Automatically pull updates when Obsidian starts").addToggle((toggle) => toggle.setValue(plugin.settings.autoPullOnBoot).onChange((value) => { - plugin.settings.autoPullOnBoot = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Push on backup").setDesc("Disable to only commit changes").addToggle((toggle) => toggle.setValue(!plugin.settings.disablePush).onChange((value) => { - plugin.settings.disablePush = !value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Pull changes before push").setDesc("Commit -> pull -> push (Only if pushing is enabled)").addToggle((toggle) => toggle.setValue(plugin.settings.pullBeforePush).onChange((value) => { - plugin.settings.pullBeforePush = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Miscellaneous" }); - new import_obsidian.Setting(containerEl).setName("Current branch").setDesc("Switch to a different branch").addDropdown((dropdown) => __async(this, null, function* () { - const branchInfo = yield plugin.gitManager.branchInfo(); - for (const branch of branchInfo.branches) { - dropdown.addOption(branch, branch); - } - dropdown.setValue(branchInfo.current); - dropdown.onChange((option) => __async(this, null, function* () { - yield plugin.gitManager.checkout(option); - new import_obsidian.Notice(`Checked out to ${option}`); - })); - })); - new import_obsidian.Setting(containerEl).setName("Automatically refresh Source Control View on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option").addToggle((toggle) => toggle.setValue(plugin.settings.refreshSourceControl).onChange((value) => { - plugin.settings.refreshSourceControl = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting").addToggle((toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { - plugin.settings.disablePopups = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect").addToggle((toggle) => toggle.setValue(plugin.settings.showStatusBar).onChange((value) => { - plugin.settings.showStatusBar = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Show changes files count in status bar").addToggle((toggle) => toggle.setValue(plugin.settings.changedFilesInStatusBar).onChange((value) => { - plugin.settings.changedFilesInStatusBar = value; - plugin.saveSettings(); - })); - containerEl.createEl("br"); - containerEl.createEl("h3", { text: "Advanced" }); - new import_obsidian.Setting(containerEl).setName("Update submodules").setDesc('"Create backup" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule').addToggle((toggle) => toggle.setValue(plugin.settings.updateSubmodules).onChange((value) => { - plugin.settings.updateSubmodules = value; - plugin.saveSettings(); - })); - new import_obsidian.Setting(containerEl).setName("Custom Git binary path").addText((cb) => { - cb.setValue(plugin.settings.gitPath); - cb.setPlaceholder("git"); - cb.onChange((value) => { - plugin.settings.gitPath = value; - plugin.saveSettings(); - plugin.gitManager.updateGitPath(value || "git"); - }); - }); - new import_obsidian.Setting(containerEl).setName("Custom base path (Git repository path)").setDesc(` - Sets the relative path to the vault from which the Git binary should be executed. - Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows. - `).addText((cb) => { - cb.setValue(plugin.settings.basePath); - cb.setPlaceholder("directory/directory-with-git-repo"); - cb.onChange((value) => { - plugin.settings.basePath = value; - plugin.saveSettings(); - plugin.gitManager.updateBasePath(value || ""); - }); - }); - const info = containerEl.createDiv(); - info.setAttr("align", "center"); - info.setText("Debugging and logging:\nYou can always see the logs of this and every other plugin by opening the console with"); - const keys = containerEl.createDiv(); - keys.setAttr("align", "center"); - keys.addClass("obsidian-git-shortcuts"); - if (import_obsidian.Platform.isMacOS === true) { - keys.createEl("kbd", { text: "CMD (\u2318) + OPTION (\u2325) + I" }); + if (callback) { + (function exec() { + setTimeout(function() { + if (editLength > maxEditLength) { + return callback(); + } + if (!execEditLength()) { + exec(); + } + }, 0); + })(); } else { - keys.createEl("kbd", { text: "CTRL + SHIFT + I" }); + while (editLength <= maxEditLength) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } } + }, + pushComponent: function pushComponent(components, added, removed) { + var last2 = components[components.length - 1]; + if (last2 && last2.added === added && last2.removed === removed) { + components[components.length - 1] = { + count: last2.count + 1, + added, + removed + }; + } else { + components.push({ + count: 1, + added, + removed + }); + } + }, + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { + var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { + newPos++; + oldPos++; + commonCount++; + } + if (commonCount) { + basePath.components.push({ + count: commonCount + }); + } + basePath.newPos = newPos; + return oldPos; + }, + equals: function equals(left, right) { + if (this.options.comparator) { + return this.options.comparator(left, right); + } else { + return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); + } + }, + removeEmpty: function removeEmpty(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + return ret; + }, + castInput: function castInput(value) { + return value; + }, + tokenize: function tokenize(value) { + return value.split(""); + }, + join: function join2(chars) { + return chars.join(""); + } +}; +function buildValues(diff2, components, newString, oldString, useLongestToken) { + var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function(value2, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value2.length ? oldValue : value2; + }); + component.value = diff2.join(value); + } else { + component.value = diff2.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff2.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + if (componentPos && components[componentPos - 1].added) { + var tmp = components[componentPos - 1]; + components[componentPos - 1] = components[componentPos]; + components[componentPos] = tmp; + } + } + } + var lastComponent = components[componentLen - 1]; + if (componentLen > 1 && typeof lastComponent.value === "string" && (lastComponent.added || lastComponent.removed) && diff2.equals("", lastComponent.value)) { + components[componentLen - 2].value += lastComponent.value; + components.pop(); + } + return components; +} +function clonePath(path2) { + return { + newPos: path2.newPos, + components: path2.components.slice(0) + }; +} +var characterDiff = new Diff(); +function diffChars(oldStr, newStr, options) { + return characterDiff.diff(oldStr, newStr, options); +} +var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; +var reWhitespace = /\S/; +var wordDiff = new Diff(); +wordDiff.equals = function(left, right) { + if (this.options.ignoreCase) { + left = left.toLowerCase(); + right = right.toLowerCase(); + } + return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); +}; +wordDiff.tokenize = function(value) { + var tokens = value.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/); + for (var i = 0; i < tokens.length - 1; i++) { + if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { + tokens[i] += tokens[i + 2]; + tokens.splice(i + 1, 2); + i--; + } + } + return tokens; +}; +function diffWordsWithSpace(oldStr, newStr, options) { + return wordDiff.diff(oldStr, newStr, options); +} +var lineDiff = new Diff(); +lineDiff.tokenize = function(value) { + var retLines = [], linesAndNewlines = value.split(/(\n|\r\n)/); + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + for (var i = 0; i < linesAndNewlines.length; i++) { + var line = linesAndNewlines[i]; + if (i % 2 && !this.options.newlineIsToken) { + retLines[retLines.length - 1] += line; + } else { + if (this.options.ignoreWhitespace) { + line = line.trim(); + } + retLines.push(line); + } + } + return retLines; +}; +function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); +} +var sentenceDiff = new Diff(); +sentenceDiff.tokenize = function(value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); +}; +var cssDiff = new Diff(); +cssDiff.tokenize = function(value) { + return value.split(/([{}:;,]|\s+)/); +}; +function _typeof(obj) { + "@babel/helpers - typeof"; + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function(obj2) { + return typeof obj2; + }; + } else { + _typeof = function(obj2) { + return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; + }; + } + return _typeof(obj); +} +function _toConsumableArray(arr) { + return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); +} +function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) + return _arrayLikeToArray(arr); +} +function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) + return Array.from(iter); +} +function _unsupportedIterableToArray(o, minLen) { + if (!o) + return; + if (typeof o === "string") + return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) + n = o.constructor.name; + if (n === "Map" || n === "Set") + return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) + return _arrayLikeToArray(o, minLen); +} +function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) + len = arr.length; + for (var i = 0, arr2 = new Array(len); i < len; i++) + arr2[i] = arr[i]; + return arr2; +} +function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); +} +var objectPrototypeToString = Object.prototype.toString; +var jsonDiff = new Diff(); +jsonDiff.useLongestToken = true; +jsonDiff.tokenize = lineDiff.tokenize; +jsonDiff.castInput = function(value) { + var _this$options = this.options, undefinedReplacement = _this$options.undefinedReplacement, _this$options$stringi = _this$options.stringifyReplacer, stringifyReplacer = _this$options$stringi === void 0 ? function(k, v) { + return typeof v === "undefined" ? undefinedReplacement : v; + } : _this$options$stringi; + return typeof value === "string" ? value : JSON.stringify(canonicalize(value, null, null, stringifyReplacer), stringifyReplacer, " "); +}; +jsonDiff.equals = function(left, right) { + return Diff.prototype.equals.call(jsonDiff, left.replace(/,([\r\n])/g, "$1"), right.replace(/,([\r\n])/g, "$1")); +}; +function canonicalize(obj, stack, replacementStack, replacer, key2) { + stack = stack || []; + replacementStack = replacementStack || []; + if (replacer) { + obj = replacer(key2, obj); + } + var i; + for (i = 0; i < stack.length; i += 1) { + if (stack[i] === obj) { + return replacementStack[i]; + } + } + var canonicalizedObj; + if (objectPrototypeToString.call(obj) === "[object Array]") { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack, replacer, key2); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + if (_typeof(obj) === "object" && obj !== null) { + stack.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], _key; + for (_key in obj) { + if (obj.hasOwnProperty(_key)) { + sortedKeys.push(_key); + } + } + sortedKeys.sort(); + for (i = 0; i < sortedKeys.length; i += 1) { + _key = sortedKeys[i]; + canonicalizedObj[_key] = canonicalize(obj[_key], stack, replacementStack, replacer, _key); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; +} +var arrayDiff = new Diff(); +arrayDiff.tokenize = function(value) { + return value.slice(); +}; +arrayDiff.join = arrayDiff.removeEmpty = function(value) { + return value; +}; +function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + if (!options) { + options = {}; + } + if (typeof options.context === "undefined") { + options.context = 4; + } + var diff2 = diffLines(oldStr, newStr, options); + if (!diff2) { + return; + } + diff2.push({ + value: "", + lines: [] + }); + function contextLines(lines) { + return lines.map(function(entry) { + return " " + entry; + }); + } + var hunks = []; + var oldRangeStart = 0, newRangeStart = 0, curRange = [], oldLine = 1, newLine = 1; + var _loop = function _loop2(i2) { + var current = diff2[i2], lines = current.lines || current.value.replace(/\n$/, "").split("\n"); + current.lines = lines; + if (current.added || current.removed) { + var _curRange; + if (!oldRangeStart) { + var prev = diff2[i2 - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + if (prev) { + curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + (_curRange = curRange).push.apply(_curRange, _toConsumableArray(lines.map(function(entry) { + return (current.added ? "+" : "-") + entry; + }))); + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + if (oldRangeStart) { + if (lines.length <= options.context * 2 && i2 < diff2.length - 2) { + var _curRange2; + (_curRange2 = curRange).push.apply(_curRange2, _toConsumableArray(contextLines(lines))); + } else { + var _curRange3; + var contextSize = Math.min(lines.length, options.context); + (_curRange3 = curRange).push.apply(_curRange3, _toConsumableArray(contextLines(lines.slice(0, contextSize)))); + var hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + if (i2 >= diff2.length - 2 && lines.length <= options.context) { + var oldEOFNewline = /\n$/.test(oldStr); + var newEOFNewline = /\n$/.test(newStr); + var noNlBeforeAdds = lines.length == 0 && curRange.length > hunk.oldLines; + if (!oldEOFNewline && noNlBeforeAdds && oldStr.length > 0) { + curRange.splice(hunk.oldLines, 0, "\\ No newline at end of file"); + } + if (!oldEOFNewline && !noNlBeforeAdds || !newEOFNewline) { + curRange.push("\\ No newline at end of file"); + } + } + hunks.push(hunk); + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + for (var i = 0; i < diff2.length; i++) { + _loop(i); + } + return { + oldFileName, + newFileName, + oldHeader, + newHeader, + hunks + }; +} +function formatPatch(diff2) { + var ret = []; + if (diff2.oldFileName == diff2.newFileName) { + ret.push("Index: " + diff2.oldFileName); + } + ret.push("==================================================================="); + ret.push("--- " + diff2.oldFileName + (typeof diff2.oldHeader === "undefined" ? "" : " " + diff2.oldHeader)); + ret.push("+++ " + diff2.newFileName + (typeof diff2.newHeader === "undefined" ? "" : " " + diff2.newHeader)); + for (var i = 0; i < diff2.hunks.length; i++) { + var hunk = diff2.hunks[i]; + if (hunk.oldLines === 0) { + hunk.oldStart -= 1; + } + if (hunk.newLines === 0) { + hunk.newStart -= 1; + } + ret.push("@@ -" + hunk.oldStart + "," + hunk.oldLines + " +" + hunk.newStart + "," + hunk.newLines + " @@"); + ret.push.apply(ret, hunk.lines); + } + return ret.join("\n") + "\n"; +} +function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + return formatPatch(structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options)); +} +function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { + return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); +} + +// src/isomorphicGit.ts +var import_obsidian5 = __toModule(require("obsidian")); + +// src/gitManager.ts +init_polyfill_buffer(); +var GitManager = class { + constructor(plugin) { + this.plugin = plugin; + this.app = plugin.app; + } + getVaultPath(path2) { + if (this.plugin.settings.basePath) { + return this.plugin.settings.basePath + "/" + path2; + } else { + return path2; + } + } + getPath(path2, relativeToVault) { + return relativeToVault && this.plugin.settings.basePath.length > 0 ? path2.substring(this.plugin.settings.basePath.length + 1) : path2; + } + _getTreeStructure(children2, beginLength = 0) { + const list = []; + children2 = [...children2]; + while (children2.length > 0) { + const first2 = children2.first(); + const restPath = first2.path.substring(beginLength); + if (restPath.contains("/")) { + const title = restPath.substring(0, restPath.indexOf("/")); + const childrenWithSameTitle = children2.filter((item) => { + return item.path.substring(beginLength).startsWith(title + "/"); + }); + childrenWithSameTitle.forEach((item) => children2.remove(item)); + list.push({ + title, + path: first2.path.substring(0, restPath.indexOf("/") + beginLength), + children: this._getTreeStructure(childrenWithSameTitle, (beginLength > 0 ? beginLength + title.length : title.length) + 1) + }); + } else { + list.push({ title: restPath, statusResult: first2, path: first2.path }); + children2.remove(first2); + } + } + return list; + } + simplify(tree) { + var _a2, _b, _c, _d; + for (const node of tree) { + const singleChild = ((_a2 = node.children) == null ? void 0 : _a2.length) == 1; + const singleChildIsDir = ((_c = (_b = node.children) == null ? void 0 : _b.first()) == null ? void 0 : _c.statusResult) == void 0; + if (node.children != void 0 && singleChild && singleChildIsDir) { + node.title += "/" + node.children.first().title; + node.path = node.children.first().path; + node.children = node.children.first().children; + } else if (node.children != void 0) { + this.simplify(node.children); + } + (_d = node.children) == null ? void 0 : _d.sort((a, b) => { + const dirCompare = (b.statusResult == void 0 ? 1 : 0) - (a.statusResult == void 0 ? 1 : 0); + if (dirCompare != 0) { + return dirCompare; + } else { + return a.title.localeCompare(b.title); + } + }); + } + return tree.sort((a, b) => { + const dirCompare = (b.statusResult == void 0 ? 1 : 0) - (a.statusResult == void 0 ? 1 : 0); + if (dirCompare != 0) { + return dirCompare; + } else { + return a.title.localeCompare(b.title); + } + }); + } + getTreeStructure(children2) { + const tree = this._getTreeStructure(children2); + const res = this.simplify(tree); + return res; + } + async formatCommitMessage(template) { + let status2; + if (template.includes("{{numFiles}}")) { + status2 = await this.status(); + const numFiles = status2.staged.length; + template = template.replace("{{numFiles}}", String(numFiles)); + } + if (template.includes("{{hostname}}")) { + const hostname = this.plugin.localStorage.getHostname() || ""; + template = template.replace("{{hostname}}", hostname); + } + if (template.includes("{{files}}")) { + status2 = status2 != null ? status2 : await this.status(); + const changeset = {}; + status2.staged.forEach((value) => { + if (value.index in changeset) { + changeset[value.index].push(value.path); + } else { + changeset[value.index] = [value.path]; + } + }); + const chunks = []; + for (const [action, files2] of Object.entries(changeset)) { + chunks.push(action + " " + files2.join(" ")); + } + const files = chunks.join(", "); + template = template.replace("{{files}}", files); + } + const moment = window.moment; + template = template.replace("{{date}}", moment().format(this.plugin.settings.commitDateFormat)); + if (this.plugin.settings.listChangedFilesInMessageBody) { + template = template + "\n\nAffected files:\n" + (status2 != null ? status2 : await this.status()).staged.map((e) => e.path).join("\n"); + } + return template; } }; -// src/statusBar.ts +// src/myAdapter.ts +init_polyfill_buffer(); var import_obsidian2 = __toModule(require("obsidian")); +var MyAdapter = class { + constructor(vault, plugin) { + this.plugin = plugin; + this.promises = {}; + this.adapter = vault.adapter; + this.vault = vault; + this.promises.readFile = this.readFile.bind(this); + this.promises.writeFile = this.writeFile.bind(this); + this.promises.readdir = this.readdir.bind(this); + this.promises.mkdir = this.mkdir.bind(this); + this.promises.rmdir = this.rmdir.bind(this); + this.promises.stat = this.stat.bind(this); + this.promises.unlink = this.unlink.bind(this); + this.promises.lstat = this.lstat.bind(this); + this.promises.readlink = this.readlink.bind(this); + this.promises.symlink = this.symlink.bind(this); + } + async readFile(path2, opts) { + var _a2; + this.maybeLog("Read: " + path2 + JSON.stringify(opts)); + if (opts == "utf8" || opts.encoding == "utf8") { + const file = this.vault.getAbstractFileByPath(path2); + if (file instanceof import_obsidian2.TFile) { + this.maybeLog("Reuse"); + return this.vault.read(file); + } else { + return this.adapter.read(path2); + } + } else { + if (path2.endsWith(".git/index")) { + return (_a2 = this.index) != null ? _a2 : this.adapter.readBinary(path2); + } + const file = this.vault.getAbstractFileByPath(path2); + if (file instanceof import_obsidian2.TFile) { + this.maybeLog("Reuse"); + return this.vault.readBinary(file); + } else { + return this.adapter.readBinary(path2); + } + } + } + async writeFile(path2, data) { + this.maybeLog("Write: " + path2); + if (typeof data === "string") { + const file = this.vault.getAbstractFileByPath(path2); + if (file instanceof import_obsidian2.TFile) { + return this.vault.modify(file, data); + } else { + return this.adapter.write(path2, data); + } + } else { + if (path2.endsWith(".git/index")) { + this.index = data; + this.indexmtime = Date.now(); + } else { + const file = this.vault.getAbstractFileByPath(path2); + if (file instanceof import_obsidian2.TFile) { + return this.vault.modifyBinary(file, data); + } else { + return this.adapter.writeBinary(path2, data); + } + } + } + } + async readdir(path2) { + if (path2 === ".") + path2 = "/"; + const res = await this.adapter.list(path2); + const all = [...res.files, ...res.folders]; + let formattedAll; + if (path2 !== "/") { + formattedAll = all.map((e) => (0, import_obsidian2.normalizePath)(e.substring(path2.length))); + } else { + formattedAll = all; + } + return formattedAll; + } + async mkdir(path2) { + return this.adapter.mkdir(path2); + } + async rmdir(path2, opts) { + var _a2, _b; + return this.adapter.rmdir(path2, (_b = (_a2 = opts == null ? void 0 : opts.options) == null ? void 0 : _a2.recursive) != null ? _b : false); + } + async stat(path2) { + if (path2.endsWith(".git/index")) { + if (this.index !== void 0 && this.indexctime != void 0 && this.indexmtime != void 0) { + return { + isFile: () => true, + isDirectory: () => false, + isSymbolicLink: () => false, + size: this.index.length, + type: "file", + ctimeMs: this.indexctime, + mtimeMs: this.indexmtime + }; + } else { + const stat = await this.adapter.stat(path2); + if (stat == void 0) { + throw { "code": "ENOENT" }; + } + this.indexctime = stat.ctime; + this.indexmtime = stat.mtime; + return { + ctimeMs: stat.ctime, + mtimeMs: stat.mtime, + size: stat.size, + type: "file", + isFile: () => true, + isDirectory: () => false, + isSymbolicLink: () => false + }; + } + } + if (path2 === ".") + path2 = "/"; + const file = this.vault.getAbstractFileByPath(path2); + this.maybeLog("Stat: " + path2); + if (file instanceof import_obsidian2.TFile) { + this.maybeLog("Reuse stat"); + return { + ctimeMs: file.stat.ctime, + mtimeMs: file.stat.mtime, + size: file.stat.size, + type: "file", + isFile: () => true, + isDirectory: () => false, + isSymbolicLink: () => false + }; + } else { + const stat = await this.adapter.stat(path2); + if (stat) { + return { + ctimeMs: stat.ctime, + mtimeMs: stat.mtime, + size: stat.size, + type: stat.type === "folder" ? "directory" : stat.type, + isFile: () => stat.type === "file", + isDirectory: () => stat.type === "folder", + isSymbolicLink: () => false + }; + } else { + throw { "code": "ENOENT" }; + } + } + } + async unlink(path2) { + return this.adapter.remove(path2); + } + async lstat(path2) { + return this.stat(path2); + } + async readlink(path2) { + throw new Error(`readlink of (${path2}) is not implemented.`); + } + async symlink(path2) { + throw new Error(`symlink of (${path2}) is not implemented.`); + } + async saveAndClear() { + if (this.index !== void 0) { + await this.adapter.writeBinary(this.plugin.gitManager.getVaultPath(".git/index"), this.index, { + ctime: this.indexctime, + mtime: this.indexmtime + }); + } + this.index = void 0; + this.indexctime = void 0; + this.indexmtime = void 0; + } + maybeLog(text2) { + } +}; // src/types.ts +init_polyfill_buffer(); var PluginState; (function(PluginState2) { PluginState2[PluginState2["idle"] = 0] = "idle"; @@ -7018,298 +19488,801 @@ var PluginState; PluginState2[PluginState2["push"] = 5] = "push"; PluginState2[PluginState2["conflicted"] = 6] = "conflicted"; })(PluginState || (PluginState = {})); +var FileType; +(function(FileType2) { + FileType2[FileType2["staged"] = 0] = "staged"; + FileType2[FileType2["changed"] = 1] = "changed"; + FileType2[FileType2["pulled"] = 2] = "pulled"; +})(FileType || (FileType = {})); -// src/statusBar.ts -var StatusBar = class { - constructor(statusBarEl, plugin) { - this.statusBarEl = statusBarEl; - this.plugin = plugin; - this.messages = []; - this.base = "obsidian-git-statusbar-"; - this.statusBarEl.setAttribute("aria-label-position", "top"); - } - displayMessage(message, timeout) { - this.messages.push({ - message: `Git: ${message.slice(0, 100)}`, - timeout - }); - this.display(); - } - display() { - if (this.messages.length > 0 && !this.currentMessage) { - this.currentMessage = this.messages.shift(); - this.statusBarEl.addClass(this.base + "message"); - this.statusBarEl.ariaLabel = ""; - this.statusBarEl.setText(this.currentMessage.message); - this.lastMessageTimestamp = Date.now(); - } else if (this.currentMessage) { - const messageAge = Date.now() - this.lastMessageTimestamp; - if (messageAge >= this.currentMessage.timeout) { - this.currentMessage = null; - this.lastMessageTimestamp = null; - } - } else { - this.displayState(); - } - } - displayState() { - if (this.statusBarEl.getText().length > 3 || !this.statusBarEl.hasChildNodes()) { - this.statusBarEl.empty(); - this.iconEl = this.statusBarEl.createDiv(); - this.textEl = this.statusBarEl.createDiv(); - this.textEl.style.float = "right"; - this.textEl.style.marginLeft = "5px"; - this.iconEl.style.float = "left"; - } - switch (this.plugin.state) { - case PluginState.idle: - this.displayFromNow(this.plugin.lastUpdate); - break; - case PluginState.status: - this.statusBarEl.ariaLabel = "Checking repository status..."; - (0, import_obsidian2.setIcon)(this.iconEl, "refresh-cw"); - this.statusBarEl.addClass(this.base + "status"); - break; - case PluginState.add: - this.statusBarEl.ariaLabel = "Adding files..."; - (0, import_obsidian2.setIcon)(this.iconEl, "refresh-w"); - this.statusBarEl.addClass(this.base + "add"); - break; - case PluginState.commit: - this.statusBarEl.ariaLabel = "Committing changes..."; - (0, import_obsidian2.setIcon)(this.iconEl, "git-commit"); - this.statusBarEl.addClass(this.base + "commit"); - break; - case PluginState.push: - this.statusBarEl.ariaLabel = "Pushing changes..."; - (0, import_obsidian2.setIcon)(this.iconEl, "upload"); - this.statusBarEl.addClass(this.base + "push"); - break; - case PluginState.pull: - this.statusBarEl.ariaLabel = "Pulling changes..."; - (0, import_obsidian2.setIcon)(this.iconEl, "download"); - this.statusBarEl.addClass(this.base + "pull"); - break; - case PluginState.conflicted: - this.statusBarEl.ariaLabel = "You have conflict files..."; - (0, import_obsidian2.setIcon)(this.iconEl, "alert-circle"); - this.statusBarEl.addClass(this.base + "conflict"); - break; - default: - this.statusBarEl.ariaLabel = "Failed on initialization!"; - (0, import_obsidian2.setIcon)(this.iconEl, "alert-triangle"); - this.statusBarEl.addClass(this.base + "failed-init"); - break; - } - } - displayFromNow(timestamp) { - if (timestamp) { - const moment = window.moment; - const fromNow = moment(timestamp).fromNow(); - this.statusBarEl.ariaLabel = `${this.plugin.offlineMode ? "Offline: " : ""}Last Git update: ${fromNow}`; - } else { - this.statusBarEl.ariaLabel = this.plugin.offlineMode ? "Git is offline" : "Git is ready"; - } - if (this.plugin.offlineMode) { - (0, import_obsidian2.setIcon)(this.iconEl, "globe"); - } else { - (0, import_obsidian2.setIcon)(this.iconEl, "check"); - } - if (this.plugin.settings.changedFilesInStatusBar && this.plugin.cachedStatus) { - this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()); - } - this.statusBarEl.addClass(this.base + "idle"); - } -}; - -// src/ui/modals/changedFilesModal.ts +// src/ui/modals/generalModal.ts +init_polyfill_buffer(); var import_obsidian3 = __toModule(require("obsidian")); -var ChangedFilesModal = class extends import_obsidian3.FuzzySuggestModal { - constructor(plugin, changedFiles) { - super(plugin.app); - this.plugin = plugin; - this.changedFiles = changedFiles; - this.setPlaceholder("Not supported files will be opened by default app!"); - } - getItems() { - return this.changedFiles; - } - getItemText(item) { - if (item.index == "?" && item.working_dir == "U") { - return `Untracked | ${item.vault_path}`; - } - let working_dir = ""; - let index = ""; - if (item.working_dir != " ") - working_dir = `Working dir: ${item.working_dir} `; - if (item.index != " ") - index = `Index: ${item.index}`; - return `${working_dir}${index} | ${item.vault_path}`; - } - onChooseItem(item, _) { - if (this.plugin.app.metadataCache.getFirstLinkpathDest(item.vault_path, "") == null) { - this.app.openWithDefaultApp(item.vault_path); - } else { - this.plugin.app.workspace.openLinkText(item.vault_path, "/"); - } - } +var generalModalConfigDefaults = { + options: [], + placeholder: "", + allowEmpty: false, + onlySelection: false, + initialValue: void 0 }; - -// src/ui/modals/customMessageModal.ts -var import_obsidian4 = __toModule(require("obsidian")); -var CustomMessageModal = class extends import_obsidian4.SuggestModal { - constructor(plugin, fromAutoBackup) { - super(plugin.app); - this.fromAutoBackup = fromAutoBackup; - this.resolve = null; - this.plugin = plugin; - this.setPlaceholder("Type your message and select optional the version with the added date."); +var GeneralModal = class extends import_obsidian3.SuggestModal { + constructor(config) { + super(app); + this.config = { ...generalModalConfigDefaults, ...config }; + this.setPlaceholder(this.config.placeholder); } open() { super.open(); + if (this.config.initialValue != void 0) { + this.inputEl.value = this.config.initialValue; + this.inputEl.dispatchEvent(new Event("input")); + } return new Promise((resolve) => { this.resolve = resolve; }); } + selectSuggestion(value, evt) { + if (this.resolve) { + let res; + if (this.config.allowEmpty && value === " ") + res = ""; + else if (value === "...") + res = void 0; + else + res = value; + this.resolve(res); + } + super.selectSuggestion(value, evt); + } onClose() { if (this.resolve) this.resolve(void 0); } - selectSuggestion(value, evt) { - if (this.resolve) - this.resolve(value); - super.selectSuggestion(value, evt); - } getSuggestions(query) { - const date = window.moment().format(this.plugin.settings.commitDateFormat); - if (query == "") - query = "..."; - return [query, `${date}: ${query}`, `${query}: ${date}`]; + if (this.config.onlySelection) { + return this.config.options; + } else if (this.config.allowEmpty) { + return [query.length > 0 ? query : " ", ...this.config.options]; + } else { + return [query.length > 0 ? query : "...", ...this.config.options]; + } } renderSuggestion(value, el) { - el.innerText = value; + el.setText(value); } - onChooseSuggestion(item, _) { + onChooseSuggestion(item, evt) { } }; -// src/constants.ts -var DEFAULT_SETTINGS = { - commitMessage: "vault backup: {{date}}", - autoCommitMessage: void 0, - commitDateFormat: "YYYY-MM-DD HH:mm:ss", - autoSaveInterval: 0, - autoPushInterval: 0, - autoPullInterval: 0, - autoPullOnBoot: false, - disablePush: false, - pullBeforePush: true, - disablePopups: false, - listChangedFilesInMessageBody: false, - showStatusBar: true, - updateSubmodules: false, - syncMethod: "merge", - gitPath: "", - customMessageOnAutoBackup: false, - autoBackupAfterFileChange: false, - treeStructure: false, - refreshSourceControl: true, - basePath: "", - differentIntervalCommitAndPush: false, - changedFilesInStatusBar: false -}; -var GIT_VIEW_CONFIG = { - type: "git-view", - name: "Source Control", - icon: "git-pull-request" -}; -var DIFF_VIEW_CONFIG = { - type: "diff-view", - name: "Diff View", - icon: "git-pull-request" +// src/utils.ts +init_polyfill_buffer(); +var import_obsidian4 = __toModule(require("obsidian")); +var worthWalking2 = (filepath, root) => { + if (filepath === "." || root == null || root.length === 0 || root === ".") { + return true; + } + if (root.length >= filepath.length) { + return root.startsWith(filepath); + } else { + return filepath.startsWith(root); + } }; +function getNewLeaf(event) { + let leaf; + if (event) { + if (event.button === 0 || event.button === 1) { + const type = import_obsidian4.Keymap.isModEvent(event); + leaf = app.workspace.getLeaf(type); + } + } else { + leaf = app.workspace.getLeaf(false); + } + return leaf; +} -// src/openInGitHub.ts -var import_electron = __toModule(require("electron")); -var import_obsidian5 = __toModule(require("obsidian")); -function openLineInGitHub(editor, file, manager) { - return __async(this, null, function* () { - const { isGitHub, branch, repo, user } = yield getData(manager); - if (isGitHub) { - const from = editor.getCursor("from").line + 1; - const to = editor.getCursor("to").line + 1; - if (from === to) { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/blob/${branch}/${file.path}?plain=1#L${from}`); - } else { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/blob/${branch}/${file.path}?plain=1#L${from}-L${to}`); - } - } else { - new import_obsidian5.Notice("It seems like you are not using GitHub"); - } - }); -} -function openHistoryInGitHub(file, manager) { - return __async(this, null, function* () { - const { isGitHub, branch, repo, user } = yield getData(manager); - if (isGitHub) { - yield import_electron.shell.openExternal(`https://github.com/${user}/${repo}/commits/${branch}/${file.path}`); - } else { - new import_obsidian5.Notice("It seems like you are not using GitHub"); - } - }); -} -function getData(manager) { - return __async(this, null, function* () { - const branchInfo = yield manager.branchInfo(); - const remoteBranch = branchInfo.tracking; - const branch = branchInfo.current; - const remote = remoteBranch.substring(0, remoteBranch.indexOf("/")); - const remoteUrl = yield manager.getConfig(`remote.${remote}.url`); - const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match(/(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^git@github\.com:(.*)\/(.*)\.git$)/); - return { - isGitHub: !!isGitHub, - repo: httpsRepo || sshRepo, - user: httpsUser || sshUser, - branch +// src/isomorphicGit.ts +var IsomorphicGit = class extends GitManager { + constructor(plugin) { + super(plugin); + this.FILE = 0; + this.HEAD = 1; + this.WORKDIR = 2; + this.STAGE = 3; + this.status_mapping = { + "000": " ", + "003": "AD", + "020": "??", + "022": "A ", + "023": "AM", + "100": "D ", + "101": " D", + "103": "MD", + "110": "DA", + "111": " ", + "120": "DA", + "121": " M", + "122": "M ", + "123": "MM" }; + this.noticeLength = 999999; + this.fs = new MyAdapter(this.app.vault, this.plugin); + } + getRepo() { + return { + fs: this.fs, + dir: this.plugin.settings.basePath, + onAuth: () => { + var _a2; + return { + username: this.plugin.settings.username, + password: (_a2 = this.plugin.localStorage.getPassword()) != null ? _a2 : void 0 + }; + }, + onAuthFailure: async () => { + new import_obsidian5.Notice("Authentication failed. Please try with different credentials"); + const username = await new GeneralModal({ placeholder: "Specify your username" }).open(); + if (username) { + const password = await new GeneralModal({ placeholder: "Specify your password/personal access token" }).open(); + if (password) { + this.plugin.settings.username = username; + await this.plugin.saveSettings(); + this.plugin.localStorage.setPassword(password); + return { + username, + password + }; + } + } + return { cancel: true }; + }, + http: { + async request({ + url, + method, + headers, + body + }) { + if (body) { + body = await collect2(body); + body = body.buffer; + } + const res = await (0, import_obsidian5.requestUrl)({ url, method, headers, body, throw: false }); + return { + url, + method, + headers: res.headers, + body: [new Uint8Array(res.arrayBuffer)], + statusCode: res.status, + statusMessage: res.status.toString() + }; + } + } + }; + } + async wrapFS(call) { + try { + const res = await call; + await this.fs.saveAndClear(); + return res; + } catch (error) { + await this.fs.saveAndClear(); + throw error; + } + } + async status() { + const notice = new import_obsidian5.Notice("Getting status...", this.noticeLength); + try { + this.plugin.setState(PluginState.status); + const status2 = (await this.wrapFS(isomorphic_git_default.statusMatrix({ ...this.getRepo() }))).map((row) => this.getFileStatusResult(row)); + const changed = status2.filter((fileStatus) => fileStatus.working_dir !== " "); + const staged = status2.filter((fileStatus) => fileStatus.index !== " " && fileStatus.index !== "U"); + const conflicted = []; + notice.hide(); + return { changed, staged, conflicted }; + } catch (error) { + notice.hide(); + this.plugin.displayError(error); + throw error; + } + } + async commitAll({ message, status: status2, unstagedFiles }) { + try { + await this.stageAll({ status: status2, unstagedFiles }); + return this.commit(message); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async commit(message) { + try { + this.plugin.setState(PluginState.commit); + const formatMessage = await this.formatCommitMessage(message); + const hadConflict = this.plugin.localStorage.getConflict() === "true"; + let parent = void 0; + if (hadConflict) { + const branchInfo = await this.branchInfo(); + parent = [branchInfo.current, branchInfo.tracking]; + } + await this.wrapFS(isomorphic_git_default.commit({ + ...this.getRepo(), + message: formatMessage, + parent + })); + this.plugin.localStorage.setConflict("false"); + return; + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async stage(filepath, relativeToVault) { + const gitPath = this.getPath(filepath, relativeToVault); + let vaultPath; + if (relativeToVault) { + vaultPath = filepath; + } else { + vaultPath = this.getVaultPath(filepath); + } + try { + this.plugin.setState(PluginState.add); + if (await this.app.vault.adapter.exists(vaultPath)) { + await this.wrapFS(isomorphic_git_default.add({ ...this.getRepo(), filepath: gitPath })); + } else { + await this.wrapFS(isomorphic_git_default.remove({ ...this.getRepo(), filepath: gitPath })); + } + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async stageAll({ dir, status: status2, unstagedFiles }) { + try { + if (status2) { + await Promise.all(status2.changed.map((file) => file.working_dir !== "D" ? this.wrapFS(isomorphic_git_default.add({ ...this.getRepo(), filepath: file.path })) : isomorphic_git_default.remove({ ...this.getRepo(), filepath: file.path }))); + } else { + const filesToStage = unstagedFiles != null ? unstagedFiles : await this.getUnstagedFiles(dir != null ? dir : "."); + await Promise.all(filesToStage.map(({ filepath, deleted }) => deleted ? isomorphic_git_default.remove({ ...this.getRepo(), filepath }) : this.wrapFS(isomorphic_git_default.add({ ...this.getRepo(), filepath })))); + } + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async unstage(filepath, relativeToVault) { + try { + this.plugin.setState(PluginState.add); + filepath = this.getPath(filepath, relativeToVault); + await this.wrapFS(isomorphic_git_default.resetIndex({ ...this.getRepo(), filepath })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async unstageAll({ dir, status: status2 }) { + try { + let staged; + if (status2) { + staged = status2.staged.map((file) => file.path); + } else { + const res = await this.getStagedFiles(dir != null ? dir : "."); + staged = res.map(({ filepath }) => filepath); + } + await Promise.all(staged.map((file) => this.unstage(file, false))); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async discard(filepath) { + try { + this.plugin.setState(PluginState.add); + await this.wrapFS(isomorphic_git_default.checkout({ ...this.getRepo(), filepaths: [filepath], force: true })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + getProgressText(action, event) { + let out = `${action} progress:`; + if (event.phase) { + out = `${out} ${event.phase}:`; + } + if (event.loaded) { + out = `${out} ${event.loaded}`; + if (event.total) { + out = `${out} of ${event.total}`; + } + } + return out; + } + resolveRef(ref) { + return this.wrapFS(isomorphic_git_default.resolveRef({ ...this.getRepo(), ref })); + } + async pull() { + const progressNotice = new import_obsidian5.Notice("Initializing pull", this.noticeLength); + try { + this.plugin.setState(PluginState.pull); + const localCommit = await this.resolveRef("HEAD"); + await this.fetch(); + const branchInfo = await this.branchInfo(); + await this.wrapFS(isomorphic_git_default.merge({ + ...this.getRepo(), + ours: branchInfo.current, + theirs: branchInfo.tracking, + abortOnConflict: false + })); + await this.wrapFS(isomorphic_git_default.checkout({ + ...this.getRepo(), + ref: branchInfo.current, + onProgress: (progress) => { + progressNotice.noticeEl.innerText = this.getProgressText("Checkout", progress); + }, + remote: branchInfo.remote + })); + progressNotice.hide(); + const upstreamCommit = await this.resolveRef("HEAD"); + this.plugin.lastUpdate = Date.now(); + const changedFiles = await this.getFileChangesCount(localCommit, upstreamCommit); + new import_obsidian5.Notice("Finished pull"); + return changedFiles.map((file) => ({ + path: file.path, + working_dir: "P", + index: "P", + vault_path: this.getVaultPath(file.path) + })); + } catch (error) { + progressNotice.hide(); + if (error instanceof Errors.MergeConflictError) { + this.plugin.handleConflict(error.data.filepaths.map((file) => this.getVaultPath(file))); + } + this.plugin.displayError(error); + throw error; + } + } + async push() { + if (!await this.canPush()) { + return 0; + } + const progressNotice = new import_obsidian5.Notice("Initializing push", this.noticeLength); + try { + this.plugin.setState(PluginState.status); + const status2 = await this.branchInfo(); + const trackingBranch = status2.tracking; + const currentBranch2 = status2.current; + const numChangedFiles = (await this.getFileChangesCount(currentBranch2, trackingBranch)).length; + this.plugin.setState(PluginState.push); + await this.wrapFS(isomorphic_git_default.push({ + ...this.getRepo(), + onProgress: (progress) => { + progressNotice.noticeEl.innerText = this.getProgressText("Pushing", progress); + } + })); + progressNotice.hide(); + return numChangedFiles; + } catch (error) { + progressNotice.hide(); + this.plugin.displayError(error); + throw error; + } + } + async canPush() { + const status2 = await this.branchInfo(); + const trackingBranch = status2.tracking; + const currentBranch2 = status2.current; + const current = await this.resolveRef(currentBranch2); + const tracking = await this.resolveRef(trackingBranch); + return current != tracking; + } + async checkRequirements() { + const headExists = await this.plugin.app.vault.adapter.exists(`${this.getRepo().dir}/.git/HEAD`); + return headExists ? "valid" : "missing-repo"; + } + async branchInfo() { + var _a2, _b; + try { + const current = await isomorphic_git_default.currentBranch(this.getRepo()) || ""; + const branches = await isomorphic_git_default.listBranches(this.getRepo()); + const remote = (_a2 = await this.getConfig(`branch.${current}.remote`)) != null ? _a2 : "origin"; + const trackingBranch = (_b = await this.getConfig(`branch.${current}.merge`)) == null ? void 0 : _b.split("refs/heads")[1]; + const tracking = trackingBranch ? remote + trackingBranch : void 0; + return { + current, + tracking, + branches, + remote + }; + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async getCurrentRemote() { + var _a2; + const current = await isomorphic_git_default.currentBranch(this.getRepo()) || ""; + const remote = (_a2 = await this.getConfig(`branch.${current}.remote`)) != null ? _a2 : "origin"; + return remote; + } + async checkout(branch2) { + try { + return this.wrapFS(isomorphic_git_default.checkout({ + ...this.getRepo(), + ref: branch2 + })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async createBranch(branch2) { + try { + await this.wrapFS(isomorphic_git_default.branch({ ...this.getRepo(), ref: branch2, checkout: true })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async deleteBranch(branch2) { + try { + await this.wrapFS(isomorphic_git_default.deleteBranch({ ...this.getRepo(), ref: branch2 })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async branchIsMerged(branch2) { + return true; + } + async init() { + try { + await this.wrapFS(isomorphic_git_default.init(this.getRepo())); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async clone(url, dir) { + const progressNotice = new import_obsidian5.Notice("Initializing clone", this.noticeLength); + try { + await this.wrapFS(isomorphic_git_default.clone({ + ...this.getRepo(), + dir, + url, + onProgress: (progress) => { + progressNotice.noticeEl.innerText = this.getProgressText("Cloning", progress); + } + })); + progressNotice.hide(); + } catch (error) { + progressNotice.hide(); + this.plugin.displayError(error); + throw error; + } + } + async setConfig(path2, value) { + try { + return this.wrapFS(isomorphic_git_default.setConfig({ + ...this.getRepo(), + path: path2, + value + })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async getConfig(path2) { + try { + return this.wrapFS(isomorphic_git_default.getConfig({ + ...this.getRepo(), + path: path2 + })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async fetch(remote) { + const progressNotice = new import_obsidian5.Notice("Initializing fetch", this.noticeLength); + try { + const args = { + ...this.getRepo(), + onProgress: (progress) => { + progressNotice.noticeEl.innerText = this.getProgressText("Fetching", progress); + }, + remote: remote != null ? remote : await this.getCurrentRemote() + }; + await this.wrapFS(isomorphic_git_default.fetch(args)); + progressNotice.hide(); + } catch (error) { + this.plugin.displayError(error); + progressNotice.hide(); + throw error; + } + } + async setRemote(name, url) { + try { + await this.wrapFS(isomorphic_git_default.addRemote({ ...this.getRepo(), remote: name, url })); + } catch (error) { + this.plugin.displayError(error); + throw error; + } + } + async getRemoteBranches(remote) { + let remoteBranches = []; + remoteBranches.push(...await this.wrapFS(isomorphic_git_default.listBranches({ ...this.getRepo(), remote }))); + remoteBranches.remove("HEAD"); + remoteBranches = remoteBranches.map((e) => `${remote}/${e}`); + return remoteBranches; + } + async getRemotes() { + return (await this.wrapFS(isomorphic_git_default.listRemotes({ ...this.getRepo() }))).map((remoteUrl) => remoteUrl.remote); + } + async removeRemote(remoteName) { + await this.wrapFS(isomorphic_git_default.deleteRemote({ ...this.getRepo(), remote: remoteName })); + } + async getRemoteUrl(remote) { + return (await this.wrapFS(isomorphic_git_default.listRemotes({ ...this.getRepo() }))).filter((item) => item.remote == remote)[0].url; + } + updateBasePath(basePath) { + this.getRepo().dir = basePath; + } + async updateUpstreamBranch(remoteBranch) { + const [remote, branch2] = remoteBranch.split("/"); + const branchInfo = await this.branchInfo(); + await this.setConfig(`branch.${branchInfo.current}.merge`, `refs/heads/${branch2}`); + await this.setConfig(`branch.${branch2}.remote`, remote); + } + updateGitPath(gitPath) { + return; + } + async getFileChangesCount(commitHash1, commitHash2) { + return this.walkDifference({ walkers: [isomorphic_git_default.TREE({ ref: commitHash1 }), isomorphic_git_default.TREE({ ref: commitHash2 })] }); + } + async walkDifference({ walkers, dir: base }) { + const res = await this.wrapFS(isomorphic_git_default.walk({ + ...this.getRepo(), + trees: walkers, + map: async function(filepath, [A, B]) { + if (!worthWalking2(filepath, base)) { + return null; + } + if (await (A == null ? void 0 : A.type()) === "tree" || await (B == null ? void 0 : B.type()) === "tree") { + return; + } + const Aoid = await (A == null ? void 0 : A.oid()); + const Boid = await (B == null ? void 0 : B.oid()); + let type = "equal"; + if (Aoid !== Boid) { + type = "modify"; + } + if (Aoid === void 0) { + type = "add"; + } + if (Boid === void 0) { + type = "remove"; + } + if (Aoid === void 0 && Boid === void 0) { + console.log("Something weird happened:"); + console.log(A); + console.log(B); + } + if (type === "equal") { + return; + } + return { + path: filepath, + type + }; + } + })); + return res; + } + async getStagedFiles(dir = ".") { + const res = await this.walkDifference({ + walkers: [isomorphic_git_default.TREE({ ref: "HEAD" }), isomorphic_git_default.STAGE()], + dir + }); + return res.map((file) => { + return { + vault_path: this.getVaultPath(file.path), + filepath: file.path + }; + }); + } + async getUnstagedFiles(base = ".") { + const notice = new import_obsidian5.Notice("Getting status...", this.noticeLength); + try { + const repo = this.getRepo(); + const res = await this.wrapFS(isomorphic_git_default.walk({ + ...repo, + trees: [isomorphic_git_default.WORKDIR(), isomorphic_git_default.STAGE()], + map: async function(filepath, [workdir, stage]) { + if (!stage && workdir) { + const isIgnored2 = await isomorphic_git_default.isIgnored({ + ...repo, + filepath + }); + if (isIgnored2) { + return null; + } + } + if (!worthWalking2(filepath, base)) { + return null; + } + const [workdirType, stageType] = await Promise.all([ + workdir && workdir.type(), + stage && stage.type() + ]); + const isBlob = [workdirType, stageType].includes("blob"); + if ((workdirType === "tree" || workdirType === "special") && !isBlob) + return; + if (stageType === "commit") + return null; + if ((stageType === "tree" || stageType === "special") && !isBlob) + return; + const stageOid = stageType === "blob" ? await stage.oid() : void 0; + let workdirOid; + if (workdirType === "blob" && stageType !== "blob") { + workdirOid = "42"; + } else if (workdirType === "blob") { + workdirOid = await workdir.oid(); + } + if (!workdirOid) { + return { + filepath, + deleted: true + }; + } + if (workdirOid !== stageOid) { + return { + filepath, + deleted: false + }; + } + return null; + } + })); + notice.hide(); + return res; + } catch (error) { + notice.hide(); + this.plugin.displayError(error); + throw error; + } + } + async getDiffString(filePath, stagedChanges = false) { + const map = async (file, [A]) => { + if (filePath == file) { + const oid = await A.oid(); + const contents = await isomorphic_git_default.readBlob({ ...this.getRepo(), oid }); + return contents.blob; + } + }; + const stagedBlob = (await isomorphic_git_default.walk({ + ...this.getRepo(), + trees: [isomorphic_git_default.STAGE()], + map + })).first(); + const stagedContent = new TextDecoder().decode(stagedBlob); + if (stagedChanges) { + const headBlob = await readBlob({ ...this.getRepo(), filepath: filePath, oid: await this.resolveRef("HEAD") }); + const headContent = new TextDecoder().decode(headBlob.blob); + const diff2 = createPatch(filePath, headContent, stagedContent); + return diff2; + } else { + let workdirContent; + if (await app.vault.adapter.exists(filePath)) { + workdirContent = await app.vault.adapter.read(filePath); + } else { + workdirContent = ""; + } + const diff2 = createPatch(filePath, stagedContent, workdirContent); + return diff2; + } + } + getFileStatusResult(row) { + const status2 = this.status_mapping[`${row[this.HEAD]}${row[this.WORKDIR]}${row[this.STAGE]}`]; + return { + index: status2[0] == "?" ? "U" : status2[0], + working_dir: status2[1] == "?" ? "U" : status2[1], + path: row[this.FILE], + vault_path: this.getVaultPath(row[this.FILE]) + }; + } +}; +function fromValue2(value) { + let queue = [value]; + return { + next() { + return Promise.resolve({ done: queue.length === 0, value: queue.pop() }); + }, + return() { + queue = []; + return {}; + }, + [Symbol.asyncIterator]() { + return this; + } + }; +} +function getIterator2(iterable) { + if (iterable[Symbol.asyncIterator]) { + return iterable[Symbol.asyncIterator](); + } + if (iterable[Symbol.iterator]) { + return iterable[Symbol.iterator](); + } + if (iterable.next) { + return iterable; + } + return fromValue2(iterable); +} +async function forAwait2(iterable, cb) { + const iter = getIterator2(iterable); + while (true) { + const { value, done } = await iter.next(); + if (value) + await cb(value); + if (done) + break; + } + if (iter.return) + iter.return(); +} +async function collect2(iterable) { + let size = 0; + const buffers = []; + await forAwait2(iterable, (value) => { + buffers.push(value); + size += value.byteLength; }); + const result = new Uint8Array(size); + let nextIndex = 0; + for (const buffer2 of buffers) { + result.set(buffer2, nextIndex); + nextIndex += buffer2.byteLength; + } + return result; } // src/simpleGit.ts +init_polyfill_buffer(); var import_child_process2 = __toModule(require("child_process")); var import_obsidian6 = __toModule(require("obsidian")); var path = __toModule(require("path")); var import_path = __toModule(require("path")); // node_modules/simple-git/dist/esm/index.js +init_polyfill_buffer(); var import_file_exists = __toModule(require_dist()); -var import_debug = __toModule(require_src()); +var import_debug = __toModule(require_browser()); var import_child_process = __toModule(require("child_process")); var import_promise_deferred = __toModule(require_dist2()); var import_promise_deferred2 = __toModule(require_dist2()); var __defProp2 = Object.defineProperty; -var __defProps2 = Object.defineProperties; +var __defProps = Object.defineProperties; var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; -var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; var __getOwnPropNames2 = Object.getOwnPropertyNames; -var __getOwnPropSymbols2 = Object.getOwnPropertySymbols; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __hasOwnProp2 = Object.prototype.hasOwnProperty; -var __propIsEnum2 = Object.prototype.propertyIsEnumerable; -var __defNormalProp2 = (obj, key2, value) => key2 in obj ? __defProp2(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; -var __spreadValues2 = (a, b) => { +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp2(obj, key2, { enumerable: true, configurable: true, writable: true, value }) : obj[key2] = value; +var __spreadValues = (a, b) => { for (var prop in b || (b = {})) if (__hasOwnProp2.call(b, prop)) - __defNormalProp2(a, prop, b[prop]); - if (__getOwnPropSymbols2) - for (var prop of __getOwnPropSymbols2(b)) { - if (__propIsEnum2.call(b, prop)) - __defNormalProp2(a, prop, b[prop]); + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); } return a; }; -var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b)); +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); var __markAsModule2 = (target) => __defProp2(target, "__esModule", { value: true }); -var __esm = (fn, res) => function __init() { +var __esm2 = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res; }; var __commonJS2 = (cb, mod) => function __require() { @@ -7332,7 +20305,7 @@ var __toCommonJS = /* @__PURE__ */ ((cache) => { return cache && cache.get(module2) || (temp = __reExport2(__markAsModule2({}), module2, 1), cache && cache.set(module2, temp), temp); }; })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); -var __async2 = (__this, __arguments, generator) => { +var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { try { @@ -7353,7 +20326,7 @@ var __async2 = (__this, __arguments, generator) => { }); }; var GitError; -var init_git_error = __esm({ +var init_git_error = __esm2({ "src/lib/errors/git-error.ts"() { GitError = class extends Error { constructor(task, message) { @@ -7365,7 +20338,7 @@ var init_git_error = __esm({ } }); var GitResponseError; -var init_git_response_error = __esm({ +var init_git_response_error = __esm2({ "src/lib/errors/git-response-error.ts"() { init_git_error(); GitResponseError = class extends GitError { @@ -7377,7 +20350,7 @@ var init_git_response_error = __esm({ } }); var TaskConfigurationError; -var init_task_configuration_error = __esm({ +var init_task_configuration_error = __esm2({ "src/lib/errors/task-configuration-error.ts"() { init_git_error(); TaskConfigurationError = class extends GitError { @@ -7394,14 +20367,11 @@ function isUserFunction(source) { return typeof source === "function" && source !== NOOP; } function splitOn(input, char) { - const index = input.indexOf(char); - if (index <= 0) { + const index2 = input.indexOf(char); + if (index2 <= 0) { return [input, ""]; } - return [ - input.substr(0, index), - input.substr(index + 1) - ]; + return [input.substr(0, index2), input.substr(index2 + 1)]; } function first(input, offset = 0) { return isArrayLike(input) && input.length > offset ? input[offset] : void 0; @@ -7414,8 +20384,8 @@ function last(input, offset = 0) { function isArrayLike(input) { return !!(input && typeof input.length === "number"); } -function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") { - return input.split(separator).reduce((output, line) => { +function toLinesWithContent(input = "", trimmed2 = true, separator2 = "\n") { + return input.split(separator2).reduce((output, line) => { const lineContent = trimmed2 ? line.trim() : line; if (lineContent) { output.push(lineContent); @@ -7426,8 +20396,8 @@ function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") { function forEachLineWithContent(input, callback) { return toLinesWithContent(input, true).map((line) => callback(line)); } -function folderExists(path3) { - return (0, import_file_exists.exists)(path3, import_file_exists.FOLDER); +function folderExists(path2) { + return (0, import_file_exists.exists)(path2, import_file_exists.FOLDER); } function append(target, item) { if (Array.isArray(target)) { @@ -7445,11 +20415,11 @@ function including(target, item) { } return target; } -function remove(target, item) { +function remove2(target, item) { if (Array.isArray(target)) { - const index = target.indexOf(item); - if (index >= 0) { - target.splice(index, 1); + const index2 = target.indexOf(item); + if (index2 >= 0) { + target.splice(index2, 1); } } else { target.delete(item); @@ -7466,8 +20436,8 @@ function asNumber(source, onNaN = 0) { if (source == null) { return onNaN; } - const num = parseInt(source, 10); - return isNaN(num) ? onNaN : num; + const num2 = parseInt(source, 10); + return isNaN(num2) ? onNaN : num2; } function prefixedArray(input, prefix) { const output = []; @@ -7477,7 +20447,7 @@ function prefixedArray(input, prefix) { return output; } function bufferToString(input) { - return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8"); + return (Array.isArray(input) ? Buffer2.concat(input) : input).toString("utf-8"); } function pick(source, properties) { return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {})); @@ -7488,7 +20458,7 @@ function delay(duration = 0) { var NULL; var NOOP; var objectToString; -var init_util = __esm({ +var init_util = __esm2({ "src/lib/utils/util.ts"() { NULL = "\0"; NOOP = () => { @@ -7516,7 +20486,7 @@ var filterString; var filterStringArray; var filterStringOrStringArray; var filterHasLength; -var init_argument_filters = __esm({ +var init_argument_filters = __esm2({ "src/lib/utils/argument-filters.ts"() { init_util(); filterArray = (input) => { @@ -7540,18 +20510,19 @@ var init_argument_filters = __esm({ } }); var ExitCodes; -var init_exit_codes = __esm({ +var init_exit_codes = __esm2({ "src/lib/utils/exit-codes.ts"() { ExitCodes = /* @__PURE__ */ ((ExitCodes2) => { ExitCodes2[ExitCodes2["SUCCESS"] = 0] = "SUCCESS"; ExitCodes2[ExitCodes2["ERROR"] = 1] = "ERROR"; + ExitCodes2[ExitCodes2["NOT_FOUND"] = -2] = "NOT_FOUND"; ExitCodes2[ExitCodes2["UNCLEAN"] = 128] = "UNCLEAN"; return ExitCodes2; })(ExitCodes || {}); } }); var GitOutputStreams; -var init_git_output_streams = __esm({ +var init_git_output_streams = __esm2({ "src/lib/utils/git-output-streams.ts"() { GitOutputStreams = class { constructor(stdOut, stdErr) { @@ -7566,14 +20537,14 @@ var init_git_output_streams = __esm({ }); var LineParser; var RemoteLineParser; -var init_line_parser = __esm({ +var init_line_parser = __esm2({ "src/lib/utils/line-parser.ts"() { LineParser = class { constructor(regExp, useMatches) { this.matches = []; this.parse = (line, target) => { this.resetMatches(); - if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) { + if (!this._regExp.every((reg, index2) => this.addMatch(reg, index2, line(index2)))) { return false; } return this.useMatches(target, this.prepareMatches()) !== false; @@ -7592,10 +20563,10 @@ var init_line_parser = __esm({ prepareMatches() { return this.matches; } - addMatch(reg, index, line) { + addMatch(reg, index2, line) { const matched = line && reg.exec(line); if (matched) { - this.pushMatch(index, matched); + this.pushMatch(index2, matched); } return !!matched; } @@ -7604,12 +20575,12 @@ var init_line_parser = __esm({ } }; RemoteLineParser = class extends LineParser { - addMatch(reg, index, line) { - return /^remote:\s/.test(String(line)) && super.addMatch(reg, index, line); + addMatch(reg, index2, line) { + return /^remote:\s/.test(String(line)) && super.addMatch(reg, index2, line); } - pushMatch(index, matched) { - if (index > 0 || matched.length > 1) { - super.pushMatch(index, matched); + pushMatch(index2, matched) { + if (index2 > 0 || matched.length > 1) { + super.pushMatch(index2, matched); } } }; @@ -7617,17 +20588,19 @@ var init_line_parser = __esm({ }); function createInstanceConfig(...options) { const baseDir = process.cwd(); - const config = Object.assign(__spreadValues2({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === "object" && o)); + const config = Object.assign(__spreadValues({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === "object" && o)); config.baseDir = config.baseDir || baseDir; + config.trimmed = config.trimmed === true; return config; } var defaultOptions; -var init_simple_git_options = __esm({ +var init_simple_git_options = __esm2({ "src/lib/utils/simple-git-options.ts"() { defaultOptions = { binary: "git", maxConcurrentProcesses: 5, - config: [] + config: [], + trimmed: false }; } }); @@ -7670,7 +20643,7 @@ function trailingFunctionArgument(args, includeNoop = true) { const callback = asFunction(last(args)); return includeNoop || isUserFunction(callback) ? callback : void 0; } -var init_task_options = __esm({ +var init_task_options = __esm2({ "src/lib/utils/task-options.ts"() { init_argument_filters(); init_util(); @@ -7679,7 +20652,7 @@ var init_task_options = __esm({ function callTaskParser(parser3, streams) { return parser3(streams.stdOut, streams.stdErr); } -function parseStringResponse(result, parsers11, texts, trim = true) { +function parseStringResponse(result, parsers12, texts, trim = true) { asArray(texts).forEach((text2) => { for (let lines = toLinesWithContent(text2, trim), i = 0, max = lines.length; i < max; i++) { const line = (offset = 0) => { @@ -7688,12 +20661,12 @@ function parseStringResponse(result, parsers11, texts, trim = true) { } return lines[i + offset]; }; - parsers11.some(({ parse }) => parse(line, result)); + parsers12.some(({ parse: parse2 }) => parse2(line, result)); } }); return result; } -var init_task_parser = __esm({ +var init_task_parser = __esm2({ "src/lib/utils/task-parser.ts"() { init_util(); } @@ -7736,13 +20709,13 @@ __export2(utils_exports, { parseStringResponse: () => parseStringResponse, pick: () => pick, prefixedArray: () => prefixedArray, - remove: () => remove, + remove: () => remove2, splitOn: () => splitOn, toLinesWithContent: () => toLinesWithContent, trailingFunctionArgument: () => trailingFunctionArgument, trailingOptionsArgument: () => trailingOptionsArgument }); -var init_utils = __esm({ +var init_utils = __esm2({ "src/lib/utils/index.ts"() { init_argument_filters(); init_exit_codes(); @@ -7782,8 +20755,8 @@ function checkIsRepoRootTask() { commands, format: "utf-8", onError, - parser(path3) { - return /^\.(git)?$/.test(path3.trim()); + parser(path2) { + return /^\.(git)?$/.test(path2.trim()); } }; } @@ -7802,7 +20775,7 @@ function isNotRepoMessage(error) { var CheckRepoActions; var onError; var parser; -var init_check_is_repo = __esm({ +var init_check_is_repo = __esm2({ "src/lib/tasks/check-is-repo.ts"() { init_utils(); CheckRepoActions = /* @__PURE__ */ ((CheckRepoActions2) => { @@ -7813,7 +20786,7 @@ var init_check_is_repo = __esm({ })(CheckRepoActions || {}); onError = ({ exitCode }, error, done, fail) => { if (exitCode === 128 && isNotRepoMessage(error)) { - return done(Buffer.from("false")); + return done(Buffer2.from("false")); } fail(error); }; @@ -7836,7 +20809,7 @@ var CleanResponse; var removalRegexp; var dryRunRemovalRegexp; var isFolderRegexp; -var init_CleanSummary = __esm({ +var init_CleanSummary = __esm2({ "src/lib/responses/CleanSummary.ts"() { init_utils(); CleanResponse = class { @@ -7891,8 +20864,8 @@ function straightThroughBufferTask(commands) { return { commands, format: "buffer", - parser(buffer) { - return buffer; + parser(buffer2) { + return buffer2; } }; } @@ -7903,7 +20876,7 @@ function isEmptyTask(task) { return task.format === "empty" || !task.commands.length; } var EMPTY_COMMANDS; -var init_task = __esm({ +var init_task = __esm2({ "src/lib/tasks/task.ts"() { init_task_configuration_error(); EMPTY_COMMANDS = []; @@ -7981,7 +20954,7 @@ var CONFIG_ERROR_MODE_REQUIRED; var CONFIG_ERROR_UNKNOWN_OPTION; var CleanOptions; var CleanOptionValues; -var init_clean = __esm({ +var init_clean = __esm2({ "src/lib/tasks/clean.ts"() { init_CleanSummary(); init_utils(); @@ -7999,7 +20972,10 @@ var init_clean = __esm({ CleanOptions2["RECURSIVE"] = "d"; return CleanOptions2; })(CleanOptions || {}); - CleanOptionValues = /* @__PURE__ */ new Set(["i", ...asStringArray(Object.values(CleanOptions))]); + CleanOptionValues = /* @__PURE__ */ new Set([ + "i", + ...asStringArray(Object.values(CleanOptions)) + ]); } }); function configListParser(text2) { @@ -8049,7 +21025,7 @@ function* configParser(text2, requestedKey = null) { } } var ConfigList; -var init_ConfigList = __esm({ +var init_ConfigList = __esm2({ "src/lib/responses/ConfigList.ts"() { init_utils(); ConfigList = class { @@ -8147,7 +21123,7 @@ function config_default() { }; } var GitConfigScope; -var init_config = __esm({ +var init_config = __esm2({ "src/lib/tasks/config.ts"() { init_ConfigList(); init_utils(); @@ -8167,11 +21143,11 @@ function parseGrep(grep) { const paths = /* @__PURE__ */ new Set(); const results = {}; forEachLineWithContent(grep, (input) => { - const [path3, line, preview] = input.split(NULL); - paths.add(path3); - (results[path3] = results[path3] || []).push({ + const [path2, line, preview] = input.split(NULL); + paths.add(path2); + (results[path2] = results[path2] || []).push({ line: asNumber(line), - path: path3, + path: path2, preview }); }); @@ -8208,7 +21184,7 @@ var disallowedOptions; var Query; var _a; var GrepQuery; -var init_grep = __esm({ +var init_grep = __esm2({ "src/lib/tasks/grep.ts"() { init_utils(); init_task(); @@ -8264,7 +21240,7 @@ function isValidResetMode(mode) { } var ResetMode; var ResetModes; -var init_reset = __esm({ +var init_reset = __esm2({ "src/lib/tasks/reset.ts"() { init_task(); ResetMode = /* @__PURE__ */ ((ResetMode2) => { @@ -8326,12 +21302,12 @@ function createLogger(label, verbose, initialStep, infoDebugger = createLog()) { }); } } -var init_git_logger = __esm({ +var init_git_logger = __esm2({ "src/lib/git-logger.ts"() { init_utils(); import_debug.default.formatters.L = (value) => String(filterHasLength(value) ? value.length : "-"); import_debug.default.formatters.B = (value) => { - if (Buffer.isBuffer(value)) { + if (Buffer2.isBuffer(value)) { return value.toString("utf8"); } return objectToString(value); @@ -8340,7 +21316,7 @@ var init_git_logger = __esm({ }); var _TasksPendingQueue; var TasksPendingQueue; -var init_tasks_pending_queue = __esm({ +var init_tasks_pending_queue = __esm2({ "src/lib/runners/tasks-pending-queue.ts"() { init_git_error(); init_git_logger(); @@ -8412,18 +21388,18 @@ function pluginContext(task, commands) { function onErrorReceived(target, logger) { return (err) => { logger(`[ERROR] child process exception %o`, err); - target.push(Buffer.from(String(err.stack), "ascii")); + target.push(Buffer2.from(String(err.stack), "ascii")); }; } function onDataReceived(target, name, logger, output) { - return (buffer) => { - logger(`%s received %L bytes`, name, buffer); - output(`%B`, buffer); - target.push(buffer); + return (buffer2) => { + logger(`%s received %L bytes`, name, buffer2); + output(`%B`, buffer2); + target.push(buffer2); }; } var GitExecutorChain; -var init_git_executor_chain = __esm({ +var init_git_executor_chain = __esm2({ "src/lib/runners/git-executor-chain.ts"() { init_git_error(); init_task(); @@ -8460,7 +21436,7 @@ var init_git_executor_chain = __esm({ return this._chain = this._chain.then(() => this.attemptTask(task)); } attemptTask(task) { - return __async2(this, null, function* () { + return __async(this, null, function* () { const onScheduleComplete = yield this._scheduler.next(); const onQueueComplete = () => this._queue.complete(task); try { @@ -8481,7 +21457,7 @@ var init_git_executor_chain = __esm({ return gitError; } attemptRemoteTask(task, logger) { - return __async2(this, null, function* () { + return __async(this, null, function* () { const args = this._plugins.exec("spawn.args", [...task.commands], pluginContext(task, task.commands)); const raw = yield this.gitResponse(task, this.binary, args, this.outputHandler, logger.step("SPAWN")); const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE")); @@ -8493,7 +21469,7 @@ var init_git_executor_chain = __esm({ }); } attemptEmptyTask(task, logger) { - return __async2(this, null, function* () { + return __async(this, null, function* () { logger(`empty task bypassing child process to call to task's parser`); return task.parser(this); }); @@ -8502,13 +21478,13 @@ var init_git_executor_chain = __esm({ const { exitCode, rejection, stdOut, stdErr } = result; return new Promise((done, fail) => { logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode); - const { error } = this._plugins.exec("task.error", { error: rejection }, __spreadValues2(__spreadValues2({}, pluginContext(task, args)), result)); + const { error } = this._plugins.exec("task.error", { error: rejection }, __spreadValues(__spreadValues({}, pluginContext(task, args)), result)); if (error && task.onError) { logger.info(`exitCode=%s handling with custom error handler`); return task.onError(result, error, (newStdOut) => { logger.info(`custom error handler treated as success`); logger(`custom error returned a %s`, objectToString(newStdOut)); - done(new GitOutputStreams(Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, Buffer.concat(stdErr))); + done(new GitOutputStreams(Array.isArray(newStdOut) ? Buffer2.concat(newStdOut) : newStdOut, Buffer2.concat(stdErr))); }, fail); } if (error) { @@ -8516,11 +21492,11 @@ var init_git_executor_chain = __esm({ return fail(error); } logger.info(`retrieving task output complete`); - done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr))); + done(new GitOutputStreams(Buffer2.concat(stdOut), Buffer2.concat(stdErr))); }); } gitResponse(task, command, args, outputHandler, logger) { - return __async2(this, null, function* () { + return __async(this, null, function* () { const outputLogger = logger.sibling("output"); const spawnOptions = this._plugins.exec("spawn.options", { cwd: this.cwd, @@ -8530,9 +21506,22 @@ var init_git_executor_chain = __esm({ return new Promise((done) => { const stdOut = []; const stdErr = []; - let rejection; logger.info(`%s %o`, command, args); logger("%O", spawnOptions); + let rejection = this._beforeSpawn(task, args); + if (rejection) { + return done({ + stdOut, + stdErr, + exitCode: 9901, + rejection + }); + } + this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), { + kill(reason) { + rejection = reason || rejection; + } + })); const spawned = (0, import_child_process.spawn)(command, args, spawnOptions); spawned.stdout.on("data", onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))); spawned.stderr.on("data", onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))); @@ -8541,7 +21530,7 @@ var init_git_executor_chain = __esm({ logger(`Passing child process stdOut/stdErr to custom outputHandler`); outputHandler(command, spawned.stdout, spawned.stderr, [...args]); } - this._plugins.exec("spawn.after", void 0, __spreadProps2(__spreadValues2({}, pluginContext(task, args)), { + this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), { spawned, close(exitCode, reason) { done({ @@ -8562,6 +21551,15 @@ var init_git_executor_chain = __esm({ }); }); } + _beforeSpawn(task, args) { + let rejection; + this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), { + kill(reason) { + rejection = reason || rejection; + } + })); + return rejection; + } }; } }); @@ -8570,7 +21568,7 @@ __export2(git_executor_exports, { GitExecutor: () => GitExecutor }); var GitExecutor; -var init_git_executor = __esm({ +var init_git_executor = __esm2({ "src/lib/runners/git-executor.ts"() { init_git_executor_chain(); GitExecutor = class { @@ -8602,9 +21600,9 @@ function taskCallback(task, response, callback = NOOP) { response.then(onSuccess, onError2); } function addDeprecationNoticeToError(err) { - let log = (name) => { + let log2 = (name) => { console.warn(`simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`); - log = NOOP; + log2 = NOOP; }; return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {})); function descriptorReducer(all, name) { @@ -8615,28 +21613,28 @@ function addDeprecationNoticeToError(err) { enumerable: false, configurable: false, get() { - log(name); + log2(name); return err.git[name]; } }; return all; } } -var init_task_callback = __esm({ +var init_task_callback = __esm2({ "src/lib/task-callback.ts"() { init_git_response_error(); init_utils(); } }); function changeWorkingDirectoryTask(directory, root) { - return adhocExecTask((instance5) => { + return adhocExecTask((instance6) => { if (!folderExists(directory)) { throw new Error(`Git.cwd: cannot change to non-directory "${directory}"`); } - return (root || instance5).cwd = directory; + return (root || instance6).cwd = directory; }); } -var init_change_working_directory = __esm({ +var init_change_working_directory = __esm2({ "src/lib/tasks/change-working-directory.ts"() { init_utils(); init_task(); @@ -8657,13 +21655,13 @@ function parseCommitResult(stdOut) { return parseStringResponse(result, parsers, stdOut); } var parsers; -var init_parse_commit = __esm({ +var init_parse_commit = __esm2({ "src/lib/parsers/parse-commit.ts"() { init_utils(); parsers = [ - new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch, root, commit]) => { - result.branch = branch; - result.commit = commit; + new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch2, root, commit2]) => { + result.branch = branch2; + result.commit = commit2; result.root = !!root; }), new LineParser(/\s*Author:\s(.+)/i, (result, [author]) => { @@ -8726,7 +21724,7 @@ function commit_default() { return !filterStringOrStringArray(message) && configurationErrorTask(`git.commit: requires the commit message to be supplied as a string/string[]`); } } -var init_commit = __esm({ +var init_commit = __esm2({ "src/lib/tasks/commit.ts"() { init_parse_commit(); init_utils(); @@ -8740,19 +21738,19 @@ function hashObjectTask(filePath, write) { } return straightThroughStringTask(commands, true); } -var init_hash_object = __esm({ +var init_hash_object = __esm2({ "src/lib/tasks/hash-object.ts"() { init_task(); } }); -function parseInit(bare, path3, text2) { +function parseInit(bare, path2, text2) { const response = String(text2).trim(); let result; if (result = initResponseRegex.exec(response)) { - return new InitSummary(bare, path3, false, result[1]); + return new InitSummary(bare, path2, false, result[1]); } if (result = reInitResponseRegex.exec(response)) { - return new InitSummary(bare, path3, true, result[1]); + return new InitSummary(bare, path2, true, result[1]); } let gitDir = ""; const tokens = response.split(" "); @@ -8763,17 +21761,17 @@ function parseInit(bare, path3, text2) { break; } } - return new InitSummary(bare, path3, /^re/i.test(response), gitDir); + return new InitSummary(bare, path2, /^re/i.test(response), gitDir); } var InitSummary; var initResponseRegex; var reInitResponseRegex; -var init_InitSummary = __esm({ +var init_InitSummary = __esm2({ "src/lib/responses/InitSummary.ts"() { InitSummary = class { - constructor(bare, path3, existing, gitDir) { + constructor(bare, path2, existing, gitDir) { this.bare = bare; - this.path = path3; + this.path = path2; this.existing = existing; this.gitDir = gitDir; } @@ -8785,7 +21783,7 @@ var init_InitSummary = __esm({ function hasBareCommand(command) { return command.includes(bareCommand); } -function initTask(bare = false, path3, customArgs) { +function initTask(bare = false, path2, customArgs) { const commands = ["init", ...customArgs]; if (bare && !hasBareCommand(commands)) { commands.splice(1, 0, bareCommand); @@ -8794,12 +21792,12 @@ function initTask(bare = false, path3, customArgs) { commands, format: "utf-8", parser(text2) { - return parseInit(commands.includes("--bare"), path3, text2); + return parseInit(commands.includes("--bare"), path2, text2); } }; } var bareCommand; -var init_init = __esm({ +var init_init = __esm2({ "src/lib/tasks/init.ts"() { init_InitSummary(); bareCommand = "--bare"; @@ -8818,13 +21816,13 @@ function isLogFormat(customArg) { return logFormatRegex.test(customArg); } var logFormatRegex; -var init_log_format = __esm({ +var init_log_format = __esm2({ "src/lib/args/log-format.ts"() { logFormatRegex = /^--(stat|numstat|name-only|name-status)(=|$)/; } }); var DiffSummary; -var init_DiffSummary = __esm({ +var init_DiffSummary = __esm2({ "src/lib/responses/DiffSummary.ts"() { DiffSummary = class { constructor() { @@ -8845,7 +21843,7 @@ var numStatParser; var nameOnlyParser; var nameStatusParser; var diffSummaryParsers; -var init_parse_diff_summary = __esm({ +var init_parse_diff_summary = __esm2({ "src/lib/parsers/parse-diff-summary.ts"() { init_log_format(); init_DiffSummary(); @@ -8935,8 +21933,8 @@ var init_parse_diff_summary = __esm({ } }); function lineBuilder(tokens, fields) { - return fields.reduce((line, field, index) => { - line[field] = tokens[index] || ""; + return fields.reduce((line, field, index2) => { + line[field] = tokens[index2] || ""; return line; }, /* @__PURE__ */ Object.create({ diff: null })); } @@ -8962,7 +21960,7 @@ var START_BOUNDARY; var COMMIT_BOUNDARY; var SPLITTER; var defaultFieldNames; -var init_parse_list_log_summary = __esm({ +var init_parse_list_log_summary = __esm2({ "src/lib/parsers/parse-list-log-summary.ts"() { init_utils(); init_parse_diff_summary(); @@ -9001,7 +21999,7 @@ function validateLogFormatConfig(customArgs) { return configurationErrorTask(`Summary flag ${flags} parsing is not compatible with null termination option '-z'`); } } -var init_diff = __esm({ +var init_diff = __esm2({ "src/lib/tasks/diff.ts"() { init_log_format(); init_parse_diff_summary(); @@ -9015,10 +22013,7 @@ function prettyFormat(format, splitter) { fields.push(field); formatStr.push(String(format[field])); }); - return [ - fields, - formatStr.join(splitter) - ]; + return [fields, formatStr.join(splitter)]; } function userOptions(input) { return Object.keys(input).reduce((out, key2) => { @@ -9049,9 +22044,9 @@ function parseLogOptions(opt = {}, customArgs = []) { if (maxCount) { command.push(`--max-count=${maxCount}`); } - if (opt.from && opt.to) { + if (opt.from || opt.to) { const rangeOperator = opt.symmetric !== false ? "..." : ".."; - suffix.push(`${opt.from}${rangeOperator}${opt.to}`); + suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`); } if (filterString(opt.file)) { suffix.push("--follow", opt.file); @@ -9060,10 +22055,7 @@ function parseLogOptions(opt = {}, customArgs = []) { return { fields, splitter, - commands: [ - ...command, - ...suffix - ] + commands: [...command, ...suffix] }; } function logTask(splitter, fields, customArgs) { @@ -9091,7 +22083,7 @@ function log_default() { } } var excludeOptions; -var init_log = __esm({ +var init_log = __esm2({ "src/lib/tasks/log.ts"() { init_log_format(); init_parse_list_log_summary(); @@ -9118,7 +22110,7 @@ var init_log = __esm({ }); var MergeSummaryConflict; var MergeSummaryDetail; -var init_MergeSummary = __esm({ +var init_MergeSummary = __esm2({ "src/lib/responses/MergeSummary.ts"() { MergeSummaryConflict = class { constructor(reason, file = null, meta) { @@ -9153,7 +22145,7 @@ var init_MergeSummary = __esm({ }); var PullSummary; var PullFailedSummary; -var init_PullSummary = __esm({ +var init_PullSummary = __esm2({ "src/lib/responses/PullSummary.ts"() { PullSummary = class { constructor() { @@ -9210,7 +22202,7 @@ function asObjectCount(source) { }; } var remoteMessagesObjectParsers; -var init_parse_remote_objects = __esm({ +var init_parse_remote_objects = __esm2({ "src/lib/parsers/parse-remote-objects.ts"() { init_utils(); remoteMessagesObjectParsers = [ @@ -9238,7 +22230,7 @@ function parseRemoteMessages(_stdOut, stdErr) { } var parsers2; var RemoteMessageSummary; -var init_parse_remote_messages = __esm({ +var init_parse_remote_messages = __esm2({ "src/lib/parsers/parse-remote-messages.ts"() { init_utils(); init_parse_remote_objects(); @@ -9277,7 +22269,7 @@ var parsers3; var errorParsers; var parsePullDetail; var parsePullResult; -var init_parse_pull = __esm({ +var init_parse_pull = __esm2({ "src/lib/parsers/parse-pull.ts"() { init_PullSummary(); init_utils(); @@ -9330,7 +22322,7 @@ var init_parse_pull = __esm({ var parsers4; var parseMergeResult; var parseMergeDetail; -var init_parse_merge = __esm({ +var init_parse_merge = __esm2({ "src/lib/parsers/parse-merge.ts"() { init_MergeSummary(); init_utils(); @@ -9342,8 +22334,8 @@ var init_parse_merge = __esm({ new LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/, (summary, [reason, file]) => { summary.conflicts.push(new MergeSummaryConflict(reason, file)); }), - new LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef]) => { - summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef })); + new LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef2]) => { + summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef: deleteRef2 })); }), new LineParser(/^CONFLICT\s+\((.+)\):/, (summary, [reason]) => { summary.conflicts.push(new MergeSummaryConflict(reason, null)); @@ -9368,29 +22360,29 @@ function mergeTask(customArgs) { commands: ["merge", ...customArgs], format: "utf-8", parser(stdOut, stdErr) { - const merge = parseMergeResult(stdOut, stdErr); - if (merge.failed) { - throw new GitResponseError(merge); + const merge2 = parseMergeResult(stdOut, stdErr); + if (merge2.failed) { + throw new GitResponseError(merge2); } - return merge; + return merge2; } }; } -var init_merge = __esm({ +var init_merge = __esm2({ "src/lib/tasks/merge.ts"() { init_git_response_error(); init_parse_merge(); init_task(); } }); -function pushResultPushedItem(local, remote, status) { - const deleted = status.includes("deleted"); - const tag = status.includes("tag") || /^refs\/tags/.test(local); - const alreadyUpdated = !status.includes("new"); +function pushResultPushedItem(local, remote, status2) { + const deleted = status2.includes("deleted"); + const tag2 = status2.includes("tag") || /^refs\/tags/.test(local); + const alreadyUpdated = !status2.includes("new"); return { deleted, - tag, - branch: !tag, + tag: tag2, + branch: !tag2, new: !alreadyUpdated, alreadyUpdated, local, @@ -9400,7 +22392,7 @@ function pushResultPushedItem(local, remote, status) { var parsers5; var parsePushResult; var parsePushDetail; -var init_parse_push = __esm({ +var init_parse_push = __esm2({ "src/lib/parsers/parse-push.ts"() { init_utils(); init_parse_remote_messages(); @@ -9409,7 +22401,7 @@ var init_parse_push = __esm({ result.repo = repo; }), new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => { - result.ref = __spreadProps2(__spreadValues2({}, result.ref || {}), { + result.ref = __spreadProps(__spreadValues({}, result.ref || {}), { local }); }), @@ -9417,7 +22409,7 @@ var init_parse_push = __esm({ result.pushed.push(pushResultPushedItem(local, remote, type)); }), new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => { - result.branch = __spreadProps2(__spreadValues2({}, result.branch || {}), { + result.branch = __spreadProps(__spreadValues({}, result.branch || {}), { local, remote, remoteName @@ -9439,7 +22431,7 @@ var init_parse_push = __esm({ parsePushResult = (stdOut, stdErr) => { const pushDetail = parsePushDetail(stdOut, stdErr); const responseDetail = parseRemoteMessages(stdOut, stdErr); - return __spreadValues2(__spreadValues2({}, pushDetail), responseDetail); + return __spreadValues(__spreadValues({}, pushDetail), responseDetail); }; parsePushDetail = (stdOut, stdErr) => { return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]); @@ -9463,7 +22455,7 @@ function pushTask(ref = {}, customArgs) { if (ref.remote) { commands.splice(1, 0, ref.remote); } - remove(commands, "-v"); + remove2(commands, "-v"); append(commands, "--verbose"); append(commands, "--porcelain"); return { @@ -9472,7 +22464,7 @@ function pushTask(ref = {}, customArgs) { parser: parsePushResult }; } -var init_push = __esm({ +var init_push = __esm2({ "src/lib/tasks/push.ts"() { init_parse_push(); init_utils(); @@ -9480,16 +22472,16 @@ var init_push = __esm({ }); var fromPathRegex; var FileStatusSummary; -var init_FileStatusSummary = __esm({ +var init_FileStatusSummary = __esm2({ "src/lib/responses/FileStatusSummary.ts"() { fromPathRegex = /^(.+) -> (.+)$/; FileStatusSummary = class { - constructor(path3, index, working_dir) { - this.path = path3; - this.index = index; + constructor(path2, index2, working_dir) { + this.path = path2; + this.index = index2; this.working_dir = working_dir; - if (index + working_dir === "R") { - const detail = fromPathRegex.exec(path3) || [null, path3, path3]; + if (index2 + working_dir === "R") { + const detail = fromPathRegex.exec(path2) || [null, path2, path2]; this.from = detail[1] || ""; this.path = detail[2] || ""; } @@ -9520,21 +22512,21 @@ function splitLine(result, lineStr) { default: return; } - function data(index, workingDir, path3) { - const raw = `${index}${workingDir}`; + function data(index2, workingDir, path2) { + const raw = `${index2}${workingDir}`; const handler = parsers6.get(raw); if (handler) { - handler(result, path3); + handler(result, path2); } if (raw !== "##" && raw !== "!!") { - result.files.push(new FileStatusSummary(path3.replace(/\0.+$/, ""), index, workingDir)); + result.files.push(new FileStatusSummary(path2.replace(/\0.+$/, ""), index2, workingDir)); } } } var StatusSummary; var parsers6; var parseStatusSummary; -var init_StatusSummary = __esm({ +var init_StatusSummary = __esm2({ "src/lib/responses/StatusSummary.ts"() { init_utils(); init_FileStatusSummary(); @@ -9583,29 +22575,32 @@ var init_StatusSummary = __esm({ ...conflicts("A", "A", "U"), ...conflicts("D", "D", "U"), ...conflicts("U", "A", "D", "U"), - ["##", (result, line) => { - const aheadReg = /ahead (\d+)/; - const behindReg = /behind (\d+)/; - const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/; - const trackingReg = /\.{3}(\S*)/; - const onEmptyBranchReg = /\son\s([\S]+)$/; - let regexResult; - regexResult = aheadReg.exec(line); - result.ahead = regexResult && +regexResult[1] || 0; - regexResult = behindReg.exec(line); - result.behind = regexResult && +regexResult[1] || 0; - regexResult = currentReg.exec(line); - result.current = regexResult && regexResult[1]; - regexResult = trackingReg.exec(line); - result.tracking = regexResult && regexResult[1]; - regexResult = onEmptyBranchReg.exec(line); - result.current = regexResult && regexResult[1] || result.current; - result.detached = /\(no branch\)/.test(line); - }] + [ + "##", + (result, line) => { + const aheadReg = /ahead (\d+)/; + const behindReg = /behind (\d+)/; + const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/; + const trackingReg = /\.{3}(\S*)/; + const onEmptyBranchReg = /\son\s([\S]+)$/; + let regexResult; + regexResult = aheadReg.exec(line); + result.ahead = regexResult && +regexResult[1] || 0; + regexResult = behindReg.exec(line); + result.behind = regexResult && +regexResult[1] || 0; + regexResult = currentReg.exec(line); + result.current = regexResult && regexResult[1]; + regexResult = trackingReg.exec(line); + result.tracking = regexResult && regexResult[1]; + regexResult = onEmptyBranchReg.exec(line); + result.current = regexResult && regexResult[1] || result.current; + result.detached = /\(no branch\)/.test(line); + } + ] ]); parseStatusSummary = function(text2) { const lines = text2.split(NULL); - const status = new StatusSummary(); + const status2 = new StatusSummary(); for (let i = 0, l = lines.length; i < l; ) { let line = lines[i++].trim(); if (!line) { @@ -9614,9 +22609,9 @@ var init_StatusSummary = __esm({ if (line.charAt(0) === "R") { line += NULL + (lines[i++] || ""); } - splitLine(status, line); + splitLine(status2, line); } - return status; + return status2; }; } }); @@ -9638,18 +22633,75 @@ function statusTask(customArgs) { }; } var ignoredOptions; -var init_status = __esm({ +var init_status = __esm2({ "src/lib/tasks/status.ts"() { init_StatusSummary(); ignoredOptions = ["--null", "-z"]; } }); +function versionResponse(major = 0, minor = 0, patch = 0, agent = "", installed = true) { + return Object.defineProperty({ + major, + minor, + patch, + agent, + installed + }, "toString", { + value() { + return `${this.major}.${this.minor}.${this.patch}`; + }, + configurable: false, + enumerable: false + }); +} +function notInstalledResponse() { + return versionResponse(0, 0, 0, "", false); +} +function version_default() { + return { + version() { + return this._runTask({ + commands: ["--version"], + format: "utf-8", + parser: versionParser, + onError(result, error, done, fail) { + if (result.exitCode === -2) { + return done(Buffer2.from(NOT_INSTALLED)); + } + fail(error); + } + }); + } + }; +} +function versionParser(stdOut) { + if (stdOut === NOT_INSTALLED) { + return notInstalledResponse(); + } + return parseStringResponse(versionResponse(0, 0, 0, stdOut), parsers7, stdOut); +} +var NOT_INSTALLED; +var parsers7; +var init_version = __esm2({ + "src/lib/tasks/version.ts"() { + init_utils(); + NOT_INSTALLED = "installed=false"; + parsers7 = [ + new LineParser(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/, (result, [major, minor, patch, agent = ""]) => { + Object.assign(result, versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent)); + }), + new LineParser(/version (\d+)\.(\d+)\.(\D+)(.+)?$/, (result, [major, minor, patch, agent = ""]) => { + Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent)); + }) + ]; + } +}); var simple_git_api_exports = {}; __export2(simple_git_api_exports, { SimpleGitApi: () => SimpleGitApi }); var SimpleGitApi; -var init_simple_git_api = __esm({ +var init_simple_git_api = __esm2({ "src/lib/simple-git-api.ts"() { init_task_callback(); init_change_working_directory(); @@ -9663,6 +22715,7 @@ var init_simple_git_api = __esm({ init_push(); init_status(); init_task(); + init_version(); init_utils(); SimpleGitApi = class { constructor(_executor) { @@ -9693,8 +22746,8 @@ var init_simple_git_api = __esm({ } return this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), next); } - hashObject(path3, write) { - return this._runTask(hashObjectTask(path3, write === true), trailingFunctionArgument(arguments)); + hashObject(path2, write) { + return this._runTask(hashObjectTask(path2, write === true), trailingFunctionArgument(arguments)); } init(bare) { return this._runTask(initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); @@ -9702,11 +22755,11 @@ var init_simple_git_api = __esm({ merge() { return this._runTask(mergeTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); } - mergeFromTo(remote, branch) { - if (!(filterString(remote) && filterString(branch))) { + mergeFromTo(remote, branch2) { + if (!(filterString(remote) && filterString(branch2))) { return this._runTask(configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`)); } - return this._runTask(mergeTask([remote, branch, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments, false)); + return this._runTask(mergeTask([remote, branch2, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments, false)); } outputHandler(handler) { this._executor.outputHandler = handler; @@ -9726,7 +22779,7 @@ var init_simple_git_api = __esm({ return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); } }; - Object.assign(SimpleGitApi.prototype, commit_default(), config_default(), grep_default(), log_default()); + Object.assign(SimpleGitApi.prototype, commit_default(), config_default(), grep_default(), log_default(), version_default()); } }); var scheduler_exports = {}; @@ -9735,7 +22788,7 @@ __export2(scheduler_exports, { }); var createScheduledTask; var Scheduler; -var init_scheduler = __esm({ +var init_scheduler = __esm2({ "src/lib/runners/scheduler.ts"() { init_utils(); init_git_logger(); @@ -9768,7 +22821,7 @@ var init_scheduler = __esm({ this.logger(`Attempting id=%s`, task.id); task.done(() => { this.logger(`Completing id=`, task.id); - remove(this.running, task); + remove2(this.running, task); this.schedule(); }); } @@ -9788,27 +22841,27 @@ __export2(apply_patch_exports, { function applyPatchTask(patches, customArgs) { return straightThroughStringTask(["apply", ...customArgs, ...patches]); } -var init_apply_patch = __esm({ +var init_apply_patch = __esm2({ "src/lib/tasks/apply-patch.ts"() { init_task(); } }); -function branchDeletionSuccess(branch, hash2) { +function branchDeletionSuccess(branch2, hash2) { return { - branch, + branch: branch2, hash: hash2, success: true }; } -function branchDeletionFailure(branch) { +function branchDeletionFailure(branch2) { return { - branch, + branch: branch2, hash: null, success: false }; } var BranchDeletionBatch; -var init_BranchDeleteSummary = __esm({ +var init_BranchDeleteSummary = __esm2({ "src/lib/responses/BranchDeleteSummary.ts"() { BranchDeletionBatch = class { constructor() { @@ -9827,34 +22880,34 @@ function hasBranchDeletionError(data, processExitCode) { } var deleteSuccessRegex; var deleteErrorRegex; -var parsers7; +var parsers8; var parseBranchDeletions; -var init_parse_branch_delete = __esm({ +var init_parse_branch_delete = __esm2({ "src/lib/parsers/parse-branch-delete.ts"() { init_BranchDeleteSummary(); init_utils(); deleteSuccessRegex = /(\S+)\s+\(\S+\s([^)]+)\)/; deleteErrorRegex = /^error[^']+'([^']+)'/m; - parsers7 = [ - new LineParser(deleteSuccessRegex, (result, [branch, hash2]) => { - const deletion = branchDeletionSuccess(branch, hash2); + parsers8 = [ + new LineParser(deleteSuccessRegex, (result, [branch2, hash2]) => { + const deletion = branchDeletionSuccess(branch2, hash2); result.all.push(deletion); - result.branches[branch] = deletion; + result.branches[branch2] = deletion; }), - new LineParser(deleteErrorRegex, (result, [branch]) => { - const deletion = branchDeletionFailure(branch); + new LineParser(deleteErrorRegex, (result, [branch2]) => { + const deletion = branchDeletionFailure(branch2); result.errors.push(deletion); result.all.push(deletion); - result.branches[branch] = deletion; + result.branches[branch2] = deletion; }) ]; parseBranchDeletions = (stdOut, stdErr) => { - return parseStringResponse(new BranchDeletionBatch(), parsers7, [stdOut, stdErr]); + return parseStringResponse(new BranchDeletionBatch(), parsers8, [stdOut, stdErr]); }; } }); var BranchSummaryResult; -var init_BranchSummary = __esm({ +var init_BranchSummary = __esm2({ "src/lib/responses/BranchSummary.ts"() { BranchSummaryResult = class { constructor() { @@ -9863,17 +22916,17 @@ var init_BranchSummary = __esm({ this.current = ""; this.detached = false; } - push(status, detached, name, commit, label) { - if (status === "*") { + push(status2, detached, name, commit2, label) { + if (status2 === "*") { this.detached = detached; this.current = name; } this.all.push(name); this.branches[name] = { - current: status === "*", - linkedWorkTree: status === "+", + current: status2 === "*", + linkedWorkTree: status2 === "+", name, - commit, + commit: commit2, label }; } @@ -9884,19 +22937,19 @@ function branchStatus(input) { return input ? input.charAt(0) : ""; } function parseBranchSummary(stdOut) { - return parseStringResponse(new BranchSummaryResult(), parsers8, stdOut); + return parseStringResponse(new BranchSummaryResult(), parsers9, stdOut); } -var parsers8; -var init_parse_branch = __esm({ +var parsers9; +var init_parse_branch = __esm2({ "src/lib/parsers/parse-branch.ts"() { init_BranchSummary(); init_utils(); - parsers8 = [ - new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name, commit, label]) => { - result.push(branchStatus(current), true, name, commit, label); + parsers9 = [ + new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name, commit2, label]) => { + result.push(branchStatus(current), true, name, commit2, label); }), - new LineParser(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s, (result, [current, name, commit, label]) => { - result.push(branchStatus(current), false, name, commit, label); + new LineParser(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s, (result, [current, name, commit2, label]) => { + result.push(branchStatus(current), false, name, commit2, label); }) ]; } @@ -9956,12 +23009,12 @@ function deleteBranchesTask(branches, forceDelete = false) { } }; } -function deleteBranchTask(branch, forceDelete = false) { +function deleteBranchTask(branch2, forceDelete = false) { const task = { format: "utf-8", - commands: ["branch", "-v", forceDelete ? "-D" : "-d", branch], + commands: ["branch", "-v", forceDelete ? "-D" : "-d", branch2], parser(stdOut, stdErr) { - return parseBranchDeletions(stdOut, stdErr).branches[branch]; + return parseBranchDeletions(stdOut, stdErr).branches[branch2]; }, onError({ exitCode, stdErr, stdOut }, error, _, fail) { if (!hasBranchDeletionError(String(error), exitCode)) { @@ -9972,7 +23025,7 @@ function deleteBranchTask(branch, forceDelete = false) { }; return task; } -var init_branch = __esm({ +var init_branch = __esm2({ "src/lib/tasks/branch.ts"() { init_git_response_error(); init_parse_branch_delete(); @@ -9981,7 +23034,7 @@ var init_branch = __esm({ } }); var parseCheckIgnore; -var init_CheckIgnore = __esm({ +var init_CheckIgnore = __esm2({ "src/lib/responses/CheckIgnore.ts"() { parseCheckIgnore = (text2) => { return text2.split(/\n/g).map((line) => line.trim()).filter((file) => !!file); @@ -9999,7 +23052,7 @@ function checkIgnoreTask(paths) { parser: parseCheckIgnore }; } -var init_check_ignore = __esm({ +var init_check_ignore = __esm2({ "src/lib/tasks/check-ignore.ts"() { init_CheckIgnore(); } @@ -10026,7 +23079,7 @@ function cloneMirrorTask(repo, directory, customArgs) { append(customArgs, "--mirror"); return cloneTask(repo, directory, customArgs); } -var init_clone = __esm({ +var init_clone = __esm2({ "src/lib/tasks/clone.ts"() { init_task(); init_utils(); @@ -10037,15 +23090,17 @@ function parseFetchResult(stdOut, stdErr) { raw: stdOut, remote: null, branches: [], - tags: [] + tags: [], + updated: [], + deleted: [] }; - return parseStringResponse(result, parsers9, [stdOut, stdErr]); + return parseStringResponse(result, parsers10, [stdOut, stdErr]); } -var parsers9; -var init_parse_fetch = __esm({ +var parsers10; +var init_parse_fetch = __esm2({ "src/lib/parsers/parse-fetch.ts"() { init_utils(); - parsers9 = [ + parsers10 = [ new LineParser(/From (.+)$/, (result, [remote]) => { result.remote = remote; }), @@ -10060,6 +23115,19 @@ var init_parse_fetch = __esm({ name, tracking }); + }), + new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/, (result, [tracking]) => { + result.deleted.push({ + tracking + }); + }), + new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [from, to, name, tracking]) => { + result.updated.push({ + name, + tracking, + to, + from + }); }) ]; } @@ -10071,10 +23139,10 @@ __export2(fetch_exports, { function disallowedCommand2(command) { return /^--upload-pack(=|$)/.test(command); } -function fetchTask(remote, branch, customArgs) { +function fetchTask(remote, branch2, customArgs) { const commands = ["fetch", ...customArgs]; - if (remote && branch) { - commands.push(remote, branch); + if (remote && branch2) { + commands.push(remote, branch2); } const banned = commands.find(disallowedCommand2); if (banned) { @@ -10086,20 +23154,20 @@ function fetchTask(remote, branch, customArgs) { parser: parseFetchResult }; } -var init_fetch = __esm({ +var init_fetch = __esm2({ "src/lib/tasks/fetch.ts"() { init_parse_fetch(); init_task(); } }); function parseMoveResult(stdOut) { - return parseStringResponse({ moves: [] }, parsers10, stdOut); + return parseStringResponse({ moves: [] }, parsers11, stdOut); } -var parsers10; -var init_parse_move = __esm({ +var parsers11; +var init_parse_move = __esm2({ "src/lib/parsers/parse-move.ts"() { init_utils(); - parsers10 = [ + parsers11 = [ new LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => { result.moves.push({ from, to }); }) @@ -10117,7 +23185,7 @@ function moveTask(from, to) { parser: parseMoveResult }; } -var init_move = __esm({ +var init_move = __esm2({ "src/lib/tasks/move.ts"() { init_parse_move(); init_utils(); @@ -10127,10 +23195,10 @@ var pull_exports = {}; __export2(pull_exports, { pullTask: () => pullTask }); -function pullTask(remote, branch, customArgs) { +function pullTask(remote, branch2, customArgs) { const commands = ["pull", ...customArgs]; - if (remote && branch) { - commands.splice(1, 0, remote, branch); + if (remote && branch2) { + commands.splice(1, 0, remote, branch2); } return { commands, @@ -10147,7 +23215,7 @@ function pullTask(remote, branch, customArgs) { } }; } -var init_pull = __esm({ +var init_pull = __esm2({ "src/lib/tasks/pull.ts"() { init_git_response_error(); init_parse_pull(); @@ -10177,7 +23245,7 @@ function parseGetRemotesVerbose(text2) { function forEach(text2, handler) { forEachLineWithContent(text2, (line) => handler(line.split(/\s+/))); } -var init_GetRemoteSummary = __esm({ +var init_GetRemoteSummary = __esm2({ "src/lib/responses/GetRemoteSummary.ts"() { init_utils(); } @@ -10221,7 +23289,7 @@ function remoteTask(customArgs = []) { function removeRemoteTask(remoteName) { return straightThroughStringTask(["remote", "remove", remoteName]); } -var init_remote = __esm({ +var init_remote = __esm2({ "src/lib/tasks/remote.ts"() { init_GetRemoteSummary(); init_task(); @@ -10241,7 +23309,7 @@ function stashListTask(opt = {}, customArgs) { parser: parser3 }; } -var init_stash_list = __esm({ +var init_stash_list = __esm2({ "src/lib/tasks/stash-list.ts"() { init_log_format(); init_parse_list_log_summary(); @@ -10256,8 +23324,8 @@ __export2(sub_module_exports, { subModuleTask: () => subModuleTask, updateSubModuleTask: () => updateSubModuleTask }); -function addSubModuleTask(repo, path3) { - return subModuleTask(["add", repo, path3]); +function addSubModuleTask(repo, path2) { + return subModuleTask(["add", repo, path2]); } function initSubModuleTask(customArgs) { return subModuleTask(["init", ...customArgs]); @@ -10272,7 +23340,7 @@ function subModuleTask(customArgs) { function updateSubModuleTask(customArgs) { return subModuleTask(["update", ...customArgs]); } -var init_sub_module = __esm({ +var init_sub_module = __esm2({ "src/lib/tasks/sub-module.ts"() { init_task(); } @@ -10299,7 +23367,7 @@ function toNumber(input) { } var TagList; var parseTagList; -var init_TagList = __esm({ +var init_TagList = __esm2({ "src/lib/responses/TagList.ts"() { TagList = class { constructor(all, latest) { @@ -10317,15 +23385,15 @@ var init_TagList = __esm({ return singleSorted(toNumber(partsA[0]), toNumber(partsB[0])); } for (let i = 0, l = Math.max(partsA.length, partsB.length); i < l; i++) { - const diff = sorted(toNumber(partsA[i]), toNumber(partsB[i])); - if (diff) { - return diff; + const diff2 = sorted(toNumber(partsA[i]), toNumber(partsB[i])); + if (diff2) { + return diff2; } } return 0; }); } - const latest = customSort ? tags[0] : [...tags].reverse().find((tag) => tag.indexOf(".") >= 0); + const latest = customSort ? tags[0] : [...tags].reverse().find((tag2) => tag2.indexOf(".") >= 0); return new TagList(tags, latest); }; } @@ -10364,7 +23432,7 @@ function addAnnotatedTagTask(name, tagMessage) { } }; } -var init_tag = __esm({ +var init_tag = __esm2({ "src/lib/tasks/tag.ts"() { init_TagList(); } @@ -10387,7 +23455,12 @@ var require_git = __commonJS2({ trailingOptionsArgument: trailingOptionsArgument2 } = (init_utils(), __toCommonJS(utils_exports)); var { applyPatchTask: applyPatchTask2 } = (init_apply_patch(), __toCommonJS(apply_patch_exports)); - var { branchTask: branchTask2, branchLocalTask: branchLocalTask2, deleteBranchesTask: deleteBranchesTask2, deleteBranchTask: deleteBranchTask2 } = (init_branch(), __toCommonJS(branch_exports)); + var { + branchTask: branchTask2, + branchLocalTask: branchLocalTask2, + deleteBranchesTask: deleteBranchesTask2, + deleteBranchTask: deleteBranchTask2 + } = (init_branch(), __toCommonJS(branch_exports)); var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports)); var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports)); var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports)); @@ -10398,14 +23471,26 @@ var require_git = __commonJS2({ var { moveTask: moveTask2 } = (init_move(), __toCommonJS(move_exports)); var { pullTask: pullTask2 } = (init_pull(), __toCommonJS(pull_exports)); var { pushTagsTask: pushTagsTask2 } = (init_push(), __toCommonJS(push_exports)); - var { addRemoteTask: addRemoteTask2, getRemotesTask: getRemotesTask2, listRemotesTask: listRemotesTask2, remoteTask: remoteTask2, removeRemoteTask: removeRemoteTask2 } = (init_remote(), __toCommonJS(remote_exports)); + var { + addRemoteTask: addRemoteTask2, + getRemotesTask: getRemotesTask2, + listRemotesTask: listRemotesTask2, + remoteTask: remoteTask2, + removeRemoteTask: removeRemoteTask2 + } = (init_remote(), __toCommonJS(remote_exports)); var { getResetMode: getResetMode2, resetTask: resetTask2 } = (init_reset(), __toCommonJS(reset_exports)); var { stashListTask: stashListTask2 } = (init_stash_list(), __toCommonJS(stash_list_exports)); - var { addSubModuleTask: addSubModuleTask2, initSubModuleTask: initSubModuleTask2, subModuleTask: subModuleTask2, updateSubModuleTask: updateSubModuleTask2 } = (init_sub_module(), __toCommonJS(sub_module_exports)); + var { + addSubModuleTask: addSubModuleTask2, + initSubModuleTask: initSubModuleTask2, + subModuleTask: subModuleTask2, + updateSubModuleTask: updateSubModuleTask2 + } = (init_sub_module(), __toCommonJS(sub_module_exports)); var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports)); var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports)); function Git2(options, plugins) { this._executor = new GitExecutor2(options.binary, options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins); + this._trimmed = options.trimmed; } (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2; Git2.prototype.customBinary = function(command) { @@ -10446,11 +23531,11 @@ var require_git = __commonJS2({ }); }); }; - Git2.prototype.pull = function(remote, branch, options, then) { - return this._runTask(pullTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + Git2.prototype.pull = function(remote, branch2, options, then) { + return this._runTask(pullTask2(filterType2(remote, filterString2), filterType2(branch2, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); }; - Git2.prototype.fetch = function(remote, branch) { - return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + Git2.prototype.fetch = function(remote, branch2) { + return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch2, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); }; Git2.prototype.silent = function(silence) { console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"); @@ -10465,12 +23550,12 @@ var require_git = __commonJS2({ Git2.prototype.reset = function(mode) { return this._runTask(resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); }; - Git2.prototype.revert = function(commit) { + Git2.prototype.revert = function(commit2) { const next = trailingFunctionArgument2(arguments); - if (typeof commit !== "string") { + if (typeof commit2 !== "string") { return this._runTask(configurationErrorTask2("Commit must be a string"), next); } - return this._runTask(straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit]), next); + return this._runTask(straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit2]), next); }; Git2.prototype.addTag = function(name) { const task = typeof name === "string" ? addTagTask2(name) : configurationErrorTask2("Git.addTag requires a tag name"); @@ -10515,10 +23600,10 @@ var require_git = __commonJS2({ if (!command.length) { return this._runTask(configurationErrorTask2("Raw: must supply one or more command to execute"), next); } - return this._runTask(straightThroughStringTask2(command), next); + return this._runTask(straightThroughStringTask2(command, this._trimmed), next); }; - Git2.prototype.submoduleAdd = function(repo, path3, then) { - return this._runTask(addSubModuleTask2(repo, path3), trailingFunctionArgument2(arguments)); + Git2.prototype.submoduleAdd = function(repo, path2, then) { + return this._runTask(addSubModuleTask2(repo, path2), trailingFunctionArgument2(arguments)); }; Git2.prototype.submoduleUpdate = function(args, then) { return this._runTask(updateSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments)); @@ -10655,6 +23740,30 @@ init_clean(); init_config(); init_grep(); init_reset(); +function abortPlugin(signal) { + if (!signal) { + return; + } + const onSpawnAfter = { + type: "spawn.after", + action(_data, context) { + function kill() { + context.kill(new GitPluginError(void 0, "abort", "Abort signal received")); + } + signal.addEventListener("abort", kill); + context.spawned.on("close", () => signal.removeEventListener("abort", kill)); + } + }; + const onSpawnBefore = { + type: "spawn.before", + action(_data, context) { + if (signal.aborted) { + context.kill(new GitPluginError(void 0, "abort", "Abort already signaled")); + } + } + }; + return [onSpawnBefore, onSpawnAfter]; +} init_utils(); function commandConfigPrefixingPlugin(configuration) { const prefix = prefixedArray(configuration, "-c"); @@ -10709,7 +23818,7 @@ function completionDetectionPlugin({ return { type: "spawn.after", action(_0, _1) { - return __async2(this, arguments, function* (_data, { spawned, close }) { + return __async(this, arguments, function* (_data, { spawned, close }) { var _a2, _b; const events = createEvents(); let deferClose = true; @@ -10737,7 +23846,7 @@ function isTaskError(result) { return !!(result.exitCode && result.stdErr.length); } function getErrorMessage(result) { - return Buffer.concat([...result.stdOut, ...result.stdErr]); + return Buffer2.concat([...result.stdOut, ...result.stdErr]); } function errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) { return (error, result) => { @@ -10756,7 +23865,7 @@ function errorDetectionPlugin(config) { stdOut: context.stdOut, exitCode: context.exitCode }); - if (Buffer.isBuffer(error)) { + if (Buffer2.isBuffer(error)) { return { error: new GitError(void 0, error.toString("utf-8")) }; } return { @@ -10834,11 +23943,13 @@ function spawnOptionsPlugin(spawnOptions) { return { type: "spawn.options", action(data) { - return __spreadValues2(__spreadValues2({}, options), data); + return __spreadValues(__spreadValues({}, options), data); } }; } -function timeoutPlugin({ block }) { +function timeoutPlugin({ + block +}) { if (block > 0) { return { type: "spawn.after", @@ -10882,6 +23993,7 @@ function gitInstanceFactory(baseDir, options) { plugins.add(commandConfigPrefixingPlugin(config.config)); } plugins.add(completionDetectionPlugin(config.completion)); + config.abort && plugins.add(abortPlugin(config.abort)); config.progress && plugins.add(progressMonitorPlugin(config.progress)); config.timeout && plugins.add(timeoutPlugin(config.timeout)); config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions)); @@ -10892,427 +24004,317 @@ function gitInstanceFactory(baseDir, options) { init_git_response_error(); var esm_default = gitInstanceFactory; -// src/gitManager.ts -var GitManager = class { - constructor(plugin) { - this.plugin = plugin; - this.app = plugin.app; - } - getTreeStructure(children2, beginLength = 0) { - let list = []; - children2 = [...children2]; - while (children2.length > 0) { - const first2 = children2.first(); - const restPath = first2.path.substring(beginLength); - if (restPath.contains("/")) { - const title = restPath.substring(0, restPath.indexOf("/")); - const childrenWithSameTitle = children2.filter((item) => { - return item.path.substring(beginLength).startsWith(title + "/"); - }); - childrenWithSameTitle.forEach((item) => children2.remove(item)); - list.push({ - title, - children: this.getTreeStructure(childrenWithSameTitle, (beginLength > 0 ? beginLength + title.length : title.length) + 1) - }); - } else { - list.push({ title: restPath, statusResult: first2 }); - children2.remove(first2); - } - } - return list; - } - formatCommitMessage(template) { - return __async(this, null, function* () { - let status; - if (template.includes("{{numFiles}}")) { - status = yield this.status(); - let numFiles = status.staged.length; - template = template.replace("{{numFiles}}", String(numFiles)); - } - if (template.includes("{{hostname}}")) { - const hostname = localStorage.getItem(this.plugin.manifest.id + ":hostname") || ""; - template = template.replace("{{hostname}}", hostname); - } - if (template.includes("{{files}}")) { - status = status != null ? status : yield this.status(); - let changeset = {}; - status.staged.forEach((value) => { - if (value.index in changeset) { - changeset[value.index].push(value.path); - } else { - changeset[value.index] = [value.path]; - } - }); - let chunks = []; - for (let [action, files2] of Object.entries(changeset)) { - chunks.push(action + " " + files2.join(" ")); - } - let files = chunks.join(", "); - template = template.replace("{{files}}", files); - } - let moment = window.moment; - template = template.replace("{{date}}", moment().format(this.plugin.settings.commitDateFormat)); - if (this.plugin.settings.listChangedFilesInMessageBody) { - template = template + "\n\nAffected files:\n" + (status != null ? status : yield this.status()).staged.map((e) => e.path).join("\n"); - } - return template; - }); - } -}; - // src/simpleGit.ts var SimpleGit = class extends GitManager { constructor(plugin) { super(plugin); } - setGitInstance(ignoreError = false) { - return __async(this, null, function* () { - if (this.isGitInstalled()) { - const adapter = this.app.vault.adapter; - const path3 = adapter.getBasePath(); - let basePath = path3; - if (this.plugin.settings.basePath) { - const exists2 = yield adapter.exists((0, import_obsidian6.normalizePath)(this.plugin.settings.basePath)); - if (exists2) { - basePath = path3 + import_path.sep + this.plugin.settings.basePath; - } else if (!ignoreError) { - new import_obsidian6.Notice("ObsidianGit: Base path does not exist"); - } + async setGitInstance(ignoreError = false) { + if (this.isGitInstalled()) { + const adapter = this.app.vault.adapter; + const path2 = adapter.getBasePath(); + let basePath = path2; + if (this.plugin.settings.basePath) { + const exists2 = await adapter.exists((0, import_obsidian6.normalizePath)(this.plugin.settings.basePath)); + if (exists2) { + basePath = path2 + import_path.sep + this.plugin.settings.basePath; + } else if (!ignoreError) { + new import_obsidian6.Notice("ObsidianGit: Base path does not exist"); } - this.git = esm_default({ - baseDir: basePath, - binary: this.plugin.settings.gitPath || void 0, - config: ["core.quotepath=off"] - }); - this.git.cwd(yield this.git.revparse("--show-toplevel")); } - }); - } - status() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.status); - const status = yield this.git.status((err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - return { - changed: status.files.filter((e) => e.working_dir !== " ").map((e) => { - const res = this.formatPath(e); - return { - path: res.path, - from: res.from, - working_dir: e.working_dir === "?" ? "U" : e.working_dir, - vault_path: this.getVaultPath(res.path) - }; - }), - staged: status.files.filter((e) => e.index !== " " && e.index != "?").map((e) => { - const res = this.formatPath(e, e.index === "R"); - return { - path: res.path, - from: res.from, - index: e.index, - vault_path: this.getVaultPath(res.path) - }; - }), - conflicted: status.conflicted.map((e) => this.formatPath({ - path: e, - from: void 0, - index: void 0, - working_dir: void 0 - }).path) - }; - }); - } - getVaultPath(path3) { - if (this.plugin.settings.basePath) { - return this.plugin.settings.basePath + "/" + path3; - } else { - return path3; + this.git = esm_default({ + baseDir: basePath, + binary: this.plugin.localStorage.getGitPath() || void 0, + config: ["core.quotepath=off"] + }); + this.git.cwd(await this.git.revparse("--show-toplevel")); } } - formatPath(path3, renamed = false) { - function format(path4) { - if (path4 == void 0) + async status() { + this.plugin.setState(PluginState.status); + const status2 = await this.git.status((err) => this.onError(err)); + this.plugin.setState(PluginState.idle); + return { + changed: status2.files.filter((e) => e.working_dir !== " ").map((e) => { + const res = this.formatPath(e); + return { + path: res.path, + from: res.from, + working_dir: e.working_dir === "?" ? "U" : e.working_dir, + vault_path: this.getVaultPath(res.path) + }; + }), + staged: status2.files.filter((e) => e.index !== " " && e.index != "?").map((e) => { + const res = this.formatPath(e, e.index === "R"); + return { + path: res.path, + from: res.from, + index: e.index, + vault_path: this.getVaultPath(res.path) + }; + }), + conflicted: status2.conflicted.map((path2) => this.formatPath({ path: path2 }).path) + }; + } + formatPath(path2, renamed = false) { + function format(path3) { + if (path3 == void 0) return void 0; - if (path4.startsWith('"') && path4.endsWith('"')) { - return path4.substring(1, path4.length - 1); + if (path3.startsWith('"') && path3.endsWith('"')) { + return path3.substring(1, path3.length - 1); } else { - return path4; + return path3; } } if (renamed) { return { - from: format(path3.from), - path: format(path3.path) + from: format(path2.from), + path: format(path2.path) }; } else { return { - path: format(path3.path) + path: format(path2.path) }; } } - commitAll(message) { - return __async(this, null, function* () { - if (this.plugin.settings.updateSubmodules) { - this.plugin.setState(PluginState.commit); - yield new Promise((resolve, reject) => __async(this, null, function* () { - this.git.outputHandler((cmd, stdout, stderr, args) => __async(this, null, function* () { - if (!(args.contains("submodule") && args.contains("foreach"))) - return; - let body = ""; - let root = this.app.vault.adapter.getBasePath() + (this.plugin.settings.basePath ? "/" + this.plugin.settings.basePath : ""); - stdout.on("data", (chunk) => { - body += chunk.toString("utf8"); - }); - stdout.on("end", () => __async(this, null, function* () { - let submods = body.split("\n"); - submods = submods.map((i) => { - let submod = i.match(/'([^']*)'/); - if (submod != void 0) { - return root + "/" + submod[1] + import_path.sep; - } - }); - submods.reverse(); - for (const item of submods) { - if (item != void 0) { - yield this.git.cwd({ path: item, root: false }).add("-A", (err) => this.onError(err)); - yield this.git.cwd({ path: item, root: false }).commit(yield this.formatCommitMessage(message), (err) => this.onError(err)); - } - } - resolve(); - })); - })); - yield this.git.subModule(["foreach", "--recursive", ""]); - this.git.outputHandler(() => { - }); - })); - } - this.plugin.setState(PluginState.add); - yield this.git.add("-A", (err) => this.onError(err)); + async commitAll({ message }) { + if (this.plugin.settings.updateSubmodules) { this.plugin.setState(PluginState.commit); - return (yield this.git.commit(yield this.formatCommitMessage(message), (err) => this.onError(err))).summary.changes; - }); - } - commit(message) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.commit); - const res = (yield this.git.commit(yield this.formatCommitMessage(message), (err) => this.onError(err))).summary.changes; - this.plugin.setState(PluginState.idle); - return res; - }); - } - stage(path3, relativeToVault) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - path3 = this.getPath(path3, relativeToVault); - yield this.git.add(["--", path3], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - stageAll() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.add("-A", (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - unstageAll() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.reset([], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - unstage(path3, relativeToVault) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - path3 = this.getPath(path3, relativeToVault); - yield this.git.reset(["--", path3], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - discard(filepath) { - return __async(this, null, function* () { - this.plugin.setState(PluginState.add); - yield this.git.checkout(["--", filepath], (err) => this.onError(err)); - this.plugin.setState(PluginState.idle); - }); - } - pull() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.pull); - if (this.plugin.settings.updateSubmodules) - yield this.git.subModule(["update", "--remote", "--merge", "--recursive"], (err) => this.onError(err)); - const branchInfo = yield this.branchInfo(); - const localCommit = yield this.git.revparse([branchInfo.current], (err) => this.onError(err)); - yield this.git.fetch((err) => this.onError(err)); - const upstreamCommit = yield this.git.revparse([branchInfo.tracking], (err) => this.onError(err)); - if (localCommit !== upstreamCommit) { - if (this.plugin.settings.syncMethod === "merge" || this.plugin.settings.syncMethod === "rebase") { - try { - switch (this.plugin.settings.syncMethod) { - case "merge": - yield this.git.merge([branchInfo.tracking]); - break; - case "rebase": - yield this.git.rebase([branchInfo.tracking]); - } - } catch (err) { - this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${err.message}`); + await new Promise(async (resolve, reject) => { + this.git.outputHandler(async (cmd, stdout, stderr, args) => { + if (!(args.contains("submodule") && args.contains("foreach"))) return; + let body = ""; + const root = this.app.vault.adapter.getBasePath() + (this.plugin.settings.basePath ? "/" + this.plugin.settings.basePath : ""); + stdout.on("data", (chunk) => { + body += chunk.toString("utf8"); + }); + stdout.on("end", async () => { + const submods = body.split("\n"); + const strippedSubmods = submods.map((i) => { + const submod = i.match(/'([^']*)'/); + if (submod != void 0) { + return root + "/" + submod[1] + import_path.sep; + } + }); + strippedSubmods.reverse(); + for (const item of strippedSubmods) { + if (item != void 0) { + await this.git.cwd({ path: item, root: false }).add("-A", (err) => this.onError(err)); + await this.git.cwd({ path: item, root: false }).commit(await this.formatCommitMessage(message), (err) => this.onError(err)); + } + } + resolve(); + }); + }); + await this.git.subModule(["foreach", "--recursive", ""]); + this.git.outputHandler(() => { + }); + }); + } + this.plugin.setState(PluginState.add); + await this.git.add("-A", (err) => this.onError(err)); + this.plugin.setState(PluginState.commit); + return (await this.git.commit(await this.formatCommitMessage(message), (err) => this.onError(err))).summary.changes; + } + async commit(message) { + this.plugin.setState(PluginState.commit); + const res = (await this.git.commit(await this.formatCommitMessage(message), (err) => this.onError(err))).summary.changes; + this.plugin.setState(PluginState.idle); + return res; + } + async stage(path2, relativeToVault) { + this.plugin.setState(PluginState.add); + path2 = this.getPath(path2, relativeToVault); + await this.git.add(["--", path2], (err) => this.onError(err)); + this.plugin.setState(PluginState.idle); + } + async stageAll({ dir }) { + this.plugin.setState(PluginState.add); + await this.git.add(dir != null ? dir : "-A", (err) => this.onError(err)); + this.plugin.setState(PluginState.idle); + } + async unstageAll() { + this.plugin.setState(PluginState.add); + await this.git.reset([], (err) => this.onError(err)); + this.plugin.setState(PluginState.idle); + } + async unstage(path2, relativeToVault) { + this.plugin.setState(PluginState.add); + path2 = this.getPath(path2, relativeToVault); + await this.git.reset(["--", path2], (err) => this.onError(err)); + this.plugin.setState(PluginState.idle); + } + async discard(filepath) { + this.plugin.setState(PluginState.add); + await this.git.checkout(["--", filepath], (err) => this.onError(err)); + this.plugin.setState(PluginState.idle); + } + async pull() { + this.plugin.setState(PluginState.pull); + if (this.plugin.settings.updateSubmodules) + await this.git.subModule(["update", "--remote", "--merge", "--recursive"], (err) => this.onError(err)); + const branchInfo = await this.branchInfo(); + const localCommit = await this.git.revparse([branchInfo.current], (err) => this.onError(err)); + await this.git.fetch((err) => this.onError(err)); + const upstreamCommit = await this.git.revparse([branchInfo.tracking], (err) => this.onError(err)); + if (localCommit !== upstreamCommit) { + if (this.plugin.settings.syncMethod === "merge" || this.plugin.settings.syncMethod === "rebase") { + try { + switch (this.plugin.settings.syncMethod) { + case "merge": + await this.git.merge([branchInfo.tracking]); + break; + case "rebase": + await this.git.rebase([branchInfo.tracking]); } - } else if (this.plugin.settings.syncMethod === "reset") { - try { - yield this.git.raw(["update-ref", `refs/heads/${branchInfo.current}`, upstreamCommit], (err) => this.onError(err)); - yield this.unstageAll(); - } catch (err) { - this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${err.message}`); - } + } catch (err) { + this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${err.message}`); + return; + } + } else if (this.plugin.settings.syncMethod === "reset") { + try { + await this.git.raw(["update-ref", `refs/heads/${branchInfo.current}`, upstreamCommit], (err) => this.onError(err)); + await this.unstageAll(); + } catch (err) { + this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${err.message}`); } - const afterMergeCommit = yield this.git.revparse([branchInfo.current], (err) => this.onError(err)); - const filesChanged = yield this.git.diff([`${localCommit}..${afterMergeCommit}`, "--name-only"]); - return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).length; - } else { - return 0; } - }); + const afterMergeCommit = await this.git.revparse([branchInfo.current], (err) => this.onError(err)); + const filesChanged = await this.git.diff([`${localCommit}..${afterMergeCommit}`, "--name-only"]); + return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).map((e) => { + return { + path: e, + working_dir: "P", + vault_path: this.getVaultPath(e) + }; + }); + } else { + return []; + } } - push() { - return __async(this, null, function* () { - this.plugin.setState(PluginState.status); - const status = yield this.git.status(); - const trackingBranch = status.tracking; - const currentBranch = status.current; - const remoteChangedFiles = (yield this.git.diffSummary([currentBranch, trackingBranch], (err) => this.onError(err))).changed; - this.plugin.setState(PluginState.push); - if (this.plugin.settings.updateSubmodules) { - yield this.git.env(__spreadProps(__spreadValues({}, process.env), { "OBSIDIAN_GIT": 1 })).subModule(["foreach", "--recursive", `tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`], (err) => this.onError(err)); + async push() { + this.plugin.setState(PluginState.status); + const status2 = await this.git.status(); + const trackingBranch = status2.tracking; + const currentBranch2 = status2.current; + const remoteChangedFiles = (await this.git.diffSummary([currentBranch2, trackingBranch, "--"], (err) => this.onError(err))).changed; + this.plugin.setState(PluginState.push); + if (this.plugin.settings.updateSubmodules) { + await this.git.env({ ...process.env, "OBSIDIAN_GIT": 1 }).subModule(["foreach", "--recursive", `tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`], (err) => this.onError(err)); + } + await this.git.env({ ...process.env, "OBSIDIAN_GIT": 1 }).push((err) => this.onError(err)); + return remoteChangedFiles; + } + async canPush() { + if (this.plugin.settings.updateSubmodules === true) { + return true; + } + const status2 = await this.git.status((err) => this.onError(err)); + const trackingBranch = status2.tracking; + const currentBranch2 = status2.current; + const remoteChangedFiles = (await this.git.diffSummary([currentBranch2, trackingBranch, "--"])).changed; + return remoteChangedFiles !== 0; + } + async checkRequirements() { + if (!this.isGitInstalled()) { + return "missing-git"; + } + if (!await this.git.checkIsRepo()) { + return "missing-repo"; + } + return "valid"; + } + async branchInfo() { + const status2 = await this.git.status((err) => this.onError(err)); + const branches = await this.git.branch(["--no-color"], (err) => this.onError(err)); + return { + current: status2.current || void 0, + tracking: status2.tracking || void 0, + branches: branches.all + }; + } + async getRemoteUrl(remote) { + return await this.git.remote(["get-url", remote], (err, url) => this.onError(err)) || void 0; + } + async log(file, relativeToVault = true) { + const path2 = this.getPath(file, relativeToVault); + const res = await this.git.log({ file: path2 }, (err) => this.onError(err)); + return res.all; + } + async show(commitHash, file, relativeToVault = true) { + const path2 = this.getPath(file, relativeToVault); + return this.git.show([commitHash + ":" + path2], (err) => this.onError(err)); + } + async checkout(branch2) { + await this.git.checkout(branch2, (err) => this.onError(err)); + } + async createBranch(branch2) { + await this.git.checkout(["-b", branch2], (err) => this.onError(err)); + } + async deleteBranch(branch2, force) { + await this.git.branch([force ? "-D" : "-d", branch2], (err) => this.onError(err)); + } + async branchIsMerged(branch2) { + const notMergedBranches = await this.git.branch(["--no-merged"], (err) => this.onError(err)); + return !notMergedBranches.all.contains(branch2); + } + async init() { + await this.git.init(false, (err) => this.onError(err)); + } + async clone(url, dir) { + await this.git.clone(url, path.join(this.app.vault.adapter.getBasePath(), dir), [], (err) => this.onError(err)); + } + async setConfig(path2, value) { + await this.git.addConfig(path2, value, (err) => this.onError(err)); + } + async getConfig(path2) { + const config = await this.git.listConfig((err) => this.onError(err)); + return config.all[path2]; + } + async fetch(remote) { + await this.git.fetch(remote != void 0 ? [remote] : [], (err) => this.onError(err)); + } + async setRemote(name, url) { + if ((await this.getRemotes()).includes(name)) + await this.git.remote(["set-url", name, url], (err) => this.onError(err)); + else { + await this.git.remote(["add", name, url], (err) => this.onError(err)); + } + } + async getRemoteBranches(remote) { + const res = await this.git.branch(["-r", "--list", `${remote}*`], (err) => this.onError(err)); + console.log(remote); + console.log(res); + const list = []; + for (const item in res.branches) { + list.push(res.branches[item].name); + } + return list; + } + async getRemotes() { + const res = await this.git.remote([], (err) => this.onError(err)); + if (res) { + return res.trim().split("\n"); + } else { + return []; + } + } + async removeRemote(remoteName) { + await this.git.removeRemote(remoteName); + } + async updateUpstreamBranch(remoteBranch) { + try { + await this.git.branch(["--set-upstream-to", remoteBranch]); + } catch (e) { + console.error(e); + try { + await this.git.branch(["--set-upstream", remoteBranch]); + } catch (e2) { + console.error(e2); + await this.git.push(["--set-upstream", ...remoteBranch.split("/")], (err) => this.onError(err)); } - yield this.git.env(__spreadProps(__spreadValues({}, process.env), { "OBSIDIAN_GIT": 1 })).push((err) => this.onError(err)); - return remoteChangedFiles; - }); - } - canPush() { - return __async(this, null, function* () { - if (this.plugin.settings.updateSubmodules === true) { - return true; - } - const status = yield this.git.status((err) => this.onError(err)); - const trackingBranch = status.tracking; - const currentBranch = status.current; - const remoteChangedFiles = (yield this.git.diffSummary([currentBranch, trackingBranch])).changed; - return remoteChangedFiles !== 0; - }); - } - checkRequirements() { - return __async(this, null, function* () { - if (!this.isGitInstalled()) { - return "missing-git"; - } - if (!(yield this.git.checkIsRepo())) { - return "missing-repo"; - } - return "valid"; - }); - } - branchInfo() { - return __async(this, null, function* () { - const status = yield this.git.status((err) => this.onError(err)); - const branches = yield this.git.branch(["--no-color"], (err) => this.onError(err)); - return { - current: status.current, - tracking: status.tracking, - branches: branches.all - }; - }); - } - getRemoteUrl(remote) { - return __async(this, null, function* () { - return (yield this.git.remote(["get-url", remote], (err, url) => this.onError(err))) || void 0; - }); - } - log(file, relativeToVault = true) { - return __async(this, null, function* () { - const path3 = this.getPath(file, relativeToVault); - const res = yield this.git.log({ file: path3 }, (err) => this.onError(err)); - return res.all; - }); - } - show(commitHash, file, relativeToVault = true) { - return __async(this, null, function* () { - const path3 = this.getPath(file, relativeToVault); - return this.git.show([commitHash + ":" + path3], (err) => this.onError(err)); - }); - } - checkout(branch) { - return __async(this, null, function* () { - yield this.git.checkout(branch, (err) => this.onError(err)); - }); - } - init() { - return __async(this, null, function* () { - yield this.git.init(false, (err) => this.onError(err)); - }); - } - clone(url, dir) { - return __async(this, null, function* () { - yield this.git.clone(url, path.join(this.app.vault.adapter.getBasePath(), dir), [], (err) => this.onError(err)); - }); - } - setConfig(path3, value) { - return __async(this, null, function* () { - yield this.git.addConfig(path3, value, (err) => this.onError(err)); - }); - } - getConfig(path3) { - return __async(this, null, function* () { - const config = yield this.git.listConfig((err) => this.onError(err)); - return config.all[path3]; - }); - } - fetch(remote) { - return __async(this, null, function* () { - yield this.git.fetch(remote != void 0 ? [remote] : [], (err) => this.onError(err)); - }); - } - setRemote(name, url) { - return __async(this, null, function* () { - if ((yield this.getRemotes()).includes(name)) - yield this.git.remote(["set-url", name, url], (err) => this.onError(err)); - else { - yield this.git.remote(["add", name, url], (err) => this.onError(err)); - } - }); - } - getRemoteBranches(remote) { - return __async(this, null, function* () { - const res = yield this.git.branch(["-r", "--list", `${remote}*`], (err) => this.onError(err)); - console.log(remote); - console.log(res); - const list = []; - for (var item in res.branches) { - list.push(res.branches[item].name); - } - return list; - }); - } - getRemotes() { - return __async(this, null, function* () { - const res = yield this.git.remote([], (err) => this.onError(err)); - if (res) { - return res.trim().split("\n"); - } else { - return []; - } - }); - } - removeRemote(remoteName) { - return __async(this, null, function* () { - yield this.git.removeRemote(remoteName); - }); - } - updateUpstreamBranch(remoteBranch) { - return __async(this, null, function* () { - yield this.git.push(["--set-upstream", ...remoteBranch.split("/")], (err) => this.onError(err)); - }); + } } updateGitPath(gitPath) { this.setGitInstance(); @@ -11320,24 +24322,17 @@ var SimpleGit = class extends GitManager { updateBasePath(basePath) { this.setGitInstance(true); } - getPath(path3, relativeToVault) { - return relativeToVault && this.plugin.settings.basePath.length > 0 ? path3.substring(this.plugin.settings.basePath.length + 1) : path3; + async getDiffString(filePath, stagedChanges = false) { + if (stagedChanges) + return await this.git.diff(["--cached", "--", filePath]); + else + return await this.git.diff(["--", filePath]); } - getDiffString(filePath, stagedChanges = false) { - return __async(this, null, function* () { - if (stagedChanges) - return yield this.git.diff(["--cached", "--", filePath]); - else - return yield this.git.diff(["--", filePath]); - }); - } - diff(file, commit1, commit2) { - return __async(this, null, function* () { - return yield this.git.diff([`${commit1}..${commit2}`, "--", file]); - }); + async diff(file, commit1, commit2) { + return await this.git.diff([`${commit1}..${commit2}`, "--", file]); } isGitInstalled() { - const command = (0, import_child_process2.spawnSync)(this.plugin.settings.gitPath || "git", ["--version"], { + const command = (0, import_child_process2.spawnSync)(this.plugin.localStorage.getGitPath() || "git", ["--version"], { stdio: "ignore" }); if (command.error) { @@ -11348,7 +24343,7 @@ var SimpleGit = class extends GitManager { } onError(error) { if (error) { - let networkFailure = error.message.contains("Could not resolve host"); + const networkFailure = error.message.contains("Could not resolve host") || error.message.match(/ssh: connect to host .*? port .*?: Operation timed out/); if (!networkFailure) { this.plugin.displayError(error.message); this.plugin.setState(PluginState.idle); @@ -11363,15 +24358,2156 @@ var SimpleGit = class extends GitManager { } }; +// src/settings.ts +var ObsidianGitSettingsTab = class extends import_obsidian7.PluginSettingTab { + display() { + const { containerEl } = this; + const plugin = this.plugin; + const commitOrBackup = plugin.settings.differentIntervalCommitAndPush ? "commit" : "backup"; + const gitReady = plugin.gitReady; + containerEl.empty(); + containerEl.createEl("h2", { text: "Git Backup settings" }); + if (!gitReady) { + containerEl.createEl("p", { text: "Git is not ready. When all settings are correct you can configure auto backup, etc." }); + } + if (gitReady) { + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Automatic" }); + new import_obsidian7.Setting(containerEl).setName("Split automatic commit and push").setDesc("Enable to use separate timer for commit and push").addToggle((toggle) => toggle.setValue(plugin.settings.differentIntervalCommitAndPush).onChange((value) => { + plugin.settings.differentIntervalCommitAndPush = value; + plugin.saveSettings(); + plugin.clearAutoBackup(); + plugin.clearAutoPush(); + if (plugin.settings.autoSaveInterval > 0) { + plugin.startAutoBackup(plugin.settings.autoSaveInterval); + } + if (value && plugin.settings.autoPushInterval > 0) { + plugin.startAutoPush(plugin.settings.autoPushInterval); + } + this.display(); + })); + new import_obsidian7.Setting(containerEl).setName(`Vault ${commitOrBackup} interval (minutes)`).setDesc(`${plugin.settings.differentIntervalCommitAndPush ? "Commit" : "Commit and push"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText((text2) => text2.setValue(String(plugin.settings.autoSaveInterval)).onChange((value) => { + if (!isNaN(Number(value))) { + plugin.settings.autoSaveInterval = Number(value); + plugin.saveSettings(); + if (plugin.settings.autoSaveInterval > 0) { + plugin.clearAutoBackup(); + plugin.startAutoBackup(plugin.settings.autoSaveInterval); + new import_obsidian7.Notice(`Automatic ${commitOrBackup} enabled! Every ${plugin.settings.autoSaveInterval} minutes.`); + } else if (plugin.settings.autoSaveInterval <= 0) { + plugin.clearAutoBackup() && new import_obsidian7.Notice(`Automatic ${commitOrBackup} disabled!`); + } + } else { + new import_obsidian7.Notice("Please specify a valid number."); + } + })); + new import_obsidian7.Setting(containerEl).setName(`If turned on, do auto ${commitOrBackup} every X minutes after last change. Prevents auto ${commitOrBackup} while editing a file. If turned off, do auto ${commitOrBackup} every X minutes. It's independent from last change.`).addToggle((toggle) => toggle.setValue(plugin.settings.autoBackupAfterFileChange).onChange((value) => { + plugin.settings.autoBackupAfterFileChange = value; + plugin.saveSettings(); + plugin.clearAutoBackup(); + if (plugin.settings.autoSaveInterval > 0) { + plugin.startAutoBackup(plugin.settings.autoSaveInterval); + } + })); + if (plugin.settings.differentIntervalCommitAndPush) { + new import_obsidian7.Setting(containerEl).setName(`Vault push interval (minutes)`).setDesc("Push changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPushInterval)).onChange((value) => { + if (!isNaN(Number(value))) { + plugin.settings.autoPushInterval = Number(value); + plugin.saveSettings(); + if (plugin.settings.autoPushInterval > 0) { + plugin.clearAutoPush(); + plugin.startAutoPush(plugin.settings.autoPushInterval); + new import_obsidian7.Notice(`Automatic push enabled! Every ${plugin.settings.autoPushInterval} minutes.`); + } else if (plugin.settings.autoPushInterval <= 0) { + plugin.clearAutoPush() && new import_obsidian7.Notice("Automatic push disabled!"); + } + } else { + new import_obsidian7.Notice("Please specify a valid number."); + } + })); + } + new import_obsidian7.Setting(containerEl).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText((text2) => text2.setValue(String(plugin.settings.autoPullInterval)).onChange((value) => { + if (!isNaN(Number(value))) { + plugin.settings.autoPullInterval = Number(value); + plugin.saveSettings(); + if (plugin.settings.autoPullInterval > 0) { + plugin.clearAutoPull(); + plugin.startAutoPull(plugin.settings.autoPullInterval); + new import_obsidian7.Notice(`Automatic pull enabled! Every ${plugin.settings.autoPullInterval} minutes.`); + } else if (plugin.settings.autoPullInterval <= 0) { + plugin.clearAutoPull() && new import_obsidian7.Notice("Automatic pull disabled!"); + } + } else { + new import_obsidian7.Notice("Please specify a valid number."); + } + })); + new import_obsidian7.Setting(containerEl).setName("Commit message on manual backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.commitMessage ? plugin.settings.commitMessage : "").onChange((value) => { + plugin.settings.commitMessage = value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Specify custom commit message on auto backup").setDesc("You will get a pop up to specify your message").addToggle((toggle) => toggle.setValue(plugin.settings.customMessageOnAutoBackup).onChange((value) => { + plugin.settings.customMessageOnAutoBackup = value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Commit message on auto backup/commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below) and {{numFiles}} (number of changed files in the commit)").addText((text2) => text2.setPlaceholder("vault backup: {{date}}").setValue(plugin.settings.autoCommitMessage).onChange((value) => { + plugin.settings.autoCommitMessage = value; + plugin.saveSettings(); + })); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Commit message" }); + new import_obsidian7.Setting(containerEl).setName("{{date}} placeholder format").setDesc('Specify custom date format. E.g. "YYYY-MM-DD HH:mm:ss"').addText((text2) => text2.setPlaceholder(plugin.settings.commitDateFormat).setValue(plugin.settings.commitDateFormat).onChange(async (value) => { + plugin.settings.commitDateFormat = value; + await plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText((text2) => { + var _a2; + return text2.setValue((_a2 = plugin.localStorage.getHostname()) != null ? _a2 : "").onChange(async (value) => { + plugin.localStorage.setHostname(value); + }); + }); + new import_obsidian7.Setting(containerEl).setName("Preview commit message").addButton((button) => button.setButtonText("Preview").onClick(async () => { + const commitMessagePreview = await plugin.gitManager.formatCommitMessage(plugin.settings.commitMessage); + new import_obsidian7.Notice(`${commitMessagePreview}`); + })); + new import_obsidian7.Setting(containerEl).setName("List filenames affected by commit in the commit body").addToggle((toggle) => toggle.setValue(plugin.settings.listChangedFilesInMessageBody).onChange((value) => { + plugin.settings.listChangedFilesInMessageBody = value; + plugin.saveSettings(); + })); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Backup" }); + if (plugin.gitManager instanceof SimpleGit) + new import_obsidian7.Setting(containerEl).setName("Sync Method").setDesc("Selects the method used for handling new changes found in your remote git repository.").addDropdown((dropdown) => { + const options = { + "merge": "Merge", + "rebase": "Rebase", + "reset": "Other sync service (Only updates the HEAD without touching the working directory)" + }; + dropdown.addOptions(options); + dropdown.setValue(plugin.settings.syncMethod); + dropdown.onChange(async (option) => { + plugin.settings.syncMethod = option; + plugin.saveSettings(); + }); + }); + new import_obsidian7.Setting(containerEl).setName("Pull updates on startup").setDesc("Automatically pull updates when Obsidian starts").addToggle((toggle) => toggle.setValue(plugin.settings.autoPullOnBoot).onChange((value) => { + plugin.settings.autoPullOnBoot = value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Push on backup").setDesc("Disable to only commit changes").addToggle((toggle) => toggle.setValue(!plugin.settings.disablePush).onChange((value) => { + plugin.settings.disablePush = !value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Pull changes before push").setDesc("Commit -> pull -> push (Only if pushing is enabled)").addToggle((toggle) => toggle.setValue(plugin.settings.pullBeforePush).onChange((value) => { + plugin.settings.pullBeforePush = value; + plugin.saveSettings(); + })); + } + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Miscellaneous" }); + new import_obsidian7.Setting(containerEl).setName("Automatically refresh Source Control View on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option").addToggle((toggle) => toggle.setValue(plugin.settings.refreshSourceControl).onChange((value) => { + plugin.settings.refreshSourceControl = value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Source Control View refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View").addText((toggle) => toggle.setValue(plugin.settings.refreshSourceControlTimer.toString()).setPlaceholder("7000").onChange((value) => { + plugin.settings.refreshSourceControlTimer = Math.max(parseInt(value), 500); + plugin.saveSettings(); + plugin.setRefreshDebouncer(); + })); + new import_obsidian7.Setting(containerEl).setName("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting").addToggle((toggle) => toggle.setValue(plugin.settings.disablePopups).onChange((value) => { + plugin.settings.disablePopups = value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect").addToggle((toggle) => toggle.setValue(plugin.settings.showStatusBar).onChange((value) => { + plugin.settings.showStatusBar = value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Show branch status bar").setDesc("Obsidian must be restarted for the changes to take affect").addToggle((toggle) => toggle.setValue(plugin.settings.showBranchStatusBar).onChange((value) => { + plugin.settings.showBranchStatusBar = value; + plugin.saveSettings(); + })); + new import_obsidian7.Setting(containerEl).setName("Show changes files count in status bar").addToggle((toggle) => toggle.setValue(plugin.settings.changedFilesInStatusBar).onChange((value) => { + plugin.settings.changedFilesInStatusBar = value; + plugin.saveSettings(); + })); + containerEl.createEl("br"); + containerEl.createEl("h3", { text: "Advanced" }); + if (plugin.gitManager instanceof SimpleGit) + new import_obsidian7.Setting(containerEl).setName("Update submodules").setDesc('"Create backup" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule').addToggle((toggle) => toggle.setValue(plugin.settings.updateSubmodules).onChange((value) => { + plugin.settings.updateSubmodules = value; + plugin.saveSettings(); + })); + if (plugin.gitManager instanceof SimpleGit) + new import_obsidian7.Setting(containerEl).setName("Custom Git binary path").addText((cb) => { + var _a2; + cb.setValue((_a2 = plugin.localStorage.getGitPath()) != null ? _a2 : ""); + cb.setPlaceholder("git"); + cb.onChange((value) => { + plugin.localStorage.setGitPath(value); + plugin.gitManager.updateGitPath(value || "git"); + }); + }); + if (plugin.gitManager instanceof IsomorphicGit) + new import_obsidian7.Setting(containerEl).setName("Username on your git server. E.g. your username on GitHub").addText((cb) => { + cb.setValue(plugin.settings.username); + cb.onChange((value) => { + plugin.settings.username = value; + plugin.saveSettings(); + }); + }); + if (plugin.gitManager instanceof IsomorphicGit) + new import_obsidian7.Setting(containerEl).setName("Password/Personal access token").setDesc("Type in your password. You won't be able to see it again.").addText((cb) => { + cb.inputEl.autocapitalize = "off"; + cb.inputEl.autocomplete = "off"; + cb.inputEl.spellcheck = false; + cb.onChange((value) => { + plugin.localStorage.setPassword(value); + }); + }); + if (gitReady) + new import_obsidian7.Setting(containerEl).setName("Author name for commit").addText(async (cb) => { + cb.setValue(await plugin.gitManager.getConfig("user.name")); + cb.onChange((value) => { + plugin.gitManager.setConfig("user.name", value); + }); + }); + if (gitReady) + new import_obsidian7.Setting(containerEl).setName("Author email for commit").addText(async (cb) => { + cb.setValue(await plugin.gitManager.getConfig("user.email")); + cb.onChange((value) => { + plugin.gitManager.setConfig("user.email", value); + }); + }); + new import_obsidian7.Setting(containerEl).setName("Custom base path (Git repository path)").setDesc(` + Sets the relative path to the vault from which the Git binary should be executed. + Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows. + `).addText((cb) => { + cb.setValue(plugin.settings.basePath); + cb.setPlaceholder("directory/directory-with-git-repo"); + cb.onChange((value) => { + plugin.settings.basePath = value; + plugin.saveSettings(); + plugin.gitManager.updateBasePath(value || ""); + }); + }); + new import_obsidian7.Setting(containerEl).setName("Disable on this device").addToggle((toggle) => toggle.setValue(plugin.localStorage.getPluginDisabled()).onChange((value) => { + plugin.localStorage.setPluginDisabled(value); + if (value) { + plugin.unloadPlugin(); + } else { + plugin.loadPlugin(); + } + new import_obsidian7.Notice("Obsidian must be restarted for the changes to take affect"); + })); + new import_obsidian7.Setting(containerEl).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton((bt) => { + bt.buttonEl.outerHTML = "Buy Me a Coffee at ko-fi.com"; + }); + const info = containerEl.createDiv(); + info.setAttr("align", "center"); + info.setText("Debugging and logging:\nYou can always see the logs of this and every other plugin by opening the console with"); + const keys = containerEl.createDiv(); + keys.setAttr("align", "center"); + keys.addClass("obsidian-git-shortcuts"); + if (import_obsidian7.Platform.isMacOS === true) { + keys.createEl("kbd", { text: "CMD (\u2318) + OPTION (\u2325) + I" }); + } else { + keys.createEl("kbd", { text: "CTRL + SHIFT + I" }); + } + } +}; + +// src/statusBar.ts +init_polyfill_buffer(); +var import_obsidian8 = __toModule(require("obsidian")); +var StatusBar = class { + constructor(statusBarEl, plugin) { + this.statusBarEl = statusBarEl; + this.plugin = plugin; + this.messages = []; + this.base = "obsidian-git-statusbar-"; + this.statusBarEl.setAttribute("aria-label-position", "top"); + } + displayMessage(message, timeout) { + this.messages.push({ + message: `Git: ${message.slice(0, 100)}`, + timeout + }); + this.display(); + } + display() { + if (this.messages.length > 0 && !this.currentMessage) { + this.currentMessage = this.messages.shift(); + this.statusBarEl.addClass(this.base + "message"); + this.statusBarEl.ariaLabel = ""; + this.statusBarEl.setText(this.currentMessage.message); + this.lastMessageTimestamp = Date.now(); + } else if (this.currentMessage) { + const messageAge = Date.now() - this.lastMessageTimestamp; + if (messageAge >= this.currentMessage.timeout) { + this.currentMessage = null; + this.lastMessageTimestamp = null; + } + } else { + this.displayState(); + } + } + displayState() { + if (this.statusBarEl.getText().length > 3 || !this.statusBarEl.hasChildNodes()) { + this.statusBarEl.empty(); + this.iconEl = this.statusBarEl.createDiv(); + this.textEl = this.statusBarEl.createDiv(); + this.textEl.style.float = "right"; + this.textEl.style.marginLeft = "5px"; + this.iconEl.style.float = "left"; + } + switch (this.plugin.state) { + case PluginState.idle: + this.displayFromNow(this.plugin.lastUpdate); + break; + case PluginState.status: + this.statusBarEl.ariaLabel = "Checking repository status..."; + (0, import_obsidian8.setIcon)(this.iconEl, "refresh-cw"); + this.statusBarEl.addClass(this.base + "status"); + break; + case PluginState.add: + this.statusBarEl.ariaLabel = "Adding files..."; + (0, import_obsidian8.setIcon)(this.iconEl, "refresh-w"); + this.statusBarEl.addClass(this.base + "add"); + break; + case PluginState.commit: + this.statusBarEl.ariaLabel = "Committing changes..."; + (0, import_obsidian8.setIcon)(this.iconEl, "git-commit"); + this.statusBarEl.addClass(this.base + "commit"); + break; + case PluginState.push: + this.statusBarEl.ariaLabel = "Pushing changes..."; + (0, import_obsidian8.setIcon)(this.iconEl, "upload"); + this.statusBarEl.addClass(this.base + "push"); + break; + case PluginState.pull: + this.statusBarEl.ariaLabel = "Pulling changes..."; + (0, import_obsidian8.setIcon)(this.iconEl, "download"); + this.statusBarEl.addClass(this.base + "pull"); + break; + case PluginState.conflicted: + this.statusBarEl.ariaLabel = "You have conflict files..."; + (0, import_obsidian8.setIcon)(this.iconEl, "alert-circle"); + this.statusBarEl.addClass(this.base + "conflict"); + break; + default: + this.statusBarEl.ariaLabel = "Failed on initialization!"; + (0, import_obsidian8.setIcon)(this.iconEl, "alert-triangle"); + this.statusBarEl.addClass(this.base + "failed-init"); + break; + } + } + displayFromNow(timestamp) { + if (timestamp) { + const moment = window.moment; + const fromNow = moment(timestamp).fromNow(); + this.statusBarEl.ariaLabel = `${this.plugin.offlineMode ? "Offline: " : ""}Last Git update: ${fromNow}`; + } else { + this.statusBarEl.ariaLabel = this.plugin.offlineMode ? "Git is offline" : "Git is ready"; + } + if (this.plugin.offlineMode) { + (0, import_obsidian8.setIcon)(this.iconEl, "globe"); + } else { + (0, import_obsidian8.setIcon)(this.iconEl, "check"); + } + if (this.plugin.settings.changedFilesInStatusBar && this.plugin.cachedStatus) { + this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()); + } + this.statusBarEl.addClass(this.base + "idle"); + } +}; + +// src/ui/modals/changedFilesModal.ts +init_polyfill_buffer(); +var import_obsidian9 = __toModule(require("obsidian")); +var ChangedFilesModal = class extends import_obsidian9.FuzzySuggestModal { + constructor(plugin, changedFiles) { + super(plugin.app); + this.plugin = plugin; + this.changedFiles = changedFiles; + this.setPlaceholder("Not supported files will be opened by default app!"); + } + getItems() { + return this.changedFiles; + } + getItemText(item) { + if (item.index == "U" && item.working_dir == "U") { + return `Untracked | ${item.vault_path}`; + } + let working_dir = ""; + let index2 = ""; + if (item.working_dir != " ") + working_dir = `Working dir: ${item.working_dir} `; + if (item.index != " ") + index2 = `Index: ${item.index}`; + return `${working_dir}${index2} | ${item.vault_path}`; + } + onChooseItem(item, _) { + if (this.plugin.app.metadataCache.getFirstLinkpathDest(item.vault_path, "") == null) { + this.app.openWithDefaultApp(item.vault_path); + } else { + this.plugin.app.workspace.openLinkText(item.vault_path, "/"); + } + } +}; + +// src/ui/modals/customMessageModal.ts +init_polyfill_buffer(); +var import_obsidian10 = __toModule(require("obsidian")); +var CustomMessageModal = class extends import_obsidian10.SuggestModal { + constructor(plugin, fromAutoBackup) { + super(plugin.app); + this.fromAutoBackup = fromAutoBackup; + this.resolve = null; + this.plugin = plugin; + this.setPlaceholder("Type your message and select optional the version with the added date."); + } + open() { + super.open(); + return new Promise((resolve) => { + this.resolve = resolve; + }); + } + onClose() { + if (this.resolve) + this.resolve(void 0); + } + selectSuggestion(value, evt) { + if (this.resolve) + this.resolve(value); + super.selectSuggestion(value, evt); + } + getSuggestions(query) { + const date = window.moment().format(this.plugin.settings.commitDateFormat); + if (query == "") + query = "..."; + return [query, `${date}: ${query}`, `${query}: ${date}`]; + } + renderSuggestion(value, el) { + el.innerText = value; + } + onChooseSuggestion(item, _) { + } +}; + +// src/constants.ts +init_polyfill_buffer(); +var import_obsidian11 = __toModule(require("obsidian")); +var DEFAULT_SETTINGS = { + commitMessage: "vault backup: {{date}}", + autoCommitMessage: void 0, + commitDateFormat: "YYYY-MM-DD HH:mm:ss", + autoSaveInterval: 0, + autoPushInterval: 0, + autoPullInterval: 0, + autoPullOnBoot: false, + disablePush: false, + pullBeforePush: true, + disablePopups: false, + listChangedFilesInMessageBody: false, + showStatusBar: true, + updateSubmodules: false, + syncMethod: "merge", + customMessageOnAutoBackup: false, + autoBackupAfterFileChange: false, + treeStructure: false, + refreshSourceControl: import_obsidian11.Platform.isDesktopApp, + basePath: "", + differentIntervalCommitAndPush: false, + changedFilesInStatusBar: false, + username: "", + showedMobileNotice: false, + refreshSourceControlTimer: 7e3, + showBranchStatusBar: true +}; +var GIT_VIEW_CONFIG = { + type: "git-view", + name: "Source Control", + icon: "git-pull-request" +}; +var DIFF_VIEW_CONFIG = { + type: "diff-view", + name: "Diff View", + icon: "git-pull-request" +}; + +// src/localStorageSettings.ts +init_polyfill_buffer(); +var LocalStorageSettings = class { + constructor(plugin) { + this.plugin = plugin; + this.prefix = this.plugin.manifest.id + ":"; + } + migrate() { + const keys = ["password", "hostname", "conflict", "lastAutoPull", "lastAutoBackup", "lastAutoPush", "gitPath", "pluginDisabled"]; + for (const key2 of keys) { + const old = localStorage.getItem(this.prefix + key2); + if (app.loadLocalStorage(this.prefix + key2) == null && old != null) { + if (old != null) { + app.saveLocalStorage(this.prefix + key2, old); + localStorage.removeItem(this.prefix + key2); + } + } + } + } + getPassword() { + return app.loadLocalStorage(this.prefix + "password"); + } + setPassword(value) { + return app.saveLocalStorage(this.prefix + "password", value); + } + getHostname() { + return app.loadLocalStorage(this.prefix + "hostname"); + } + setHostname(value) { + return app.saveLocalStorage(this.prefix + "hostname", value); + } + getConflict() { + return app.loadLocalStorage(this.prefix + "conflict"); + } + setConflict(value) { + return app.saveLocalStorage(this.prefix + "conflict", value); + } + getLastAutoPull() { + return app.loadLocalStorage(this.prefix + "lastAutoPull"); + } + setLastAutoPull(value) { + return app.saveLocalStorage(this.prefix + "lastAutoPull", value); + } + getLastAutoBackup() { + return app.loadLocalStorage(this.prefix + "lastAutoBackup"); + } + setLastAutoBackup(value) { + return app.saveLocalStorage(this.prefix + "lastAutoBackup", value); + } + getLastAutoPush() { + return app.loadLocalStorage(this.prefix + "lastAutoPush"); + } + setLastAutoPush(value) { + return app.saveLocalStorage(this.prefix + "lastAutoPush", value); + } + getGitPath() { + return app.loadLocalStorage(this.prefix + "gitPath"); + } + setGitPath(value) { + return app.saveLocalStorage(this.prefix + "gitPath", value); + } + getPluginDisabled() { + return app.loadLocalStorage(this.prefix + "pluginDisabled") == "true"; + } + setPluginDisabled(value) { + return app.saveLocalStorage(this.prefix + "pluginDisabled", `${value}`); + } +}; + +// src/openInGitHub.ts +init_polyfill_buffer(); +var import_obsidian12 = __toModule(require("obsidian")); +async function openLineInGitHub(editor, file, manager) { + const { isGitHub, branch: branch2, repo, user } = await getData(manager); + if (isGitHub) { + const path2 = manager.getPath(file.path, true); + const from = editor.getCursor("from").line + 1; + const to = editor.getCursor("to").line + 1; + if (from === to) { + window.open(`https://github.com/${user}/${repo}/blob/${branch2}/${path2}?plain=1#L${from}`); + } else { + window.open(`https://github.com/${user}/${repo}/blob/${branch2}/${path2}?plain=1#L${from}-L${to}`); + } + } else { + new import_obsidian12.Notice("It seems like you are not using GitHub"); + } +} +async function openHistoryInGitHub(file, manager) { + const { isGitHub, branch: branch2, repo, user } = await getData(manager); + const path2 = manager.getPath(file.path, true); + if (isGitHub) { + window.open(`https://github.com/${user}/${repo}/commits/${branch2}/${path2}`); + } else { + new import_obsidian12.Notice("It seems like you are not using GitHub"); + } +} +async function getData(manager) { + const branchInfo = await manager.branchInfo(); + const remoteBranch = branchInfo.tracking; + const branch2 = branchInfo.current; + const remote = remoteBranch.substring(0, remoteBranch.indexOf("/")); + const remoteUrl = await manager.getConfig(`remote.${remote}.url`); + const [isGitHub, httpsUser, httpsRepo, sshUser, sshRepo] = remoteUrl.match(/(?:^https:\/\/github\.com\/(.*)\/(.*)\.git$)|(?:^git@github\.com:(.*)\/(.*)\.git$)/); + return { + isGitHub: !!isGitHub, + repo: httpsRepo || sshRepo, + user: httpsUser || sshUser, + branch: branch2 + }; +} + // src/ui/diff/diffView.ts -var import_diff2html = __toModule(require_diff2html()); -var import_obsidian7 = __toModule(require("obsidian")); -var DiffView = class extends import_obsidian7.ItemView { +init_polyfill_buffer(); + +// node_modules/diff2html/lib-esm/diff2html.js +init_polyfill_buffer(); + +// node_modules/diff2html/lib-esm/diff-parser.js +init_polyfill_buffer(); + +// node_modules/diff2html/lib-esm/types.js +init_polyfill_buffer(); +var LineType; +(function(LineType2) { + LineType2["INSERT"] = "insert"; + LineType2["DELETE"] = "delete"; + LineType2["CONTEXT"] = "context"; +})(LineType || (LineType = {})); +var OutputFormatType = { + LINE_BY_LINE: "line-by-line", + SIDE_BY_SIDE: "side-by-side" +}; +var LineMatchingType = { + LINES: "lines", + WORDS: "words", + NONE: "none" +}; +var DiffStyleType = { + WORD: "word", + CHAR: "char" +}; + +// node_modules/diff2html/lib-esm/utils.js +init_polyfill_buffer(); +var specials = [ + "-", + "[", + "]", + "/", + "{", + "}", + "(", + ")", + "*", + "+", + "?", + ".", + "\\", + "^", + "$", + "|" +]; +var regex = RegExp("[" + specials.join("\\") + "]", "g"); +function escapeForRegExp(str) { + return str.replace(regex, "\\$&"); +} +function unifyPath(path2) { + return path2 ? path2.replace(/\\/g, "/") : path2; +} +function hashCode(text2) { + var i, chr, len; + var hash2 = 0; + for (i = 0, len = text2.length; i < len; i++) { + chr = text2.charCodeAt(i); + hash2 = (hash2 << 5) - hash2 + chr; + hash2 |= 0; + } + return hash2; +} + +// node_modules/diff2html/lib-esm/diff-parser.js +var __spreadArray = function(to, from, pack) { + if (pack || arguments.length === 2) + for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) + ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +function getExtension(filename, language) { + var filenameParts = filename.split("."); + return filenameParts.length > 1 ? filenameParts[filenameParts.length - 1] : language; +} +function startsWithAny(str, prefixes) { + return prefixes.reduce(function(startsWith, prefix) { + return startsWith || str.startsWith(prefix); + }, false); +} +var baseDiffFilenamePrefixes = ["a/", "b/", "i/", "w/", "c/", "o/"]; +function getFilename(line, linePrefix, extraPrefix) { + var prefixes = extraPrefix !== void 0 ? __spreadArray(__spreadArray([], baseDiffFilenamePrefixes, true), [extraPrefix], false) : baseDiffFilenamePrefixes; + var FilenameRegExp = linePrefix ? new RegExp("^".concat(escapeForRegExp(linePrefix), ' "?(.+?)"?$')) : new RegExp('^"?(.+?)"?$'); + var _a2 = FilenameRegExp.exec(line) || [], _b = _a2[1], filename = _b === void 0 ? "" : _b; + var matchingPrefix = prefixes.find(function(p) { + return filename.indexOf(p) === 0; + }); + var fnameWithoutPrefix = matchingPrefix ? filename.slice(matchingPrefix.length) : filename; + return fnameWithoutPrefix.replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/, ""); +} +function getSrcFilename(line, srcPrefix) { + return getFilename(line, "---", srcPrefix); +} +function getDstFilename(line, dstPrefix) { + return getFilename(line, "+++", dstPrefix); +} +function parse(diffInput, config) { + if (config === void 0) { + config = {}; + } + var files = []; + var currentFile = null; + var currentBlock = null; + var oldLine = null; + var oldLine2 = null; + var newLine = null; + var possibleOldName = null; + var possibleNewName = null; + var oldFileNameHeader = "--- "; + var newFileNameHeader = "+++ "; + var hunkHeaderPrefix = "@@"; + var oldMode = /^old mode (\d{6})/; + var newMode = /^new mode (\d{6})/; + var deletedFileMode = /^deleted file mode (\d{6})/; + var newFileMode = /^new file mode (\d{6})/; + var copyFrom = /^copy from "?(.+)"?/; + var copyTo = /^copy to "?(.+)"?/; + var renameFrom = /^rename from "?(.+)"?/; + var renameTo = /^rename to "?(.+)"?/; + var similarityIndex = /^similarity index (\d+)%/; + var dissimilarityIndex = /^dissimilarity index (\d+)%/; + var index2 = /^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/; + var binaryFiles = /^Binary files (.*) and (.*) differ/; + var binaryDiff = /^GIT binary patch/; + var combinedIndex = /^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/; + var combinedMode = /^mode (\d{6}),(\d{6})\.\.(\d{6})/; + var combinedNewFile = /^new file mode (\d{6})/; + var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/; + var diffLines2 = diffInput.replace(/\\ No newline at end of file/g, "").replace(/\r\n?/g, "\n").split("\n"); + function saveBlock() { + if (currentBlock !== null && currentFile !== null) { + currentFile.blocks.push(currentBlock); + currentBlock = null; + } + } + function saveFile() { + if (currentFile !== null) { + if (!currentFile.oldName && possibleOldName !== null) { + currentFile.oldName = possibleOldName; + } + if (!currentFile.newName && possibleNewName !== null) { + currentFile.newName = possibleNewName; + } + if (currentFile.newName) { + files.push(currentFile); + currentFile = null; + } + } + possibleOldName = null; + possibleNewName = null; + } + function startFile() { + saveBlock(); + saveFile(); + currentFile = { + blocks: [], + deletedLines: 0, + addedLines: 0 + }; + } + function startBlock(line) { + saveBlock(); + var values; + if (currentFile !== null) { + if (values = /^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(line)) { + currentFile.isCombined = false; + oldLine = parseInt(values[1], 10); + newLine = parseInt(values[2], 10); + } else if (values = /^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(line)) { + currentFile.isCombined = true; + oldLine = parseInt(values[1], 10); + oldLine2 = parseInt(values[2], 10); + newLine = parseInt(values[3], 10); + } else { + if (line.startsWith(hunkHeaderPrefix)) { + console.error("Failed to parse lines, starting in 0!"); + } + oldLine = 0; + newLine = 0; + currentFile.isCombined = false; + } + } + currentBlock = { + lines: [], + oldStartLine: oldLine, + oldStartLine2: oldLine2, + newStartLine: newLine, + header: line + }; + } + function createLine(line) { + if (currentFile === null || currentBlock === null || oldLine === null || newLine === null) + return; + var currentLine = { + content: line + }; + var addedPrefixes = currentFile.isCombined ? ["+ ", " +", "++"] : ["+"]; + var deletedPrefixes = currentFile.isCombined ? ["- ", " -", "--"] : ["-"]; + if (startsWithAny(line, addedPrefixes)) { + currentFile.addedLines++; + currentLine.type = LineType.INSERT; + currentLine.oldNumber = void 0; + currentLine.newNumber = newLine++; + } else if (startsWithAny(line, deletedPrefixes)) { + currentFile.deletedLines++; + currentLine.type = LineType.DELETE; + currentLine.oldNumber = oldLine++; + currentLine.newNumber = void 0; + } else { + currentLine.type = LineType.CONTEXT; + currentLine.oldNumber = oldLine++; + currentLine.newNumber = newLine++; + } + currentBlock.lines.push(currentLine); + } + function existHunkHeader(line, lineIdx) { + var idx = lineIdx; + while (idx < diffLines2.length - 3) { + if (line.startsWith("diff")) { + return false; + } + if (diffLines2[idx].startsWith(oldFileNameHeader) && diffLines2[idx + 1].startsWith(newFileNameHeader) && diffLines2[idx + 2].startsWith(hunkHeaderPrefix)) { + return true; + } + idx++; + } + return false; + } + diffLines2.forEach(function(line, lineIndex) { + if (!line || line.startsWith("*")) { + return; + } + var values; + var prevLine = diffLines2[lineIndex - 1]; + var nxtLine = diffLines2[lineIndex + 1]; + var afterNxtLine = diffLines2[lineIndex + 2]; + if (line.startsWith("diff")) { + startFile(); + var gitDiffStart = /^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/; + if (values = gitDiffStart.exec(line)) { + possibleOldName = getFilename(values[1], void 0, config.dstPrefix); + possibleNewName = getFilename(values[2], void 0, config.srcPrefix); + } + if (currentFile === null) { + throw new Error("Where is my file !!!"); + } + currentFile.isGitDiff = true; + return; + } + if (!currentFile || !currentFile.isGitDiff && currentFile && line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) && afterNxtLine.startsWith(hunkHeaderPrefix)) { + startFile(); + } + if (currentFile === null || currentFile === void 0 ? void 0 : currentFile.isTooBig) { + return; + } + if (currentFile && (typeof config.diffMaxChanges === "number" && currentFile.addedLines + currentFile.deletedLines > config.diffMaxChanges || typeof config.diffMaxLineLength === "number" && line.length > config.diffMaxLineLength)) { + currentFile.isTooBig = true; + currentFile.addedLines = 0; + currentFile.deletedLines = 0; + currentFile.blocks = []; + currentBlock = null; + var message = typeof config.diffTooBigMessage === "function" ? config.diffTooBigMessage(files.length) : "Diff too big to be displayed"; + startBlock(message); + return; + } + if (line.startsWith(oldFileNameHeader) && nxtLine.startsWith(newFileNameHeader) || line.startsWith(newFileNameHeader) && prevLine.startsWith(oldFileNameHeader)) { + if (currentFile && !currentFile.oldName && line.startsWith("--- ") && (values = getSrcFilename(line, config.srcPrefix))) { + currentFile.oldName = values; + currentFile.language = getExtension(currentFile.oldName, currentFile.language); + return; + } + if (currentFile && !currentFile.newName && line.startsWith("+++ ") && (values = getDstFilename(line, config.dstPrefix))) { + currentFile.newName = values; + currentFile.language = getExtension(currentFile.newName, currentFile.language); + return; + } + } + if (currentFile && (line.startsWith(hunkHeaderPrefix) || currentFile.isGitDiff && currentFile.oldName && currentFile.newName && !currentBlock)) { + startBlock(line); + return; + } + if (currentBlock && (line.startsWith("+") || line.startsWith("-") || line.startsWith(" "))) { + createLine(line); + return; + } + var doesNotExistHunkHeader = !existHunkHeader(line, lineIndex); + if (currentFile === null) { + throw new Error("Where is my file !!!"); + } + if (values = oldMode.exec(line)) { + currentFile.oldMode = values[1]; + } else if (values = newMode.exec(line)) { + currentFile.newMode = values[1]; + } else if (values = deletedFileMode.exec(line)) { + currentFile.deletedFileMode = values[1]; + currentFile.isDeleted = true; + } else if (values = newFileMode.exec(line)) { + currentFile.newFileMode = values[1]; + currentFile.isNew = true; + } else if (values = copyFrom.exec(line)) { + if (doesNotExistHunkHeader) { + currentFile.oldName = values[1]; + } + currentFile.isCopy = true; + } else if (values = copyTo.exec(line)) { + if (doesNotExistHunkHeader) { + currentFile.newName = values[1]; + } + currentFile.isCopy = true; + } else if (values = renameFrom.exec(line)) { + if (doesNotExistHunkHeader) { + currentFile.oldName = values[1]; + } + currentFile.isRename = true; + } else if (values = renameTo.exec(line)) { + if (doesNotExistHunkHeader) { + currentFile.newName = values[1]; + } + currentFile.isRename = true; + } else if (values = binaryFiles.exec(line)) { + currentFile.isBinary = true; + currentFile.oldName = getFilename(values[1], void 0, config.srcPrefix); + currentFile.newName = getFilename(values[2], void 0, config.dstPrefix); + startBlock("Binary file"); + } else if (binaryDiff.test(line)) { + currentFile.isBinary = true; + startBlock(line); + } else if (values = similarityIndex.exec(line)) { + currentFile.unchangedPercentage = parseInt(values[1], 10); + } else if (values = dissimilarityIndex.exec(line)) { + currentFile.changedPercentage = parseInt(values[1], 10); + } else if (values = index2.exec(line)) { + currentFile.checksumBefore = values[1]; + currentFile.checksumAfter = values[2]; + values[3] && (currentFile.mode = values[3]); + } else if (values = combinedIndex.exec(line)) { + currentFile.checksumBefore = [values[2], values[3]]; + currentFile.checksumAfter = values[1]; + } else if (values = combinedMode.exec(line)) { + currentFile.oldMode = [values[2], values[3]]; + currentFile.newMode = values[1]; + } else if (values = combinedNewFile.exec(line)) { + currentFile.newFileMode = values[1]; + currentFile.isNew = true; + } else if (values = combinedDeletedFile.exec(line)) { + currentFile.deletedFileMode = values[1]; + currentFile.isDeleted = true; + } + }); + saveBlock(); + saveFile(); + return files; +} + +// node_modules/diff2html/lib-esm/file-list-renderer.js +init_polyfill_buffer(); + +// node_modules/diff2html/lib-esm/render-utils.js +init_polyfill_buffer(); + +// node_modules/diff2html/lib-esm/rematch.js +init_polyfill_buffer(); +function levenshtein(a, b) { + if (a.length === 0) { + return b.length; + } + if (b.length === 0) { + return a.length; + } + var matrix = []; + var i; + for (i = 0; i <= b.length; i++) { + matrix[i] = [i]; + } + var j; + for (j = 0; j <= a.length; j++) { + matrix[0][j] = j; + } + for (i = 1; i <= b.length; i++) { + for (j = 1; j <= a.length; j++) { + if (b.charAt(i - 1) === a.charAt(j - 1)) { + matrix[i][j] = matrix[i - 1][j - 1]; + } else { + matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1)); + } + } + } + return matrix[b.length][a.length]; +} +function newDistanceFn(str) { + return function(x, y) { + var xValue = str(x).trim(); + var yValue = str(y).trim(); + var lev = levenshtein(xValue, yValue); + return lev / (xValue.length + yValue.length); + }; +} +function newMatcherFn(distance2) { + function findBestMatch(a, b, cache) { + if (cache === void 0) { + cache = new Map(); + } + var bestMatchDist = Infinity; + var bestMatch; + for (var i = 0; i < a.length; ++i) { + for (var j = 0; j < b.length; ++j) { + var cacheKey = JSON.stringify([a[i], b[j]]); + var md = void 0; + if (!(cache.has(cacheKey) && (md = cache.get(cacheKey)))) { + md = distance2(a[i], b[j]); + cache.set(cacheKey, md); + } + if (md < bestMatchDist) { + bestMatchDist = md; + bestMatch = { indexA: i, indexB: j, score: bestMatchDist }; + } + } + } + return bestMatch; + } + function group(a, b, level, cache) { + if (level === void 0) { + level = 0; + } + if (cache === void 0) { + cache = new Map(); + } + var bm = findBestMatch(a, b, cache); + if (!bm || a.length + b.length < 3) { + return [[a, b]]; + } + var a1 = a.slice(0, bm.indexA); + var b1 = b.slice(0, bm.indexB); + var aMatch = [a[bm.indexA]]; + var bMatch = [b[bm.indexB]]; + var tailA = bm.indexA + 1; + var tailB = bm.indexB + 1; + var a2 = a.slice(tailA); + var b2 = b.slice(tailB); + var group1 = group(a1, b1, level + 1, cache); + var groupMatch = group(aMatch, bMatch, level + 1, cache); + var group2 = group(a2, b2, level + 1, cache); + var result = groupMatch; + if (bm.indexA > 0 || bm.indexB > 0) { + result = group1.concat(result); + } + if (a.length > tailA || b.length > tailB) { + result = result.concat(group2); + } + return result; + } + return group; +} + +// node_modules/diff2html/lib-esm/render-utils.js +var __assign = function() { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +var CSSLineClass = { + INSERTS: "d2h-ins", + DELETES: "d2h-del", + CONTEXT: "d2h-cntx", + INFO: "d2h-info", + INSERT_CHANGES: "d2h-ins d2h-change", + DELETE_CHANGES: "d2h-del d2h-change" +}; +var defaultRenderConfig = { + matching: LineMatchingType.NONE, + matchWordsThreshold: 0.25, + maxLineLengthHighlight: 1e4, + diffStyle: DiffStyleType.WORD +}; +var separator = "/"; +var distance = newDistanceFn(function(change) { + return change.value; +}); +var matcher = newMatcherFn(distance); +function isDevNullName(name) { + return name.indexOf("dev/null") !== -1; +} +function removeInsElements(line) { + return line.replace(/(]*>((.|\n)*?)<\/ins>)/g, ""); +} +function removeDelElements(line) { + return line.replace(/(]*>((.|\n)*?)<\/del>)/g, ""); +} +function toCSSClass(lineType) { + switch (lineType) { + case LineType.CONTEXT: + return CSSLineClass.CONTEXT; + case LineType.INSERT: + return CSSLineClass.INSERTS; + case LineType.DELETE: + return CSSLineClass.DELETES; + } +} +function prefixLength(isCombined) { + return isCombined ? 2 : 1; +} +function escapeForHtml(str) { + return str.slice(0).replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/"); +} +function deconstructLine(line, isCombined, escape) { + if (escape === void 0) { + escape = true; + } + var indexToSplit = prefixLength(isCombined); + return { + prefix: line.substring(0, indexToSplit), + content: escape ? escapeForHtml(line.substring(indexToSplit)) : line.substring(indexToSplit) + }; +} +function filenameDiff(file) { + var oldFilename = unifyPath(file.oldName); + var newFilename = unifyPath(file.newName); + if (oldFilename !== newFilename && !isDevNullName(oldFilename) && !isDevNullName(newFilename)) { + var prefixPaths = []; + var suffixPaths = []; + var oldFilenameParts = oldFilename.split(separator); + var newFilenameParts = newFilename.split(separator); + var oldFilenamePartsSize = oldFilenameParts.length; + var newFilenamePartsSize = newFilenameParts.length; + var i = 0; + var j = oldFilenamePartsSize - 1; + var k = newFilenamePartsSize - 1; + while (i < j && i < k) { + if (oldFilenameParts[i] === newFilenameParts[i]) { + prefixPaths.push(newFilenameParts[i]); + i += 1; + } else { + break; + } + } + while (j > i && k > i) { + if (oldFilenameParts[j] === newFilenameParts[k]) { + suffixPaths.unshift(newFilenameParts[k]); + j -= 1; + k -= 1; + } else { + break; + } + } + var finalPrefix = prefixPaths.join(separator); + var finalSuffix = suffixPaths.join(separator); + var oldRemainingPath = oldFilenameParts.slice(i, j + 1).join(separator); + var newRemainingPath = newFilenameParts.slice(i, k + 1).join(separator); + if (finalPrefix.length && finalSuffix.length) { + return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; + } else if (finalPrefix.length) { + return finalPrefix + separator + "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}"; + } else if (finalSuffix.length) { + return "{" + oldRemainingPath + " \u2192 " + newRemainingPath + "}" + separator + finalSuffix; + } + return oldFilename + " \u2192 " + newFilename; + } else if (!isDevNullName(newFilename)) { + return newFilename; + } else { + return oldFilename; + } +} +function getHtmlId(file) { + return "d2h-".concat(hashCode(filenameDiff(file)).toString().slice(-6)); +} +function getFileIcon(file) { + var templateName = "file-changed"; + if (file.isRename) { + templateName = "file-renamed"; + } else if (file.isCopy) { + templateName = "file-renamed"; + } else if (file.isNew) { + templateName = "file-added"; + } else if (file.isDeleted) { + templateName = "file-deleted"; + } else if (file.newName !== file.oldName) { + templateName = "file-renamed"; + } + return templateName; +} +function diffHighlight(diffLine1, diffLine2, isCombined, config) { + if (config === void 0) { + config = {}; + } + var _a2 = __assign(__assign({}, defaultRenderConfig), config), matching = _a2.matching, maxLineLengthHighlight = _a2.maxLineLengthHighlight, matchWordsThreshold = _a2.matchWordsThreshold, diffStyle = _a2.diffStyle; + var line1 = deconstructLine(diffLine1, isCombined, false); + var line2 = deconstructLine(diffLine2, isCombined, false); + if (line1.content.length > maxLineLengthHighlight || line2.content.length > maxLineLengthHighlight) { + return { + oldLine: { + prefix: line1.prefix, + content: escapeForHtml(line1.content) + }, + newLine: { + prefix: line2.prefix, + content: escapeForHtml(line2.content) + } + }; + } + var diff2 = diffStyle === "char" ? diffChars(line1.content, line2.content) : diffWordsWithSpace(line1.content, line2.content); + var changedWords = []; + if (diffStyle === "word" && matching === "words") { + var removed = diff2.filter(function(element2) { + return element2.removed; + }); + var added = diff2.filter(function(element2) { + return element2.added; + }); + var chunks = matcher(added, removed); + chunks.forEach(function(chunk) { + if (chunk[0].length === 1 && chunk[1].length === 1) { + var dist = distance(chunk[0][0], chunk[1][0]); + if (dist < matchWordsThreshold) { + changedWords.push(chunk[0][0]); + changedWords.push(chunk[1][0]); + } + } + }); + } + var highlightedLine = diff2.reduce(function(highlightedLine2, part) { + var elemType = part.added ? "ins" : part.removed ? "del" : null; + var addClass = changedWords.indexOf(part) > -1 ? ' class="d2h-change"' : ""; + var escapedValue = escapeForHtml(part.value); + return elemType !== null ? "".concat(highlightedLine2, "<").concat(elemType).concat(addClass, ">").concat(escapedValue, "") : "".concat(highlightedLine2).concat(escapedValue); + }, ""); + return { + oldLine: { + prefix: line1.prefix, + content: removeInsElements(highlightedLine) + }, + newLine: { + prefix: line2.prefix, + content: removeDelElements(highlightedLine) + } + }; +} + +// node_modules/diff2html/lib-esm/file-list-renderer.js +var baseTemplatesPath = "file-summary"; +var iconsBaseTemplatesPath = "icon"; +function render(diffFiles, hoganUtils) { + var files = diffFiles.map(function(file) { + return hoganUtils.render(baseTemplatesPath, "line", { + fileHtmlId: getHtmlId(file), + oldName: file.oldName, + newName: file.newName, + fileName: filenameDiff(file), + deletedLines: "-" + file.deletedLines, + addedLines: "+" + file.addedLines + }, { + fileIcon: hoganUtils.template(iconsBaseTemplatesPath, getFileIcon(file)) + }); + }).join("\n"); + return hoganUtils.render(baseTemplatesPath, "wrapper", { + filesNumber: diffFiles.length, + files + }); +} + +// node_modules/diff2html/lib-esm/line-by-line-renderer.js +init_polyfill_buffer(); +var __assign2 = function() { + __assign2 = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign2.apply(this, arguments); +}; +var defaultLineByLineRendererConfig = __assign2(__assign2({}, defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); +var genericTemplatesPath = "generic"; +var baseTemplatesPath2 = "line-by-line"; +var iconsBaseTemplatesPath2 = "icon"; +var tagsBaseTemplatesPath = "tag"; +var LineByLineRenderer = function() { + function LineByLineRenderer2(hoganUtils, config) { + if (config === void 0) { + config = {}; + } + this.hoganUtils = hoganUtils; + this.config = __assign2(__assign2({}, defaultLineByLineRendererConfig), config); + } + LineByLineRenderer2.prototype.render = function(diffFiles) { + var _this = this; + var diffsHtml = diffFiles.map(function(file) { + var diffs; + if (file.blocks.length) { + diffs = _this.generateFileHtml(file); + } else { + diffs = _this.generateEmptyDiff(); + } + return _this.makeFileDiffHtml(file, diffs); + }).join("\n"); + return this.hoganUtils.render(genericTemplatesPath, "wrapper", { content: diffsHtml }); + }; + LineByLineRenderer2.prototype.makeFileDiffHtml = function(file, diffs) { + if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) + return ""; + var fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath2, "file-diff"); + var filePathTemplate = this.hoganUtils.template(genericTemplatesPath, "file-path"); + var fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath2, "file"); + var fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath, getFileIcon(file)); + return fileDiffTemplate.render({ + file, + fileHtmlId: getHtmlId(file), + diffs, + filePath: filePathTemplate.render({ + fileDiffName: filenameDiff(file) + }, { + fileIcon: fileIconTemplate, + fileTag: fileTagTemplate + }) + }); + }; + LineByLineRenderer2.prototype.generateEmptyDiff = function() { + return this.hoganUtils.render(genericTemplatesPath, "empty-diff", { + contentClass: "d2h-code-line", + CSSLineClass + }); + }; + LineByLineRenderer2.prototype.generateFileHtml = function(file) { + var _this = this; + var matcher2 = newMatcherFn(newDistanceFn(function(e) { + return deconstructLine(e.content, file.isCombined).content; + })); + return file.blocks.map(function(block) { + var lines = _this.hoganUtils.render(genericTemplatesPath, "block-header", { + CSSLineClass, + blockHeader: file.isTooBig ? block.header : escapeForHtml(block.header), + lineClass: "d2h-code-linenumber", + contentClass: "d2h-code-line" + }); + _this.applyLineGroupping(block).forEach(function(_a2) { + var contextLines = _a2[0], oldLines = _a2[1], newLines = _a2[2]; + if (oldLines.length && newLines.length && !contextLines.length) { + _this.applyRematchMatching(oldLines, newLines, matcher2).map(function(_a3) { + var oldLines2 = _a3[0], newLines2 = _a3[1]; + var _b2 = _this.processChangedLines(file.isCombined, oldLines2, newLines2), left2 = _b2.left, right2 = _b2.right; + lines += left2; + lines += right2; + }); + } else if (contextLines.length) { + contextLines.forEach(function(line) { + var _a3 = deconstructLine(line.content, file.isCombined), prefix = _a3.prefix, content = _a3.content; + lines += _this.generateSingleLineHtml({ + type: CSSLineClass.CONTEXT, + prefix, + content, + oldNumber: line.oldNumber, + newNumber: line.newNumber + }); + }); + } else if (oldLines.length || newLines.length) { + var _b = _this.processChangedLines(file.isCombined, oldLines, newLines), left = _b.left, right = _b.right; + lines += left; + lines += right; + } else { + console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); + } + }); + return lines; + }).join("\n"); + }; + LineByLineRenderer2.prototype.applyLineGroupping = function(block) { + var blockLinesGroups = []; + var oldLines = []; + var newLines = []; + for (var i = 0; i < block.lines.length; i++) { + var diffLine = block.lines[i]; + if (diffLine.type !== LineType.INSERT && newLines.length || diffLine.type === LineType.CONTEXT && oldLines.length > 0) { + blockLinesGroups.push([[], oldLines, newLines]); + oldLines = []; + newLines = []; + } + if (diffLine.type === LineType.CONTEXT) { + blockLinesGroups.push([[diffLine], [], []]); + } else if (diffLine.type === LineType.INSERT && oldLines.length === 0) { + blockLinesGroups.push([[], [], [diffLine]]); + } else if (diffLine.type === LineType.INSERT && oldLines.length > 0) { + newLines.push(diffLine); + } else if (diffLine.type === LineType.DELETE) { + oldLines.push(diffLine); + } + } + if (oldLines.length || newLines.length) { + blockLinesGroups.push([[], oldLines, newLines]); + oldLines = []; + newLines = []; + } + return blockLinesGroups; + }; + LineByLineRenderer2.prototype.applyRematchMatching = function(oldLines, newLines, matcher2) { + var comparisons = oldLines.length * newLines.length; + var maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map(function(elem) { + return elem.content.length; + }))); + var doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); + return doMatching ? matcher2(oldLines, newLines) : [[oldLines, newLines]]; + }; + LineByLineRenderer2.prototype.processChangedLines = function(isCombined, oldLines, newLines) { + var fileHtml = { + right: "", + left: "" + }; + var maxLinesNumber = Math.max(oldLines.length, newLines.length); + for (var i = 0; i < maxLinesNumber; i++) { + var oldLine = oldLines[i]; + var newLine = newLines[i]; + var diff2 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; + var preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? __assign2(__assign2({}, diff2 !== void 0 ? { + prefix: diff2.oldLine.prefix, + content: diff2.oldLine.content, + type: CSSLineClass.DELETE_CHANGES + } : __assign2(__assign2({}, deconstructLine(oldLine.content, isCombined)), { type: toCSSClass(oldLine.type) })), { oldNumber: oldLine.oldNumber, newNumber: oldLine.newNumber }) : void 0; + var preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? __assign2(__assign2({}, diff2 !== void 0 ? { + prefix: diff2.newLine.prefix, + content: diff2.newLine.content, + type: CSSLineClass.INSERT_CHANGES + } : __assign2(__assign2({}, deconstructLine(newLine.content, isCombined)), { type: toCSSClass(newLine.type) })), { oldNumber: newLine.oldNumber, newNumber: newLine.newNumber }) : void 0; + var _a2 = this.generateLineHtml(preparedOldLine, preparedNewLine), left = _a2.left, right = _a2.right; + fileHtml.left += left; + fileHtml.right += right; + } + return fileHtml; + }; + LineByLineRenderer2.prototype.generateLineHtml = function(oldLine, newLine) { + return { + left: this.generateSingleLineHtml(oldLine), + right: this.generateSingleLineHtml(newLine) + }; + }; + LineByLineRenderer2.prototype.generateSingleLineHtml = function(line) { + if (line === void 0) + return ""; + var lineNumberHtml = this.hoganUtils.render(baseTemplatesPath2, "numbers", { + oldNumber: line.oldNumber || "", + newNumber: line.newNumber || "" + }); + return this.hoganUtils.render(genericTemplatesPath, "line", { + type: line.type, + lineClass: "d2h-code-linenumber", + contentClass: "d2h-code-line", + prefix: line.prefix === " " ? " " : line.prefix, + content: line.content, + lineNumber: lineNumberHtml + }); + }; + return LineByLineRenderer2; +}(); +var line_by_line_renderer_default = LineByLineRenderer; + +// node_modules/diff2html/lib-esm/side-by-side-renderer.js +init_polyfill_buffer(); +var __assign3 = function() { + __assign3 = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign3.apply(this, arguments); +}; +var defaultSideBySideRendererConfig = __assign3(__assign3({}, defaultRenderConfig), { renderNothingWhenEmpty: false, matchingMaxComparisons: 2500, maxLineSizeInBlockForComparison: 200 }); +var genericTemplatesPath2 = "generic"; +var baseTemplatesPath3 = "side-by-side"; +var iconsBaseTemplatesPath3 = "icon"; +var tagsBaseTemplatesPath2 = "tag"; +var SideBySideRenderer = function() { + function SideBySideRenderer2(hoganUtils, config) { + if (config === void 0) { + config = {}; + } + this.hoganUtils = hoganUtils; + this.config = __assign3(__assign3({}, defaultSideBySideRendererConfig), config); + } + SideBySideRenderer2.prototype.render = function(diffFiles) { + var _this = this; + var diffsHtml = diffFiles.map(function(file) { + var diffs; + if (file.blocks.length) { + diffs = _this.generateFileHtml(file); + } else { + diffs = _this.generateEmptyDiff(); + } + return _this.makeFileDiffHtml(file, diffs); + }).join("\n"); + return this.hoganUtils.render(genericTemplatesPath2, "wrapper", { content: diffsHtml }); + }; + SideBySideRenderer2.prototype.makeFileDiffHtml = function(file, diffs) { + if (this.config.renderNothingWhenEmpty && Array.isArray(file.blocks) && file.blocks.length === 0) + return ""; + var fileDiffTemplate = this.hoganUtils.template(baseTemplatesPath3, "file-diff"); + var filePathTemplate = this.hoganUtils.template(genericTemplatesPath2, "file-path"); + var fileIconTemplate = this.hoganUtils.template(iconsBaseTemplatesPath3, "file"); + var fileTagTemplate = this.hoganUtils.template(tagsBaseTemplatesPath2, getFileIcon(file)); + return fileDiffTemplate.render({ + file, + fileHtmlId: getHtmlId(file), + diffs, + filePath: filePathTemplate.render({ + fileDiffName: filenameDiff(file) + }, { + fileIcon: fileIconTemplate, + fileTag: fileTagTemplate + }) + }); + }; + SideBySideRenderer2.prototype.generateEmptyDiff = function() { + return { + right: "", + left: this.hoganUtils.render(genericTemplatesPath2, "empty-diff", { + contentClass: "d2h-code-side-line", + CSSLineClass + }) + }; + }; + SideBySideRenderer2.prototype.generateFileHtml = function(file) { + var _this = this; + var matcher2 = newMatcherFn(newDistanceFn(function(e) { + return deconstructLine(e.content, file.isCombined).content; + })); + return file.blocks.map(function(block) { + var fileHtml = { + left: _this.makeHeaderHtml(block.header, file), + right: _this.makeHeaderHtml("") + }; + _this.applyLineGroupping(block).forEach(function(_a2) { + var contextLines = _a2[0], oldLines = _a2[1], newLines = _a2[2]; + if (oldLines.length && newLines.length && !contextLines.length) { + _this.applyRematchMatching(oldLines, newLines, matcher2).map(function(_a3) { + var oldLines2 = _a3[0], newLines2 = _a3[1]; + var _b2 = _this.processChangedLines(file.isCombined, oldLines2, newLines2), left2 = _b2.left, right2 = _b2.right; + fileHtml.left += left2; + fileHtml.right += right2; + }); + } else if (contextLines.length) { + contextLines.forEach(function(line) { + var _a3 = deconstructLine(line.content, file.isCombined), prefix = _a3.prefix, content = _a3.content; + var _b2 = _this.generateLineHtml({ + type: CSSLineClass.CONTEXT, + prefix, + content, + number: line.oldNumber + }, { + type: CSSLineClass.CONTEXT, + prefix, + content, + number: line.newNumber + }), left2 = _b2.left, right2 = _b2.right; + fileHtml.left += left2; + fileHtml.right += right2; + }); + } else if (oldLines.length || newLines.length) { + var _b = _this.processChangedLines(file.isCombined, oldLines, newLines), left = _b.left, right = _b.right; + fileHtml.left += left; + fileHtml.right += right; + } else { + console.error("Unknown state reached while processing groups of lines", contextLines, oldLines, newLines); + } + }); + return fileHtml; + }).reduce(function(accomulated, html2) { + return { left: accomulated.left + html2.left, right: accomulated.right + html2.right }; + }, { left: "", right: "" }); + }; + SideBySideRenderer2.prototype.applyLineGroupping = function(block) { + var blockLinesGroups = []; + var oldLines = []; + var newLines = []; + for (var i = 0; i < block.lines.length; i++) { + var diffLine = block.lines[i]; + if (diffLine.type !== LineType.INSERT && newLines.length || diffLine.type === LineType.CONTEXT && oldLines.length > 0) { + blockLinesGroups.push([[], oldLines, newLines]); + oldLines = []; + newLines = []; + } + if (diffLine.type === LineType.CONTEXT) { + blockLinesGroups.push([[diffLine], [], []]); + } else if (diffLine.type === LineType.INSERT && oldLines.length === 0) { + blockLinesGroups.push([[], [], [diffLine]]); + } else if (diffLine.type === LineType.INSERT && oldLines.length > 0) { + newLines.push(diffLine); + } else if (diffLine.type === LineType.DELETE) { + oldLines.push(diffLine); + } + } + if (oldLines.length || newLines.length) { + blockLinesGroups.push([[], oldLines, newLines]); + oldLines = []; + newLines = []; + } + return blockLinesGroups; + }; + SideBySideRenderer2.prototype.applyRematchMatching = function(oldLines, newLines, matcher2) { + var comparisons = oldLines.length * newLines.length; + var maxLineSizeInBlock = Math.max.apply(null, [0].concat(oldLines.concat(newLines).map(function(elem) { + return elem.content.length; + }))); + var doMatching = comparisons < this.config.matchingMaxComparisons && maxLineSizeInBlock < this.config.maxLineSizeInBlockForComparison && (this.config.matching === "lines" || this.config.matching === "words"); + return doMatching ? matcher2(oldLines, newLines) : [[oldLines, newLines]]; + }; + SideBySideRenderer2.prototype.makeHeaderHtml = function(blockHeader, file) { + return this.hoganUtils.render(genericTemplatesPath2, "block-header", { + CSSLineClass, + blockHeader: (file === null || file === void 0 ? void 0 : file.isTooBig) ? blockHeader : escapeForHtml(blockHeader), + lineClass: "d2h-code-side-linenumber", + contentClass: "d2h-code-side-line" + }); + }; + SideBySideRenderer2.prototype.processChangedLines = function(isCombined, oldLines, newLines) { + var fileHtml = { + right: "", + left: "" + }; + var maxLinesNumber = Math.max(oldLines.length, newLines.length); + for (var i = 0; i < maxLinesNumber; i++) { + var oldLine = oldLines[i]; + var newLine = newLines[i]; + var diff2 = oldLine !== void 0 && newLine !== void 0 ? diffHighlight(oldLine.content, newLine.content, isCombined, this.config) : void 0; + var preparedOldLine = oldLine !== void 0 && oldLine.oldNumber !== void 0 ? __assign3(__assign3({}, diff2 !== void 0 ? { + prefix: diff2.oldLine.prefix, + content: diff2.oldLine.content, + type: CSSLineClass.DELETE_CHANGES + } : __assign3(__assign3({}, deconstructLine(oldLine.content, isCombined)), { type: toCSSClass(oldLine.type) })), { number: oldLine.oldNumber }) : void 0; + var preparedNewLine = newLine !== void 0 && newLine.newNumber !== void 0 ? __assign3(__assign3({}, diff2 !== void 0 ? { + prefix: diff2.newLine.prefix, + content: diff2.newLine.content, + type: CSSLineClass.INSERT_CHANGES + } : __assign3(__assign3({}, deconstructLine(newLine.content, isCombined)), { type: toCSSClass(newLine.type) })), { number: newLine.newNumber }) : void 0; + var _a2 = this.generateLineHtml(preparedOldLine, preparedNewLine), left = _a2.left, right = _a2.right; + fileHtml.left += left; + fileHtml.right += right; + } + return fileHtml; + }; + SideBySideRenderer2.prototype.generateLineHtml = function(oldLine, newLine) { + return { + left: this.generateSingleHtml(oldLine), + right: this.generateSingleHtml(newLine) + }; + }; + SideBySideRenderer2.prototype.generateSingleHtml = function(line) { + var lineClass = "d2h-code-side-linenumber"; + var contentClass = "d2h-code-side-line"; + return this.hoganUtils.render(genericTemplatesPath2, "line", { + type: (line === null || line === void 0 ? void 0 : line.type) || "".concat(CSSLineClass.CONTEXT, " d2h-emptyplaceholder"), + lineClass: line !== void 0 ? lineClass : "".concat(lineClass, " d2h-code-side-emptyplaceholder"), + contentClass: line !== void 0 ? contentClass : "".concat(contentClass, " d2h-code-side-emptyplaceholder"), + prefix: (line === null || line === void 0 ? void 0 : line.prefix) === " " ? " " : line === null || line === void 0 ? void 0 : line.prefix, + content: line === null || line === void 0 ? void 0 : line.content, + lineNumber: line === null || line === void 0 ? void 0 : line.number + }); + }; + return SideBySideRenderer2; +}(); +var side_by_side_renderer_default = SideBySideRenderer; + +// node_modules/diff2html/lib-esm/hoganjs-utils.js +init_polyfill_buffer(); +var Hogan3 = __toModule(require_hogan()); + +// node_modules/diff2html/lib-esm/diff2html-templates.js +init_polyfill_buffer(); +var Hogan2 = __toModule(require_hogan()); +var defaultTemplates = {}; +defaultTemplates["file-summary-line"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('
  • '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(t.rp("'); + t.b(t.v(t.f("fileName", c, p, 0))); + t.b(""); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(' '); + t.b(t.v(t.f("addedLines", c, p, 0))); + t.b(""); + t.b("\n" + i); + t.b(' '); + t.b(t.v(t.f("deletedLines", c, p, 0))); + t.b(""); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b("
  • "); + return t.fl(); +}, partials: { "'); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b(' Files changed ('); + t.b(t.v(t.f("filesNumber", c, p, 0))); + t.b(")"); + t.b("\n" + i); + t.b(' hide'); + t.b("\n" + i); + t.b(' show'); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b('
      '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.f("files", c, p, 0))); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b(""); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["generic-block-header"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b(""); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b('
    '); + t.b(t.t(t.f("blockHeader", c, p, 0))); + t.b("
    "); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b(""); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["generic-empty-diff"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b(""); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b(" File without changes"); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b(""); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["generic-file-path"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b(''); + t.b("\n" + i); + t.b(t.rp("'); + t.b(t.v(t.f("fileDiffName", c, p, 0))); + t.b(""); + t.b("\n" + i); + t.b(t.rp(""); + t.b("\n" + i); + t.b('"); + return t.fl(); +}, partials: { ""); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.f("lineNumber", c, p, 0))); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + if (t.s(t.f("prefix", c, p, 1), c, p, 0, 162, 238, "{{ }}")) { + t.rs(c, p, function(c2, p2, t2) { + t2.b(' '); + t2.b(t2.t(t2.f("prefix", c2, p2, 0))); + t2.b(""); + t2.b("\n" + i); + }); + c.pop(); + } + if (!t.s(t.f("prefix", c, p, 1), c, p, 1, 0, 0, "")) { + t.b('  '); + t.b("\n" + i); + } + ; + if (t.s(t.f("content", c, p, 1), c, p, 0, 371, 445, "{{ }}")) { + t.rs(c, p, function(c2, p2, t2) { + t2.b(' '); + t2.b(t2.t(t2.f("content", c2, p2, 0))); + t2.b(""); + t2.b("\n" + i); + }); + c.pop(); + } + if (!t.s(t.f("content", c, p, 1), c, p, 1, 0, 0, "")) { + t.b('
    '); + t.b("\n" + i); + } + ; + t.b("
    "); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b(""); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["generic-wrapper"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('
    '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.f("content", c, p, 0))); + t.b("\n" + i); + t.b("
    "); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["icon-file-added"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('"); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["icon-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('"); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["icon-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('"); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["icon-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('"); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["icon-file"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('"); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["line-by-line-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('
    '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.f("filePath", c, p, 0))); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.f("diffs", c, p, 0))); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["line-by-line-numbers"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('
    '); + t.b(t.v(t.f("oldNumber", c, p, 0))); + t.b("
    "); + t.b("\n" + i); + t.b('
    '); + t.b(t.v(t.f("newNumber", c, p, 0))); + t.b("
    "); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["side-by-side-file-diff"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('
    '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.f("filePath", c, p, 0))); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.d("diffs.left", c, p, 0))); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b('
    '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(' '); + t.b("\n" + i); + t.b(" "); + t.b(t.t(t.d("diffs.right", c, p, 0))); + t.b("\n" + i); + t.b(" "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + t.b("\n" + i); + t.b("
    "); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["tag-file-added"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('ADDED'); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["tag-file-changed"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('CHANGED'); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["tag-file-deleted"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('DELETED'); + return t.fl(); +}, partials: {}, subs: {} }); +defaultTemplates["tag-file-renamed"] = new Hogan2.Template({ code: function(c, p, i) { + var t = this; + t.b(i = i || ""); + t.b('RENAMED'); + return t.fl(); +}, partials: {}, subs: {} }); + +// node_modules/diff2html/lib-esm/hoganjs-utils.js +var __assign4 = function() { + __assign4 = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign4.apply(this, arguments); +}; +var HoganJsUtils = function() { + function HoganJsUtils2(_a2) { + var _b = _a2.compiledTemplates, compiledTemplates = _b === void 0 ? {} : _b, _c = _a2.rawTemplates, rawTemplates = _c === void 0 ? {} : _c; + var compiledRawTemplates = Object.entries(rawTemplates).reduce(function(previousTemplates, _a3) { + var _b2; + var name = _a3[0], templateString = _a3[1]; + var compiledTemplate = Hogan3.compile(templateString, { asString: false }); + return __assign4(__assign4({}, previousTemplates), (_b2 = {}, _b2[name] = compiledTemplate, _b2)); + }, {}); + this.preCompiledTemplates = __assign4(__assign4(__assign4({}, defaultTemplates), compiledTemplates), compiledRawTemplates); + } + HoganJsUtils2.compile = function(templateString) { + return Hogan3.compile(templateString, { asString: false }); + }; + HoganJsUtils2.prototype.render = function(namespace, view, params, partials, indent2) { + var templateKey = this.templateKey(namespace, view); + try { + var template = this.preCompiledTemplates[templateKey]; + return template.render(params, partials, indent2); + } catch (e) { + throw new Error("Could not find template to render '".concat(templateKey, "'")); + } + }; + HoganJsUtils2.prototype.template = function(namespace, view) { + return this.preCompiledTemplates[this.templateKey(namespace, view)]; + }; + HoganJsUtils2.prototype.templateKey = function(namespace, view) { + return "".concat(namespace, "-").concat(view); + }; + return HoganJsUtils2; +}(); +var hoganjs_utils_default = HoganJsUtils; + +// node_modules/diff2html/lib-esm/diff2html.js +var __assign5 = function() { + __assign5 = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign5.apply(this, arguments); +}; +var defaultDiff2HtmlConfig = __assign5(__assign5(__assign5({}, defaultLineByLineRendererConfig), defaultSideBySideRendererConfig), { outputFormat: OutputFormatType.LINE_BY_LINE, drawFileList: true }); +function html(diffInput, configuration) { + if (configuration === void 0) { + configuration = {}; + } + var config = __assign5(__assign5({}, defaultDiff2HtmlConfig), configuration); + var diffJson = typeof diffInput === "string" ? parse(diffInput, config) : diffInput; + var hoganUtils = new hoganjs_utils_default(config); + var fileList = config.drawFileList ? render(diffJson, hoganUtils) : ""; + var diffOutput = config.outputFormat === "side-by-side" ? new side_by_side_renderer_default(hoganUtils, config).render(diffJson) : new line_by_line_renderer_default(hoganUtils, config).render(diffJson); + return fileList + diffOutput; +} + +// src/ui/diff/diffView.ts +var import_obsidian13 = __toModule(require("obsidian")); +var DiffView = class extends import_obsidian13.ItemView { constructor(leaf, plugin) { super(leaf); this.plugin = plugin; this.gettingDiff = false; this.parser = new DOMParser(); + this.navigation = true; addEventListener("git-refresh", this.refresh.bind(this)); } getViewType() { @@ -11383,12 +26519,10 @@ var DiffView = class extends import_obsidian7.ItemView { getIcon() { return DIFF_VIEW_CONFIG.icon; } - setState(state, result) { - return __async(this, null, function* () { - this.state = state; - yield this.refresh(); - return; - }); + async setState(state, result) { + this.state = state; + await this.refresh(); + return; } getState() { return this.state; @@ -11401,35 +26535,43 @@ var DiffView = class extends import_obsidian7.ItemView { this.refresh(); return super.onOpen(); } - refresh() { - return __async(this, null, function* () { - var _a2; - if (((_a2 = this.state) == null ? void 0 : _a2.file) && !this.gettingDiff && this.plugin.gitManager) { - this.gettingDiff = true; - const diff = this.parser.parseFromString((0, import_diff2html.html)(yield this.plugin.gitManager.getDiffString(this.state.file, this.state.staged)), "text/html").querySelector(".d2h-file-diff"); - this.contentEl.empty(); - if (diff) { - this.contentEl.append(diff); - } else { - const div = this.contentEl.createDiv({ cls: "diff-err" }); - div.createSpan({ text: "\u26A0\uFE0F", cls: "diff-err-sign" }); - div.createEl("br"); - div.createSpan({ text: "No changes to " + this.state.file }); - } - this.gettingDiff = false; + async refresh() { + var _a2; + if (((_a2 = this.state) == null ? void 0 : _a2.file) && !this.gettingDiff && this.plugin.gitManager) { + this.gettingDiff = true; + let diff2 = await this.plugin.gitManager.getDiffString(this.state.file, this.state.staged); + this.contentEl.empty(); + if (!diff2) { + const content = await this.app.vault.adapter.read(this.plugin.gitManager.getVaultPath(this.state.file)); + const header = `--- /dev/null ++++ ${this.state.file} +@@ -0,0 +1,${content.split("\n").length} @@`; + diff2 = [...header.split("\n"), ...content.split("\n").map((line) => `+${line}`)].join("\n"); } - }); + const diffEl = this.parser.parseFromString(html(diff2), "text/html").querySelector(".d2h-file-diff"); + this.contentEl.append(diffEl); + this.gettingDiff = false; + } } }; -// src/ui/modals/generalModal.ts -var import_obsidian8 = __toModule(require("obsidian")); -var GeneralModal = class extends import_obsidian8.SuggestModal { - constructor(app2, remotes, placeholder) { - super(app2); - this.resolve = null; - this.list = remotes; - this.setPlaceholder(placeholder); +// src/ui/modals/branchModal.ts +init_polyfill_buffer(); +var import_obsidian14 = __toModule(require("obsidian")); +var BranchModal = class extends import_obsidian14.FuzzySuggestModal { + constructor(branches) { + super(app); + this.branches = branches; + this.setPlaceholder("Select branch to checkout"); + } + getItems() { + return this.branches; + } + getItemText(item) { + return item; + } + onChooseItem(item, evt) { + this.resolve(item); } open() { super.open(); @@ -11437,29 +26579,61 @@ var GeneralModal = class extends import_obsidian8.SuggestModal { this.resolve = resolve; }); } - selectSuggestion(value, evt) { - if (this.resolve) - this.resolve(value); - super.selectSuggestion(value, evt); - } - onClose() { + async onClose() { + await new Promise((resolve) => setTimeout(resolve, 10)); if (this.resolve) this.resolve(void 0); } - getSuggestions(query) { - return [query.length > 0 ? query : "...", ...this.list]; +}; + +// src/ui/modals/ignoreModal.ts +init_polyfill_buffer(); +var import_obsidian15 = __toModule(require("obsidian")); +var IgnoreModal = class extends import_obsidian15.Modal { + constructor(app2, content) { + super(app2); + this.content = content; + this.resolve = null; } - renderSuggestion(value, el) { - el.innerText = value; + open() { + super.open(); + return new Promise((resolve) => { + this.resolve = resolve; + }); } - onChooseSuggestion(item, _) { + onOpen() { + const { contentEl, titleEl } = this; + titleEl.setText("Edit .gitignore"); + const div = contentEl.createDiv(); + const text2 = div.createEl("textarea", { + text: this.content, + cls: ["obsidian-git-textarea"], + attr: { rows: 10, cols: 30, wrap: "off" } + }); + div.createEl("button", { + cls: ["mod-cta", "obsidian-git-center-button"], + text: "Save" + }).addEventListener("click", async () => { + this.resolve(text2.value); + this.close(); + }); + } + onClose() { + const { contentEl } = this; + this.resolve(void 0); + contentEl.empty(); } }; // src/ui/sidebar/sidebarView.ts -var import_obsidian14 = __toModule(require("obsidian")); +init_polyfill_buffer(); +var import_obsidian22 = __toModule(require("obsidian")); + +// src/ui/sidebar/gitView.svelte +init_polyfill_buffer(); // node_modules/svelte/internal/index.mjs +init_polyfill_buffer(); function noop() { } var identity = (x) => x; @@ -11543,6 +26717,7 @@ function append_empty_stylesheet(node) { } function append_stylesheet(node, style) { append2(node.head || node, style); + return style.sheet; } function insert(target, node, anchor) { target.insertBefore(node, anchor || null); @@ -11595,6 +26770,13 @@ function set_data(text2, data) { function set_input_value(input, value) { input.value = value == null ? "" : value; } +function set_style(node, key2, value, important) { + if (value === null) { + node.style.removeProperty(key2); + } else { + node.style.setProperty(key2, value, important ? "important" : ""); + } +} function toggle_class(element2, name, toggle) { element2.classList[toggle ? "add" : "remove"](name); } @@ -11655,11 +26837,9 @@ function clear_rules() { if (active) return; managed_styles.forEach((info) => { - const { stylesheet } = info; - let i = stylesheet.cssRules.length; - while (i--) - stylesheet.deleteRule(i); - info.rules = {}; + const { ownerNode } = info.stylesheet; + if (ownerNode) + detach(ownerNode); }); managed_styles.clear(); }); @@ -11802,7 +26982,7 @@ function create_bidirectional_transition(node, fn, params, intro) { if (animation_name) delete_rule(node, animation_name); } - function init2(program, duration) { + function init3(program, duration) { const d = program.b - t; duration *= Math.abs(d); return { @@ -11834,11 +27014,11 @@ function create_bidirectional_transition(node, fn, params, intro) { } if (b) tick2(0, 1); - running_program = init2(program, duration); + running_program = init3(program, duration); add_render_callback(() => dispatch(node, b, "start")); loop((now2) => { if (pending_program && now2 > pending_program.start) { - running_program = init2(pending_program, duration); + running_program = init3(pending_program, duration); pending_program = null; dispatch(node, running_program.b, "start"); if (css) { @@ -11900,7 +27080,9 @@ var boolean_attributes = new Set([ "disabled", "formnovalidate", "hidden", + "inert", "ismap", + "itemscope", "loop", "multiple", "muted", @@ -11917,13 +27099,13 @@ function create_component(block) { block && block.c(); } function mount_component(component, target, anchor, customElement) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; + const { fragment, after_update } = component.$$; fragment && fragment.m(target, anchor); if (!customElement) { add_render_callback(() => { - const new_on_destroy = on_mount.map(run).filter(is_function); - if (on_destroy) { - on_destroy.push(...new_on_destroy); + const new_on_destroy = component.$$.on_mount.map(run).filter(is_function); + if (component.$$.on_destroy) { + component.$$.on_destroy.push(...new_on_destroy); } else { run_all(new_on_destroy); } @@ -11949,12 +27131,12 @@ function make_dirty(component, i) { } component.$$.dirty[i / 31 | 0] |= 1 << i % 31; } -function init(component, options, instance5, create_fragment5, not_equal, props, append_styles2, dirty = [-1]) { +function init2(component, options, instance6, create_fragment6, not_equal, props, append_styles2, dirty = [-1]) { const parent_component = current_component; set_current_component(component); const $$ = component.$$ = { fragment: null, - ctx: null, + ctx: [], props, update: noop, not_equal, @@ -11971,21 +27153,21 @@ function init(component, options, instance5, create_fragment5, not_equal, props, root: options.target || parent_component.$$.root }; append_styles2 && append_styles2($$.root); - let ready2 = false; - $$.ctx = instance5 ? instance5(component, options.props || {}, (i, ret, ...rest) => { + let ready = false; + $$.ctx = instance6 ? instance6(component, options.props || {}, (i, ret, ...rest) => { const value = rest.length ? rest[0] : ret; if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value); - if (ready2) + if (ready) make_dirty(component, i); } return ret; }) : []; $$.update(); - ready2 = true; + ready = true; run_all($$.before_update); - $$.fragment = create_fragment5 ? create_fragment5($$.ctx) : false; + $$.fragment = create_fragment6 ? create_fragment6($$.ctx) : false; if (options.target) { if (options.hydrate) { start_hydrating(); @@ -12028,12 +27210,15 @@ if (typeof HTMLElement === "function") { this.$destroy = noop; } $on(type, callback) { + if (!is_function(callback)) { + return noop; + } const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); callbacks.push(callback); return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); + const index2 = callbacks.indexOf(callback); + if (index2 !== -1) + callbacks.splice(index2, 1); }; } $set($$props) { @@ -12051,12 +27236,15 @@ var SvelteComponent = class { this.$destroy = noop; } $on(type, callback) { + if (!is_function(callback)) { + return noop; + } const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []); callbacks.push(callback); return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); + const index2 = callbacks.indexOf(callback); + if (index2 !== -1) + callbacks.splice(index2, 1); }; } $set($$props) { @@ -12068,40 +27256,17 @@ var SvelteComponent = class { } }; -// node_modules/tslib/modules/index.js -var import_tslib = __toModule(require_tslib()); -var { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __exportStar, - __createBinding, - __values, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn -} = import_tslib.default; - // src/ui/sidebar/gitView.svelte -var import_obsidian13 = __toModule(require("obsidian")); +var import_obsidian21 = __toModule(require("obsidian")); + +// node_modules/svelte/index.mjs +init_polyfill_buffer(); + +// node_modules/svelte/transition/index.mjs +init_polyfill_buffer(); // node_modules/svelte/easing/index.mjs +init_polyfill_buffer(); function cubicOut(t) { const f = t - 1; return f * f * f + 1; @@ -12127,11 +27292,16 @@ function slide(node, { delay: delay2 = 0, duration = 400, easing = cubicOut } = } // src/ui/sidebar/components/fileComponent.svelte -var import_obsidian11 = __toModule(require("obsidian")); +init_polyfill_buffer(); +var import_obsidian18 = __toModule(require("obsidian")); + +// node_modules/obsidian-community-lib/dist/index.js +init_polyfill_buffer(); // node_modules/obsidian-community-lib/dist/utils.js +init_polyfill_buffer(); var feather = __toModule(require_feather()); -var import_obsidian9 = __toModule(require("obsidian")); +var import_obsidian16 = __toModule(require("obsidian")); function hoverPreview(event, view, to) { const targetEl = event.target; app.workspace.trigger("hover-link", { @@ -12142,47 +27312,11 @@ function hoverPreview(event, view, to) { linktext: to }); } -function createNewMDNote(newName, currFilePath = "") { - return __async(this, null, function* () { - const newFileFolder = app.fileManager.getNewFileParent(currFilePath).path; - const newFilePath = (0, import_obsidian9.normalizePath)(`${newFileFolder}${newFileFolder === "/" ? "" : "/"}${addMD(newName)}`); - return yield app.vault.create(newFilePath, ""); - }); -} -var addMD = (noteName) => { - return noteName.match(/\.MD$|\.md$/m) ? noteName : noteName + ".md"; -}; -function openOrSwitch(_0, _1) { - return __async(this, arguments, function* (dest, event, options = { createNewFile: true }) { - const { workspace } = app; - let destFile = app.metadataCache.getFirstLinkpathDest(dest, ""); - if (!destFile && options.createNewFile) { - destFile = yield createNewMDNote(dest); - } else if (!destFile && !options.createNewFile) - return; - const leavesWithDestAlreadyOpen = []; - workspace.iterateAllLeaves((leaf) => { - var _a2; - if (leaf.view instanceof import_obsidian9.MarkdownView) { - const file = (_a2 = leaf.view) === null || _a2 === void 0 ? void 0 : _a2.file; - if (file && file.basename + "." + file.extension === dest) { - leavesWithDestAlreadyOpen.push(leaf); - } - } - }); - if (leavesWithDestAlreadyOpen.length > 0) { - workspace.setActiveLeaf(leavesWithDestAlreadyOpen[0]); - } else { - const mode = app.vault.getConfig("defaultViewMode"); - const leaf = event.ctrlKey || event.getModifierState("Meta") ? workspace.splitActiveLeaf() : workspace.getUnpinnedLeaf(); - yield leaf.openFile(destFile, { active: true, mode }); - } - }); -} // src/ui/modals/discardModal.ts -var import_obsidian10 = __toModule(require("obsidian")); -var DiscardModal = class extends import_obsidian10.Modal { +init_polyfill_buffer(); +var import_obsidian17 = __toModule(require("obsidian")); +var DiscardModal = class extends import_obsidian17.Modal { constructor(app2, deletion, filename) { super(app2); this.deletion = deletion; @@ -12196,7 +27330,7 @@ var DiscardModal = class extends import_obsidian10.Modal { }); } onOpen() { - let { contentEl, titleEl } = this; + const { contentEl, titleEl } = this; titleEl.setText(`${this.deletion ? "Delete" : "Discard"} this file?`); contentEl.createEl("h4").setText(`Do you really want to ${this.deletion ? "delete" : "discard the changes of"} "${this.filename}"`); const div = contentEl.createDiv(); @@ -12209,21 +27343,21 @@ var DiscardModal = class extends import_obsidian10.Modal { div.createEl("button", { cls: "mod-cta", text: "Confirm" - }).addEventListener("click", () => __async(this, null, function* () { + }).addEventListener("click", async () => { if (this.resolve) this.resolve(true); this.close(); - })); + }); } onClose() { - let { contentEl } = this; + const { contentEl } = this; contentEl.empty(); } }; // src/ui/sidebar/components/fileComponent.svelte function add_css(target) { - append_styles(target, "svelte-1furf50", "main.svelte-1furf50.svelte-1furf50.svelte-1furf50{cursor:pointer;background-color:var(--background-secondary);border-radius:4px;width:98%;display:flex;justify-content:space-between;font-size:0.8rem;margin-bottom:2px}main.svelte-1furf50 .path.svelte-1furf50.svelte-1furf50{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-1furf50:hover .path.svelte-1furf50.svelte-1furf50{color:var(--text-normal);transition:all 200ms}main.svelte-1furf50 .tools.svelte-1furf50.svelte-1furf50{display:flex;align-items:center}main.svelte-1furf50 .tools .type.svelte-1furf50.svelte-1furf50{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-1furf50 .tools .type[data-type=M].svelte-1furf50.svelte-1furf50{color:orange}main.svelte-1furf50 .tools .type[data-type=D].svelte-1furf50.svelte-1furf50{color:red}main.svelte-1furf50 .tools .buttons.svelte-1furf50.svelte-1furf50{display:flex}main.svelte-1furf50 .tools .buttons.svelte-1furf50>.svelte-1furf50{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-1furf50 .tools .buttons.svelte-1furf50>.svelte-1furf50:hover{color:var(--text-normal);background-color:var(--interactive-accent)}"); + append_styles(target, "svelte-1o25zf2", "main.svelte-1o25zf2 .nav-file-title-content.svelte-1o25zf2.svelte-1o25zf2{display:flex;align-items:center}main.svelte-1o25zf2 .tools.svelte-1o25zf2.svelte-1o25zf2{display:flex;margin-left:auto}main.svelte-1o25zf2 .tools .type.svelte-1o25zf2.svelte-1o25zf2{padding-left:var(--size-2-1);display:flex;align-items:center;justify-content:center}main.svelte-1o25zf2 .tools .type[data-type=M].svelte-1o25zf2.svelte-1o25zf2{color:orange}main.svelte-1o25zf2 .tools .type[data-type=D].svelte-1o25zf2.svelte-1o25zf2{color:red}main.svelte-1o25zf2 .tools .buttons.svelte-1o25zf2.svelte-1o25zf2{display:flex}main.svelte-1o25zf2 .tools .buttons.svelte-1o25zf2>.svelte-1o25zf2{padding:0 0;height:auto}"); } function create_if_block(ctx) { let div; @@ -12234,13 +27368,16 @@ function create_if_block(ctx) { div = element("div"); attr(div, "data-icon", "go-to-file"); attr(div, "aria-label", "Open File"); - attr(div, "class", "svelte-1furf50"); + attr(div, "class", "clickable-icon svelte-1o25zf2"); }, m(target, anchor) { insert(target, div, anchor); - ctx[12](div); + ctx[11](div); if (!mounted) { - dispose = listen(div, "click", ctx[5]); + dispose = [ + listen(div, "auxclick", ctx[5]), + listen(div, "click", ctx[5]) + ]; mounted = true; } }, @@ -12248,105 +27385,108 @@ function create_if_block(ctx) { d(detaching) { if (detaching) detach(div); - ctx[12](null); + ctx[11](null); mounted = false; - dispose(); + run_all(dispose); } }; } function create_fragment(ctx) { + var _a2; let main; - let span0; - let t0_value = ctx[0].vault_path.split("/").last().replace(".md", "") + ""; + let div6; + let div0; + let t0_value = ((_a2 = ctx[0].vault_path.split("/").last()) == null ? void 0 : _a2.replace(".md", "")) + ""; let t0; - let span0_aria_label_value; let t1; + let div5; let div3; - let div2; let show_if = ctx[1].app.vault.getAbstractFileByPath(ctx[0].vault_path); let t2; - let div0; - let t3; let div1; + let t3; + let div2; let t4; - let span1; + let div4; let t5_value = ctx[0].working_dir + ""; let t5; - let span1_data_type_value; + let div4_data_type_value; + let div6_aria_label_value; let mounted; let dispose; let if_block = show_if && create_if_block(ctx); return { c() { main = element("main"); - span0 = element("span"); + div6 = element("div"); + div0 = element("div"); t0 = text(t0_value); t1 = space(); + div5 = element("div"); div3 = element("div"); - div2 = element("div"); if (if_block) if_block.c(); t2 = space(); - div0 = element("div"); - t3 = space(); div1 = element("div"); + t3 = space(); + div2 = element("div"); t4 = space(); - span1 = element("span"); + div4 = element("div"); t5 = text(t5_value); - attr(span0, "class", "path svelte-1furf50"); - attr(span0, "aria-label-position", ctx[3]); - attr(span0, "aria-label", span0_aria_label_value = ctx[0].vault_path.split("/").last() != ctx[0].vault_path ? ctx[0].vault_path : ""); - attr(div0, "data-icon", "skip-back"); - attr(div0, "aria-label", "Discard"); - attr(div0, "class", "svelte-1furf50"); - attr(div1, "data-icon", "plus"); - attr(div1, "aria-label", "Stage"); - attr(div1, "class", "svelte-1furf50"); - attr(div2, "class", "buttons svelte-1furf50"); - attr(span1, "class", "type svelte-1furf50"); - attr(span1, "data-type", span1_data_type_value = ctx[0].working_dir); - attr(div3, "class", "tools svelte-1furf50"); - attr(main, "class", "svelte-1furf50"); + attr(div0, "class", "nav-file-title-content svelte-1o25zf2"); + attr(div1, "data-icon", "skip-back"); + attr(div1, "aria-label", "Discard"); + attr(div1, "class", "clickable-icon svelte-1o25zf2"); + attr(div2, "data-icon", "plus"); + attr(div2, "aria-label", "Stage"); + attr(div2, "class", "clickable-icon svelte-1o25zf2"); + attr(div3, "class", "buttons svelte-1o25zf2"); + attr(div4, "class", "type svelte-1o25zf2"); + attr(div4, "data-type", div4_data_type_value = ctx[0].working_dir); + attr(div5, "class", "tools svelte-1o25zf2"); + attr(div6, "class", "nav-file-title"); + attr(div6, "aria-label-position", ctx[3]); + attr(div6, "aria-label", div6_aria_label_value = ctx[0].vault_path.split("/").last() != ctx[0].vault_path ? ctx[0].vault_path : ""); + attr(main, "class", "nav-file svelte-1o25zf2"); }, m(target, anchor) { insert(target, main, anchor); - append2(main, span0); - append2(span0, t0); - append2(main, t1); - append2(main, div3); - append2(div3, div2); + append2(main, div6); + append2(div6, div0); + append2(div0, t0); + append2(div6, t1); + append2(div6, div5); + append2(div5, div3); if (if_block) - if_block.m(div2, null); - append2(div2, t2); - append2(div2, div0); - ctx[13](div0); - append2(div2, t3); - append2(div2, div1); - ctx[14](div1); - append2(div3, t4); - append2(div3, span1); - append2(span1, t5); + if_block.m(div3, null); + append2(div3, t2); + append2(div3, div1); + ctx[12](div1); + append2(div3, t3); + append2(div3, div2); + ctx[13](div2); + append2(div5, t4); + append2(div5, div4); + append2(div4, t5); if (!mounted) { dispose = [ - listen(span0, "click", self2(ctx[7])), - listen(div0, "click", ctx[8]), - listen(div1, "click", ctx[6]), + listen(div0, "click", ctx[7]), + listen(div0, "auxclick", ctx[7]), + listen(div1, "click", ctx[8]), + listen(div2, "click", ctx[6]), + listen(div6, "click", self2(ctx[7])), + listen(div6, "auxclick", self2(ctx[7])), listen(main, "mouseover", ctx[4]), listen(main, "click", self2(ctx[7])), - listen(main, "focus", ctx[11]) + listen(main, "focus", ctx[10]) ]; mounted = true; } }, p(ctx2, [dirty]) { - if (dirty & 1 && t0_value !== (t0_value = ctx2[0].vault_path.split("/").last().replace(".md", "") + "")) + var _a3; + if (dirty & 1 && t0_value !== (t0_value = ((_a3 = ctx2[0].vault_path.split("/").last()) == null ? void 0 : _a3.replace(".md", "")) + "")) set_data(t0, t0_value); - if (dirty & 8) { - attr(span0, "aria-label-position", ctx2[3]); - } - if (dirty & 1 && span0_aria_label_value !== (span0_aria_label_value = ctx2[0].vault_path.split("/").last() != ctx2[0].vault_path ? ctx2[0].vault_path : "")) { - attr(span0, "aria-label", span0_aria_label_value); - } if (dirty & 3) show_if = ctx2[1].app.vault.getAbstractFileByPath(ctx2[0].vault_path); if (show_if) { @@ -12355,7 +27495,7 @@ function create_fragment(ctx) { } else { if_block = create_if_block(ctx2); if_block.c(); - if_block.m(div2, t2); + if_block.m(div3, t2); } } else if (if_block) { if_block.d(1); @@ -12363,8 +27503,14 @@ function create_fragment(ctx) { } if (dirty & 1 && t5_value !== (t5_value = ctx2[0].working_dir + "")) set_data(t5, t5_value); - if (dirty & 1 && span1_data_type_value !== (span1_data_type_value = ctx2[0].working_dir)) { - attr(span1, "data-type", span1_data_type_value); + if (dirty & 1 && div4_data_type_value !== (div4_data_type_value = ctx2[0].working_dir)) { + attr(div4, "data-type", div4_data_type_value); + } + if (dirty & 8) { + attr(div6, "aria-label-position", ctx2[3]); + } + if (dirty & 1 && div6_aria_label_value !== (div6_aria_label_value = ctx2[0].vault_path.split("/").last() != ctx2[0].vault_path ? ctx2[0].vault_path : "")) { + attr(div6, "aria-label", div6_aria_label_value); } }, i: noop, @@ -12374,8 +27520,8 @@ function create_fragment(ctx) { detach(main); if (if_block) if_block.d(); + ctx[12](null); ctx[13](null); - ctx[14](null); mounted = false; run_all(dispose); } @@ -12386,17 +27532,19 @@ function instance($$self, $$props, $$invalidate) { let { change } = $$props; let { view } = $$props; let { manager } = $$props; - let { workspace } = $$props; let buttons = []; - setImmediate(() => buttons.forEach((b) => (0, import_obsidian11.setIcon)(b, b.getAttr("data-icon"), 16))); + window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian18.setIcon)(b, b.getAttr("data-icon"))), 0); function hover(event) { if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { hoverPreview(event, view, change.vault_path.split("/").last().replace(".md", "")); } } function open(event) { - if (!(change.path.startsWith(view.app.vault.configDir) || change.path.startsWith(".") || change.working_dir === "D")) { - openOrSwitch(change.vault_path, event); + var _a2; + const file = view.app.vault.getAbstractFileByPath(change.vault_path); + console.log(event); + if (file instanceof import_obsidian18.TFile) { + (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); } } function stage() { @@ -12405,19 +27553,12 @@ function instance($$self, $$props, $$invalidate) { }); } function showDiff(event) { - const leaf = workspace.getMostRecentLeaf(workspace.rootSplit); - if (leaf && !leaf.getViewState().pinned && !(event.ctrlKey || event.getModifierState("Meta"))) { - leaf.setViewState({ - type: DIFF_VIEW_CONFIG.type, - state: { file: change.path, staged: false } - }); - } else { - workspace.createLeafInParent(workspace.rootSplit, 0).setViewState({ - type: DIFF_VIEW_CONFIG.type, - active: true, - state: { file: change.path, staged: false } - }); - } + var _a2; + (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.setViewState({ + type: DIFF_VIEW_CONFIG.type, + active: true, + state: { file: change.path, staged: false } + }); } function discard() { const deleteFile = change.working_dir == "U"; @@ -12444,13 +27585,13 @@ function instance($$self, $$props, $$invalidate) { $$invalidate(2, buttons); }); } - function div0_binding($$value) { + function div1_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[0] = $$value; $$invalidate(2, buttons); }); } - function div1_binding($$value) { + function div2_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[2] = $$value; $$invalidate(2, buttons); @@ -12463,8 +27604,6 @@ function instance($$self, $$props, $$invalidate) { $$invalidate(1, view = $$props2.view); if ("manager" in $$props2) $$invalidate(9, manager = $$props2.manager); - if ("workspace" in $$props2) - $$invalidate(10, workspace = $$props2.workspace); }; $$self.$$.update = () => { if ($$self.$$.dirty & 2) { @@ -12483,31 +27622,151 @@ function instance($$self, $$props, $$invalidate) { showDiff, discard, manager, - workspace, focus_handler, div_binding, - div0_binding, - div1_binding + div1_binding, + div2_binding ]; } var FileComponent = class extends SvelteComponent { constructor(options) { super(); - init(this, options, instance, create_fragment, safe_not_equal, { - change: 0, - view: 1, - manager: 9, - workspace: 10 - }, add_css); + init2(this, options, instance, create_fragment, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css); } }; var fileComponent_default = FileComponent; -// src/ui/sidebar/components/stagedFileComponent.svelte -var import_obsidian12 = __toModule(require("obsidian")); -var import_path2 = __toModule(require("path")); +// src/ui/sidebar/components/pulledFileComponent.svelte +init_polyfill_buffer(); +var import_obsidian19 = __toModule(require("obsidian")); function add_css2(target) { - append_styles(target, "svelte-15heedx", "main.svelte-15heedx.svelte-15heedx.svelte-15heedx{cursor:pointer;background-color:var(--background-secondary);border-radius:4px;width:98%;display:flex;justify-content:space-between;font-size:0.8rem;margin-bottom:2px}main.svelte-15heedx .path.svelte-15heedx.svelte-15heedx{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-15heedx:hover .path.svelte-15heedx.svelte-15heedx{color:var(--text-normal);transition:all 200ms}main.svelte-15heedx .tools.svelte-15heedx.svelte-15heedx{display:flex;align-items:center}main.svelte-15heedx .tools .type.svelte-15heedx.svelte-15heedx{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-15heedx .tools .type[data-type=M].svelte-15heedx.svelte-15heedx{color:orange}main.svelte-15heedx .tools .type[data-type=D].svelte-15heedx.svelte-15heedx{color:red}main.svelte-15heedx .tools .type[data-type=A].svelte-15heedx.svelte-15heedx{color:yellowgreen}main.svelte-15heedx .tools .type[data-type=R].svelte-15heedx.svelte-15heedx{color:violet}main.svelte-15heedx .tools .buttons.svelte-15heedx.svelte-15heedx{display:flex}main.svelte-15heedx .tools .buttons.svelte-15heedx>.svelte-15heedx{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-15heedx .tools .buttons.svelte-15heedx>.svelte-15heedx:hover{color:var(--text-normal);background-color:var(--interactive-accent)}"); + append_styles(target, "svelte-sajhpp", "main.svelte-sajhpp .nav-file-title-content.svelte-sajhpp{display:flex;align-items:center}main.svelte-sajhpp .tools.svelte-sajhpp{display:flex;margin-left:auto}main.svelte-sajhpp .tools .type.svelte-sajhpp{padding-left:var(--size-2-1);display:flex;align-items:center;justify-content:center}main.svelte-sajhpp .tools .type[data-type=M].svelte-sajhpp{color:orange}main.svelte-sajhpp .tools .type[data-type=D].svelte-sajhpp{color:red}"); +} +function create_fragment2(ctx) { + var _a2; + let main; + let div2; + let div0; + let t0_value = ((_a2 = ctx[0].vault_path.split("/").last()) == null ? void 0 : _a2.replace(".md", "")) + ""; + let t0; + let t1; + let div1; + let span; + let t2_value = ctx[0].working_dir + ""; + let t2; + let span_data_type_value; + let div2_aria_label_value; + let mounted; + let dispose; + return { + c() { + main = element("main"); + div2 = element("div"); + div0 = element("div"); + t0 = text(t0_value); + t1 = space(); + div1 = element("div"); + span = element("span"); + t2 = text(t2_value); + attr(div0, "class", "nav-file-title-content svelte-sajhpp"); + attr(span, "class", "type svelte-sajhpp"); + attr(span, "data-type", span_data_type_value = ctx[0].working_dir); + attr(div1, "class", "tools svelte-sajhpp"); + attr(div2, "class", "nav-file-title"); + attr(div2, "aria-label-position", ctx[1]); + attr(div2, "aria-label", div2_aria_label_value = ctx[0].vault_path.split("/").last() != ctx[0].vault_path ? ctx[0].vault_path : ""); + attr(main, "class", "nav-file svelte-sajhpp"); + }, + m(target, anchor) { + insert(target, main, anchor); + append2(main, div2); + append2(div2, div0); + append2(div0, t0); + append2(div2, t1); + append2(div2, div1); + append2(div1, span); + append2(span, t2); + if (!mounted) { + dispose = [ + listen(main, "mouseover", ctx[2]), + listen(main, "click", ctx[3]), + listen(main, "focus", ctx[5]) + ]; + mounted = true; + } + }, + p(ctx2, [dirty]) { + var _a3; + if (dirty & 1 && t0_value !== (t0_value = ((_a3 = ctx2[0].vault_path.split("/").last()) == null ? void 0 : _a3.replace(".md", "")) + "")) + set_data(t0, t0_value); + if (dirty & 1 && t2_value !== (t2_value = ctx2[0].working_dir + "")) + set_data(t2, t2_value); + if (dirty & 1 && span_data_type_value !== (span_data_type_value = ctx2[0].working_dir)) { + attr(span, "data-type", span_data_type_value); + } + if (dirty & 2) { + attr(div2, "aria-label-position", ctx2[1]); + } + if (dirty & 1 && div2_aria_label_value !== (div2_aria_label_value = ctx2[0].vault_path.split("/").last() != ctx2[0].vault_path ? ctx2[0].vault_path : "")) { + attr(div2, "aria-label", div2_aria_label_value); + } + }, + i: noop, + o: noop, + d(detaching) { + if (detaching) + detach(main); + mounted = false; + run_all(dispose); + } + }; +} +function instance2($$self, $$props, $$invalidate) { + let side; + let { change } = $$props; + let { view } = $$props; + function hover(event) { + if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { + hoverPreview(event, view, change.vault_path.split("/").last().replace(".md", "")); + } + } + function open(event) { + var _a2; + const file = view.app.vault.getAbstractFileByPath(change.vault_path); + if (file instanceof import_obsidian19.TFile) { + (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); + } + } + function focus_handler(event) { + bubble.call(this, $$self, event); + } + $$self.$$set = ($$props2) => { + if ("change" in $$props2) + $$invalidate(0, change = $$props2.change); + if ("view" in $$props2) + $$invalidate(4, view = $$props2.view); + }; + $$self.$$.update = () => { + if ($$self.$$.dirty & 16) { + $: + $$invalidate(1, side = view.leaf.getRoot().side == "left" ? "right" : "left"); + } + }; + return [change, side, hover, open, view, focus_handler]; +} +var PulledFileComponent = class extends SvelteComponent { + constructor(options) { + super(); + init2(this, options, instance2, create_fragment2, safe_not_equal, { change: 0, view: 4 }, add_css2); + } +}; +var pulledFileComponent_default = PulledFileComponent; + +// src/ui/sidebar/components/stagedFileComponent.svelte +init_polyfill_buffer(); +var import_obsidian20 = __toModule(require("obsidian")); +function add_css3(target) { + append_styles(target, "svelte-1o25zf2", "main.svelte-1o25zf2 .nav-file-title-content.svelte-1o25zf2.svelte-1o25zf2{display:flex;align-items:center}main.svelte-1o25zf2 .tools.svelte-1o25zf2.svelte-1o25zf2{display:flex;margin-left:auto}main.svelte-1o25zf2 .tools .type.svelte-1o25zf2.svelte-1o25zf2{padding-left:var(--size-2-1);display:flex;align-items:center;justify-content:center}main.svelte-1o25zf2 .tools .type[data-type=M].svelte-1o25zf2.svelte-1o25zf2{color:orange}main.svelte-1o25zf2 .tools .type[data-type=D].svelte-1o25zf2.svelte-1o25zf2{color:red}main.svelte-1o25zf2 .tools .buttons.svelte-1o25zf2.svelte-1o25zf2{display:flex}main.svelte-1o25zf2 .tools .buttons.svelte-1o25zf2>.svelte-1o25zf2{padding:0 0;height:auto}"); } function create_if_block2(ctx) { let div; @@ -12518,7 +27777,7 @@ function create_if_block2(ctx) { div = element("div"); attr(div, "data-icon", "go-to-file"); attr(div, "aria-label", "Open File"); - attr(div, "class", "svelte-15heedx"); + attr(div, "class", "clickable-icon svelte-1o25zf2"); }, m(target, anchor) { insert(target, div, anchor); @@ -12538,72 +27797,79 @@ function create_if_block2(ctx) { } }; } -function create_fragment2(ctx) { +function create_fragment3(ctx) { + var _a2; let main; - let span0; - let t0_value = ctx[3].split("/").last().replace(".md", "") + ""; + let div5; + let div0; + let t0_value = ((_a2 = ctx[3].split("/").last()) == null ? void 0 : _a2.replace(".md", "")) + ""; let t0; - let span0_aria_label_value; let t1; + let div4; let div2; - let div1; let show_if = ctx[1].app.vault.getAbstractFileByPath(ctx[3]); let t2; - let div0; + let div1; let t3; - let span1; + let div3; let t4_value = ctx[0].index + ""; let t4; - let span1_data_type_value; + let div3_data_type_value; + let div5_aria_label_value; let mounted; let dispose; let if_block = show_if && create_if_block2(ctx); return { c() { main = element("main"); - span0 = element("span"); + div5 = element("div"); + div0 = element("div"); t0 = text(t0_value); t1 = space(); + div4 = element("div"); div2 = element("div"); - div1 = element("div"); if (if_block) if_block.c(); t2 = space(); - div0 = element("div"); + div1 = element("div"); t3 = space(); - span1 = element("span"); + div3 = element("div"); t4 = text(t4_value); - attr(span0, "class", "path svelte-15heedx"); - attr(span0, "aria-label-position", ctx[4]); - attr(span0, "aria-label", span0_aria_label_value = ctx[3].split("/").last() != ctx[3] ? ctx[3] : ""); - attr(div0, "data-icon", "minus"); - attr(div0, "aria-label", "Unstage"); - attr(div0, "class", "svelte-15heedx"); - attr(div1, "class", "buttons svelte-15heedx"); - attr(span1, "class", "type svelte-15heedx"); - attr(span1, "data-type", span1_data_type_value = ctx[0].index); - attr(div2, "class", "tools svelte-15heedx"); - attr(main, "class", "svelte-15heedx"); + attr(div0, "class", "nav-file-title-content svelte-1o25zf2"); + attr(div1, "data-icon", "minus"); + attr(div1, "aria-label", "Unstage"); + attr(div1, "class", "clickable-icon svelte-1o25zf2"); + attr(div2, "class", "buttons svelte-1o25zf2"); + attr(div3, "class", "type svelte-1o25zf2"); + attr(div3, "data-type", div3_data_type_value = ctx[0].index); + attr(div4, "class", "tools svelte-1o25zf2"); + attr(div5, "class", "nav-file-title"); + attr(div5, "aria-label-position", ctx[4]); + attr(div5, "aria-label", div5_aria_label_value = ctx[3].split("/").last() != ctx[3] ? ctx[3] : ""); + attr(main, "class", "nav-file svelte-1o25zf2"); }, m(target, anchor) { insert(target, main, anchor); - append2(main, span0); - append2(span0, t0); - append2(main, t1); - append2(main, div2); - append2(div2, div1); + append2(main, div5); + append2(div5, div0); + append2(div0, t0); + append2(div5, t1); + append2(div5, div4); + append2(div4, div2); if (if_block) - if_block.m(div1, null); - append2(div1, t2); - append2(div1, div0); - ctx[12](div0); - append2(div2, t3); - append2(div2, span1); - append2(span1, t4); + if_block.m(div2, null); + append2(div2, t2); + append2(div2, div1); + ctx[12](div1); + append2(div4, t3); + append2(div4, div3); + append2(div3, t4); if (!mounted) { dispose = [ - listen(span0, "click", ctx[7]), - listen(div0, "click", ctx[8]), + listen(div0, "click", ctx[7]), + listen(div0, "auxclick", ctx[7]), + listen(div1, "click", ctx[8]), + listen(div5, "click", self2(ctx[7])), listen(main, "mouseover", ctx[5]), listen(main, "focus", ctx[10]), listen(main, "click", self2(ctx[7])) @@ -12612,14 +27878,9 @@ function create_fragment2(ctx) { } }, p(ctx2, [dirty]) { - if (dirty & 8 && t0_value !== (t0_value = ctx2[3].split("/").last().replace(".md", "") + "")) + var _a3; + if (dirty & 8 && t0_value !== (t0_value = ((_a3 = ctx2[3].split("/").last()) == null ? void 0 : _a3.replace(".md", "")) + "")) set_data(t0, t0_value); - if (dirty & 16) { - attr(span0, "aria-label-position", ctx2[4]); - } - if (dirty & 8 && span0_aria_label_value !== (span0_aria_label_value = ctx2[3].split("/").last() != ctx2[3] ? ctx2[3] : "")) { - attr(span0, "aria-label", span0_aria_label_value); - } if (dirty & 10) show_if = ctx2[1].app.vault.getAbstractFileByPath(ctx2[3]); if (show_if) { @@ -12628,7 +27889,7 @@ function create_fragment2(ctx) { } else { if_block = create_if_block2(ctx2); if_block.c(); - if_block.m(div1, t2); + if_block.m(div2, t2); } } else if (if_block) { if_block.d(1); @@ -12636,8 +27897,14 @@ function create_fragment2(ctx) { } if (dirty & 1 && t4_value !== (t4_value = ctx2[0].index + "")) set_data(t4, t4_value); - if (dirty & 1 && span1_data_type_value !== (span1_data_type_value = ctx2[0].index)) { - attr(span1, "data-type", span1_data_type_value); + if (dirty & 1 && div3_data_type_value !== (div3_data_type_value = ctx2[0].index)) { + attr(div3, "data-type", div3_data_type_value); + } + if (dirty & 16) { + attr(div5, "aria-label-position", ctx2[4]); + } + if (dirty & 8 && div5_aria_label_value !== (div5_aria_label_value = ctx2[3].split("/").last() != ctx2[3] ? ctx2[3] : "")) { + attr(div5, "aria-label", div5_aria_label_value); } }, i: noop, @@ -12653,40 +27920,33 @@ function create_fragment2(ctx) { } }; } -function instance2($$self, $$props, $$invalidate) { +function instance3($$self, $$props, $$invalidate) { let formattedPath; let side; let { change } = $$props; let { view } = $$props; let { manager } = $$props; let buttons = []; - setImmediate(() => buttons.forEach((b) => (0, import_obsidian12.setIcon)(b, b.getAttr("data-icon"), 16))); + window.setTimeout(() => buttons.forEach((b) => (0, import_obsidian20.setIcon)(b, b.getAttr("data-icon"), 16)), 0); function hover(event) { if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) { hoverPreview(event, view, formattedPath.split("/").last().replace(".md", "")); } } function open(event) { - if (!(change.path.startsWith(view.app.vault.configDir) || change.path.startsWith(".") || change.index === "D")) { - openOrSwitch(formattedPath, event); + var _a2; + const file = view.app.vault.getAbstractFileByPath(change.vault_path); + if (file instanceof import_obsidian20.TFile) { + (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.openFile(file); } } function showDiff(event) { - const workspace = view.app.workspace; - const leaf = workspace.getMostRecentLeaf(workspace.rootSplit); - if (leaf && !leaf.getViewState().pinned && !(event.ctrlKey || event.getModifierState("Meta"))) { - leaf.setViewState({ - type: DIFF_VIEW_CONFIG.type, - state: { file: change.path, staged: true } - }); - workspace.setActiveLeaf(leaf, true, true); - } else { - workspace.createLeafInParent(workspace.rootSplit, 0).setViewState({ - type: DIFF_VIEW_CONFIG.type, - active: true, - state: { file: change.path, staged: true } - }); - } + var _a2; + (_a2 = getNewLeaf(event)) === null || _a2 === void 0 ? void 0 : _a2.setViewState({ + type: DIFF_VIEW_CONFIG.type, + active: true, + state: { file: change.path, staged: true } + }); } function unstage() { manager.unstage(change.path, false).finally(() => { @@ -12702,7 +27962,7 @@ function instance2($$self, $$props, $$invalidate) { $$invalidate(2, buttons); }); } - function div0_binding($$value) { + function div1_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[0] = $$value; $$invalidate(2, buttons); @@ -12739,128 +27999,165 @@ function instance2($$self, $$props, $$invalidate) { manager, focus_handler, div_binding, - div0_binding + div1_binding ]; } var StagedFileComponent = class extends SvelteComponent { constructor(options) { super(); - init(this, options, instance2, create_fragment2, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css2); + init2(this, options, instance3, create_fragment3, safe_not_equal, { change: 0, view: 1, manager: 9 }, add_css3); } }; var stagedFileComponent_default = StagedFileComponent; // src/ui/sidebar/components/treeComponent.svelte -function add_css3(target) { - append_styles(target, "svelte-pgmdei", '@charset "UTF-8";main.svelte-pgmdei.svelte-pgmdei:not(.topLevel){margin-left:5px}.opener.svelte-pgmdei.svelte-pgmdei{display:flex;justify-content:space-between;align-items:center;padding:0 4px}.opener.svelte-pgmdei .collapse-icon.svelte-pgmdei::after{content:"\xA0"}.opener.svelte-pgmdei div.svelte-pgmdei{display:flex}.opener.svelte-pgmdei svg.svelte-pgmdei{transform:rotate(-90deg)}.opener.open.svelte-pgmdei svg.svelte-pgmdei{transform:rotate(0)}.opener.svelte-pgmdei span.svelte-pgmdei{font-size:0.8rem}.file-view.svelte-pgmdei.svelte-pgmdei{margin-left:5px}'); +init_polyfill_buffer(); +function add_css4(target) { + append_styles(target, "svelte-148wteu", "main.svelte-148wteu .nav-folder-title-content.svelte-148wteu.svelte-148wteu{display:flex;align-items:center}main.svelte-148wteu .tools.svelte-148wteu.svelte-148wteu{display:flex;margin-left:auto}main.svelte-148wteu .tools .buttons.svelte-148wteu.svelte-148wteu{display:flex}main.svelte-148wteu .tools .buttons.svelte-148wteu>.svelte-148wteu{padding:0 0;height:auto}"); } function get_each_context(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[7] = list[i]; + child_ctx[14] = list[i]; return child_ctx; } -function create_else_block_1(ctx) { - let div2; - let div1; +function create_else_block(ctx) { + let div5; + let div4; let div0; let t0; - let span; - let t1_value = ctx[7].title + ""; + let div1; + let t1_value = ctx[14].title + ""; let t1; let t2; - let if_block_anchor; + let div3; + let div2; + let t3; + let t4; let current; let mounted; let dispose; function click_handler() { - return ctx[6](ctx[7]); + return ctx[9](ctx[14]); } - let if_block = !ctx[5][ctx[7].title] && create_if_block_2(ctx); + function click_handler_1() { + return ctx[10](ctx[14]); + } + function select_block_type_2(ctx2, dirty) { + if (ctx2[3] == FileType.staged) + return create_if_block_5; + return create_else_block_1; + } + let current_block_type = select_block_type_2(ctx, -1); + let if_block0 = current_block_type(ctx); + function click_handler_4() { + return ctx[13](ctx[14]); + } + let if_block1 = !ctx[5][ctx[14].title] && create_if_block_4(ctx); return { c() { - div2 = element("div"); - div1 = element("div"); + div5 = element("div"); + div4 = element("div"); div0 = element("div"); - div0.innerHTML = ``; + div0.innerHTML = ``; t0 = space(); - span = element("span"); + div1 = element("div"); t1 = text(t1_value); t2 = space(); - if (if_block) - if_block.c(); - if_block_anchor = empty(); - attr(div0, "class", "tree-item-icon collapse-icon svelte-pgmdei"); - attr(div0, "style", ""); - attr(span, "class", "svelte-pgmdei"); - attr(div1, "class", "svelte-pgmdei"); - attr(div2, "class", "opener tree-item-self is-clickable svelte-pgmdei"); - toggle_class(div2, "open", !ctx[5][ctx[7].title]); + div3 = element("div"); + div2 = element("div"); + if_block0.c(); + t3 = space(); + if (if_block1) + if_block1.c(); + t4 = space(); + attr(div0, "class", "nav-folder-collapse-indicator collapse-icon"); + attr(div1, "class", "nav-folder-title-content svelte-148wteu"); + attr(div2, "class", "buttons svelte-148wteu"); + attr(div3, "class", "tools svelte-148wteu"); + attr(div4, "class", "nav-folder-title"); + attr(div5, "class", "nav-folder"); + toggle_class(div5, "is-collapsed", ctx[5][ctx[14].title]); }, m(target, anchor) { - insert(target, div2, anchor); - append2(div2, div1); - append2(div1, div0); - append2(div1, t0); - append2(div1, span); - append2(span, t1); - insert(target, t2, anchor); - if (if_block) - if_block.m(target, anchor); - insert(target, if_block_anchor, anchor); + insert(target, div5, anchor); + append2(div5, div4); + append2(div4, div0); + append2(div4, t0); + append2(div4, div1); + append2(div1, t1); + append2(div4, t2); + append2(div4, div3); + append2(div3, div2); + if_block0.m(div2, null); + append2(div5, t3); + if (if_block1) + if_block1.m(div5, null); + append2(div5, t4); current = true; if (!mounted) { - dispose = listen(div2, "click", click_handler); + dispose = [ + listen(div0, "click", click_handler), + listen(div1, "click", click_handler_1), + listen(div4, "click", self2(click_handler_4)) + ]; mounted = true; } }, p(new_ctx, dirty) { ctx = new_ctx; - if ((!current || dirty & 1) && t1_value !== (t1_value = ctx[7].title + "")) + if ((!current || dirty & 1) && t1_value !== (t1_value = ctx[14].title + "")) set_data(t1, t1_value); - if (dirty & 33) { - toggle_class(div2, "open", !ctx[5][ctx[7].title]); + if (current_block_type === (current_block_type = select_block_type_2(ctx, dirty)) && if_block0) { + if_block0.p(ctx, dirty); + } else { + if_block0.d(1); + if_block0 = current_block_type(ctx); + if (if_block0) { + if_block0.c(); + if_block0.m(div2, null); + } } - if (!ctx[5][ctx[7].title]) { - if (if_block) { - if_block.p(ctx, dirty); + if (!ctx[5][ctx[14].title]) { + if (if_block1) { + if_block1.p(ctx, dirty); if (dirty & 33) { - transition_in(if_block, 1); + transition_in(if_block1, 1); } } else { - if_block = create_if_block_2(ctx); - if_block.c(); - transition_in(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); + if_block1 = create_if_block_4(ctx); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(div5, t4); } - } else if (if_block) { + } else if (if_block1) { group_outros(); - transition_out(if_block, 1, 1, () => { - if_block = null; + transition_out(if_block1, 1, 1, () => { + if_block1 = null; }); check_outros(); } + if (!current || dirty & 33) { + toggle_class(div5, "is-collapsed", ctx[5][ctx[14].title]); + } }, i(local) { if (current) return; - transition_in(if_block); + transition_in(if_block1); current = true; }, o(local) { - transition_out(if_block); + transition_out(if_block1); current = false; }, d(detaching) { if (detaching) - detach(div2); - if (detaching) - detach(t2); - if (if_block) - if_block.d(detaching); - if (detaching) - detach(if_block_anchor); + detach(div5); + if_block0.d(); + if (if_block1) + if_block1.d(); mounted = false; - dispose(); + run_all(dispose); } }; } @@ -12870,25 +28167,32 @@ function create_if_block3(ctx) { let if_block; let t; let current; - const if_block_creators = [create_if_block_1, create_else_block]; + const if_block_creators = [create_if_block_1, create_if_block_2, create_if_block_3]; const if_blocks = []; function select_block_type_1(ctx2, dirty) { - if (ctx2[3]) + if (ctx2[3] == FileType.staged) return 0; - return 1; + if (ctx2[3] == FileType.changed) + return 1; + if (ctx2[3] == FileType.pulled) + return 2; + return -1; + } + if (~(current_block_type_index = select_block_type_1(ctx, -1))) { + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); } - current_block_type_index = select_block_type_1(ctx, -1); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); return { c() { div = element("div"); - if_block.c(); + if (if_block) + if_block.c(); t = space(); - attr(div, "class", "file-view svelte-pgmdei"); }, m(target, anchor) { insert(target, div, anchor); - if_blocks[current_block_type_index].m(div, null); + if (~current_block_type_index) { + if_blocks[current_block_type_index].m(div, null); + } append2(div, t); current = true; }, @@ -12896,22 +28200,30 @@ function create_if_block3(ctx) { let previous_block_index = current_block_type_index; current_block_type_index = select_block_type_1(ctx2, dirty); if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx2, dirty); - } else { - 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 { - if_block.p(ctx2, dirty); + if (~current_block_type_index) { + if_blocks[current_block_type_index].p(ctx2, dirty); + } + } else { + if (if_block) { + group_outros(); + transition_out(if_blocks[previous_block_index], 1, 1, () => { + if_blocks[previous_block_index] = null; + }); + check_outros(); + } + if (~current_block_type_index) { + 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 { + if_block.p(ctx2, dirty); + } + transition_in(if_block, 1); + if_block.m(div, t); + } else { + if_block = null; } - transition_in(if_block, 1); - if_block.m(div, t); } }, i(local) { @@ -12927,47 +28239,112 @@ function create_if_block3(ctx) { d(detaching) { if (detaching) detach(div); - if_blocks[current_block_type_index].d(); + if (~current_block_type_index) { + if_blocks[current_block_type_index].d(); + } } }; } -function create_if_block_2(ctx) { +function create_else_block_1(ctx) { + let div; + let mounted; + let dispose; + function click_handler_3() { + return ctx[12](ctx[14]); + } + return { + c() { + div = element("div"); + div.innerHTML = ``; + attr(div, "data-icon", "plus"); + attr(div, "aria-label", "Stage"); + attr(div, "class", "clickable-icon svelte-148wteu"); + }, + m(target, anchor) { + insert(target, div, anchor); + if (!mounted) { + dispose = listen(div, "click", click_handler_3); + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + }, + d(detaching) { + if (detaching) + detach(div); + mounted = false; + dispose(); + } + }; +} +function create_if_block_5(ctx) { + let div; + let mounted; + let dispose; + function click_handler_2() { + return ctx[11](ctx[14]); + } + return { + c() { + div = element("div"); + div.innerHTML = ``; + attr(div, "data-icon", "minus"); + attr(div, "aria-label", "Unstage"); + attr(div, "class", "clickable-icon svelte-148wteu"); + }, + m(target, anchor) { + insert(target, div, anchor); + if (!mounted) { + dispose = listen(div, "click", click_handler_2); + mounted = true; + } + }, + p(new_ctx, dirty) { + ctx = new_ctx; + }, + d(detaching) { + if (detaching) + detach(div); + mounted = false; + dispose(); + } + }; +} +function create_if_block_4(ctx) { let div; let treecomponent; - let t; let div_transition; let current; treecomponent = new TreeComponent({ props: { - hierarchy: ctx[7], + hierarchy: ctx[14], plugin: ctx[1], view: ctx[2], - staged: ctx[3] + fileType: ctx[3] } }); return { c() { div = element("div"); create_component(treecomponent.$$.fragment); - t = space(); - attr(div, "class", "file-view svelte-pgmdei"); + attr(div, "class", "nav-folder-children"); }, m(target, anchor) { insert(target, div, anchor); mount_component(treecomponent, div, null); - append2(div, t); current = true; }, p(ctx2, dirty) { const treecomponent_changes = {}; if (dirty & 1) - treecomponent_changes.hierarchy = ctx2[7]; + treecomponent_changes.hierarchy = ctx2[14]; if (dirty & 2) treecomponent_changes.plugin = ctx2[1]; if (dirty & 4) treecomponent_changes.view = ctx2[2]; if (dirty & 8) - treecomponent_changes.staged = ctx2[3]; + treecomponent_changes.fileType = ctx2[3]; treecomponent.$set(treecomponent_changes); }, i(local) { @@ -12977,7 +28354,7 @@ function create_if_block_2(ctx) { if (local) { add_render_callback(() => { if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 75 }, true); + div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); div_transition.run(1); }); } @@ -12987,7 +28364,7 @@ function create_if_block_2(ctx) { transition_out(treecomponent.$$.fragment, local); if (local) { if (!div_transition) - div_transition = create_bidirectional_transition(div, slide, { duration: 75 }, false); + div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); div_transition.run(0); } current = false; @@ -13001,15 +28378,54 @@ function create_if_block_2(ctx) { } }; } -function create_else_block(ctx) { +function create_if_block_3(ctx) { + let pulledfilecomponent; + let current; + pulledfilecomponent = new pulledFileComponent_default({ + props: { + change: ctx[14].statusResult, + view: ctx[2] + } + }); + return { + c() { + create_component(pulledfilecomponent.$$.fragment); + }, + m(target, anchor) { + mount_component(pulledfilecomponent, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const pulledfilecomponent_changes = {}; + if (dirty & 1) + pulledfilecomponent_changes.change = ctx2[14].statusResult; + if (dirty & 4) + pulledfilecomponent_changes.view = ctx2[2]; + pulledfilecomponent.$set(pulledfilecomponent_changes); + }, + i(local) { + if (current) + return; + transition_in(pulledfilecomponent.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(pulledfilecomponent.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(pulledfilecomponent, detaching); + } + }; +} +function create_if_block_2(ctx) { let filecomponent; let current; filecomponent = new fileComponent_default({ props: { - change: ctx[7].statusResult, + change: ctx[14].statusResult, manager: ctx[1].gitManager, - view: ctx[2], - workspace: ctx[1].app.workspace + view: ctx[2] } }); return { @@ -13023,13 +28439,11 @@ function create_else_block(ctx) { p(ctx2, dirty) { const filecomponent_changes = {}; if (dirty & 1) - filecomponent_changes.change = ctx2[7].statusResult; + filecomponent_changes.change = ctx2[14].statusResult; if (dirty & 2) filecomponent_changes.manager = ctx2[1].gitManager; if (dirty & 4) filecomponent_changes.view = ctx2[2]; - if (dirty & 2) - filecomponent_changes.workspace = ctx2[1].app.workspace; filecomponent.$set(filecomponent_changes); }, i(local) { @@ -13052,7 +28466,7 @@ function create_if_block_1(ctx) { let current; stagedfilecomponent = new stagedFileComponent_default({ props: { - change: ctx[7].statusResult, + change: ctx[14].statusResult, manager: ctx[1].gitManager, view: ctx[2] } @@ -13068,7 +28482,7 @@ function create_if_block_1(ctx) { p(ctx2, dirty) { const stagedfilecomponent_changes = {}; if (dirty & 1) - stagedfilecomponent_changes.change = ctx2[7].statusResult; + stagedfilecomponent_changes.change = ctx2[14].statusResult; if (dirty & 2) stagedfilecomponent_changes.manager = ctx2[1].gitManager; if (dirty & 4) @@ -13095,10 +28509,10 @@ function create_each_block(ctx) { let if_block; let if_block_anchor; let current; - const if_block_creators = [create_if_block3, create_else_block_1]; + const if_block_creators = [create_if_block3, create_else_block]; const if_blocks = []; function select_block_type(ctx2, dirty) { - if (ctx2[7].statusResult) + if (ctx2[14].statusResult) return 0; return 1; } @@ -13153,7 +28567,7 @@ function create_each_block(ctx) { } }; } -function create_fragment3(ctx) { +function create_fragment4(ctx) { let main; let current; let each_value = ctx[0].children; @@ -13170,7 +28584,7 @@ function create_fragment3(ctx) { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - attr(main, "class", "svelte-pgmdei"); + attr(main, "class", "svelte-148wteu"); toggle_class(main, "topLevel", ctx[4]); }, m(target, anchor) { @@ -13181,7 +28595,7 @@ function create_fragment3(ctx) { current = true; }, p(ctx2, [dirty]) { - if (dirty & 47) { + if (dirty & 495) { each_value = ctx2[0].children; let i; for (i = 0; i < each_value.length; i += 1) { @@ -13202,7 +28616,7 @@ function create_fragment3(ctx) { } check_outros(); } - if (dirty & 16) { + if (!current || dirty & 16) { toggle_class(main, "topLevel", ctx2[4]); } }, @@ -13228,16 +28642,31 @@ function create_fragment3(ctx) { } }; } -function instance3($$self, $$props, $$invalidate) { +function instance4($$self, $$props, $$invalidate) { let { hierarchy } = $$props; let { plugin } = $$props; let { view } = $$props; - let { staged } = $$props; + let { fileType } = $$props; let { topLevel = false } = $$props; const closed = {}; - const click_handler = (entity) => { - $$invalidate(5, closed[entity.title] = !closed[entity.title], closed); - }; + function stage(path2) { + plugin.gitManager.stageAll({ dir: path2 }).finally(() => { + dispatchEvent(new CustomEvent("git-refresh")); + }); + } + function unstage(path2) { + plugin.gitManager.unstageAll({ dir: path2 }).finally(() => { + dispatchEvent(new CustomEvent("git-refresh")); + }); + } + function fold(item) { + $$invalidate(5, closed[item.title] = !closed[item.title], closed); + } + const click_handler = (entity) => fold(entity); + const click_handler_1 = (entity) => fold(entity); + const click_handler_2 = (entity) => unstage(entity.title); + const click_handler_3 = (entity) => stage(entity.path); + const click_handler_4 = (entity) => fold(entity); $$self.$$set = ($$props2) => { if ("hierarchy" in $$props2) $$invalidate(0, hierarchy = $$props2.hierarchy); @@ -13245,42 +28674,62 @@ function instance3($$self, $$props, $$invalidate) { $$invalidate(1, plugin = $$props2.plugin); if ("view" in $$props2) $$invalidate(2, view = $$props2.view); - if ("staged" in $$props2) - $$invalidate(3, staged = $$props2.staged); + if ("fileType" in $$props2) + $$invalidate(3, fileType = $$props2.fileType); if ("topLevel" in $$props2) $$invalidate(4, topLevel = $$props2.topLevel); }; - return [hierarchy, plugin, view, staged, topLevel, closed, click_handler]; + return [ + hierarchy, + plugin, + view, + fileType, + topLevel, + closed, + stage, + unstage, + fold, + click_handler, + click_handler_1, + click_handler_2, + click_handler_3, + click_handler_4 + ]; } var TreeComponent = class extends SvelteComponent { constructor(options) { super(); - init(this, options, instance3, create_fragment3, safe_not_equal, { + init2(this, options, instance4, create_fragment4, safe_not_equal, { hierarchy: 0, plugin: 1, view: 2, - staged: 3, + fileType: 3, topLevel: 4 - }, add_css3); + }, add_css4); } }; var treeComponent_default = TreeComponent; // src/ui/sidebar/gitView.svelte -function add_css4(target) { - append_styles(target, "svelte-1f0ksxd", '@charset "UTF-8";.commit-msg.svelte-1f0ksxd.svelte-1f0ksxd{width:100%;min-height:1.9em;height:1.9em;resize:vertical;padding:2px 5px;background-color:var(--background-modifier-form-field)}.search-input-container.svelte-1f0ksxd.svelte-1f0ksxd{width:100%}.file-view.svelte-1f0ksxd.svelte-1f0ksxd{margin-left:5px}.opener.svelte-1f0ksxd.svelte-1f0ksxd{display:flex;justify-content:space-between;align-items:center;padding:0 4px}.opener.svelte-1f0ksxd .collapse-icon.svelte-1f0ksxd::after{content:"\xA0"}.opener.svelte-1f0ksxd div.svelte-1f0ksxd{display:flex}.opener.svelte-1f0ksxd svg.svelte-1f0ksxd{transform:rotate(-90deg)}.opener.open.svelte-1f0ksxd svg.svelte-1f0ksxd{transform:rotate(0)}.git-view-body.svelte-1f0ksxd.svelte-1f0ksxd{overflow-y:auto;padding-left:10px}main.svelte-1f0ksxd.svelte-1f0ksxd{display:flex;flex-direction:column;height:100%;overflow-y:hidden}.nav-buttons-container.svelte-1f0ksxd.svelte-1f0ksxd{justify-content:space-between}.group.svelte-1f0ksxd.svelte-1f0ksxd{display:flex}'); +function add_css5(target) { + append_styles(target, "svelte-1u4uc91", `.commit-msg-input.svelte-1u4uc91{width:100%;min-height:33px;height:30px;resize:vertical;padding:7px 5px;background-color:var(--background-modifier-form-field)}.git-commit-msg.svelte-1u4uc91{position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto}.git-commit-msg-clear-button.svelte-1u4uc91{position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:0px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out}.git-commit-msg-clear-button.svelte-1u4uc91:after{content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat}.tree-item-flair.svelte-1u4uc91{margin-left:auto;align-items:center}`); } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[30] = list[i]; + child_ctx[34] = list[i]; return child_ctx; } function get_each_context_1(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[33] = list[i]; + child_ctx[34] = list[i]; return child_ctx; } -function create_if_block_5(ctx) { +function get_each_context_2(ctx, list, i) { + const child_ctx = ctx.slice(); + child_ctx[39] = list[i]; + return child_ctx; +} +function create_if_block_8(ctx) { let div; let div_aria_label_value; let mounted; @@ -13288,13 +28737,13 @@ function create_if_block_5(ctx) { return { c() { div = element("div"); - attr(div, "class", "search-input-clear-button"); + attr(div, "class", "git-commit-msg-clear-button svelte-1u4uc91"); attr(div, "aria-label", div_aria_label_value = "Clear"); }, m(target, anchor) { insert(target, div, anchor); if (!mounted) { - dispose = listen(div, "click", ctx[26]); + dispose = listen(div, "click", ctx[29]); mounted = true; } }, @@ -13308,37 +28757,49 @@ function create_if_block_5(ctx) { }; } function create_if_block4(ctx) { + let div9; + let div8; let div3; let div2; + let div0; + let t0; let div1; let t2; - let span1; + let span0; let t3_value = ctx[5].staged.length + ""; let t3; let t4; let t5; let div7; let div6; + let div4; + let t6; let div5; let t8; - let span3; + let span1; let t9_value = ctx[5].changed.length + ""; let t9; let t10; + let t11; let current; let mounted; let dispose; - let if_block0 = ctx[11] && create_if_block_3(ctx); - let if_block1 = ctx[10] && create_if_block_12(ctx); + let if_block0 = ctx[13] && create_if_block_6(ctx); + let if_block1 = ctx[12] && create_if_block_42(ctx); + let if_block2 = ctx[6].length > 0 && create_if_block_12(ctx); return { c() { + div9 = element("div"); + div8 = element("div"); div3 = element("div"); div2 = element("div"); + div0 = element("div"); + div0.innerHTML = ``; + t0 = space(); div1 = element("div"); - div1.innerHTML = `
    - Staged Changes`; + div1.textContent = "Staged Changes"; t2 = space(); - span1 = element("span"); + span0 = element("span"); t3 = text(t3_value); t4 = space(); if (if_block0) @@ -13346,51 +28807,69 @@ function create_if_block4(ctx) { t5 = space(); div7 = element("div"); div6 = element("div"); + div4 = element("div"); + div4.innerHTML = ``; + t6 = space(); div5 = element("div"); - div5.innerHTML = `
    - Changes`; + div5.textContent = "Changes"; t8 = space(); - span3 = element("span"); + span1 = element("span"); t9 = text(t9_value); t10 = space(); if (if_block1) if_block1.c(); - attr(div1, "class", "svelte-1f0ksxd"); - attr(span1, "class", "tree-item-flair"); - attr(div2, "class", "opener tree-item-self is-clickable svelte-1f0ksxd"); - toggle_class(div2, "open", ctx[11]); - attr(div3, "class", "staged"); - attr(div5, "class", "svelte-1f0ksxd"); - attr(span3, "class", "tree-item-flair"); - attr(div6, "class", "opener tree-item-self is-clickable svelte-1f0ksxd"); - toggle_class(div6, "open", ctx[10]); - attr(div7, "class", "changes"); + t11 = space(); + if (if_block2) + if_block2.c(); + attr(div0, "class", "nav-folder-collapse-indicator collapse-icon"); + attr(div1, "class", "nav-folder-title-content"); + attr(span0, "class", "tree-item-flair svelte-1u4uc91"); + attr(div2, "class", "nav-folder-title"); + attr(div3, "class", "staged nav-folder"); + toggle_class(div3, "is-collapsed", !ctx[13]); + attr(div4, "class", "nav-folder-collapse-indicator collapse-icon"); + attr(div5, "class", "nav-folder-title-content"); + attr(span1, "class", "tree-item-flair svelte-1u4uc91"); + attr(div6, "class", "nav-folder-title"); + attr(div7, "class", "changes nav-folder"); + toggle_class(div7, "is-collapsed", !ctx[12]); + attr(div8, "class", "nav-folder-children"); + attr(div9, "class", "nav-folder mod-root"); }, m(target, anchor) { - insert(target, div3, anchor); + insert(target, div9, anchor); + append2(div9, div8); + append2(div8, div3); append2(div3, div2); + append2(div2, div0); + append2(div2, t0); append2(div2, div1); append2(div2, t2); - append2(div2, span1); - append2(span1, t3); + append2(div2, span0); + append2(span0, t3); append2(div3, t4); if (if_block0) if_block0.m(div3, null); - insert(target, t5, anchor); - insert(target, div7, anchor); + append2(div8, t5); + append2(div8, div7); append2(div7, div6); + append2(div6, div4); + append2(div6, t6); append2(div6, div5); append2(div6, t8); - append2(div6, span3); - append2(span3, t9); + append2(div6, span1); + append2(span1, t9); append2(div7, t10); if (if_block1) if_block1.m(div7, null); + append2(div8, t11); + if (if_block2) + if_block2.m(div8, null); current = true; if (!mounted) { dispose = [ - listen(div2, "click", ctx[27]), - listen(div6, "click", ctx[28]) + listen(div2, "click", ctx[30]), + listen(div6, "click", ctx[31]) ]; mounted = true; } @@ -13398,17 +28877,14 @@ function create_if_block4(ctx) { p(ctx2, dirty) { if ((!current || dirty[0] & 32) && t3_value !== (t3_value = ctx2[5].staged.length + "")) set_data(t3, t3_value); - if (dirty[0] & 2048) { - toggle_class(div2, "open", ctx2[11]); - } - if (ctx2[11]) { + if (ctx2[13]) { if (if_block0) { if_block0.p(ctx2, dirty); - if (dirty[0] & 2048) { + if (dirty[0] & 8192) { transition_in(if_block0, 1); } } else { - if_block0 = create_if_block_3(ctx2); + if_block0 = create_if_block_6(ctx2); if_block0.c(); transition_in(if_block0, 1); if_block0.m(div3, null); @@ -13420,19 +28896,19 @@ function create_if_block4(ctx) { }); check_outros(); } + if (!current || dirty[0] & 8192) { + toggle_class(div3, "is-collapsed", !ctx2[13]); + } if ((!current || dirty[0] & 32) && t9_value !== (t9_value = ctx2[5].changed.length + "")) set_data(t9, t9_value); - if (dirty[0] & 1024) { - toggle_class(div6, "open", ctx2[10]); - } - if (ctx2[10]) { + if (ctx2[12]) { if (if_block1) { if_block1.p(ctx2, dirty); - if (dirty[0] & 1024) { + if (dirty[0] & 4096) { transition_in(if_block1, 1); } } else { - if_block1 = create_if_block_12(ctx2); + if_block1 = create_if_block_42(ctx2); if_block1.c(); transition_in(if_block1, 1); if_block1.m(div7, null); @@ -13444,42 +28920,64 @@ function create_if_block4(ctx) { }); check_outros(); } + if (!current || dirty[0] & 4096) { + toggle_class(div7, "is-collapsed", !ctx2[12]); + } + if (ctx2[6].length > 0) { + if (if_block2) { + if_block2.p(ctx2, dirty); + if (dirty[0] & 64) { + transition_in(if_block2, 1); + } + } else { + if_block2 = create_if_block_12(ctx2); + if_block2.c(); + transition_in(if_block2, 1); + if_block2.m(div8, null); + } + } else if (if_block2) { + group_outros(); + transition_out(if_block2, 1, 1, () => { + if_block2 = null; + }); + check_outros(); + } }, i(local) { if (current) return; transition_in(if_block0); transition_in(if_block1); + transition_in(if_block2); current = true; }, o(local) { transition_out(if_block0); transition_out(if_block1); + transition_out(if_block2); current = false; }, d(detaching) { if (detaching) - detach(div3); + detach(div9); if (if_block0) if_block0.d(); - if (detaching) - detach(t5); - if (detaching) - detach(div7); if (if_block1) if_block1.d(); + if (if_block2) + if_block2.d(); mounted = false; run_all(dispose); } }; } -function create_if_block_3(ctx) { +function create_if_block_6(ctx) { let div; let current_block_type_index; let if_block; let div_transition; let current; - const if_block_creators = [create_if_block_4, create_else_block_12]; + const if_block_creators = [create_if_block_7, create_else_block_2]; const if_blocks = []; function select_block_type(ctx2, dirty) { if (ctx2[2]) @@ -13492,7 +28990,7 @@ function create_if_block_3(ctx) { c() { div = element("div"); if_block.c(); - attr(div, "class", "file-view svelte-1f0ksxd"); + attr(div, "class", "nav-folder-children"); }, m(target, anchor) { insert(target, div, anchor); @@ -13552,13 +29050,13 @@ function create_if_block_3(ctx) { } }; } -function create_else_block_12(ctx) { +function create_else_block_2(ctx) { let each_1_anchor; let current; - let each_value_1 = ctx[5].staged; + let each_value_2 = ctx[5].staged; let each_blocks = []; - for (let i = 0; i < each_value_1.length; i += 1) { - each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + for (let i = 0; i < each_value_2.length; i += 1) { + each_blocks[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); } const out = (i) => transition_out(each_blocks[i], 1, 1, () => { each_blocks[i] = null; @@ -13579,22 +29077,22 @@ function create_else_block_12(ctx) { }, p(ctx2, dirty) { if (dirty[0] & 35) { - each_value_1 = ctx2[5].staged; + each_value_2 = ctx2[5].staged; let i; - for (i = 0; i < each_value_1.length; i += 1) { - const child_ctx = get_each_context_1(ctx2, each_value_1, i); + for (i = 0; i < each_value_2.length; i += 1) { + const child_ctx = get_each_context_2(ctx2, each_value_2, i); if (each_blocks[i]) { each_blocks[i].p(child_ctx, dirty); transition_in(each_blocks[i], 1); } else { - each_blocks[i] = create_each_block_1(child_ctx); + each_blocks[i] = create_each_block_2(child_ctx); each_blocks[i].c(); transition_in(each_blocks[i], 1); each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); } } group_outros(); - for (i = each_value_1.length; i < each_blocks.length; i += 1) { + for (i = each_value_2.length; i < each_blocks.length; i += 1) { out(i); } check_outros(); @@ -13603,7 +29101,7 @@ function create_else_block_12(ctx) { i(local) { if (current) return; - for (let i = 0; i < each_value_1.length; i += 1) { + for (let i = 0; i < each_value_2.length; i += 1) { transition_in(each_blocks[i]); } current = true; @@ -13622,15 +29120,15 @@ function create_else_block_12(ctx) { } }; } -function create_if_block_4(ctx) { +function create_if_block_7(ctx) { let treecomponent; let current; treecomponent = new treeComponent_default({ props: { - hierarchy: ctx[9], + hierarchy: ctx[10], plugin: ctx[0], view: ctx[1], - staged: true, + fileType: FileType.staged, topLevel: true } }); @@ -13644,8 +29142,8 @@ function create_if_block_4(ctx) { }, p(ctx2, dirty) { const treecomponent_changes = {}; - if (dirty[0] & 512) - treecomponent_changes.hierarchy = ctx2[9]; + if (dirty[0] & 1024) + treecomponent_changes.hierarchy = ctx2[10]; if (dirty[0] & 1) treecomponent_changes.plugin = ctx2[0]; if (dirty[0] & 2) @@ -13667,12 +29165,12 @@ function create_if_block_4(ctx) { } }; } -function create_each_block_1(ctx) { +function create_each_block_2(ctx) { let stagedfilecomponent; let current; stagedfilecomponent = new stagedFileComponent_default({ props: { - change: ctx[33], + change: ctx[39], view: ctx[1], manager: ctx[0].gitManager } @@ -13688,7 +29186,7 @@ function create_each_block_1(ctx) { p(ctx2, dirty) { const stagedfilecomponent_changes = {}; if (dirty[0] & 32) - stagedfilecomponent_changes.change = ctx2[33]; + stagedfilecomponent_changes.change = ctx2[39]; if (dirty[0] & 2) stagedfilecomponent_changes.view = ctx2[1]; if (dirty[0] & 1) @@ -13710,13 +29208,13 @@ function create_each_block_1(ctx) { } }; } -function create_if_block_12(ctx) { +function create_if_block_42(ctx) { let div; let current_block_type_index; let if_block; let div_transition; let current; - const if_block_creators = [create_if_block_22, create_else_block2]; + const if_block_creators = [create_if_block_52, create_else_block_12]; const if_blocks = []; function select_block_type_1(ctx2, dirty) { if (ctx2[2]) @@ -13729,7 +29227,7 @@ function create_if_block_12(ctx) { c() { div = element("div"); if_block.c(); - attr(div, "class", "file-view svelte-1f0ksxd"); + attr(div, "class", "nav-folder-children"); }, m(target, anchor) { insert(target, div, anchor); @@ -13789,10 +29287,349 @@ function create_if_block_12(ctx) { } }; } +function create_else_block_12(ctx) { + let each_1_anchor; + let current; + let each_value_1 = ctx[5].changed; + let each_blocks = []; + for (let i = 0; i < each_value_1.length; i += 1) { + each_blocks[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i)); + } + const out = (i) => transition_out(each_blocks[i], 1, 1, () => { + each_blocks[i] = null; + }); + return { + c() { + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].c(); + } + each_1_anchor = empty(); + }, + m(target, anchor) { + for (let i = 0; i < each_blocks.length; i += 1) { + each_blocks[i].m(target, anchor); + } + insert(target, each_1_anchor, anchor); + current = true; + }, + p(ctx2, dirty) { + if (dirty[0] & 35) { + each_value_1 = ctx2[5].changed; + let i; + for (i = 0; i < each_value_1.length; i += 1) { + const child_ctx = get_each_context_1(ctx2, each_value_1, i); + if (each_blocks[i]) { + each_blocks[i].p(child_ctx, dirty); + transition_in(each_blocks[i], 1); + } else { + each_blocks[i] = create_each_block_1(child_ctx); + each_blocks[i].c(); + transition_in(each_blocks[i], 1); + each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor); + } + } + group_outros(); + for (i = each_value_1.length; i < each_blocks.length; i += 1) { + out(i); + } + check_outros(); + } + }, + i(local) { + if (current) + return; + for (let i = 0; i < each_value_1.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) { + destroy_each(each_blocks, detaching); + if (detaching) + detach(each_1_anchor); + } + }; +} +function create_if_block_52(ctx) { + let treecomponent; + let current; + treecomponent = new treeComponent_default({ + props: { + hierarchy: ctx[9], + plugin: ctx[0], + view: ctx[1], + fileType: FileType.changed, + topLevel: true + } + }); + return { + c() { + create_component(treecomponent.$$.fragment); + }, + m(target, anchor) { + mount_component(treecomponent, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const treecomponent_changes = {}; + if (dirty[0] & 512) + treecomponent_changes.hierarchy = ctx2[9]; + if (dirty[0] & 1) + treecomponent_changes.plugin = ctx2[0]; + if (dirty[0] & 2) + treecomponent_changes.view = ctx2[1]; + treecomponent.$set(treecomponent_changes); + }, + i(local) { + if (current) + return; + transition_in(treecomponent.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(treecomponent.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(treecomponent, detaching); + } + }; +} +function create_each_block_1(ctx) { + let filecomponent; + let current; + filecomponent = new fileComponent_default({ + props: { + change: ctx[34], + view: ctx[1], + manager: ctx[0].gitManager + } + }); + filecomponent.$on("git-refresh", triggerRefresh); + return { + c() { + create_component(filecomponent.$$.fragment); + }, + m(target, anchor) { + mount_component(filecomponent, target, anchor); + current = true; + }, + p(ctx2, dirty) { + const filecomponent_changes = {}; + if (dirty[0] & 32) + filecomponent_changes.change = ctx2[34]; + if (dirty[0] & 2) + filecomponent_changes.view = ctx2[1]; + if (dirty[0] & 1) + filecomponent_changes.manager = ctx2[0].gitManager; + filecomponent.$set(filecomponent_changes); + }, + i(local) { + if (current) + return; + transition_in(filecomponent.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(filecomponent.$$.fragment, local); + current = false; + }, + d(detaching) { + destroy_component(filecomponent, detaching); + } + }; +} +function create_if_block_12(ctx) { + let div3; + let div2; + let div0; + let t0; + let div1; + let t2; + let span; + let t3_value = ctx[6].length + ""; + let t3; + let t4; + let current; + let mounted; + let dispose; + let if_block = ctx[14] && create_if_block_22(ctx); + return { + c() { + div3 = element("div"); + div2 = element("div"); + div0 = element("div"); + div0.innerHTML = ``; + t0 = space(); + div1 = element("div"); + div1.textContent = "Recently Pulled Files"; + t2 = space(); + span = element("span"); + t3 = text(t3_value); + t4 = space(); + if (if_block) + if_block.c(); + attr(div0, "class", "nav-folder-collapse-indicator collapse-icon"); + attr(div1, "class", "nav-folder-title-content"); + attr(span, "class", "tree-item-flair svelte-1u4uc91"); + attr(div2, "class", "nav-folder-title"); + attr(div3, "class", "pulled nav-folder"); + toggle_class(div3, "is-collapsed", !ctx[14]); + }, + m(target, anchor) { + insert(target, div3, anchor); + append2(div3, div2); + append2(div2, div0); + append2(div2, t0); + append2(div2, div1); + append2(div2, t2); + append2(div2, span); + append2(span, t3); + append2(div3, t4); + if (if_block) + if_block.m(div3, null); + current = true; + if (!mounted) { + dispose = listen(div2, "click", ctx[32]); + mounted = true; + } + }, + p(ctx2, dirty) { + if ((!current || dirty[0] & 64) && t3_value !== (t3_value = ctx2[6].length + "")) + set_data(t3, t3_value); + if (ctx2[14]) { + if (if_block) { + if_block.p(ctx2, dirty); + if (dirty[0] & 16384) { + transition_in(if_block, 1); + } + } else { + if_block = create_if_block_22(ctx2); + if_block.c(); + transition_in(if_block, 1); + if_block.m(div3, null); + } + } else if (if_block) { + group_outros(); + transition_out(if_block, 1, 1, () => { + if_block = null; + }); + check_outros(); + } + if (!current || dirty[0] & 16384) { + toggle_class(div3, "is-collapsed", !ctx2[14]); + } + }, + i(local) { + if (current) + return; + transition_in(if_block); + current = true; + }, + o(local) { + transition_out(if_block); + current = false; + }, + d(detaching) { + if (detaching) + detach(div3); + if (if_block) + if_block.d(); + mounted = false; + dispose(); + } + }; +} +function create_if_block_22(ctx) { + let div; + let current_block_type_index; + let if_block; + let div_transition; + let current; + const if_block_creators = [create_if_block_32, create_else_block2]; + const if_blocks = []; + function select_block_type_2(ctx2, dirty) { + if (ctx2[2]) + return 0; + return 1; + } + current_block_type_index = select_block_type_2(ctx, [-1, -1]); + if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); + return { + c() { + div = element("div"); + if_block.c(); + attr(div, "class", "nav-folder-children"); + }, + m(target, anchor) { + insert(target, div, anchor); + if_blocks[current_block_type_index].m(div, null); + current = true; + }, + p(ctx2, dirty) { + let previous_block_index = current_block_type_index; + current_block_type_index = select_block_type_2(ctx2, dirty); + if (current_block_type_index === previous_block_index) { + if_blocks[current_block_type_index].p(ctx2, dirty); + } else { + 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 { + if_block.p(ctx2, dirty); + } + transition_in(if_block, 1); + if_block.m(div, null); + } + }, + i(local) { + if (current) + return; + transition_in(if_block); + if (local) { + add_render_callback(() => { + if (!div_transition) + div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, true); + div_transition.run(1); + }); + } + current = true; + }, + o(local) { + transition_out(if_block); + if (local) { + if (!div_transition) + div_transition = create_bidirectional_transition(div, slide, { duration: 150 }, false); + div_transition.run(0); + } + current = false; + }, + d(detaching) { + if (detaching) + detach(div); + if_blocks[current_block_type_index].d(); + if (detaching && div_transition) + div_transition.end(); + } + }; +} function create_else_block2(ctx) { let each_1_anchor; let current; - let each_value = ctx[5].changed; + let each_value = ctx[6]; let each_blocks = []; for (let i = 0; i < each_value.length; i += 1) { each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i)); @@ -13815,8 +29652,8 @@ function create_else_block2(ctx) { current = true; }, p(ctx2, dirty) { - if (dirty[0] & 35) { - each_value = ctx2[5].changed; + if (dirty[0] & 66) { + each_value = ctx2[6]; let i; for (i = 0; i < each_value.length; i += 1) { const child_ctx = get_each_context2(ctx2, each_value, i); @@ -13859,15 +29696,15 @@ function create_else_block2(ctx) { } }; } -function create_if_block_22(ctx) { +function create_if_block_32(ctx) { let treecomponent; let current; treecomponent = new treeComponent_default({ props: { - hierarchy: ctx[8], + hierarchy: ctx[11], plugin: ctx[0], view: ctx[1], - staged: false, + fileType: FileType.pulled, topLevel: true } }); @@ -13881,8 +29718,8 @@ function create_if_block_22(ctx) { }, p(ctx2, dirty) { const treecomponent_changes = {}; - if (dirty[0] & 256) - treecomponent_changes.hierarchy = ctx2[8]; + if (dirty[0] & 2048) + treecomponent_changes.hierarchy = ctx2[11]; if (dirty[0] & 1) treecomponent_changes.plugin = ctx2[0]; if (dirty[0] & 2) @@ -13905,56 +29742,50 @@ function create_if_block_22(ctx) { }; } function create_each_block2(ctx) { - let filecomponent; + let pulledfilecomponent; let current; - filecomponent = new fileComponent_default({ + pulledfilecomponent = new pulledFileComponent_default({ props: { - change: ctx[30], - view: ctx[1], - manager: ctx[0].gitManager, - workspace: ctx[0].app.workspace + change: ctx[34], + view: ctx[1] } }); - filecomponent.$on("git-refresh", triggerRefresh); + pulledfilecomponent.$on("git-refresh", triggerRefresh); return { c() { - create_component(filecomponent.$$.fragment); + create_component(pulledfilecomponent.$$.fragment); }, m(target, anchor) { - mount_component(filecomponent, target, anchor); + mount_component(pulledfilecomponent, target, anchor); current = true; }, p(ctx2, dirty) { - const filecomponent_changes = {}; - if (dirty[0] & 32) - filecomponent_changes.change = ctx2[30]; + const pulledfilecomponent_changes = {}; + if (dirty[0] & 64) + pulledfilecomponent_changes.change = ctx2[34]; if (dirty[0] & 2) - filecomponent_changes.view = ctx2[1]; - if (dirty[0] & 1) - filecomponent_changes.manager = ctx2[0].gitManager; - if (dirty[0] & 1) - filecomponent_changes.workspace = ctx2[0].app.workspace; - filecomponent.$set(filecomponent_changes); + pulledfilecomponent_changes.view = ctx2[1]; + pulledfilecomponent.$set(pulledfilecomponent_changes); }, i(local) { if (current) return; - transition_in(filecomponent.$$.fragment, local); + transition_in(pulledfilecomponent.$$.fragment, local); current = true; }, o(local) { - transition_out(filecomponent.$$.fragment, local); + transition_out(pulledfilecomponent.$$.fragment, local); current = false; }, d(detaching) { - destroy_component(filecomponent, detaching); + destroy_component(pulledfilecomponent, detaching); } }; } -function create_fragment4(ctx) { +function create_fragment5(ctx) { let main; - let div9; - let div6; + let div8; + let div7; let div0; let t0; let div1; @@ -13967,9 +29798,9 @@ function create_fragment4(ctx) { let t4; let div5; let t5; - let div7; + let div6; let t6; - let div8; + let div9; let textarea; let t7; let t8; @@ -13977,13 +29808,13 @@ function create_fragment4(ctx) { let current; let mounted; let dispose; - let if_block0 = ctx[6] && create_if_block_5(ctx); - let if_block1 = ctx[5] && create_if_block4(ctx); + let if_block0 = ctx[7] && create_if_block_8(ctx); + let if_block1 = ctx[5] && ctx[10] && ctx[9] && create_if_block4(ctx); return { c() { main = element("main"); - div9 = element("div"); - div6 = element("div"); + div8 = element("div"); + div7 = element("div"); div0 = element("div"); t0 = space(); div1 = element("div"); @@ -13996,9 +29827,9 @@ function create_fragment4(ctx) { t4 = space(); div5 = element("div"); t5 = space(); - div7 = element("div"); + div6 = element("div"); t6 = space(); - div8 = element("div"); + div9 = element("div"); textarea = element("textarea"); t7 = space(); if (if_block0) @@ -14009,73 +29840,73 @@ function create_fragment4(ctx) { if_block1.c(); attr(div0, "id", "commit-btn"); attr(div0, "data-icon", "check"); - attr(div0, "class", "nav-action-button"); + attr(div0, "class", "clickable-icon nav-action-button"); attr(div0, "aria-label", "Commit"); attr(div1, "id", "stage-all"); - attr(div1, "class", "nav-action-button"); + attr(div1, "class", "clickable-icon nav-action-button"); attr(div1, "data-icon", "plus-circle"); attr(div1, "aria-label", "Stage all"); attr(div2, "id", "unstage-all"); - attr(div2, "class", "nav-action-button"); + attr(div2, "class", "clickable-icon nav-action-button"); attr(div2, "data-icon", "minus-circle"); attr(div2, "aria-label", "Unstage all"); attr(div3, "id", "push"); - attr(div3, "class", "nav-action-button"); + attr(div3, "class", "clickable-icon nav-action-button"); attr(div3, "data-icon", "upload"); attr(div3, "aria-label", "Push"); attr(div4, "id", "pull"); - attr(div4, "class", "nav-action-button"); + attr(div4, "class", "clickable-icon nav-action-button"); attr(div4, "data-icon", "download"); attr(div4, "aria-label", "Pull"); attr(div5, "id", "layoutChange"); - attr(div5, "class", "nav-action-button"); + attr(div5, "class", "clickable-icon nav-action-button"); attr(div5, "aria-label", "Change Layout"); - attr(div6, "class", "group svelte-1f0ksxd"); - attr(div7, "id", "refresh"); - attr(div7, "class", "nav-action-button"); - attr(div7, "data-icon", "refresh-cw"); - attr(div7, "aria-label", "Refresh"); - toggle_class(div7, "loading", ctx[4]); - attr(textarea, "class", "commit-msg svelte-1f0ksxd"); + attr(div6, "id", "refresh"); + attr(div6, "class", "clickable-icon nav-action-button"); + attr(div6, "data-icon", "refresh-cw"); + attr(div6, "aria-label", "Refresh"); + toggle_class(div6, "loading", ctx[4]); + attr(div7, "class", "nav-buttons-container"); + attr(div8, "class", "nav-header"); + attr(textarea, "class", "commit-msg-input svelte-1u4uc91"); attr(textarea, "type", "text"); attr(textarea, "spellcheck", "true"); attr(textarea, "placeholder", "Commit Message"); - attr(div8, "class", "search-input-container svelte-1f0ksxd"); - attr(div9, "class", "nav-buttons-container svelte-1f0ksxd"); - attr(div10, "class", "git-view-body svelte-1f0ksxd"); - attr(main, "class", "svelte-1f0ksxd"); + attr(div9, "class", "git-commit-msg svelte-1u4uc91"); + attr(div10, "class", "nav-files-container"); + set_style(div10, "position", "relative"); }, m(target, anchor) { insert(target, main, anchor); + append2(main, div8); + append2(div8, div7); + append2(div7, div0); + ctx[20](div0); + append2(div7, t0); + append2(div7, div1); + ctx[21](div1); + append2(div7, t1); + append2(div7, div2); + ctx[22](div2); + append2(div7, t2); + append2(div7, div3); + ctx[23](div3); + append2(div7, t3); + append2(div7, div4); + ctx[24](div4); + append2(div7, t4); + append2(div7, div5); + ctx[25](div5); + append2(div7, t5); + append2(div7, div6); + ctx[27](div6); + append2(main, t6); append2(main, div9); - append2(div9, div6); - append2(div6, div0); - ctx[17](div0); - append2(div6, t0); - append2(div6, div1); - ctx[18](div1); - append2(div6, t1); - append2(div6, div2); - ctx[19](div2); - append2(div6, t2); - append2(div6, div3); - ctx[20](div3); - append2(div6, t3); - append2(div6, div4); - ctx[21](div4); - append2(div6, t4); - append2(div6, div5); - ctx[22](div5); - append2(div9, t5); - append2(div9, div7); - ctx[24](div7); - append2(div9, t6); - append2(div9, div8); - append2(div8, textarea); - set_input_value(textarea, ctx[6]); - append2(div8, t7); + append2(div9, textarea); + set_input_value(textarea, ctx[7]); + append2(div9, t7); if (if_block0) - if_block0.m(div8, null); + if_block0.m(div9, null); append2(main, t8); append2(main, div10); if (if_block1) @@ -14083,41 +29914,41 @@ function create_fragment4(ctx) { current = true; if (!mounted) { dispose = [ - listen(div0, "click", ctx[12]), - listen(div1, "click", ctx[13]), - listen(div2, "click", ctx[14]), - listen(div3, "click", ctx[15]), - listen(div4, "click", ctx[16]), - listen(div5, "click", ctx[23]), - listen(div7, "click", triggerRefresh), - listen(textarea, "input", ctx[25]) + listen(div0, "click", ctx[15]), + listen(div1, "click", ctx[16]), + listen(div2, "click", ctx[17]), + listen(div3, "click", ctx[18]), + listen(div4, "click", ctx[19]), + listen(div5, "click", ctx[26]), + listen(div6, "click", triggerRefresh), + listen(textarea, "input", ctx[28]) ]; mounted = true; } }, p(ctx2, dirty) { - if (dirty[0] & 16) { - toggle_class(div7, "loading", ctx2[4]); + if (!current || dirty[0] & 16) { + toggle_class(div6, "loading", ctx2[4]); } - if (dirty[0] & 64) { - set_input_value(textarea, ctx2[6]); + if (dirty[0] & 128) { + set_input_value(textarea, ctx2[7]); } - if (ctx2[6]) { + if (ctx2[7]) { if (if_block0) { if_block0.p(ctx2, dirty); } else { - if_block0 = create_if_block_5(ctx2); + if_block0 = create_if_block_8(ctx2); if_block0.c(); - if_block0.m(div8, null); + if_block0.m(div9, null); } } else if (if_block0) { if_block0.d(1); if_block0 = null; } - if (ctx2[5]) { + if (ctx2[5] && ctx2[10] && ctx2[9]) { if (if_block1) { if_block1.p(ctx2, dirty); - if (dirty[0] & 32) { + if (dirty[0] & 1568) { transition_in(if_block1, 1); } } else { @@ -14147,13 +29978,13 @@ function create_fragment4(ctx) { d(detaching) { if (detaching) detach(main); - ctx[17](null); - ctx[18](null); - ctx[19](null); ctx[20](null); ctx[21](null); ctx[22](null); + ctx[23](null); ctx[24](null); + ctx[25](null); + ctx[27](null); if (if_block0) if_block0.d(); if (if_block1) @@ -14166,103 +29997,133 @@ function create_fragment4(ctx) { function triggerRefresh() { dispatchEvent(new CustomEvent("git-refresh")); } -function instance4($$self, $$props, $$invalidate) { +function instance5($$self, $$props, $$invalidate) { let { plugin } = $$props; let { view } = $$props; let loading; - let status; + let status2; + let lastPulledFiles = []; let commitMessage = plugin.settings.commitMessage; let buttons = []; let changeHierarchy; let stagedHierarchy; + let lastPulledFilesHierarchy; let changesOpen = true; let stagedOpen = true; + let lastPulledFilesOpen = true; let showTree = plugin.settings.treeStructure; let layoutBtn; addEventListener("git-view-refresh", refresh); - plugin.app.workspace.onLayoutReady(() => setImmediate(() => { - buttons.forEach((btn) => (0, import_obsidian13.setIcon)(btn, btn.getAttr("data-icon"), 16)); - (0, import_obsidian13.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); - })); + plugin.app.workspace.onLayoutReady(() => { + window.setTimeout(() => { + buttons.forEach((btn) => (0, import_obsidian21.setIcon)(btn, btn.getAttr("data-icon"), 16)); + (0, import_obsidian21.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); + }, 0); + }); onDestroy(() => { removeEventListener("git-view-refresh", refresh); }); - function commit() { - return __awaiter(this, void 0, void 0, function* () { - $$invalidate(4, loading = true); - if (yield plugin.hasTooBigFiles(status.staged)) { + async function commit2() { + $$invalidate(4, loading = true); + if (status2) { + if (await plugin.hasTooBigFiles(status2.staged)) { plugin.setState(PluginState.idle); return false; } plugin.gitManager.commit(commitMessage).then(() => { if (commitMessage !== plugin.settings.commitMessage) { - $$invalidate(6, commitMessage = ""); + $$invalidate(7, commitMessage = ""); } }).finally(triggerRefresh); - }); + } } - function refresh() { - return __awaiter(this, void 0, void 0, function* () { - $$invalidate(5, status = plugin.cachedStatus); - if (status) { - $$invalidate(8, changeHierarchy = { + async function refresh() { + if (!plugin.gitReady) { + $$invalidate(5, status2 = void 0); + return; + } + $$invalidate(5, status2 = plugin.cachedStatus); + if (plugin.lastPulledFiles && plugin.lastPulledFiles != lastPulledFiles) { + $$invalidate(6, lastPulledFiles = plugin.lastPulledFiles); + $$invalidate(11, lastPulledFilesHierarchy = { + title: "", + path: "", + children: plugin.gitManager.getTreeStructure(lastPulledFiles) + }); + } + if (status2) { + const sort = (a, b) => { + return a.vault_path.split("/").last().localeCompare(b.vault_path.split("/").last()); + }; + status2.changed.sort(sort); + status2.staged.sort(sort); + if (status2.changed.length + status2.staged.length > 500) { + $$invalidate(5, status2 = void 0); + if (!plugin.loading) { + plugin.displayError("Too many changes to display"); + } + } else { + $$invalidate(9, changeHierarchy = { title: "", - children: plugin.gitManager.getTreeStructure(status.changed) + path: "", + children: plugin.gitManager.getTreeStructure(status2.changed) }); - $$invalidate(9, stagedHierarchy = { + $$invalidate(10, stagedHierarchy = { title: "", - children: plugin.gitManager.getTreeStructure(status.staged) + path: "", + children: plugin.gitManager.getTreeStructure(status2.staged) }); } - $$invalidate(4, loading = plugin.loading); - }); + } else { + $$invalidate(9, changeHierarchy = void 0); + $$invalidate(10, stagedHierarchy = void 0); + } + $$invalidate(4, loading = plugin.loading); } function stageAll() { $$invalidate(4, loading = true); - plugin.gitManager.stageAll().finally(triggerRefresh); + plugin.gitManager.stageAll({ status: status2 }).finally(triggerRefresh); } function unstageAll() { $$invalidate(4, loading = true); - plugin.gitManager.unstageAll().finally(triggerRefresh); + plugin.gitManager.unstageAll({ status: status2 }).finally(triggerRefresh); } - function push() { + function push2() { $$invalidate(4, loading = true); - if (ready) { - plugin.push().finally(triggerRefresh); - } + plugin.push().finally(triggerRefresh); } - function pull() { + function pull2() { $$invalidate(4, loading = true); plugin.pullChangesFromRemote().finally(triggerRefresh); } function div0_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[0] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div1_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[1] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div2_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[2] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div3_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[3] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div4_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[4] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function div5_binding($$value) { @@ -14276,19 +30137,20 @@ function instance4($$self, $$props, $$invalidate) { $$invalidate(0, plugin.settings.treeStructure = showTree, plugin); plugin.saveSettings(); }; - function div7_binding($$value) { + function div6_binding($$value) { binding_callbacks[$$value ? "unshift" : "push"](() => { buttons[6] = $$value; - $$invalidate(7, buttons); + $$invalidate(8, buttons); }); } function textarea_input_handler() { commitMessage = this.value; - $$invalidate(6, commitMessage); + $$invalidate(7, commitMessage); } - const click_handler_1 = () => $$invalidate(6, commitMessage = ""); - const click_handler_2 = () => $$invalidate(11, stagedOpen = !stagedOpen); - const click_handler_3 = () => $$invalidate(10, changesOpen = !changesOpen); + const click_handler_1 = () => $$invalidate(7, commitMessage = ""); + const click_handler_2 = () => $$invalidate(13, stagedOpen = !stagedOpen); + const click_handler_3 = () => $$invalidate(12, changesOpen = !changesOpen); + const click_handler_4 = () => $$invalidate(14, lastPulledFilesOpen = !lastPulledFilesOpen); $$self.$$set = ($$props2) => { if ("plugin" in $$props2) $$invalidate(0, plugin = $$props2.plugin); @@ -14300,7 +30162,7 @@ function instance4($$self, $$props, $$invalidate) { $: { if (layoutBtn) { layoutBtn.empty(); - (0, import_obsidian13.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); + (0, import_obsidian21.setIcon)(layoutBtn, showTree ? "list" : "folder", 16); } } } @@ -14311,18 +30173,21 @@ function instance4($$self, $$props, $$invalidate) { showTree, layoutBtn, loading, - status, + status2, + lastPulledFiles, commitMessage, buttons, changeHierarchy, stagedHierarchy, + lastPulledFilesHierarchy, changesOpen, stagedOpen, - commit, + lastPulledFilesOpen, + commit2, stageAll, unstageAll, - push, - pull, + push2, + pull2, div0_binding, div1_binding, div2_binding, @@ -14330,23 +30195,24 @@ function instance4($$self, $$props, $$invalidate) { div4_binding, div5_binding, click_handler, - div7_binding, + div6_binding, textarea_input_handler, click_handler_1, click_handler_2, - click_handler_3 + click_handler_3, + click_handler_4 ]; } var GitView = class extends SvelteComponent { constructor(options) { super(); - init(this, options, instance4, create_fragment4, safe_not_equal, { plugin: 0, view: 1 }, add_css4, [-1, -1]); + init2(this, options, instance5, create_fragment5, safe_not_equal, { plugin: 0, view: 1 }, add_css5, [-1, -1]); } }; var gitView_default = GitView; // src/ui/sidebar/sidebarView.ts -var GitView2 = class extends import_obsidian14.ItemView { +var GitView2 = class extends import_obsidian22.ItemView { constructor(leaf, plugin) { super(leaf); this.plugin = plugin; @@ -14362,7 +30228,6 @@ var GitView2 = class extends import_obsidian14.ItemView { return GIT_VIEW_CONFIG.icon; } onClose() { - this._view.$destroy(); return super.onClose(); } onOpen() { @@ -14377,8 +30242,33 @@ var GitView2 = class extends import_obsidian14.ItemView { } }; +// src/ui/statusBar/branchStatusBar.ts +init_polyfill_buffer(); +var BranchStatusBar = class { + constructor(statusBarEl, plugin) { + this.statusBarEl = statusBarEl; + this.plugin = plugin; + this.statusBarEl.addClass("mod-clickable"); + this.statusBarEl.onClickEvent((e) => { + this.plugin.switchBranch(); + }); + } + async display() { + if (this.plugin.gitReady) { + const branchInfo = await this.plugin.gitManager.branchInfo(); + if (branchInfo.current != void 0) { + this.statusBarEl.setText(branchInfo.current); + } else { + this.statusBarEl.empty(); + } + } else { + this.statusBarEl.empty(); + } + } +}; + // src/main.ts -var ObsidianGit = class extends import_obsidian15.Plugin { +var ObsidianGit = class extends import_obsidian23.Plugin { constructor() { super(...arguments); this.gitReady = false; @@ -14386,518 +30276,786 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.conflictOutputFile = "conflict-files-obsidian-git.md"; this.offlineMode = false; this.loading = false; - this.debRefresh = (0, import_obsidian15.debounce)(() => { - if (this.settings.refreshSourceControl) { - this.refresh(); - } - }, 7e3, true); } setState(state) { var _a2; this.state = state; (_a2 = this.statusBar) == null ? void 0 : _a2.display(); } - updateCachedStatus() { - return __async(this, null, function* () { - this.cachedStatus = yield this.gitManager.status(); - return this.cachedStatus; - }); + async updateCachedStatus() { + this.cachedStatus = await this.gitManager.status(); + return this.cachedStatus; } - refresh() { - return __async(this, null, function* () { - const gitView = this.app.workspace.getLeavesOfType(GIT_VIEW_CONFIG.type); - if (this.settings.changedFilesInStatusBar || gitView.length > 0) { - this.loading = true; - dispatchEvent(new CustomEvent("git-view-refresh")); - yield this.updateCachedStatus(); - this.loading = false; - dispatchEvent(new CustomEvent("git-view-refresh")); + async refresh() { + const gitView = this.app.workspace.getLeavesOfType(GIT_VIEW_CONFIG.type); + if (this.settings.changedFilesInStatusBar || gitView.length > 0) { + this.loading = true; + dispatchEvent(new CustomEvent("git-view-refresh")); + await this.updateCachedStatus(); + this.loading = false; + dispatchEvent(new CustomEvent("git-view-refresh")); + } + } + async onload() { + console.log("loading " + this.manifest.name + " plugin"); + this.localStorage = new LocalStorageSettings(this); + this.localStorage.migrate(); + await this.loadSettings(); + this.migrateSettings(); + this.addSettingTab(new ObsidianGitSettingsTab(this.app, this)); + if (!this.localStorage.getPluginDisabled()) { + this.loadPlugin(); + } + } + async loadPlugin() { + addEventListener("git-refresh", this.refresh.bind(this)); + this.registerView(GIT_VIEW_CONFIG.type, (leaf) => { + return new GitView2(leaf, this); + }); + this.registerView(DIFF_VIEW_CONFIG.type, (leaf) => { + return new DiffView(leaf, this); + }); + this.app.workspace.registerHoverLinkSource(GIT_VIEW_CONFIG.type, { + display: "Git View", + defaultMod: true + }); + this.setRefreshDebouncer(); + this.addCommand({ + id: "edit-gitignore", + name: "Edit .gitignore", + callback: async () => { + const content = await this.app.vault.adapter.read(this.gitManager.getVaultPath(".gitignore")); + const modal = new IgnoreModal(this.app, content); + const res = await modal.open(); + if (res !== void 0) { + await this.app.vault.adapter.write(this.gitManager.getVaultPath(".gitignore"), res); + this.refresh(); + } } }); - } - onload() { - return __async(this, null, function* () { - console.log("loading " + this.manifest.name + " plugin"); - yield this.loadSettings(); - this.migrateSettings(); - addEventListener("git-refresh", this.refresh.bind(this)); - this.registerView(GIT_VIEW_CONFIG.type, (leaf) => { - return new GitView2(leaf, this); - }); - this.registerView(DIFF_VIEW_CONFIG.type, (leaf) => { - return new DiffView(leaf, this); - }); - this.app.workspace.registerHoverLinkSource(GIT_VIEW_CONFIG.type, { - display: "Git View", - defaultMod: true - }); - this.addSettingTab(new ObsidianGitSettingsTab(this.app, this)); - this.addCommand({ - id: "open-git-view", - name: "Open source control view", - callback: () => __async(this, null, function* () { - if (this.app.workspace.getLeavesOfType(GIT_VIEW_CONFIG.type).length === 0) { - yield this.app.workspace.getRightLeaf(false).setViewState({ - type: GIT_VIEW_CONFIG.type - }); - } - this.app.workspace.revealLeaf(this.app.workspace.getLeavesOfType(GIT_VIEW_CONFIG.type).first()); - dispatchEvent(new CustomEvent("git-refresh")); - }) - }); - this.addCommand({ - id: "open-diff-view", - name: "Open diff view", - editorCallback: (editor, view) => __async(this, null, function* () { - this.app.workspace.createLeafBySplit(view.leaf).setViewState({ type: DIFF_VIEW_CONFIG.type, state: { staged: false, file: view.file.path } }); - }) - }); - this.addCommand({ - id: "view-file-on-github", - name: "Open file on GitHub", - editorCallback: (editor, { file }) => openLineInGitHub(editor, file, this.gitManager) - }); - this.addCommand({ - id: "view-history-on-github", - name: "Open file history on GitHub", - editorCallback: (_, { file }) => openHistoryInGitHub(file, this.gitManager) - }); - this.addCommand({ - id: "pull", - name: "Pull", - callback: () => this.promiseQueue.addTask(() => this.pullChangesFromRemote()) - }); - this.addCommand({ - id: "push", - name: "Create backup", - callback: () => this.promiseQueue.addTask(() => this.createBackup(false)) - }); - this.addCommand({ - id: "commit-push-specified-message", - name: "Create backup with specific message", - callback: () => this.promiseQueue.addTask(() => this.createBackup(false, true)) - }); - this.addCommand({ - id: "commit", - name: "Commit all changes", - callback: () => this.promiseQueue.addTask(() => this.commit(false)) - }); - this.addCommand({ - id: "commit-specified-message", - name: "Commit all changes with specific message", - callback: () => this.promiseQueue.addTask(() => this.commit(false, true)) - }); - this.addCommand({ - id: "push2", - name: "Push", - callback: () => this.promiseQueue.addTask(() => this.push()) - }); - this.addCommand({ - id: "stage-current-file", - name: "Stage current file", - checkCallback: (checking) => { - if (checking) { - return this.app.workspace.getActiveFile() !== null; - } else { - this.promiseQueue.addTask(() => this.stageCurrentFile()); - } + this.addCommand({ + id: "open-git-view", + name: "Open source control view", + callback: async () => { + const leafs = this.app.workspace.getLeavesOfType(GIT_VIEW_CONFIG.type); + let leaf; + if (leafs.length === 0) { + leaf = this.app.workspace.getRightLeaf(false); + await leaf.setViewState({ + type: GIT_VIEW_CONFIG.type + }); + } else { + leaf = leafs.first(); } - }); - this.addCommand({ - id: "unstage-current-file", - name: "Unstage current file", - checkCallback: (checking) => { - if (checking) { - return this.app.workspace.getActiveFile() !== null; - } else { - this.promiseQueue.addTask(() => this.unstageCurrentFile()); - } - } - }); - this.addCommand({ - id: "edit-remotes", - name: "Edit remotes", - callback: () => __async(this, null, function* () { - return this.editRemotes(); - }) - }); - this.addCommand({ - id: "remove-remote", - name: "Remove remote", - callback: () => __async(this, null, function* () { - return this.removeRemote(); - }) - }); - this.addCommand({ - id: "init-repo", - name: "Initialize a new repo", - callback: () => __async(this, null, function* () { - return this.createNewRepo(); - }) - }); - this.addCommand({ - id: "clone-repo", - name: "Clone an existing remote repo", - callback: () => __async(this, null, function* () { - return this.cloneNewRepo(); - }) - }); - this.addCommand({ - id: "list-changed-files", - name: "List changed files", - callback: () => __async(this, null, function* () { - const status = yield this.gitManager.status(); - this.setState(PluginState.idle); - new ChangedFilesModal(this, status.changed).open(); - }) - }); - if (this.settings.showStatusBar) { - let statusBarEl = this.addStatusBarItem(); - this.statusBar = new StatusBar(statusBarEl, this); - this.registerInterval(window.setInterval(() => this.statusBar.display(), 1e3)); + this.app.workspace.revealLeaf(leaf); + dispatchEvent(new CustomEvent("git-refresh")); } - this.app.workspace.onLayoutReady(() => this.init()); + }); + this.addCommand({ + id: "open-diff-view", + name: "Open diff view", + checkCallback: (checking) => { + var _a2; + const file = this.app.workspace.getActiveFile(); + if (checking) { + return file !== null; + } else { + (_a2 = getNewLeaf()) == null ? void 0 : _a2.setViewState({ type: DIFF_VIEW_CONFIG.type, state: { staged: false, file: file.path } }); + } + } + }); + this.addCommand({ + id: "view-file-on-github", + name: "Open file on GitHub", + editorCallback: (editor, { file }) => openLineInGitHub(editor, file, this.gitManager) + }); + this.addCommand({ + id: "view-history-on-github", + name: "Open file history on GitHub", + editorCallback: (_, { file }) => openHistoryInGitHub(file, this.gitManager) + }); + this.addCommand({ + id: "pull", + name: "Pull", + callback: () => this.promiseQueue.addTask(() => this.pullChangesFromRemote()) + }); + this.addCommand({ + id: "add-to-gitignore", + name: "Add file to gitignore", + checkCallback: (checking) => { + const file = app.workspace.getActiveFile(); + if (checking) { + return file !== null; + } else { + app.vault.adapter.append(this.gitManager.getVaultPath(".gitignore"), "\n" + this.gitManager.getPath(file.path, true)).then(() => { + this.refresh(); + }); + } + } + }); + this.addCommand({ + id: "push", + name: "Create backup", + callback: () => this.promiseQueue.addTask(() => this.createBackup(false)) + }); + this.addCommand({ + id: "backup-and-close", + name: "Create backup and close", + callback: () => this.promiseQueue.addTask(async () => { + await this.createBackup(false); + window.close(); + }) + }); + this.addCommand({ + id: "commit-push-specified-message", + name: "Create backup with specific message", + callback: () => this.promiseQueue.addTask(() => this.createBackup(false, true)) + }); + this.addCommand({ + id: "commit", + name: "Commit all changes", + callback: () => this.promiseQueue.addTask(() => this.commit(false)) + }); + this.addCommand({ + id: "commit-specified-message", + name: "Commit all changes with specific message", + callback: () => this.promiseQueue.addTask(() => this.commit(false, true)) + }); + this.addCommand({ + id: "commit-staged", + name: "Commit staged", + callback: () => this.promiseQueue.addTask(() => this.commit(false, false, true)) + }); + this.addCommand({ + id: "commit-staged-specified-message", + name: "Commit staged with specific message", + callback: () => this.promiseQueue.addTask(() => this.commit(false, true, true)) + }); + this.addCommand({ + id: "push2", + name: "Push", + callback: () => this.promiseQueue.addTask(() => this.push()) + }); + this.addCommand({ + id: "stage-current-file", + name: "Stage current file", + checkCallback: (checking) => { + const file = this.app.workspace.getActiveFile(); + if (checking) { + return file !== null; + } else { + this.promiseQueue.addTask(() => this.stageFile(file)); + } + } + }); + this.addCommand({ + id: "unstage-current-file", + name: "Unstage current file", + checkCallback: (checking) => { + const file = this.app.workspace.getActiveFile(); + if (checking) { + return file !== null; + } else { + this.promiseQueue.addTask(() => this.unstageFile(file)); + } + } + }); + this.addCommand({ + id: "edit-remotes", + name: "Edit remotes", + callback: async () => this.editRemotes() + }); + this.addCommand({ + id: "remove-remote", + name: "Remove remote", + callback: async () => this.removeRemote() + }); + this.addCommand({ + id: "delete-repo", + name: "CAUTION: Delete repository", + callback: async () => { + const repoExists = await this.app.vault.adapter.exists(`${this.settings.basePath}/.git`); + if (repoExists) { + const modal = new GeneralModal({ options: ["NO", "YES"], placeholder: "Do you really want to delete the repository (.git directory)? This action cannot be undone.", onlySelection: true }); + const shouldDelete = await modal.open() === "YES"; + if (shouldDelete) { + await this.app.vault.adapter.rmdir(`${this.settings.basePath}/.git`, true); + new import_obsidian23.Notice("Successfully deleted repository. Reloading plugin..."); + this.unloadPlugin(); + this.init(); + } + } else { + new import_obsidian23.Notice("No repository found"); + } + } + }); + this.addCommand({ + id: "init-repo", + name: "Initialize a new repo", + callback: async () => this.createNewRepo() + }); + this.addCommand({ + id: "clone-repo", + name: "Clone an existing remote repo", + callback: async () => this.cloneNewRepo() + }); + this.addCommand({ + id: "list-changed-files", + name: "List changed files", + callback: async () => { + if (!await this.isAllInitialized()) + return; + const status2 = await this.gitManager.status(); + this.setState(PluginState.idle); + if (status2.changed.length + status2.staged.length > 500) { + this.displayError("Too many changes to display"); + return; + } + new ChangedFilesModal(this, status2.changed).open(); + } + }); + this.addCommand({ + id: "switch-branch", + name: "Switch branch", + callback: () => { + this.switchBranch(); + } + }); + this.addCommand({ + id: "create-branch", + name: "Create new branch", + callback: () => { + this.createBranch(); + } + }); + this.addCommand({ + id: "delete-branch", + name: "Delete branch", + callback: () => { + this.deleteBranch(); + } + }); + this.registerEvent(this.app.workspace.on("file-menu", (menu, file, source) => { + this.handleFileMenu(menu, file, source); + })); + if (this.settings.showStatusBar) { + const statusBarEl = this.addStatusBarItem(); + this.statusBar = new StatusBar(statusBarEl, this); + this.registerInterval(window.setInterval(() => { + var _a2; + return (_a2 = this.statusBar) == null ? void 0 : _a2.display(); + }, 1e3)); + } + if (import_obsidian23.Platform.isDesktop && this.settings.showBranchStatusBar) { + const branchStatusBarEl = this.addStatusBarItem(); + this.branchBar = new BranchStatusBar(branchStatusBarEl, this); + this.registerInterval(window.setInterval(() => { + var _a2; + return (_a2 = this.branchBar) == null ? void 0 : _a2.display(); + }, 6e4)); + } + this.app.workspace.onLayoutReady(() => this.init()); + } + setRefreshDebouncer() { + var _a2; + (_a2 = this.debRefresh) == null ? void 0 : _a2.cancel(); + this.debRefresh = (0, import_obsidian23.debounce)(() => { + if (this.settings.refreshSourceControl) { + this.refresh(); + } + }, this.settings.refreshSourceControlTimer, true); + } + async showNotices() { + const length = 1e4; + if (this.manifest.id === "obsidian-git" && import_obsidian23.Platform.isDesktopApp && !this.settings.showedMobileNotice) { + new import_obsidian23.Notice("Obsidian Git is now available on mobile! Please read the plugin's README for more information.", length); + this.settings.showedMobileNotice = true; + await this.saveSettings(); + } + if (this.manifest.id === "obsidian-git-isomorphic") { + new import_obsidian23.Notice("Obsidian Git Mobile is now deprecated. Please uninstall it and install Obsidian Git instead.", length); + } + } + handleFileMenu(menu, file, source) { + if (source !== "file-explorer-context-menu") { + return; + } + if (!file) { + return; + } + if (!this.gitReady) + return; + menu.addItem((item) => { + item.setTitle(`Git: Stage`).setIcon("plus-circle").setSection("action").onClick((_) => { + this.promiseQueue.addTask(async () => { + if (file instanceof import_obsidian23.TFile) { + await this.gitManager.stage(file.path, true); + } else { + await this.gitManager.stageAll({ dir: this.gitManager.getPath(file.path, true) }); + } + this.displayMessage(`Staged ${file.path}`); + }); + }); + }); + menu.addItem((item) => { + item.setTitle(`Git: Unstage`).setIcon("minus-circle").setSection("action").onClick((_) => { + this.promiseQueue.addTask(async () => { + if (file instanceof import_obsidian23.TFile) { + await this.gitManager.unstage(file.path, true); + } else { + await this.gitManager.unstageAll({ dir: this.gitManager.getPath(file.path, true) }); + } + this.displayMessage(`Unstaged ${file.path}`); + }); + }); }); } - migrateSettings() { + async migrateSettings() { if (this.settings.mergeOnPull != void 0) { this.settings.syncMethod = this.settings.mergeOnPull ? "merge" : "rebase"; this.settings.mergeOnPull = void 0; - return this.saveSettings(); + await this.saveSettings(); } if (this.settings.autoCommitMessage === void 0) { this.settings.autoCommitMessage = this.settings.commitMessage; - this.saveSettings(); + await this.saveSettings(); + } + if (this.settings.gitPath != void 0) { + this.localStorage.setGitPath(this.settings.gitPath); + this.settings.gitPath = void 0; + await this.saveSettings(); } } - onunload() { - return __async(this, null, function* () { - this.app.workspace.unregisterHoverLinkSource(GIT_VIEW_CONFIG.type); - this.app.workspace.detachLeavesOfType(GIT_VIEW_CONFIG.type); - this.app.workspace.detachLeavesOfType(DIFF_VIEW_CONFIG.type); - this.clearAutoPull(); - this.clearAutoBackup(); - removeEventListener("git-refresh", this.refresh.bind(this)); - this.app.metadataCache.offref(this.modifyEvent); - this.app.metadataCache.offref(this.deleteEvent); - this.app.metadataCache.offref(this.createEvent); - this.app.metadataCache.offref(this.renameEvent); - console.log("unloading " + this.manifest.name + " plugin"); - }); + unloadPlugin() { + this.gitReady = false; + dispatchEvent(new CustomEvent("git-refresh")); + this.clearAutoPull(); + this.clearAutoPush(); + this.clearAutoBackup(); + removeEventListener("git-refresh", this.refresh.bind(this)); + this.app.metadataCache.offref(this.modifyEvent); + this.app.metadataCache.offref(this.deleteEvent); + this.app.metadataCache.offref(this.createEvent); + this.app.metadataCache.offref(this.renameEvent); + this.debRefresh.cancel(); } - loadSettings() { - return __async(this, null, function* () { - this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); - }); + async onunload() { + this.app.workspace.unregisterHoverLinkSource(GIT_VIEW_CONFIG.type); + this.unloadPlugin(); + console.log("unloading " + this.manifest.name + " plugin"); } - saveSettings() { - return __async(this, null, function* () { - yield this.saveData(this.settings); - }); + async loadSettings() { + let data = await this.loadData(); + if (data == void 0) { + data = { showedMobileNotice: true }; + } + this.settings = Object.assign({}, DEFAULT_SETTINGS, data); } - saveLastAuto(date, mode) { - return __async(this, null, function* () { - if (mode === "backup") { - window.localStorage.setItem(this.manifest.id + ":lastAutoBackup", date.toString()); - } else if (mode === "pull") { - window.localStorage.setItem(this.manifest.id + ":lastAutoPull", date.toString()); - } else if (mode === "push") { - window.localStorage.setItem(this.manifest.id + ":lastAutoPush", date.toString()); - } - }); + async saveSettings() { + await this.saveData(this.settings); } - loadLastAuto() { - return __async(this, null, function* () { - var _a2, _b, _c; - return { - "backup": new Date((_a2 = window.localStorage.getItem(this.manifest.id + ":lastAutoBackup")) != null ? _a2 : ""), - "pull": new Date((_b = window.localStorage.getItem(this.manifest.id + ":lastAutoPull")) != null ? _b : ""), - "push": new Date((_c = window.localStorage.getItem(this.manifest.id + ":lastAutoPush")) != null ? _c : "") - }; - }); + async saveLastAuto(date, mode) { + if (mode === "backup") { + this.localStorage.setLastAutoBackup(date.toString()); + } else if (mode === "pull") { + this.localStorage.setLastAutoPull(date.toString()); + } else if (mode === "push") { + this.localStorage.setLastAutoPush(date.toString()); + } } - init() { - return __async(this, null, function* () { - try { + async loadLastAuto() { + var _a2, _b, _c; + return { + "backup": new Date((_a2 = this.localStorage.getLastAutoBackup()) != null ? _a2 : ""), + "pull": new Date((_b = this.localStorage.getLastAutoPull()) != null ? _b : ""), + "push": new Date((_c = this.localStorage.getLastAutoPush()) != null ? _c : "") + }; + } + async init() { + var _a2; + this.showNotices(); + try { + if (import_obsidian23.Platform.isDesktopApp) { this.gitManager = new SimpleGit(this); - if (this.gitManager instanceof SimpleGit) { - yield this.gitManager.setGitInstance(); - } - const result = yield this.gitManager.checkRequirements(); - switch (result) { - case "missing-git": - this.displayError("Cannot run git command"); - break; - case "missing-repo": - new import_obsidian15.Notice("Can't find a valid git repository. Please create one via the given command."); - break; - case "valid": - this.gitReady = true; - this.setState(PluginState.idle); - this.modifyEvent = this.app.vault.on("modify", () => { - this.debRefresh(); - }); - this.deleteEvent = this.app.vault.on("delete", () => { - this.debRefresh(); - }); - this.createEvent = this.app.vault.on("create", () => { - this.debRefresh(); - }); - this.renameEvent = this.app.vault.on("rename", () => { - this.debRefresh(); - }); - this.registerEvent(this.modifyEvent); - this.registerEvent(this.deleteEvent); - this.registerEvent(this.createEvent); - this.registerEvent(this.renameEvent); - dispatchEvent(new CustomEvent("git-refresh")); - if (this.settings.autoPullOnBoot) { - this.promiseQueue.addTask(() => this.pullChangesFromRemote()); - } - const lastAutos = yield this.loadLastAuto(); - if (this.settings.autoSaveInterval > 0) { - const now2 = new Date(); - const diff = this.settings.autoSaveInterval - Math.round((now2.getTime() - lastAutos.backup.getTime()) / 1e3 / 60); - this.startAutoBackup(diff <= 0 ? 0 : diff); - } - if (this.settings.differentIntervalCommitAndPush && this.settings.autoPushInterval > 0) { - const now2 = new Date(); - const diff = this.settings.autoPushInterval - Math.round((now2.getTime() - lastAutos.push.getTime()) / 1e3 / 60); - this.startAutoPush(diff <= 0 ? 0 : diff); - } - if (this.settings.autoPullInterval > 0) { - const now2 = new Date(); - const diff = this.settings.autoPullInterval - Math.round((now2.getTime() - lastAutos.pull.getTime()) / 1e3 / 60); - this.startAutoPull(diff <= 0 ? 0 : diff); - } - break; - default: - console.log("Something weird happened. The 'checkRequirements' result is " + result); - } - } catch (error) { - this.displayError(error); - console.error(error); - } - }); - } - createNewRepo() { - return __async(this, null, function* () { - yield this.gitManager.init(); - new import_obsidian15.Notice("Initialized new repo"); - }); - } - cloneNewRepo() { - return __async(this, null, function* () { - const modal = new GeneralModal(this.app, [], "Enter remote URL"); - const url = yield modal.open(); - if (url) { - let dir = yield new GeneralModal(this.app, [], "Enter directory for clone. It needs to be empty or not existent.").open(); - if (dir) { - dir = path2.normalize(dir); - new import_obsidian15.Notice(`Cloning new repo into "${dir}"`); - yield this.gitManager.clone(url, dir); - new import_obsidian15.Notice("Cloned new repo"); - } - } - }); - } - isAllInitialized() { - return __async(this, null, function* () { - if (!this.gitReady) { - yield this.init(); - } - return this.gitReady; - }); - } - pullChangesFromRemote() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - const filesUpdated = yield this.pull(); - if (!filesUpdated) { - this.displayMessage("Everything is up-to-date"); - } - if (this.gitManager instanceof SimpleGit) { - const status = yield this.gitManager.status(); - if (status.conflicted.length > 0) { - this.displayError(`You have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}`); - this.handleConflict(status.conflicted); - } - } - dispatchEvent(new CustomEvent("git-refresh")); - this.lastUpdate = Date.now(); - this.setState(PluginState.idle); - }); - } - createBackup(fromAutoBackup, requestCustomMessage = false) { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - if (!(yield this.commit(fromAutoBackup, requestCustomMessage))) - return; - if (!this.settings.disablePush) { - if (yield this.gitManager.canPush()) { - if (this.settings.pullBeforePush) { - yield this.pull(); - } - yield this.push(); - } else { - this.displayMessage("No changes to push"); - } - } - this.setState(PluginState.idle); - }); - } - commit(fromAutoBackup, requestCustomMessage = false) { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return false; - const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); - if (file) - yield this.app.vault.delete(file); - let status; - if (this.gitManager instanceof SimpleGit) { - status = yield this.gitManager.status(); - if (fromAutoBackup && status.conflicted.length > 0) { - this.displayError(`Did not commit, because you have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}. Please resolve them and commit per command.`); - this.handleConflict(status.conflicted); - return; - } + await this.gitManager.setGitInstance(); } else { - status = yield this.gitManager.status(); + this.gitManager = new IsomorphicGit(this); } - if (yield this.hasTooBigFiles([...status.staged, ...status.changed])) { - this.setState(PluginState.idle); - return false; - } - const changedFiles = status.changed.length + status.staged.length; - if (changedFiles !== 0) { - let commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage; - if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) { - if (!this.settings.disablePopups && fromAutoBackup) { - new import_obsidian15.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort"); - } - const tempMessage = yield new CustomMessageModal(this, true).open(); - if (tempMessage != void 0 && tempMessage != "" && tempMessage != "...") { - commitMessage = tempMessage; - } else { - this.setState(PluginState.idle); - return false; - } - } - const committedFiles = yield this.gitManager.commitAll(commitMessage); - this.displayMessage(`Committed ${committedFiles} ${committedFiles > 1 ? "files" : "file"}`); - } else { - this.displayMessage("No changes to commit"); - } - dispatchEvent(new CustomEvent("git-refresh")); - this.setState(PluginState.idle); - return true; - }); - } - hasTooBigFiles(files) { - return __async(this, null, function* () { - var _a2; - const branchInfo = yield this.gitManager.branchInfo(); - const remote = (_a2 = branchInfo.tracking) == null ? void 0 : _a2.split("/")[0]; - if (remote) { - const remoteUrl = yield this.gitManager.getRemoteUrl(remote); - if (remoteUrl.includes("github.com")) { - const tooBigFiles = files.filter((f) => { - const file = this.app.vault.getAbstractFileByPath(f.vault_path); - if (file instanceof import_obsidian15.TFile) { - return file.stat.size >= 1e8; - } - return false; + const result = await this.gitManager.checkRequirements(); + switch (result) { + case "missing-git": + this.displayError("Cannot run git command"); + break; + case "missing-repo": + new import_obsidian23.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo."); + break; + case "valid": + this.gitReady = true; + this.setState(PluginState.idle); + this.modifyEvent = this.app.vault.on("modify", () => { + this.debRefresh(); }); - if (tooBigFiles.length > 0) { - this.displayError(`Did not commit, because following files are too big: ${tooBigFiles.map((e) => e.vault_path)}. Please remove them.`); - return true; + this.deleteEvent = this.app.vault.on("delete", () => { + this.debRefresh(); + }); + this.createEvent = this.app.vault.on("create", () => { + this.debRefresh(); + }); + this.renameEvent = this.app.vault.on("rename", () => { + this.debRefresh(); + }); + this.registerEvent(this.modifyEvent); + this.registerEvent(this.deleteEvent); + this.registerEvent(this.createEvent); + this.registerEvent(this.renameEvent); + (_a2 = this.branchBar) == null ? void 0 : _a2.display(); + dispatchEvent(new CustomEvent("git-refresh")); + if (this.settings.autoPullOnBoot) { + this.promiseQueue.addTask(() => this.pullChangesFromRemote()); + } + const lastAutos = await this.loadLastAuto(); + if (this.settings.autoSaveInterval > 0) { + const now2 = new Date(); + const diff2 = this.settings.autoSaveInterval - Math.round((now2.getTime() - lastAutos.backup.getTime()) / 1e3 / 60); + this.startAutoBackup(diff2 <= 0 ? 0 : diff2); + } + if (this.settings.differentIntervalCommitAndPush && this.settings.autoPushInterval > 0) { + const now2 = new Date(); + const diff2 = this.settings.autoPushInterval - Math.round((now2.getTime() - lastAutos.push.getTime()) / 1e3 / 60); + this.startAutoPush(diff2 <= 0 ? 0 : diff2); + } + if (this.settings.autoPullInterval > 0) { + const now2 = new Date(); + const diff2 = this.settings.autoPullInterval - Math.round((now2.getTime() - lastAutos.pull.getTime()) / 1e3 / 60); + this.startAutoPull(diff2 <= 0 ? 0 : diff2); + } + break; + default: + console.log("Something weird happened. The 'checkRequirements' result is " + result); + } + } catch (error) { + this.displayError(error); + console.error(error); + } + } + async createNewRepo() { + await this.gitManager.init(); + new import_obsidian23.Notice("Initialized new repo"); + await this.init(); + } + async cloneNewRepo() { + const modal = new GeneralModal({ placeholder: "Enter remote URL" }); + const url = await modal.open(); + if (url) { + const confirmOption = "Vault Root"; + let dir = await new GeneralModal({ + options: [confirmOption], + placeholder: "Enter directory for clone. It needs to be empty or not existent.", + allowEmpty: this.gitManager instanceof IsomorphicGit + }).open(); + if (dir !== void 0) { + if (dir === confirmOption) { + dir = "."; + } + dir = (0, import_obsidian23.normalizePath)(dir); + if (dir === "/") { + dir = "."; + } + if (dir === ".") { + const modal2 = new GeneralModal({ options: ["NO", "YES"], placeholder: `Does your remote repo contain a ${app.vault.configDir} directory at the root?`, onlySelection: true }); + const containsConflictDir = await modal2.open(); + if (containsConflictDir === void 0) { + new import_obsidian23.Notice("Aborted clone"); + return; + } else if (containsConflictDir === "YES") { + const confirmOption2 = "DELETE ALL YOUR LOCAL CONFIG AND PLUGINS"; + const modal3 = new GeneralModal({ options: ["Abort clone", confirmOption2], placeholder: `To avoid conflicts, the local ${app.vault.configDir} directory needs to be deleted.`, onlySelection: true }); + const shouldDelete = await modal3.open() === confirmOption2; + if (shouldDelete) { + await this.app.vault.adapter.rmdir(app.vault.configDir, true); + } else { + new import_obsidian23.Notice("Aborted clone"); + return; + } } } - } - return false; - }); - } - push() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return false; - if (!this.remotesAreSet()) { - return false; - } - const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); - if (file) - yield this.app.vault.delete(file); - let status; - if (this.gitManager instanceof SimpleGit && (status = yield this.gitManager.status()).conflicted.length > 0) { - this.displayError(`Cannot push. You have ${status.conflicted.length} conflict ${status.conflicted.length > 1 ? "files" : "file"}`); - this.handleConflict(status.conflicted); - return false; - } else { - const pushedFiles = yield this.gitManager.push(); - this.lastUpdate = Date.now(); - if (pushedFiles > 0) { - this.displayMessage(`Pushed ${pushedFiles} ${pushedFiles > 1 ? "files" : "file"} to remote`); - } else { - this.displayMessage(`No changes to push`); + new import_obsidian23.Notice(`Cloning new repo into "${dir}"`); + await this.gitManager.clone(url, dir); + new import_obsidian23.Notice("Cloned new repo."); + new import_obsidian23.Notice("Please restart Obsidian"); + if (dir && dir !== ".") { + this.settings.basePath = dir; + this.saveSettings(); } - this.offlineMode = false; - this.setState(PluginState.idle); - return true; } - }); + } } - pull() { - return __async(this, null, function* () { - const pulledFilesLength = yield this.gitManager.pull(); - this.offlineMode = false; - if (pulledFilesLength > 0) { - this.displayMessage(`Pulled ${pulledFilesLength} ${pulledFilesLength > 1 ? "files" : "file"} from remote`); + async isAllInitialized() { + if (!this.gitReady) { + await this.init(); + } + return this.gitReady; + } + async pullChangesFromRemote() { + if (!await this.isAllInitialized()) + return; + const filesUpdated = await this.pull(); + if (!filesUpdated) { + this.displayMessage("Everything is up-to-date"); + } + if (this.gitManager instanceof SimpleGit) { + const status2 = await this.gitManager.status(); + if (status2.conflicted.length > 0) { + this.displayError(`You have ${status2.conflicted.length} conflict ${status2.conflicted.length > 1 ? "files" : "file"}`); + this.handleConflict(status2.conflicted); } - return pulledFilesLength != 0; - }); + } + dispatchEvent(new CustomEvent("git-refresh")); + this.lastUpdate = Date.now(); + this.setState(PluginState.idle); } - stageCurrentFile() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) + async createBackup(fromAutoBackup, requestCustomMessage = false) { + if (!await this.isAllInitialized()) + return; + if (this.settings.syncMethod == "reset" && this.settings.pullBeforePush) { + await this.pull(); + } + if (!await this.commit(fromAutoBackup, requestCustomMessage)) + return; + if (!this.settings.disablePush) { + if (await this.gitManager.canPush()) { + if (this.settings.syncMethod != "reset" && this.settings.pullBeforePush) { + await this.pull(); + } + await this.push(); + } else { + this.displayMessage("No changes to push"); + } + } + this.setState(PluginState.idle); + } + async commit(fromAutoBackup, requestCustomMessage = false, onlyStaged = false) { + if (!await this.isAllInitialized()) + return false; + const hadConflict = this.localStorage.getConflict() === "true"; + let changedFiles; + let status2; + let unstagedFiles; + if (this.gitManager instanceof SimpleGit) { + const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); + if (file != null) + await this.app.vault.delete(file); + status2 = await this.updateCachedStatus(); + if (fromAutoBackup && status2.conflicted.length > 0) { + this.displayError(`Did not commit, because you have ${status2.conflicted.length} conflict ${status2.conflicted.length > 1 ? "files" : "file"}. Please resolve them and commit per command.`); + this.handleConflict(status2.conflicted); return false; - const file = this.app.workspace.getActiveFile(); - yield this.gitManager.stage(file.path, true); - this.displayMessage(`Staged ${file.path}`); - dispatchEvent(new CustomEvent("git-refresh")); + } + changedFiles = [...status2.changed, ...status2.staged]; + } else if (fromAutoBackup && hadConflict) { + this.setState(PluginState.conflicted); + this.displayError(`Did not commit, because you have conflict files. Please resolve them and commit per command.`); + return false; + } else if (hadConflict) { + const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); + if (file != null) + await this.app.vault.delete(file); + status2 = await this.updateCachedStatus(); + changedFiles = [...status2.changed, ...status2.staged]; + } else { + if (onlyStaged) { + changedFiles = await this.gitManager.getStagedFiles(); + } else { + unstagedFiles = await this.gitManager.getUnstagedFiles(); + changedFiles = unstagedFiles.map(({ filepath }) => ({ vault_path: this.gitManager.getVaultPath(filepath) })); + } + } + if (await this.hasTooBigFiles(changedFiles)) { this.setState(PluginState.idle); - return true; - }); - } - unstageCurrentFile() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return false; - const file = this.app.workspace.getActiveFile(); - yield this.gitManager.unstage(file.path, true); - this.displayMessage(`Unstaged ${file.path}`); - dispatchEvent(new CustomEvent("git-refresh")); - this.setState(PluginState.idle); - return true; - }); - } - remotesAreSet() { - return __async(this, null, function* () { - if (!(yield this.gitManager.branchInfo()).tracking) { - new import_obsidian15.Notice("No upstream branch is set. Please select one."); - const remoteBranch = yield this.selectRemoteBranch(); - if (remoteBranch == void 0) { - this.displayError("Did not push. No upstream-branch is set!", 1e4); + return false; + } + if (changedFiles.length !== 0 || hadConflict) { + let commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage; + if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) { + if (!this.settings.disablePopups && fromAutoBackup) { + new import_obsidian23.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort"); + } + const tempMessage = await new CustomMessageModal(this, true).open(); + if (tempMessage != void 0 && tempMessage != "" && tempMessage != "...") { + commitMessage = tempMessage; + } else { this.setState(PluginState.idle); return false; - } else { - yield this.gitManager.updateUpstreamBranch(remoteBranch); + } + } + let committedFiles; + if (onlyStaged) { + committedFiles = await this.gitManager.commit(commitMessage); + } else { + committedFiles = await this.gitManager.commitAll({ message: commitMessage, status: status2, unstagedFiles }); + } + let roughly = false; + if (committedFiles === void 0) { + roughly = true; + committedFiles = changedFiles.length; + } + this.displayMessage(`Committed${roughly ? " approx." : ""} ${committedFiles} ${committedFiles > 1 ? "files" : "file"}`); + } else { + this.displayMessage("No changes to commit"); + } + dispatchEvent(new CustomEvent("git-refresh")); + this.setState(PluginState.idle); + return true; + } + async hasTooBigFiles(files) { + var _a2; + const branchInfo = await this.gitManager.branchInfo(); + const remote = (_a2 = branchInfo.tracking) == null ? void 0 : _a2.split("/")[0]; + if (remote) { + const remoteUrl = await this.gitManager.getRemoteUrl(remote); + if (remoteUrl == null ? void 0 : remoteUrl.includes("github.com")) { + const tooBigFiles = files.filter((f) => { + const file = this.app.vault.getAbstractFileByPath(f.vault_path); + if (file instanceof import_obsidian23.TFile) { + return file.stat.size >= 1e8; + } + return false; + }); + if (tooBigFiles.length > 0) { + this.displayError(`Did not commit, because following files are too big: ${tooBigFiles.map((e) => e.vault_path)}. Please remove them.`); return true; } } + } + return false; + } + async push() { + if (!await this.isAllInitialized()) + return false; + if (!await this.remotesAreSet()) { + return false; + } + const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile); + const hadConflict = this.localStorage.getConflict() === "true"; + if (this.gitManager instanceof SimpleGit && file) + await this.app.vault.delete(file); + let status2; + if (this.gitManager instanceof SimpleGit && (status2 = await this.updateCachedStatus()).conflicted.length > 0) { + this.displayError(`Cannot push. You have ${status2.conflicted.length} conflict ${status2.conflicted.length > 1 ? "files" : "file"}`); + this.handleConflict(status2.conflicted); + return false; + } else if (this.gitManager instanceof IsomorphicGit && hadConflict) { + this.displayError(`Cannot push. You have conflict files`); + this.setState(PluginState.conflicted); + return false; + } + { + console.log("Pushing...."); + const pushedFiles = await this.gitManager.push(); + console.log("Pushed!", pushedFiles); + this.lastUpdate = Date.now(); + if (pushedFiles > 0) { + this.displayMessage(`Pushed ${pushedFiles} ${pushedFiles > 1 ? "files" : "file"} to remote`); + } else { + this.displayMessage(`No changes to push`); + } + this.offlineMode = false; + this.setState(PluginState.idle); return true; - }); + } + } + async pull() { + if (!await this.remotesAreSet()) { + return false; + } + const pulledFiles = await this.gitManager.pull() || []; + this.offlineMode = false; + if (pulledFiles.length > 0) { + this.displayMessage(`Pulled ${pulledFiles.length} ${pulledFiles.length > 1 ? "files" : "file"} from remote`); + this.lastPulledFiles = pulledFiles; + } + return pulledFiles.length != 0; + } + async stageFile(file) { + if (!await this.isAllInitialized()) + return false; + await this.gitManager.stage(file.path, true); + this.displayMessage(`Staged ${file.path}`); + dispatchEvent(new CustomEvent("git-refresh")); + this.setState(PluginState.idle); + return true; + } + async unstageFile(file) { + if (!await this.isAllInitialized()) + return false; + await this.gitManager.unstage(file.path, true); + this.displayMessage(`Unstaged ${file.path}`); + dispatchEvent(new CustomEvent("git-refresh")); + this.setState(PluginState.idle); + return true; + } + async switchBranch() { + var _a2; + if (!await this.isAllInitialized()) + return; + const branchInfo = await this.gitManager.branchInfo(); + const selectedBranch = await new BranchModal(branchInfo.branches).open(); + if (selectedBranch != void 0) { + await this.gitManager.checkout(selectedBranch); + this.displayMessage(`Switched to ${selectedBranch}`); + (_a2 = this.branchBar) == null ? void 0 : _a2.display(); + return selectedBranch; + } + } + async createBranch() { + var _a2; + if (!await this.isAllInitialized()) + return; + const newBranch = await new GeneralModal({ placeholder: "Create new branch" }).open(); + if (newBranch != void 0) { + await this.gitManager.createBranch(newBranch); + this.displayMessage(`Created new branch ${newBranch}`); + (_a2 = this.branchBar) == null ? void 0 : _a2.display(); + return newBranch; + } + } + async deleteBranch() { + var _a2; + if (!await this.isAllInitialized()) + return; + const branchInfo = await this.gitManager.branchInfo(); + if (branchInfo.current) + branchInfo.branches.remove(branchInfo.current); + const branch2 = await new GeneralModal({ options: branchInfo.branches, placeholder: "Delete branch", onlySelection: true }).open(); + if (branch2 != void 0) { + let force = false; + if (!await this.gitManager.branchIsMerged(branch2)) { + const forceAnswer = await new GeneralModal({ options: ["YES", "NO"], placeholder: "This branch isn't merged into HEAD. Force delete?", onlySelection: true }).open(); + if (forceAnswer !== "YES") { + return; + } + force = forceAnswer === "YES"; + } + await this.gitManager.deleteBranch(branch2, force); + this.displayMessage(`Deleted branch ${branch2}`); + (_a2 = this.branchBar) == null ? void 0 : _a2.display(); + return branch2; + } + } + async remotesAreSet() { + if (!(await this.gitManager.branchInfo()).tracking) { + new import_obsidian23.Notice("No upstream branch is set. Please select one."); + const remoteBranch = await this.selectRemoteBranch(); + if (remoteBranch == void 0) { + this.displayError("Aborted. No upstream-branch is set!", 1e4); + this.setState(PluginState.idle); + return false; + } else { + await this.gitManager.updateUpstreamBranch(remoteBranch); + return true; + } + } + return true; } startAutoBackup(minutes) { const time = (minutes != null ? minutes : this.settings.autoSaveInterval) * 6e4; @@ -14906,7 +31064,7 @@ var ObsidianGit = class extends import_obsidian15.Plugin { this.doAutoBackup(); } else { this.onFileModifyEventRef = this.app.vault.on("modify", () => this.autoBackupDebouncer()); - this.autoBackupDebouncer = (0, import_obsidian15.debounce)(() => this.doAutoBackup(), time, true); + this.autoBackupDebouncer = (0, import_obsidian23.debounce)(() => this.doAutoBackup(), time, true); } } else { this.timeoutIDBackup = window.setTimeout(() => this.doAutoBackup(), time); @@ -14972,15 +31130,17 @@ var ObsidianGit = class extends import_obsidian15.Plugin { } return false; } - handleConflict(conflicted) { - return __async(this, null, function* () { - this.setState(PluginState.conflicted); - const lines = [ + async handleConflict(conflicted) { + this.setState(PluginState.conflicted); + this.localStorage.setConflict("true"); + let lines; + if (conflicted !== void 0) { + lines = [ "# Conflict files", "Please resolve them and commit per command (This file will be deleted before the commit).", ...conflicted.map((e) => { const file = this.app.vault.getAbstractFileByPath(e); - if (file instanceof import_obsidian15.TFile) { + if (file instanceof import_obsidian23.TFile) { const link = this.app.metadataCache.fileToLinktext(file, "/"); return `- [[${link}]]`; } else { @@ -14988,94 +31148,102 @@ var ObsidianGit = class extends import_obsidian15.Plugin { } }) ]; - this.writeAndOpenFile(lines.join("\n")); - }); + } + this.writeAndOpenFile(lines == null ? void 0 : lines.join("\n")); } - editRemotes() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - const remotes = yield this.gitManager.getRemotes(); - const nameModal = new GeneralModal(this.app, remotes, "Select or create a new remote by typing its name and selecting it"); - const remoteName = yield nameModal.open(); - if (remoteName) { - const urlModal = new GeneralModal(this.app, [], "Enter the remote URL"); - const remoteURL = yield urlModal.open(); - yield this.gitManager.setRemote(remoteName, remoteURL); + async editRemotes() { + if (!await this.isAllInitialized()) + return; + const remotes = await this.gitManager.getRemotes(); + const nameModal = new GeneralModal({ + options: remotes, + placeholder: "Select or create a new remote by typing its name and selecting it" + }); + const remoteName = await nameModal.open(); + if (remoteName) { + const oldUrl = await this.gitManager.getRemoteUrl(remoteName); + const urlModal = new GeneralModal({ initialValue: oldUrl }); + const remoteURL = await urlModal.open(); + if (remoteURL) { + await this.gitManager.setRemote(remoteName, remoteURL); return remoteName; } - }); + } } - selectRemoteBranch() { - return __async(this, null, function* () { - let remotes = yield this.gitManager.getRemotes(); - let selectedRemote; - if (remotes.length === 0) { - selectedRemote = yield this.editRemotes(); - if (selectedRemote == void 0) { - remotes = yield this.gitManager.getRemotes(); - } + async selectRemoteBranch() { + let remotes = await this.gitManager.getRemotes(); + let selectedRemote; + if (remotes.length === 0) { + selectedRemote = await this.editRemotes(); + if (selectedRemote == void 0) { + remotes = await this.gitManager.getRemotes(); } - const nameModal = new GeneralModal(this.app, remotes, "Select or create a new remote by typing its name and selecting it"); - const remoteName = selectedRemote != null ? selectedRemote : yield nameModal.open(); - if (remoteName) { - this.displayMessage("Fetching remote branches"); - yield this.gitManager.fetch(remoteName); - const branches = yield this.gitManager.getRemoteBranches(remoteName); - const branchModal = new GeneralModal(this.app, branches, "Select or create a new remote branch by typing its name and selecting it"); - return yield branchModal.open(); - } - }); + } + const nameModal = new GeneralModal({ options: remotes, placeholder: "Select or create a new remote by typing its name and selecting it" }); + const remoteName = selectedRemote != null ? selectedRemote : await nameModal.open(); + if (remoteName) { + this.displayMessage("Fetching remote branches"); + await this.gitManager.fetch(remoteName); + const branches = await this.gitManager.getRemoteBranches(remoteName); + const branchModal = new GeneralModal({ options: branches, placeholder: "Select or create a new remote branch by typing its name and selecting it" }); + return await branchModal.open(); + } } - removeRemote() { - return __async(this, null, function* () { - if (!(yield this.isAllInitialized())) - return; - const remotes = yield this.gitManager.getRemotes(); - const nameModal = new GeneralModal(this.app, remotes, "Select a remote"); - const remoteName = yield nameModal.open(); - if (remoteName) { - this.gitManager.removeRemote(remoteName); - } - }); + async removeRemote() { + if (!await this.isAllInitialized()) + return; + const remotes = await this.gitManager.getRemotes(); + const nameModal = new GeneralModal({ options: remotes, placeholder: "Select a remote" }); + const remoteName = await nameModal.open(); + if (remoteName) { + this.gitManager.removeRemote(remoteName); + } } - writeAndOpenFile(text2) { - return __async(this, null, function* () { - yield this.app.vault.adapter.write(this.conflictOutputFile, text2); - let fileIsAlreadyOpened = false; - this.app.workspace.iterateAllLeaves((leaf) => { - if (leaf.getDisplayText() != "" && this.conflictOutputFile.startsWith(leaf.getDisplayText())) { - fileIsAlreadyOpened = true; - } - }); - if (!fileIsAlreadyOpened) { - this.app.workspace.openLinkText(this.conflictOutputFile, "/", true); + async writeAndOpenFile(text2) { + if (text2 !== void 0) { + await this.app.vault.adapter.write(this.conflictOutputFile, text2); + } + let fileIsAlreadyOpened = false; + this.app.workspace.iterateAllLeaves((leaf) => { + if (leaf.getDisplayText() != "" && this.conflictOutputFile.startsWith(leaf.getDisplayText())) { + fileIsAlreadyOpened = true; } }); + if (!fileIsAlreadyOpened) { + this.app.workspace.openLinkText(this.conflictOutputFile, "/", true); + } } displayMessage(message, timeout = 4 * 1e3) { var _a2; (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); if (!this.settings.disablePopups) { - new import_obsidian15.Notice(message, 5 * 1e3); + new import_obsidian23.Notice(message, 5 * 1e3); } console.log(`git obsidian message: ${message}`); } displayError(message, timeout = 10 * 1e3) { var _a2; + if (message instanceof Errors.UserCanceledError) { + new import_obsidian23.Notice("Aborted"); + return; + } message = message.toString(); - new import_obsidian15.Notice(message, timeout); + new import_obsidian23.Notice(message, timeout); console.log(`git obsidian error: ${message}`); (_a2 = this.statusBar) == null ? void 0 : _a2.displayMessage(message.toLowerCase(), timeout); } }; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = {}); /*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -15090,3 +31258,6 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ +/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */ +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json index 48bf9e99..b3c5c931 100644 --- a/.obsidian/plugins/obsidian-git/manifest.json +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -1,8 +1,8 @@ { "id": "obsidian-git", "name": "Obsidian Git", - "description": "Backup your vault with git.", - "isDesktopOnly": true, + "description": "Backup your vault with Git.", + "isDesktopOnly": false, "js": "main.js", - "version": "1.28.0" + "version": "2.6.0" } diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css index 68a06f02..a7ccdfd9 100644 --- a/.obsidian/plugins/obsidian-git/styles.css +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -1,413 +1,473 @@ @keyframes loading { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } } -.loading > svg { - animation: 2s linear infinite loading; - transform-origin: 50% 50%; - display: inline-block; + +.workspace-leaf-content[data-type='git-view'] .view-content { + padding: 0; +} + +.loading>svg { + animation: 2s linear infinite loading; + transform-origin: 50% 50%; + display: inline-block; } .obsidian-git-center { - margin: auto; - width: 50%; + margin: auto; + width: 50%; +} + +.obsidian-git-textarea { + display: block; + margin-left: auto; + margin-right: auto; +} + +.obsidian-git-center-button { + display: block; + margin: 20px auto; } .tooltip.mod-left { - overflow-wrap: break-word; + overflow-wrap: break-word; } .tooltip.mod-right { - overflow-wrap: break-word; + overflow-wrap: break-word; } .obsidian-git-shortcuts { - margin: 10px; + margin: 10px; } .diff-err { - height: 100%; - display: flex; - justify-content: center; - flex-direction: column; - align-items: center; + height: 100%; + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; } .diff-err-sign { - font-size: 2em; + font-size: 2em; } .workspace-leaf-content[data-type="diff-view"] .d2h-d-none { - display: none; + display: none; } + .workspace-leaf-content[data-type="diff-view"] .d2h-wrapper { - text-align: left; + text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-header { - background-color: var(--background-primary); - border-bottom: 1px solid var(--interactive-accent); - font-family: var(--font-monospace); - height: 35px; - padding: 5px 10px; + background-color: var(--background-primary); + border-bottom: 1px solid var(--interactive-accent); + font-family: var(--font-monospace); + height: 35px; + padding: 5px 10px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-header, .workspace-leaf-content[data-type="diff-view"] .d2h-file-stats { - display: -webkit-box; - display: -ms-flexbox; - display: flex; + display: -webkit-box; + display: -ms-flexbox; + display: flex; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-stats { - font-size: 14px; - margin-left: auto; + font-size: 14px; + margin-left: auto; } + .workspace-leaf-content[data-type="diff-view"] .d2h-lines-added { - border: 1px solid #b4e2b4; - border-radius: 5px 0 0 5px; - color: #399839; - padding: 2px; - text-align: right; - vertical-align: middle; + border: 1px solid #b4e2b4; + border-radius: 5px 0 0 5px; + color: #399839; + padding: 2px; + text-align: right; + vertical-align: middle; } + .workspace-leaf-content[data-type="diff-view"] .d2h-lines-deleted { - border: 1px solid #e9aeae; - border-radius: 0 5px 5px 0; - color: #c33; - margin-left: 1px; - padding: 2px; - text-align: left; - vertical-align: middle; + border: 1px solid #e9aeae; + border-radius: 0 5px 5px 0; + color: #c33; + margin-left: 1px; + padding: 2px; + text-align: left; + vertical-align: middle; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-name-wrapper { - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - font-size: 15px; - width: 100%; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 15px; + width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-name { - overflow-x: hidden; - text-overflow: ellipsis; - white-space: nowrap; + overflow-x: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-wrapper { - border: 1px solid var(--background-modifier-border); - border-radius: 3px; - margin-bottom: 1em; + border: 1px solid var(--background-modifier-border); + border-radius: 3px; + margin-bottom: 1em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse { - -webkit-box-pack: end; - -ms-flex-pack: end; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - border: 1px solid var(--background-modifier-border); - border-radius: 3px; - cursor: pointer; - display: none; - font-size: 12px; - justify-content: flex-end; - padding: 4px 8px; + -webkit-box-pack: end; + -ms-flex-pack: end; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 1px solid var(--background-modifier-border); + border-radius: 3px; + cursor: pointer; + display: none; + font-size: 12px; + justify-content: flex-end; + padding: 4px 8px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse.d2h-selected { - background-color: #c8e1ff; + background-color: #c8e1ff; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse-input { - margin: 0 4px 0 0; + margin: 0 4px 0 0; } + .workspace-leaf-content[data-type="diff-view"] .d2h-diff-table { - border-collapse: collapse; - font-family: Menlo, Consolas, monospace; - font-size: 13px; - width: 100%; + border-collapse: collapse; + font-family: Menlo, Consolas, monospace; + font-size: 13px; + width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-files-diff { - width: 100%; + width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff { - overflow-y: hidden; + overflow-y: hidden; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-side-diff { - display: inline-block; - margin-bottom: -8px; - margin-right: -4px; - overflow-x: scroll; - overflow-y: hidden; - width: 50%; + display: inline-block; + margin-bottom: -8px; + margin-right: -4px; + overflow-x: scroll; + overflow-y: hidden; + width: 50%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line { - padding: 0 8em; + padding: 0 8em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line { - display: inline-block; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - white-space: nowrap; - width: 100%; + display: inline-block; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: 100%; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line { - padding: 0 4.5em; + padding: 0 4.5em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line-ctn { - word-wrap: normal; - background: none; - display: inline-block; - padding: 0; - -webkit-user-select: text; - -moz-user-select: text; - -ms-user-select: text; - user-select: text; - vertical-align: middle; - white-space: pre; - width: 100%; + word-wrap: normal; + background: none; + display: inline-block; + padding: 0; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + vertical-align: middle; + white-space: pre; + width: 100%; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - del { - background-color: #ffb6ba; +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { + background-color: #ffb6ba; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - del { - background-color: #8d232881; +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del { + background-color: #8d232881; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { - border-radius: 0.2em; - display: inline-block; - margin-top: -1px; - text-decoration: none; - vertical-align: middle; + border-radius: 0.2em; + display: inline-block; + margin-top: -1px; + text-decoration: none; + vertical-align: middle; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - ins { - background-color: #97f295; - text-align: left; +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { + background-color: #97f295; + text-align: left; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-code-side-line - ins { - background-color: #1d921996; - text-align: left; +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { + background-color: #1d921996; + text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix { - word-wrap: normal; - background: none; - display: inline; - padding: 0; - white-space: pre; + word-wrap: normal; + background: none; + display: inline; + padding: 0; + white-space: pre; } + .workspace-leaf-content[data-type="diff-view"] .line-num1 { - float: left; + float: left; } + .workspace-leaf-content[data-type="diff-view"] .line-num1, .workspace-leaf-content[data-type="diff-view"] .line-num2 { - -webkit-box-sizing: border-box; - box-sizing: border-box; - overflow: hidden; - padding: 0 0.5em; - text-overflow: ellipsis; - width: 3.5em; + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + padding: 0 0.5em; + text-overflow: ellipsis; + width: 3.5em; } + .workspace-leaf-content[data-type="diff-view"] .line-num2 { - float: right; + float: right; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber { - background-color: var(--background-primary); - border: solid var(--background-modifier-border); - border-width: 0 1px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: var(--text-muted); - cursor: pointer; - display: inline-block; - position: absolute; - text-align: right; - width: 7.5em; + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-muted); + cursor: pointer; + display: inline-block; + position: absolute; + text-align: right; + width: 7.5em; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber:after { - content: "\200b"; + content: "\200b"; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber { - background-color: var(--background-primary); - border: solid var(--background-modifier-border); - border-width: 0 1px; - -webkit-box-sizing: border-box; - box-sizing: border-box; - color: var(--text-muted); - cursor: pointer; - display: inline-block; - overflow: hidden; - padding: 0 0.5em; - position: absolute; - text-align: right; - text-overflow: ellipsis; - width: 4em; + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-muted); + cursor: pointer; + display: inline-block; + overflow: hidden; + padding: 0 0.5em; + position: absolute; + text-align: right; + text-overflow: ellipsis; + width: 4em; } + +.workspace-leaf-content[data-type="diff-view"] .d2h-diff-tbody tr { + position: relative; +} + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber:after { - content: "\200b"; + content: "\200b"; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-emptyplaceholder, .workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder { - background-color: var(--background-primary); - border-color: var(--background-modifier-border); + background-color: var(--background-primary); + border-color: var(--background-modifier-border); } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix, .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber, .workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } + .workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber, .workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber { - direction: rtl; + direction: rtl; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-del { - background-color: #fee8e9; - border-color: #e9aeae; + background-color: #fee8e9; + border-color: #e9aeae; } + .theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-ins { - background-color: #dfd; - border-color: #b4e2b4; + background-color: #dfd; + border-color: #b4e2b4; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-del { - background-color: #521b1d83; - border-color: #691d1d73; + background-color: #521b1d83; + border-color: #691d1d73; } + .theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-ins { - background-color: rgba(30, 71, 30, 0.5); - border-color: #13501381; + background-color: rgba(30, 71, 30, 0.5); + border-color: #13501381; } + .workspace-leaf-content[data-type="diff-view"] .d2h-info { - background-color: var(--background-primary); - border-color: var(--background-modifier-border); - color: var(--text-normal); + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + color: var(--text-normal); } -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-del.d2h-change { - background-color: #fdf2d0; + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { + background-color: #fdf2d0; } -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-del.d2h-change { - background-color: #55492480; + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-del.d2h-change { + background-color: #55492480; } -.theme-light - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-ins.d2h-change { - background-color: #ded; + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { + background-color: #ded; } -.theme-dark - .workspace-leaf-content[data-type="diff-view"] - .d2h-file-diff - .d2h-ins.d2h-change { - background-color: rgba(37, 78, 37, 0.418); + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-file-diff .d2h-ins.d2h-change { + background-color: rgba(37, 78, 37, 0.418); } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper { - margin-bottom: 10px; + margin-bottom: 10px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a { - color: #3572b0; - text-decoration: none; + color: #3572b0; + text-decoration: none; } -.workspace-leaf-content[data-type="diff-view"] - .d2h-file-list-wrapper - a:visited { - color: #3572b0; + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a:visited { + color: #3572b0; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-header { - text-align: left; + text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-title { - font-weight: 700; + font-weight: 700; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list-line { - display: -webkit-box; - display: -ms-flexbox; - display: flex; - text-align: left; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + text-align: left; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-list { - display: block; - list-style: none; - margin: 0; - padding: 0; + display: block; + list-style: none; + margin: 0; + padding: 0; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li { - border-bottom: 1px solid var(--background-modifier-border); - margin: 0; - padding: 5px 10px; + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li { + border-bottom: 1px solid var(--background-modifier-border); + margin: 0; + padding: 5px 10px; } -.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child { - border-bottom: none; + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list>li:last-child { + border-bottom: none; } + .workspace-leaf-content[data-type="diff-view"] .d2h-file-switch { - cursor: pointer; - display: none; - font-size: 10px; + cursor: pointer; + display: none; + font-size: 10px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-icon { - fill: currentColor; - margin-right: 10px; - vertical-align: middle; + fill: currentColor; + margin-right: 10px; + vertical-align: middle; } + .workspace-leaf-content[data-type="diff-view"] .d2h-deleted { - color: #c33; + color: #c33; } + .workspace-leaf-content[data-type="diff-view"] .d2h-added { - color: #399839; + color: #399839; } + .workspace-leaf-content[data-type="diff-view"] .d2h-changed { - color: #d0b44c; + color: #d0b44c; } + .workspace-leaf-content[data-type="diff-view"] .d2h-moved { - color: #3572b0; + color: #3572b0; } + .workspace-leaf-content[data-type="diff-view"] .d2h-tag { - background-color: var(--background-primary); - display: -webkit-box; - display: -ms-flexbox; - display: flex; - font-size: 10px; - margin-left: 5px; - padding: 0 2px; + background-color: var(--background-primary); + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 10px; + margin-left: 5px; + padding: 0 2px; } + .workspace-leaf-content[data-type="diff-view"] .d2h-deleted-tag { - border: 2px solid #c33; + border: 2px solid #c33; } + .workspace-leaf-content[data-type="diff-view"] .d2h-added-tag { - border: 1px solid #399839; + border: 1px solid #399839; } + .workspace-leaf-content[data-type="diff-view"] .d2h-changed-tag { - border: 1px solid #d0b44c; + border: 1px solid #d0b44c; } + .workspace-leaf-content[data-type="diff-view"] .d2h-moved-tag { - border: 1px solid #3572b0; -} + border: 1px solid #3572b0; +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-hider/data.json b/.obsidian/plugins/obsidian-hider/data.json index 010f878e..5482fdbb 100644 --- a/.obsidian/plugins/obsidian-hider/data.json +++ b/.obsidian/plugins/obsidian-hider/data.json @@ -1,11 +1,14 @@ { - "frameless": false, "hideRibbon": false, "hideStatus": false, + "hideTabs": true, "hideScroll": false, + "hideSidebarButtons": false, "hideTooltips": false, "hideSearchSuggestions": false, + "hideSearchCounts": false, "hideInstructions": false, "hideMeta": false, - "hideVault": true + "hideVault": true, + "frameless": false } \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-hider/main.js b/.obsidian/plugins/obsidian-hider/main.js index 69e9abd9..c68042f4 100644 --- a/.obsidian/plugins/obsidian-hider/main.js +++ b/.obsidian/plugins/obsidian-hider/main.js @@ -82,10 +82,12 @@ var Hider = /** @class */ (function (_super) { _this.updateStyle = function () { document.body.classList.toggle('hider-ribbon', _this.settings.hideRibbon); document.body.classList.toggle('hider-status', _this.settings.hideStatus); - document.body.classList.toggle('hider-frameless', _this.settings.frameless); + document.body.classList.toggle('hider-tabs', _this.settings.hideTabs); document.body.classList.toggle('hider-scroll', _this.settings.hideScroll); + document.body.classList.toggle('hider-sidebar-buttons', _this.settings.hideSidebarButtons); document.body.classList.toggle('hider-tooltips', _this.settings.hideTooltips); document.body.classList.toggle('hider-search-suggestions', _this.settings.hideSearchSuggestions); + document.body.classList.toggle('hider-search-counts', _this.settings.hideSearchCounts); document.body.classList.toggle('hider-instructions', _this.settings.hideInstructions); document.body.classList.toggle('hider-meta', _this.settings.hideMeta); document.body.classList.toggle('hider-vault', _this.settings.hideVault); @@ -107,10 +109,18 @@ var Hider = /** @class */ (function (_super) { this.addSettingTab(new HiderSettingTab(this.app, this)); // add the toggle on/off command this.addCommand({ - id: 'toggle-app-ribbon', - name: 'Toggle App Ribbon', + id: 'toggle-tab-containers', + name: 'Toggle tab bar', + callback: function () { + _this.settings.hideTabs = !_this.settings.hideTabs; + _this.saveData(_this.settings); + _this.refresh(); + } + }); + this.addCommand({ + id: 'toggle-app-ribbon', + name: 'Toggle app ribbon', callback: function () { - // switch the setting, save and refresh _this.settings.hideRibbon = !_this.settings.hideRibbon; _this.saveData(_this.settings); _this.refresh(); @@ -118,9 +128,8 @@ var Hider = /** @class */ (function (_super) { }); this.addCommand({ id: 'toggle-hider-status', - name: 'Toggle Status Bar', + name: 'Toggle status bar', callback: function () { - // switch the setting, save and refresh _this.settings.hideStatus = !_this.settings.hideStatus; _this.saveData(_this.settings); _this.refresh(); @@ -167,12 +176,14 @@ var Hider = /** @class */ (function (_super) { return Hider; }(obsidian.Plugin)); var DEFAULT_SETTINGS = { - frameless: false, hideRibbon: false, hideStatus: false, + hideTabs: false, hideScroll: false, + hideSidebarButtons: false, hideTooltips: false, hideSearchSuggestions: false, + hideSearchCounts: false, hideInstructions: false, hideMeta: false, hideVault: false @@ -188,15 +199,6 @@ var HiderSettingTab = /** @class */ (function (_super) { var _this = this; var containerEl = this.containerEl; containerEl.empty(); - new obsidian.Setting(containerEl) - .setName('Hide title bar (frameless mode)') - .setDesc('Hides the title bar (best on macOS)') - .addToggle(function (toggle) { return toggle.setValue(_this.plugin.settings.frameless) - .onChange(function (value) { - _this.plugin.settings.frameless = value; - _this.plugin.saveData(_this.plugin.settings); - _this.plugin.refresh(); - }); }); new obsidian.Setting(containerEl) .setName('Hide app ribbon') .setDesc('Hides the Obsidian menu. Warning: to open Settings you will need use the hotkey (default is CMD + ,)') @@ -206,6 +208,15 @@ var HiderSettingTab = /** @class */ (function (_super) { _this.plugin.saveData(_this.plugin.settings); _this.plugin.refresh(); }); }); + new obsidian.Setting(containerEl) + .setName('Hide tab bar') + .setDesc('Hides the tab container at the top of the window') + .addToggle(function (toggle) { return toggle.setValue(_this.plugin.settings.hideTabs) + .onChange(function (value) { + _this.plugin.settings.hideTabs = value; + _this.plugin.saveData(_this.plugin.settings); + _this.plugin.refresh(); + }); }); new obsidian.Setting(containerEl) .setName('Hide status bar') .setDesc('Hides word count, character count and backlink count') @@ -233,6 +244,15 @@ var HiderSettingTab = /** @class */ (function (_super) { _this.plugin.saveData(_this.plugin.settings); _this.plugin.refresh(); }); }); + new obsidian.Setting(containerEl) + .setName('Hide sidebar toggle buttons') + .setDesc('Hides both sidebar buttons') + .addToggle(function (toggle) { return toggle.setValue(_this.plugin.settings.hideSidebarButtons) + .onChange(function (value) { + _this.plugin.settings.hideSidebarButtons = value; + _this.plugin.saveData(_this.plugin.settings); + _this.plugin.refresh(); + }); }); new obsidian.Setting(containerEl) .setName('Hide tooltips') .setDesc('Hides all tooltips') @@ -260,6 +280,15 @@ var HiderSettingTab = /** @class */ (function (_super) { _this.plugin.saveData(_this.plugin.settings); _this.plugin.refresh(); }); }); + new obsidian.Setting(containerEl) + .setName('Hide count of search term matches') + .setDesc('Hides the number of matches within each search result') + .addToggle(function (toggle) { return toggle.setValue(_this.plugin.settings.hideSearchCounts) + .onChange(function (value) { + _this.plugin.settings.hideSearchCounts = value; + _this.plugin.saveData(_this.plugin.settings); + _this.plugin.refresh(); + }); }); new obsidian.Setting(containerEl) .setName('Hide metadata block in Reading view') .setDesc('When front matter is turned off in your Editor settings this hides the metadata block') @@ -274,4 +303,4 @@ var HiderSettingTab = /** @class */ (function (_super) { }(obsidian.PluginSettingTab)); module.exports = Hider; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1bGVzL3RzbGliL3RzbGliLmVzNi5qcyIsIm1haW4udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyohICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXHJcbkNvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLlxyXG5cclxuUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55XHJcbnB1cnBvc2Ugd2l0aCBvciB3aXRob3V0IGZlZSBpcyBoZXJlYnkgZ3JhbnRlZC5cclxuXHJcblRIRSBTT0ZUV0FSRSBJUyBQUk9WSURFRCBcIkFTIElTXCIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEhcclxuUkVHQVJEIFRPIFRISVMgU09GVFdBUkUgSU5DTFVESU5HIEFMTCBJTVBMSUVEIFdBUlJBTlRJRVMgT0Yg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F0gJiAyID8geVtcInJldHVyblwiXSA6IG9wWzBdID8geVtcInRocm93XCJdIHx8ICgodCA9IHlbXCJyZXR1cm5cIl0pICYmIHQuY2FsbCh5KSwgMCkgOiB5Lm5leHQpICYmICEodCA9IHQuY2FsbCh5LCBvcFsxXSkpLmRvbmUpIHJldHVybiB0O1xyXG4gICAgICAgICAgICBpZiAoeSA9IDAsIHQpIG9wID0gW29wWzBdICYgMiwgdC52YWx1ZV07XHJcbiAgICAgICAgICAgIHN3aXRjaCAob3BbMF0pIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs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0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLENBQUM7WUFDM0MsS0FBSSxDQUFDLE1BQU0sQ0FBQyxPQUFPLEVBQUUsQ0FBQztTQUNyQixDQUFDLEdBQUEsQ0FDSCxDQUFDO1FBRVIsSUFBSUEsZ0JBQU8sQ0FBQyxXQUFXLENBQUM7YUFDckIsT0FBTyxDQUFDLHFDQUFxQyxDQUFDO2FBQzlDLE9BQU8sQ0FBQyx1RkFBdUYsQ0FBQzthQUNoRyxTQUFTLENBQUMsVUFBQSxNQUFNLElBQUksT0FBQSxNQUFNLENBQUMsUUFBUSxDQUFDLEtBQUksQ0FBQyxNQUFNLENBQUMsUUFBUSxDQUFDLFFBQVEsQ0FBQzthQUM5RCxRQUFRLENBQUMsVUFBQyxLQUFLO1lBQ2QsS0FBSSxDQUFDLE1BQU0sQ0FBQyxRQUFRLENBQUMsUUFBUSxHQUFHLEtBQUssQ0FBQztZQUN0QyxLQUFJLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxLQUFJLENBQUMsTUFBTSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1lBQzNDLEtBQUksQ0FBQyxNQUFNLENBQUMsT0FBTyxFQUFFLENBQUM7U0FDckIsQ0FBQyxHQUFBLENBQ0gsQ0FBQztLQUlUO0lBQ0gsc0JBQUM7QUFBRCxDQTFJQSxDQUE4QkMseUJBQWdCOzs7OyJ9 diff --git a/.obsidian/plugins/obsidian-hider/manifest.json b/.obsidian/plugins/obsidian-hider/manifest.json index 7ad0e3b3..35be2f99 100644 --- a/.obsidian/plugins/obsidian-hider/manifest.json +++ b/.obsidian/plugins/obsidian-hider/manifest.json @@ -1,8 +1,8 @@ { "id": "obsidian-hider", "name": "Hider", - "version": "1.1.1", - "minAppVersion": "0.12.2", + "version": "1.2.3", + "minAppVersion": "0.16.0", "description": "Hide UI elements such as tooltips, status, titlebar and more", "author": "@kepano", "authorUrl": "https://www.twitter.com/kepano", diff --git a/.obsidian/plugins/obsidian-hider/styles.css b/.obsidian/plugins/obsidian-hider/styles.css index 92828a1d..54cc8b70 100644 --- a/.obsidian/plugins/obsidian-hider/styles.css +++ b/.obsidian/plugins/obsidian-hider/styles.css @@ -3,7 +3,25 @@ display:none; } +/* Hide tabs */ +.hider-tabs .mod-root .workspace-tabs .workspace-tab-header-container { + display: none; +} + +/* Hide sidebar buttons */ +.hider-sidebar-buttons .sidebar-toggle-button.mod-right, +.hider-sidebar-buttons .sidebar-toggle-button.mod-left { + display: none; +} +.hider-sidebar-buttons.mod-macos.is-hidden-frameless:not(.is-popout-window) .workspace .workspace-tabs.mod-top-right-space .workspace-tab-header-container { + padding-right: 4px; +} + /* Hide ribbon */ +.hider-ribbon.mod-macos.is-hidden-frameless:not(.is-fullscreen):not(.is-popout-window) .workspace-tabs.mod-top-left-space .workspace-tab-header-container { + padding-left: calc(var(--frame-left-space) + var(--ribbon-width)); +} + .hider-ribbon .workspace-ribbon.mod-left { display:none; } @@ -18,24 +36,6 @@ margin-left:0; } -/* Frameless */ -.hider-frameless .titlebar-button-container { - display:none; -} -.hider-frameless .titlebar, -.hider-frameless .titlebar-inner { - position:fixed; - top:0; - height:12px; - background:transparent; -} -.hider-frameless { - padding-top:0 !important; -} -.hider-frameless .workspace-split.mod-left-split > .workspace-tabs { - padding-top:18px; -} - /* Hide meta */ .hider-meta .frontmatter-container { display:none; @@ -61,7 +61,13 @@ display: none; } +/* Hide search count flair */ +.hider-search-counts .tree-item-flair:not(.tag-pane-tag-count) { + display:none; +} + /* Hide instructions */ .hider-instructions .prompt-instructions { display:none; -} \ No newline at end of file +} + diff --git a/.obsidian/themes/Minimal/manifest.json b/.obsidian/themes/Minimal/manifest.json new file mode 100644 index 00000000..d857811c --- /dev/null +++ b/.obsidian/themes/Minimal/manifest.json @@ -0,0 +1,7 @@ +{ + "name": "Minimal", + "version": "6.0.12", + "minAppVersion": "0.16.0", + "author": "@kepano", + "authorUrl": "https://twitter.com/kepano" +} diff --git a/.obsidian/themes/Minimal/theme.css b/.obsidian/themes/Minimal/theme.css new file mode 100644 index 00000000..2a956b98 --- /dev/null +++ b/.obsidian/themes/Minimal/theme.css @@ -0,0 +1,1646 @@ +/* --------------------------------------------------------------------------- + +Minimal Obsidian 6.0.0 alpha by @kepano + +User interface replacement for Obsidian. + +Designed to be used with the Minimal Theme Settings +plugin and the Hider plugin. + +Sponsor my work: +https://www.buymeacoffee.com/kepano + +Readme: +https://github.com/kepano/obsidian-minimal + +----------------------------------------------------------------------------- + +MIT License + +Copyright (c) 2020-2022 Stephan Ango (@kepano) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ +body{--font-text-theme:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Ubuntu,sans-serif;--font-editor-theme:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Ubuntu,sans-serif;--font-monospace-theme:Menlo,SFMono-Regular,Consolas,"Roboto Mono",monospace;--font-interface-theme:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Ubuntu,sans-serif;--font-editor:var(--font-editor-override),var(--font-text-override),var(--font-editor-theme);--minimal-version:"You are currently using Minimal 6.0\a\aIf you run into any issues, try updating to the latest version of the theme. It is also highly recommended to install Minimal Theme Settings and Contextual Typography plugins.\a\a Full documentation:\a minimal.guide\a\a Support my work:\a buymeacoffee.com/kepano"}body{--blockquote-style:normal;--blockquote-color:var(--text-muted);--blockquote-border-thickness:1px;--blockquote-border-color:var(--quote-opening-modifier);--embed-block-shadow-hover:none;--font-ui-smaller:12px;--normal-weight:400;--bold-weight:600;--link-weight:inherit;--h1-size:1.125em;--h2-size:1.05em;--h3-size:1em;--h4-size:0.90em;--h5-size:0.85em;--h6-size:0.85em;--h1-weight:600;--h2-weight:600;--h3-weight:500;--h4-weight:500;--h5-weight:500;--h6-weight:400;--h1-variant:normal;--h2-variant:normal;--h3-variant:normal;--h4-variant:small-caps;--h5-variant:small-caps;--h6-variant:small-caps;--h1-style:normal;--h2-style:normal;--h3-style:normal;--h4-style:normal;--h5-style:normal;--h6-style:normal;--line-width:40rem;--line-height:1.5;--max-width:88%;--max-col-width:18em;--icon-muted:0.5;--border-width:1px;--nested-padding:1.1em;--folding-offset:10px;--list-edit-offset:1em;--list-indent:2em;--list-spacing:0.075em;--input-height:32px;--header-height:40px;--mobile-left-sidebar-width:280pt;--mobile-right-sidebar-width:240pt;--tag-radius:14px;--tag-border-width:1px;--top-left-padding-y:0px;--image-muted:0.7;--spacing-p:0.75em}.mod-macos{--top-left-padding-y:24px}body{--base-h:0;--base-s:0%;--base-l:96%;--accent-h:201;--accent-s:17%;--accent-l:50%;--red:#d04255;--yellow:#e5b567;--green:#a8c373;--orange:#d5763f;--cyan:#73bbb2;--blue:#6c99bb;--purple:#9e86c8;--pink:#b05279}.theme-light,.theme-light.minimal-default-light,body .excalidraw{--bg1:white;--bg2:hsl( var(--base-h), var(--base-s), var(--base-l) );--bg3:hsla( var(--base-h), var(--base-s), calc(var(--base-l) - 50%), 0.12 );--ui1:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 6%) );--ui2:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 12%) );--ui3:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 20%) );--tx1:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 90%) );--tx2:hsl( var(--base-h), calc(var(--base-s) - 20%), calc(var(--base-l) - 45%) );--tx3:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) - 25%) );--tx4:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) - 60%) );--ax1:hsl( var(--accent-h), var(--accent-s), var(--accent-l) );--ax2:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) - 10%) );--ax3:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) + 10%) );--hl1:hsla( var(--accent-h), 50%, calc(var(--base-l) - 20%), 30% );--hl2:rgba(255, 225, 0, 0.5)}.excalidraw.theme--dark,.theme-dark,.theme-dark.minimal-default-dark,.theme-light.minimal-light-contrast .titlebar,.theme-light.minimal-light-contrast.minimal-status-off .status-bar{--accent-l:60%;--base-l:15%;--bg1:hsl( var(--base-h), var(--base-s), var(--base-l) );--bg2:hsl( var(--base-h), var(--base-s), calc(var(--base-l) - 2%) );--bg3:hsla( var(--base-h), var(--base-s), calc(var(--base-l) + 40%), 0.12 );--ui1:hsl( var(--base-h), var(--base-s), calc(var(--base-l) + 6%) );--ui2:hsl( var(--base-h), var(--base-s), calc(var(--base-l) + 12%) );--ui3:hsl( var(--base-h), var(--base-s), calc(var(--base-l) + 20%) );--tx1:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) + 67%) );--tx2:hsl( var(--base-h), calc(var(--base-s) - 20%), calc(var(--base-l) + 45%) );--tx3:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) + 20%) );--tx4:hsl( var(--base-h), calc(var(--base-s) - 10%), calc(var(--base-l) + 50%) );--ax1:hsl( var(--accent-h), var(--accent-s), var(--accent-l) );--ax2:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) + 12%) );--ax3:hsl( var(--accent-h), var(--accent-s), calc(var(--accent-l) - 12%) );--hl1:hsla( var(--accent-h), 50%, 40%, 30% );--hl2:rgba(255, 177, 80, 0.3);--sp1:#fff}.theme-light.minimal-light-white{--background-primary:white;--background-secondary:white;--background-secondary-alt:white;--ribbon-background:white}.theme-dark.minimal-dark-black{--base-d:0%;--titlebar-background:black;--background-primary:black;--background-secondary:black;--background-secondary-alt:black;--ribbon-background:black;--background-modifier-hover:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 10%));--tx1:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 75%) );--tx2:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 50%) );--tx3:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 25%) );--ui1:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 12%) );--ui2:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 20%) );--ui3:hsl( var(--base-h), var(--base-s), calc(var(--base-d) + 30%) )}.theme-light{--mono100:black;--mono0:white}.theme-dark{--mono100:white;--mono0:black}.excalidraw.theme--dark,.theme-dark,.theme-light,.theme-light.minimal-light-contrast .titlebar,.theme-light.minimal-light-contrast.is-mobile .workspace-drawer.mod-left,.theme-light.minimal-light-contrast.minimal-status-off .status-bar,body .excalidraw{--background-modifier-accent:var(--ax3);--background-modifier-border-focus:var(--ui3);--background-modifier-border-hover:var(--ui2);--background-modifier-border:var(--ui1);--background-modifier-form-field-highlighted:var(--bg1);--background-modifier-form-field:var(--bg1);--background-modifier-success:var(--green);--background-modifier-hover:var(--bg3);--background-modifier-active-hover:var(--bg3);--background-primary:var(--bg1);--background-primary-alt:var(--bg2);--background-secondary:var(--bg2);--background-secondary-alt:var(--bg1);--background-table-rows:var(--bg2);--code-normal:var(--tx1);--divider-color:var(--ui1);--frame-divider-color:var(--ui1);--icon-color-active:var(--tx1);--icon-color-focused:var(--tx1);--icon-color-hover:var(--tx2);--icon-color:var(--tx2);--icon-hex:var(--mono0);--interactive-accent-hover:var(--ax3);--interactive-accent:var(--ax3);--interactive-hover:var(--ui1);--list-marker-color:var(--tx3);--modal-border-color:var(--ui2);--nav-item-background-active:var(--bg3);--nav-item-background-hover:var(--bg3);--nav-item-color:var(--tx2);--nav-item-color-active:var(--tx1);--nav-item-color-hover:var(--tx1);--nav-collapse-icon-color:var(--tx2);--nav-collapse-icon-color-collapsed:var(--tx2);--nav-indentation-guide-color:var(--ui1);--prompt-border-color:var(--ui3);--quote-opening-modifier:var(--ui2);--ribbon-background:var(--bg2);--scrollbar-active-thumb-bg:var(--ui3);--scrollbar-bg:transparent;--scrollbar-thumb-bg:var(--ui1);--tab-text-color-focused-active:var(--tx1);--tab-outline-color:var(--ui1);--text-accent-hover:var(--ax2);--text-accent:var(--ax1);--text-blockquote:var(--tx2);--text-bold:var(--tx1);--text-code:var(--tx4);--text-error:var(--red);--text-faint:var(--tx3);--text-highlight-bg:var(--hl2);--text-italic:var(--tx1);--text-muted:var(--tx2);--text-normal:var(--tx1);--text-on-accent:white;--text-selection:var(--hl1);--title-color-inactive:var(--tx2);--title-color:var(--tx1);--titlebar-background:var(--bg2);--titlebar-background-focused:var(--bg2);--titlebar-text-color-focused:var(--tx1);--tag-color:var(--tx2);--tag-bg:transparent;--tag-bg2:transparent}.theme-light.minimal-light-contrast .theme-dark{--tab-container-background:var(--bg2)}.theme-light,body .excalidraw{--interactive-normal:var(--bg1);--interactive-accent-rgb:220,220,220;--active-line-bg:rgba(0,0,0,0.035);--background-modifier-cover:hsla(var(--base-h),calc(var(--base-s) - 70%),calc(var(--base-l) - 20%),0.5);--text-highlight-bg-active:rgba(0, 0, 0, 0.1);--background-modifier-error:rgba(255,0,0,0.14);--background-modifier-error-hover:rgba(255,0,0,0.08);--shadow-color:rgba(0, 0, 0, 0.1);--btn-shadow-color:rgba(0, 0, 0, 0.05)}.excalidraw.theme--dark,.theme-dark{--interactive-normal:var(--bg3);--interactive-accent-rgb:66,66,66;--active-line-bg:rgba(255,255,255,0.04);--background-modifier-cover:hsla(var(--base-h),var(--base-s), calc(var(--base-l) - 12%), 0.5);--text-highlight-bg-active:rgba(255, 255, 255, 0.1);--background-modifier-error:rgba(255,20,20,0.12);--background-modifier-error-hover:rgba(255,20,20,0.18);--background-modifier-box-shadow:rgba(0, 0, 0, 0.3);--shadow-color:rgba(0, 0, 0, 0.3);--btn-shadow-color:rgba(0, 0, 0, 0.2)}.theme-light.minimal-light-white{--background-table-rows:var(--bg2)}.theme-light.minimal-light-tonal{--background-primary:var(--bg2);--background-primary-alt:var(--bg3);--background-table-rows:var(--bg3)}.theme-dark.minimal-dark-tonal{--ribbon-background:var(--bg1);--background-secondary:var(--bg1);--background-table-rows:var(--bg3)}.theme-dark.minimal-dark-black{--background-primary-alt:var(--bg3);--background-table-rows:var(--bg3);--modal-border:var(--ui2);--active-line-bg:rgba(255,255,255,0.085);--background-modifier-form-field:var(--bg3);--background-modifier-cover:hsla(var(--base-h),var(--base-s),calc(var(--base-d) + 8%),0.9);--background-modifier-box-shadow:rgba(0, 0, 0, 1)}body{--font-adaptive-normal:var(--font-text-size,var(--editor-font-size));--font-adaptive-small:var(--font-ui-medium);--font-adaptive-smaller:var(--font-ui-small);--font-adaptive-smallest:11px;--line-width-adaptive:var(--line-width);--line-width-wide:calc(var(--line-width) + 12.5%);--font-code:calc(var(--font-adaptive-normal) * 0.9);--table-text-size:calc(var(--font-adaptive-normal) * 0.875)}@media (max-width:400pt){.is-mobile{--font-adaptive-small:calc(var(--font-ui-medium) + 2px);--font-adaptive-smaller:calc(var(--font-ui-smaller) + 2px);--font-adaptive-smallest:calc(var(--font-ui-smaller) + 2px);--max-width:88%}}@media (min-width:400pt){.is-mobile{--font-adaptive-small:calc(var(--font-ui-medium) + 3px);--font-adaptive-smaller:calc(var(--font-ui-smaller) + 2px);--font-adaptive-smallest:calc(var(--font-ui-smallest) + 2px);--line-width-adaptive:calc(var(--line-width) + 6rem);--max-width:90%}}.minimal-dev-block-width .mod-root .workspace-leaf-content:after{display:flex;align-items:flex-end;content:"\00a0pane\00a0";font-size:12px;color:gray;font-family:var(--font-monospace);width:100%;max-width:100%;height:100vh;top:0;z-index:999;position:fixed;pointer-events:none}.minimal-dev-block-width.minimal-readable .mod-root .view-header:after{display:flex;align-items:flex-end;color:green;font-size:12px;font-family:var(--font-monospace);content:" ";width:var(--folding-offset);height:100vh;border-left:1px solid green;border-right:1px solid green;background-color:rgba(0,128,0,.1);top:0;left:max(calc(50% - var(--line-width-adaptive)/ 2 - 1px),calc(50% - var(--max-width)/ 2 - 1px));z-index:999;position:fixed;pointer-events:none}.minimal-dev-block-width.minimal-readable-off .mod-root .view-header:after{display:flex;align-items:flex-end;color:green;font-size:12px;font-family:var(--font-monospace);content:" ";width:var(--folding-offset);height:100vh;border-left:1px solid green;border-right:1px solid green;background-color:rgba(0,128,0,.1);top:0;left:calc(50% - var(--max-width)/ 2 - 1px);z-index:999;position:fixed;pointer-events:none}.minimal-dev-block-width .mod-root .view-content:before{display:flex;align-items:flex-end;content:"\00a0max\00a0";font-size:12px;color:red;width:var(--max-width);height:100vh;border-left:1px solid red;border-right:1px solid red;top:0;left:50%;transform:translate(-50%,0);z-index:999;position:fixed;pointer-events:none}.minimal-dev-block-width.minimal-readable .mod-root .view-header:before{display:flex;align-items:flex-end;content:"\00a0wide\00a0";font-size:12px;color:orange;font-family:var(--font-monospace);width:var(--line-width-wide);max-width:var(--max-width);height:100vh;border-left:1px solid orange;border-right:1px solid orange;background-color:rgba(255,165,0,.05);top:0;left:50%;transform:translate(-50%,0);z-index:999;position:fixed;pointer-events:none}.minimal-dev-block-width.minimal-readable .mod-root .view-content:after{display:flex;align-items:flex-end;color:#00f;font-size:12px;font-family:var(--font-monospace);content:"\00a0normal";width:var(--line-width-adaptive);max-width:var(--max-width);height:100vh;border-left:1px solid #00f;border-right:1px solid #00f;background-color:rgba(0,0,255,.08);top:0;left:50%;transform:translate(-50%,0);z-index:999;position:fixed;pointer-events:none}.CodeMirror-wrap>div>textarea{opacity:0}.markdown-source-view.mod-cm6 hr{border-width:2px}.mod-cm6 .cm-editor .cm-line{padding:0}.cm-editor .cm-content{padding-top:.5em}.markdown-source-view{color:var(--text-normal)}.markdown-reading-view>.markdown-preview-view{padding-top:18px}.markdown-source-view.mod-cm6 .cm-scroller{padding-top:18px;padding-left:0;padding-right:0}body:not(.is-mobile) .markdown-source-view.mod-cm6 .cm-gutters{position:absolute!important;z-index:0;margin-left:0}.cm-editor .cm-lineNumbers .cm-gutterElement{min-width:25px}@media (max-width:400pt){.cm-editor .cm-lineNumbers .cm-gutterElement{padding-right:4px;padding-left:8px}}.cm-editor .cm-lineNumbers .cm-gutterElement{font-variant-numeric:tabular-nums}.cm-editor .cm-gutterElement.cm-active .cm-heading-marker,.cm-editor .cm-lineNumbers .cm-gutterElement.cm-active{color:var(--text-muted)}.markdown-source-view.mod-cm6 .edit-block-button{cursor:var(--cursor);color:var(--text-faint);background-color:var(--background-primary);top:0;right:auto;left:0;opacity:0;transition:opacity .2s;padding:4px 4px 4px 9px}.markdown-source-view.mod-cm6 .edit-block-button svg{margin:0!important}.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.edit-block-button{width:30px!important;padding-left:7px!important;transform:none!important;margin-left:0!important}.is-live-preview:not(.is-readable-line-width) .cm-embed-block>.edit-block-button{padding-left:0!important;margin-left:0!important;transform:none!important;right:0;left:auto;padding:4px}.markdown-source-view.mod-cm6 .edit-block-button:hover{background-color:var(--background-primary);color:var(--text-muted)}.markdown-source-view.mod-cm6 .edit-block-button svg{opacity:1}.markdown-source-view.mod-cm6 .edit-block-button:hover svg{opacity:1}.markdown-source-view.mod-cm6 .cm-embed-block{padding:0;border:0;border-radius:0}.markdown-source-view.mod-cm6 .cm-embed-block:hover{border:0}.markdown-source-view.mod-cm6 .cm-foldPlaceholder{color:var(--text-faint)}.markdown-source-view.mod-cm6.is-live-preview .HyperMD-quote{background-color:transparent;border-left-width:1px}.cm-editor .cm-foldPlaceholder,.markdown-source-view.mod-cm6 .cm-fold-indicator .collapse-indicator{cursor:var(--cursor)}.markdown-source-view.mod-cm6 .HyperMD-list-line.HyperMD-list-line-1 .cm-fold-indicator .collapse-indicator{right:8px}.markdown-source-view.mod-cm6 .HyperMD-list-line.HyperMD-task-line:not(.HyperMD-list-line-1) .cm-fold-indicator .collapse-indicator{right:8px;width:auto}.markdown-source-view.mod-cm6 .HyperMD-list-line:not(.HyperMD-list-line-1) .cm-fold-indicator .collapse-indicator{right:-8px;top:1px;width:26px}.markdown-source-view.mod-cm6 .is-collapsed~.cm-formatting-list .list-bullet:after,ul>li.is-collapsed::marker{color:var(--text-accent)}.cm-gutterElement .collapse-indicator,.markdown-source-view.mod-cm6 .cm-fold-indicator .collapse-indicator,.markdown-source-view.mod-cm6 .fold-gutter{opacity:0}.cm-gutterElement .is-collapsed .collapse-indicator,.cm-gutterElement:hover .collapse-indicator,.markdown-source-view.mod-cm6 .cm-fold-indicator.is-collapsed .collapse-indicator,.markdown-source-view.mod-cm6 .cm-fold-indicator.is-collapsed .collapse-indicator svg,.markdown-source-view.mod-cm6 .cm-line:hover .cm-fold-indicator .collapse-indicator,.markdown-source-view.mod-cm6 .fold-gutter.is-collapsed,.markdown-source-view.mod-cm6 .fold-gutter:hover{opacity:1}body .markdown-source-view.mod-cm6.is-readable-line-width:not(.is-rtl) .cm-contentContainer{max-width:100%}body:not(.is-mobile).minimal-folding .markdown-source-view.mod-cm6.is-readable-line-width .cm-contentContainer{max-width:100%}.theme-light .cm-link,.theme-light .cm-operator,.theme-light .cm-string,.theme-light .cm-string-2,.theme-light .language-css .token.string,.theme-light .style .token.string,.theme-light .token.entity,.theme-light .token.operator,.theme-light .token.url{background-color:transparent}.markdown-source-view,.markdown-source-view.mod-cm5,.markdown-source-view.mod-cm6{padding:0}.cm-s-obsidian .CodeMirror-code{padding-right:0}.CodeMirror-lines{padding-bottom:170px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding-left:0;padding-right:0}.cm-s-obsidian pre.HyperMD-list-line{padding-top:0}.workspace .markdown-preview-view .markdown-embed{margin:0}.workspace .markdown-preview-view .markdown-embed-content{max-height:none}.internal-embed .markdown-preview-section,.markdown-embed-title{max-width:100%}.CodeMirror-linenumber{font-size:var(--font-adaptive-small)!important;font-feature-settings:'tnum';color:var(--text-faint);padding-top:3px}.cm-s-obsidian .cm-active span.cm-link.cm-hmd-barelink.cm-formatting-link-start,.cm-s-obsidian .cm-formatting-link+span.cm-link.cm-formatting.cm-formatting-link-end,.cm-s-obsidian span.cm-footref.cm-formatting.cm-formatting-link.cm-formatting-link-end,.cm-s-obsidian span.cm-formatting-link,.cm-s-obsidian span.cm-link.cm-hmd-barelink.cm-formatting-link-start,span.cm-image-marker{color:var(--text-faint)}.cm-s-obsidian span.cm-footref{font-size:var(--font-adaptive-normal)}.cm-s-obsidian pre.HyperMD-footnote{font-size:var(--font-adaptive-small);padding-left:20px}.cm-formatting-quote{color:var(--text-faint)!important}.markdown-preview-view blockquote,.markdown-preview-view ol,.markdown-preview-view p,.markdown-preview-view ul{margin-block-start:var(--spacing-p);margin-block-end:var(--spacing-p)}.markdown-preview-view ol ol,.markdown-preview-view ol ul,.markdown-preview-view ul ol,.markdown-preview-view ul ul{margin-block-start:0em;margin-block-end:0em}.markdown-preview-view h1,.markdown-preview-view h2,.markdown-preview-view h3,.markdown-preview-view h4,.markdown-preview-view h5,.markdown-preview-view h6{margin-block-start:1em;margin-block-end:var(--spacing-p)}.markdown-preview-view .mod-highlighted{transition:background-color .3s ease;background-color:var(--text-selection);color:inherit}.workspace-leaf-content>.view-content{--file-margins:0}.inline-title{padding-top:16px}.minimal-status-off .status-bar{--status-bar-position:static;--status-bar-radius:0;--status-bar-border-width:1px 0 0 0;--status-bar-background:var(--background-secondary);--status-bar-border-color:var(--ui1)}body:not(.minimal-status-off) .status-bar{background-color:var(--background-primary);--status-bar-border-width:0}.status-bar{transition:color .2s linear;color:var(--text-faint);font-size:var(--font-adaptive-smallest)}.status-bar .sync-status-icon.mod-success,.status-bar .sync-status-icon.mod-working{color:var(--text-faint)}.status-bar:hover,.status-bar:hover .sync-status-icon.mod-success,.status-bar:hover .sync-status-icon.mod-working{color:var(--text-muted);transition:color .2s linear}.status-bar .plugin-sync:hover .sync-status-icon.mod-success,.status-bar .plugin-sync:hover .sync-status-icon.mod-working{color:var(--text-normal)}.status-bar .status-bar-item{cursor:var(--cursor)!important}.status-bar .status-bar-item.cMenu-statusbar-button:hover,.status-bar .status-bar-item.mod-clickable:hover,.status-bar .status-bar-item.plugin-editor-status:hover,.status-bar .status-bar-item.plugin-sync:hover{text-align:center;background-color:var(--background-modifier-hover)!important}.tab-stack-top-flipped{--tab-stacked-text-transform:rotate(180deg);--tab-stacked-text-align:right}.tab-stack-bottom{--tab-stacked-text-transform:rotate(180deg)}.tab-stack-bottom-flipped{--tab-stacked-text-align:right}body:not(.is-mobile) .view-actions .view-action:last-child{margin-left:-1px}.minimal-focus-mode .workspace-ribbon:not(.is-collapsed)~.mod-root .view-header:hover .view-actions,.mod-right.is-collapsed~.mod-root .view-header:hover .view-actions,.view-action.is-active:hover,.workspace-ribbon.mod-left.is-collapsed~.mod-root .view-header:hover .view-actions,body:not(.minimal-focus-mode) .workspace-ribbon:not(.is-collapsed)~.mod-root .view-actions{opacity:1;transition:opacity .25s ease-in-out}.minimal-tab-title-hover .view-header-title-container{opacity:0;transition:opacity .1s ease-in-out}.minimal-tab-title-hover .view-header:hover .view-header-title-container,.minimal-tab-title-hover .workspace-tab-header-container:hover+.workspace-tab-container .view-header-title-container{opacity:1;transition:opacity .1s ease-in-out}.minimal-tab-title-hidden .view-header-title-container{opacity:0}body.window-title-off .titlebar-text{display:none}.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame),.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame){--titlebar-background:var(--bg1)}.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame).is-focused .sidebar-toggle-button.mod-right,.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame).is-focused .workspace-ribbon.mod-left.is-collapsed,.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame).is-focused .workspace-tabs.mod-top,.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame).is-focused .sidebar-toggle-button.mod-right,.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame).is-focused .workspace-ribbon.mod-left.is-collapsed,.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame).is-focused .workspace-tabs.mod-top{--titlebar-background-focused:var(--bg1)}.is-hidden-frameless.theme-dark:not(.minimal-dark-black):not(.colorful-frame):not(.minimal-light-white) .workspace-ribbon.mod-left:not(.is-collapsed),.is-hidden-frameless.theme-light:not(.minimal-light-tonal):not(.colorful-frame):not(.minimal-light-white) .workspace-ribbon.mod-left:not(.is-collapsed){--titlebar-background:var(--bg2)}.mod-macos.is-hidden-frameless:not(.is-popout-window) .sidebar-toggle-button.mod-right{right:0;padding-right:var(--size-4-2)}body.is-focused{--titlebar-background-focused:var(--background-secondary)}body .mod-right-split{--background-secondary:var(--background-primary)}body .mod-right-split :not(.mod-top) .workspace-tab-header-container{--tab-container-background:var(--background-primary)}.is-hidden-frameless:not(.colorful-frame) .mod-left-split .mod-top .workspace-tab-header-container{--tab-container-background:var(--background-secondary)}.modal button:not(.mod-warning),.modal.mod-settings button:not(.mod-cta):not(.mod-warning),.modal.mod-settings button:not(.mod-warning){white-space:nowrap;transition:background-color .2s ease-out,border-color .2s ease-out}button.mod-warning{border:1px solid var(--background-modifier-error);color:var(--text-error);box-shadow:0 1px 1px 0 var(--btn-shadow-color);transition:background-color .2s ease-out}button.mod-warning:hover{border:1px solid var(--background-modifier-error);color:var(--text-error);box-shadow:0 2px 3px 0 var(--btn-shadow-color);transition:background-color .2s ease-out}.document-replace,.document-search{max-width:100%}.document-search-container{margin:0 auto;max-width:var(--max-width);width:var(--line-width-adaptive)}.minimal-focus-mode .document-search-container{margin-top:var(--header-height)}.is-mobile .CodeMirror-foldgutter-open:after,.is-mobile span[title="Fold line"]:after{transform:translateX(-2px)!important}body.is-mobile .CodeMirror-foldgutter-folded:after,body.is-mobile span[title="Unfold line"]:after{content:"›";font-family:sans-serif;transform:translateY(-2px);transform:rotate(-90deg) translateY(2px) translateX(-.45em)}body.is-mobile .CodeMirror-foldgutter-open:after,body.is-mobile span[title="Fold line"]:after{content:"›";font-family:sans-serif;transform:rotate(360deg)}body{--ig-adjust-reading:-0.65em;--ig-adjust-edit:-1px}.markdown-rendered.show-indentation-guide li.task-list-item>ol::before,.markdown-rendered.show-indentation-guide li.task-list-item>ul::before,.markdown-rendered.show-indentation-guide li>ol::before,.markdown-rendered.show-indentation-guide li>ul::before{left:var(--ig-adjust-reading)}.markdown-source-view.mod-cm6 .cm-indent::before{transform:translateX(var(--ig-adjust-edit))}.is-mobile .markdown-rendered.show-indentation-guide li>ol::before,.is-mobile .markdown-rendered.show-indentation-guide li>ul::before{left:calc(0em + var(--ig-adjust-reading))}.is-mobile .markdown-source-view.mod-cm6 .cm-indent::before{transform:translateX(calc(2px + var(--ig-adjust-edit)))}.modal-container.mod-confirmation .modal{width:480px;min-width:0}.modal-container.mod-confirmation .modal-content{margin-top:10px}.modal-container.mod-confirmation .modal-content .setting-item{margin-top:10px}.modal-container.mod-confirmation .modal-button-container{display:flex}.modal-container.mod-confirmation .modal-button-container>.mod-warning:nth-last-child(3){background:0 0;border:none;font-weight:500;color:var(--text-error);cursor:pointer;margin-right:auto;box-shadow:none;padding-left:0;padding-right:0}.modal-container.mod-confirmation .modal-button-container>.mod-warning:nth-last-child(3):hover{text-decoration:underline}.modal-container.mod-confirmation .modal-button-container>.mod-warning:nth-last-child(2){margin-left:auto}.theme-light{--progress-outline:rgba(0,0,0,0.05)}.theme-dark{--progress-outline:rgba(255,255,255,0.04)}.markdown-preview-view progress,.markdown-rendered progress,.markdown-source-view.is-live-preview progress{width:220px}.markdown-preview-view progress[value]::-webkit-progress-bar,.markdown-rendered progress[value]::-webkit-progress-bar,.markdown-source-view.is-live-preview progress[value]::-webkit-progress-bar{box-shadow:inset 0 0 0 var(--border-width) var(--progress-outline)}.markdown-preview-view progress[value^='1']::-webkit-progress-value,.markdown-preview-view progress[value^='2']::-webkit-progress-value,.markdown-preview-view progress[value^='3']::-webkit-progress-value,.markdown-rendered progress[value^='1']::-webkit-progress-value,.markdown-rendered progress[value^='2']::-webkit-progress-value,.markdown-rendered progress[value^='3']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='1']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='2']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='3']::-webkit-progress-value{background-color:var(--red)}.markdown-preview-view progress[value^='4']::-webkit-progress-value,.markdown-preview-view progress[value^='5']::-webkit-progress-value,.markdown-rendered progress[value^='4']::-webkit-progress-value,.markdown-rendered progress[value^='5']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='4']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='5']::-webkit-progress-value{background-color:var(--orange)}.markdown-preview-view progress[value^='6']::-webkit-progress-value,.markdown-preview-view progress[value^='7']::-webkit-progress-value,.markdown-rendered progress[value^='6']::-webkit-progress-value,.markdown-rendered progress[value^='7']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='6']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='7']::-webkit-progress-value{background-color:var(--yellow)}.markdown-preview-view progress[value^='8']::-webkit-progress-value,.markdown-preview-view progress[value^='9']::-webkit-progress-value,.markdown-rendered progress[value^='8']::-webkit-progress-value,.markdown-rendered progress[value^='9']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='8']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value^='9']::-webkit-progress-value{background-color:var(--green)}.markdown-preview-view progress[value='1']::-webkit-progress-value,.markdown-preview-view progress[value='100']::-webkit-progress-value,.markdown-rendered progress[value='1']::-webkit-progress-value,.markdown-rendered progress[value='100']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='1']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='100']::-webkit-progress-value{background-color:var(--text-accent)}.markdown-preview-view progress[value='0']::-webkit-progress-value,.markdown-preview-view progress[value='2']::-webkit-progress-value,.markdown-preview-view progress[value='3']::-webkit-progress-value,.markdown-preview-view progress[value='4']::-webkit-progress-value,.markdown-preview-view progress[value='5']::-webkit-progress-value,.markdown-preview-view progress[value='6']::-webkit-progress-value,.markdown-preview-view progress[value='7']::-webkit-progress-value,.markdown-preview-view progress[value='8']::-webkit-progress-value,.markdown-preview-view progress[value='9']::-webkit-progress-value,.markdown-rendered progress[value='0']::-webkit-progress-value,.markdown-rendered progress[value='2']::-webkit-progress-value,.markdown-rendered progress[value='3']::-webkit-progress-value,.markdown-rendered progress[value='4']::-webkit-progress-value,.markdown-rendered progress[value='5']::-webkit-progress-value,.markdown-rendered progress[value='6']::-webkit-progress-value,.markdown-rendered progress[value='7']::-webkit-progress-value,.markdown-rendered progress[value='8']::-webkit-progress-value,.markdown-rendered progress[value='9']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='0']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='2']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='3']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='4']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='5']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='6']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='7']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='8']::-webkit-progress-value,.markdown-source-view.is-live-preview progress[value='9']::-webkit-progress-value{background-color:var(--red)}body:not(.hider-scrollbars).styled-scrollbars ::-webkit-scrollbar,body:not(.native-scrollbars) ::-webkit-scrollbar{width:11px;background-color:transparent}body:not(.hider-scrollbars).styled-scrollbars ::-webkit-scrollbar:horizontal,body:not(.native-scrollbars) ::-webkit-scrollbar:horizontal{height:11px}body:not(.hider-scrollbars).styled-scrollbars ::-webkit-scrollbar-corner,body:not(.native-scrollbars) ::-webkit-scrollbar-corner{background-color:transparent}body:not(.hider-scrollbars).styled-scrollbars ::-webkit-scrollbar-track,body:not(.native-scrollbars) ::-webkit-scrollbar-track{background-color:transparent}body:not(.hider-scrollbars).styled-scrollbars ::-webkit-scrollbar-thumb,body:not(.native-scrollbars) ::-webkit-scrollbar-thumb{background-clip:padding-box;border-radius:20px;border:3px solid transparent;background-color:var(--background-modifier-border);border-width:3px 3px 3px 3px;min-height:45px}body:not(.hider-scrollbars).styled-scrollbars .mod-left-split .workspace-tabs ::-webkit-scrollbar-thumb:hover,body:not(.hider-scrollbars).styled-scrollbars .modal .vertical-tab-header::-webkit-scrollbar-thumb:hover,body:not(.hider-scrollbars).styled-scrollbars ::-webkit-scrollbar-thumb:hover,body:not(.native-scrollbars) .mod-left-split .workspace-tabs ::-webkit-scrollbar-thumb:hover,body:not(.native-scrollbars) .modal .vertical-tab-header::-webkit-scrollbar-thumb:hover,body:not(.native-scrollbars) ::-webkit-scrollbar-thumb:hover{background-color:var(--background-modifier-border-hover)}body:not(.hider-scrollbars).styled-scrollbars .mod-left-split .workspace-tabs ::-webkit-scrollbar-thumb:active,body:not(.hider-scrollbars).styled-scrollbars .modal .vertical-tab-header::-webkit-scrollbar-thumb:active,body:not(.hider-scrollbars).styled-scrollbars ::-webkit-scrollbar-thumb:active,body:not(.native-scrollbars) .mod-left-split .workspace-tabs ::-webkit-scrollbar-thumb:active,body:not(.native-scrollbars) .modal .vertical-tab-header::-webkit-scrollbar-thumb:active,body:not(.native-scrollbars) ::-webkit-scrollbar-thumb:active{background-color:var(--background-modifier-border-focus)}.tooltip{transition:none;animation:none}.tooltip.mod-left,.tooltip.mod-right{transform:none;animation:none}.tooltip.mod-error{color:var(--text-error)}.markdown-preview-view blockquote{padding:0 0 0 var(--nested-padding);font-size:var(--blockquote-size)}.markdown-source-view.mod-cm6 .HyperMD-quote,.markdown-source-view.mod-cm6.is-live-preview .HyperMD-quote{font-size:var(--blockquote-size)}.is-live-preview .cm-hmd-indent-in-quote{color:var(--text-faint)}.is-live-preview.is-readable-line-width>.cm-callout .callout{max-width:var(--max-width);margin:0 auto}body{--checkbox-size:17px;--checkbox-icon:20px;--checkbox-radius:50%;--checkbox-top:2px;--checkbox-left:0px;--checkbox-margin:0px 6px 0px -1.35em}.checkbox-square{--checkbox-size:15px;--checkbox-icon:17px;--checkbox-radius:4px;--checkbox-top:1px;--checkbox-left:0px;--checkbox-margin:0px 8px 0px -1.35em}body.minimal-strike-lists{--checklist-done-decoration:line-through}body:not(.minimal-strike-lists){--checklist-done-decoration:none;--checklist-done-color:var(--text-normal)}input[type=checkbox]{padding:0;margin:0 6px 0 0}.markdown-preview-section>.contains-task-list{padding-bottom:.5em}ul>li.task-list-item .task-list-item-checkbox{margin-left:-1.35em}.mod-cm6 .HyperMD-task-line[data-task] .task-list-item-checkbox{margin:-2px 1px 0 -.6em}.markdown-preview-view .task-list-item-checkbox{position:relative;top:var(--checkbox-top);left:var(--checkbox-left);line-height:0;margin:var(--checkbox-margin)}.markdown-preview-view ul>li.task-list-item{text-indent:0;line-height:var(--line-height)}.markdown-preview-view .task-list-item{padding-inline-start:0}.is-mobile .mod-cm6 .HyperMD-task-line[data-task] .task-list-item-checkbox{margin-left:-.4em}.is-mobile .markdown-preview-view input[type=checkbox].task-list-item-checkbox{top:.2em}.embed-strict .internal-embed .markdown-embed{padding:0;border:none}.embed-strict .internal-embed .markdown-embed .markdown-embed-title{display:none}.embed-strict .internal-embed:not([src*="#^"]) .markdown-embed-link{width:24px;opacity:0}.contextual-typography .embed-strict .internal-embed .markdown-preview-view .markdown-preview-sizer>div,.embed-strict.contextual-typography .internal-embed .markdown-preview-view .markdown-preview-sizer>div{margin:0;width:100%}.markdown-embed .markdown-preview-view .markdown-preview-sizer{padding-bottom:0!important}.markdown-preview-view.is-readable-line-width .markdown-embed .markdown-preview-sizer,.markdown-preview-view.markdown-embed .markdown-preview-sizer{max-width:100%;width:100%;min-height:0!important;padding-bottom:0!important}.markdown-embed .markdown-preview-section div:last-child p,.markdown-embed .markdown-preview-section div:last-child ul{margin-block-end:2px}.markdown-preview-view .markdown-embed{margin-top:var(--nested-padding);padding:0 calc(var(--nested-padding)/ 2) 0 var(--nested-padding)}.markdown-embed-title{line-height:18px;height:24px}.internal-embed:not([src*="#^"]) .markdown-embed-link{right:0;width:100%}.file-embed-link,.markdown-embed-link{top:0;right:0;text-align:right;justify-content:flex-end}.file-embed-link svg,.markdown-embed-link svg{width:16px;height:16px}.markdown-embed .file-embed-link,.markdown-embed .markdown-embed-link{opacity:.6;transition:opacity .1s linear}.markdown-embed .file-embed-link:hover,.markdown-embed .markdown-embed-link:hover{opacity:1}.markdown-embed .file-embed-link:hover:hover,.markdown-embed .markdown-embed-link:hover:hover{background-color:transparent;--icon-color:var(--text-accent)}.file-embed-link:hover,.markdown-embed-link:hover{color:var(--text-muted)}.markdown-preview-view .markdown-embed-content>.markdown-preview-view{max-height:none!important}.markdown-embed-content{max-height:none!important}.markdown-embed .markdown-preview-view{padding:0}.internal-embed .markdown-embed{border:0;border-left:1px solid var(--quote-opening-modifier);border-radius:0}a[href*="obsidian://search"]{background-image:url("data:image/svg+xml,")}.theme-dark a[href*="obsidian://search"]{background-image:url("data:image/svg+xml,")}div>ol,div>ul{padding-inline-start:1.4em}ul>li{min-height:1.4em}ol>li{margin-left:0}ol{margin-left:0;list-style:default}.markdown-source-view.mod-cm6 .cm-content .HyperMD-list-line{margin-left:var(--list-edit-offset)!important}.markdown-preview-view ol>li,.markdown-preview-view ul>li,.markdown-source-view ol>li,.markdown-source-view ul>li,.mod-cm6 .HyperMD-list-line.cm-line{padding-top:var(--list-spacing);padding-bottom:var(--list-spacing)}body:not(.is-mobile) .markdown-source-view.mod-cm6 .list-bullet:after{left:-5px}body:not(.is-mobile) .markdown-source-view.mod-cm6 span.cm-formatting.cm-formatting-list.cm-formatting-list-ol{margin-left:-5px}.is-mobile ul>li:not(.task-list-item)::marker{font-size:.8em}.is-mobile .markdown-rendered ol,.is-mobile .markdown-rendered ul{padding-inline-start:var(--list-indent)}.is-mobile .markdown-rendered div>ol,.is-mobile .markdown-rendered div>ul{padding-inline-start:2em}.is-mobile .el-ol>ol,.is-mobile .el-ul>ul{margin-left:0}.is-mobile .workspace-leaf-content:not([data-type=search]) .workspace-leaf-content[data-type=markdown] .nav-buttons-container{border-bottom:none;padding-top:5px}.is-mobile .mod-root .workspace-leaf-content[data-type=markdown] .search-input-container{width:calc(100% - 160px)}.embedded-backlinks .nav-header~.search-input-container{width:calc(100% - 140px);margin-top:12px}.embedded-backlinks .nav-buttons-container{position:absolute;right:0;top:14px}.embedded-backlinks .backlink-pane>.tree-item-self,.embedded-backlinks .backlink-pane>.tree-item-self:hover{text-transform:none;color:var(--text-normal);font-size:var(--font-adaptive-normal);font-weight:500;letter-spacing:unset}.markdown-source-view.mod-cm6 table{border-collapse:collapse}.markdown-preview-view table{margin-block-start:1em}.markdown-preview-view .dataview.table-view-table thead.table-view-thead tr th,.markdown-preview-view td,.markdown-preview-view th,.markdown-source-view.mod-cm6 .dataview.table-view-table thead.table-view-thead tr th,.markdown-source-view.mod-cm6 td,.markdown-source-view.mod-cm6 th{padding:4px 10px}.markdown-preview-view .dataview.table-view-table thead.table-view-thead tr th:first-child,.markdown-preview-view td:first-child,.markdown-preview-view th:first-child,.markdown-source-view.mod-cm6 .dataview.table-view-table thead.table-view-thead tr th:first-child,.markdown-source-view.mod-cm6 td:first-child,.markdown-source-view.mod-cm6 th:first-child{padding-left:0}body{--table-header-border-width:0 1px;--table-column-first-border-width:0;--table-column-last-border-width:0;--table-row-last-border-width:0}.is-live-preview .el-table{width:100%;max-width:100%}.cm-hmd-table-sep-dummy,.cm-s-obsidian .HyperMD-table-row span.cm-hmd-table-sep{color:var(--text-faint);font-weight:400}body.minimal-unstyled-tags .cm-s-obsidian span.cm-hashtag,body.minimal-unstyled-tags .frontmatter-container .tag,body.minimal-unstyled-tags a.tag{color:var(--tag-color);font-weight:var(--link-weight);text-decoration:none}body.minimal-unstyled-tags .cm-s-obsidian span.cm-hashtag:hover,body.minimal-unstyled-tags .frontmatter-container .tag:hover,body.minimal-unstyled-tags a.tag:hover{color:var(--text-normal)}body:not(.minimal-unstyled-tags) .frontmatter-container .tag,body:not(.minimal-unstyled-tags) a.tag{background-color:var(--tag-bg);border:var(--tag-border-width) solid var(--background-modifier-border);color:var(--tag-color);font-size:calc(var(--font-adaptive-normal) * .8);font-weight:var(--link-weight);font-family:var(--font-interface);vertical-align:middle;display:inline-block;margin:1px 0;border-radius:var(--tag-radius)}body:not(.minimal-unstyled-tags) a.tag:hover{color:var(--text-normal);border-color:var(--background-modifier-border-hover);background-color:var(--tag-bg2)}body:not(.minimal-unstyled-tags) .cm-s-obsidian span.cm-hashtag{background-color:var(--tag-bg);border:var(--tag-border-width) solid var(--background-modifier-border);color:var(--tag-color);font-size:calc(var(--font-adaptive-normal) * .8);font-family:var(--font-interface);font-weight:var(--link-weight);text-align:center;text-decoration:none;margin:0;vertical-align:text-bottom;padding-top:2px;border-left:none;border-right:none;padding-bottom:3px;cursor:text}body:not(.minimal-unstyled-tags) .cm-s-obsidian span.cm-hashtag:hover{background-color:var(--tag-bg2)}body:not(.minimal-unstyled-tags) span.cm-hashtag.cm-hashtag-begin{border-top-left-radius:var(--tag-radius);border-bottom-left-radius:var(--tag-radius);padding-left:8px;border-right:none;border-left:var(--tag-border-width) solid var(--background-modifier-border)}body:not(.minimal-unstyled-tags) span.cm-hashtag.cm-hashtag-end{border-top-right-radius:var(--tag-radius);border-bottom-right-radius:var(--tag-radius);border-left:none;padding-right:8px;border-right:var(--tag-border-width) solid var(--background-modifier-border)}h1,h2,h3,h4{letter-spacing:-.02em}body,button,input{font-family:var(--font-interface)}.cm-s-obsidian span.cm-error{color:var(--red)}.markdown-preview-view,.popover,.workspace-leaf-content[data-type=markdown]{font-family:var(--font-text)}.cm-s-obsidian,.cm-s-obsidian .cm-formatting-hashtag,.markdown-preview-view,.markdown-source-view.mod-cm6.is-live-preview .cm-scroller,body{font-size:var(--font-adaptive-normal);font-weight:var(--normal-weight);line-height:var(--line-height)}.cm-s-obsidian,.cm-s-obsidian .cm-formatting-hashtag,.cm-s-obsidian span.cm-formatting-task,.markdown-source-view,.markdown-source-view.mod-cm6 .cm-scroller{line-height:var(--line-height);font-family:var(--font-editor)}.cm-s-obsidian span.cm-formatting-task{font-family:var(--font-editor);line-height:var(--line-height)}.mod-cm6 .cm-editor .HyperMD-header-1,.mod-cm6 .cm-editor .HyperMD-header-2,.mod-cm6 .cm-editor .HyperMD-header-3,.mod-cm6 .cm-editor .HyperMD-header-4,.mod-cm6 .cm-editor .HyperMD-header-5,.mod-cm6 .cm-editor .HyperMD-header-6{padding-top:.5em}.active-line-on .cm-line.cm-active,.active-line-on .markdown-source-view.mod-cm6.is-live-preview .HyperMD-quote.cm-active{background-color:var(--active-line-bg);box-shadow:-25vw 0 var(--active-line-bg),25vw 0 var(--active-line-bg)}.borders-none{--divider-width:0px}:root{--cards-min-width:180px;--cards-max-width:1fr;--cards-mobile-width:120px;--cards-image-height:400px;--cards-padding:1.2em;--cards-image-fit:contain;--cards-background:transparent;--cards-border-width:1px;--cards-aspect-ratio:auto;--cards-columns:repeat(auto-fit, minmax(var(--cards-min-width), var(--cards-max-width)))}@media (max-width:400pt){:root{--cards-min-width:var(--cards-mobile-width)}}.cards.table-100 table.dataview tbody,.table-100 .cards table.dataview tbody{padding:.25rem .75rem}.cards table.dataview tbody{clear:both;padding:.5rem 0;display:grid;grid-template-columns:var(--cards-columns);grid-column-gap:0.75rem;grid-row-gap:0.75rem}.cards table.dataview>tbody>tr{background-color:var(--cards-background);border:var(--cards-border-width) solid var(--background-modifier-border);display:flex;flex-direction:column;margin:0;padding:0 0 calc(var(--cards-padding)/3) 0;border-radius:6px;overflow:hidden;transition:box-shadow .15s linear}.cards table.dataview>tbody>tr:hover{border:var(--cards-border-width) solid var(--background-modifier-border-hover);box-shadow:0 4px 6px 0 rgba(0,0,0,.05),0 1px 3px 1px rgba(0,0,0,.025);transition:box-shadow .15s linear}.cards table.dataview tbody>tr>td:first-child{font-weight:var(--bold-weight)}.cards table.dataview tbody>tr>td:first-child a{padding:0 0 calc(var(--cards-padding)/3);display:block}.cards table.dataview tbody>tr>td:not(:first-child){font-size:90%;color:var(--text-muted)}.cards table.dataview tbody>tr>td .el-p{display:block;width:100%}.cards table.dataview tbody>tr>td>:not(.el-embed-image){padding:calc(var(--cards-padding)/3) 0}.cards table.dataview tbody>tr>td:not(:last-child):not(:first-child)>.el-p:not(.el-embed-image){border-bottom:1px solid var(--background-modifier-border);width:100%}.cards table.dataview tbody>tr>td a{text-decoration:none}.cards table.dataview tbody>tr>td>button{width:100%;margin:calc(var(--cards-padding)/2) 0}.cards table.dataview tbody>tr>td:last-child>button{margin-bottom:calc(var(--cards-padding)/6)}.cards table.dataview tbody>tr>td>ul{width:100%;padding:.25em 0!important;margin:0 auto!important}.cards table.dataview tbody>tr>td:not(:last-child)>ul{border-bottom:1px solid var(--background-modifier-border)}.cards table.dataview tbody>tr>td .el-embed-image{background-color:var(--background-secondary);display:block;margin:0 calc(var(--cards-padding)/-2) 0 calc(var(--cards-padding)/-2);width:calc(100% + var(--cards-padding))}.cards table.dataview tbody>tr>td img{aspect-ratio:var(--cards-aspect-ratio);width:100%;object-fit:var(--cards-image-fit);max-height:var(--cards-image-height);background-color:var(--background-secondary);vertical-align:bottom}.markdown-source-view.mod-cm6.cards .dataview.table-view-table>tbody>tr>td,.trim-cols .cards table.dataview tbody>tr>td{white-space:normal}.cards .dataview.table-view-table>tbody>tr>td,.cards table.dataview tbody>tr>td,.markdown-source-view.mod-cm6.cards .dataview.table-view-table>tbody>tr>td,.markdown-source-view.mod-cm6.cards table.dataview tbody>tr>td{border-bottom:none;padding:0!important;line-height:1.2;width:calc(100% - var(--cards-padding));margin:0 auto;overflow:visible!important;max-width:100%;display:flex}.links-int-on .cards table.dataview tbody>tr>td a{text-decoration:none}.markdown-source-view.mod-cm6.cards .edit-block-button{top:0}.cards.table-100 table.dataview thead>tr,.table-100 .cards table.dataview thead>tr{right:.75rem}.cards.table-100 table.dataview thead:before,.table-100 .cards table.dataview thead:before{margin-right:.75rem}.theme-light .cards table.dataview thead:before{background-image:url('data:image/svg+xml;utf8,')}.cards .el-pre+.el-lang-dataview .table-view-thead{padding-top:8px}.cards table.dataview thead{user-select:none;width:180px;display:block;float:right;position:relative;text-align:right;height:24px;padding-bottom:4px}.cards table.dataview thead:hover:before{opacity:.5;background-color:var(--background-modifier-hover)}.cards table.dataview thead:before{content:'';position:absolute;right:0;top:0;width:10px;height:16px;background-repeat:no-repeat;cursor:var(--cursor);text-align:right;padding:var(--size-4-1) var(--size-4-2);margin-bottom:2px;border-radius:var(--radius-s);font-weight:500;font-size:var(--font-adaptive-small);opacity:.25;background-position:center center;background-size:16px;background-image:url('data:image/svg+xml;utf8,')}.cards table.dataview thead>tr{top:-1px;position:absolute;display:none;z-index:9;border:1px solid var(--background-modifier-border-hover);background-color:var(--background-secondary);box-shadow:var(--shadow-s);padding:6px;border-radius:var(--radius-m);flex-direction:column;margin:26px 0 0 0;width:100%}.cards table.dataview thead:hover>tr{display:flex}.cards table.dataview thead>tr>th{display:block;padding:3px 30px 3px 6px!important;border-radius:var(--radius-s);width:100%;font-weight:400;color:var(--text-normal);cursor:var(--cursor);border:none;font-size:var(--font-ui-small)}.cards table.dataview thead>tr>th[sortable-style=sortable-asc],.cards table.dataview thead>tr>th[sortable-style=sortable-desc]{color:var(--text-normal)}.cards table.dataview thead>tr>th:hover{color:var(--text-normal);background-color:var(--background-modifier-hover)}.cards.cards-16-9{--cards-aspect-ratio:16/9}.cards.cards-1-1{--cards-aspect-ratio:1/1}.cards.cards-2-1{--cards-aspect-ratio:2/1}.cards.cards-2-3{--cards-aspect-ratio:2/3}.cards.cards-cols-1{--cards-columns:repeat(1, minmax(0, 1fr))}.cards.cards-cols-2{--cards-columns:repeat(2, minmax(0, 1fr))}.cards.cards-cover table.dataview tbody>tr>td img{object-fit:cover}.cards.cards-align-bottom table.dataview tbody>tr>td:last-child{align-items:flex-end;flex-grow:1}@media (max-width:400pt){.cards table.dataview tbody>tr>td:not(:first-child){font-size:80%}}@media (min-width:400pt){.cards-cols-3{--cards-columns:repeat(3, minmax(0, 1fr))}.cards-cols-4{--cards-columns:repeat(4, minmax(0, 1fr))}.cards-cols-5{--cards-columns:repeat(5, minmax(0, 1fr))}.cards-cols-6{--cards-columns:repeat(6, minmax(0, 1fr))}.cards-cols-7{--cards-columns:repeat(7, minmax(0, 1fr))}.cards-cols-8{--cards-columns:repeat(8, minmax(0, 1fr))}}.cm-formatting.cm-formatting-task.cm-property{font-family:var(--font-monospace);font-size:90%}input[data-task="!"]:checked,input[data-task="*"]:checked,input[data-task="-"]:checked,input[data-task="<"]:checked,input[data-task=">"]:checked,input[data-task="I"]:checked,input[data-task="b"]:checked,input[data-task="c"]:checked,input[data-task="d"]:checked,input[data-task="f"]:checked,input[data-task="k"]:checked,input[data-task="l"]:checked,input[data-task="p"]:checked,input[data-task="u"]:checked,input[data-task="w"]:checked,li[data-task="!"]>input:checked,li[data-task="!"]>p>input:checked,li[data-task="*"]>input:checked,li[data-task="*"]>p>input:checked,li[data-task="-"]>input:checked,li[data-task="-"]>p>input:checked,li[data-task="<"]>input:checked,li[data-task="<"]>p>input:checked,li[data-task=">"]>input:checked,li[data-task=">"]>p>input:checked,li[data-task="I"]>input:checked,li[data-task="I"]>p>input:checked,li[data-task="b"]>input:checked,li[data-task="b"]>p>input:checked,li[data-task="c"]>input:checked,li[data-task="c"]>p>input:checked,li[data-task="d"]>input:checked,li[data-task="d"]>p>input:checked,li[data-task="f"]>input:checked,li[data-task="f"]>p>input:checked,li[data-task="k"]>input:checked,li[data-task="k"]>p>input:checked,li[data-task="l"]>input:checked,li[data-task="l"]>p>input:checked,li[data-task="p"]>input:checked,li[data-task="p"]>p>input:checked,li[data-task="u"]>input:checked,li[data-task="u"]>p>input:checked,li[data-task="w"]>input:checked,li[data-task="w"]>p>input:checked{--checkbox-marker-color:transparent;border:none;border-radius:0;background-image:none;background-color:currentColor;-webkit-mask-size:var(--checkbox-icon);-webkit-mask-position:50% 50%}input[data-task=">"]:checked,li[data-task=">"]>input:checked,li[data-task=">"]>p>input:checked{color:var(--text-faint);transform:rotate(90deg);-webkit-mask-position:50% 100%;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z' /%3E%3C/svg%3E")}input[data-task="<"]:checked,li[data-task="<"]>input:checked,li[data-task="<"]>p>input:checked{color:var(--text-faint);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z' clip-rule='evenodd' /%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="?"]:checked,li[data-task="?"]>input:checked,li[data-task="?"]>p>input:checked{--checkbox-marker-color:transparent;background-color:var(--yellow);border-color:var(--yellow);background-position:50% 50%;background-size:200% 90%;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="white" fill-rule="evenodd" d="M4.475 5.458c-.284 0-.514-.237-.47-.517C4.28 3.24 5.576 2 7.825 2c2.25 0 3.767 1.36 3.767 3.215c0 1.344-.665 2.288-1.79 2.973c-1.1.659-1.414 1.118-1.414 2.01v.03a.5.5 0 0 1-.5.5h-.77a.5.5 0 0 1-.5-.495l-.003-.2c-.043-1.221.477-2.001 1.645-2.712c1.03-.632 1.397-1.135 1.397-2.028c0-.979-.758-1.698-1.926-1.698c-1.009 0-1.71.529-1.938 1.402c-.066.254-.278.461-.54.461h-.777ZM7.496 14c.622 0 1.095-.474 1.095-1.09c0-.618-.473-1.092-1.095-1.092c-.606 0-1.087.474-1.087 1.091S6.89 14 7.496 14Z"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task="?"]:checked,.theme-dark li[data-task="?"]>input:checked,.theme-dark li[data-task="?"]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16"%3E%3Cpath fill="black" fill-opacity="0.8" fill-rule="evenodd" d="M4.475 5.458c-.284 0-.514-.237-.47-.517C4.28 3.24 5.576 2 7.825 2c2.25 0 3.767 1.36 3.767 3.215c0 1.344-.665 2.288-1.79 2.973c-1.1.659-1.414 1.118-1.414 2.01v.03a.5.5 0 0 1-.5.5h-.77a.5.5 0 0 1-.5-.495l-.003-.2c-.043-1.221.477-2.001 1.645-2.712c1.03-.632 1.397-1.135 1.397-2.028c0-.979-.758-1.698-1.926-1.698c-1.009 0-1.71.529-1.938 1.402c-.066.254-.278.461-.54.461h-.777ZM7.496 14c.622 0 1.095-.474 1.095-1.09c0-.618-.473-1.092-1.095-1.092c-.606 0-1.087.474-1.087 1.091S6.89 14 7.496 14Z"%2F%3E%3C%2Fsvg%3E')}input[data-task="/"]:checked,li[data-task="/"]>input:checked,li[data-task="/"]>p>input:checked{background-image:none;background-color:transparent;position:relative;overflow:hidden}input[data-task="/"]:checked:after,li[data-task="/"]>input:checked:after,li[data-task="/"]>p>input:checked:after{top:0;left:0;content:" ";display:block;position:absolute;background-color:var(--background-modifier-accent);width:calc(50% - .5px);height:100%;-webkit-mask-image:none}input[data-task="!"]:checked,li[data-task="!"]>input:checked,li[data-task="!"]>p>input:checked{color:var(--orange);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="\""]:checked,input[data-task="“"]:checked,li[data-task="\""]>input:checked,li[data-task="\""]>p>input:checked,li[data-task="“"]>input:checked,li[data-task="“"]>p>input:checked{--checkbox-marker-color:transparent;background-position:50% 50%;background-color:var(--cyan);border-color:var(--cyan);background-size:75%;background-repeat:no-repeat;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"%3E%3Cpath fill="white" d="M6.5 10c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.318.142-.686.238-1.028.466c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.945c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 6.5 10zm11 0c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.317.143-.686.238-1.028.467c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.944c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 17.5 10z"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task="\""]:checked,.theme-dark input[data-task="“"]:checked,.theme-dark li[data-task="\""]>input:checked,.theme-dark li[data-task="\""]>p>input:checked,.theme-dark li[data-task="“"]>input:checked,.theme-dark li[data-task="“"]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"%3E%3Cpath fill="black" fill-opacity="0.7" d="M6.5 10c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.318.142-.686.238-1.028.466c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.945c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 6.5 10zm11 0c-.223 0-.437.034-.65.065c.069-.232.14-.468.254-.68c.114-.308.292-.575.469-.844c.148-.291.409-.488.601-.737c.201-.242.475-.403.692-.604c.213-.21.492-.315.714-.463c.232-.133.434-.28.65-.35l.539-.222l.474-.197l-.485-1.938l-.597.144c-.191.048-.424.104-.689.171c-.271.05-.56.187-.882.312c-.317.143-.686.238-1.028.467c-.344.218-.741.4-1.091.692c-.339.301-.748.562-1.05.944c-.33.358-.656.734-.909 1.162c-.293.408-.492.856-.702 1.299c-.19.443-.343.896-.468 1.336c-.237.882-.343 1.72-.384 2.437c-.034.718-.014 1.315.028 1.747c.015.204.043.402.063.539l.025.168l.026-.006A4.5 4.5 0 1 0 17.5 10z"%2F%3E%3C%2Fsvg%3E')}input[data-task="-"]:checked,li[data-task="-"]>input:checked,li[data-task="-"]>p>input:checked{color:var(--text-faint);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z' clip-rule='evenodd' /%3E%3C/svg%3E")}body:not(.tasks) .markdown-preview-view ul li[data-task="-"].task-list-item.is-checked,body:not(.tasks) .markdown-source-view.mod-cm6 .HyperMD-task-line[data-task]:is([data-task="-"]),body:not(.tasks) li[data-task="-"].task-list-item.is-checked{color:var(--text-faint);text-decoration:line-through solid var(--text-faint) 1px}input[data-task="*"]:checked,li[data-task="*"]>input:checked,li[data-task="*"]>p>input:checked{color:var(--yellow);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z' /%3E%3C/svg%3E")}input[data-task="l"]:checked,li[data-task="l"]>input:checked,li[data-task="l"]>p>input:checked{color:var(--red);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M5.05 4.05a7 7 0 119.9 9.9L10 18.9l-4.95-4.95a7 7 0 010-9.9zM10 11a2 2 0 100-4 2 2 0 000 4z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="i"]:checked,li[data-task="i"]>input:checked,li[data-task="i"]>p>input:checked{--checkbox-marker-color:transparent;background-color:var(--blue);border-color:var(--blue);background-position:50%;background-size:100%;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"%3E%3Cpath fill="none" stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="40" d="M196 220h64v172"%2F%3E%3Cpath fill="none" stroke="white" stroke-linecap="round" stroke-miterlimit="10" stroke-width="40" d="M187 396h138"%2F%3E%3Cpath fill="white" d="M256 160a32 32 0 1 1 32-32a32 32 0 0 1-32 32Z"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task="i"]:checked,.theme-dark li[data-task="i"]>input:checked,.theme-dark li[data-task="i"]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 512 512"%3E%3Cpath fill="none" stroke="black" stroke-opacity="0.8" stroke-linecap="round" stroke-linejoin="round" stroke-width="40" d="M196 220h64v172"%2F%3E%3Cpath fill="none" stroke="black" stroke-opacity="0.8" stroke-linecap="round" stroke-miterlimit="10" stroke-width="40" d="M187 396h138"%2F%3E%3Cpath fill="black" fill-opacity="0.8" d="M256 160a32 32 0 1 1 32-32a32 32 0 0 1-32 32Z"%2F%3E%3C%2Fsvg%3E')}input[data-task="S"]:checked,li[data-task="S"]>input:checked,li[data-task="S"]>p>input:checked{--checkbox-marker-color:transparent;border-color:var(--green);background-color:var(--green);background-size:100%;background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"%3E%3Cpath fill="white" fill-rule="evenodd" d="M26 8a2 2 0 1 0-4 0v2a8 8 0 1 0 0 16v8a4.002 4.002 0 0 1-3.773-2.666a2 2 0 0 0-3.771 1.332A8.003 8.003 0 0 0 22 38v2a2 2 0 1 0 4 0v-2a8 8 0 1 0 0-16v-8a4.002 4.002 0 0 1 3.773 2.666a2 2 0 0 0 3.771-1.332A8.003 8.003 0 0 0 26 10V8Zm-4 6a4 4 0 0 0 0 8v-8Zm4 12v8a4 4 0 0 0 0-8Z" clip-rule="evenodd"%2F%3E%3C%2Fsvg%3E')}.theme-dark input[data-task="S"]:checked,.theme-dark li[data-task="S"]>input:checked,.theme-dark li[data-task="S"]>p>input:checked{background-image:url('data:image/svg+xml,%3Csvg xmlns="http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg" width="20" height="20" preserveAspectRatio="xMidYMid meet" viewBox="0 0 48 48"%3E%3Cpath fill-opacity="0.8" fill="black" fill-rule="evenodd" d="M26 8a2 2 0 1 0-4 0v2a8 8 0 1 0 0 16v8a4.002 4.002 0 0 1-3.773-2.666a2 2 0 0 0-3.771 1.332A8.003 8.003 0 0 0 22 38v2a2 2 0 1 0 4 0v-2a8 8 0 1 0 0-16v-8a4.002 4.002 0 0 1 3.773 2.666a2 2 0 0 0 3.771-1.332A8.003 8.003 0 0 0 26 10V8Zm-4 6a4 4 0 0 0 0 8v-8Zm4 12v8a4 4 0 0 0 0-8Z" clip-rule="evenodd"%2F%3E%3C%2Fsvg%3E')}input[data-task="I"]:checked,li[data-task="I"]>input:checked,li[data-task="I"]>p>input:checked{color:var(--yellow);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M11 3a1 1 0 10-2 0v1a1 1 0 102 0V3zM15.657 5.757a1 1 0 00-1.414-1.414l-.707.707a1 1 0 001.414 1.414l.707-.707zM18 10a1 1 0 01-1 1h-1a1 1 0 110-2h1a1 1 0 011 1zM5.05 6.464A1 1 0 106.464 5.05l-.707-.707a1 1 0 00-1.414 1.414l.707.707zM5 10a1 1 0 01-1 1H3a1 1 0 110-2h1a1 1 0 011 1zM8 16v-1h4v1a2 2 0 11-4 0zM12 14c.015-.34.208-.646.477-.859a4 4 0 10-4.954 0c.27.213.462.519.476.859h4.002z' /%3E%3C/svg%3E")}input[data-task="f"]:checked,li[data-task="f"]>input:checked,li[data-task="f"]>p>input:checked{color:var(--red);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="k"]:checked,li[data-task="k"]>input:checked,li[data-task="k"]>p>input:checked{color:var(--yellow);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="u"]:checked,li[data-task="u"]>input:checked,li[data-task="u"]>p>input:checked{color:var(--green);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12 7a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0V8.414l-4.293 4.293a1 1 0 01-1.414 0L8 10.414l-4.293 4.293a1 1 0 01-1.414-1.414l5-5a1 1 0 011.414 0L11 10.586 14.586 7H12z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="d"]:checked,li[data-task="d"]>input:checked,li[data-task="d"]>p>input:checked{color:var(--red);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12 13a1 1 0 100 2h5a1 1 0 001-1V9a1 1 0 10-2 0v2.586l-4.293-4.293a1 1 0 00-1.414 0L8 9.586 3.707 5.293a1 1 0 00-1.414 1.414l5 5a1 1 0 001.414 0L11 9.414 14.586 13H12z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="w"]:checked,li[data-task="w"]>input:checked,li[data-task="w"]>p>input:checked{color:var(--purple);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M6 3a1 1 0 011-1h.01a1 1 0 010 2H7a1 1 0 01-1-1zm2 3a1 1 0 00-2 0v1a2 2 0 00-2 2v1a2 2 0 00-2 2v.683a3.7 3.7 0 011.055.485 1.704 1.704 0 001.89 0 3.704 3.704 0 014.11 0 1.704 1.704 0 001.89 0 3.704 3.704 0 014.11 0 1.704 1.704 0 001.89 0A3.7 3.7 0 0118 12.683V12a2 2 0 00-2-2V9a2 2 0 00-2-2V6a1 1 0 10-2 0v1h-1V6a1 1 0 10-2 0v1H8V6zm10 8.868a3.704 3.704 0 01-4.055-.036 1.704 1.704 0 00-1.89 0 3.704 3.704 0 01-4.11 0 1.704 1.704 0 00-1.89 0A3.704 3.704 0 012 14.868V17a1 1 0 001 1h14a1 1 0 001-1v-2.132zM9 3a1 1 0 011-1h.01a1 1 0 110 2H10a1 1 0 01-1-1zm3 0a1 1 0 011-1h.01a1 1 0 110 2H13a1 1 0 01-1-1z' clip-rule='evenodd' /%3E%3C/svg%3E")}input[data-task="p"]:checked,li[data-task="p"]>input:checked,li[data-task="p"]>p>input:checked{color:var(--green);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M2 10.5a1.5 1.5 0 113 0v6a1.5 1.5 0 01-3 0v-6zM6 10.333v5.43a2 2 0 001.106 1.79l.05.025A4 4 0 008.943 18h5.416a2 2 0 001.962-1.608l1.2-6A2 2 0 0015.56 8H12V4a2 2 0 00-2-2 1 1 0 00-1 1v.667a4 4 0 01-.8 2.4L6.8 7.933a4 4 0 00-.8 2.4z' /%3E%3C/svg%3E")}input[data-task="c"]:checked,li[data-task="c"]>input:checked,li[data-task="c"]>p>input:checked{color:var(--orange);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M18 9.5a1.5 1.5 0 11-3 0v-6a1.5 1.5 0 013 0v6zM14 9.667v-5.43a2 2 0 00-1.105-1.79l-.05-.025A4 4 0 0011.055 2H5.64a2 2 0 00-1.962 1.608l-1.2 6A2 2 0 004.44 12H8v4a2 2 0 002 2 1 1 0 001-1v-.667a4 4 0 01.8-2.4l1.4-1.866a4 4 0 00.8-2.4z' /%3E%3C/svg%3E")}input[data-task="b"]:checked,li[data-task="b"]>input:checked,li[data-task="b"]>p>input:checked{color:var(--orange);-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath d='M5 4a2 2 0 012-2h6a2 2 0 012 2v14l-5-2.5L5 18V4z' /%3E%3C/svg%3E")}.colorful-active{--sp1:#fff}.colorful-active .nav-files-container{--nav-item-background-active:var(--ax3);--nav-item-color-active:var(--sp1)}.colorful-active #calendar-container .active,.colorful-active #calendar-container .active.today,.colorful-active #calendar-container .active:hover,.colorful-active #calendar-container .day:active{background-color:var(--ax3);color:var(--sp1)}.colorful-active #calendar-container .active .dot,.colorful-active #calendar-container .day:active .dot,.colorful-active #calendar-container .today.active .dot{fill:var(--sp1)}body:not(.colorful-active) .horizontal-tab-nav-item.is-active,body:not(.colorful-active) .vertical-tab-nav-item.is-active{background-color:var(--background-modifier-hover);color:var(--text-normal)}body{--frame-background:hsl( var(--frame-background-h), var(--frame-background-s), var(--frame-background-l))}.theme-light{--frame-background-h:var(--accent-h);--frame-background-s:var(--accent-s);--frame-background-l:calc(var(--accent-l) + 30%);--frame-outline-color:hsla( var(--frame-background-h), var(--frame-background-s), calc(var(--frame-background-l) - 6.5%), 1 );--frame-muted-color:hsl( var(--frame-background-h), calc(var(--frame-background-s) - 10%), calc(var(--frame-background-l) - 35%))}.theme-dark{--frame-background-h:var(--accent-h);--frame-background-s:var(--accent-s);--frame-background-l:calc(var(--accent-l) - 25%);--frame-outline-color:hsla( var(--frame-background-h), calc(var(--frame-background-s) - 2%), calc(var(--frame-background-l) + 6.5%), 1 );--frame-muted-color:hsl( var(--frame-background-h), calc(var(--frame-background-s) - 10%), calc(var(--frame-background-l) + 25%))}.colorful-frame.theme-dark{--tab-outline-width:0px}.colorful-frame,.colorful-frame.is-focused{--frame-divider-color:var(--frame-outline-color);--titlebar-background:var(--frame-background);--titlebar-background-focused:var(--frame-background)}.colorful-frame .mod-top .workspace-tab-header-container,.colorful-frame .sidebar-toggle-button.mod-left,.colorful-frame .titlebar,.colorful-frame .workspace-ribbon.mod-left:before,.colorful-frame.is-focused .mod-top .workspace-tab-header-container,.colorful-frame.is-focused .sidebar-toggle-button.mod-left,.colorful-frame.is-focused .titlebar,.colorful-frame.is-focused .workspace-ribbon.mod-left:before{--titlebar-text-color:var(--frame-muted-color);--tab-outline-color:var(--frame-outline-color);--tab-divider-color:var(--frame-outline-color);--background-modifier-hover:var(--frame-outline-color);--icon-color:var(--frame-muted-color);--icon-color-hover:var(--frame-muted-color);--icon-color-focus:var(--text-normal);--tab-text-color:var(--frame-muted-color);--tab-text-color-hover:var(--frame-muted-color);--tab-text-color-focused:var(--frame-muted-color)}.workspace-leaf-resize-handle{transition:none}.colorful-frame.is-hidden-frameless .workspace-split.mod-left-split>.workspace-leaf-resize-handle,.colorful-frame.is-hidden-frameless .workspace-split.mod-right-split>.workspace-leaf-resize-handle,.colorful-frame.is-hidden-frameless .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle{-webkit-app-region:no-drag;border:0;z-index:15}.colorful-frame.is-hidden-frameless .workspace-split.mod-left-split>.workspace-leaf-resize-handle:after,.colorful-frame.is-hidden-frameless .workspace-split.mod-right-split>.workspace-leaf-resize-handle:after,.colorful-frame.is-hidden-frameless .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle:after{content:"";height:100%;width:1px;background:linear-gradient(180deg,var(--frame-outline-color) var(--header-height),var(--divider-color) var(--header-height));top:0;position:absolute}.colorful-frame.is-hidden-frameless .workspace-split.mod-left-split>.workspace-leaf-resize-handle:hover:after,.colorful-frame.is-hidden-frameless .workspace-split.mod-right-split>.workspace-leaf-resize-handle:hover:after,.colorful-frame.is-hidden-frameless .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle:hover:after{background:var(--divider-color-hover)}.colorful-frame.is-hidden-frameless .workspace-split.mod-right-split>.workspace-leaf-resize-handle:after{left:0}.colorful-frame.is-hidden-frameless .workspace-split.mod-left-split>.workspace-leaf-resize-handle:after,.colorful-frame.is-hidden-frameless .workspace-split.mod-vertical>*>.workspace-leaf-resize-handle:after{right:0}body.colorful-headings{--h1-color:var(--red);--h2-color:var(--orange);--h3-color:var(--yellow);--h4-color:var(--green);--h5-color:var(--blue);--h6-color:var(--purple)}body.colorful-headings .modal{--h1-color:var(--text-normal);--h2-color:var(--text-normal);--h3-color:var(--text-normal);--h4-color:var(--text-normal);--h5-color:var(--text-normal);--h6-color:var(--text-normal)}.is-mobile .tree-item-self .collapse-icon{width:20px}body:not(.minimal-icons-off) svg.calendar-day,body:not(.minimal-icons-off) svg.excalidraw-icon,body:not(.minimal-icons-off) svg.globe,body:not(.minimal-icons-off) svg.longform,body:not(.minimal-icons-off) svg.obsidian-leaflet-plugin-icon-map{background-color:currentColor}body:not(.minimal-icons-off) svg.excalidraw-icon path{display:none}body:not(.minimal-icons-off) svg.bar-graph{-webkit-mask-image:url('data:image/svg+xml;utf8,')}body:not(.minimal-icons-off) svg.excalidraw-icon{-webkit-mask-image:url('data:image/svg+xml;utf8,')}body:not(.minimal-icons-off) svg.longform{-webkit-mask-image:url('data:image/svg+xml;utf8,')}.fancy-cursor .CodeMirror-cursor{border:none;border-left:2px solid var(--text-accent)}.cm-fat-cursor .CodeMirror-cursor{background-color:var(--text-accent);opacity:.5;width:5px}.cm-animate-fat-cursor{background-color:var(--text-accent);opacity:.5;width:5px}body .markdown-source-view.mod-cm6 .cm-content{caret-color:unset}body.fancy-cursor .markdown-source-view.mod-cm6 .cm-content,body.fancy-cursor .mod-cm6 .cm-line{caret-color:var(--text-accent)}.fancy-cursor input.prompt-input{caret-color:var(--text-accent)}.workspace-ribbon.mod-left{border-left:0;transition:none}.minimal-focus-mode .workspace-ribbon.mod-left{transition:background-color 0s linear 0s}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed{border-color:transparent;background-color:var(--background-primary)}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed:before{background-color:var(--background-primary);border-color:transparent}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed .side-dock-actions,.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed .side-dock-settings{opacity:0;transition:opacity .1s ease-in-out .1s}.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed:hover .side-dock-actions,.minimal-focus-mode .workspace-ribbon.mod-left.is-collapsed:hover .side-dock-settings{opacity:1;transition:opacity .1s ease-in-out .1s}.minimal-focus-mode.borders-title .workspace-ribbon.mod-left.is-collapsed{border-right:none}.minimal-focus-mode:not(.minimal-status-off) .status-bar{opacity:0;transition:opacity .2s ease-in-out}.minimal-focus-mode .status-bar:hover{opacity:1;transition:opacity .2s ease-in-out}.minimal-focus-mode .mod-root .workspace-tabs{position:relative}.minimal-focus-mode .mod-root .workspace-tabs:before:hover{background-color:#00f}.minimal-focus-mode .mod-root .workspace-tab-header-container{height:0;transition:all .1s linear .6s;--tab-outline-width:0px}.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-container-inner,.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-new-tab,.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-tab-list{opacity:0;transition:opacity .1s linear .6s}.minimal-focus-mode .mod-root .workspace-tab-header-container .workspace-tab-header-spacer:before{width:100%;content:" ";background-color:transparent;height:15px;position:absolute;z-index:100;top:0;left:0}.minimal-focus-mode .mod-root .workspace-tab-header-container:hover{height:var(--header-height);--tab-outline-width:1px;transition:all .1s linear 50ms}.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-container-inner,.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-new-tab,.minimal-focus-mode .mod-root .workspace-tab-header-container:hover .workspace-tab-header-tab-list{opacity:1;transition:opacity .1s linear 50ms}.minimal-focus-mode.mod-macos:not(.is-fullscreen) .workspace:not(.is-left-sidedock-open) .mod-root .workspace-tabs.mod-stacked .workspace-tab-container .workspace-tab-header-inner{padding-top:30px}body.show-view-header .app-container .workspace-split.mod-root>.workspace-leaf .view-header{transition:height .1s linear .1s}body.minimal-focus-mode.show-view-header .mod-root .workspace-leaf .view-header{height:0;transition:all .1s linear .5s}body.minimal-focus-mode.show-view-header .view-header::after{width:100%;content:" ";background-color:transparent;height:40px;position:absolute;z-index:-9;top:0}body.minimal-focus-mode.show-view-header .view-actions,body.minimal-focus-mode.show-view-header .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .view-header-title-container{opacity:0;transition:all .1s linear .5s}body.minimal-focus-mode.show-view-header .mod-root .workspace-leaf .view-header:focus-within,body.minimal-focus-mode.show-view-header .mod-root .workspace-leaf .view-header:hover,body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header{height:calc(var(--header-height) + 2px);transition:all .1s linear .1s}body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header .view-actions,body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .mod-root .workspace-tab-header-container:hover~.workspace-tab-container .view-header .view-header-title-container,body.minimal-focus-mode.show-view-header .view-header:focus-within .view-actions,body.minimal-focus-mode.show-view-header .view-header:focus-within .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .view-header:focus-within .view-header-title-container,body.minimal-focus-mode.show-view-header .view-header:hover .view-actions,body.minimal-focus-mode.show-view-header .view-header:hover .view-header-nav-buttons,body.minimal-focus-mode.show-view-header .view-header:hover .view-header-title-container{opacity:1;transition:all .1s linear .1s}body.minimal-focus-mode.show-view-header .view-content{height:100%}.full-width-media .image-embed img:not(.emoji):not([width]),.full-width-media .markdown-preview-view .image-embed img:not(.emoji):not([width]),.full-width-media .markdown-preview-view audio,.full-width-media .markdown-preview-view video{width:100%}.table-small table:not(.calendar){--table-text-size:85%}.table-tiny table:not(.calendar){--table-text-size:75%}.row-alt table:not(.calendar) tbody>tr>td:first-child,.row-alt table:not(.calendar) th:first-child,.row-alt.markdown-source-view.mod-cm6 td:first-child,.row-alt.markdown-source-view.mod-cm6 th:first-child,.row-hover th:first-child,.table-lines table:not(.calendar) tbody>tr>td:first-child,.table-lines table:not(.calendar) thead>tr>th:first-child,.table-lines.markdown-source-view.mod-cm6 td:first-child,.table-lines.markdown-source-view.mod-cm6 th:first-child{padding-left:10px}.row-alt{--table-row-alt-background:var(--background-table-rows)}.col-alt{--table-column-alt-background:var(--background-table-rows)}.table-tabular table:not(.calendar){font-variant-numeric:tabular-nums}.table-lines{--table-header-border-width:1px;--table-column-first-border-width:1px;--table-column-last-border-width:1px;--table-row-last-border-width:1px}.table-nowrap{--table-white-space:nowrap}.table-nowrap .table-wrap,.trim-cols{--table-white-space:normal}.table-numbers table:not(.calendar){counter-reset:section}.table-numbers table:not(.calendar)>thead>tr>th:first-child::before{content:" ";padding-right:.5em;display:inline-block;min-width:2em}.table-numbers table:not(.calendar)>tbody>tr>td:first-child::before{counter-increment:section;content:counter(section) " ";text-align:center;padding-right:.5em;display:inline-block;min-width:2em;color:var(--text-faint);font-variant-numeric:tabular-nums}.row-lines .table-view-table>tbody>tr>td,.row-lines table:not(.calendar) tbody>tr>td{border-bottom:1px solid var(--background-modifier-border)}.row-lines table:not(.calendar) tbody>tr:last-child>td{border-bottom:none}.col-lines .table-view-table thead>tr>th:not(:last-child),.col-lines .table-view-table>tbody>tr>td:not(:last-child),.col-lines table:not(.calendar) tbody>tr>td:not(:last-child){border-right:1px solid var(--background-modifier-border)}.row-hover{--table-row-background-hover:hsla( var(--accent-h), 50%, 80%, 20% )}.theme-dark .row-hover,.theme-dark.row-hover{--table-row-background-hover:hsla( var(--accent-h), 30%, 40%, 20% )}.theme-dark .markdown-preview-view img,.theme-dark .markdown-source-view img{opacity:var(--image-muted);transition:opacity .25s linear}.theme-dark .markdown-preview-view img:hover,.theme-dark .markdown-source-view img:hover,.theme-dark .print-preview img{opacity:1;transition:opacity .25s linear}.theme-dark div[src$="#invert"] img,.theme-dark img[src$="#invert"],.theme-dark span[src$="#invert"] img{filter:invert(1) hue-rotate(180deg);mix-blend-mode:screen}.theme-dark div[src$="#invert"]{background-color:var(--background-primary)}.theme-light div[src$="#invertW"] img,.theme-light img[src$="#invertW"],.theme-light span[src$=invertW] img{filter:invert(1) hue-rotate(180deg)}img[src$="#circle"],span[src$="#circle"] img,span[src$="#round"] img{border-radius:50%;aspect-ratio:1/1}img[src$="#outline"],span[src$="#outline"] img{border:1px solid var(--ui1)}img[src$="#interface"],span[src$="#interface"] img{border:1px solid var(--ui1);box-shadow:0 .5px .9px rgba(0,0,0,.021),0 1.3px 2.5px rgba(0,0,0,.03),0 3px 6px rgba(0,0,0,.039),0 10px 20px rgba(0,0,0,.06);margin-top:10px;margin-bottom:15px;border-radius:var(--radius-m)}div:not(.el-embed-image)+.el-embed-image{margin-top:1rem}.el-embed-image{margin-top:.5rem}.contextual-typography .markdown-preview-section>.el-embed-image>p{margin-block-start:0;margin-block-end:0}.img-grid .markdown-preview-section .el-embed-image img:not(.emoji):not([width]),.img-grid .markdown-preview-section video{width:100%}.img-grid .markdown-preview-section>.el-embed-image>p{display:grid;grid-column-gap:0.5rem;grid-row-gap:0;grid-template-columns:repeat(auto-fit,minmax(0,1fr))}.img-grid .markdown-preview-section>.el-embed-image>p>br{display:none}.img-grid .markdown-preview-section>.el-embed-image>p>img{object-fit:cover;align-self:stretch}.img-grid .markdown-preview-section>.el-embed-image>p>.internal-embed img{object-fit:cover;height:100%}.img-grid .img-grid-ratio .markdown-preview-section>.el-embed-image>p>.internal-embed img,.img-grid.img-grid-ratio .markdown-preview-section>.el-embed-image>p>.internal-embed img{object-fit:contain;height:100%;align-self:center}@media (max-width:400pt){.el-embed-image{margin-top:.25rem}.img-grid .markdown-preview-section>.el-embed-image>p{grid-column-gap:0.25rem}}body:not(.zoom-off) .view-content img{max-width:100%;cursor:zoom-in}body:not(.zoom-off) .view-content img:active{cursor:zoom-out}body:not(.zoom-off) .view-content .markdown-preview-view img[referrerpolicy=no-referrer]:active{background-color:var(--background-primary);padding:10px}body:not(.zoom-off) .view-content .image-embed:active,body:not(.zoom-off) .view-content .markdown-preview-view img[referrerpolicy=no-referrer]:active{aspect-ratio:unset;cursor:zoom-out;display:block;z-index:200;position:fixed;max-height:calc(100% + 1px);max-width:100%;height:calc(100% + 1px);width:100%;object-fit:contain;margin:-.5px auto 0!important;text-align:center;padding:0;left:0;right:0;bottom:0}body:not(.zoom-off) .view-content .image-embed:active:after{background-color:var(--background-primary);opacity:.9;content:" ";height:calc(100% + 1px);width:100%;position:fixed;left:0;right:1px;z-index:0}body:not(.zoom-off) .view-content .image-embed:active img{aspect-ratio:unset;top:50%;z-index:99;transform:translateY(-50%);padding:0;margin:0 auto;width:calc(100% - 20px);max-height:95vh;object-fit:contain;left:0;right:0;bottom:0;position:absolute;opacity:1}.labeled-nav.is-translucent .mod-left-split .mod-top .workspace-tab-header-container .workspace-tab-header-container-inner{background-color:transparent}.labeled-nav.is-hidden-frameless:not(.is-fullscreen) .mod-left-split .workspace-tabs.mod-top-left-space .workspace-tab-header-container{padding-left:0}.labeled-nav.mod-macos .mod-left-split .mod-top .workspace-tab-header-container:before,.labeled-nav.mod-macos.is-hidden-frameless:not(.is-fullscreen) .mod-left-split .mod-top .workspace-tab-header-container:before{-webkit-app-region:drag;position:absolute;width:calc(100% - var(--divider-width));height:calc(var(--header-height) - var(--tab-outline-width));border-bottom:var(--labeled-nav-outline-width) solid var(--tab-outline-color)}.labeled-nav.mod-macos .workspace-ribbon.mod-left:not(.is-collapsed),.labeled-nav.mod-macos.is-hidden-frameless:not(.is-fullscreen) .workspace-ribbon.mod-left:not(.is-collapsed){border:none;--tab-outline-width:0px}.labeled-nav.colorful-frame.is-hidden-frameless:not(.is-fullscreen) .mod-left-split .mod-top .workspace-tab-header-container:before,.labeled-nav.mod-macos:not(.hider-ribbon) .mod-left-split .mod-top .workspace-tab-header-container:before,.labeled-nav:not(.is-hidden-frameless) .mod-left-split .mod-top .workspace-tab-header-container:before{border-bottom:var(--tab-outline-width) solid var(--tab-outline-color)}.labeled-nav:not(.is-hidden-frameless) .mod-left-split .mod-top .workspace-tab-header-container:before{position:absolute;top:0;content:" "}.labeled-nav.hider-ribbon.mod-macos.is-hidden-frameless:not(.is-fullscreen):not(.is-popout-window) .mod-left-split:not(.is-sidedock-collapsed) .workspace-tabs.mod-top-left-space .workspace-tab-header-container{padding-left:0}.labeled-nav:not(.is-grabbing):not(.is-fullscreen).is-hidden-frameless .mod-top .workspace-tab-header-container{-webkit-app-region:no-drag}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-spacer{display:none}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-inner-title{display:inline-block;font-weight:500;font-size:var(--font-adaptive-smaller)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container{position:relative;flex-direction:column-reverse!important;height:auto;width:100%}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container .sidebar-toggle-button.mod-left{position:absolute;justify-content:flex-end;padding-right:var(--size-4-2);top:0;right:0}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container .workspace-tab-header-container-inner{padding-top:var(--size-4-2);margin-top:var(--header-height);flex-direction:column!important;background-color:var(--background-secondary)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container .workspace-tab-container-inner{flex-grow:1;gap:0;padding:var(--size-4-2) var(--size-4-3)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header{--icon-color:var(--text-muted);--tab-text-color:var(--text-muted);--tab-text-color-focused:var(--text-muted);padding:0;margin-bottom:2px;border:none;height:auto}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:not(:hover){background-color:transparent}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active,.labeled-nav .mod-left-split .mod-top .workspace-tab-header:hover{opacity:1;--tab-text-color-focused:var(--text-normal);--icon-color:var(--text-normal)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header .workspace-tab-header-inner{gap:var(--size-2-3);padding:var(--size-4-1) var(--size-4-2);box-shadow:none;border:none}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.has-active-menu:hover,.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:hover{background-color:transparent}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active:hover .workspace-tab-header-inner,.labeled-nav .mod-left-split .mod-top .workspace-tab-header:not(.is-active):hover .workspace-tab-header-inner{background-color:var(--nav-item-background-hover)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header.is-active .workspace-tab-header-inner-icon,.labeled-nav .mod-left-split .mod-top .workspace-tab-header:hover .workspace-tab-header-inner-icon{color:var(--icon-color-active)}.labeled-nav .mod-left-split .mod-top .workspace-tab-header-container{border:none;padding:0}body{--table-max-width:var(--max-width);--left-margin-table:auto}.maximize-tables-auto{--table-max-width:auto;--left-margin-table:max( calc(50% + var(--folding-offset)/2 - var(--line-width-adaptive)/2), calc(50% + var(--folding-offset)/2 - var(--max-width)/2) )}.maximize-tables-auto.table-100,.maximize-tables-auto.table-max,.maximize-tables-auto.table-wide{--table-max-width:var(--max-width);--left-margin-table:auto}.maximize-tables-off{--table-max-width:auto;--left-margin-table:max( calc(50% + var(--folding-offset)/2 - var(--line-width-adaptive)/2), calc(50% + var(--folding-offset)/2 - var(--max-width)/2))}.maximize-tables-off.table-wide{--left-margin-table:max( calc(50% + var(--folding-offset)/2 - var(--line-width-wide)/2), calc(50% + var(--folding-offset)/2 - var(--max-width)/2))}.maximize-tables-off.table-max{--left-margin-table:calc(50% + var(--folding-offset)/2 - var(--max-width)/2)}.maximize-tables-off.table-100{--left-margin-table:0}.contextual-typography .markdown-preview-view.markdown-preview-view.is-readable-line-width .markdown-preview-sizer{display:flex;flex-direction:column;width:100%;max-width:100%;padding-left:0;padding-top:0}.contextual-typography .markdown-preview-view.is-readable-line-width .markdown-preview-sizer{align-items:center;padding-left:0}.contextual-typography .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div{margin-left:auto;margin-right:auto;max-width:var(--max-width);width:var(--line-width-adaptive)}.contextual-typography .markdown-preview-view.is-readable-line-width .markdown-embed .markdown-preview-sizer>div{max-width:100%}.contextual-typography .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-dataview,.contextual-typography .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-dataviewjs,.contextual-typography .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-table{width:100%;max-width:100%;overflow-x:auto}.el-lang-dataview .block-language-dataview .contains-task-list,.el-lang-dataviewjs .block-language-dataviewjs .contains-task-list{max-width:100%}.is-readable-line-width .el-lang-dataview .dataview.table-view-table,.is-readable-line-width .el-lang-dataviewjs .dataview.table-view-table,.is-readable-line-width .el-table table{width:var(--table-max-width);max-width:var(--line-width-adaptive);margin:0 auto .5rem}.markdown-embed .el-lang-dataview .dataview.table-view-table,.markdown-embed .el-table table{width:100%}.markdown-preview-view.table-100.is-readable-line-width .el-lang-dataview .dataview.table-view-table,.markdown-preview-view.table-100.is-readable-line-width .el-lang-dataviewjs .dataview.table-view-table,.markdown-preview-view.table-100.is-readable-line-width .el-table table,.table-100 .el-lang-dataview .dataview.table-view-table,.table-100 .el-lang-dataviewjs .dataview.table-view-table,.table-100 .el-table table{max-width:100%!important;width:100%!important}.markdown-preview-view.table-max .el-lang-dataview .dataview.table-view-table,.markdown-preview-view.table-max .el-lang-dataviewjs .dataview.table-view-table,.markdown-preview-view.table-max .el-table table,.table-max .el-lang-dataview .dataview.table-view-table,.table-max .el-lang-dataviewjs .dataview.table-view-table,.table-max .el-table table{max-width:100%!important}.markdown-preview-view.is-readable-line-width.table-wide .el-lang-dataview .dataview.table-view-table,.markdown-preview-view.is-readable-line-width.table-wide .el-lang-dataviewjs .dataview.table-view-table,.markdown-preview-view.is-readable-line-width.table-wide .el-table table,.table-wide .markdown-preview-view.is-readable-line-width .el-lang-dataview .dataview.table-view-table,.table-wide .markdown-preview-view.is-readable-line-width .el-lang-dataviewjs .dataview.table-view-table,.table-wide .markdown-preview-view.is-readable-line-width .el-table table{max-width:var(--line-width-wide)!important}.table-100 .dataview.table-view-table td:first-child,.table-100 .dataview.table-view-table th:first-child,.table-100 .markdown-source-view.mod-cm6 td:first-child,.table-100 .markdown-source-view.mod-cm6 th:first-child,.table-100 table td:first-child,.table-100 table th:first-child{padding-left:20px}.table-100 .dataview.table-view-table td:last-child,.table-100 .dataview.table-view-table th:last-child,.table-100 table td:last-child,.table-100 table th:last-child{padding-right:20px}.contextual-typography .chart-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography .chart-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography .chart-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography .chart-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography .iframe-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography .iframe-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography .iframe-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography .iframe-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography .img-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography .img-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography .img-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography .img-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography .map-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography .map-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography .map-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography .map-max.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography.chart-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography.chart-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography.chart-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography.chart-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography.iframe-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography.iframe-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography.iframe-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography.iframe-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography.img-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography.img-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography.img-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography.img-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography.map-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography.map-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography.map-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography.map-max .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet{width:100%}.contextual-typography .markdown-preview-view.is-readable-line-width.chart-wide .markdown-preview-sizer>.el-lang-chart,.contextual-typography .markdown-preview-view.is-readable-line-width.iframe-wide .markdown-preview-sizer>.el-iframe,.contextual-typography .markdown-preview-view.is-readable-line-width.img-wide .markdown-preview-sizer>.el-embed-image,.contextual-typography .markdown-preview-view.is-readable-line-width.map-wide .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography.chart-wide .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography.iframe-wide .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography.img-wide .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography.map-wide .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet{width:var(--line-width-wide)}.contextual-typography .markdown-preview-view.iframe-100 .markdown-preview-sizer>.el-iframe,.contextual-typography .markdown-preview-view.img-100 .markdown-preview-sizer>.el-embed-image,.contextual-typography .markdown-preview-view.is-readable-line-width.chart-100 .markdown-preview-sizer>.el-lang-chart,.contextual-typography .markdown-preview-view.is-readable-line-width.map-100 .markdown-preview-sizer>.el-lang-leaflet,.contextual-typography.chart-100 .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-chart,.contextual-typography.iframe-100 .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-iframe,.contextual-typography.img-100 .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-embed-image,.contextual-typography.map-100 .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-leaflet{width:100%;max-width:100%}.is-readable-line-width .el-lang-dataview .dataview.table-view-table,.is-readable-line-width .el-lang-dataviewjs .dataview.table-view-table,.is-readable-line-width .el-table table{max-width:calc(var(--line-width-adaptive) - var(--folding-offset));margin-left:var(--left-margin-table)!important}.chart-100 .el-lang-chart,.chart-max .el-lang-chart,.chart-wide .el-lang-chart,.embed-strict .el-embed-page p,.iframe-100 .el-iframe,.iframe-max .el-iframe,.iframe-wide .el-iframe,.img-100 .el-embed-image,.img-max .el-embed-image,.img-wide .el-embed-image,.map-100 .el-lang-leaflet,.map-max .el-lang-leaflet,.map-wide .el-lang-leaflet,.table-100 .el-lang-dataview,.table-100 .el-lang-dataviewjs,.table-100 .el-table,.table-max .el-lang-dataview,.table-max .el-lang-dataviewjs,.table-max .el-table,.table-wide .el-lang-dataview,.table-wide .el-lang-dataviewjs,.table-wide .el-table{--folding-offset:0px}.chart-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-chart,.chart-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-chart,.img-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>.image-embed,.img-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>img,.img-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>.image-embed,.img-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>img,.map-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-leaflet,.map-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-leaflet,.table-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block.cm-table-widget>div:not(.edit-block-button),.table-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataview,.table-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataviewjs,.table-max .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-table-widget>table,.table-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block.cm-table-widget>div:not(.edit-block-button),.table-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataview,.table-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataviewjs,.table-max.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-table-widget>table{width:var(--max-width)!important;max-width:var(--max-width)!important;transform:none!important;padding-left:0;margin:0 auto!important}.chart-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-chart,.chart-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-chart,.img-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>.image-embed,.img-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>img,.img-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>.image-embed,.img-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>img,.map-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-leaflet,.map-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-leaflet,.table-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block.cm-table-widget>div:not(.edit-block-button),.table-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataview,.table-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataviewjs,.table-wide .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-table-widget>table,.table-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block.cm-table-widget>div:not(.edit-block-button),.table-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataview,.table-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataviewjs,.table-wide.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-table-widget>table{width:var(--line-width-wide)!important;max-width:var(--max-width);transform:none!important;padding-left:0;margin:0 auto!important}.chart-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-chart,.chart-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-chart,.img-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>.image-embed,.img-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>img,.img-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>.image-embed,.img-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-content>img,.map-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-leaflet,.map-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .block-language-leaflet,.table-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block.cm-table-widget>div:not(.edit-block-button),.table-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataview,.table-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataviewjs,.table-100 .markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width table,.table-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block.cm-table-widget>div:not(.edit-block-button),.table-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataview,.table-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width .cm-embed-block>.block-language-dataviewjs,.table-100.markdown-source-view.mod-cm6.is-live-preview.is-readable-line-width table{width:100%!important;max-width:100%!important;transform:none!important;margin:0 auto!important;padding-left:0}@media (max-width:400pt){.markdown-preview-view .el-lang-dataview td:first-child .markdown-preview-view .el-lang-dataviewjs th:first-child,.markdown-preview-view .el-lang-dataview th:first-child,.markdown-preview-view .el-lang-dataviewjs td:first-child,.markdown-preview-view .el-table td:first-child,.markdown-preview-view .el-table th:first-child{padding-left:6vw}.markdown-preview-view .el-lang-dataview td:last-child,.markdown-preview-view .el-lang-dataview th:last-child,.markdown-preview-view .el-lang-dataviewjs td:last-child,.markdown-preview-view .el-lang-dataviewjs th:last-child,.markdown-preview-view .el-table td:last-child,.markdown-preview-view .el-table th:last-child{padding-right:6vw}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-dataview .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-dataviewjs,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-table{padding-left:0;padding-right:0}.markdown-preview-view .table-view-table table,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-dataview .markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-lang-dataviewjs,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>.el-table{width:100%}}@media (max-width:400pt){.is-mobile{--folding-offset:0px}}.markdown-preview-view.wide,.markdown-source-view.wide{--line-width-adaptive:var(--line-width-wide)}.markdown-preview-view.max,.markdown-source-view.max{--line-width-adaptive:300em;--line-width-wide:300em}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer{max-width:var(--max-width);width:var(--line-width-adaptive);padding-left:0}.markdown-source-view.is-readable-line-width .CodeMirror{padding-left:0;padding-right:0;margin:0 auto 0 auto;width:var(--line-width-adaptive);max-width:var(--max-width)}.markdown-reading-view .markdown-preview-view:not(.is-readable-line-width)>.markdown-preview-sizer{max-width:var(--max-width);margin:0 auto;padding-left:var(--folding-offset)}.is-mobile .markdown-source-view.mod-cm6 .cm-gutters{padding-right:0}.minimal-readable-off .view-header-title-container{width:var(--max-width)}.markdown-source-view.mod-cm6:not(.is-readable-line-width) .cm-contentContainer,.markdown-source-view.mod-cm6:not(.is-readable-line-width) .inline-title{max-width:var(--max-width);margin:0 0 0 calc(50% - var(--max-width)/ 2)!important;padding-left:var(--folding-offset)}.markdown-source-view.mod-cm6 .cm-content>.cm-embed-block[contenteditable=false]{overflow-x:auto}.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div,.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div[data-block-language=dataview],.markdown-preview-view.is-readable-line-width .markdown-preview-sizer>div[data-block-language=dataviewjs]{padding-left:var(--folding-offset)}.internal-embed>.markdown-embed,.popover:not(.hover-editor){--folding-offset:0}.markdown-source-view.mod-cm6.is-readable-line-width .inline-title{width:calc(var(--line-width-adaptive) - var(--folding-offset));max-width:calc(var(--max-width) - var(--folding-offset));margin-right:auto;margin-left:max(calc(50% + var(--folding-offset) - var(--line-width-adaptive)/ 2),calc(50% + var(--folding-offset) - var(--max-width)/ 2))!important}.markdown-source-view.mod-cm6.is-readable-line-width .cm-content,.markdown-source-view.mod-cm6.is-readable-line-width .cm-sizer{max-width:100%}.markdown-source-view.mod-cm6.is-readable-line-width .cm-line:not(.HyperMD-table-row){max-width:calc(var(--max-width) - var(--folding-offset))}.is-live-preview.is-readable-line-width .cm-embed-block table.dataview,.is-live-preview.is-readable-line-width.embed-strict .internal-embed .markdown-preview-sizer,.is-readable-line-width .block-language-dataview table.dataview,.is-readable-line-width .block-language-dataviewjs table.dataview,.markdown-preview-view.is-readable-line-width .dataview.result-group .contains-task-list,.markdown-source-view.is-live-preview.is-readable-line-width table.NLT__table{width:100%;max-width:100%;transform:none;margin-left:auto!important}.markdown-source-view.mod-cm6.is-readable-line-width .cm-line.HyperMD-list-line .internal-embed.image-embed,.markdown-source-view.mod-cm6.is-readable-line-width .cm-line>.internal-embed{margin-left:0!important}.markdown-source-view.mod-cm6.is-readable-line-width .cm-content>.image-embed,.markdown-source-view.mod-cm6.is-readable-line-width .cm-content>img:not([width]),.markdown-source-view.mod-cm6.is-readable-line-width .cm-embed-block.cm-callout>.callout,.markdown-source-view.mod-cm6.is-readable-line-width .cm-html-embed,.markdown-source-view.mod-cm6.is-readable-line-width .cm-line,.markdown-source-view.mod-cm6.is-readable-line-width .cm-line.HyperMD-codeblock,.markdown-source-view.mod-cm6.is-readable-line-width .cm-line.HyperMD-quote,.markdown-source-view.mod-cm6.is-readable-line-width .embedded-backlinks,.markdown-source-view.mod-cm6.is-readable-line-width .internal-embed,.markdown-source-view.mod-cm6.is-readable-line-width table{width:calc(var(--line-width-adaptive) - var(--folding-offset));max-width:calc(var(--max-width) - var(--folding-offset));margin-right:auto;margin-left:max(calc(50% + var(--folding-offset) - var(--line-width-adaptive)/ 2),calc(50% + var(--folding-offset) - var(--max-width)/ 2))!important}.markdown-source-view.mod-cm6.is-readable-line-width .cm-line>.cm-html-embed{--folding-offset:0}.markdown-source-view.mod-cm6.is-readable-line-width .cm-content>img[width]{max-width:var(--max-width);margin-left:max(calc(50% + var(--folding-offset) - var(--line-width-adaptive)/ 2),calc(50% + var(--folding-offset) - var(--max-width)/ 2))!important}.markdown-source-view.mod-cm6.is-readable-line-width .cm-embed-block>div,.markdown-source-view.mod-cm6.is-readable-line-width .cm-embed-block>mjx-container,.markdown-source-view.mod-cm6.is-readable-line-width .mod-empty{width:calc(var(--line-width-adaptive) - var(--folding-offset));max-width:calc(var(--max-width) - var(--folding-offset));margin-right:auto;margin-left:max(calc(50% + var(--folding-offset) - var(--line-width-adaptive)/ 2),calc(50% + var(--folding-offset) - var(--max-width)/ 2))!important}.markdown-source-view.mod-cm6.is-readable-line-width .HyperMD-list-line{width:calc(var(--line-width-adaptive) - var(--folding-offset) - var(--list-edit-offset));max-width:calc(var(--max-width) - var(--folding-offset) - var(--list-edit-offset));margin-right:auto;margin-left:max(calc(50% + var(--list-edit-offset) + var(--folding-offset) - var(--line-width-adaptive)/ 2),calc(50% + var(--list-edit-offset) + var(--folding-offset) - var(--max-width)/ 2))!important}body:not(.table-100):not(.table-max):not(.table-wide) .is-live-preview.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.dataview-container>.contains-task-list,body:not(.table-100):not(.table-max):not(.table-wide) .is-live-preview.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.list-view-ul,body:not(.table-100):not(.table-max):not(.table-wide) .is-live-preview.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.result-group>.contains-task-list,body:not(.table-100):not(.table-max):not(.table-wide) .is-live-preview.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview>h4{max-width:100%;margin-right:auto;margin-left:auto;transform:none}body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataview h4,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataview>h4,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs h4,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h1,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h2,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h3,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>h4,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .block-language-dataviewjs>p,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.dataview-container>.contains-task-list,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.dataview-error,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.list-view-ul,body:not(.table-100):not(.table-max):not(.table-wide) .markdown-preview-view.is-readable-line-width:not(.table-100):not(.table-max):not(.table-wide) .dataview.result-group{width:calc(var(--line-width-adaptive) - var(--folding-offset));max-width:var(--max-width);margin-right:auto;margin-left:auto}.is-live-preview.is-readable-line-width .block-language-dataviewjs h4,.is-live-preview.is-readable-line-width .dataview .contains-task-list,.is-live-preview.is-readable-line-width .dataview.dataview-container .contains-task-list,.is-live-preview.is-readable-line-width .dataview.list-view-ul,.is-live-preview.is-readable-line-width .dataview>h4{--folding-offset:10px;width:calc(var(--line-width-adaptive) - var(--folding-offset));max-width:calc(100% - var(--folding-offset));transform:translateX(calc(var(--folding-offset)/2));margin-right:auto;margin-left:auto}.table-100 .is-live-preview.is-readable-line-width .dataview .contains-task-list,.table-100 .is-live-preview.is-readable-line-width .dataview.list-view-ul,.table-100 .is-live-preview.is-readable-line-width .dataview>h4,.table-100.is-live-preview.is-readable-line-width .dataview .contains-task-list,.table-100.is-live-preview.is-readable-line-width .dataview.list-view-ul,.table-100.is-live-preview.is-readable-line-width .dataview>h4{max-width:calc(var(--max-width) - var(--folding-offset))}.markdown-preview-view.is-readable-line-width .block-language-dataview h4,.markdown-preview-view.is-readable-line-width .block-language-dataview>h4,.markdown-preview-view.is-readable-line-width .block-language-dataviewjs h4,.markdown-preview-view.is-readable-line-width .block-language-dataviewjs>h1,.markdown-preview-view.is-readable-line-width .block-language-dataviewjs>h2,.markdown-preview-view.is-readable-line-width .block-language-dataviewjs>h3,.markdown-preview-view.is-readable-line-width .block-language-dataviewjs>h4,.markdown-preview-view.is-readable-line-width .block-language-dataviewjs>p,.markdown-preview-view.is-readable-line-width .dataview .contains-task-list,.markdown-preview-view.is-readable-line-width .dataview.dataview-error,.markdown-preview-view.is-readable-line-width .dataview.list-view-ul,.markdown-preview-view.is-readable-line-width .dataview.result-group{--folding-offset:10px;width:calc(var(--line-width-adaptive) - var(--folding-offset));max-width:calc(var(--max-width) - var(--folding-offset));margin-left:auto;margin-right:max(calc(50% - var(--line-width-adaptive)/ 2),calc(50% - var(--max-width)/ 2))}body:not(.links-int-on){--link-decoration:none}body:not(.links-ext-on){--link-external-decoration:none}.tabs-square .mod-root{--tab-curve:0;--tab-radius:0;--tab-radius-active:0}.tabs-underline .mod-root{--tab-curve:0;--tab-radius:0;--tab-radius-active:0;--tab-outline-width:0px;--tab-background-active:transparent}.tabs-underline .mod-root .workspace-tab-header-container{border-bottom:1px solid var(--divider-color)}.tabs-underline .mod-root .workspace-tab-header{border-bottom:2px solid transparent}.tabs-underline .mod-root .workspace-tab-header:hover{border-bottom:2px solid var(--ui2)}.tabs-underline .mod-root .workspace-tab-header:hover .workspace-tab-header-inner{background-color:transparent}.tabs-underline .mod-root .workspace-tab-header.is-active{border-bottom:2px solid var(--ax3)}.tabs-underline .mod-root .workspace-tab-header-inner:hover{background-color:transparent}.workspace>.workspace-split:not(.mod-root) .workspace-tabs:not(.mod-top) .workspace-tab-header-container{--tab-outline-width:0}.full-file-names{--nav-item-white-space:normal}body:not(.full-file-names) .tree-item-inner{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.theme-dark,.theme-light{--h1l:var(--ui1);--h2l:var(--ui1);--h3l:var(--ui1);--h4l:var(--ui1);--h5l:var(--ui1);--h6l:var(--ui1)}.h1-l .markdown-reading-view h1:not(.embedded-note-title),.h1-l .mod-cm6 .cm-editor .HyperMD-header-1{border-bottom:1px solid var(--h1l);padding-bottom:.4em;margin-block-end:0.6em}.h2-l .markdown-reading-view h2,.h2-l .mod-cm6 .cm-editor .HyperMD-header-2{border-bottom:1px solid var(--h2l);padding-bottom:.4em;margin-block-end:0.6em}.h3-l .markdown-reading-view h3,.h3-l .mod-cm6 .cm-editor .HyperMD-header-3{border-bottom:1px solid var(--h3l);padding-bottom:.4em;margin-block-end:0.6em}.h4-l .markdown-reading-view h4,.h4-l .mod-cm6 .cm-editor .HyperMD-header-4{border-bottom:1px solid var(--h4l);padding-bottom:.4em;margin-block-end:0.6em}.h5-l .markdown-reading-view h5,.h5-l .mod-cm6 .cm-editor .HyperMD-header-5{border-bottom:1px solid var(--h5l);padding-bottom:.4em;margin-block-end:0.6em}.h6-l .markdown-reading-view h6,.h6-l .mod-cm6 .cm-editor .HyperMD-header-6{border-bottom:1px solid var(--h6l);padding-bottom:.4em;margin-block-end:0.6em}.is-tablet .workspace-drawer:not(.is-pinned){margin:30px 16px 0;height:calc(100vh - 48px);border-radius:15px;border:none}.is-tablet .workspace-drawer-ribbon{background-color:var(--background-primary);border-right:1px solid var(--background-modifier-border)}.backlink-pane>.tree-item-self,.backlink-pane>.tree-item-self:hover,.outgoing-link-pane>.tree-item-self,.outgoing-link-pane>.tree-item-self:hover{color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em;font-size:var(--font-adaptive-smallest);font-weight:500}.is-mobile .nav-folder.mod-root>.nav-folder-title .nav-folder-title-content{display:none}body:not(.is-mobile) .nav-folder.mod-root>.nav-folder-title .nav-folder-title-content{font-weight:500;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-size:var(--font-adaptive-smallest)}.nav-buttons-container{justify-content:flex-start}.is-mobile .mod-publish .modal-content{display:unset;padding:10px 10px 10px;margin-bottom:120px;overflow-x:hidden}.is-mobile .mod-publish .button-container,.is-mobile .modal.mod-publish .modal-button-container{padding:10px 15px 30px;margin-left:0;left:0}.is-mobile .modal.mod-publish .modal-title{padding:10px 20px;margin:0 -10px;border-bottom:1px solid var(--background-modifier-border)}.is-mobile .publish-site-settings-container{margin-right:0;padding:0}.is-mobile .modal.mod-publish .modal-content .publish-sections-container{margin-right:0;padding-right:0}@media (max-width:400pt){.is-mobile .publish-changes-info,.is-mobile .publish-section-header{flex-wrap:wrap;border:none}.is-mobile .publish-changes-info .publish-changes-add-linked-btn{flex-basis:100%;margin-top:10px}.is-mobile .publish-section-header-text{flex-basis:100%;margin-bottom:10px;margin-left:20px;margin-top:-8px}.is-mobile .publish-section{background:var(--background-secondary);border-radius:10px;padding:12px 12px 1px}.is-mobile .publish-changes-switch-site{flex-grow:0;margin-right:10px}}.release-notes-view .cm-scroller.is-readable-line-width{width:var(--line-width-adaptive);max-width:var(--max-width);margin:0 auto}@media (max-width:400pt){.is-mobile .modal.mod-sync-log{width:100vw;height:100vh;max-height:calc(100vh - 32px);box-shadow:0 -32px 0 32px var(--background-primary);bottom:0;padding-bottom:10px}}.obsidian-banner.solid{border-bottom:var(--divider-width) solid var(--divider-color)}.contextual-typography .markdown-preview-view div.has-banner-icon.obsidian-banner-wrapper{overflow:visible}.theme-dark .markdown-preview-view img.emoji{opacity:1}body.theme-dark .button-default,body.theme-light .button-default{border:none;box-shadow:none;height:var(--input-height);background:var(--background-modifier-hover);color:var(--text-normal);font-size:revert;font-weight:500;transform:none;transition:all .1s linear;padding:0 20px}body.theme-dark .button-default:hover,body.theme-light .button-default:hover{border:none;background:var(--background-modifier-border-hover);box-shadow:none;transform:none;transition:all .1s linear}body.theme-dark .button-default:active,body.theme-dark .button-default:focus,body.theme-light .button-default:active,body.theme-light .button-default:focus{box-shadow:none}body .button-default.blue{background-color:var(--blue)!important}.button-default.red{background-color:var(--red)!important}.button-default.green{background-color:var(--green)!important}.button-default.yellow{background-color:var(--yellow)!important}.button-default.purple{background-color:var(--purple)!important}.workspace-leaf-content[data-type=calendar] .view-content{padding:5px 0 0 0}#calendar-container{padding:0 var(--size-4-4) var(--size-4-1);--color-background-day-empty:var(--background-secondary-alt);--color-background-day-active:var(--background-modifier-hover);--color-background-day-hover:var(--background-modifier-hover);--color-dot:var(--text-faint);--color-text-title:var(--text-normal);--color-text-heading:var(--text-muted);--color-text-day:var(--text-normal);--color-text-today:var(--text-normal);--color-arrow:var(--text-faint);--color-background-day-empty:transparent}#calendar-container .table{border-collapse:separate;table-layout:fixed}#calendar-container h2{font-weight:400;font-size:var(--h2)}.mod-root #calendar-container{width:var(--line-width-adaptive);max-width:var(--max-width);margin:0 auto;padding:0}#calendar-container .arrow{cursor:var(--cursor);width:22px;border-radius:4px;padding:3px 7px}#calendar-container .arrow svg{width:12px;height:12px;color:var(--text-faint);opacity:.7}#calendar-container .arrow:hover{fill:var(--text-muted);color:var(--text-muted);background-color:var(--background-modifier-hover)}#calendar-container .arrow:hover svg{color:var(--text-muted);opacity:1}#calendar-container tr th{padding:2px 0 4px;font-weight:500;letter-spacing:.1em;font-size:var(--font-adaptive-smallest)}#calendar-container tr td{padding:2px 0 0 0;border-radius:var(--radius-m);cursor:var(--cursor);border:1px solid transparent;transition:none}#calendar-container .nav{padding:0;margin:var(--size-4-2) var(--size-4-1)}#calendar-container .dot{margin:0}#calendar-container .month,#calendar-container .title,#calendar-container .year{font-size:var(--font-adaptive-normal);font-weight:400;color:var(--text-normal)}#calendar-container .today,#calendar-container .today.active{color:var(--text-accent);font-weight:600}#calendar-container .today .dot,#calendar-container .today.active .dot{fill:var(--text-accent)}#calendar-container .active .task{stroke:var(--text-faint)}#calendar-container .active{color:var(--text-normal)}#calendar-container .reset-button{text-transform:none;letter-spacing:0;font-size:var(--font-adaptive-smaller);font-weight:500;color:var(--text-muted);border-radius:4px;margin:0;padding:2px 8px}#calendar-container .reset-button:hover{color:var(--text-normal);background-color:var(--background-modifier-hover)}#calendar-container .day,#calendar-container .reset-button{cursor:var(--cursor)}#calendar-container .day.adjacent-month{color:var(--text-faint);opacity:1}#calendar-container .day{padding:2px 4px 4px;font-size:calc(var(--font-adaptive-normal) - 2px)}#calendar-container .active,#calendar-container .active.today,#calendar-container .day:hover,#calendar-container .week-num:hover{background-color:var(--color-background-day-active)}#calendar-container .active .dot{fill:var(--text-faint)}#calendar-container .active .task{stroke:var(--text-faint)}.block-language-chart canvas,.block-language-dataviewjs canvas{margin:1em 0}.theme-dark,.theme-light{--chart-color-1:var(--blue);--chart-color-2:var(--red);--chart-color-3:var(--yellow);--chart-color-4:var(--green);--chart-color-5:var(--orange);--chart-color-6:var(--purple);--chart-color-7:var(--cyan);--chart-color-8:var(--pink)}.checklist-plugin-main .group .classic,.checklist-plugin-main .group .compact,.checklist-plugin-main .group .page,.checklist-plugin-main .group svg{cursor:var(--cursor)}.workspace .view-content .checklist-plugin-main{padding:10px 10px 15px 15px;--todoList-togglePadding--compact:2px;--todoList-listItemMargin--compact:2px}.checklist-plugin-main .title{font-weight:400;color:var(--text-muted);font-size:var(--font-adaptive-small)}.checklist-plugin-main .group svg{fill:var(--text-faint)}.checklist-plugin-main .group svg:hover{fill:var(--text-normal)}.checklist-plugin-main .group .title:hover{color:var(--text-normal)}.checklist-plugin-main .group:not(:last-child){border-bottom:1px solid var(--background-modifier-border)}.checklist-plugin-main .group{padding:0 0 2px 0}.checklist-plugin-main .group .classic:last-child,.checklist-plugin-main .group .compact:last-child{margin-bottom:10px}.checklist-plugin-main .group .classic,.checklist-plugin-main .group .compact{font-size:var(--font-adaptive-small)}.checklist-plugin-main .group .classic,.checklist-plugin-main .group .compact{background:0 0;border-radius:0;margin:1px auto;padding:0}.checklist-plugin-main .group .classic .content{padding:0}.checklist-plugin-main .group .classic:hover,.checklist-plugin-main .group .compact:hover{background:0 0}.markdown-preview-view.checklist-plugin-main ul>li:not(.task-list-item)::before{display:none}.checklist-plugin-main .group .compact>.toggle .checked{background:var(--text-accent);top:-1px;left:-1px;height:18px;width:18px}.checklist-plugin-main .compact .toggle:hover{opacity:1!important}.checklist-plugin-main .group .count{font-size:var(--font-adaptive-smaller);padding:0;background:0 0;font-weight:400;color:var(--text-faint)}.checklist-plugin-main .group .group-header:hover .count{color:var(--text-muted)}.checklist-plugin-main .group .checkbox{border:1px solid var(--background-modifier-border-hover);min-height:18px;min-width:18px;height:18px;width:18px}.checklist-plugin-main .group .checkbox:hover{border:1px solid var(--background-modifier-border-focus)}.checklist-plugin-main button:active,.checklist-plugin-main button:focus,.checklist-plugin-main button:hover{box-shadow:none!important}.checklist-plugin-main button.collapse{padding:0}body:not(.is-mobile) .checklist-plugin-main button.collapse svg{width:18px;height:18px}.is-mobile .checklist-plugin-main .group-header .title{flex-grow:1;flex-shrink:0}.is-mobile .checklist-plugin-main button{width:auto}.is-mobile .checklist-plugin-main.markdown-preview-view ul{padding-inline-start:0}.is-mobile .workspace .view-content .checklist-plugin-main{padding-bottom:50px}body #cMenuModalBar{box-shadow:0 2px 20px var(--shadow-color)}body #cMenuModalBar .cMenuCommandItem{cursor:var(--cursor)}body #cMenuModalBar button.cMenuCommandItem:hover{background-color:var(--background-modifier-hover)}.MiniSettings-statusbar-button{padding-top:0;padding-bottom:0}.el-hr hr{margin:1rem 0}.el-p+.el-h1,.el-p+.el-h2{margin-top:.75rem}.el-h1+.el-h1,.el-h1+.el-h2,.el-h2+.el-h2,.el-hr+.el-h1,.el-hr+.el-h2{margin-top:0}.el-lang-dataview+.el-p,.el-lang-dataviewjs+.el-p,.el-ol+.el-lang-dataview,.el-ol+.el-lang-dataviewjs,.el-ol+.el-table,.el-p+.el-table,.el-p:not(.el-lang-dataview)+.el-lang-dataview,.el-p:not(.el-lang-dataviewjs)+.el-lang-dataviewjs,.el-ul+.el-lang-dataview,.el-ul+.el-lang-dataviewjs,.el-ul+.el-table{margin-top:var(--spacing-p)}.el-div+.el-h1,.el-embed-image+.el-p:not(.el-embed-image),.el-iframe+.el-p,.el-lang-leaflet,.el-lang-leaflet+*,.el-p+.el-iframe,.el-p:not(.el-embed-image)+.el-embed-image,.el-pre+.el-h1{margin-top:1rem}.markdown-preview-view .table-view-table>thead>tr>th,body .table-view-table>thead>tr>th{font-weight:400;font-size:var(--table-text-size);color:var(--text-muted);border-bottom:1px solid var(--background-modifier-border);cursor:var(--cursor)}table.dataview ul.dataview-ul{list-style:none;padding-inline-start:0;margin-block-start:0em!important;margin-block-end:0em!important}.markdown-preview-view .table-view-table>tbody>tr>td,.markdown-source-view.mod-cm6 .table-view-table>tbody>tr>td{max-width:var(--max-col-width)}body .dataview.small-text{color:var(--text-faint)}body:not(.row-hover) .dataview.task-list-basic-item:hover,body:not(.row-hover) .dataview.task-list-item:hover,body:not(.row-hover) .table-view-table>tbody>tr:hover{background-color:transparent!important;box-shadow:none}body.row-hover .dataview.task-list-basic-item:hover,body.row-hover .dataview.task-list-item:hover,body.row-hover .table-view-table>tbody>tr:hover{background-color:var(--table-row-background-hover)!important}body .dataview-error{margin-top:16px;background-color:transparent}.dataview.dataview-error,.markdown-source-view.mod-cm6 .cm-content .dataview.dataview-error{color:var(--text-muted)}body div.dataview-error-box{min-height:0;border:none;background-color:transparent;font-size:var(--table-text-size);border-radius:var(--radius-m);padding:15px 0}body div.dataview-error-box p{margin-block-start:0;margin-block-end:0;color:var(--text-faint)}.markdown-source-view div.dataview-error-box{margin-top:15px}.trim-cols .markdown-preview-view .table-view-table>tbody>tr>td,.trim-cols .markdown-source-view.mod-cm6 .table-view-table>tbody>tr>td,.trim-cols .markdown-source-view.mod-cm6 .table-view-table>thead>tr>th{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}ul .dataview .task-list-basic-item:hover,ul .dataview .task-list-item:hover{background-color:transparent;box-shadow:none}body .dataview.result-group{padding-left:0}body .dataview .inline-field-standalone-value,body .dataview.inline-field-key,body .dataview.inline-field-value{font-family:var(--font-text);font-size:calc(var(--font-adaptive-normal) - 2px);background:0 0;color:var(--text-muted)}body .dataview.inline-field-key{padding:0}body .dataview .inline-field-standalone-value{padding:0}body .dataview.inline-field-key::after{margin-left:3px;content:"|";color:var(--background-modifier-border)}body .dataview.inline-field-value{padding:0 1px 0 3px}.markdown-preview-view .block-language-dataview table.calendar th{border:none;cursor:default;background-image:none}.markdown-preview-view .block-language-dataview table.calendar .day{font-size:var(--font-adaptive-small)}.workspace-leaf-content .view-content.dictionary-view-content{padding:0}div[data-type=dictionary-view] .contents{padding-bottom:2rem}div[data-type=dictionary-view] .results>.container{background-color:transparent;margin-top:0;max-width:none;padding:0 10px}div[data-type=dictionary-view] .error,div[data-type=dictionary-view] .errorDescription{text-align:left;font-size:var(--font-adaptive-small);padding:10px 12px 0;margin:0}div[data-type=dictionary-view] .results>.container h3{text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);font-size:var(--font-adaptive-smallest);font-weight:500;padding:5px 7px 0 2px;margin-bottom:6px}div[data-type=dictionary-view] .container .main{border-radius:0;background-color:transparent;font-size:var(--font-adaptive-smaller);line-height:1.3;color:var(--text-muted);padding:5px 0 0}div[data-type=dictionary-view] .main .definition{padding:10px;border:1px solid var(--background-modifier-border);border-radius:5px;margin:10px 0 5px;background-color:var(--background-primary)}div[data-type=dictionary-view] .main .definition:last-child{border:1px solid var(--background-modifier-border)}div[data-type=dictionary-view] .main .synonyms{padding:10px 0 0}div[data-type=dictionary-view] .main .synonyms p{margin:0}div[data-type=dictionary-view] .main .definition>blockquote{margin:0}div[data-type=dictionary-view] .main .label{color:var(--text-normal);margin-bottom:2px;font-size:var(--font-adaptive-smaller);font-weight:500}div[data-type=dictionary-view] .main .mark{color:var(--text-normal);background-color:var(--text-selection);box-shadow:none}div[data-type=dictionary-view] .main>.opener{font-size:var(--font-adaptive-small);color:var(--text-normal);padding-left:5px}body .excalidraw,body .excalidraw.theme--dark{--color-primary-light:var(--text-selection);--color-primary:var(--interactive-accent);--color-primary-chubb:var(--interactive-accent-hover);--color-primary-darker:var(--interactive-accent-hover);--color-primary-darkest:var(--interactive-accent-hover);--ui-font:var(--font-interface);--island-bg-color:var(--background-secondary);--button-gray-1:var(--background-modifier-hover);--button-gray-2:var(--background-modifier-hover);--focus-highlight-color:var(--background-modifier-border-focus);--default-bg-color:var(--background-primary);--input-border-color:var(--background-modifier-border);--link-color:var(--text-accent);--overlay-bg-color:rgba(255, 255, 255, 0.88);--text-primary-color:var(--text-normal)}.workspace-leaf-content[data-type=excalidraw] .view-header .view-header-title-container{width:auto}body .excalidraw .App-toolbar-container .ToolIcon_type_floating:not(.is-mobile) .ToolIcon__icon{box-shadow:none}body .excalidraw .buttonList label,body .excalidraw button{cursor:var(--cursor)}body .excalidraw .Dialog__title{font-variant:normal}body .excalidraw .HintViewer,body .excalidraw .reset-zoom-button{color:var(--text-muted);font-size:var(--font-adaptive-smaller)}body .excalidraw .reset-zoom-button{padding-left:1em;padding-right:1em}body .excalidraw .HintViewer>span{background-color:transparent}body .excalidraw button:hover{box-shadow:none}body .excalidraw .Island{box-shadow:none;border:1px solid var(--background-modifier-border)}body .excalidraw .ToolIcon{cursor:var(--cursor);font-family:var(--font-interface);background-color:transparent}body .excalidraw label.ToolIcon{cursor:var(--cursor);background-color:transparent}.git-view-body .opener{text-transform:uppercase;letter-spacing:.05em;font-size:var(--font-adaptive-smallest);font-weight:500;padding:5px 7px 5px 10px;margin-bottom:6px}.git-view-body .file-view .opener{text-transform:none;letter-spacing:normal;font-size:var(--font-adaptive-smallest);font-weight:400;padding:initial;margin-bottom:0}.git-view-body .file-view .opener .collapse-icon{display:flex!important;margin-left:-7px}.git-view-body{margin-top:6px}.git-view-body .file-view{margin-left:4px}.git-view-body .file-view main:hover{color:var(--text-normal)}.git-view-body .file-view .tools .type{display:none!important}.git-view-body .file-view .tools{opacity:0;transition:opacity .1s}.git-view-body .file-view main:hover>.tools{opacity:1}.git-view-body .staged{margin-bottom:12px}.git-view-body .opener.open{color:var(--text-normal)}div[data-type=git-view] .search-input-container{margin-left:0;width:100%}.git-view-body .opener .collapse-icon{display:none!important}.git-view-body main{background-color:var(--background-primary)!important;width:initial!important}.git-view-body .file-view>main:not(.topLevel){margin-left:7px}div[data-type=git-view] .commit-msg{min-height:2.5em!important;height:2.5em!important;padding:6.5px 8px!important}div[data-type=git-view] .search-input-clear-button{bottom:5.5px}.mod-macos.hider-frameless .workspace-ribbon{border:none}.hider-ribbon:not(.is-mobile) .workspace-ribbon-collapse-btn{display:none}.hider-ribbon:not(.is-mobile) .workspace-ribbon.mod-right{pointer-events:none}.hider-ribbon:not(.is-mobile) .workspace-ribbon.mod-left{position:absolute;border-right:0px;margin:0;height:var(--header-height);overflow:visible;flex-basis:0;bottom:0;top:auto;display:flex!important;flex-direction:row;z-index:17;opacity:0;transition:opacity .25s ease-in-out;filter:drop-shadow(2px 10px 30px rgba(0,0,0,.2));gap:0}.hider-ribbon:not(.is-mobile) .side-dock-actions,.hider-ribbon:not(.is-mobile) .side-dock-settings{flex-direction:row;display:flex;border-top:var(--border-width) solid var(--background-modifier-border);background:var(--background-secondary);margin:0;position:relative;gap:var(--size-2-2)}.hider-ribbon:not(.is-mobile) .side-dock-actions{padding-left:8px}.hider-ribbon:not(.is-mobile) .side-dock-settings{border-right:var(--border-width) solid var(--background-modifier-border);border-top-right-radius:var(--radius-m);padding:0 var(--size-2-2)}.hider-ribbon:not(.is-mobile) .workspace-ribbon.mod-left .side-dock-ribbon-action{display:flex;margin:7px 0 8px}.hider-ribbon:not(.is-mobile) .workspace-ribbon.mod-left:hover{opacity:1;transition:opacity .25s ease-in-out}.hider-ribbon:not(.is-mobile) .workspace-ribbon.mod-left .workspace-ribbon-collapse-btn{opacity:0}.hider-ribbon:not(.is-mobile) .workspace-split.mod-left-split{margin:0}.hider-ribbon:not(.is-mobile) .workspace-leaf-content .item-list{padding-bottom:40px}.hider-ribbon .workspace-ribbon{padding:0}.popover.hover-editor{--folding-offset:10px}.theme-dark,.theme-light{--he-title-bar-inactive-bg:var(--background-secondary);--he-title-bar-inactive-pinned-bg:var(--background-secondary);--he-title-bar-active-pinned-bg:var(--background-secondary);--he-title-bar-active-bg:var(--background-secondary);--he-title-bar-inactive-fg:var(--text-muted);--he-title-bar-active-fg:var(--text-normal);--he-title-bar-font-size:14px}.theme-light{--popover-shadow:0px 2.7px 3.1px rgba(0, 0, 0, 0.032),0px 5.9px 8.7px rgba(0, 0, 0, 0.052),0px 10.4px 18.1px rgba(0, 0, 0, 0.071),0px 20px 40px rgba(0, 0, 0, 0.11)}.theme-dark{--popover-shadow:0px 2.7px 3.1px rgba(0, 0, 0, 0.081),0px 5.9px 8.7px rgba(0, 0, 0, 0.131),0px 10.4px 18.1px rgba(0, 0, 0, 0.18),0px 20px 40px rgba(0, 0, 0, 0.28)}.popover.hover-editor:not(.snap-to-viewport){--max-width:92%}.popover.hover-editor:not(.snap-to-viewport) .markdown-preview-view,.popover.hover-editor:not(.snap-to-viewport) .markdown-source-view .cm-content{font-size:90%}body .popover.hover-editor:not(.is-loaded){box-shadow:var(--popover-shadow)}body .popover.hover-editor:not(.is-loaded) .markdown-preview-view{padding:15px 0 0 0}body .popover.hover-editor:not(.is-loaded) .view-content{height:100%;background-color:var(--background-primary)}body .popover.hover-editor:not(.is-loaded) .view-actions{height:auto}body .popover.hover-editor:not(.is-loaded) .popover-content{border:1px solid var(--background-modifier-border-hover)}body .popover.hover-editor:not(.is-loaded) .popover-titlebar{padding:0 4px}body .popover.hover-editor:not(.is-loaded) .popover-titlebar .popover-title{padding-left:4px;letter-spacing:-.02em;font-weight:var(--title-weight)}body .popover.hover-editor:not(.is-loaded) .markdown-embed{height:auto;font-size:unset;line-height:unset}body .popover.hover-editor:not(.is-loaded) .markdown-embed .markdown-preview-view{padding:0}body .popover.hover-editor:not(.is-loaded).show-navbar .popover-titlebar{border-bottom:var(--border-width) solid var(--background-modifier-border)}body .popover.hover-editor:not(.is-loaded) .popover-action,body .popover.hover-editor:not(.is-loaded) .popover-header-icon{cursor:var(--cursor);margin:4px 0;padding:4px 3px;border-radius:var(--radius-m);color:var(--icon-color)}body .popover.hover-editor:not(.is-loaded) .popover-action.mod-pin-popover,body .popover.hover-editor:not(.is-loaded) .popover-header-icon.mod-pin-popover{padding:4px 2px}body .popover.hover-editor:not(.is-loaded) .popover-action svg,body .popover.hover-editor:not(.is-loaded) .popover-header-icon svg{opacity:var(--icon-muted)}body .popover.hover-editor:not(.is-loaded) .popover-action:hover,body .popover.hover-editor:not(.is-loaded) .popover-header-icon:hover{background-color:var(--background-modifier-hover);color:var(--icon-color-hover)}body .popover.hover-editor:not(.is-loaded) .popover-action:hover svg,body .popover.hover-editor:not(.is-loaded) .popover-header-icon:hover svg{opacity:1;transition:opacity .1s ease-in-out}body .popover.hover-editor:not(.is-loaded) .popover-action.is-active,body .popover.hover-editor:not(.is-loaded) .popover-header-icon.is-active{color:var(--icon-color)}body.minimal-dark-black.theme-dark,body.minimal-dark-tonal.theme-dark,body.minimal-light-tonal.theme-light,body.minimal-light-white.theme-light,body.theme-dark{--kanban-border:0px}body:not(.is-mobile) .kanban-plugin__grow-wrap>textarea:focus{box-shadow:none}body:not(.minimal-icons-off) .kanban-plugin svg.cross{height:14px;width:14px}body .kanban-plugin{--kanban-border:var(--border-width);--interactive-accent:var(--text-selection);--interactive-accent-hover:var(--background-modifier-hover);--text-on-accent:var(--text-normal);background-color:var(--background-primary)}body .kanban-plugin__markdown-preview-view{font-family:var(----text)}body .kanban-plugin__board>div{margin:0 auto}body .kanban-plugin__checkbox-label{font-size:var(--font-adaptive-small);color:var(--text-muted)}body .kanban-plugin__item-markdown ul{margin:0}body .kanban-plugin__item-content-wrapper{box-shadow:none}body .kanban-plugin__grow-wrap::after,body .kanban-plugin__grow-wrap>textarea{padding:0;border:0;border-radius:0}body .kanban-plugin__grow-wrap::after,body .kanban-plugin__grow-wrap>textarea,body .kanban-plugin__item-title p,body .kanban-plugin__markdown-preview-view{font-size:calc(var(--font-adaptive-normal) - 2px);line-height:1.3}body .kanban-plugin__item-input-actions button,body .kanban-plugin__lane-input-actions button{font-size:var(--font-adaptive-small)}body .kanban-plugin__item{background-color:var(--background-primary)}body .kanban-plugin__item-title-wrapper{align-items:center}body .kanban-plugin__lane-form-wrapper{border:1px solid var(--background-modifier-border)}body .kanban-plugin__lane-header-wrapper{border-bottom:0}body .kanban-plugin__lane-header-wrapper .kanban-plugin__grow-wrap>textarea,body .kanban-plugin__lane-input-wrapper .kanban-plugin__grow-wrap>textarea,body .kanban-plugin__lane-title p{background:0 0;color:var(--text-normal);font-size:calc(var(--font-adaptive-normal) - 2px);font-weight:500}body .kanban-plugin__item-input-wrapper .kanban-plugin__grow-wrap>textarea{padding:0;border-radius:0;height:auto}body .kanban-plugin__item-form .kanban-plugin__grow-wrap{padding:6px 8px;border-radius:6px;border:1px solid var(--background-modifier-border);background-color:var(--background-primary)}body .kanban-plugin__item-input-wrapper .kanban-plugin__grow-wrap>textarea::placeholder{color:var(--text-faint)}body .kanban-plugin__item .kanban-plugin__item-edit-archive-button,body .kanban-plugin__item button.kanban-plugin__item-edit-button,body .kanban-plugin__item-settings-actions>button,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled,body .kanban-plugin__lane-action-wrapper>button{background:0 0;transition:color .1s ease-in-out}body .kanban-plugin__item .kanban-plugin__item-edit-archive-button:hover,body .kanban-plugin__item button.kanban-plugin__item-edit-button.is-enabled,body .kanban-plugin__item button.kanban-plugin__item-edit-button:hover,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button:hover{color:var(--text-normal);transition:color .1s ease-in-out;background:0 0}body .kanban-plugin__new-lane-button-wrapper{position:fixed;bottom:30px}body .kanban-plugin__lane-items>.kanban-plugin__placeholder:only-child{border:1px dashed var(--background-modifier-border);height:2em}body .kanban-plugin__item-postfix-button-wrapper{align-self:flex-start}body .kanban-plugin__item button.kanban-plugin__item-postfix-button.is-enabled,body .kanban-plugin__item button.kanban-plugin__item-prefix-button.is-enabled,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button.is-enabled{color:var(--text-muted)}body .kanban-plugin button{box-shadow:none;cursor:var(--cursor);height:auto}body .kanban-plugin__item button.kanban-plugin__item-postfix-button:hover,body .kanban-plugin__item button.kanban-plugin__item-prefix-button:hover,body .kanban-plugin__lane button.kanban-plugin__lane-settings-button:hover{background-color:var(--background-modifier-hover)}body .kanban-plugin__item-button-wrapper>button{font-size:var(--font-adaptive-small);color:var(--text-muted);font-weight:400;background:0 0;height:32px}body .kanban-plugin__item-button-wrapper>button:hover{color:var(--text-normal);background:var(--background-modifier-hover)}body .kanban-plugin__item-button-wrapper>button:focus{box-shadow:none}body .kanban-plugin__item-button-wrapper{padding:1px 6px 5px;border-top:none}body .kanban-plugin__lane-setting-wrapper>div:last-child{border:none;margin:0}body .kanban-plugin.something-is-dragging{cursor:grabbing;cursor:-webkit-grabbing}body .kanban-plugin__item.is-dragging{box-shadow:0 5px 30px rgba(0,0,0,.15),0 0 0 2px var(--text-selection)}body .kanban-plugin__lane{background:0 0;padding:0;border:var(--border-width) solid transparent}body .kanban-plugin__lane.is-dragging{box-shadow:0 5px 30px rgba(0,0,0,.15);border:1px solid var(--background-modifier-border)}body .kanban-plugin__lane-items{border:var(--kanban-border) solid var(--background-modifier-border);border-bottom:none;padding:0 4px;border-top-left-radius:8px;border-top-right-radius:8px;margin:0;background-color:var(--background-secondary)}body .kanban-plugin__item-input-wrapper{border:0;padding-top:1px;flex-grow:1}body .kanban-plugin__item-button-wrapper,body .kanban-plugin__item-form{background-color:var(--background-secondary);border:var(--kanban-border) solid var(--background-modifier-border);border-top:none;border-bottom-left-radius:8px;border-bottom-right-radius:8px}body .kanban-plugin__item-form{padding:0 4px 5px}body .kanban-plugin__markdown-preview-view ol,body .kanban-plugin__markdown-preview-view ol.contains-task-list .contains-task-list,body .kanban-plugin__markdown-preview-view ul,body .kanban-plugin__markdown-preview-view ul.contains-task-list .contains-task-list{padding-inline-start:1.8em!important}@media (max-width:400pt){.kanban-plugin__board{flex-direction:column!important}.kanban-plugin__lane{width:100%!important;margin-bottom:1rem!important}}body .cm-heading-marker{cursor:var(--cursor);padding-left:10px}.theme-light{--leaflet-buttons:var(--bg1);--leaflet-borders:rgba(0,0,0,0.1)}.theme-dark{--leaflet-buttons:var(--bg2);--leaflet-borders:rgba(255,255,255,0.1)}.leaflet-top{transition:top .1s linear}.mod-macos.minimal-focus-mode .mod-root .map-100 .markdown-preview-sizer.markdown-preview-section .el-lang-leaflet:nth-child(3) .leaflet-top{top:calc(18px + var(--ewt-traffic-light-y));transition:top .1s linear}body .leaflet-container{background-color:var(--background-secondary);font-family:var(--font-interface)}.map-100 .markdown-preview-sizer.markdown-preview-section .el-lang-leaflet:nth-child(3){margin-top:-16px}.leaflet-control-attribution{display:none}.leaflet-popup-content{margin:10px}.block-language-leaflet{border-radius:var(--radius-m);overflow:hidden;border:var(--border-width) solid var(--background-modifier-border)}.map-wide .block-language-leaflet{border-radius:var(--radius-l)}.map-max .block-language-leaflet{border-radius:var(--radius-xl)}.workspace-leaf-content[data-type=obsidian-leaflet-map-view] .block-language-leaflet{border-radius:0;border:none}.map-100 .block-language-leaflet{border-radius:0;border-left:none;border-right:none}.block-language-leaflet .leaflet-control-expandable-list .input-container .input-item>input{appearance:none}body .block-language-leaflet .leaflet-bar.disabled>a{background-color:transparent;opacity:.3}body .leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}body .leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px}body .leaflet-control-layers-toggle{border-radius:4px}body .block-language-leaflet .leaflet-control-expandable,body .block-language-leaflet .leaflet-control-has-actions .control-actions.expanded,body .block-language-leaflet .leaflet-distance-control,body .leaflet-bar,body .leaflet-bar a,body .leaflet-control-layers-expanded,body .leaflet-control-layers-toggle{background-color:var(--leaflet-buttons);color:var(--text-muted);border:none;user-select:none}body .leaflet-bar a.leaflet-disabled,body .leaflet-bar a.leaflet-disabled:hover{background-color:var(--leaflet-buttons);color:var(--text-faint);opacity:.6;cursor:not-allowed}body .leaflet-control a{cursor:var(--cursor);color:var(--text-normal)}body .leaflet-bar a:hover{background-color:var(--background-modifier-hover);color:var(--text-normal);border:none}body .leaflet-touch .leaflet-control-layers{background-color:var(--leaflet-buttons)}body .leaflet-touch .leaflet-bar,body .leaflet-touch .leaflet-control-layers{border-radius:5px;box-shadow:2px 0 8px 0 rgba(0,0,0,.1);border:1px solid var(--ui1)}body .block-language-leaflet .leaflet-control-has-actions .control-actions{box-shadow:0;border:1px solid var(--ui1)}body .leaflet-control-expandable-list .leaflet-bar{box-shadow:none;border-radius:0}body .block-language-leaflet .leaflet-distance-control{padding:4px 10px;height:auto;cursor:var(--cursor)!important}body .block-language-leaflet .leaflet-marker-link-popup>.leaflet-popup-content-wrapper>*{font-size:var(--font-adaptive-small);font-family:var(--font-interface)}body .block-language-leaflet .leaflet-marker-link-popup>.leaflet-popup-content-wrapper{padding:4px 10px!important}.leaflet-marker-icon svg path{stroke:var(--background-primary);stroke-width:18px}.map-view-marker-name{font-weight:400}.workspace-leaf-content[data-type=map] .graph-controls{background-color:var(--background-primary)}body:not(.is-mobile):not(.plugin-sliding-panes-rotate-header) .workspace-split.mod-root .workspace-leaf-content[data-type=map] .view-header{position:fixed;background:0 0!important;width:100%;z-index:99}body:not(.plugin-sliding-panes-rotate-header) .workspace-leaf-content[data-type=map] .view-header-title{display:none}body:not(.is-mobile):not(.plugin-sliding-panes-rotate-header) .workspace-leaf-content[data-type=map] .view-actions{background:0 0}body:not(.is-mobile):not(.plugin-sliding-panes-rotate-header) .workspace-leaf-content[data-type=map] .view-content{height:100%}body:not(.is-mobile):not(.plugin-sliding-panes-rotate-header) .workspace-leaf-content[data-type=map] .leaflet-top.leaflet-right{top:var(--header-height)}.obsidian-metatable{--metatable-font-size:calc(var(--font-adaptive-normal) - 2px);--metatable-font-family:var(--font-interface);--metatable-background:transparent;--metatable-foreground:var(--text-faint);--metatable-key-background:transparent;--metatable-key-border-width:0;--metatable-key-border-color:transparent;--metatable-value-background:transparent;padding-bottom:.5rem}.obsidian-metatable::part(key),.obsidian-metatable::part(value){border-bottom:0 solid var(--background-modifier-border);padding:.1rem 0;text-overflow:ellipsis;overflow:hidden}.obsidian-metatable::part(key){font-weight:400;color:var(--tx3);font-size:calc(var(--font-adaptive-normal) - 2px)}.obsidian-metatable::part(value){font-size:calc(var(--font-adaptive-normal) - 2px);color:var(--tx1)}body .NLT__header-menu-header-container{font-size:85%}body .NLT__button{background:0 0;box-shadow:none;color:var(--text-muted)}body .NLT__button:active,body .NLT__button:focus,body .NLT__button:hover{background:0 0;color:var(--text-normal);box-shadow:none}.NLT__app .NLT__button{background:0 0;border:1px solid var(--background-modifier-border);box-shadow:0 .5px 1px 0 var(--btn-shadow-color);color:var(--text-muted);padding:2px 8px}.NLT__app .NLT__button:active,.NLT__app .NLT__button:focus,.NLT__app .NLT__button:hover{background:0 0;border-color:var(--background-modifier-border-hover);color:var(--text-normal);box-shadow:0 .5px 1px 0 var(--btn-shadow-color)}.NLT__td:nth-last-child(2),.NLT__th:nth-last-child(2){border-right:0}.NLT__app .NLT__td:last-child,.NLT__app .NLT__th:last-child{padding-right:0}.NLT__app .NLT__th{background-image:none!important}.NLT__app th.NLT__selectable:hover{background-color:transparent;cursor:var(--cursor)}.NLT__menu .NLT__menu-container{background-color:var(--background-secondary)}.NLT__menu .NLT__header-menu-item{font-size:var(--font-adaptive-small)}.NLT__menu .NLT__header-menu{padding:6px 4px}.NLT__menu .NLT__drag-menu{font-size:var(--font-adaptive-small);padding:6px 4px}.NLT__menu svg{color:var(--text-faint);margin-right:6px}.NLT__menu .NLT__selectable:hover,.NLT__menu .NLT__selected{background:0 0}.NLT__menu .NLT__selected>.NLT__selectable{background-color:var(--background-modifier-hover)}.NLT__menu .NLT__selectable{cursor:var(--cursor)}.NLT__menu div.NLT__selectable{min-width:110px;border-radius:var(--radius-m);padding:3px 8px 3px 4px;margin:1px 2px 1px;cursor:var(--cursor);height:auto;line-height:20px}.NLT__menu div.NLT__selectable:hover{background-color:var(--background-modifier-hover)}.NLT__menu .NLT__textarea{font-size:var(--table-text-size)}.NLT__tfoot tr:hover td{background-color:transparent}.modal .quickAddPrompt>h1,.modal .quickAddYesNoPrompt h1{margin-top:0;text-align:left!important;font-size:var(--h1);font-weight:600}.modal .quickAddYesNoPrompt p{text-align:left!important}.modal .quickAddYesNoPrompt button{font-size:var(--font-ui-small)}.modal .yesNoPromptButtonContainer{font-size:var(--font-ui-small);justify-content:flex-end}.quickAddModal .modal-content{padding:20px 2px 5px}div#quick-explorer{display:flex}div#quick-explorer span.explorable{align-items:center;color:var(--text-muted);display:flex;font-size:var(--font-adaptive-smaller);line-height:16px}div#quick-explorer span.explorable:last-of-type{font-size:var(--font-adaptive-smaller)}div#quick-explorer span.explorable.selected,div#quick-explorer span.explorable:hover{background-color:unset!important}div#quick-explorer span.explorable.selected .explorable-name,div#quick-explorer span.explorable:hover .explorable-name{color:var(--text-normal)}div#quick-explorer span.explorable.selected .explorable-separator,div#quick-explorer span.explorable:hover .explorable-separator{color:var(--text-normal)}div#quick-explorer .explorable-name{padding:0 4px;border-radius:4px}div#quick-explorer .explorable-separator::before{content:"\00a0›"!important;font-size:1.3em;font-weight:400;margin:0}body:not(.colorful-active) .qe-popup-menu .menu-item:not(.is-disabled):not(.is-label).selected,body:not(.colorful-active) .qe-popup-menu .menu-item:not(.is-disabled):not(.is-label):hover{background-color:var(--background-modifier-hover);color:var(--text-normal)}body:not(.colorful-active) .qe-popup-menu .menu-item:not(.is-disabled):not(.is-label).selected .menu-item-icon,body:not(.colorful-active) .qe-popup-menu .menu-item:not(.is-disabled):not(.is-label):hover .menu-item-icon{color:var(--text-normal)}.workspace-leaf-content[data-type=recent-files] .view-content{padding-top:10px}.mod-root .workspace-leaf-content[data-type=reminder-list] main{max-width:var(--max-width);margin:0 auto;padding:0}.modal .reminder-actions .later-select{font-size:var(--font-settings-small);vertical-align:bottom;margin-left:3px}.modal .reminder-actions .icon{line-height:1}:not(.mod-root) .workspace-leaf-content[data-type=reminder-list] main{margin:0 auto;padding:15px}:not(.mod-root) .workspace-leaf-content[data-type=reminder-list] main .group-name{font-weight:500;color:var(--text-muted);font-size:var(--font-adaptive-small);padding-bottom:.5em;border-bottom:1px solid var(--background-modifier-border)}:not(.mod-root) .workspace-leaf-content[data-type=reminder-list] main .reminder-group .reminder-list-item{line-height:1.3;font-size:var(--font-adaptive-small)}:not(.mod-root) .workspace-leaf-content[data-type=reminder-list] main .reminder-group .no-reminders{color:var(--text-faint)}:not(.mod-root) .workspace-leaf-content[data-type=reminder-list] main .reminder-group .reminder-time{font-family:var(--font-text);font-size:var(--font-adaptive-small)}:not(.mod-root) .workspace-leaf-content[data-type=reminder-list] main .reminder-group .reminder-file{color:var(--text-faint)}body .modal .dtchooser{background-color:transparent}body .modal .dtchooser .reminder-calendar .year-month{font-weight:400;font-size:var(--font-adaptive-normal);padding-bottom:10px}body .modal .dtchooser .reminder-calendar .year-month .month,body .modal .dtchooser .reminder-calendar .year-month .year{color:var(--text-normal)}body .modal .dtchooser .reminder-calendar .year-month .month-nav:first-child{background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E")}body .modal .dtchooser .reminder-calendar .year-month .month-nav:last-child{background-color:currentColor;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' class='h-5 w-5' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z' clip-rule='evenodd' /%3E%3C/svg%3E")}body .modal .dtchooser .reminder-calendar .year-month .month-nav{-webkit-mask-size:20px 20px;-webkit-mask-repeat:no-repeat;-webkit-mask-position:50% 50%;color:var(--text-faint);cursor:var(--cursor);border-radius:var(--radius-m);padding:0;width:30px;display:inline-block}body .modal .dtchooser .reminder-calendar .year-month .month-nav:hover{color:var(--text-muted)}body .modal .dtchooser .reminder-calendar th{padding:.5em 0;font-size:var(--font-adaptive-smallest);font-weight:500;text-transform:uppercase;letter-spacing:.1em}body .modal .dtchooser .reminder-calendar .calendar-date{transition:background-color .1s ease-in;padding:.3em 0;border-radius:var(--radius-m)}body .modal .dtchooser .reminder-calendar .calendar-date.is-selected,body .modal .dtchooser .reminder-calendar .calendar-date:hover{transition:background-color .1s ease-in;background-color:var(--background-modifier-hover)!important}body .modal .dtchooser .reminder-calendar .calendar-date.is-selected{font-weight:var(--bold-weight);color:var(--text-accent)!important}body .markdown-preview-view th,body .markdown-source-view.mod-cm6 .dataview.table-view-table thead.table-view-thead tr th,body .table-view-table>thead>tr>th{cursor:var(--cursor);background-image:none}.markdown-source-view.mod-cm6 th{background-repeat:no-repeat;background-position:right}.style-settings-container[data-level="2"]{background:var(--background-secondary);border:1px solid var(--ui1);border-radius:5px;padding:10px 20px;margin:2px 0 2px -20px}.workspace-leaf-content[data-type=style-settings] .view-content{padding:var(--size-4-4) 0 var(--size-4-4) var(--folding-offset)}.workspace-leaf-content[data-type=style-settings] .view-content>div{width:var(--line-width-adaptive);max-width:var(--max-width);margin:0 auto}.workspace-leaf-content[data-type=style-settings] .style-settings-heading[data-level="0"] .setting-item-name{padding-left:17px}.workspace-leaf-content[data-type=style-settings] .setting-item{max-width:100%;margin:0 auto}.workspace-leaf-content[data-type=style-settings] .setting-item-name{position:relative}.workspace-leaf-content[data-type=style-settings] .style-settings-collapse-indicator{position:absolute;left:0}.setting-item-heading.style-settings-heading,.style-settings-container .style-settings-heading{cursor:var(--cursor)}.modal.mod-settings .setting-item .pickr button.pcr-button{box-shadow:none;border-radius:40px;height:24px;width:24px}.setting-item .pickr .pcr-button:after,.setting-item .pickr .pcr-button:before{border-radius:40px;box-shadow:none;border:none}.setting-item.setting-item-heading.style-settings-heading.is-collapsed{border-bottom:1px solid var(--background-modifier-border)}.setting-item.setting-item-heading.style-settings-heading{border:0;padding:10px 0 5px;margin-bottom:0}.mod-root .workspace-leaf-content[data-type=style-settings] .style-settings-container .setting-item:not(.setting-item-heading){flex-direction:row;align-items:center;padding:.5em 0}.workspace-split:not(.mod-root) .workspace-leaf-content[data-type=style-settings] .setting-item-name{font-size:var(--font-adaptive-smaller)}.setting-item .style-settings-export,.setting-item .style-settings-import{text-decoration:none;font-size:var(--font-ui-small);font-weight:500;color:var(--text-muted);margin:0;padding:2px 8px;border-radius:5px;cursor:var(--cursor)}.style-settings-export:hover,.style-settings-import:hover{background-color:var(--background-modifier-hover);color:var(--text-normal);cursor:var(--cursor)}.themed-color-wrapper>div+div{margin-top:0;margin-left:6px}.theme-light .themed-color-wrapper>.theme-light{background-color:transparent}.theme-light .themed-color-wrapper>.theme-dark{background-color:rgba(0,0,0,.8)}.theme-dark .themed-color-wrapper>.theme-dark{background-color:transparent}body .todoist-query-title{display:inline;font-size:var(--h4);font-variant:var(--h4-variant);letter-spacing:.02em;color:var(--h4-color);font-weight:var(--h4-weight);font-style:var(--h4-style)}body .is-live-preview .block-language-todoist{padding-left:0}ul.todoist-task-list>li.task-list-item .task-list-item-checkbox{margin:0}body .todoist-refresh-button{display:inline;float:right;background:0 0;padding:5px 6px 0;margin-right:0}body .is-live-preview .todoist-refresh-button{margin-right:30px}body .todoist-refresh-button:hover{box-shadow:none;background-color:var(--background-modifier-hover)}.todoist-refresh-button svg{width:15px;height:15px;opacity:var(--icon-muted)}ul.todoist-task-list{margin-left:-.25em}.is-live-preview ul.todoist-task-list{padding-left:0;margin-left:.5em;margin-block-start:0;margin-block-end:0}.contains-task-list.todoist-task-list .task-metadata{font-size:var(--font-adaptive-small);display:flex;color:var(--text-muted);justify-content:space-between;margin-left:.1em;margin-bottom:.25rem}.is-live-preview .contains-task-list.todoist-task-list .task-metadata{padding-left:calc(var(--checkbox-size) + .6em)}.todoist-task-list .task-date.task-overdue{color:var(--orange)}body .todoist-p1>input[type=checkbox]{border:1px solid var(--red)}body .todoist-p1>input[type=checkbox]:hover{opacity:.8}body .todoist-p2>input[type=checkbox]{border:1px solid var(--yellow)}body .todoist-p2>input[type=checkbox]:hover{opacity:.8}body .todoist-p3>input[type=checkbox]{border:1px solid var(--blue)}body .todoist-p3>input[type=checkbox]:hover{opacity:.8}body.theme-light{--color-axis-label:var(--tx1);--color-tick-label:var(--tx2);--color-dot-fill:var(--ax1);--color-line:var(--ui1)}.tracker-axis-label{font-family:var(--font-interface)}.tracker-axis{color:var(--ui2)}.theme-dark.minimal-atom-dark{--red:#e16d76;--orange:#d19a66;--yellow:#cec167;--green:#98c379;--cyan:#58b6c2;--blue:#62afef;--purple:#c678de;--pink:#e16d76}.theme-light.minimal-atom-light{--red:#e45749;--orange:#b76b02;--yellow:#c18302;--green:#50a150;--cyan:#0d97b3;--blue:#62afef;--purple:#a626a4;--pink:#e45749}.theme-light.minimal-atom-light{--base-h:106;--base-s:0%;--base-l:98%;--accent-h:209;--accent-s:100%;--accent-l:55%;--bg1:#fafafa;--bg2:#eaeaeb;--bg3:#dbdbdc;--ui1:#dbdbdc;--ui2:#d8d8d9;--tx1:#232324;--tx2:#8e8e90;--tx3:#a0a1a8;--ax1:#1a92ff;--ax3:#566de8;--hl1:rgba(180,180,183,0.3);--hl2:rgba(209,154,102,0.35)}.theme-light.minimal-atom-light.minimal-light-white{--bg3:#eaeaeb}.theme-dark.minimal-atom-dark,.theme-light.minimal-atom-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-atom-light.minimal-light-contrast .titlebar,.theme-light.minimal-atom-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-atom-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-atom-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:220;--base-s:12%;--base-l:18%;--accent-h:220;--accent-s:86%;--accent-l:65%;--bg1:#282c34;--bg2:#21252c;--bg3:#3a3f4b;--divider-color:#181a1f;--tab-outline-color:#181a1f;--tx1:#d8dae1;--tx2:#898f9d;--tx3:#5d6370;--ax1:#578af2;--ax3:#578af2;--hl1:rgba(114,123,141,0.3);--hl2:rgba(209,154,102,0.3);--sp1:#fff}.theme-dark.minimal-atom-dark.minimal-dark-black{--base-d:5%;--bg3:#282c34;--divider-color:#282c34;--tab-outline-color:#282c34}.theme-dark.minimal-dracula-dark{--red:#ff5555;--yellow:#f1fa8c;--green:#50fa7b;--orange:#ffb86c;--purple:#bd93f9;--pink:#ff79c6;--cyan:#8be9fd;--blue:#6272a4}.theme-dark.minimal-dracula-dark,.theme-light.minimal-dracula-light.minimal-light-contrast .titlebar,.theme-light.minimal-dracula-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-dracula-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:232;--base-s:16%;--base-l:19%;--accent-h:265;--accent-s:89%;--accent-l:78%;--bg1:#282a37;--bg2:#21222c;--ui2:#44475a;--ui3:#6272a4;--tx1:#f8f8f2;--tx2:#949FBE;--tx3:#6272a4;--hl1:rgba(134, 140, 170, 0.3);--hl2:rgba(189, 147, 249, 0.35)}.theme-dark.minimal-dracula-dark.minimal-dark-black{--ui1:#282a36}.theme-light.minimal-everforest-light{--red:#f85552;--orange:#f57d26;--yellow:#dfa000;--green:#8da101;--purple:#df69ba;--pink:#df69ba;--cyan:#35a77c;--blue:#7fbbb3}.theme-dark.minimal-everforest-dark{--red:#e67e80;--orange:#e69875;--yellow:#dbbc7f;--green:#a7c080;--purple:#d699b6;--pink:#d699b6;--cyan:#83c092;--blue:#7fbbb3}.theme-light.minimal-everforest-light{--base-h:46;--base-s:87%;--base-l:94%;--accent-h:81;--accent-s:37%;--accent-l:52%;--bg1:#FDF7E3;--bg2:#EEEAD5;--bg3:rgba(206,207,182,.5);--ui1:#dfdbc8;--ui2:#bdc3af;--ui3:#bdc3af;--tx1:#5C6A72;--tx2:#829181;--tx3:#a6b0a0;--ax1:#93b259;--ax2:#738555;--ax3:#93b259;--hl1:rgba(198,214,152,.4);--hl2:rgba(222,179,51,.3)}.theme-light.minimal-everforest-light.minimal-light-tonal{--bg2:#EEEAD5}.theme-light.minimal-everforest-light.minimal-light-white{--bg3:#f3efda;--ui1:#edead5}.theme-dark.minimal-everforest-dark,.theme-light.minimal-everforest-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-everforest-light.minimal-light-contrast .titlebar,.theme-light.minimal-everforest-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-everforest-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-everforest-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:203;--base-s:15%;--base-l:23%;--accent-h:81;--accent-s:34%;--accent-l:63%;--bg1:#323D44;--bg2:#2A343A;--bg3:#414C54;--bg3:rgba(78,91,100,0.5);--ui1:#404c51;--ui2:#4A555C;--ui3:#525c62;--tx1:#d3c6aa;--tx2:#9da9a0;--tx3:#7a8478;--ax1:#A7C080;--ax2:#c7cca3;--ax3:#93b259;--hl1:rgba(134,70,93,.5);--hl2:rgba(147,185,96,.3)}.theme-dark.minimal-everforest-dark.minimal-dark-black{--hl1:rgba(134,70,93,.4);--ui1:#2b3339}.theme-dark.minimal-gruvbox-dark,.theme-light.minimal-gruvbox-light{--red:#cc241d;--yellow:#d79921;--green:#98971a;--orange:#d65d0e;--purple:#b16286;--pink:#b16286;--cyan:#689d6a;--blue:#458588}.theme-light.minimal-gruvbox-light{--base-h:49;--base-s:92%;--base-l:89%;--accent-h:24;--accent-s:88%;--accent-l:45%;--bg1:#fcf2c7;--bg2:#f2e6bd;--bg3:#ebd9b3;--ui1:#ebdbb2;--ui2:#d5c4a1;--ui3:#bdae93;--tx1:#282828;--tx2:#7c7065;--tx3:#a89a85;--ax1:#d65d0e;--ax2:#af3a03;--ax3:#d65d0d;--hl1:rgba(192,165,125,.3);--hl2:rgba(215,153,33,.4)}.theme-light.minimal-gruvbox-light.minimal-light-tonal{--bg2:#fcf2c7}.theme-light.minimal-gruvbox-light.minimal-light-white{--bg3:#faf5d7;--ui1:#f2e6bd}.theme-dark.minimal-gruvbox-dark,.theme-light.minimal-gruvbox-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-gruvbox-light.minimal-light-contrast .titlebar,.theme-light.minimal-gruvbox-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-gruvbox-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-gruvbox-light.minimal-light-contrast.minimal-status-off .status-bar{--accent-h:24;--accent-s:88%;--accent-l:45%;--bg1:#282828;--bg2:#1e2021;--bg3:#3d3836;--bg3:rgba(62,57,55,0.5);--ui1:#3c3836;--ui2:#504945;--ui3:#665c54;--tx1:#fbf1c7;--tx2:#bdae93;--tx3:#7c6f64;--ax1:#d65d0e;--ax2:#fe8019;--ax3:#d65d0e;--hl1:rgba(173,149,139,0.3);--hl2:rgba(215,153,33,.4)}.theme-dark.minimal-gruvbox-dark.minimal-dark-black{--hl1:rgba(173,149,139,0.4);--ui1:#282828}.theme-dark.minimal-macos-dark,.theme-light.minimal-macos-light{--red:#ff3b31;--yellow:#ffcc00;--green:#2acd41;--orange:#ff9502;--purple:#b051de;--pink:#ff2e55;--cyan:#02c7be;--blue:#027aff}.theme-light.minimal-macos-light{--base-h:106;--base-s:0%;--base-l:94%;--accent-h:212;--accent-s:100%;--accent-l:50%;--bg1:#fff;--bg2:#f0f0f0;--bg3:#d7d7d7;--ui1:#e7e7e7;--tx1:#454545;--tx2:#808080;--tx3:#b0b0b0;--ax1:#027aff;--ax2:#0463cc;--ax3:#007bff;--hl1:#b3d7ff}.theme-light.minimal-macos-light.minimal-light-tonal{--bg1:#f0f0f0;--bg2:#f0f0f0}.theme-dark.minimal-macos-dark,.theme-light.minimal-macos-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-macos-light.minimal-light-contrast .titlebar,.theme-light.minimal-macos-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-macos-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-macos-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:106;--base-s:0%;--base-l:12%;--accent-h:212;--accent-s:100%;--accent-l:50%;--bg1:#1e1e1e;--bg2:#282828;--bg3:rgba(255,255,255,0.11);--divider-color:#000;--tab-outline-color:#000;--ui1:#373737;--ui2:#515151;--ui3:#595959;--tx1:#dcdcdc;--tx2:#8c8c8c;--tx3:#686868;--ax1:#027aff;--ax2:#3f9bff;--ax3:#007bff;--hl1:rgba(98,169,252,0.5);--sp1:#fff}.theme-dark.minimal-macos-dark.minimal-dark-black{--divider-color:#1e1e1e;--tab-outline-color:#1e1e1e}.theme-dark.minimal-nord-dark,.theme-light.minimal-nord-light{--red:#BF616A;--yellow:#EBCB8B;--green:#A3BE8C;--orange:#D08770;--purple:#B48EAD;--pink:#B48EAD;--cyan:#88C0D0;--blue:#81A1C1}.theme-light.minimal-nord-light{--base-h:221;--base-s:27%;--base-l:94%;--accent-h:213;--accent-s:32%;--accent-l:52%;--bg1:#fff;--bg2:#eceff4;--bg3:rgba(157,174,206,0.25);--ui1:#d8dee9;--ui2:#BBCADC;--ui3:#81a1c1;--tx1:#2e3440;--tx2:#7D8697;--tx3:#ADB1B8;--ax1:#5e81ac;--ax2:#81a1c1;--hl2:rgba(208, 135, 112, 0.35)}.theme-dark.minimal-nord-dark,.theme-light.minimal-nord-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-nord-light.minimal-light-contrast .titlebar,.theme-light.minimal-nord-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-nord-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-nord-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:220;--base-s:16%;--base-l:22%;--accent-h:213;--accent-s:32%;--accent-l:52%;--bg1:#2e3440;--bg2:#3b4252;--bg3:rgba(135,152,190,0.15);--ui1:#434c5e;--ui2:#58647b;--ui3:#5e81ac;--tx1:#d8dee9;--tx2:#9eafcc;--tx3:#4c566a;--ax3:#5e81ac;--hl1:rgba(129,142,180,0.3);--hl2:rgba(208, 135, 112, 0.35)}.theme-dark.minimal-nord-dark.minimal-dark-black{--ui1:#2e3440}.theme-light.minimal-notion-light{--base-h:39;--base-s:18%;--base-d:96%;--accent-h:197;--accent-s:65%;--accent-l:71%;--bg2:#f7f6f4;--bg3:#e8e7e4;--ui1:#ededec;--ui2:#dbdbda;--ui3:#aaa9a5;--tx1:#37352f;--tx2:#72706c;--tx3:#aaa9a5;--ax1:#37352f;--ax2:#000;--ax3:#2eaadc;--hl1:rgba(131,201,229,0.3);--link-weight:500}.theme-dark.minimal-notion-dark,.theme-light.minimal-notion-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-notion-light.minimal-light-contrast .titlebar,.theme-light.minimal-notion-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-notion-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-notion-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:203;--base-s:8%;--base-d:20%;--accent-h:197;--accent-s:48%;--accent-l:43%;--bg1:#2f3437;--bg2:#373c3f;--bg3:#4b5053;--ui1:#3e4245;--ui2:#585d5f;--ui3:#585d5f;--tx1:#ebebeb;--tx2:#909295;--tx3:#585d5f;--ax1:#ebebeb;--ax2:#fff;--ax3:#2eaadc;--hl1:rgba(57,134,164,0.3);--link-weight:500}.theme-dark.minimal-notion-dark.minimal-dark-black{--base-d:5%;--bg3:#232729;--ui1:#2f3437}.theme-dark.minimal-solarized-dark,.theme-light.minimal-solarized-light{--red:#dc322f;--orange:#cb4b16;--yellow:#b58900;--green:#859900;--cyan:#2aa198;--blue:#268bd2;--purple:#6c71c4;--pink:#d33682}.theme-light.minimal-solarized-light{--base-h:44;--base-s:87%;--base-l:94%;--accent-h:205;--accent-s:70%;--accent-l:48%;--bg1:#fdf6e3;--bg2:#eee8d5;--bg3:rgba(0,0,0,0.062);--ui1:#e9e1c8;--ui2:#d0cab8;--ui3:#d0cab8;--tx1:#073642;--tx2:#586e75;--tx3:#ABB2AC;--tx4:#586e75;--ax1:#268bd2;--hl1:rgba(202,197,182,0.3);--hl2:rgba(203,75,22,0.3)}.theme-light.minimal-solarized-light.minimal-light-tonal{--bg2:#fdf6e3}.theme-dark.minimal-solarized-dark,.theme-light.minimal-solarized-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-solarized-light.minimal-light-contrast .titlebar,.theme-light.minimal-solarized-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-solarized-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-solarized-light.minimal-light-contrast.minimal-status-off .status-bar{--accent-h:205;--accent-s:70%;--accent-l:48%;--base-h:193;--base-s:98%;--base-l:11%;--bg1:#002b36;--bg2:#073642;--bg3:rgba(255,255,255,0.062);--ui1:#19414B;--ui2:#274850;--ui3:#31535B;--tx1:#93a1a1;--tx2:#657b83;--tx3:#31535B;--tx4:#657b83;--ax1:#268bd2;--ax3:#268bd2;--hl1:rgba(15,81,98,0.3);--hl2:rgba(203, 75, 22, 0.35)}.theme-dark.minimal-solarized-dark.minimal-dark-black{--hl1:rgba(15,81,98,0.55);--ui1:#002b36}.theme-dark.minimal-things-dark,.theme-light.minimal-things-light{--red:#FF306C;--yellow:#FFD500;--green:#4BBF5E;--orange:#ff9502;--purple:#b051de;--pink:#ff2e55;--cyan:#49AEA4}.theme-light.minimal-things-light{--blue:#1b61c2}.theme-dark.minimal-things-dark{--blue:#4d95f7}.theme-light.minimal-things-light{--accent-h:215;--accent-s:76%;--accent-l:43%;--bg1:white;--bg2:#f5f6f8;--bg3:rgba(162,177,187,0.25);--ui1:#eef0f4;--ui2:#D8DADD;--ui3:#c1c3c6;--tx1:#26272b;--tx2:#7D7F84;--tx3:#a9abb0;--ax1:#1b61c2;--ax2:#1C88DD;--ax3:#1b61c2;--hl1:#cae2ff}.theme-light.minimal-things-light.minimal-light-tonal{--ui1:#e6e8ec}.theme-light.minimal-things-light.minimal-light-white{--bg3:#f5f6f8}.theme-dark.minimal-things-dark,.theme-light.minimal-things-light.minimal-light-contrast .mod-left-split,.theme-light.minimal-things-light.minimal-light-contrast .titlebar,.theme-light.minimal-things-light.minimal-light-contrast .workspace-drawer.mod-left,.theme-light.minimal-things-light.minimal-light-contrast .workspace-ribbon.mod-left:not(.is-collapsed),.theme-light.minimal-things-light.minimal-light-contrast.minimal-status-off .status-bar{--base-h:218;--base-s:9%;--base-l:15%;--accent-h:215;--accent-s:91%;--accent-l:64%;--bg1:#24262a;--bg2:#202225;--bg3:#3d3f41;--divider-color:#17191c;--tab-outline-color:#17191c;--ui1:#3A3B3F;--ui2:#45464a;--ui3:#6c6e70;--tx1:#fbfbfb;--tx2:#CBCCCD;--tx3:#6c6e70;--ax1:#4d95f7;--ax2:#79a9ec;--ax3:#4d95f7;--hl1:rgba(40,119,236,0.35);--sp1:#fff}.theme-dark.minimal-things-dark.minimal-dark-black{--base-d:5%;--bg3:#24262a;--divider-color:#24262a;--tab-outline-color:#24262a} +/* Plugin compatibility */ + +/* @plugins +core: +- backlink +- command-palette +- daily-notes +- file-explorer +- file-recovery +- global-search +- graph +- outgoing-link +- outline +- page-preview +- publish +- random-note +- starred +- switcher +- sync +- tag-pane +- word-count +community: +- buttons +- dataview +- calendar +- obsidian-charts +- obsidian-checklist-plugin +- obsidian-codemirror-options +- obsidian-dictionary-plugin +- obsidian-embedded-note-titles +- obsidian-excalidraw-plugin +- obsidian-git +- obsidian-hider +- obsidian-hover-editor +- obsidian-kanban +- obsidian-metatable +- obsidian-minimal-settings +- obsidian-outliner +- obsidian-system-dark-mode +- obsidian-style-settings +- quickadd +- sliding-panes-obsidian +- todoist-sync-plugin +*/ +/* @settings + +name: Minimal +id: minimal-style +settings: + - + id: instructions + title: Welcome 👋 + type: heading + level: 2 + collapsed: true + description: Use the Minimal Theme Settings plugin to access hotkeys, adjust features, select fonts, and choose from preset color schemes. Use the settings below for more granular customization. Visit minimal.guide for documentation. + - + id: interface + title: Interface colors + type: heading + level: 2 + collapsed: true + - + id: base + title: Base color + description: Defines all background and border colors unless overridden in more granular settings + type: variable-themed-color + format: hsl-split + default-light: '#' + default-dark: '#' + - + id: bg1 + title: Primary background + description: Background color for the main window + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bg2 + title: Secondary background + description: Background color for left sidebar and menus + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bg3 + title: Active background + description: Background color for hovered buttons and currently selected file + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: ui1 + title: Border color + type: variable-themed-color + description: For buttons, divider lines, and outlined elements + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: ui2 + title: Highlighted border color + description: Used when hovering over buttons, dividers, and outlined elements + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: ui3 + title: Active border color + description: Used when clicking buttons and outlined elements + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: extended-palette + title: Interface extended palette + type: heading + level: 2 + collapsed: true + - + id: red + title: Red + description: Extended palette colors are defaults used for progress bar status, syntax highlighting, colorful headings, and graph nodes + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: orange + title: Orange + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: yellow + title: Yellow + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: green + title: Green + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: cyan + title: Cyan + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: blue + title: Blue + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: purple + title: Purple + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: pink + title: Pink + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: active-line + title: Active line + type: heading + level: 2 + collapsed: true + - + id: active-line-on + title: Highlight active line + description: Adds a background to current line in editor + type: class-toggle + default: false + - + id: active-line-bg + title: Active line background + description: Using a low opacity color is recommended to avoid conflicting with highlights + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: blockquotes + title: Blockquotes + type: heading + level: 2 + collapsed: true + - + id: blockquote-color + title: Blockquotes text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: blockquote-size + title: Blockquotes font size + description: Accepts any CSS font-size value + type: variable-text + default: '' + - + id: blockquote-font-style + title: Blockquotes font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: code-blocks + title: Code and syntax highlighting + type: heading + level: 2 + collapsed: true + - + id: code-size + title: Code font size + description: Accepts any CSS font-size value + type: variable-text + default: 13px + - + id: code-background + title: Code background color + description: Background for code blocks + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-normal + title: Code text color + description: Color of code when syntax highlighting is not present + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: syntax-highlighting + title: Syntax highlighting + type: heading + level: 3 + collapsed: false + - + id: code-comment + title: "Syntax: comments" + description: Syntax highlighting for comments + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-function + title: "Syntax: functions" + description: Syntax highlighting for functions + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-keyword + title: "Syntax: keywords" + description: Syntax highlighting for keywords + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-important + title: "Syntax: important" + description: Syntax highlighting for important text + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-property + title: "Syntax: properties" + description: Syntax highlighting for properties + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-punctuation + title: "Syntax: punctuation" + description: Syntax highlighting for punctuation + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-string + title: "Syntax: strings" + description: Syntax highlighting for strings + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-tag + title: "Syntax: tags" + description: Syntax highlighting for tags + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: code-value + title: "Syntax: values" + description: Syntax highlighting for values + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: dataview + title: Dataview + type: heading + level: 2 + collapsed: true + - + id: trim-cols + title: Trim Dataview columns + description: Disables word wrapping in table cells, and trims long text + type: class-toggle + default: true + - + id: max-col-width + title: Dataview maximum column width + description: Maximum width for Dataview columns, accepts any CSS width value + type: variable-text + default: 18em + - + id: embed-blocks + title: Embeds and transclusions + type: heading + level: 2 + collapsed: true + - + id: embed-strict + title: Use strict embed style globally + description: Transclusions appear seamlessly in the flow of text. Can be enabled per file using the embed-strict helper class + type: class-toggle + default: false + - + id: graphs + title: Graphs + type: heading + level: 2 + collapsed: true + - + id: graph-node + title: Node color + description: Changing node colors requires closing and reopening graph panes or restarting Obsidian + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-focused + title: Active node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-tag + title: Tag node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-attachment + title: Attachment node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: graph-node-unresolved + title: Unresolved node color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: headings + title: Headings + type: heading + level: 2 + collapsed: true + - + id: level-1-headings + title: Level 1 Headings + type: heading + level: 3 + collapsed: true + - + id: h1-font + title: H1 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h1-size + title: H1 font size + description: Accepts any CSS font-size value + type: variable-text + default: 1.125em + - + id: h1-weight + title: H1 font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: h1-color + title: H1 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h1-variant + title: H1 font variant + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h1-style + title: H1 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h1-l + title: H1 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-2-headings + title: Level 2 Headings + type: heading + level: 3 + collapsed: true + - + id: h2-font + title: H2 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h2-size + title: H2 font size + description: Accepts any CSS font-size value + type: variable-text + default: 1em + - + id: h2-weight + title: H2 font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: h2-color + title: H2 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h2-variant + title: H2 font variant + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h2-style + title: H2 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h2-l + title: H2 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-3-headings + title: Level 3 Headings + type: heading + level: 3 + collapsed: true + - + id: h3-font + title: H3 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h3-size + title: H3 font size + description: Accepts any CSS font-size value + type: variable-text + default: 1em + - + id: h3-weight + title: H3 font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: h3-color + title: H3 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h3-variant + title: H3 font variant + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h3-style + title: H3 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h3-l + title: H3 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-4-headings + title: Level 4 Headings + type: heading + level: 3 + collapsed: true + - + id: h4-font + title: H4 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h4-size + title: H4 font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.9em + - + id: h4-weight + title: H4 font weight + type: variable-number-slider + default: 500 + min: 100 + max: 900 + step: 100 + - + id: h4-color + title: H4 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h4-variant + title: H4 font variant + type: variable-select + allowEmpty: false + default: small-caps + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h4-style + title: H4 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h4-l + title: H4 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-5-headings + title: Level 5 Headings + type: heading + level: 3 + collapsed: true + - + id: h5-font + title: H5 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h5-size + title: H5 font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.85em + - + id: h5-weight + title: H5 font weight + type: variable-number-slider + default: 500 + min: 100 + max: 900 + step: 100 + - + id: h5-color + title: H5 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h5-variant + title: H5 font variant + type: variable-select + allowEmpty: false + default: small-caps + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h5-style + title: H5 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h5-l + title: H5 divider line + description: Adds a border below the heading + type: class-toggle + default: false + - + id: level-6-headings + title: Level 6 Headings + type: heading + level: 3 + collapsed: true + - + id: h6-font + title: H6 font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: h6-size + title: H6 font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.85em + - + id: h6-weight + title: H6 font weight + type: variable-number-slider + default: 400 + min: 100 + max: 900 + step: 100 + - + id: h6-color + title: H6 text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: h6-variant + title: H6 font variant + type: variable-select + allowEmpty: false + default: small-caps + options: + - + label: Normal + value: normal + - + label: Small caps + value: small-caps + - + label: All small caps + value: all-small-caps + - + id: h6-style + title: H6 font style + type: variable-select + allowEmpty: false + default: normal + options: + - + label: Normal + value: normal + - + label: Italic + value: italic + - + id: h6-l + title: H6 divider line + type: class-toggle + description: Adds a border below the heading + default: false + - + id: icons + title: Icons + type: heading + level: 2 + collapsed: true + - + id: icon-muted + title: Icon opacity (inactive) + type: variable-number-slider + default: 0.5 + min: 0.25 + max: 1 + step: 0.05 + - + id: icon-color + title: Icon color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: icon-color-hover + title: Icon color (hover) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: icon-color-active + title: Icon color (active) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: icon-color-focused + title: Icon color (focused) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: images + title: Images + type: heading + level: 2 + collapsed: true + - + id: image-muted + title: Image opacity in dark mode + description: Level of fading for images in dark mode. Hover over images to display at full brightness. + type: variable-number-slider + default: 0.7 + min: 0.25 + max: 1 + step: 0.05 + - + id: zoom-off + title: Disable image zoom + description: Turns off click + hold to zoom images + type: class-toggle + - + id: indentation-guides + title: Indentation guides + type: heading + level: 2 + collapsed: true + - + id: ig-adjust-reading + title: Horizontal adjustment in reading mode + type: variable-number-slider + default: -0.65 + min: -1.2 + max: 0 + step: 0.05 + format: em + - + id: ig-adjust-edit + title: Horizontal adjustment in edit mode + type: variable-number-slider + default: -1 + min: -10 + max: 10 + step: 1 + format: px + - + id: links + title: Links + type: heading + level: 2 + collapsed: true + - + id: ax1 + title: Link color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: ax2 + title: Link color (hovering) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: link-weight + title: Link font weight + type: variable-number-slider + default: 400 + min: 100 + max: 900 + step: 100 + - + id: lists + title: Lists and tasks + type: heading + level: 2 + collapsed: true + - + id: ax3 + title: Checkbox color + description: Background color for completed tasks + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: checkbox-shape + title: Checkbox shape + type: class-select + allowEmpty: false + default: checkbox-circle + options: + - + label: Circle + value: checkbox-circle + - + label: Square + value: checkbox-square + - + id: minimal-strike-lists + title: Strike completed tasks + description: Adds strikethrough line and greyed text for completed tasks + type: class-toggle + default: false + - + id: list-spacing + title: List item spacing + description: Vertical space between list items in em units + type: variable-number-slider + default: 0.075 + min: 0 + max: 0.3 + step: 0.005 + format: em + - + id: list-indent + title: Nested list indentation + description: Horizontal space from left in em units + type: variable-number-slider + default: 2 + min: 1 + max: 3.5 + step: 0.1 + format: em + - + id: sidebars + title: Sidebars + type: heading + level: 2 + collapsed: true + - + id: sidebar-lines-off + title: Disable sidebar relationship lines + description: Turns off lines in file navigation + type: class-toggle + - + id: mobile-left-sidebar-width + title: Mobile left sidebar width + description: Maximum width for pinned left sidebar on mobile + type: variable-number + default: 280 + format: pt + - + id: mobile-right-sidebar-width + title: Mobile right sidebar width + description: Maximum width for pinned right sidebar on mobile + type: variable-number + default: 240 + format: pt + - + id: tables + title: Tables + type: heading + level: 2 + collapsed: true + - + id: table-text-size + title: Table font size + description: All of the following settings apply to all tables globally. To turn on these features on a per-note basis use helper classes. See documentation. + type: variable-text + default: 1em + - + id: maximize-tables-off + title: Maximize table width (beta) + description: Tables fill the width of the line + type: class-select + allowEmpty: false + default: maximize-tables + options: + - + label: Always + value: maximize-tables + - + label: Automatic + value: maximize-tables-auto + - + label: Never + value: maximize-tables-off + - + id: row-lines + title: Row lines + description: Display borders between table rows globally + type: class-toggle + default: false + - + id: col-lines + title: Column lines + description: Display borders between table columns globally + type: class-toggle + default: false + - + id: table-lines + title: Cell lines + description: Display borders around all table cells globally + type: class-toggle + default: false + - + id: row-alt + title: Striped rows + description: Display striped background in alternating table rows globally + type: class-toggle + default: false + - + id: col-alt + title: Striped columns + description: Display striped background in alternating table columns globally + type: class-toggle + default: false + - + id: table-tabular + title: Tabular figures + description: Use fixed width numbers in tables globally + type: class-toggle + default: false + - + id: table-numbers + title: Row numbers + description: Display row numbers in tables globally + type: class-toggle + default: false + - + id: table-nowrap + title: Disable line wrap + description: Turn off line wrapping in table cells globally + type: class-toggle + default: false + - + id: row-hover + title: Highlight active row + description: Highlight rows on hover + type: class-toggle + default: false + - + id: table-row-background-hover + title: Active row background + description: Background color for hovered tables rows + type: variable-themed-color + format: hex + opacity: true + default-light: '#' + default-dark: '#' + - + id: tabs + title: Tabs + type: heading + level: 2 + collapsed: true + - + id: header-height + title: Tab bar height + type: variable-text + default: 40px + - + id: tabs-style + title: Tab style + type: class-select + allowEmpty: false + default: tabs-default + options: + - + label: Default + value: tabs-default + - + label: Square + value: tabs-square + - + label: Underline + value: tabs-underline + - + id: tab-stacks + title: Tab stacks + type: heading + level: 2 + collapsed: true + - + id: tab-stacked-pane-width + title: Stacked width + type: variable-number + description: Width of a stacked tab in pixels + default: 700 + format: px + - + id: tab-stacked-header-width + title: Spine width + type: variable-number + description: Width of the spine in pixels + default: 40 + format: px + - + id: tab-stacked-spine-orientation + title: Spine text orientation + type: class-select + default: tab-stack-top + options: + - + label: Top aligned + value: tab-stack-top + - + label: Top aligned flipped + value: tab-stack-top-flipped + - + label: Bottom aligned + value: tab-stack-bottom + - + label: Bottom aligned flipped + value: tab-stack-bottom-flipped + - + id: tags + title: Tags + type: heading + level: 2 + collapsed: true + - + id: minimal-unstyled-tags + title: Plain tags + description: Tags will render as normal text, overrides settings below + type: class-toggle + default: false + - + id: tag-radius + title: Tag shape + type: variable-select + default: 14px + options: + - + label: Pill + value: 14px + - + label: Rounded + value: 4px + - + label: Square + value: 0px + - + id: tag-border-width + title: Tag border width + type: variable-select + default: 1px + options: + - + label: None + value: 0 + - + label: Thin + value: 1px + - + label: Thick + value: 2px + - + id: tag-color + title: Tag text color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tag-bg + title: Tag background color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tag-bg2 + title: Tag background color (hover) + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: text + title: Text + type: heading + level: 2 + collapsed: true + - + id: tx1 + title: Normal text color + type: variable-themed-color + description: Primary text color used by default across all elements + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: hl1 + title: Selected text background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: hl2 + title: Highlighted text background + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tx2 + title: Muted text color + description: Secondary text such as sidebar note titles and table headings + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: tx3 + title: Faint text color + description: tertiary text such as input placeholders, empty checkboxes, and disabled statuses + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: italic-color + title: Italic text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bold-color + title: Bold text color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: bold-weight + title: Bold text weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: spacing-p + title: Paragraph spacing + description: Space between paragraphs in reading mode + type: variable-text + default: 0.75em + - + id: titles + title: Titles + type: heading + level: 2 + collapsed: true + - + id: tab-title-bar + title: Tab title bar + description: Tab title bar must be turned on in Appearance settings + type: heading + level: 3 + collapsed: true + - + id: file-header-visibility + title: Tab title visibility + description: Visibility of the tab title text + type: class-select + default: minimal-tab-title-visible + options: + - + label: Visible + value: minimal-tab-title-visible + - + label: Hidden + value: minimal-tab-title-hidden + - + label: Hover only + value: minimal-tab-title-hover + - + id: file-header-font-size + title: Tab title font size + description: Accepts any CSS font-size value + type: variable-text + default: 0.9em + - + id: file-header-font-weight + title: Tab title font weight + type: variable-number-slider + default: 400 + min: 100 + max: 900 + step: 100 + - + id: file-header-justify + title: Tab title alignment + type: variable-select + default: center + options: + - + label: Center + value: center + - + label: Left + value: left + - + id: title-color + title: Tab title text color (active) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: title-color-inactive + title: Tab title color (inactive) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: inline-title + title: Inline title + description: Inline titles must be turned on in Appearance settings + type: heading + level: 3 + collapsed: true + - + id: inline-title-font + title: Inline title font + description: Name of the font as it appears on your system + type: variable-text + default: '' + - + id: inline-title-size + title: Inline title font size + description: Accepts any CSS font-size value + type: variable-text + default: 1.125em + - + id: inline-title-weight + title: Inline title font weight + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 + - + id: inline-title-color + title: Inline title text color (active) + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: translucency + title: Translucency + type: heading + level: 2 + collapsed: true + - + id: workspace-background-translucent + title: Translucent background color + type: variable-themed-color + opacity: true + format: hex + default-light: '#' + default-dark: '#' + - + id: window-frame + title: Window frame + type: heading + level: 2 + collapsed: true + - + id: window-title-off + title: Hide window title + description: Hide title in the custom title bar + type: class-toggle + - + id: frame-background + title: Window frame background + description: Requires colorful window frame + type: variable-themed-color + opacity: true + format: hsl-split + default-light: '#' + default-dark: '#' + - + id: titlebar-text-color-focused + title: Window title color (focused) + description: Requires custom title bar + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: titlebar-text-color + title: Window title color (inactive) + description: Requires custom title bar + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + - + id: titlebar-text-weight + title: Window title font weight + description: Requires custom title bar + type: variable-number-slider + default: 600 + min: 100 + max: 900 + step: 100 +*/ + +/* @settings +name: Minimal Cards +id: minimal-cards-style +settings: + - + id: cards-min-width + title: Card minimum width + type: variable-text + default: 180px + - + id: cards-max-width + title: Card maximum width + description: Default fills the available width, accepts valid CSS units + type: variable-text + default: 1fr + - + id: cards-mobile-width + title: Card minimum width on mobile + type: variable-text + default: 120px + - + id: cards-padding + title: Card padding + type: variable-text + default: 1.2em + - + id: cards-image-height + title: Card maximum image height + type: variable-text + default: 400px + - + id: cards-border-width + title: Card border width + type: variable-text + default: 1px + - + id: cards-background + title: Card background color + type: variable-themed-color + format: hex + default-light: '#' + default-dark: '#' + +*/ + +/* @settings +name: Minimal Mobile +id: minimal-mobile +settings: + - + id: mobile-toolbar-off + title: Disable toolbar + description: Turns off mobile toolbar + type: class-toggle +*/ + +/* @settings +name: Minimal Advanced Settings +id: minimal-advanced +settings: + - + id: styled-scrollbars + title: Styled scrollbars + description: Use styled scrollbars (replaces native scrollbars) + type: class-toggle + - + id: cursor + title: Cursor style + description: The cursor style for UI elements + type: variable-select + default: default + options: + - + label: Default + value: default + - + label: Pointer + value: pointer + - + label: Crosshair + value: crosshair + - + id: font-ui-small + title: Small font size + description: Font size in px of smaller text + type: variable-number + default: 13 + format: px + - + id: font-ui-smaller + title: Smaller font size + description: Font size in px of smallest text + type: variable-number + default: 11 + format: px + - + id: folding-offset + title: Folding offset + description: Width of the left margin used for folding indicators + type: variable-number-slider + default: 10 + min: 0 + max: 30 + step: 1 + format: px + +*/ diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json new file mode 100644 index 00000000..d15dd9f1 --- /dev/null +++ b/.obsidian/workspace.json @@ -0,0 +1,134 @@ +{ + "main": { + "id": "1f445337c2d6e92a", + "type": "split", + "children": [ + { + "id": "92d55d495ed63201", + "type": "tabs", + "children": [ + { + "id": "63b55a8eb1738113", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "journal/2022/W41/2022-10-14.md", + "mode": "source", + "backlinks": false, + "source": false + } + } + } + ] + } + ], + "direction": "vertical" + }, + "left": { + "id": "807eda8c7f9d39d6", + "type": "split", + "children": [ + { + "id": "127edee3cbe2de12", + "type": "tabs", + "children": [ + { + "id": "32e3954140b6c675", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical" + } + } + }, + { + "id": "0aacbc5bc1b33126", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 235.5 + }, + "right": { + "id": "b6d0f50ff4f93745", + "type": "split", + "children": [ + { + "id": "72bfceaff7d9617c", + "type": "tabs", + "children": [ + { + "id": "216a95b1562d56d5", + "type": "leaf", + "state": { + "type": "calendar", + "state": {} + } + }, + { + "id": "9701940d4d2f1bc6", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true + } + } + }, + { + "id": "c5fde77b8d301a14", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "journal/2022/W41/2022-10-14.md" + } + } + }, + { + "id": "bf8d2979ce1401e1", + "type": "leaf", + "state": { + "type": "git-view", + "state": {} + } + } + ] + } + ], + "direction": "horizontal", + "width": 294.5 + }, + "ribbon": { + "mostRecentAction": "" + }, + "active": "63b55a8eb1738113", + "lastOpenFiles": [ + "journal/2022/W41/未命名.md", + "journal/2022/W41/2022-10-13.md", + "journal/2022/W41/2022-10-11.md", + "journal/2022/W38/2022-09-21.md", + "wiki/safe/系统权限/权限设计方案/主流权限系统的设计.md", + "wiki/safe/系统权限/系统权限简明指南.md", + "wiki/dev/Git/进阶/命令示例.md", + "wiki/dev/Git/进阶/工作流.md", + "wiki/dev/Git/进阶/常用技巧.md", + "wiki/dev/Git/进阶/参考手册.md" + ] +} \ No newline at end of file