");
- 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("\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("\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;
- Object.defineProperty(o, k2, { enumerable: true, get: function() {
- return m[k];
- } });
- } : 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(_a) {
- var _b = _a.compiledTemplates, compiledTemplates = _b === void 0 ? {} : _b, _c = _a.rawTemplates, rawTemplates = _c === void 0 ? {} : _c;
- var compiledRawTemplates = Object.entries(rawTemplates).reduce(function(previousTemplates, _a2) {
- var _b2;
- var name = _a2[0], templateString = _a2[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 '" + templateKey + "'");
- }
- };
- HoganJsUtils2.prototype.template = function(namespace, view) {
- return this.preCompiledTemplates[this.templateKey(namespace, view)];
- };
- HoganJsUtils2.prototype.templateKey = function(namespace, view) {
- return namespace + "-" + 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;
- Object.defineProperty(o, k2, { enumerable: true, get: function() {
- return m[k];
- } });
- } : 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/feather-icons/dist/feather.js
-var require_feather = __commonJS({
- "node_modules/feather-icons/dist/feather.js"(exports, module2) {
- (function webpackUniversalModuleDefinition(root, factory) {
- if (typeof exports === "object" && typeof module2 === "object")
- module2.exports = factory();
- else if (typeof define === "function" && define.amd)
- define([], factory);
- else if (typeof exports === "object")
- exports["feather"] = factory();
- else
- root["feather"] = factory();
- })(typeof self !== "undefined" ? self : exports, function() {
- return function(modules) {
- var installedModules = {};
- function __webpack_require__(moduleId) {
- if (installedModules[moduleId]) {
- return installedModules[moduleId].exports;
- }
- var module3 = installedModules[moduleId] = {
- i: moduleId,
- l: false,
- exports: {}
- };
- modules[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
- module3.l = true;
- return module3.exports;
- }
- __webpack_require__.m = modules;
- __webpack_require__.c = installedModules;
- __webpack_require__.d = function(exports2, name, getter) {
- if (!__webpack_require__.o(exports2, name)) {
- Object.defineProperty(exports2, name, {
- configurable: false,
- enumerable: true,
- get: getter
- });
- }
- };
- __webpack_require__.r = function(exports2) {
- Object.defineProperty(exports2, "__esModule", { value: true });
- };
- __webpack_require__.n = function(module3) {
- var getter = module3 && module3.__esModule ? function getDefault() {
- return module3["default"];
- } : function getModuleExports() {
- return module3;
- };
- __webpack_require__.d(getter, "a", getter);
- return getter;
- };
- __webpack_require__.o = function(object, property) {
- return Object.prototype.hasOwnProperty.call(object, property);
- };
- __webpack_require__.p = "";
- return __webpack_require__(__webpack_require__.s = 0);
- }({
- "./dist/icons.json": function(module3) {
- module3.exports = { "activity": '', "airplay": '', "alert-circle": '', "alert-octagon": '', "alert-triangle": '', "align-center": '', "align-justify": '', "align-left": '', "align-right": '', "anchor": '', "aperture": '', "archive": '', "arrow-down-circle": '', "arrow-down-left": '', "arrow-down-right": '', "arrow-down": '', "arrow-left-circle": '', "arrow-left": '', "arrow-right-circle": '', "arrow-right": '', "arrow-up-circle": '', "arrow-up-left": '', "arrow-up-right": '', "arrow-up": '', "at-sign": '', "award": '', "bar-chart-2": '', "bar-chart": '', "battery-charging": '', "battery": '', "bell-off": '', "bell": '', "bluetooth": '', "bold": '', "book-open": '', "book": '', "bookmark": '', "box": '', "briefcase": '', "calendar": '', "camera-off": '', "camera": '', "cast": '', "check-circle": '', "check-square": '', "check": '', "chevron-down": '', "chevron-left": '', "chevron-right": '', "chevron-up": '', "chevrons-down": '', "chevrons-left": '', "chevrons-right": '', "chevrons-up": '', "chrome": '', "circle": '', "clipboard": '', "clock": '', "cloud-drizzle": '', "cloud-lightning": '', "cloud-off": '', "cloud-rain": '', "cloud-snow": '', "cloud": '', "code": '', "codepen": '', "codesandbox": '', "coffee": '', "columns": '', "command": '', "compass": '', "copy": '', "corner-down-left": '', "corner-down-right": '', "corner-left-down": '', "corner-left-up": '', "corner-right-down": '', "corner-right-up": '', "corner-up-left": '', "corner-up-right": '', "cpu": '', "credit-card": '', "crop": '', "crosshair": '', "database": '', "delete": '', "disc": '', "divide-circle": '', "divide-square": '', "divide": '', "dollar-sign": '', "download-cloud": '', "download": '', "dribbble": '', "droplet": '', "edit-2": '', "edit-3": '', "edit": '', "external-link": '', "eye-off": '', "eye": '', "facebook": '', "fast-forward": '', "feather": '', "figma": '', "file-minus": '', "file-plus": '', "file-text": '', "file": '', "film": '', "filter": '', "flag": '', "folder-minus": '', "folder-plus": '', "folder": '', "framer": '', "frown": '', "gift": '', "git-branch": '', "git-commit": '', "git-merge": '', "git-pull-request": '', "github": '', "gitlab": '', "globe": '', "grid": '', "hard-drive": '', "hash": '', "headphones": '', "heart": '', "help-circle": '', "hexagon": '', "home": '', "image": '', "inbox": '', "info": '', "instagram": '', "italic": '', "key": '', "layers": '', "layout": '', "life-buoy": '', "link-2": '', "link": '', "linkedin": '', "list": '', "loader": '', "lock": '', "log-in": '', "log-out": '', "mail": '', "map-pin": '', "map": '', "maximize-2": '', "maximize": '', "meh": '', "menu": '', "message-circle": '', "message-square": '', "mic-off": '', "mic": '', "minimize-2": '', "minimize": '', "minus-circle": '', "minus-square": '', "minus": '', "monitor": '', "moon": '', "more-horizontal": '', "more-vertical": '', "mouse-pointer": '', "move": '', "music": '', "navigation-2": '', "navigation": '', "octagon": '', "package": '', "paperclip": '', "pause-circle": '', "pause": '', "pen-tool": '', "percent": '', "phone-call": '', "phone-forwarded": '', "phone-incoming": '', "phone-missed": '', "phone-off": '', "phone-outgoing": '', "phone": '', "pie-chart": '', "play-circle": '', "play": '', "plus-circle": '', "plus-square": '', "plus": '', "pocket": '', "power": '', "printer": '', "radio": '', "refresh-ccw": '', "refresh-cw": '', "repeat": '', "rewind": '', "rotate-ccw": '', "rotate-cw": '', "rss": '', "save": '', "scissors": '', "search": '', "send": '', "server": '', "settings": '', "share-2": '', "share": '', "shield-off": '', "shield": '', "shopping-bag": '', "shopping-cart": '', "shuffle": '', "sidebar": '', "skip-back": '', "skip-forward": '', "slack": '', "slash": '', "sliders": '', "smartphone": '', "smile": '', "speaker": '', "square": '', "star": '', "stop-circle": '', "sun": '', "sunrise": '', "sunset": '', "tablet": '', "tag": '', "target": '', "terminal": '', "thermometer": '', "thumbs-down": '', "thumbs-up": '', "toggle-left": '', "toggle-right": '', "tool": '', "trash-2": '', "trash": '', "trello": '', "trending-down": '', "trending-up": '', "triangle": '', "truck": '', "tv": '', "twitch": '', "twitter": '', "type": '', "umbrella": '', "underline": '', "unlock": '', "upload-cloud": '', "upload": '', "user-check": '', "user-minus": '', "user-plus": '', "user-x": '', "user": '', "users": '', "video-off": '', "video": '', "voicemail": '', "volume-1": '', "volume-2": '', "volume-x": '', "volume": '', "watch": '', "wifi-off": '', "wifi": '', "wind": '', "x-circle": '', "x-octagon": '', "x-square": '', "x": '', "youtube": '', "zap-off": '', "zap": '', "zoom-in": '', "zoom-out": '' };
- },
- "./node_modules/classnames/dedupe.js": function(module3, exports2, __webpack_require__) {
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
- (function() {
- "use strict";
- var classNames = function() {
- function StorageObject() {
- }
- StorageObject.prototype = Object.create(null);
- function _parseArray(resultSet, array) {
- var length = array.length;
- for (var i = 0; i < length; ++i) {
- _parse(resultSet, array[i]);
- }
- }
- var hasOwn = {}.hasOwnProperty;
- function _parseNumber(resultSet, num) {
- resultSet[num] = true;
- }
- function _parseObject(resultSet, object) {
- for (var k in object) {
- if (hasOwn.call(object, k)) {
- resultSet[k] = !!object[k];
- }
- }
- }
- var SPACE = /\s+/;
- function _parseString(resultSet, str) {
- var array = str.split(SPACE);
- var length = array.length;
- for (var i = 0; i < length; ++i) {
- resultSet[array[i]] = true;
- }
- }
- function _parse(resultSet, arg) {
- if (!arg)
- return;
- var argType = typeof arg;
- if (argType === "string") {
- _parseString(resultSet, arg);
- } else if (Array.isArray(arg)) {
- _parseArray(resultSet, arg);
- } else if (argType === "object") {
- _parseObject(resultSet, arg);
- } else if (argType === "number") {
- _parseNumber(resultSet, arg);
- }
- }
- function _classNames() {
- var len = arguments.length;
- var args = Array(len);
- for (var i = 0; i < len; i++) {
- args[i] = arguments[i];
- }
- var classSet = new StorageObject();
- _parseArray(classSet, args);
- var list = [];
- for (var k in classSet) {
- if (classSet[k]) {
- list.push(k);
- }
- }
- return list.join(" ");
- }
- return _classNames;
- }();
- if (typeof module3 !== "undefined" && module3.exports) {
- module3.exports = classNames;
- } else if (true) {
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
- return classNames;
- }.apply(exports2, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module3.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {
- }
- })();
- },
- "./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;
- },
- "./node_modules/core-js/internals/a-function.js": function(module3, exports2) {
- module3.exports = function(it) {
- if (typeof it != "function") {
- throw TypeError(String(it) + " is not a function");
- }
- return it;
- };
- },
- "./node_modules/core-js/internals/an-object.js": function(module3, exports2, __webpack_require__) {
- var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js");
- module3.exports = function(it) {
- if (!isObject(it)) {
- throw TypeError(String(it) + " is not an object");
- }
- return it;
- };
- },
- "./node_modules/core-js/internals/array-from.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var bind = __webpack_require__("./node_modules/core-js/internals/bind-context.js");
- var toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js");
- var callWithSafeIterationClosing = __webpack_require__("./node_modules/core-js/internals/call-with-safe-iteration-closing.js");
- var isArrayIteratorMethod = __webpack_require__("./node_modules/core-js/internals/is-array-iterator-method.js");
- var toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js");
- var createProperty = __webpack_require__("./node_modules/core-js/internals/create-property.js");
- var getIteratorMethod = __webpack_require__("./node_modules/core-js/internals/get-iterator-method.js");
- module3.exports = function from(arrayLike) {
- var O = toObject(arrayLike);
- var C = typeof this == "function" ? this : Array;
- var argumentsLength = arguments.length;
- var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
- var mapping = mapfn !== void 0;
- var index = 0;
- var iteratorMethod = getIteratorMethod(O);
- var length, result, step, iterator;
- if (mapping)
- mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : void 0, 2);
- 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);
- }
- } else {
- length = toLength(O.length);
- result = new C(length);
- for (; length > index; index++) {
- createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
- }
- }
- result.length = index;
- return result;
- };
- },
- "./node_modules/core-js/internals/array-includes.js": function(module3, exports2, __webpack_require__) {
- var toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js");
- var toLength = __webpack_require__("./node_modules/core-js/internals/to-length.js");
- var toAbsoluteIndex = __webpack_require__("./node_modules/core-js/internals/to-absolute-index.js");
- module3.exports = function(IS_INCLUDES) {
- return function($this, el, fromIndex) {
- var O = toIndexedObject($this);
- var length = toLength(O.length);
- var index = toAbsoluteIndex(fromIndex, length);
- var value;
- if (IS_INCLUDES && el != el)
- while (length > index) {
- value = O[index++];
- 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;
- }
- return !IS_INCLUDES && -1;
- };
- };
- },
- "./node_modules/core-js/internals/bind-context.js": function(module3, exports2, __webpack_require__) {
- var aFunction = __webpack_require__("./node_modules/core-js/internals/a-function.js");
- module3.exports = function(fn, that, length) {
- aFunction(fn);
- if (that === void 0)
- return fn;
- switch (length) {
- case 0:
- return function() {
- return fn.call(that);
- };
- case 1:
- return function(a) {
- return fn.call(that, a);
- };
- case 2:
- return function(a, b) {
- return fn.call(that, a, b);
- };
- case 3:
- return function(a, b, c) {
- return fn.call(that, a, b, c);
- };
- }
- return function() {
- return fn.apply(that, arguments);
- };
- };
- },
- "./node_modules/core-js/internals/call-with-safe-iteration-closing.js": function(module3, exports2, __webpack_require__) {
- var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js");
- module3.exports = function(iterator, fn, value, ENTRIES) {
- try {
- return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
- } catch (error) {
- var returnMethod = iterator["return"];
- if (returnMethod !== void 0)
- anObject(returnMethod.call(iterator));
- throw error;
- }
- };
- },
- "./node_modules/core-js/internals/check-correctness-of-iteration.js": function(module3, exports2, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol("iterator");
- var SAFE_CLOSING = false;
- try {
- var called = 0;
- var iteratorWithReturn = {
- next: function() {
- return { done: !!called++ };
- },
- "return": function() {
- SAFE_CLOSING = true;
- }
- };
- iteratorWithReturn[ITERATOR] = function() {
- return this;
- };
- Array.from(iteratorWithReturn, function() {
- throw 2;
- });
- } catch (error) {
- }
- module3.exports = function(exec, SKIP_CLOSING) {
- if (!SKIP_CLOSING && !SAFE_CLOSING)
- return false;
- var ITERATION_SUPPORT = false;
- try {
- var object = {};
- object[ITERATOR] = function() {
- return {
- next: function() {
- return { done: ITERATION_SUPPORT = true };
- }
- };
- };
- exec(object);
- } catch (error) {
- }
- return ITERATION_SUPPORT;
- };
- },
- "./node_modules/core-js/internals/classof-raw.js": function(module3, exports2) {
- var toString = {}.toString;
- module3.exports = function(it) {
- return toString.call(it).slice(8, -1);
- };
- },
- "./node_modules/core-js/internals/classof.js": function(module3, exports2, __webpack_require__) {
- var classofRaw = __webpack_require__("./node_modules/core-js/internals/classof-raw.js");
- var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js");
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- var CORRECT_ARGUMENTS = classofRaw(function() {
- return arguments;
- }()) == "Arguments";
- var tryGet = function(it, key2) {
- try {
- return it[key2];
- } catch (error) {
- }
- };
- 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;
- };
- },
- "./node_modules/core-js/internals/copy-constructor-properties.js": function(module3, exports2, __webpack_require__) {
- var has = __webpack_require__("./node_modules/core-js/internals/has.js");
- var ownKeys = __webpack_require__("./node_modules/core-js/internals/own-keys.js");
- var getOwnPropertyDescriptorModule = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-descriptor.js");
- var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js");
- module3.exports = function(target, source) {
- var keys = ownKeys(source);
- var defineProperty = definePropertyModule.f;
- var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
- for (var i = 0; i < keys.length; i++) {
- var key2 = keys[i];
- if (!has(target, key2))
- defineProperty(target, key2, getOwnPropertyDescriptor(source, key2));
- }
- };
- },
- "./node_modules/core-js/internals/correct-prototype-getter.js": function(module3, exports2, __webpack_require__) {
- var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");
- module3.exports = !fails(function() {
- function F() {
- }
- F.prototype.constructor = null;
- return Object.getPrototypeOf(new F()) !== F.prototype;
- });
- },
- "./node_modules/core-js/internals/create-iterator-constructor.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var IteratorPrototype = __webpack_require__("./node_modules/core-js/internals/iterators-core.js").IteratorPrototype;
- var create = __webpack_require__("./node_modules/core-js/internals/object-create.js");
- var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js");
- var setToStringTag = __webpack_require__("./node_modules/core-js/internals/set-to-string-tag.js");
- var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js");
- var returnThis = function() {
- return this;
- };
- module3.exports = function(IteratorConstructor, NAME, next) {
- var TO_STRING_TAG = NAME + " Iterator";
- IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
- setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
- Iterators[TO_STRING_TAG] = returnThis;
- return IteratorConstructor;
- };
- },
- "./node_modules/core-js/internals/create-property-descriptor.js": function(module3, exports2) {
- module3.exports = function(bitmap, value) {
- return {
- enumerable: !(bitmap & 1),
- configurable: !(bitmap & 2),
- writable: !(bitmap & 4),
- value
- };
- };
- },
- "./node_modules/core-js/internals/create-property.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var toPrimitive = __webpack_require__("./node_modules/core-js/internals/to-primitive.js");
- var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js");
- var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js");
- module3.exports = function(object, key2, value) {
- var propertyKey = toPrimitive(key2);
- if (propertyKey in object)
- definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value));
- else
- object[propertyKey] = value;
- };
- },
- "./node_modules/core-js/internals/define-iterator.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var $ = __webpack_require__("./node_modules/core-js/internals/export.js");
- var createIteratorConstructor = __webpack_require__("./node_modules/core-js/internals/create-iterator-constructor.js");
- var getPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-get-prototype-of.js");
- var setPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-set-prototype-of.js");
- var setToStringTag = __webpack_require__("./node_modules/core-js/internals/set-to-string-tag.js");
- var hide = __webpack_require__("./node_modules/core-js/internals/hide.js");
- var redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js");
- var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js");
- var IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js");
- var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js");
- var IteratorsCore = __webpack_require__("./node_modules/core-js/internals/iterators-core.js");
- var IteratorPrototype = IteratorsCore.IteratorPrototype;
- var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
- var ITERATOR = wellKnownSymbol("iterator");
- var KEYS = "keys";
- var VALUES = "values";
- var ENTRIES = "entries";
- var returnThis = function() {
- return this;
- };
- module3.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
- createIteratorConstructor(IteratorConstructor, NAME, next);
- var getIterationMethod = function(KIND) {
- if (KIND === DEFAULT && defaultIterator)
- return defaultIterator;
- if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
- return IterablePrototype[KIND];
- switch (KIND) {
- case KEYS:
- return function keys() {
- return new IteratorConstructor(this, KIND);
- };
- case VALUES:
- return function values() {
- return new IteratorConstructor(this, KIND);
- };
- case ENTRIES:
- return function entries() {
- return new IteratorConstructor(this, KIND);
- };
- }
- return function() {
- return new IteratorConstructor(this);
- };
- };
- var TO_STRING_TAG = NAME + " Iterator";
- var INCORRECT_VALUES_NAME = false;
- var IterablePrototype = Iterable.prototype;
- var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
- var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
- var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
- var CurrentIteratorPrototype, methods, KEY;
- if (anyNativeIterator) {
- CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
- if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
- if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
- if (setPrototypeOf) {
- setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
- } else if (typeof CurrentIteratorPrototype[ITERATOR] != "function") {
- hide(CurrentIteratorPrototype, ITERATOR, returnThis);
- }
- }
- setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
- if (IS_PURE)
- Iterators[TO_STRING_TAG] = returnThis;
- }
- }
- if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
- INCORRECT_VALUES_NAME = true;
- defaultIterator = function values() {
- return nativeIterator.call(this);
- };
- }
- if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
- hide(IterablePrototype, ITERATOR, defaultIterator);
- }
- Iterators[NAME] = defaultIterator;
- if (DEFAULT) {
- methods = {
- values: getIterationMethod(VALUES),
- keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
- entries: getIterationMethod(ENTRIES)
- };
- if (FORCED)
- for (KEY in methods) {
- if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
- redefine(IterablePrototype, KEY, methods[KEY]);
- }
- }
- else
- $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
- }
- return methods;
- };
- },
- "./node_modules/core-js/internals/descriptors.js": function(module3, exports2, __webpack_require__) {
- var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");
- module3.exports = !fails(function() {
- return Object.defineProperty({}, "a", { get: function() {
- return 7;
- } }).a != 7;
- });
- },
- "./node_modules/core-js/internals/document-create-element.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js");
- var document2 = global2.document;
- var exist = isObject(document2) && isObject(document2.createElement);
- module3.exports = function(it) {
- return exist ? document2.createElement(it) : {};
- };
- },
- "./node_modules/core-js/internals/enum-bug-keys.js": function(module3, exports2) {
- module3.exports = [
- "constructor",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "toLocaleString",
- "toString",
- "valueOf"
- ];
- },
- "./node_modules/core-js/internals/export.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var getOwnPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/object-get-own-property-descriptor.js").f;
- var hide = __webpack_require__("./node_modules/core-js/internals/hide.js");
- var redefine = __webpack_require__("./node_modules/core-js/internals/redefine.js");
- var setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js");
- var copyConstructorProperties = __webpack_require__("./node_modules/core-js/internals/copy-constructor-properties.js");
- var isForced = __webpack_require__("./node_modules/core-js/internals/is-forced.js");
- module3.exports = function(options, source) {
- var TARGET = options.target;
- var GLOBAL = options.global;
- var STATIC = options.stat;
- var FORCED, target, key2, targetProperty, sourceProperty, descriptor;
- if (GLOBAL) {
- target = global2;
- } else if (STATIC) {
- target = global2[TARGET] || setGlobal(TARGET, {});
- } else {
- target = (global2[TARGET] || {}).prototype;
- }
- if (target)
- for (key2 in source) {
- sourceProperty = source[key2];
- if (options.noTargetGet) {
- descriptor = getOwnPropertyDescriptor(target, key2);
- targetProperty = descriptor && descriptor.value;
- } else
- targetProperty = target[key2];
- FORCED = isForced(GLOBAL ? key2 : TARGET + (STATIC ? "." : "#") + key2, options.forced);
- if (!FORCED && targetProperty !== void 0) {
- if (typeof sourceProperty === typeof targetProperty)
- continue;
- copyConstructorProperties(sourceProperty, targetProperty);
- }
- if (options.sham || targetProperty && targetProperty.sham) {
- hide(sourceProperty, "sham", true);
- }
- redefine(target, key2, sourceProperty, options);
- }
- };
- },
- "./node_modules/core-js/internals/fails.js": function(module3, exports2) {
- module3.exports = function(exec) {
- try {
- return !!exec();
- } catch (error) {
- return true;
- }
- };
- },
- "./node_modules/core-js/internals/function-to-string.js": function(module3, exports2, __webpack_require__) {
- var shared = __webpack_require__("./node_modules/core-js/internals/shared.js");
- module3.exports = shared("native-function-to-string", Function.toString);
- },
- "./node_modules/core-js/internals/get-iterator-method.js": function(module3, exports2, __webpack_require__) {
- var classof = __webpack_require__("./node_modules/core-js/internals/classof.js");
- var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js");
- var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js");
- var ITERATOR = wellKnownSymbol("iterator");
- module3.exports = function(it) {
- if (it != void 0)
- return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)];
- };
- },
- "./node_modules/core-js/internals/global.js": function(module3, exports2, __webpack_require__) {
- (function(global2) {
- var O = "object";
- var check = function(it) {
- return it && it.Math == Math && it;
- };
- module3.exports = check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof global2 == O && global2) || Function("return this")();
- }).call(this, __webpack_require__("./node_modules/webpack/buildin/global.js"));
- },
- "./node_modules/core-js/internals/has.js": function(module3, exports2) {
- var hasOwnProperty = {}.hasOwnProperty;
- module3.exports = function(it, key2) {
- return hasOwnProperty.call(it, key2);
- };
- },
- "./node_modules/core-js/internals/hidden-keys.js": function(module3, exports2) {
- module3.exports = {};
- },
- "./node_modules/core-js/internals/hide.js": function(module3, exports2, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js");
- var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js");
- var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js");
- module3.exports = DESCRIPTORS ? function(object, key2, value) {
- return definePropertyModule.f(object, key2, createPropertyDescriptor(1, value));
- } : function(object, key2, value) {
- object[key2] = value;
- return object;
- };
- },
- "./node_modules/core-js/internals/html.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var document2 = global2.document;
- module3.exports = document2 && document2.documentElement;
- },
- "./node_modules/core-js/internals/ie8-dom-define.js": function(module3, exports2, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js");
- var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");
- var createElement = __webpack_require__("./node_modules/core-js/internals/document-create-element.js");
- module3.exports = !DESCRIPTORS && !fails(function() {
- return Object.defineProperty(createElement("div"), "a", {
- get: function() {
- return 7;
- }
- }).a != 7;
- });
- },
- "./node_modules/core-js/internals/indexed-object.js": function(module3, exports2, __webpack_require__) {
- var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");
- var classof = __webpack_require__("./node_modules/core-js/internals/classof-raw.js");
- var split = "".split;
- module3.exports = fails(function() {
- return !Object("z").propertyIsEnumerable(0);
- }) ? function(it) {
- return classof(it) == "String" ? split.call(it, "") : Object(it);
- } : Object;
- },
- "./node_modules/core-js/internals/internal-state.js": function(module3, exports2, __webpack_require__) {
- var NATIVE_WEAK_MAP = __webpack_require__("./node_modules/core-js/internals/native-weak-map.js");
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js");
- var hide = __webpack_require__("./node_modules/core-js/internals/hide.js");
- var objectHas = __webpack_require__("./node_modules/core-js/internals/has.js");
- var sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js");
- var hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js");
- var WeakMap = global2.WeakMap;
- var set, get, has;
- var enforce = function(it) {
- return has(it) ? get(it) : set(it, {});
- };
- var getterFor = function(TYPE) {
- return function(it) {
- var state;
- if (!isObject(it) || (state = get(it)).type !== TYPE) {
- throw TypeError("Incompatible receiver, " + TYPE + " required");
- }
- return state;
- };
- };
- if (NATIVE_WEAK_MAP) {
- var store = new WeakMap();
- var wmget = store.get;
- var wmhas = store.has;
- var wmset = store.set;
- set = function(it, metadata) {
- wmset.call(store, it, metadata);
- return metadata;
- };
- get = function(it) {
- return wmget.call(store, it) || {};
- };
- has = function(it) {
- return wmhas.call(store, it);
- };
- } else {
- var STATE = sharedKey("state");
- hiddenKeys[STATE] = true;
- set = function(it, metadata) {
- hide(it, STATE, metadata);
- return metadata;
- };
- get = function(it) {
- return objectHas(it, STATE) ? it[STATE] : {};
- };
- has = function(it) {
- return objectHas(it, STATE);
- };
- }
- module3.exports = {
- set,
- get,
- has,
- enforce,
- getterFor
- };
- },
- "./node_modules/core-js/internals/is-array-iterator-method.js": function(module3, exports2, __webpack_require__) {
- var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js");
- var Iterators = __webpack_require__("./node_modules/core-js/internals/iterators.js");
- var ITERATOR = wellKnownSymbol("iterator");
- var ArrayPrototype = Array.prototype;
- module3.exports = function(it) {
- return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
- };
- },
- "./node_modules/core-js/internals/is-forced.js": function(module3, exports2, __webpack_require__) {
- var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");
- var replacement = /#|\.prototype\./;
- var isForced = function(feature, detection) {
- var value = data[normalize2(feature)];
- return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == "function" ? fails(detection) : !!detection;
- };
- var normalize2 = isForced.normalize = function(string) {
- return String(string).replace(replacement, ".").toLowerCase();
- };
- var data = isForced.data = {};
- var NATIVE = isForced.NATIVE = "N";
- var POLYFILL = isForced.POLYFILL = "P";
- module3.exports = isForced;
- },
- "./node_modules/core-js/internals/is-object.js": function(module3, exports2) {
- module3.exports = function(it) {
- return typeof it === "object" ? it !== null : typeof it === "function";
- };
- },
- "./node_modules/core-js/internals/is-pure.js": function(module3, exports2) {
- module3.exports = false;
- },
- "./node_modules/core-js/internals/iterators-core.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var getPrototypeOf = __webpack_require__("./node_modules/core-js/internals/object-get-prototype-of.js");
- var hide = __webpack_require__("./node_modules/core-js/internals/hide.js");
- var has = __webpack_require__("./node_modules/core-js/internals/has.js");
- var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js");
- var IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js");
- var ITERATOR = wellKnownSymbol("iterator");
- var BUGGY_SAFARI_ITERATORS = false;
- var returnThis = function() {
- return this;
- };
- var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
- if ([].keys) {
- arrayIterator = [].keys();
- if (!("next" in arrayIterator))
- BUGGY_SAFARI_ITERATORS = true;
- else {
- PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
- if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
- IteratorPrototype = PrototypeOfArrayIteratorPrototype;
- }
- }
- if (IteratorPrototype == void 0)
- IteratorPrototype = {};
- if (!IS_PURE && !has(IteratorPrototype, ITERATOR))
- hide(IteratorPrototype, ITERATOR, returnThis);
- module3.exports = {
- IteratorPrototype,
- BUGGY_SAFARI_ITERATORS
- };
- },
- "./node_modules/core-js/internals/iterators.js": function(module3, exports2) {
- module3.exports = {};
- },
- "./node_modules/core-js/internals/native-symbol.js": function(module3, exports2, __webpack_require__) {
- var fails = __webpack_require__("./node_modules/core-js/internals/fails.js");
- module3.exports = !!Object.getOwnPropertySymbols && !fails(function() {
- return !String(Symbol());
- });
- },
- "./node_modules/core-js/internals/native-weak-map.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var nativeFunctionToString = __webpack_require__("./node_modules/core-js/internals/function-to-string.js");
- var WeakMap = global2.WeakMap;
- module3.exports = typeof WeakMap === "function" && /native code/.test(nativeFunctionToString.call(WeakMap));
- },
- "./node_modules/core-js/internals/object-create.js": function(module3, exports2, __webpack_require__) {
- var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js");
- var defineProperties = __webpack_require__("./node_modules/core-js/internals/object-define-properties.js");
- var enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js");
- var hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js");
- var html2 = __webpack_require__("./node_modules/core-js/internals/html.js");
- var documentCreateElement = __webpack_require__("./node_modules/core-js/internals/document-create-element.js");
- var sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js");
- var IE_PROTO = sharedKey("IE_PROTO");
- var PROTOTYPE = "prototype";
- var Empty = function() {
- };
- var createDict = function() {
- var iframe = documentCreateElement("iframe");
- var length = enumBugKeys.length;
- var lt = "<";
- var script = "script";
- var gt = ">";
- var js = "java" + script + ":";
- var iframeDocument;
- iframe.style.display = "none";
- html2.appendChild(iframe);
- iframe.src = String(js);
- iframeDocument = iframe.contentWindow.document;
- iframeDocument.open();
- iframeDocument.write(lt + script + gt + "document.F=Object" + lt + "/" + script + gt);
- iframeDocument.close();
- createDict = iframeDocument.F;
- while (length--)
- delete createDict[PROTOTYPE][enumBugKeys[length]];
- return createDict();
- };
- module3.exports = Object.create || function create(O, Properties) {
- var result;
- if (O !== null) {
- Empty[PROTOTYPE] = anObject(O);
- result = new Empty();
- Empty[PROTOTYPE] = null;
- result[IE_PROTO] = O;
- } else
- result = createDict();
- return Properties === void 0 ? result : defineProperties(result, Properties);
- };
- hiddenKeys[IE_PROTO] = true;
- },
- "./node_modules/core-js/internals/object-define-properties.js": function(module3, exports2, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js");
- var definePropertyModule = __webpack_require__("./node_modules/core-js/internals/object-define-property.js");
- var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js");
- var objectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys.js");
- module3.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
- anObject(O);
- var keys = objectKeys(Properties);
- var length = keys.length;
- var i = 0;
- var key2;
- while (length > i)
- definePropertyModule.f(O, key2 = keys[i++], Properties[key2]);
- return O;
- };
- },
- "./node_modules/core-js/internals/object-define-property.js": function(module3, exports2, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js");
- var IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/internals/ie8-dom-define.js");
- var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js");
- var toPrimitive = __webpack_require__("./node_modules/core-js/internals/to-primitive.js");
- var nativeDefineProperty = Object.defineProperty;
- exports2.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
- anObject(O);
- P = toPrimitive(P, true);
- anObject(Attributes);
- if (IE8_DOM_DEFINE)
- try {
- return nativeDefineProperty(O, P, Attributes);
- } catch (error) {
- }
- if ("get" in Attributes || "set" in Attributes)
- throw TypeError("Accessors not supported");
- if ("value" in Attributes)
- O[P] = Attributes.value;
- return O;
- };
- },
- "./node_modules/core-js/internals/object-get-own-property-descriptor.js": function(module3, exports2, __webpack_require__) {
- var DESCRIPTORS = __webpack_require__("./node_modules/core-js/internals/descriptors.js");
- var propertyIsEnumerableModule = __webpack_require__("./node_modules/core-js/internals/object-property-is-enumerable.js");
- var createPropertyDescriptor = __webpack_require__("./node_modules/core-js/internals/create-property-descriptor.js");
- var toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js");
- var toPrimitive = __webpack_require__("./node_modules/core-js/internals/to-primitive.js");
- var has = __webpack_require__("./node_modules/core-js/internals/has.js");
- var IE8_DOM_DEFINE = __webpack_require__("./node_modules/core-js/internals/ie8-dom-define.js");
- var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- exports2.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
- O = toIndexedObject(O);
- P = toPrimitive(P, true);
- if (IE8_DOM_DEFINE)
- try {
- return nativeGetOwnPropertyDescriptor(O, P);
- } catch (error) {
- }
- if (has(O, P))
- return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
- };
- },
- "./node_modules/core-js/internals/object-get-own-property-names.js": function(module3, exports2, __webpack_require__) {
- var internalObjectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys-internal.js");
- var enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js");
- var hiddenKeys = enumBugKeys.concat("length", "prototype");
- exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
- return internalObjectKeys(O, hiddenKeys);
- };
- },
- "./node_modules/core-js/internals/object-get-own-property-symbols.js": function(module3, exports2) {
- exports2.f = Object.getOwnPropertySymbols;
- },
- "./node_modules/core-js/internals/object-get-prototype-of.js": function(module3, exports2, __webpack_require__) {
- var has = __webpack_require__("./node_modules/core-js/internals/has.js");
- var toObject = __webpack_require__("./node_modules/core-js/internals/to-object.js");
- var sharedKey = __webpack_require__("./node_modules/core-js/internals/shared-key.js");
- var CORRECT_PROTOTYPE_GETTER = __webpack_require__("./node_modules/core-js/internals/correct-prototype-getter.js");
- var IE_PROTO = sharedKey("IE_PROTO");
- var ObjectPrototype = Object.prototype;
- module3.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function(O) {
- O = toObject(O);
- if (has(O, IE_PROTO))
- return O[IE_PROTO];
- if (typeof O.constructor == "function" && O instanceof O.constructor) {
- return O.constructor.prototype;
- }
- return O instanceof Object ? ObjectPrototype : null;
- };
- },
- "./node_modules/core-js/internals/object-keys-internal.js": function(module3, exports2, __webpack_require__) {
- var has = __webpack_require__("./node_modules/core-js/internals/has.js");
- var toIndexedObject = __webpack_require__("./node_modules/core-js/internals/to-indexed-object.js");
- var arrayIncludes = __webpack_require__("./node_modules/core-js/internals/array-includes.js");
- var hiddenKeys = __webpack_require__("./node_modules/core-js/internals/hidden-keys.js");
- var arrayIndexOf = arrayIncludes(false);
- module3.exports = function(object, names) {
- var O = toIndexedObject(object);
- var i = 0;
- var result = [];
- var key2;
- for (key2 in O)
- !has(hiddenKeys, key2) && has(O, key2) && result.push(key2);
- while (names.length > i)
- if (has(O, key2 = names[i++])) {
- ~arrayIndexOf(result, key2) || result.push(key2);
- }
- return result;
- };
- },
- "./node_modules/core-js/internals/object-keys.js": function(module3, exports2, __webpack_require__) {
- var internalObjectKeys = __webpack_require__("./node_modules/core-js/internals/object-keys-internal.js");
- var enumBugKeys = __webpack_require__("./node_modules/core-js/internals/enum-bug-keys.js");
- module3.exports = Object.keys || function keys(O) {
- return internalObjectKeys(O, enumBugKeys);
- };
- },
- "./node_modules/core-js/internals/object-property-is-enumerable.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
- exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
- var descriptor = getOwnPropertyDescriptor(this, V);
- return !!descriptor && descriptor.enumerable;
- } : nativePropertyIsEnumerable;
- },
- "./node_modules/core-js/internals/object-set-prototype-of.js": function(module3, exports2, __webpack_require__) {
- var validateSetPrototypeOfArguments = __webpack_require__("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js");
- module3.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
- var correctSetter = false;
- var test = {};
- var setter;
- try {
- setter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set;
- setter.call(test, []);
- correctSetter = test instanceof Array;
- } catch (error) {
- }
- return function setPrototypeOf(O, proto) {
- validateSetPrototypeOfArguments(O, proto);
- if (correctSetter)
- setter.call(O, proto);
- else
- O.__proto__ = proto;
- return O;
- };
- }() : void 0);
- },
- "./node_modules/core-js/internals/own-keys.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- 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 keys = getOwnPropertyNamesModule.f(anObject(it));
- var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
- return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys;
- };
- },
- "./node_modules/core-js/internals/path.js": function(module3, exports2, __webpack_require__) {
- module3.exports = __webpack_require__("./node_modules/core-js/internals/global.js");
- },
- "./node_modules/core-js/internals/redefine.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var shared = __webpack_require__("./node_modules/core-js/internals/shared.js");
- var hide = __webpack_require__("./node_modules/core-js/internals/hide.js");
- var has = __webpack_require__("./node_modules/core-js/internals/has.js");
- var setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js");
- var nativeFunctionToString = __webpack_require__("./node_modules/core-js/internals/function-to-string.js");
- var InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js");
- var getInternalState = InternalStateModule.get;
- var enforceInternalState = InternalStateModule.enforce;
- var TEMPLATE = String(nativeFunctionToString).split("toString");
- shared("inspectSource", function(it) {
- return nativeFunctionToString.call(it);
- });
- (module3.exports = function(O, key2, value, options) {
- var unsafe = options ? !!options.unsafe : false;
- var simple2 = options ? !!options.enumerable : false;
- var noTargetGet = options ? !!options.noTargetGet : false;
- if (typeof value == "function") {
- if (typeof key2 == "string" && !has(value, "name"))
- hide(value, "name", key2);
- enforceInternalState(value).source = TEMPLATE.join(typeof key2 == "string" ? key2 : "");
- }
- if (O === global2) {
- if (simple2)
- O[key2] = value;
- else
- setGlobal(key2, value);
- return;
- } else if (!unsafe) {
- delete O[key2];
- } else if (!noTargetGet && O[key2]) {
- simple2 = true;
- }
- if (simple2)
- O[key2] = value;
- else
- hide(O, key2, value);
- })(Function.prototype, "toString", function toString() {
- return typeof this == "function" && getInternalState(this).source || nativeFunctionToString.call(this);
- });
- },
- "./node_modules/core-js/internals/require-object-coercible.js": function(module3, exports2) {
- module3.exports = function(it) {
- if (it == void 0)
- throw TypeError("Can't call method on " + it);
- return it;
- };
- },
- "./node_modules/core-js/internals/set-global.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var hide = __webpack_require__("./node_modules/core-js/internals/hide.js");
- module3.exports = function(key2, value) {
- try {
- hide(global2, key2, value);
- } catch (error) {
- global2[key2] = value;
- }
- return value;
- };
- },
- "./node_modules/core-js/internals/set-to-string-tag.js": function(module3, exports2, __webpack_require__) {
- var defineProperty = __webpack_require__("./node_modules/core-js/internals/object-define-property.js").f;
- var has = __webpack_require__("./node_modules/core-js/internals/has.js");
- var wellKnownSymbol = __webpack_require__("./node_modules/core-js/internals/well-known-symbol.js");
- var TO_STRING_TAG = wellKnownSymbol("toStringTag");
- module3.exports = function(it, TAG, STATIC) {
- if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
- defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
- }
- };
- },
- "./node_modules/core-js/internals/shared-key.js": function(module3, exports2, __webpack_require__) {
- var shared = __webpack_require__("./node_modules/core-js/internals/shared.js");
- var uid = __webpack_require__("./node_modules/core-js/internals/uid.js");
- var keys = shared("keys");
- module3.exports = function(key2) {
- return keys[key2] || (keys[key2] = uid(key2));
- };
- },
- "./node_modules/core-js/internals/shared.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var setGlobal = __webpack_require__("./node_modules/core-js/internals/set-global.js");
- var IS_PURE = __webpack_require__("./node_modules/core-js/internals/is-pure.js");
- var SHARED = "__core-js_shared__";
- var store = global2[SHARED] || setGlobal(SHARED, {});
- (module3.exports = function(key2, value) {
- return store[key2] || (store[key2] = value !== void 0 ? value : {});
- })("versions", []).push({
- version: "3.1.3",
- mode: IS_PURE ? "pure" : "global",
- copyright: "\xA9 2019 Denis Pushkarev (zloirock.ru)"
- });
- },
- "./node_modules/core-js/internals/string-at.js": function(module3, exports2, __webpack_require__) {
- var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js");
- var requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js");
- module3.exports = function(that, pos, CONVERT_TO_STRING) {
- var S = String(requireObjectCoercible(that));
- var position = toInteger(pos);
- var size = S.length;
- var first, second;
- if (position < 0 || position >= size)
- return CONVERT_TO_STRING ? "" : void 0;
- first = S.charCodeAt(position);
- return first < 55296 || first > 56319 || position + 1 === size || (second = S.charCodeAt(position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
- };
- },
- "./node_modules/core-js/internals/to-absolute-index.js": function(module3, exports2, __webpack_require__) {
- 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);
- return integer < 0 ? max(integer + length, 0) : min(integer, length);
- };
- },
- "./node_modules/core-js/internals/to-indexed-object.js": function(module3, exports2, __webpack_require__) {
- var IndexedObject = __webpack_require__("./node_modules/core-js/internals/indexed-object.js");
- var requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js");
- module3.exports = function(it) {
- return IndexedObject(requireObjectCoercible(it));
- };
- },
- "./node_modules/core-js/internals/to-integer.js": function(module3, exports2) {
- var ceil = Math.ceil;
- var floor = Math.floor;
- module3.exports = function(argument) {
- return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
- };
- },
- "./node_modules/core-js/internals/to-length.js": function(module3, exports2, __webpack_require__) {
- var toInteger = __webpack_require__("./node_modules/core-js/internals/to-integer.js");
- var min = Math.min;
- module3.exports = function(argument) {
- return argument > 0 ? min(toInteger(argument), 9007199254740991) : 0;
- };
- },
- "./node_modules/core-js/internals/to-object.js": function(module3, exports2, __webpack_require__) {
- var requireObjectCoercible = __webpack_require__("./node_modules/core-js/internals/require-object-coercible.js");
- module3.exports = function(argument) {
- return Object(requireObjectCoercible(argument));
- };
- },
- "./node_modules/core-js/internals/to-primitive.js": function(module3, exports2, __webpack_require__) {
- var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js");
- module3.exports = function(it, S) {
- if (!isObject(it))
- return it;
- var fn, val;
- if (S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it)))
- return val;
- if (typeof (fn = it.valueOf) == "function" && !isObject(val = fn.call(it)))
- return val;
- if (!S && typeof (fn = it.toString) == "function" && !isObject(val = fn.call(it)))
- return val;
- throw TypeError("Can't convert object to primitive value");
- };
- },
- "./node_modules/core-js/internals/uid.js": function(module3, exports2) {
- var id = 0;
- var postfix = Math.random();
- module3.exports = function(key2) {
- return "Symbol(".concat(key2 === void 0 ? "" : key2, ")_", (++id + postfix).toString(36));
- };
- },
- "./node_modules/core-js/internals/validate-set-prototype-of-arguments.js": function(module3, exports2, __webpack_require__) {
- var isObject = __webpack_require__("./node_modules/core-js/internals/is-object.js");
- var anObject = __webpack_require__("./node_modules/core-js/internals/an-object.js");
- module3.exports = function(O, proto) {
- anObject(O);
- if (!isObject(proto) && proto !== null) {
- throw TypeError("Can't set " + String(proto) + " as a prototype");
- }
- };
- },
- "./node_modules/core-js/internals/well-known-symbol.js": function(module3, exports2, __webpack_require__) {
- var global2 = __webpack_require__("./node_modules/core-js/internals/global.js");
- var shared = __webpack_require__("./node_modules/core-js/internals/shared.js");
- var uid = __webpack_require__("./node_modules/core-js/internals/uid.js");
- var NATIVE_SYMBOL = __webpack_require__("./node_modules/core-js/internals/native-symbol.js");
- var Symbol2 = global2.Symbol;
- var store = shared("wks");
- module3.exports = function(name) {
- return store[name] || (store[name] = NATIVE_SYMBOL && Symbol2[name] || (NATIVE_SYMBOL ? Symbol2 : uid)("Symbol." + name));
- };
- },
- "./node_modules/core-js/modules/es.array.from.js": function(module3, exports2, __webpack_require__) {
- var $ = __webpack_require__("./node_modules/core-js/internals/export.js");
- var from = __webpack_require__("./node_modules/core-js/internals/array-from.js");
- var checkCorrectnessOfIteration = __webpack_require__("./node_modules/core-js/internals/check-correctness-of-iteration.js");
- var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
- Array.from(iterable);
- });
- $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, {
- from
- });
- },
- "./node_modules/core-js/modules/es.string.iterator.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var codePointAt = __webpack_require__("./node_modules/core-js/internals/string-at.js");
- var InternalStateModule = __webpack_require__("./node_modules/core-js/internals/internal-state.js");
- var defineIterator = __webpack_require__("./node_modules/core-js/internals/define-iterator.js");
- var STRING_ITERATOR = "String Iterator";
- var setInternalState = InternalStateModule.set;
- var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
- defineIterator(String, "String", function(iterated) {
- setInternalState(this, {
- type: STRING_ITERATOR,
- string: String(iterated),
- index: 0
- });
- }, function next() {
- var state = getInternalState(this);
- var string = state.string;
- var index = state.index;
- var point;
- if (index >= string.length)
- return { value: void 0, done: true };
- point = codePointAt(string, index, true);
- state.index += point.length;
- return { value: point, done: false };
- });
- },
- "./node_modules/webpack/buildin/global.js": function(module3, exports2) {
- var g;
- g = function() {
- return this;
- }();
- try {
- g = g || Function("return this")() || (1, eval)("this");
- } catch (e) {
- if (typeof window === "object")
- g = window;
- }
- module3.exports = g;
- },
- "./src/default-attrs.json": function(module3) {
- module3.exports = { "xmlns": "http://www.w3.org/2000/svg", "width": 24, "height": 24, "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke-width": 2, "stroke-linecap": "round", "stroke-linejoin": "round" };
- },
- "./src/icon.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _extends = Object.assign || function(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key2 in source) {
- if (Object.prototype.hasOwnProperty.call(source, key2)) {
- target[key2] = source[key2];
- }
- }
- }
- return target;
- };
- var _createClass = function() {
- function defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i];
- descriptor.enumerable = descriptor.enumerable || false;
- descriptor.configurable = true;
- if ("value" in descriptor)
- descriptor.writable = true;
- Object.defineProperty(target, descriptor.key, descriptor);
- }
- }
- return function(Constructor, protoProps, staticProps) {
- if (protoProps)
- defineProperties(Constructor.prototype, protoProps);
- if (staticProps)
- defineProperties(Constructor, staticProps);
- return Constructor;
- };
- }();
- var _dedupe = __webpack_require__("./node_modules/classnames/dedupe.js");
- var _dedupe2 = _interopRequireDefault(_dedupe);
- var _defaultAttrs = __webpack_require__("./src/default-attrs.json");
- var _defaultAttrs2 = _interopRequireDefault(_defaultAttrs);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function _classCallCheck(instance5, Constructor) {
- if (!(instance5 instanceof Constructor)) {
- throw new TypeError("Cannot call a class as a function");
- }
- }
- var Icon = function() {
- function Icon2(name, contents) {
- var tags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
- _classCallCheck(this, Icon2);
- this.name = name;
- this.contents = contents;
- this.tags = tags;
- this.attrs = _extends({}, _defaultAttrs2.default, { class: "feather feather-" + name });
- }
- _createClass(Icon2, [{
- key: "toSvg",
- value: function toSvg() {
- var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- var combinedAttrs = _extends({}, this.attrs, attrs, { class: (0, _dedupe2.default)(this.attrs.class, attrs.class) });
- return "";
- }
- }, {
- key: "toString",
- value: function toString() {
- return this.contents;
- }
- }]);
- return Icon2;
- }();
- function attrsToString(attrs) {
- return Object.keys(attrs).map(function(key2) {
- return key2 + '="' + attrs[key2] + '"';
- }).join(" ");
- }
- exports2.default = Icon;
- },
- "./src/icons.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _icon = __webpack_require__("./src/icon.js");
- var _icon2 = _interopRequireDefault(_icon);
- var _icons = __webpack_require__("./dist/icons.json");
- var _icons2 = _interopRequireDefault(_icons);
- var _tags = __webpack_require__("./src/tags.json");
- var _tags2 = _interopRequireDefault(_tags);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- exports2.default = Object.keys(_icons2.default).map(function(key2) {
- return new _icon2.default(key2, _icons2.default[key2], _tags2.default[key2]);
- }).reduce(function(object, icon) {
- object[icon.name] = icon;
- return object;
- }, {});
- },
- "./src/index.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- var _icons = __webpack_require__("./src/icons.js");
- var _icons2 = _interopRequireDefault(_icons);
- var _toSvg = __webpack_require__("./src/to-svg.js");
- var _toSvg2 = _interopRequireDefault(_toSvg);
- var _replace = __webpack_require__("./src/replace.js");
- var _replace2 = _interopRequireDefault(_replace);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- module3.exports = { icons: _icons2.default, toSvg: _toSvg2.default, replace: _replace2.default };
- },
- "./src/replace.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _extends = Object.assign || function(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];
- for (var key2 in source) {
- if (Object.prototype.hasOwnProperty.call(source, key2)) {
- target[key2] = source[key2];
- }
- }
- }
- return target;
- };
- var _dedupe = __webpack_require__("./node_modules/classnames/dedupe.js");
- var _dedupe2 = _interopRequireDefault(_dedupe);
- var _icons = __webpack_require__("./src/icons.js");
- var _icons2 = _interopRequireDefault(_icons);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function replace() {
- var attrs = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
- if (typeof document === "undefined") {
- throw new Error("`feather.replace()` only works in a browser environment.");
- }
- var elementsToReplace = document.querySelectorAll("[data-feather]");
- Array.from(elementsToReplace).forEach(function(element2) {
- return replaceElement(element2, attrs);
- });
- }
- function replaceElement(element2) {
- var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- var elementAttrs = getAttrs(element2);
- var name = elementAttrs["data-feather"];
- delete elementAttrs["data-feather"];
- var svgString = _icons2.default[name].toSvg(_extends({}, attrs, elementAttrs, { class: (0, _dedupe2.default)(attrs.class, elementAttrs.class) }));
- var svgDocument = new DOMParser().parseFromString(svgString, "image/svg+xml");
- var svgElement = svgDocument.querySelector("svg");
- element2.parentNode.replaceChild(svgElement, element2);
- }
- function getAttrs(element2) {
- return Array.from(element2.attributes).reduce(function(attrs, attr2) {
- attrs[attr2.name] = attr2.value;
- return attrs;
- }, {});
- }
- exports2.default = replace;
- },
- "./src/tags.json": function(module3) {
- module3.exports = { "activity": ["pulse", "health", "action", "motion"], "airplay": ["stream", "cast", "mirroring"], "alert-circle": ["warning", "alert", "danger"], "alert-octagon": ["warning", "alert", "danger"], "alert-triangle": ["warning", "alert", "danger"], "align-center": ["text alignment", "center"], "align-justify": ["text alignment", "justified"], "align-left": ["text alignment", "left"], "align-right": ["text alignment", "right"], "anchor": [], "archive": ["index", "box"], "at-sign": ["mention", "at", "email", "message"], "award": ["achievement", "badge"], "aperture": ["camera", "photo"], "bar-chart": ["statistics", "diagram", "graph"], "bar-chart-2": ["statistics", "diagram", "graph"], "battery": ["power", "electricity"], "battery-charging": ["power", "electricity"], "bell": ["alarm", "notification", "sound"], "bell-off": ["alarm", "notification", "silent"], "bluetooth": ["wireless"], "book-open": ["read", "library"], "book": ["read", "dictionary", "booklet", "magazine", "library"], "bookmark": ["read", "clip", "marker", "tag"], "box": ["cube"], "briefcase": ["work", "bag", "baggage", "folder"], "calendar": ["date"], "camera": ["photo"], "cast": ["chromecast", "airplay"], "circle": ["off", "zero", "record"], "clipboard": ["copy"], "clock": ["time", "watch", "alarm"], "cloud-drizzle": ["weather", "shower"], "cloud-lightning": ["weather", "bolt"], "cloud-rain": ["weather"], "cloud-snow": ["weather", "blizzard"], "cloud": ["weather"], "codepen": ["logo"], "codesandbox": ["logo"], "code": ["source", "programming"], "coffee": ["drink", "cup", "mug", "tea", "cafe", "hot", "beverage"], "columns": ["layout"], "command": ["keyboard", "cmd", "terminal", "prompt"], "compass": ["navigation", "safari", "travel", "direction"], "copy": ["clone", "duplicate"], "corner-down-left": ["arrow", "return"], "corner-down-right": ["arrow"], "corner-left-down": ["arrow"], "corner-left-up": ["arrow"], "corner-right-down": ["arrow"], "corner-right-up": ["arrow"], "corner-up-left": ["arrow"], "corner-up-right": ["arrow"], "cpu": ["processor", "technology"], "credit-card": ["purchase", "payment", "cc"], "crop": ["photo", "image"], "crosshair": ["aim", "target"], "database": ["storage", "memory"], "delete": ["remove"], "disc": ["album", "cd", "dvd", "music"], "dollar-sign": ["currency", "money", "payment"], "droplet": ["water"], "edit": ["pencil", "change"], "edit-2": ["pencil", "change"], "edit-3": ["pencil", "change"], "eye": ["view", "watch"], "eye-off": ["view", "watch", "hide", "hidden"], "external-link": ["outbound"], "facebook": ["logo", "social"], "fast-forward": ["music"], "figma": ["logo", "design", "tool"], "file-minus": ["delete", "remove", "erase"], "file-plus": ["add", "create", "new"], "file-text": ["data", "txt", "pdf"], "film": ["movie", "video"], "filter": ["funnel", "hopper"], "flag": ["report"], "folder-minus": ["directory"], "folder-plus": ["directory"], "folder": ["directory"], "framer": ["logo", "design", "tool"], "frown": ["emoji", "face", "bad", "sad", "emotion"], "gift": ["present", "box", "birthday", "party"], "git-branch": ["code", "version control"], "git-commit": ["code", "version control"], "git-merge": ["code", "version control"], "git-pull-request": ["code", "version control"], "github": ["logo", "version control"], "gitlab": ["logo", "version control"], "globe": ["world", "browser", "language", "translate"], "hard-drive": ["computer", "server", "memory", "data"], "hash": ["hashtag", "number", "pound"], "headphones": ["music", "audio", "sound"], "heart": ["like", "love", "emotion"], "help-circle": ["question mark"], "hexagon": ["shape", "node.js", "logo"], "home": ["house", "living"], "image": ["picture"], "inbox": ["email"], "instagram": ["logo", "camera"], "key": ["password", "login", "authentication", "secure"], "layers": ["stack"], "layout": ["window", "webpage"], "life-bouy": ["help", "life ring", "support"], "link": ["chain", "url"], "link-2": ["chain", "url"], "linkedin": ["logo", "social media"], "list": ["options"], "lock": ["security", "password", "secure"], "log-in": ["sign in", "arrow", "enter"], "log-out": ["sign out", "arrow", "exit"], "mail": ["email", "message"], "map-pin": ["location", "navigation", "travel", "marker"], "map": ["location", "navigation", "travel"], "maximize": ["fullscreen"], "maximize-2": ["fullscreen", "arrows", "expand"], "meh": ["emoji", "face", "neutral", "emotion"], "menu": ["bars", "navigation", "hamburger"], "message-circle": ["comment", "chat"], "message-square": ["comment", "chat"], "mic-off": ["record", "sound", "mute"], "mic": ["record", "sound", "listen"], "minimize": ["exit fullscreen", "close"], "minimize-2": ["exit fullscreen", "arrows", "close"], "minus": ["subtract"], "monitor": ["tv", "screen", "display"], "moon": ["dark", "night"], "more-horizontal": ["ellipsis"], "more-vertical": ["ellipsis"], "mouse-pointer": ["arrow", "cursor"], "move": ["arrows"], "music": ["note"], "navigation": ["location", "travel"], "navigation-2": ["location", "travel"], "octagon": ["stop"], "package": ["box", "container"], "paperclip": ["attachment"], "pause": ["music", "stop"], "pause-circle": ["music", "audio", "stop"], "pen-tool": ["vector", "drawing"], "percent": ["discount"], "phone-call": ["ring"], "phone-forwarded": ["call"], "phone-incoming": ["call"], "phone-missed": ["call"], "phone-off": ["call", "mute"], "phone-outgoing": ["call"], "phone": ["call"], "play": ["music", "start"], "pie-chart": ["statistics", "diagram"], "play-circle": ["music", "start"], "plus": ["add", "new"], "plus-circle": ["add", "new"], "plus-square": ["add", "new"], "pocket": ["logo", "save"], "power": ["on", "off"], "printer": ["fax", "office", "device"], "radio": ["signal"], "refresh-cw": ["synchronise", "arrows"], "refresh-ccw": ["arrows"], "repeat": ["loop", "arrows"], "rewind": ["music"], "rotate-ccw": ["arrow"], "rotate-cw": ["arrow"], "rss": ["feed", "subscribe"], "save": ["floppy disk"], "scissors": ["cut"], "search": ["find", "magnifier", "magnifying glass"], "send": ["message", "mail", "email", "paper airplane", "paper aeroplane"], "settings": ["cog", "edit", "gear", "preferences"], "share-2": ["network", "connections"], "shield": ["security", "secure"], "shield-off": ["security", "insecure"], "shopping-bag": ["ecommerce", "cart", "purchase", "store"], "shopping-cart": ["ecommerce", "cart", "purchase", "store"], "shuffle": ["music"], "skip-back": ["music"], "skip-forward": ["music"], "slack": ["logo"], "slash": ["ban", "no"], "sliders": ["settings", "controls"], "smartphone": ["cellphone", "device"], "smile": ["emoji", "face", "happy", "good", "emotion"], "speaker": ["audio", "music"], "star": ["bookmark", "favorite", "like"], "stop-circle": ["media", "music"], "sun": ["brightness", "weather", "light"], "sunrise": ["weather", "time", "morning", "day"], "sunset": ["weather", "time", "evening", "night"], "tablet": ["device"], "tag": ["label"], "target": ["logo", "bullseye"], "terminal": ["code", "command line", "prompt"], "thermometer": ["temperature", "celsius", "fahrenheit", "weather"], "thumbs-down": ["dislike", "bad", "emotion"], "thumbs-up": ["like", "good", "emotion"], "toggle-left": ["on", "off", "switch"], "toggle-right": ["on", "off", "switch"], "tool": ["settings", "spanner"], "trash": ["garbage", "delete", "remove", "bin"], "trash-2": ["garbage", "delete", "remove", "bin"], "triangle": ["delta"], "truck": ["delivery", "van", "shipping", "transport", "lorry"], "tv": ["television", "stream"], "twitch": ["logo"], "twitter": ["logo", "social"], "type": ["text"], "umbrella": ["rain", "weather"], "unlock": ["security"], "user-check": ["followed", "subscribed"], "user-minus": ["delete", "remove", "unfollow", "unsubscribe"], "user-plus": ["new", "add", "create", "follow", "subscribe"], "user-x": ["delete", "remove", "unfollow", "unsubscribe", "unavailable"], "user": ["person", "account"], "users": ["group"], "video-off": ["camera", "movie", "film"], "video": ["camera", "movie", "film"], "voicemail": ["phone"], "volume": ["music", "sound", "mute"], "volume-1": ["music", "sound"], "volume-2": ["music", "sound"], "volume-x": ["music", "sound", "mute"], "watch": ["clock", "time"], "wifi-off": ["disabled"], "wifi": ["connection", "signal", "wireless"], "wind": ["weather", "air"], "x-circle": ["cancel", "close", "delete", "remove", "times", "clear"], "x-octagon": ["delete", "stop", "alert", "warning", "times", "clear"], "x-square": ["cancel", "close", "delete", "remove", "times", "clear"], "x": ["cancel", "close", "delete", "remove", "times", "clear"], "youtube": ["logo", "video", "play"], "zap-off": ["flash", "camera", "lightning"], "zap": ["flash", "camera", "lightning"], "zoom-in": ["magnifying glass"], "zoom-out": ["magnifying glass"] };
- },
- "./src/to-svg.js": function(module3, exports2, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports2, "__esModule", {
- value: true
- });
- var _icons = __webpack_require__("./src/icons.js");
- var _icons2 = _interopRequireDefault(_icons);
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
- function toSvg(name) {
- var attrs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead.");
- if (!name) {
- throw new Error("The required `key` (icon name) parameter is missing.");
- }
- if (!_icons2.default[name]) {
- throw new Error("No icon matching '" + name + "'. See the complete list of icons at https://feathericons.com");
- }
- return _icons2.default[name].toSvg(attrs);
- }
- exports2.default = toSvg;
- },
- 0: function(module3, exports2, __webpack_require__) {
- __webpack_require__("./node_modules/core-js/es/array/from.js");
- module3.exports = __webpack_require__("./src/index.js");
- }
- });
- });
- }
-});
-
-// 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 __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;
- Object.defineProperty(o, k2, { enumerable: true, get: function() {
- return m[k];
- } });
- } : 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;
- };
- 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);
- });
- }
-});
-
-// src/main.ts
-__export(exports, {
- default: () => ObsidianGit
-});
-var import_obsidian14 = __toModule(require("obsidian"));
-var path2 = __toModule(require("path"));
-
-// src/promiseQueue.ts
-var PromiseQueue = class {
- constructor() {
- this.tasks = [];
- }
- addTask(task) {
- this.tasks.push(task);
- if (this.tasks.length === 1) {
- this.handleTask();
- }
- }
- handleTask() {
- return __async(this, null, function* () {
- 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" });
- new import_obsidian.Setting(containerEl).setName("Vault backup interval (minutes)").setDesc("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 backup enabled! Every ${plugin.settings.autoSaveInterval} minutes.`);
- } else if (plugin.settings.autoSaveInterval <= 0) {
- plugin.clearAutoBackup() && new import_obsidian.Notice("Automatic backup disabled!");
- }
- } else {
- new import_obsidian.Notice("Please specify a valid number.");
- }
- }));
- new import_obsidian.Setting(containerEl).setName("If turned on, do auto backup every X minutes after last change. Prevents auto backup while editing a file. If turned off, do auto backup 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);
- }
- }));
- 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("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("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("Commit message on auto backup").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();
- }));
- 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();
- }));
- 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("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("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("Disable push").setDesc("Do not push changes to the remote repository").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();
- }));
- 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("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("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates)").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("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");
- });
- });
- 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" });
- } else {
- keys.createEl("kbd", { text: "CTRL + SHIFT + I" });
- }
- }
-};
-
-// src/statusBar.ts
-var import_obsidian2 = __toModule(require("obsidian"));
-
-// src/types.ts
-var PluginState;
-(function(PluginState2) {
- PluginState2[PluginState2["idle"] = 0] = "idle";
- PluginState2[PluginState2["status"] = 1] = "status";
- PluginState2[PluginState2["pull"] = 2] = "pull";
- PluginState2[PluginState2["add"] = 3] = "add";
- PluginState2[PluginState2["commit"] = 4] = "commit";
- PluginState2[PluginState2["push"] = 5] = "push";
- PluginState2[PluginState2["conflicted"] = 6] = "conflicted";
-})(PluginState || (PluginState = {}));
-
-// 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() {
- 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.statusBarEl, "feather-refresh-cw");
- this.statusBarEl.addClass(this.base + "status");
- break;
- case PluginState.add:
- this.statusBarEl.ariaLabel = "Adding files...";
- (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-refresh-w");
- this.statusBarEl.addClass(this.base + "add");
- break;
- case PluginState.commit:
- this.statusBarEl.ariaLabel = "Committing changes...";
- (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-git-commit");
- this.statusBarEl.addClass(this.base + "commit");
- break;
- case PluginState.push:
- this.statusBarEl.ariaLabel = "Pushing changes...";
- (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-upload");
- this.statusBarEl.addClass(this.base + "push");
- break;
- case PluginState.pull:
- this.statusBarEl.ariaLabel = "Pulling changes...";
- (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-download");
- this.statusBarEl.addClass(this.base + "pull");
- break;
- case PluginState.conflicted:
- this.statusBarEl.ariaLabel = "You have conflict files...";
- (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-alert-circle");
- this.statusBarEl.addClass(this.base + "conflict");
- break;
- default:
- this.statusBarEl.ariaLabel = "Failed on initialization!";
- (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-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 = `Last Git update: ${fromNow}`;
- } else {
- this.statusBarEl.ariaLabel = "Git is ready";
- }
- (0, import_obsidian2.setIcon)(this.statusBarEl, "feather-check");
- this.statusBarEl.addClass(this.base + "idle");
- }
-};
-
-// src/ui/modals/changedFilesModal.ts
-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.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.path}`;
- }
- onChooseItem(item, _) {
- if (this.plugin.app.metadataCache.getFirstLinkpathDest(item.path, "") == null) {
- this.app.openWithDefaultApp(item.path);
- } else {
- this.plugin.app.workspace.openLinkText(item.path, "/");
- }
- }
-};
-
-// 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.");
- }
- 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
-var DEFAULT_SETTINGS = {
- commitMessage: "vault backup: {{date}}",
- autoCommitMessage: void 0,
- commitDateFormat: "YYYY-MM-DD HH:mm:ss",
- autoSaveInterval: 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
-};
-var GIT_VIEW_CONFIG = {
- type: "git-view",
- name: "Source Control",
- icon: "feather-git-pull-request"
-};
-var DIFF_VIEW_CONFIG = {
- type: "diff-view",
- name: "Diff View",
- icon: "feather-git-pull-request"
-};
-
-// 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/simpleGit.ts
-var import_child_process = __toModule(require("child_process"));
-var path = __toModule(require("path"));
-var simple = __toModule(require_src3());
-
-// 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 first = children2.first();
- const restPath = first.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: first });
- children2.remove(first);
- }
- }
- 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);
- this.setGitInstance();
- }
- setGitInstance() {
- return __async(this, null, function* () {
- if (this.isGitInstalled()) {
- const adapter = this.app.vault.adapter;
- const path3 = adapter.getBasePath();
- this.git = (0, simple.default)({
- baseDir: path3,
- 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.path);
- e.path = res.path;
- e.from = res.from;
- e.working_dir = e.working_dir === "?" ? "U" : e.working_dir;
- return e;
- }),
- staged: status.files.filter((e) => e.index !== " " && e.index != "?").map((e) => {
- const res = this.formatPath(e.path, e.index === "R");
- e.path = res.path;
- e.from = res.from;
- return e;
- }),
- conflicted: status.conflicted.map((e) => this.formatPath(e).path)
- };
- });
- }
- formatPath(path3, renamed = false) {
- function format(path4) {
- if (path4.startsWith('"') && path4.endsWith('"')) {
- return path4.substring(1, path4.length - 1);
- } else {
- return path4;
- }
- }
- if (renamed) {
- const paths = path3.split(" -> ").map((e) => format(e));
- return {
- from: paths[0],
- path: paths[1]
- };
- } else {
- return {
- path: format(path3)
- };
- }
- }
- commitAll(message) {
- return __async(this, null, function* () {
- if (this.plugin.settings.updateSubmodules) {
- this.plugin.setState(PluginState.commit);
- yield this.git.subModule(["foreach", "--recursive", `git add -A && if [ ! -z "$(git status --porcelain)" ]; then git commit -m "${yield this.formatCommitMessage(message)}"; fi`], (err) => this.onError(err));
- }
- this.plugin.setState(PluginState.add);
- yield this.git.add("-A", (err) => this.onError(err));
- 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(filepath) {
- return __async(this, null, function* () {
- this.plugin.setState(PluginState.add);
- yield this.git.add(["--", filepath], (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(filepath) {
- return __async(this, null, function* () {
- this.plugin.setState(PluginState.add);
- yield this.git.reset(["--", filepath], (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.tracking], (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}`);
- const status = yield this.status();
- if (status.conflicted.length > 0) {
- this.plugin.handleConflict(status.conflicted);
- }
- return;
- }
- } 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}`);
- }
- }
- console.log(localCommit);
- const filesChanged = yield this.git.diff([`${localCommit}..${upstreamCommit}`, "--name-only"]);
- return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).length;
- } else {
- return 0;
- }
- });
- }
- 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])).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));
- }
- 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
- };
- });
- }
- 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));
- 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();
- }
- getDiffString(filePath) {
- return __async(this, null, function* () {
- return yield this.git.diff([filePath]);
- });
- }
- isGitInstalled() {
- const command = (0, import_child_process.spawnSync)(this.plugin.settings.gitPath || "git", ["--version"], {
- stdio: "ignore"
- });
- if (command.error) {
- console.error(command.error);
- return false;
- }
- return true;
- }
- onError(error) {
- if (error) {
- this.plugin.displayError(error.message);
- this.plugin.setState(PluginState.idle);
- }
- }
-};
-
-// src/ui/diff/diffView.ts
-var import_diff2html = __toModule(require_diff2html());
-var import_obsidian6 = __toModule(require("obsidian"));
-var DiffView = class extends import_obsidian6.ItemView {
- constructor(leaf, plugin) {
- super(leaf);
- this.plugin = plugin;
- this.gettingDiff = false;
- this.parser = new DOMParser();
- this.registerEvent(this.app.workspace.on("active-leaf-change", (leaf2) => {
- if (leaf2.view instanceof import_obsidian6.MarkdownView) {
- this.filePath = leaf2.view.file.path;
- } else {
- this.filePath = null;
- }
- this.refresh();
- }));
- addEventListener("diff-update", this.firstOpen.bind(this));
- this.intervalId = window.setInterval(() => this.refresh(), 1e4);
- this.registerInterval(this.intervalId);
- }
- firstOpen(event) {
- this.filePath = event.detail.path;
- this.refresh();
- }
- getViewType() {
- return DIFF_VIEW_CONFIG.type;
- }
- getDisplayText() {
- return DIFF_VIEW_CONFIG.name;
- }
- getIcon() {
- return DIFF_VIEW_CONFIG.icon;
- }
- onClose() {
- removeEventListener("diff-update", this.firstOpen.bind(this));
- window.clearInterval(this.intervalId);
- return super.onClose();
- }
- onOpen() {
- this.refresh();
- return super.onOpen();
- }
- refresh() {
- return __async(this, null, function* () {
- if (this.filePath && !this.gettingDiff) {
- if (!this.app.vault.getAbstractFileByPath(this.filePath)) {
- this.contentEl.empty();
- const div = this.contentEl.createDiv({ cls: "diff-err" });
- div.createSpan({ text: "\u26A0\uFE0F", cls: "diff-err-sign" });
- div.createEl("br");
- div.createSpan({ text: this.filePath + " was deleted" });
- } else {
- this.gettingDiff = true;
- const diff = this.parser.parseFromString((0, import_diff2html.html)(yield this.plugin.gitManager.getDiffString(this.filePath)), "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.filePath });
- }
- this.gettingDiff = false;
- }
- }
- });
- }
-};
-
-// node_modules/obsidian-community-lib/dist/utils.js
-var feather = __toModule(require_feather());
-var import_obsidian7 = __toModule(require("obsidian"));
-function addFeatherIcon(name, attr2 = { viewBox: "0 0 24 24", width: "100", height: "100" }) {
- if (feather.icons[name]) {
- const iconName = `feather-${name}`;
- (0, import_obsidian7.addIcon)(iconName, feather.icons[name].toSvg(attr2));
- return iconName;
- } else {
- throw Error(`This Icon (${name}) doesn't exist in the Feather Library.`);
- }
-}
-function hoverPreview(event, view, to) {
- const targetEl = event.target;
- view.app.workspace.trigger("hover-link", {
- event,
- source: view.getViewType(),
- hoverParent: view,
- targetEl,
- linktext: to
- });
-}
-function createNewMDNote(app, newName, currFilePath = "") {
- return __async(this, null, function* () {
- const newFileFolder = app.fileManager.getNewFileParent(currFilePath).path;
- const newFilePath = (0, import_obsidian7.normalizePath)(`${newFileFolder}${newFileFolder === "/" ? "" : "/"}${addMD(newName)}`);
- return yield app.vault.create(newFilePath, "");
- });
-}
-var addMD = (noteName) => {
- return noteName.endsWith(".md") ? noteName : noteName + ".md";
-};
-function openOrSwitch(_0, _1, _2) {
- return __async(this, arguments, function* (app, dest, event, options = { createNewFile: true }) {
- const { workspace } = app;
- let destFile = app.metadataCache.getFirstLinkpathDest(dest, "");
- if (!destFile && options.createNewFile) {
- destFile = yield createNewMDNote(app, dest);
- } else if (!destFile && !options.createNewFile)
- return;
- const leavesWithDestAlreadyOpen = [];
- workspace.iterateAllLeaves((leaf) => {
- var _a;
- if (leaf.view instanceof import_obsidian7.MarkdownView) {
- const file = (_a = leaf.view) === null || _a === void 0 ? void 0 : _a.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/icons.ts
-function addIcons() {
- addFeatherIcon("git-pull-request");
- addFeatherIcon("check");
- addFeatherIcon("refresh-cw");
- addFeatherIcon("plus-circle");
- addFeatherIcon("minus-circle");
- addFeatherIcon("upload");
- addFeatherIcon("download");
- addFeatherIcon("plus");
- addFeatherIcon("skip-back");
- addFeatherIcon("minus");
- addFeatherIcon("alert-circle");
- addFeatherIcon("alert-triangle");
- addFeatherIcon("git-commit");
- addFeatherIcon("edit");
- addFeatherIcon("folder");
- addFeatherIcon("list");
-}
-
-// src/ui/modals/generalModal.ts
-var import_obsidian8 = __toModule(require("obsidian"));
-var GeneralModal = class extends import_obsidian8.SuggestModal {
- constructor(app, remotes, placeholder) {
- super(app);
- this.resolve = null;
- this.list = remotes;
- this.setPlaceholder(placeholder);
- }
- open() {
- super.open();
- return new Promise((resolve) => {
- this.resolve = resolve;
- });
- }
- selectSuggestion(value, evt) {
- if (this.resolve)
- this.resolve(value);
- super.selectSuggestion(value, evt);
- }
- onClose() {
- if (this.resolve)
- this.resolve(void 0);
- }
- getSuggestions(query) {
- return [query.length > 0 ? query : "...", ...this.list];
- }
- renderSuggestion(value, el) {
- el.innerText = value;
- }
- onChooseSuggestion(item, _) {
- }
-};
-
-// src/ui/sidebar/sidebarView.ts
-var import_obsidian13 = __toModule(require("obsidian"));
-
-// node_modules/svelte/internal/index.mjs
-function noop() {
-}
-var identity = (x) => x;
-function run(fn) {
- return fn();
-}
-function blank_object() {
- return Object.create(null);
-}
-function run_all(fns) {
- fns.forEach(run);
-}
-function is_function(thing) {
- return typeof thing === "function";
-}
-function safe_not_equal(a, b) {
- return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function");
-}
-function is_empty(obj) {
- return Object.keys(obj).length === 0;
-}
-var is_client = typeof window !== "undefined";
-var now = is_client ? () => window.performance.now() : () => Date.now();
-var raf = is_client ? (cb) => requestAnimationFrame(cb) : noop;
-var tasks = new Set();
-function run_tasks(now2) {
- tasks.forEach((task) => {
- if (!task.c(now2)) {
- tasks.delete(task);
- task.f();
- }
- });
- if (tasks.size !== 0)
- raf(run_tasks);
-}
-function loop(callback) {
- let task;
- if (tasks.size === 0)
- raf(run_tasks);
- return {
- promise: new Promise((fulfill) => {
- tasks.add(task = { c: callback, f: fulfill });
- }),
- abort() {
- tasks.delete(task);
- }
- };
-}
-var is_hydrating = false;
-function start_hydrating() {
- is_hydrating = true;
-}
-function end_hydrating() {
- is_hydrating = false;
-}
-function append(target, node) {
- target.appendChild(node);
-}
-function append_styles(target, style_sheet_id, styles) {
- const append_styles_to = get_root_for_style(target);
- if (!append_styles_to.getElementById(style_sheet_id)) {
- const style = element("style");
- style.id = style_sheet_id;
- style.textContent = styles;
- append_stylesheet(append_styles_to, style);
- }
-}
-function get_root_for_style(node) {
- if (!node)
- return document;
- const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
- if (root && root.host) {
- return root;
- }
- return node.ownerDocument;
-}
-function append_empty_stylesheet(node) {
- const style_element = element("style");
- append_stylesheet(get_root_for_style(node), style_element);
- return style_element.sheet;
-}
-function append_stylesheet(node, style) {
- append(node.head || node, style);
-}
-function insert(target, node, anchor) {
- target.insertBefore(node, anchor || null);
-}
-function detach(node) {
- node.parentNode.removeChild(node);
-}
-function destroy_each(iterations, detaching) {
- for (let i = 0; i < iterations.length; i += 1) {
- if (iterations[i])
- iterations[i].d(detaching);
- }
-}
-function element(name) {
- return document.createElement(name);
-}
-function text(data) {
- return document.createTextNode(data);
-}
-function space() {
- return text(" ");
-}
-function empty() {
- return text("");
-}
-function listen(node, event, handler, options) {
- node.addEventListener(event, handler, options);
- return () => node.removeEventListener(event, handler, options);
-}
-function attr(node, attribute, value) {
- if (value == null)
- node.removeAttribute(attribute);
- else if (node.getAttribute(attribute) !== value)
- node.setAttribute(attribute, value);
-}
-function children(element2) {
- return Array.from(element2.childNodes);
-}
-function set_data(text2, data) {
- data = "" + data;
- if (text2.wholeText !== data)
- text2.data = data;
-}
-function set_input_value(input, value) {
- input.value = value == null ? "" : value;
-}
-function toggle_class(element2, name, toggle) {
- element2.classList[toggle ? "add" : "remove"](name);
-}
-function custom_event(type, detail, bubbles = false) {
- const e = document.createEvent("CustomEvent");
- e.initCustomEvent(type, bubbles, false, detail);
- return e;
-}
-var managed_styles = new Map();
-var active = 0;
-function hash(str) {
- let hash2 = 5381;
- let i = str.length;
- while (i--)
- hash2 = (hash2 << 5) - hash2 ^ str.charCodeAt(i);
- return hash2 >>> 0;
-}
-function create_style_information(doc, node) {
- const info = { stylesheet: append_empty_stylesheet(node), rules: {} };
- managed_styles.set(doc, info);
- return info;
-}
-function create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {
- const step = 16.666 / duration;
- let keyframes = "{\n";
- for (let p = 0; p <= 1; p += step) {
- const t = a + (b - a) * ease(p);
- keyframes += p * 100 + `%{${fn(t, 1 - t)}}
-`;
- }
- const rule = keyframes + `100% {${fn(b, 1 - b)}}
-}`;
- const name = `__svelte_${hash(rule)}_${uid}`;
- const doc = get_root_for_style(node);
- const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);
- if (!rules[name]) {
- rules[name] = true;
- stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);
- }
- const animation = node.style.animation || "";
- node.style.animation = `${animation ? `${animation}, ` : ""}${name} ${duration}ms linear ${delay}ms 1 both`;
- active += 1;
- return name;
-}
-function delete_rule(node, name) {
- const previous = (node.style.animation || "").split(", ");
- const next = previous.filter(name ? (anim) => anim.indexOf(name) < 0 : (anim) => anim.indexOf("__svelte") === -1);
- const deleted = previous.length - next.length;
- if (deleted) {
- node.style.animation = next.join(", ");
- active -= deleted;
- if (!active)
- clear_rules();
- }
-}
-function clear_rules() {
- raf(() => {
- if (active)
- return;
- managed_styles.forEach((info) => {
- const { stylesheet } = info;
- let i = stylesheet.cssRules.length;
- while (i--)
- stylesheet.deleteRule(i);
- info.rules = {};
- });
- managed_styles.clear();
- });
-}
-var current_component;
-function set_current_component(component) {
- current_component = component;
-}
-function get_current_component() {
- if (!current_component)
- throw new Error("Function called outside component initialization");
- return current_component;
-}
-function onDestroy(fn) {
- get_current_component().$$.on_destroy.push(fn);
-}
-function bubble(component, event) {
- const callbacks = component.$$.callbacks[event.type];
- if (callbacks) {
- callbacks.slice().forEach((fn) => fn.call(this, event));
- }
-}
-var dirty_components = [];
-var binding_callbacks = [];
-var render_callbacks = [];
-var flush_callbacks = [];
-var resolved_promise = Promise.resolve();
-var update_scheduled = false;
-function schedule_update() {
- if (!update_scheduled) {
- update_scheduled = true;
- resolved_promise.then(flush);
- }
-}
-function add_render_callback(fn) {
- render_callbacks.push(fn);
-}
-var seen_callbacks = new Set();
-var flushidx = 0;
-function flush() {
- const saved_component = current_component;
- do {
- while (flushidx < dirty_components.length) {
- const component = dirty_components[flushidx];
- flushidx++;
- set_current_component(component);
- update(component.$$);
- }
- set_current_component(null);
- dirty_components.length = 0;
- flushidx = 0;
- while (binding_callbacks.length)
- binding_callbacks.pop()();
- for (let i = 0; i < render_callbacks.length; i += 1) {
- const callback = render_callbacks[i];
- if (!seen_callbacks.has(callback)) {
- seen_callbacks.add(callback);
- callback();
- }
- }
- render_callbacks.length = 0;
- } while (dirty_components.length);
- while (flush_callbacks.length) {
- flush_callbacks.pop()();
- }
- update_scheduled = false;
- seen_callbacks.clear();
- set_current_component(saved_component);
-}
-function update($$) {
- if ($$.fragment !== null) {
- $$.update();
- run_all($$.before_update);
- const dirty = $$.dirty;
- $$.dirty = [-1];
- $$.fragment && $$.fragment.p($$.ctx, dirty);
- $$.after_update.forEach(add_render_callback);
- }
-}
-var promise;
-function wait2() {
- if (!promise) {
- promise = Promise.resolve();
- promise.then(() => {
- promise = null;
- });
- }
- return promise;
-}
-function dispatch(node, direction, kind) {
- node.dispatchEvent(custom_event(`${direction ? "intro" : "outro"}${kind}`));
-}
-var outroing = new Set();
-var outros;
-function group_outros() {
- outros = {
- r: 0,
- c: [],
- p: outros
- };
-}
-function check_outros() {
- if (!outros.r) {
- run_all(outros.c);
- }
- outros = outros.p;
-}
-function transition_in(block, local) {
- if (block && block.i) {
- outroing.delete(block);
- block.i(local);
- }
-}
-function transition_out(block, local, detach2, callback) {
- if (block && block.o) {
- if (outroing.has(block))
- return;
- outroing.add(block);
- outros.c.push(() => {
- outroing.delete(block);
- if (callback) {
- if (detach2)
- block.d(1);
- callback();
- }
- });
- block.o(local);
- }
-}
-var null_transition = { duration: 0 };
-function create_bidirectional_transition(node, fn, params, intro) {
- let config = fn(node, params);
- let t = intro ? 0 : 1;
- let running_program = null;
- let pending_program = null;
- let animation_name = null;
- function clear_animation() {
- if (animation_name)
- delete_rule(node, animation_name);
- }
- function init2(program, duration) {
- const d = program.b - t;
- duration *= Math.abs(d);
- return {
- a: t,
- b: program.b,
- d,
- duration,
- start: program.start,
- end: program.start + duration,
- group: program.group
- };
- }
- function go(b) {
- const { delay = 0, duration = 300, easing = identity, tick: tick2 = noop, css } = config || null_transition;
- const program = {
- start: now() + delay,
- b
- };
- if (!b) {
- program.group = outros;
- outros.r += 1;
- }
- if (running_program || pending_program) {
- pending_program = program;
- } else {
- if (css) {
- clear_animation();
- animation_name = create_rule(node, t, b, duration, delay, easing, css);
- }
- if (b)
- tick2(0, 1);
- running_program = init2(program, duration);
- add_render_callback(() => dispatch(node, b, "start"));
- loop((now2) => {
- if (pending_program && now2 > pending_program.start) {
- running_program = init2(pending_program, duration);
- pending_program = null;
- dispatch(node, running_program.b, "start");
- if (css) {
- clear_animation();
- animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);
- }
- }
- if (running_program) {
- if (now2 >= running_program.end) {
- tick2(t = running_program.b, 1 - t);
- dispatch(node, running_program.b, "end");
- if (!pending_program) {
- if (running_program.b) {
- clear_animation();
- } else {
- if (!--running_program.group.r)
- run_all(running_program.group.c);
- }
- }
- running_program = null;
- } else if (now2 >= running_program.start) {
- const p = now2 - running_program.start;
- t = running_program.a + running_program.d * easing(p / running_program.duration);
- tick2(t, 1 - t);
- }
- }
- return !!(running_program || pending_program);
- });
- }
- }
- return {
- run(b) {
- if (is_function(config)) {
- wait2().then(() => {
- config = config();
- go(b);
- });
- } else {
- go(b);
- }
- },
- end() {
- clear_animation();
- running_program = pending_program = null;
- }
- };
-}
-var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
-var boolean_attributes = new Set([
- "allowfullscreen",
- "allowpaymentrequest",
- "async",
- "autofocus",
- "autoplay",
- "checked",
- "controls",
- "default",
- "defer",
- "disabled",
- "formnovalidate",
- "hidden",
- "ismap",
- "loop",
- "multiple",
- "muted",
- "nomodule",
- "novalidate",
- "open",
- "playsinline",
- "readonly",
- "required",
- "reversed",
- "selected"
-]);
-function create_component(block) {
- block && block.c();
-}
-function mount_component(component, target, anchor, customElement) {
- const { fragment, on_mount, on_destroy, 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);
- } else {
- run_all(new_on_destroy);
- }
- component.$$.on_mount = [];
- });
- }
- after_update.forEach(add_render_callback);
-}
-function destroy_component(component, detaching) {
- const $$ = component.$$;
- if ($$.fragment !== null) {
- run_all($$.on_destroy);
- $$.fragment && $$.fragment.d(detaching);
- $$.on_destroy = $$.fragment = null;
- $$.ctx = [];
- }
-}
-function make_dirty(component, i) {
- if (component.$$.dirty[0] === -1) {
- dirty_components.push(component);
- schedule_update();
- component.$$.dirty.fill(0);
- }
- component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
-}
-function init(component, options, instance5, create_fragment5, not_equal, props, append_styles2, dirty = [-1]) {
- const parent_component = current_component;
- set_current_component(component);
- const $$ = component.$$ = {
- fragment: null,
- ctx: null,
- props,
- update: noop,
- not_equal,
- bound: blank_object(),
- on_mount: [],
- on_destroy: [],
- on_disconnect: [],
- before_update: [],
- after_update: [],
- context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
- callbacks: blank_object(),
- dirty,
- skip_bound: false,
- root: options.target || parent_component.$$.root
- };
- append_styles2 && append_styles2($$.root);
- let ready2 = false;
- $$.ctx = instance5 ? instance5(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)
- make_dirty(component, i);
- }
- return ret;
- }) : [];
- $$.update();
- ready2 = true;
- run_all($$.before_update);
- $$.fragment = create_fragment5 ? create_fragment5($$.ctx) : false;
- if (options.target) {
- if (options.hydrate) {
- start_hydrating();
- const nodes = children(options.target);
- $$.fragment && $$.fragment.l(nodes);
- nodes.forEach(detach);
- } else {
- $$.fragment && $$.fragment.c();
- }
- if (options.intro)
- transition_in(component.$$.fragment);
- mount_component(component, options.target, options.anchor, options.customElement);
- end_hydrating();
- flush();
- }
- set_current_component(parent_component);
-}
-var SvelteElement;
-if (typeof HTMLElement === "function") {
- SvelteElement = class extends HTMLElement {
- constructor() {
- super();
- this.attachShadow({ mode: "open" });
- }
- connectedCallback() {
- const { on_mount } = this.$$;
- this.$$.on_disconnect = on_mount.map(run).filter(is_function);
- for (const key2 in this.$$.slotted) {
- this.appendChild(this.$$.slotted[key2]);
- }
- }
- attributeChangedCallback(attr2, _oldValue, newValue) {
- this[attr2] = newValue;
- }
- disconnectedCallback() {
- run_all(this.$$.on_disconnect);
- }
- $destroy() {
- destroy_component(this, 1);
- this.$destroy = noop;
- }
- $on(type, callback) {
- const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
- callbacks.push(callback);
- return () => {
- const index = callbacks.indexOf(callback);
- if (index !== -1)
- callbacks.splice(index, 1);
- };
- }
- $set($$props) {
- if (this.$$set && !is_empty($$props)) {
- this.$$.skip_bound = true;
- this.$$set($$props);
- this.$$.skip_bound = false;
- }
- }
- };
-}
-var SvelteComponent = class {
- $destroy() {
- destroy_component(this, 1);
- this.$destroy = noop;
- }
- $on(type, callback) {
- const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
- callbacks.push(callback);
- return () => {
- const index = callbacks.indexOf(callback);
- if (index !== -1)
- callbacks.splice(index, 1);
- };
- }
- $set($$props) {
- if (this.$$set && !is_empty($$props)) {
- this.$$.skip_bound = true;
- this.$$set($$props);
- this.$$.skip_bound = false;
- }
- }
-};
-
-// node_modules/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
-} = import_tslib.default;
-
-// src/ui/sidebar/gitView.svelte
-var import_obsidian12 = __toModule(require("obsidian"));
-
-// node_modules/svelte/easing/index.mjs
-function cubicOut(t) {
- const f = t - 1;
- return f * f * f + 1;
-}
-
-// node_modules/svelte/transition/index.mjs
-function slide(node, { delay = 0, duration = 400, easing = cubicOut } = {}) {
- const style = getComputedStyle(node);
- const opacity = +style.opacity;
- const height = parseFloat(style.height);
- const padding_top = parseFloat(style.paddingTop);
- const padding_bottom = parseFloat(style.paddingBottom);
- const margin_top = parseFloat(style.marginTop);
- const margin_bottom = parseFloat(style.marginBottom);
- const border_top_width = parseFloat(style.borderTopWidth);
- const border_bottom_width = parseFloat(style.borderBottomWidth);
- return {
- delay,
- duration,
- easing,
- css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};height: ${t * height}px;padding-top: ${t * padding_top}px;padding-bottom: ${t * padding_bottom}px;margin-top: ${t * margin_top}px;margin-bottom: ${t * margin_bottom}px;border-top-width: ${t * border_top_width}px;border-bottom-width: ${t * border_bottom_width}px;`
- };
-}
-
-// src/ui/sidebar/components/fileComponent.svelte
-var import_obsidian10 = __toModule(require("obsidian"));
-
-// src/ui/modals/discardModal.ts
-var import_obsidian9 = __toModule(require("obsidian"));
-var DiscardModal = class extends import_obsidian9.Modal {
- constructor(app, deletion, filename) {
- super(app);
- this.deletion = deletion;
- this.filename = filename;
- this.resolve = null;
- }
- myOpen() {
- this.open();
- return new Promise((resolve) => {
- this.resolve = resolve;
- });
- }
- onOpen() {
- let { 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();
- div.addClass("obsidian-git-center");
- div.createEl("button", { text: "Cancel" }).addEventListener("click", () => {
- if (this.resolve)
- this.resolve(false);
- return this.close();
- });
- div.createEl("button", {
- cls: "mod-cta",
- text: "Confirm"
- }).addEventListener("click", () => __async(this, null, function* () {
- if (this.resolve)
- this.resolve(true);
- this.close();
- }));
- }
- onClose() {
- let { contentEl } = this;
- contentEl.empty();
- }
-};
-
-// src/ui/sidebar/components/fileComponent.svelte
-function add_css(target) {
- append_styles(target, "svelte-1ncg2cs", "main.svelte-1ncg2cs.svelte-1ncg2cs.svelte-1ncg2cs{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-1ncg2cs .path.svelte-1ncg2cs.svelte-1ncg2cs{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-1ncg2cs .path.svelte-1ncg2cs.svelte-1ncg2cs:hover{color:var(--text-normal);transition:all 200ms}main.svelte-1ncg2cs .tools.svelte-1ncg2cs.svelte-1ncg2cs{display:flex;align-items:center}main.svelte-1ncg2cs .tools .type.svelte-1ncg2cs.svelte-1ncg2cs{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-1ncg2cs .tools .type[data-type=M].svelte-1ncg2cs.svelte-1ncg2cs{color:orange}main.svelte-1ncg2cs .tools .type[data-type=D].svelte-1ncg2cs.svelte-1ncg2cs{color:red}main.svelte-1ncg2cs .tools .buttons.svelte-1ncg2cs.svelte-1ncg2cs{display:flex}main.svelte-1ncg2cs .tools .buttons.svelte-1ncg2cs>.svelte-1ncg2cs{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-1ncg2cs .tools .buttons.svelte-1ncg2cs>.svelte-1ncg2cs:hover{color:var(--text-normal);background-color:var(--interactive-accent)}");
-}
-function create_fragment(ctx) {
- let main;
- let span0;
- let t0_value = ctx[0].path.split("/").last().replace(".md", "") + "";
- let t0;
- let span0_aria_label_value;
- let t1;
- let div3;
- let div2;
- let div0;
- let t2;
- let div1;
- let t3;
- let span1;
- let t4_value = ctx[0].working_dir + "";
- let t4;
- let span1_data_type_value;
- let mounted;
- let dispose;
- return {
- c() {
- main = element("main");
- span0 = element("span");
- t0 = text(t0_value);
- t1 = space();
- div3 = element("div");
- div2 = element("div");
- div0 = element("div");
- t2 = space();
- div1 = element("div");
- t3 = space();
- span1 = element("span");
- t4 = text(t4_value);
- attr(span0, "class", "path svelte-1ncg2cs");
- attr(span0, "aria-label-position", ctx[2]);
- attr(span0, "aria-label", span0_aria_label_value = ctx[0].path.split("/").last() != ctx[0].path ? ctx[0].path : "");
- attr(div0, "data-icon", "feather-skip-back");
- attr(div0, "aria-label", "Discard");
- attr(div0, "class", "svelte-1ncg2cs");
- attr(div1, "data-icon", "feather-plus");
- attr(div1, "aria-label", "Stage");
- attr(div1, "class", "svelte-1ncg2cs");
- attr(div2, "class", "buttons svelte-1ncg2cs");
- attr(span1, "class", "type svelte-1ncg2cs");
- attr(span1, "data-type", span1_data_type_value = ctx[0].working_dir);
- attr(div3, "class", "tools svelte-1ncg2cs");
- attr(main, "class", "svelte-1ncg2cs");
- },
- m(target, anchor) {
- insert(target, main, anchor);
- append(main, span0);
- append(span0, t0);
- append(main, t1);
- append(main, div3);
- append(div3, div2);
- append(div2, div0);
- ctx[12](div0);
- append(div2, t2);
- append(div2, div1);
- ctx[13](div1);
- append(div3, t3);
- append(div3, span1);
- append(span1, t4);
- if (!mounted) {
- dispose = [
- listen(span0, "mouseover", ctx[3]),
- listen(span0, "click", ctx[4]),
- listen(span0, "dblclick", ctx[6]),
- listen(span0, "focus", ctx[11]),
- listen(div0, "click", ctx[7]),
- listen(div1, "click", ctx[5])
- ];
- mounted = true;
- }
- },
- p(ctx2, [dirty]) {
- if (dirty & 1 && t0_value !== (t0_value = ctx2[0].path.split("/").last().replace(".md", "") + ""))
- set_data(t0, t0_value);
- if (dirty & 4) {
- attr(span0, "aria-label-position", ctx2[2]);
- }
- if (dirty & 1 && span0_aria_label_value !== (span0_aria_label_value = ctx2[0].path.split("/").last() != ctx2[0].path ? ctx2[0].path : "")) {
- attr(span0, "aria-label", span0_aria_label_value);
- }
- if (dirty & 1 && t4_value !== (t4_value = ctx2[0].working_dir + ""))
- set_data(t4, t4_value);
- if (dirty & 1 && span1_data_type_value !== (span1_data_type_value = ctx2[0].working_dir)) {
- attr(span1, "data-type", span1_data_type_value);
- }
- },
- i: noop,
- o: noop,
- d(detaching) {
- if (detaching)
- detach(main);
- ctx[12](null);
- ctx[13](null);
- mounted = false;
- run_all(dispose);
- }
- };
-}
-function instance($$self, $$props, $$invalidate) {
- let side;
- let { change } = $$props;
- let { view } = $$props;
- let { manager } = $$props;
- let { workspace } = $$props;
- let buttons = [];
- setImmediate(() => buttons.forEach((b) => (0, import_obsidian10.setIcon)(b, b.getAttr("data-icon"), 16)));
- function hover(event) {
- if (!change.path.startsWith(view.app.vault.configDir) || !change.path.startsWith(".")) {
- hoverPreview(event, view, change.path.split("/").last().replace(".md", ""));
- }
- }
- function open(event) {
- if (!(change.path.startsWith(view.app.vault.configDir) || change.path.startsWith(".") || change.working_dir === "D")) {
- openOrSwitch(view.app, change.path, event);
- }
- }
- function stage() {
- manager.stage(change.path).then(() => {
- dispatchEvent(new CustomEvent("git-refresh"));
- });
- }
- function showDiff() {
- workspace.createLeafInParent(workspace.rootSplit, 0).setViewState({ type: DIFF_VIEW_CONFIG.type });
- dispatchEvent(new CustomEvent("diff-update", { detail: { path: change.path } }));
- }
- function discard() {
- const deleteFile = change.working_dir == "U";
- new DiscardModal(view.app, deleteFile, change.path).myOpen().then((shouldDiscard) => {
- if (shouldDiscard === true) {
- if (deleteFile) {
- view.app.vault.adapter.remove(change.path).then(() => {
- dispatchEvent(new CustomEvent("git-refresh"));
- });
- } else {
- manager.discard(change.path).then(() => {
- dispatchEvent(new CustomEvent("git-refresh"));
- });
- }
- }
- });
- }
- function focus_handler(event) {
- bubble.call(this, $$self, event);
- }
- function div0_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[0] = $$value;
- $$invalidate(1, buttons);
- });
- }
- function div1_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[2] = $$value;
- $$invalidate(1, buttons);
- });
- }
- $$self.$$set = ($$props2) => {
- if ("change" in $$props2)
- $$invalidate(0, change = $$props2.change);
- if ("view" in $$props2)
- $$invalidate(8, 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 & 256) {
- $:
- $$invalidate(2, side = view.leaf.getRoot().side == "left" ? "right" : "left");
- }
- };
- return [
- change,
- buttons,
- side,
- hover,
- open,
- stage,
- showDiff,
- discard,
- view,
- manager,
- workspace,
- focus_handler,
- div0_binding,
- div1_binding
- ];
-}
-var FileComponent = class extends SvelteComponent {
- constructor(options) {
- super();
- init(this, options, instance, create_fragment, safe_not_equal, {
- change: 0,
- view: 8,
- manager: 9,
- workspace: 10
- }, add_css);
- }
-};
-var fileComponent_default = FileComponent;
-
-// src/ui/sidebar/components/stagedFileComponent.svelte
-var import_obsidian11 = __toModule(require("obsidian"));
-function add_css2(target) {
- append_styles(target, "svelte-1m5vxuz", "main.svelte-1m5vxuz.svelte-1m5vxuz.svelte-1m5vxuz{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-1m5vxuz .path.svelte-1m5vxuz.svelte-1m5vxuz{color:var(--text-muted);white-space:nowrap;max-width:75%;overflow:hidden;text-overflow:ellipsis}main.svelte-1m5vxuz .path.svelte-1m5vxuz.svelte-1m5vxuz:hover{color:var(--text-normal);transition:all 200ms}main.svelte-1m5vxuz .tools.svelte-1m5vxuz.svelte-1m5vxuz{display:flex;align-items:center}main.svelte-1m5vxuz .tools .type.svelte-1m5vxuz.svelte-1m5vxuz{height:16px;width:16px;margin:0;display:flex;align-items:center;justify-content:center}main.svelte-1m5vxuz .tools .type[data-type=M].svelte-1m5vxuz.svelte-1m5vxuz{color:orange}main.svelte-1m5vxuz .tools .type[data-type=D].svelte-1m5vxuz.svelte-1m5vxuz{color:red}main.svelte-1m5vxuz .tools .type[data-type=A].svelte-1m5vxuz.svelte-1m5vxuz{color:yellowgreen}main.svelte-1m5vxuz .tools .type[data-type=R].svelte-1m5vxuz.svelte-1m5vxuz{color:violet}main.svelte-1m5vxuz .tools .buttons.svelte-1m5vxuz.svelte-1m5vxuz{display:flex}main.svelte-1m5vxuz .tools .buttons.svelte-1m5vxuz>.svelte-1m5vxuz{color:var(--text-faint);height:16px;width:16px;margin:0;transition:all 0.2s;border-radius:2px;margin-right:1px}main.svelte-1m5vxuz .tools .buttons.svelte-1m5vxuz>.svelte-1m5vxuz:hover{color:var(--text-normal);background-color:var(--interactive-accent)}");
-}
-function create_fragment2(ctx) {
- let main;
- let span0;
- let t0_value = ctx[2].split("/").last().replace(".md", "") + "";
- let t0;
- let span0_aria_label_value;
- let t1;
- let div2;
- let div1;
- let div0;
- let t2;
- let span1;
- let t3_value = ctx[0].index + "";
- let t3;
- let span1_data_type_value;
- let mounted;
- let dispose;
- return {
- c() {
- main = element("main");
- span0 = element("span");
- t0 = text(t0_value);
- t1 = space();
- div2 = element("div");
- div1 = element("div");
- div0 = element("div");
- t2 = space();
- span1 = element("span");
- t3 = text(t3_value);
- attr(span0, "class", "path svelte-1m5vxuz");
- attr(span0, "aria-label-position", ctx[3]);
- attr(span0, "aria-label", span0_aria_label_value = ctx[0].path.split("/").last() != ctx[0].path ? ctx[0].path : "");
- attr(div0, "data-icon", "feather-minus");
- attr(div0, "aria-label", "Unstage");
- attr(div0, "class", "svelte-1m5vxuz");
- attr(div1, "class", "buttons svelte-1m5vxuz");
- attr(span1, "class", "type svelte-1m5vxuz");
- attr(span1, "data-type", span1_data_type_value = ctx[0].index);
- attr(div2, "class", "tools svelte-1m5vxuz");
- attr(main, "class", "svelte-1m5vxuz");
- },
- m(target, anchor) {
- insert(target, main, anchor);
- append(main, span0);
- append(span0, t0);
- append(main, t1);
- append(main, div2);
- append(div2, div1);
- append(div1, div0);
- ctx[10](div0);
- append(div2, t2);
- append(div2, span1);
- append(span1, t3);
- if (!mounted) {
- dispose = [
- listen(span0, "mouseover", ctx[4]),
- listen(span0, "focus", ctx[9]),
- listen(span0, "click", ctx[5]),
- listen(div0, "click", ctx[6])
- ];
- mounted = true;
- }
- },
- p(ctx2, [dirty]) {
- if (dirty & 4 && t0_value !== (t0_value = ctx2[2].split("/").last().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].path.split("/").last() != ctx2[0].path ? ctx2[0].path : "")) {
- attr(span0, "aria-label", span0_aria_label_value);
- }
- if (dirty & 1 && t3_value !== (t3_value = ctx2[0].index + ""))
- set_data(t3, t3_value);
- if (dirty & 1 && span1_data_type_value !== (span1_data_type_value = ctx2[0].index)) {
- attr(span1, "data-type", span1_data_type_value);
- }
- },
- i: noop,
- o: noop,
- d(detaching) {
- if (detaching)
- detach(main);
- ctx[10](null);
- mounted = false;
- run_all(dispose);
- }
- };
-}
-function instance2($$self, $$props, $$invalidate) {
- let formattedPath;
- let side;
- let { change } = $$props;
- let { view } = $$props;
- let { manager } = $$props;
- let buttons = [];
- setImmediate(() => buttons.forEach((b) => (0, import_obsidian11.setIcon)(b, b.getAttr("data-icon"), 16)));
- 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(view.app, formattedPath, event);
- }
- }
- function unstage() {
- manager.unstage(formattedPath).then(() => {
- dispatchEvent(new CustomEvent("git-refresh"));
- });
- }
- function focus_handler(event) {
- bubble.call(this, $$self, event);
- }
- function div0_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[0] = $$value;
- $$invalidate(1, buttons);
- });
- }
- $$self.$$set = ($$props2) => {
- if ("change" in $$props2)
- $$invalidate(0, change = $$props2.change);
- if ("view" in $$props2)
- $$invalidate(7, view = $$props2.view);
- if ("manager" in $$props2)
- $$invalidate(8, manager = $$props2.manager);
- };
- $$self.$$.update = () => {
- if ($$self.$$.dirty & 1) {
- $:
- $$invalidate(2, formattedPath = change.path);
- }
- if ($$self.$$.dirty & 128) {
- $:
- $$invalidate(3, side = view.leaf.getRoot().side == "left" ? "right" : "left");
- }
- };
- return [
- change,
- buttons,
- formattedPath,
- side,
- hover,
- open,
- unstage,
- view,
- manager,
- focus_handler,
- div0_binding
- ];
-}
-var StagedFileComponent = class extends SvelteComponent {
- constructor(options) {
- super();
- init(this, options, instance2, create_fragment2, safe_not_equal, { change: 0, view: 7, manager: 8 }, add_css2);
- }
-};
-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}');
-}
-function get_each_context(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[7] = list[i];
- return child_ctx;
-}
-function create_else_block_1(ctx) {
- let div2;
- let div1;
- let div0;
- let t0;
- let span;
- let t1_value = ctx[7].title + "";
- let t1;
- let t2;
- let if_block_anchor;
- let current;
- let mounted;
- let dispose;
- function click_handler() {
- return ctx[6](ctx[7]);
- }
- let if_block = !ctx[5][ctx[7].title] && create_if_block_2(ctx);
- return {
- c() {
- div2 = element("div");
- div1 = element("div");
- div0 = element("div");
- div0.innerHTML = ``;
- t0 = space();
- span = element("span");
- 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]);
- },
- m(target, anchor) {
- insert(target, div2, anchor);
- append(div2, div1);
- append(div1, div0);
- append(div1, t0);
- append(div1, span);
- append(span, t1);
- insert(target, t2, anchor);
- if (if_block)
- if_block.m(target, anchor);
- insert(target, if_block_anchor, anchor);
- current = true;
- if (!mounted) {
- dispose = listen(div2, "click", click_handler);
- mounted = true;
- }
- },
- p(new_ctx, dirty) {
- ctx = new_ctx;
- if ((!current || dirty & 1) && t1_value !== (t1_value = ctx[7].title + ""))
- set_data(t1, t1_value);
- if (dirty & 33) {
- toggle_class(div2, "open", !ctx[5][ctx[7].title]);
- }
- if (!ctx[5][ctx[7].title]) {
- if (if_block) {
- if_block.p(ctx, dirty);
- if (dirty & 33) {
- transition_in(if_block, 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);
- }
- } else if (if_block) {
- group_outros();
- transition_out(if_block, 1, 1, () => {
- if_block = null;
- });
- check_outros();
- }
- },
- i(local) {
- if (current)
- return;
- transition_in(if_block);
- current = true;
- },
- o(local) {
- transition_out(if_block);
- current = false;
- },
- d(detaching) {
- if (detaching)
- detach(div2);
- if (detaching)
- detach(t2);
- if (if_block)
- if_block.d(detaching);
- if (detaching)
- detach(if_block_anchor);
- mounted = false;
- dispose();
- }
- };
-}
-function create_if_block(ctx) {
- let div;
- let current_block_type_index;
- let if_block;
- let t;
- let current;
- const if_block_creators = [create_if_block_1, create_else_block];
- const if_blocks = [];
- function select_block_type_1(ctx2, dirty) {
- if (ctx2[3])
- return 0;
- return 1;
- }
- 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();
- 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);
- append(div, t);
- current = true;
- },
- p(ctx2, dirty) {
- 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);
- }
- transition_in(if_block, 1);
- if_block.m(div, t);
- }
- },
- i(local) {
- if (current)
- return;
- transition_in(if_block);
- current = true;
- },
- o(local) {
- transition_out(if_block);
- current = false;
- },
- d(detaching) {
- if (detaching)
- detach(div);
- if_blocks[current_block_type_index].d();
- }
- };
-}
-function create_if_block_2(ctx) {
- let div;
- let treecomponent;
- let t;
- let div_transition;
- let current;
- treecomponent = new TreeComponent({
- props: {
- hierarchy: ctx[7],
- plugin: ctx[1],
- view: ctx[2],
- staged: ctx[3]
- }
- });
- return {
- c() {
- div = element("div");
- create_component(treecomponent.$$.fragment);
- t = space();
- attr(div, "class", "file-view svelte-pgmdei");
- },
- m(target, anchor) {
- insert(target, div, anchor);
- mount_component(treecomponent, div, null);
- append(div, t);
- current = true;
- },
- p(ctx2, dirty) {
- const treecomponent_changes = {};
- if (dirty & 1)
- treecomponent_changes.hierarchy = ctx2[7];
- 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.$set(treecomponent_changes);
- },
- i(local) {
- if (current)
- return;
- transition_in(treecomponent.$$.fragment, local);
- if (local) {
- add_render_callback(() => {
- if (!div_transition)
- div_transition = create_bidirectional_transition(div, slide, { duration: 75 }, true);
- div_transition.run(1);
- });
- }
- current = true;
- },
- o(local) {
- transition_out(treecomponent.$$.fragment, local);
- if (local) {
- if (!div_transition)
- div_transition = create_bidirectional_transition(div, slide, { duration: 75 }, false);
- div_transition.run(0);
- }
- current = false;
- },
- d(detaching) {
- if (detaching)
- detach(div);
- destroy_component(treecomponent);
- if (detaching && div_transition)
- div_transition.end();
- }
- };
-}
-function create_else_block(ctx) {
- let filecomponent;
- let current;
- filecomponent = new fileComponent_default({
- props: {
- change: ctx[7].statusResult,
- manager: ctx[1].gitManager,
- view: ctx[2],
- workspace: ctx[1].app.workspace
- }
- });
- return {
- c() {
- create_component(filecomponent.$$.fragment);
- },
- m(target, anchor) {
- mount_component(filecomponent, target, anchor);
- current = true;
- },
- p(ctx2, dirty) {
- const filecomponent_changes = {};
- if (dirty & 1)
- filecomponent_changes.change = ctx2[7].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) {
- 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_1(ctx) {
- let stagedfilecomponent;
- let current;
- stagedfilecomponent = new stagedFileComponent_default({
- props: {
- change: ctx[7].statusResult,
- manager: ctx[1].gitManager,
- view: ctx[2]
- }
- });
- return {
- c() {
- create_component(stagedfilecomponent.$$.fragment);
- },
- m(target, anchor) {
- mount_component(stagedfilecomponent, target, anchor);
- current = true;
- },
- p(ctx2, dirty) {
- const stagedfilecomponent_changes = {};
- if (dirty & 1)
- stagedfilecomponent_changes.change = ctx2[7].statusResult;
- if (dirty & 2)
- stagedfilecomponent_changes.manager = ctx2[1].gitManager;
- if (dirty & 4)
- stagedfilecomponent_changes.view = ctx2[2];
- stagedfilecomponent.$set(stagedfilecomponent_changes);
- },
- i(local) {
- if (current)
- return;
- transition_in(stagedfilecomponent.$$.fragment, local);
- current = true;
- },
- o(local) {
- transition_out(stagedfilecomponent.$$.fragment, local);
- current = false;
- },
- d(detaching) {
- destroy_component(stagedfilecomponent, detaching);
- }
- };
-}
-function create_each_block(ctx) {
- let current_block_type_index;
- let if_block;
- let if_block_anchor;
- let current;
- const if_block_creators = [create_if_block, create_else_block_1];
- const if_blocks = [];
- function select_block_type(ctx2, dirty) {
- if (ctx2[7].statusResult)
- return 0;
- return 1;
- }
- current_block_type_index = select_block_type(ctx, -1);
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
- return {
- c() {
- if_block.c();
- if_block_anchor = empty();
- },
- m(target, anchor) {
- if_blocks[current_block_type_index].m(target, anchor);
- insert(target, if_block_anchor, anchor);
- current = true;
- },
- p(ctx2, dirty) {
- let previous_block_index = current_block_type_index;
- current_block_type_index = select_block_type(ctx2, dirty);
- if (current_block_type_index === previous_block_index) {
- 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(if_block_anchor.parentNode, if_block_anchor);
- }
- },
- i(local) {
- if (current)
- return;
- transition_in(if_block);
- current = true;
- },
- o(local) {
- transition_out(if_block);
- current = false;
- },
- d(detaching) {
- if_blocks[current_block_type_index].d(detaching);
- if (detaching)
- detach(if_block_anchor);
- }
- };
-}
-function create_fragment3(ctx) {
- let main;
- let current;
- let each_value = ctx[0].children;
- let each_blocks = [];
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
- }
- const out = (i) => transition_out(each_blocks[i], 1, 1, () => {
- each_blocks[i] = null;
- });
- return {
- c() {
- main = element("main");
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].c();
- }
- attr(main, "class", "svelte-pgmdei");
- toggle_class(main, "topLevel", ctx[4]);
- },
- m(target, anchor) {
- insert(target, main, anchor);
- for (let i = 0; i < each_blocks.length; i += 1) {
- each_blocks[i].m(main, null);
- }
- current = true;
- },
- p(ctx2, [dirty]) {
- if (dirty & 47) {
- each_value = ctx2[0].children;
- let i;
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context(ctx2, each_value, i);
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block(child_ctx);
- each_blocks[i].c();
- transition_in(each_blocks[i], 1);
- each_blocks[i].m(main, null);
- }
- }
- group_outros();
- for (i = each_value.length; i < each_blocks.length; i += 1) {
- out(i);
- }
- check_outros();
- }
- if (dirty & 16) {
- toggle_class(main, "topLevel", ctx2[4]);
- }
- },
- i(local) {
- if (current)
- return;
- for (let i = 0; i < each_value.length; i += 1) {
- transition_in(each_blocks[i]);
- }
- current = true;
- },
- o(local) {
- each_blocks = each_blocks.filter(Boolean);
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
- current = false;
- },
- d(detaching) {
- if (detaching)
- detach(main);
- destroy_each(each_blocks, detaching);
- }
- };
-}
-function instance3($$self, $$props, $$invalidate) {
- let { hierarchy } = $$props;
- let { plugin } = $$props;
- let { view } = $$props;
- let { staged } = $$props;
- let { topLevel = false } = $$props;
- const closed = {};
- const click_handler = (entity) => {
- $$invalidate(5, closed[entity.title] = !closed[entity.title], closed);
- };
- $$self.$$set = ($$props2) => {
- if ("hierarchy" in $$props2)
- $$invalidate(0, hierarchy = $$props2.hierarchy);
- if ("plugin" in $$props2)
- $$invalidate(1, plugin = $$props2.plugin);
- if ("view" in $$props2)
- $$invalidate(2, view = $$props2.view);
- if ("staged" in $$props2)
- $$invalidate(3, staged = $$props2.staged);
- if ("topLevel" in $$props2)
- $$invalidate(4, topLevel = $$props2.topLevel);
- };
- return [hierarchy, plugin, view, staged, topLevel, closed, click_handler];
-}
-var TreeComponent = class extends SvelteComponent {
- constructor(options) {
- super();
- init(this, options, instance3, create_fragment3, safe_not_equal, {
- hierarchy: 0,
- plugin: 1,
- view: 2,
- staged: 3,
- topLevel: 4
- }, add_css3);
- }
-};
-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 get_each_context2(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[35] = list[i];
- return child_ctx;
-}
-function get_each_context_1(ctx, list, i) {
- const child_ctx = ctx.slice();
- child_ctx[38] = list[i];
- return child_ctx;
-}
-function create_if_block_5(ctx) {
- let div;
- let div_aria_label_value;
- let mounted;
- let dispose;
- return {
- c() {
- div = element("div");
- attr(div, "class", "search-input-clear-button");
- attr(div, "aria-label", div_aria_label_value = "Clear");
- },
- m(target, anchor) {
- insert(target, div, anchor);
- if (!mounted) {
- dispose = listen(div, "click", ctx[27]);
- mounted = true;
- }
- },
- p: noop,
- d(detaching) {
- if (detaching)
- detach(div);
- mounted = false;
- dispose();
- }
- };
-}
-function create_if_block2(ctx) {
- let div3;
- let div2;
- let div1;
- let t2;
- let span1;
- let t3_value = ctx[6].staged.length + "";
- let t3;
- let t4;
- let t5;
- let div7;
- let div6;
- let div5;
- let t8;
- let span3;
- let t9_value = ctx[6].changed.length + "";
- let t9;
- let t10;
- let current;
- let mounted;
- let dispose;
- let if_block0 = ctx[10] && create_if_block_3(ctx);
- let if_block1 = ctx[9] && create_if_block_12(ctx);
- return {
- c() {
- div3 = element("div");
- div2 = element("div");
- div1 = element("div");
- div1.innerHTML = `
- Staged Changes`;
- t2 = space();
- span1 = element("span");
- t3 = text(t3_value);
- t4 = space();
- if (if_block0)
- if_block0.c();
- t5 = space();
- div7 = element("div");
- div6 = element("div");
- div5 = element("div");
- div5.innerHTML = `
- Changes`;
- t8 = space();
- span3 = 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[10]);
- 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[9]);
- attr(div7, "class", "changes");
- },
- m(target, anchor) {
- insert(target, div3, anchor);
- append(div3, div2);
- append(div2, div1);
- append(div2, t2);
- append(div2, span1);
- append(span1, t3);
- append(div3, t4);
- if (if_block0)
- if_block0.m(div3, null);
- insert(target, t5, anchor);
- insert(target, div7, anchor);
- append(div7, div6);
- append(div6, div5);
- append(div6, t8);
- append(div6, span3);
- append(span3, t9);
- append(div7, t10);
- if (if_block1)
- if_block1.m(div7, null);
- current = true;
- if (!mounted) {
- dispose = [
- listen(div2, "click", ctx[28]),
- listen(div6, "click", ctx[29])
- ];
- mounted = true;
- }
- },
- p(ctx2, dirty) {
- if ((!current || dirty[0] & 64) && t3_value !== (t3_value = ctx2[6].staged.length + ""))
- set_data(t3, t3_value);
- if (dirty[0] & 1024) {
- toggle_class(div2, "open", ctx2[10]);
- }
- if (ctx2[10]) {
- if (if_block0) {
- if_block0.p(ctx2, dirty);
- if (dirty[0] & 1024) {
- transition_in(if_block0, 1);
- }
- } else {
- if_block0 = create_if_block_3(ctx2);
- if_block0.c();
- transition_in(if_block0, 1);
- if_block0.m(div3, null);
- }
- } else if (if_block0) {
- group_outros();
- transition_out(if_block0, 1, 1, () => {
- if_block0 = null;
- });
- check_outros();
- }
- if ((!current || dirty[0] & 64) && t9_value !== (t9_value = ctx2[6].changed.length + ""))
- set_data(t9, t9_value);
- if (dirty[0] & 512) {
- toggle_class(div6, "open", ctx2[9]);
- }
- if (ctx2[9]) {
- if (if_block1) {
- if_block1.p(ctx2, dirty);
- if (dirty[0] & 512) {
- transition_in(if_block1, 1);
- }
- } else {
- if_block1 = create_if_block_12(ctx2);
- if_block1.c();
- transition_in(if_block1, 1);
- if_block1.m(div7, null);
- }
- } else if (if_block1) {
- group_outros();
- transition_out(if_block1, 1, 1, () => {
- if_block1 = null;
- });
- check_outros();
- }
- },
- i(local) {
- if (current)
- return;
- transition_in(if_block0);
- transition_in(if_block1);
- current = true;
- },
- o(local) {
- transition_out(if_block0);
- transition_out(if_block1);
- current = false;
- },
- d(detaching) {
- if (detaching)
- detach(div3);
- if (if_block0)
- if_block0.d();
- if (detaching)
- detach(t5);
- if (detaching)
- detach(div7);
- if (if_block1)
- if_block1.d();
- mounted = false;
- run_all(dispose);
- }
- };
-}
-function create_if_block_3(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_blocks = [];
- function select_block_type(ctx2, dirty) {
- if (ctx2[2])
- return 0;
- return 1;
- }
- current_block_type_index = select_block_type(ctx, [-1, -1]);
- if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
- return {
- c() {
- div = element("div");
- if_block.c();
- attr(div, "class", "file-view svelte-1f0ksxd");
- },
- 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(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_block_12(ctx) {
- let each_1_anchor;
- let current;
- let each_value_1 = ctx[6].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));
- }
- 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] & 67) {
- each_value_1 = ctx2[6].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);
- 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_4(ctx) {
- let treecomponent;
- let current;
- treecomponent = new treeComponent_default({
- props: {
- hierarchy: ctx[8],
- plugin: ctx[0],
- view: ctx[1],
- staged: true,
- 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] & 256)
- treecomponent_changes.hierarchy = ctx2[8];
- 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 stagedfilecomponent;
- let current;
- stagedfilecomponent = new stagedFileComponent_default({
- props: {
- change: ctx[38],
- view: ctx[1],
- manager: ctx[0].gitManager
- }
- });
- return {
- c() {
- create_component(stagedfilecomponent.$$.fragment);
- },
- m(target, anchor) {
- mount_component(stagedfilecomponent, target, anchor);
- current = true;
- },
- p(ctx2, dirty) {
- const stagedfilecomponent_changes = {};
- if (dirty[0] & 64)
- stagedfilecomponent_changes.change = ctx2[38];
- if (dirty[0] & 2)
- stagedfilecomponent_changes.view = ctx2[1];
- if (dirty[0] & 1)
- stagedfilecomponent_changes.manager = ctx2[0].gitManager;
- stagedfilecomponent.$set(stagedfilecomponent_changes);
- },
- i(local) {
- if (current)
- return;
- transition_in(stagedfilecomponent.$$.fragment, local);
- current = true;
- },
- o(local) {
- transition_out(stagedfilecomponent.$$.fragment, local);
- current = false;
- },
- d(detaching) {
- destroy_component(stagedfilecomponent, detaching);
- }
- };
-}
-function create_if_block_12(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_blocks = [];
- function select_block_type_1(ctx2, dirty) {
- if (ctx2[2])
- return 0;
- return 1;
- }
- current_block_type_index = select_block_type_1(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", "file-view svelte-1f0ksxd");
- },
- 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_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);
- }
- 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[6].changed;
- let each_blocks = [];
- for (let i = 0; i < each_value.length; i += 1) {
- each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i));
- }
- const 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] & 8259) {
- each_value = ctx2[6].changed;
- let i;
- for (i = 0; i < each_value.length; i += 1) {
- const child_ctx = get_each_context2(ctx2, each_value, i);
- if (each_blocks[i]) {
- each_blocks[i].p(child_ctx, dirty);
- transition_in(each_blocks[i], 1);
- } else {
- each_blocks[i] = create_each_block2(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.length; i < each_blocks.length; i += 1) {
- out(i);
- }
- check_outros();
- }
- },
- i(local) {
- if (current)
- return;
- for (let i = 0; i < each_value.length; i += 1) {
- transition_in(each_blocks[i]);
- }
- current = true;
- },
- o(local) {
- each_blocks = each_blocks.filter(Boolean);
- for (let i = 0; i < each_blocks.length; i += 1) {
- transition_out(each_blocks[i]);
- }
- current = false;
- },
- d(detaching) {
- destroy_each(each_blocks, detaching);
- if (detaching)
- detach(each_1_anchor);
- }
- };
-}
-function create_if_block_22(ctx) {
- let treecomponent;
- let current;
- treecomponent = new treeComponent_default({
- props: {
- hierarchy: ctx[7],
- plugin: ctx[0],
- view: ctx[1],
- staged: false,
- 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] & 128)
- treecomponent_changes.hierarchy = ctx2[7];
- 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_block2(ctx) {
- let filecomponent;
- let current;
- filecomponent = new fileComponent_default({
- props: {
- change: ctx[35],
- view: ctx[1],
- manager: ctx[0].gitManager,
- workspace: ctx[0].app.workspace
- }
- });
- filecomponent.$on("git-refresh", ctx[13]);
- 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] & 64)
- filecomponent_changes.change = ctx2[35];
- 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);
- },
- 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_fragment4(ctx) {
- let main;
- let div9;
- let div6;
- let div0;
- let t0;
- let div1;
- let t1;
- let div2;
- let t2;
- let div3;
- let t3;
- let div4;
- let t4;
- let div5;
- let t5;
- let div7;
- let t6;
- let div8;
- let textarea;
- let t7;
- let t8;
- let div10;
- let current;
- let mounted;
- let dispose;
- let if_block0 = ctx[4] && create_if_block_5(ctx);
- let if_block1 = ctx[6] && create_if_block2(ctx);
- return {
- c() {
- main = element("main");
- div9 = element("div");
- div6 = element("div");
- div0 = element("div");
- t0 = space();
- div1 = element("div");
- t1 = space();
- div2 = element("div");
- t2 = space();
- div3 = element("div");
- t3 = space();
- div4 = element("div");
- t4 = space();
- div5 = element("div");
- t5 = space();
- div7 = element("div");
- t6 = space();
- div8 = element("div");
- textarea = element("textarea");
- t7 = space();
- if (if_block0)
- if_block0.c();
- t8 = space();
- div10 = element("div");
- if (if_block1)
- if_block1.c();
- attr(div0, "id", "commit-btn");
- attr(div0, "data-icon", "feather-check");
- attr(div0, "class", "nav-action-button");
- attr(div0, "aria-label", "Commit");
- attr(div1, "id", "stage-all");
- attr(div1, "class", "nav-action-button");
- attr(div1, "data-icon", "feather-plus-circle");
- attr(div1, "aria-label", "Stage all");
- attr(div2, "id", "unstage-all");
- attr(div2, "class", "nav-action-button");
- attr(div2, "data-icon", "feather-minus-circle");
- attr(div2, "aria-label", "Unstage all");
- attr(div3, "id", "push");
- attr(div3, "class", "nav-action-button");
- attr(div3, "data-icon", "feather-upload");
- attr(div3, "aria-label", "Push");
- attr(div4, "id", "pull");
- attr(div4, "class", "nav-action-button");
- attr(div4, "data-icon", "feather-download");
- attr(div4, "aria-label", "Pull");
- attr(div5, "id", "layoutChange");
- attr(div5, "class", "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", "feather-refresh-cw");
- attr(div7, "aria-label", "Refresh");
- toggle_class(div7, "loading", ctx[11]);
- attr(textarea, "class", "commit-msg svelte-1f0ksxd");
- 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");
- },
- m(target, anchor) {
- insert(target, main, anchor);
- append(main, div9);
- append(div9, div6);
- append(div6, div0);
- ctx[18](div0);
- append(div6, t0);
- append(div6, div1);
- ctx[19](div1);
- append(div6, t1);
- append(div6, div2);
- ctx[20](div2);
- append(div6, t2);
- append(div6, div3);
- ctx[21](div3);
- append(div6, t3);
- append(div6, div4);
- ctx[22](div4);
- append(div6, t4);
- append(div6, div5);
- ctx[23](div5);
- append(div9, t5);
- append(div9, div7);
- ctx[25](div7);
- append(div9, t6);
- append(div9, div8);
- append(div8, textarea);
- set_input_value(textarea, ctx[4]);
- append(div8, t7);
- if (if_block0)
- if_block0.m(div8, null);
- append(main, t8);
- append(main, div10);
- if (if_block1)
- if_block1.m(div10, null);
- current = true;
- if (!mounted) {
- dispose = [
- listen(div0, "click", ctx[12]),
- listen(div1, "click", ctx[14]),
- listen(div2, "click", ctx[15]),
- listen(div3, "click", ctx[16]),
- listen(div4, "click", ctx[17]),
- listen(div5, "click", ctx[24]),
- listen(div7, "click", ctx[13]),
- listen(textarea, "input", ctx[26])
- ];
- mounted = true;
- }
- },
- p(ctx2, dirty) {
- if (dirty[0] & 2048) {
- toggle_class(div7, "loading", ctx2[11]);
- }
- if (dirty[0] & 16) {
- set_input_value(textarea, ctx2[4]);
- }
- if (ctx2[4]) {
- if (if_block0) {
- if_block0.p(ctx2, dirty);
- } else {
- if_block0 = create_if_block_5(ctx2);
- if_block0.c();
- if_block0.m(div8, null);
- }
- } else if (if_block0) {
- if_block0.d(1);
- if_block0 = null;
- }
- if (ctx2[6]) {
- if (if_block1) {
- if_block1.p(ctx2, dirty);
- if (dirty[0] & 64) {
- transition_in(if_block1, 1);
- }
- } else {
- if_block1 = create_if_block2(ctx2);
- if_block1.c();
- transition_in(if_block1, 1);
- if_block1.m(div10, null);
- }
- } else if (if_block1) {
- group_outros();
- transition_out(if_block1, 1, 1, () => {
- if_block1 = null;
- });
- check_outros();
- }
- },
- i(local) {
- if (current)
- return;
- transition_in(if_block1);
- current = true;
- },
- o(local) {
- transition_out(if_block1);
- current = false;
- },
- d(detaching) {
- if (detaching)
- detach(main);
- ctx[18](null);
- ctx[19](null);
- ctx[20](null);
- ctx[21](null);
- ctx[22](null);
- ctx[23](null);
- ctx[25](null);
- if (if_block0)
- if_block0.d();
- if (if_block1)
- if_block1.d();
- mounted = false;
- run_all(dispose);
- }
- };
-}
-function instance4($$self, $$props, $$invalidate) {
- let { plugin } = $$props;
- let { view } = $$props;
- let commitMessage = plugin.settings.commitMessage;
- let buttons = [];
- let status;
- let changeHierarchy;
- let stagedHierarchy;
- let changesOpen = true;
- let stagedOpen = true;
- let loading = true;
- const debRefresh = (0, import_obsidian12.debounce)(() => {
- if (plugin.settings.refreshSourceControl) {
- refresh();
- }
- }, 1e3);
- let showTree = plugin.settings.treeStructure;
- let layoutBtn;
- let modifyEvent;
- let deleteEvent;
- let createEvent;
- let renameEvent;
- plugin.app.workspace.onLayoutReady(() => setImmediate(() => {
- buttons.forEach((btn) => (0, import_obsidian12.setIcon)(btn, btn.getAttr("data-icon"), 16));
- (0, import_obsidian12.setIcon)(layoutBtn, showTree ? "feather-list" : "feather-folder", 16);
- refresh();
- modifyEvent = plugin.app.vault.on("modify", () => {
- debRefresh();
- });
- deleteEvent = plugin.app.vault.on("delete", () => {
- debRefresh();
- });
- createEvent = plugin.app.vault.on("create", () => {
- debRefresh();
- });
- renameEvent = plugin.app.vault.on("rename", () => {
- debRefresh();
- });
- addEventListener("git-source-control-refresh", refresh);
- plugin.registerEvent(modifyEvent);
- plugin.registerEvent(deleteEvent);
- plugin.registerEvent(createEvent);
- plugin.registerEvent(renameEvent);
- }));
- onDestroy(() => {
- plugin.app.metadataCache.offref(modifyEvent);
- plugin.app.metadataCache.offref(deleteEvent);
- plugin.app.metadataCache.offref(createEvent);
- plugin.app.metadataCache.offref(renameEvent);
- removeEventListener("git-source-control-refresh", refresh);
- });
- function commit() {
- $$invalidate(11, loading = true);
- plugin.gitManager.commit(commitMessage).then(() => {
- if (commitMessage !== plugin.settings.commitMessage) {
- $$invalidate(4, commitMessage = "");
- }
- refresh();
- });
- }
- addEventListener("git-refresh", (_) => {
- refresh();
- });
- function refresh() {
- return __awaiter(this, void 0, void 0, function* () {
- $$invalidate(11, loading = true);
- $$invalidate(6, status = yield plugin.gitManager.status());
- $$invalidate(7, changeHierarchy = {
- title: "",
- children: plugin.gitManager.getTreeStructure(status.changed)
- });
- $$invalidate(8, stagedHierarchy = {
- title: "",
- children: plugin.gitManager.getTreeStructure(status.staged)
- });
- $$invalidate(11, loading = false);
- });
- }
- function stageAll() {
- $$invalidate(11, loading = true);
- plugin.gitManager.stageAll().then(() => {
- refresh();
- });
- }
- function unstageAll() {
- $$invalidate(11, loading = true);
- plugin.gitManager.unstageAll().then(() => {
- refresh();
- });
- }
- function push() {
- $$invalidate(11, loading = true);
- if (ready) {
- plugin.push().then((pushedFiles) => {
- refresh();
- });
- }
- }
- function pull() {
- $$invalidate(11, loading = true);
- plugin.pullChangesFromRemote().then(() => {
- refresh();
- });
- }
- function div0_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[0] = $$value;
- $$invalidate(5, buttons);
- });
- }
- function div1_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[1] = $$value;
- $$invalidate(5, buttons);
- });
- }
- function div2_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[2] = $$value;
- $$invalidate(5, buttons);
- });
- }
- function div3_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[3] = $$value;
- $$invalidate(5, buttons);
- });
- }
- function div4_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[4] = $$value;
- $$invalidate(5, buttons);
- });
- }
- function div5_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- layoutBtn = $$value;
- $$invalidate(3, layoutBtn);
- });
- }
- const click_handler = () => {
- $$invalidate(2, showTree = !showTree);
- $$invalidate(0, plugin.settings.treeStructure = showTree, plugin);
- plugin.saveSettings();
- };
- function div7_binding($$value) {
- binding_callbacks[$$value ? "unshift" : "push"](() => {
- buttons[6] = $$value;
- $$invalidate(5, buttons);
- });
- }
- function textarea_input_handler() {
- commitMessage = this.value;
- $$invalidate(4, commitMessage);
- }
- const click_handler_1 = () => $$invalidate(4, commitMessage = "");
- const click_handler_2 = () => $$invalidate(10, stagedOpen = !stagedOpen);
- const click_handler_3 = () => $$invalidate(9, changesOpen = !changesOpen);
- $$self.$$set = ($$props2) => {
- if ("plugin" in $$props2)
- $$invalidate(0, plugin = $$props2.plugin);
- if ("view" in $$props2)
- $$invalidate(1, view = $$props2.view);
- };
- $$self.$$.update = () => {
- if ($$self.$$.dirty[0] & 12) {
- $: {
- if (layoutBtn) {
- layoutBtn.empty();
- (0, import_obsidian12.setIcon)(layoutBtn, showTree ? "feather-list" : "feather-folder", 16);
- }
- }
- }
- };
- return [
- plugin,
- view,
- showTree,
- layoutBtn,
- commitMessage,
- buttons,
- status,
- changeHierarchy,
- stagedHierarchy,
- changesOpen,
- stagedOpen,
- loading,
- commit,
- refresh,
- stageAll,
- unstageAll,
- push,
- pull,
- div0_binding,
- div1_binding,
- div2_binding,
- div3_binding,
- div4_binding,
- div5_binding,
- click_handler,
- div7_binding,
- textarea_input_handler,
- click_handler_1,
- click_handler_2,
- click_handler_3
- ];
-}
-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]);
- }
-};
-var gitView_default = GitView;
-
-// src/ui/sidebar/sidebarView.ts
-var GitView2 = class extends import_obsidian13.ItemView {
- constructor(leaf, plugin) {
- super(leaf);
- this.plugin = plugin;
- this.hoverPopover = null;
- }
- getViewType() {
- return GIT_VIEW_CONFIG.type;
- }
- getDisplayText() {
- return GIT_VIEW_CONFIG.name;
- }
- getIcon() {
- return GIT_VIEW_CONFIG.icon;
- }
- onClose() {
- this._view.$destroy();
- return super.onClose();
- }
- onOpen() {
- this._view = new gitView_default({
- target: this.contentEl,
- props: {
- plugin: this.plugin,
- view: this
- }
- });
- return super.onOpen();
- }
-};
-
-// src/main.ts
-var ObsidianGit = class extends import_obsidian14.Plugin {
- constructor() {
- super(...arguments);
- this.gitReady = false;
- this.promiseQueue = new PromiseQueue();
- this.conflictOutputFile = "conflict-files-obsidian-git.md";
- }
- setState(state) {
- var _a;
- this.state = state;
- (_a = this.statusBar) == null ? void 0 : _a.display();
- }
- onload() {
- return __async(this, null, function* () {
- console.log("loading " + this.manifest.name + " plugin");
- yield this.loadSettings();
- this.migrateSettings();
- addIcons();
- 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());
- })
- });
- 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 });
- dispatchEvent(new CustomEvent("diff-update", { detail: { path: 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: "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.onLayoutReady(() => this.init());
- });
- }
- migrateSettings() {
- if (this.settings.mergeOnPull != void 0) {
- this.settings.syncMethod = this.settings.mergeOnPull ? "merge" : "rebase";
- this.settings.mergeOnPull = void 0;
- return this.saveSettings();
- }
- if (this.settings.autoCommitMessage === void 0) {
- this.settings.autoCommitMessage = this.settings.commitMessage;
- 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();
- console.log("unloading " + this.manifest.name + " plugin");
- });
- }
- loadSettings() {
- return __async(this, null, function* () {
- this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData());
- });
- }
- saveSettings() {
- return __async(this, null, function* () {
- yield this.saveData(this.settings);
- });
- }
- 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());
- }
- });
- }
- loadLastAuto() {
- return __async(this, null, function* () {
- var _a, _b;
- return {
- "backup": new Date((_a = window.localStorage.getItem(this.manifest.id + ":lastAutoBackup")) != null ? _a : ""),
- "pull": new Date((_b = window.localStorage.getItem(this.manifest.id + ":lastAutoPull")) != null ? _b : "")
- };
- });
- }
- init() {
- return __async(this, null, function* () {
- try {
- this.gitManager = new SimpleGit(this);
- const result = yield this.gitManager.checkRequirements();
- switch (result) {
- case "missing-git":
- this.displayError("Cannot run git command");
- break;
- case "missing-repo":
- new import_obsidian14.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);
- 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.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_obsidian14.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_obsidian14.Notice(`Cloning new repo into "${dir}"`);
- yield this.gitManager.clone(url, dir);
- new import_obsidian14.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"}`);
- }
- }
- dispatchEvent(new CustomEvent("git-source-control-refresh"));
- this.lastUpdate = Date.now();
- this.setState(PluginState.idle);
- });
- }
- createBackup(fromAutoBackup, requestCustomMessage = false) {
- return __async(this, null, function* () {
- if (!(yield this.isAllInitialized()))
- return;
- if (!fromAutoBackup) {
- const file = this.app.vault.getAbstractFileByPath(this.conflictOutputFile);
- yield this.app.vault.delete(file);
- }
- if (this.gitManager instanceof SimpleGit) {
- const status = yield this.gitManager.status();
- if (fromAutoBackup && status.conflicted.length > 0) {
- this.setState(PluginState.idle);
- 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;
- }
- }
- if (!(yield this.commit(fromAutoBackup, requestCustomMessage)))
- return;
- if (!this.settings.disablePush) {
- if (yield this.gitManager.canPush()) {
- if (this.settings.pullBeforePush) {
- yield this.pull();
- }
- if (!(yield this.push()))
- return;
- } 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 changedFiles = (yield this.gitManager.status()).changed;
- if (changedFiles.length !== 0) {
- let commitMessage = fromAutoBackup ? this.settings.autoCommitMessage : this.settings.commitMessage;
- if (fromAutoBackup && this.settings.customMessageOnAutoBackup || requestCustomMessage) {
- if (!this.settings.disablePopups && fromAutoBackup) {
- new import_obsidian14.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-source-control-refresh"));
- this.setState(PluginState.idle);
- return true;
- });
- }
- push() {
- return __async(this, null, function* () {
- if (!(yield this.isAllInitialized()))
- return false;
- if (!this.remotesAreSet()) {
- return false;
- }
- 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();
- this.displayMessage(`Pushed ${pushedFiles} ${pushedFiles > 1 ? "files" : "file"} to remote`);
- this.setState(PluginState.idle);
- return true;
- }
- });
- }
- pull() {
- return __async(this, null, function* () {
- const pulledFilesLength = yield this.gitManager.pull();
- if (pulledFilesLength > 0) {
- this.displayMessage(`Pulled ${pulledFilesLength} ${pulledFilesLength > 1 ? "files" : "file"} from remote`);
- }
- return pulledFilesLength != 0;
- });
- }
- remotesAreSet() {
- return __async(this, null, function* () {
- if (!(yield this.gitManager.branchInfo()).tracking) {
- new import_obsidian14.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);
- this.setState(PluginState.idle);
- return false;
- } else {
- yield this.gitManager.updateUpstreamBranch(remoteBranch);
- return true;
- }
- }
- return true;
- });
- }
- startAutoBackup(minutes) {
- const time = (minutes != null ? minutes : this.settings.autoSaveInterval) * 6e4;
- if (this.settings.autoBackupAfterFileChange) {
- if (minutes === 0) {
- this.doAutoBackup();
- } else {
- this.onFileModifyEventRef = this.app.vault.on("modify", () => this.autoBackupDebouncer());
- this.autoBackupDebouncer = (0, import_obsidian14.debounce)(() => this.doAutoBackup(), time, true);
- }
- } else {
- this.timeoutIDBackup = window.setTimeout(() => this.doAutoBackup(), time);
- }
- }
- doAutoBackup() {
- this.promiseQueue.addTask(() => this.createBackup(true));
- this.saveLastAuto(new Date(), "backup");
- this.saveSettings();
- this.startAutoBackup();
- }
- startAutoPull(minutes) {
- this.timeoutIDPull = window.setTimeout(() => {
- this.promiseQueue.addTask(() => this.pullChangesFromRemote());
- this.saveLastAuto(new Date(), "pull");
- this.saveSettings();
- this.startAutoPull();
- }, (minutes != null ? minutes : this.settings.autoPullInterval) * 6e4);
- }
- clearAutoBackup() {
- var _a;
- let wasActive = false;
- if (this.timeoutIDBackup) {
- window.clearTimeout(this.timeoutIDBackup);
- this.timeoutIDBackup = void 0;
- wasActive = true;
- }
- if (this.onFileModifyEventRef) {
- (_a = this.autoBackupDebouncer) == null ? void 0 : _a.cancel();
- this.app.vault.offref(this.onFileModifyEventRef);
- this.onFileModifyEventRef = void 0;
- wasActive = true;
- }
- return wasActive;
- }
- clearAutoPull() {
- if (this.timeoutIDPull) {
- window.clearTimeout(this.timeoutIDPull);
- this.timeoutIDPull = void 0;
- return true;
- }
- return false;
- }
- handleConflict(conflicted) {
- return __async(this, null, function* () {
- this.setState(PluginState.conflicted);
- const 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_obsidian14.TFile) {
- const link = this.app.metadataCache.fileToLinktext(file, "/");
- return `- [[${link}]]`;
- } else {
- return `- Not a file: ${e}`;
- }
- })
- ];
- this.writeAndOpenFile(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);
- 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();
- }
- }
- 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();
- }
- });
- }
- 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);
- }
- });
- }
- 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);
- }
- });
- }
- displayMessage(message, timeout = 4 * 1e3) {
- var _a;
- (_a = this.statusBar) == null ? void 0 : _a.displayMessage(message.toLowerCase(), timeout);
- if (!this.settings.disablePopups) {
- new import_obsidian14.Notice(message, 5 * 1e3);
- }
- console.log(`git obsidian message: ${message}`);
- }
- displayError(message, timeout = 0) {
- var _a;
- message = message.toString();
- new import_obsidian14.Notice(message, 15 * 1e3);
- console.log(`git obsidian error: ${message}`);
- (_a = this.statusBar) == null ? void 0 : _a.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
-*/
-/*! *****************************************************************************
-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.
-***************************************************************************** */
diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json
deleted file mode 100644
index 1d0a3b1..0000000
--- a/.obsidian/plugins/obsidian-git/manifest.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "id": "obsidian-git",
- "name": "Obsidian Git",
- "description": "Backup your vault with git.",
- "isDesktopOnly": true,
- "js": "main.js",
- "version": "1.22.0"
-}
diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css
deleted file mode 100644
index 3455a4d..0000000
--- a/.obsidian/plugins/obsidian-git/styles.css
+++ /dev/null
@@ -1,384 +0,0 @@
-@keyframes loading {
- 0% {
- transform: rotate(0deg);
- }
- 100% {
- transform: rotate(360deg);
- }
-}
-
-.loading > svg {
- animation: 2s linear infinite loading;
- transform-origin: 50% 50%;
- display: inline-block;
-}
-.obsidian-git-center {
- margin: auto;
- width: 50%;
-}
-.tooltip.mod-left {
- overflow-wrap: break-word;
-}
-.tooltip.mod-right {
- overflow-wrap: break-word;
-}
-.obsidian-git-shortcuts {
- margin: 10px;
-}
-
-.diff-err {
- height: 100%;
- display: flex;
- justify-content: center;
- flex-direction: column;
- align-items: center;
-}
-
-.diff-err-sign {
- font-size: 2em;
-}
-
-.d2h-d-none {
- display: none;
-}
-.d2h-wrapper {
- text-align: left;
-}
-.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;
-}
-.d2h-file-header,
-.d2h-file-stats {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
-}
-.d2h-file-stats {
- font-size: 14px;
- margin-left: auto;
-}
-.d2h-lines-added {
- border: 1px solid #b4e2b4;
- border-radius: 5px 0 0 5px;
- color: #399839;
- padding: 2px;
- text-align: right;
- vertical-align: middle;
-}
-.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;
-}
-.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%;
-}
-.d2h-file-name {
- overflow-x: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-.d2h-file-wrapper {
- border: 1px solid var(--background-modifier-border);
- border-radius: 3px;
- margin-bottom: 1em;
-}
-.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;
-}
-.d2h-file-collapse.d2h-selected {
- background-color: #c8e1ff;
-}
-.d2h-file-collapse-input {
- margin: 0 4px 0 0;
-}
-.d2h-diff-table {
- border-collapse: collapse;
- font-family: Menlo, Consolas, monospace;
- font-size: 13px;
- width: 100%;
-}
-.d2h-files-diff {
- width: 100%;
-}
-.d2h-file-diff {
- overflow-y: hidden;
-}
-.d2h-file-side-diff {
- display: inline-block;
- margin-bottom: -8px;
- margin-right: -4px;
- overflow-x: scroll;
- overflow-y: hidden;
- width: 50%;
-}
-.d2h-code-line {
- padding: 0 8em;
-}
-.d2h-code-line,
-.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%;
-}
-.d2h-code-side-line {
- padding: 0 4.5em;
-}
-.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%;
-}
-.theme-light .d2h-code-line del,
-.theme-light .d2h-code-side-line del {
- background-color: #ffb6ba;
-}
-.theme-dark .d2h-code-line del,
-.theme-dark .d2h-code-side-line del {
- background-color: #8d232881;
-}
-.d2h-code-line del,
-.d2h-code-line ins,
-.d2h-code-side-line del,
-.d2h-code-side-line ins {
- border-radius: 0.2em;
- display: inline-block;
- margin-top: -1px;
- text-decoration: none;
- vertical-align: middle;
-}
-.theme-light .d2h-code-line ins,
-.theme-light .d2h-code-side-line ins {
- background-color: #97f295;
- text-align: left;
-}
-.theme-dark .d2h-code-line ins,
-.theme-dark .d2h-code-side-line ins {
- background-color: #1d921996;
- text-align: left;
-}
-.d2h-code-line-prefix {
- word-wrap: normal;
- background: none;
- display: inline;
- padding: 0;
- white-space: pre;
-}
-.line-num1 {
- float: left;
-}
-.line-num1,
-.line-num2 {
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- overflow: hidden;
- padding: 0 0.5em;
- text-overflow: ellipsis;
- width: 3.5em;
-}
-.line-num2 {
- float: right;
-}
-.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;
-}
-.d2h-code-linenumber:after {
- content: "\200b";
-}
-.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;
-}
-.d2h-code-side-linenumber:after {
- content: "\200b";
-}
-.d2h-code-side-emptyplaceholder,
-.d2h-emptyplaceholder {
- background-color: var(--background-primary);
- border-color: var(--background-modifier-border);
-}
-.d2h-code-line-prefix,
-.d2h-code-linenumber,
-.d2h-code-side-linenumber,
-.d2h-emptyplaceholder {
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-.d2h-code-linenumber,
-.d2h-code-side-linenumber {
- direction: rtl;
-}
-.theme-light .d2h-del {
- background-color: #fee8e9;
- border-color: #e9aeae;
-}
-.theme-light .d2h-ins {
- background-color: #dfd;
- border-color: #b4e2b4;
-}
-.theme-dark .d2h-del {
- background-color: #521b1d83;
- border-color: #691d1d73;
-}
-.theme-dark .d2h-ins {
- background-color: rgba(30, 71, 30, 0.5);
- border-color: #13501381;
-}
-.d2h-info {
- background-color: var(--background-primary);
- border-color: var(--background-modifier-border);
- color: var(--text-normal);
-}
-.theme-light .d2h-file-diff .d2h-del.d2h-change {
- background-color: #fdf2d0;
-}
-.theme-dark .d2h-file-diff .d2h-del.d2h-change {
- background-color: #55492480;
-}
-.theme-light .d2h-file-diff .d2h-ins.d2h-change {
- background-color: #ded;
-}
-.theme-dark .d2h-file-diff .d2h-ins.d2h-change {
- background-color: rgba(37, 78, 37, 0.418);
-}
-.d2h-file-list-wrapper {
- margin-bottom: 10px;
-}
-.d2h-file-list-wrapper a {
- color: #3572b0;
- text-decoration: none;
-}
-.d2h-file-list-wrapper a:visited {
- color: #3572b0;
-}
-.d2h-file-list-header {
- text-align: left;
-}
-.d2h-file-list-title {
- font-weight: 700;
-}
-.d2h-file-list-line {
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- text-align: left;
-}
-.d2h-file-list {
- display: block;
- list-style: none;
- margin: 0;
- padding: 0;
-}
-.d2h-file-list > li {
- border-bottom: 1px solid var(--background-modifier-border);
- margin: 0;
- padding: 5px 10px;
-}
-.d2h-file-list > li:last-child {
- border-bottom: none;
-}
-.d2h-file-switch {
- cursor: pointer;
- display: none;
- font-size: 10px;
-}
-.d2h-icon {
- fill: currentColor;
- margin-right: 10px;
- vertical-align: middle;
-}
-.d2h-deleted {
- color: #c33;
-}
-.d2h-added {
- color: #399839;
-}
-.d2h-changed {
- color: #d0b44c;
-}
-.d2h-moved {
- color: #3572b0;
-}
-.d2h-tag {
- background-color: var(--background-primary);
- display: -webkit-box;
- display: -ms-flexbox;
- display: flex;
- font-size: 10px;
- margin-left: 5px;
- padding: 0 2px;
-}
-.d2h-deleted-tag {
- border: 2px solid #c33;
-}
-.d2h-added-tag {
- border: 1px solid #399839;
-}
-.d2h-changed-tag {
- border: 1px solid #d0b44c;
-}
-.d2h-moved-tag {
- border: 1px solid #3572b0;
-}
diff --git a/.obsidian/workspace b/.obsidian/workspace
index e7e2b55..f8616a2 100644
--- a/.obsidian/workspace
+++ b/.obsidian/workspace
@@ -9,7 +9,7 @@
"state": {
"type": "markdown",
"state": {
- "file": "随时随地/简单的 React 思考 - Context.md",
+ "file": "随时随地/React Hooks 的碎片记录.md",
"mode": "source",
"source": false
}
@@ -69,7 +69,7 @@
"state": {
"type": "backlink",
"state": {
- "file": "随时随地/简单的 React 思考 - Context.md",
+ "file": "随时随地/React Hooks 的碎片记录.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@@ -89,15 +89,15 @@
},
"active": "1508f46ea2481b37",
"lastOpenFiles": [
- "随时随地/简单的 React 思考 - Context.md",
- "随时随地/简单的 React 思考 - useCallback.md",
- "随时随地/简单的 React 思考 - useMemo.md",
+ "随时随地/React Hooks 的碎片记录.md",
"随时随地/奇怪的疑惑.md",
"随时随地/简单的 React 思考 - useReducer.md",
- "随时随地/简单的 React 思考 - Fiber 创建.md",
- "随时随地/React Hooks 的碎片记录.md",
+ "随时随地/简单的 React 思考 - useMemo.md",
"随时随地/useEffect 和 Debounce.md",
- "随时随地/简单的 React 思考 - 状态管理工具.md",
- "1648111615(1) 5.png.md"
+ "1648111615(1) 5.png.md",
+ "1648111615(1).png",
+ "1648111615(1) 5.png",
+ "随时随地/简单的 React 思考 - Hook.md",
+ "随时随地/简单的 React 思考 - Fiber 创建.md"
]
}
\ No newline at end of file