vault backup: 2025-07-02 13:08:29
This commit is contained in:
commit
83dd5cf976
18 files changed
+27329
No files matched your search
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
Vendored
+5
@@ -0,0 +1,5 @@
|
|||||||
|
[
|
||||||
|
"dataview",
|
||||||
|
"obsidian-git",
|
||||||
|
"calendar"
|
||||||
|
]
|
||||||
Vendored
+31
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"file-explorer": true,
|
||||||
|
"global-search": true,
|
||||||
|
"switcher": true,
|
||||||
|
"graph": true,
|
||||||
|
"backlink": true,
|
||||||
|
"canvas": true,
|
||||||
|
"outgoing-link": true,
|
||||||
|
"tag-pane": true,
|
||||||
|
"properties": false,
|
||||||
|
"page-preview": true,
|
||||||
|
"daily-notes": true,
|
||||||
|
"templates": true,
|
||||||
|
"note-composer": true,
|
||||||
|
"command-palette": true,
|
||||||
|
"slash-command": false,
|
||||||
|
"editor-status": true,
|
||||||
|
"bookmarks": true,
|
||||||
|
"markdown-importer": false,
|
||||||
|
"zk-prefixer": false,
|
||||||
|
"random-note": false,
|
||||||
|
"outline": true,
|
||||||
|
"word-count": true,
|
||||||
|
"slides": false,
|
||||||
|
"audio-recorder": false,
|
||||||
|
"workspaces": false,
|
||||||
|
"file-recovery": true,
|
||||||
|
"publish": false,
|
||||||
|
"sync": true,
|
||||||
|
"webviewer": false
|
||||||
|
}
|
||||||
Vendored
+10
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"shouldConfirmBeforeCreate": true,
|
||||||
|
"weekStart": "locale",
|
||||||
|
"wordsPerDot": 250,
|
||||||
|
"showWeeklyNote": false,
|
||||||
|
"weeklyNoteFormat": "",
|
||||||
|
"weeklyNoteTemplate": "",
|
||||||
|
"weeklyNoteFolder": "",
|
||||||
|
"localeOverride": "system-default"
|
||||||
|
}
|
||||||
Vendored
+4459
File diff suppressed because it is too large.
Load diff
+10
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"id": "calendar",
|
||||||
|
"name": "Calendar",
|
||||||
|
"description": "Calendar view of your daily notes",
|
||||||
|
"version": "1.5.10",
|
||||||
|
"author": "Liam Cain",
|
||||||
|
"authorUrl": "https://github.com/liamcain/",
|
||||||
|
"isDesktopOnly": false,
|
||||||
|
"minAppVersion": "0.9.11"
|
||||||
|
}
|
||||||
Vendored
+20876
File diff suppressed because it is too large.
Load diff
+11
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"id": "dataview",
|
||||||
|
"name": "Dataview",
|
||||||
|
"version": "0.5.68",
|
||||||
|
"minAppVersion": "0.13.11",
|
||||||
|
"description": "Complex data views for the data-obsessed.",
|
||||||
|
"author": "Michael Brenan <blacksmithgu@gmail.com>",
|
||||||
|
"authorUrl": "https://github.com/blacksmithgu",
|
||||||
|
"helpUrl": "https://blacksmithgu.github.io/obsidian-dataview/",
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
+141
@@ -0,0 +1,141 @@
|
|||||||
|
.block-language-dataview {
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************/
|
||||||
|
/** Table Views **/
|
||||||
|
/*****************/
|
||||||
|
|
||||||
|
/* List View Default Styling; rendered internally as a table. */
|
||||||
|
.table-view-table {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-view-table > thead > tr, .table-view-table > tbody > tr {
|
||||||
|
margin-top: 1em;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-view-table > tbody > tr:hover {
|
||||||
|
background-color: var(--table-row-background-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-view-table > thead > tr > th {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: larger;
|
||||||
|
border-top: none;
|
||||||
|
border-left: none;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: solid;
|
||||||
|
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-view-table > tbody > tr > td {
|
||||||
|
text-align: left;
|
||||||
|
border: none;
|
||||||
|
font-weight: 400;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-view-table ul, .table-view-table ol {
|
||||||
|
margin-block-start: 0.2em !important;
|
||||||
|
margin-block-end: 0.2em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Rendered value styling for any view. */
|
||||||
|
.dataview-result-list-root-ul {
|
||||||
|
padding: 0em !important;
|
||||||
|
margin: 0em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataview-result-list-ul {
|
||||||
|
margin-block-start: 0.2em !important;
|
||||||
|
margin-block-end: 0.2em !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Generic grouping styling. */
|
||||||
|
.dataview.result-group {
|
||||||
|
padding-left: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*******************/
|
||||||
|
/** Inline Fields **/
|
||||||
|
/*******************/
|
||||||
|
|
||||||
|
.dataview.inline-field-key {
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
background-color: var(--background-primary-alt);
|
||||||
|
color: var(--nav-item-color-selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataview.inline-field-value {
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
background-color: var(--background-secondary-alt);
|
||||||
|
color: var(--nav-item-color-selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataview.inline-field-standalone-value {
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
background-color: var(--background-secondary-alt);
|
||||||
|
color: var(--nav-item-color-selected);
|
||||||
|
}
|
||||||
|
|
||||||
|
/***************/
|
||||||
|
/** Task View **/
|
||||||
|
/***************/
|
||||||
|
|
||||||
|
.dataview.task-list-item, .dataview.task-list-basic-item {
|
||||||
|
margin-top: 3px;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
transition: 0.4s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataview.task-list-item:hover, .dataview.task-list-basic-item:hover {
|
||||||
|
background-color: var(--text-selection);
|
||||||
|
box-shadow: -40px 0 0 var(--text-selection);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************/
|
||||||
|
/** Error Views **/
|
||||||
|
/*****************/
|
||||||
|
|
||||||
|
div.dataview-error-box {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 150px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border: 4px dashed var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataview-error-message {
|
||||||
|
color: var(--text-muted);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************/
|
||||||
|
/** Additional Metadata **/
|
||||||
|
/*************************/
|
||||||
|
|
||||||
|
.dataview.small-text {
|
||||||
|
font-size: smaller;
|
||||||
|
color: var(--text-muted);
|
||||||
|
margin-left: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataview.small-text::before {
|
||||||
|
content: "(";
|
||||||
|
}
|
||||||
|
|
||||||
|
.dataview.small-text::after {
|
||||||
|
content: ")";
|
||||||
|
}
|
||||||
+61
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"commitMessage": "vault backup: {{date}}",
|
||||||
|
"autoCommitMessage": "vault backup: {{date}}",
|
||||||
|
"commitMessageScript": "",
|
||||||
|
"commitDateFormat": "YYYY-MM-DD HH:mm:ss",
|
||||||
|
"autoSaveInterval": 5,
|
||||||
|
"autoPushInterval": 0,
|
||||||
|
"autoPullInterval": 0,
|
||||||
|
"autoPullOnBoot": true,
|
||||||
|
"disablePush": false,
|
||||||
|
"pullBeforePush": true,
|
||||||
|
"disablePopups": false,
|
||||||
|
"showErrorNotices": true,
|
||||||
|
"disablePopupsForNoChanges": false,
|
||||||
|
"listChangedFilesInMessageBody": false,
|
||||||
|
"showStatusBar": true,
|
||||||
|
"updateSubmodules": false,
|
||||||
|
"syncMethod": "merge",
|
||||||
|
"customMessageOnAutoBackup": false,
|
||||||
|
"autoBackupAfterFileChange": false,
|
||||||
|
"treeStructure": false,
|
||||||
|
"refreshSourceControl": true,
|
||||||
|
"basePath": "",
|
||||||
|
"differentIntervalCommitAndPush": false,
|
||||||
|
"changedFilesInStatusBar": false,
|
||||||
|
"showedMobileNotice": true,
|
||||||
|
"refreshSourceControlTimer": 7000,
|
||||||
|
"showBranchStatusBar": true,
|
||||||
|
"setLastSaveToLastCommit": false,
|
||||||
|
"submoduleRecurseCheckout": false,
|
||||||
|
"gitDir": "",
|
||||||
|
"showFileMenu": true,
|
||||||
|
"authorInHistoryView": "hide",
|
||||||
|
"dateInHistoryView": false,
|
||||||
|
"diffStyle": "split",
|
||||||
|
"lineAuthor": {
|
||||||
|
"show": false,
|
||||||
|
"followMovement": "inactive",
|
||||||
|
"authorDisplay": "initials",
|
||||||
|
"showCommitHash": false,
|
||||||
|
"dateTimeFormatOptions": "date",
|
||||||
|
"dateTimeFormatCustomString": "YYYY-MM-DD HH:mm",
|
||||||
|
"dateTimeTimezone": "viewer-local",
|
||||||
|
"coloringMaxAge": "1y",
|
||||||
|
"colorNew": {
|
||||||
|
"r": 255,
|
||||||
|
"g": 150,
|
||||||
|
"b": 150
|
||||||
|
},
|
||||||
|
"colorOld": {
|
||||||
|
"r": 120,
|
||||||
|
"g": 160,
|
||||||
|
"b": 255
|
||||||
|
},
|
||||||
|
"textColorCss": "var(--text-muted)",
|
||||||
|
"ignoreWhitespace": false,
|
||||||
|
"gutterSpacingFallbackLength": 5,
|
||||||
|
"lastShownAuthorDisplay": "initials",
|
||||||
|
"lastShownDateTimeFormatOptions": "date"
|
||||||
|
}
|
||||||
|
}
|
||||||
+418
@@ -0,0 +1,418 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source visit the plugins github repository (https://github.com/denolehov/obsidian-git)
|
||||||
|
*/
|
||||||
|
|
||||||
|
var qP=Object.create;var Fo=Object.defineProperty;var YP=Object.getOwnPropertyDescriptor;var XP=Object.getOwnPropertyNames;var ZP=Object.getPrototypeOf,KP=Object.prototype.hasOwnProperty;var Uv=e=>{throw TypeError(e)};var JP=(e,t,r)=>t in e?Fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var QP=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),eR=(e,t)=>{for(var r in t)Fo(e,r,{get:t[r],enumerable:!0})},Gv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of XP(t))!KP.call(e,i)&&i!==r&&Fo(e,i,{get:()=>t[i],enumerable:!(n=YP(t,i))||n.enumerable});return e};var Ve=(e,t,r)=>(r=e!=null?qP(ZP(e)):{},Gv(t||!e||!e.__esModule?Fo(r,"default",{value:e,enumerable:!0}):r,e)),tR=e=>Gv(Fo({},"__esModule",{value:!0}),e);var Pr=(e,t,r)=>JP(e,typeof t!="symbol"?t+"":t,r),zv=(e,t,r)=>t.has(e)||Uv("Cannot "+r);var Ht=(e,t,r)=>(zv(e,t,"read from private field"),r?r.call(e):t.get(e)),Cc=(e,t,r)=>t.has(e)?Uv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Pc=(e,t,r,n)=>(zv(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var qv=F(Rc=>{"use strict";g();Rc.byteLength=nR;Rc.toByteArray=aR;Rc.fromByteArray=lR;var hn=[],Rr=[],rR=typeof Uint8Array!="undefined"?Uint8Array:Array,eh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ki=0,Vv=eh.length;Ki<Vv;++Ki)hn[Ki]=eh[Ki],Rr[eh.charCodeAt(Ki)]=Ki;var Ki,Vv;Rr[45]=62;Rr[95]=63;function Wv(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function nR(e){var t=Wv(e),r=t[0],n=t[1];return(r+n)*3/4-n}function iR(e,t,r){return(t+r)*3/4-r}function aR(e){var t,r=Wv(e),n=r[0],i=r[1],a=new rR(iR(e,n,i)),s=0,o=i>0?n-4:n,l;for(l=0;l<o;l+=4)t=Rr[e.charCodeAt(l)]<<18|Rr[e.charCodeAt(l+1)]<<12|Rr[e.charCodeAt(l+2)]<<6|Rr[e.charCodeAt(l+3)],a[s++]=t>>16&255,a[s++]=t>>8&255,a[s++]=t&255;return i===2&&(t=Rr[e.charCodeAt(l)]<<2|Rr[e.charCodeAt(l+1)]>>4,a[s++]=t&255),i===1&&(t=Rr[e.charCodeAt(l)]<<10|Rr[e.charCodeAt(l+1)]<<4|Rr[e.charCodeAt(l+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function sR(e){return hn[e>>18&63]+hn[e>>12&63]+hn[e>>6&63]+hn[e&63]}function oR(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(sR(n));return i.join("")}function lR(e){for(var t,r=e.length,n=r%3,i=[],a=16383,s=0,o=r-n;s<o;s+=a)i.push(oR(e,s,s+a>o?o:s+a));return n===1?(t=e[r-1],i.push(hn[t>>2]+hn[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],i.push(hn[t>>10]+hn[t>>4&63]+hn[t<<2&63]+"=")),i.join("")}});var Yv=F(th=>{g();th.read=function(e,t,r,n,i){var a,s,o=i*8-n-1,l=(1<<o)-1,c=l>>1,u=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,a=h&(1<<-u)-1,h>>=-u,u+=o;u>0;a=a*256+e[t+f],f+=d,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=s*256+e[t+f],f+=d,u-=8);if(a===0)a=1-c;else{if(a===l)return s?NaN:(h?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-c}return(h?-1:1)*s*Math.pow(2,a-n)};th.write=function(e,t,r,n,i,a){var s,o,l,c=a*8-i-1,u=(1<<c)-1,f=u>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?t+=d/l:t+=d*Math.pow(2,1-f),t*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(t*l-1)*Math.pow(2,i),s=s+f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=o&255,h+=p,o/=256,i-=8);for(s=s<<i|o,c+=i;c>0;e[r+h]=s&255,h+=p,s/=256,c-=8);e[r+h-p]|=m*128}});var uh=F(Qa=>{"use strict";g();var rh=qv(),Ka=Yv(),Xv=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Qa.Buffer=M;Qa.SlowBuffer=pR;Qa.INSPECT_MAX_BYTES=50;var Mc=2147483647;Qa.kMaxLength=Mc;M.TYPED_ARRAY_SUPPORT=cR();!M.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function cR(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(M.prototype,"parent",{enumerable:!0,get:function(){if(M.isBuffer(this))return this.buffer}});Object.defineProperty(M.prototype,"offset",{enumerable:!0,get:function(){if(M.isBuffer(this))return this.byteOffset}});function Nn(e){if(e>Mc)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,M.prototype),t}function M(e,t,r){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return sh(e)}return Qv(e,t,r)}M.poolSize=8192;function Qv(e,t,r){if(typeof e=="string")return fR(e,t);if(ArrayBuffer.isView(e))return dR(e);if(e==null)throw new TypeError("The first argument must be one of type string,
Line truncated
|
||||||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N$(e,t){if(e){if(typeof e=="string")return Fx(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Fx(e,t)}}function Fx(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function B$(e,t){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var s=e[Symbol.iterator](),o;!(n=(o=s.next()).done)&&(r.push(o.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw a}}return r}}function j$(e){if(Array.isArray(e))return e}var Lx=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?$/,Dx=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?$/,Nx=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,Bx=/^rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,jx=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,Hx=/^rgba?\(\s*(\d+%)\s+(\d+%)\s+(\d+%)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,Ux=/^hsla?\(\s*(\d+)(deg|rad|grad|turn)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/;function Fl(e,t){return e.indexOf(t)>-1}function H$(e,t,r){var n=e/255,i=t/255,a=r/255,s=Math.max(n,i,a),o=Math.min(n,i,a),l=s-o,c=(s+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=function(){switch(s){case n:return(i-a)/l%6;case i:return(a-n)/l+2;default:return(n-i)/l+4}}();return[f*60,u*100,c*100]}function U$(e,t,r){var n=e/60,i=t/100,a=r/100,s=(1-Math.abs(2*a-1))*i,o=s*(1-Math.abs(n%2-1)),l=a-s/2,c=function(){return n<1?[s,o,0]:n<2?[o,s,0]:n<3?[0,s,o]:n<4?[0,o,s]:n<5?[o,0,s]:[s,0,o]}(),u=qt(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var G$=function(){function e(t){var r=qt(t,4),n=r[0],i=r[1],a=r[2],s=r[3];$$(this,e),this.values=[Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(a,10),255),0),s==null?1:Math.max(Math.min(parseFloat(s),255),0)]}return L$(e,[{key:"toRgbString",value:function(){var r=qt(this.values,4),n=r[0],i=r[1],a=r[2],s=r[3];return s===1?"rgb(".concat(n,", ").concat(i,", ").concat(a,")"):"rgba(".concat(n,", ").concat(i,", ").concat(a,", ").concat(s,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),n=qt(r,4),i=n[0],a=n[1],s=n[2],o=n[3];return o===1?"hsl(".concat(i,", ").concat(a,"%, ").concat(s,"%)"):"hsla(".concat(i,", ").concat(a,"%, ").concat(s,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=qt(this.values,4),n=r[0],i=r[1],a=r[2],s=r[3];return n=Number(n).toString(16).padStart(2,"0"),i=Number(i).toString(16).padStart(2,"0"),a=Number(a).toString(16).padStart(2,"0"),s=s<1?parseInt(s*255,10).toString(16).padStart(2,"0"):"","#".concat(n).concat(i).concat(a).concat(s)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=qt(this.values,4),n=r[0],i=r[1],a=r[2],s=r[3],o=H$(n,i,a),l=qt(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,s]}}]),e}();function Ls(e){var t=qt(e,4),r=t[0],n=t[1],i=t[2],a=t[3];return new G$([r,n,i,a])}function Em(e){var t=qt(e,3),r=t[0],n=t[1],i=t[2];return Ls([r,n,i,1])}function Wu(e){var t=qt(e,4),r=t[0],n=t[1],i=t[2],a=t[3],s=U$(r,n,i),o=qt(s,3),l=o[0],c=o[1],u=o[2];return Ls([l,c,u,a])}function Gx(e){var t=qt(e,3),r=t[0],n=t[1],i=t[2];return Wu([r,n,i,1])}function z$(e){var t=Lx.exec(e)||Dx.exec(e),r=qt(t,5),n=r[1],i=r[2],a=r[3],s=r[4];return n=parseInt(n.length<2?n.repeat(2):n,16),i=parseInt(i.length<2?i.repeat(2):i,16),a=parseInt(a.length<2?a.repeat(2):a,16),s=s&&(parseInt(s.length<2?s.repeat(2):s,16)/255).toPrecision(1)||1,Ls([n,i,a,s])}function V$(e){var t=Nx.exec(e)||jx.exec(e)||Bx.exec(e)||Hx.exec(e),r=qt(t,5),n=r[1],i=r[2],a=r[3],s=r[4];return n=Fl(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),i=Fl(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),a=Fl(a,"%")>0?parseInt(a,10)*255/100:parseInt(a,10),s=s===void 0?1:parseFloat(s)/(Fl(s,"%")?100:1),Ls([n,i,a,s])}function W$(e){var t=Ux.exec(e),r=qt(t,6),n=r[1],i=r[2],a=r[3],s=r[4],o=r[5];return i=i||"deg",n=(0,F$.default)(parseFloat(n),i,"deg"),a=parseFloat(a),s=parseFloat(s),o=o===void 0?1:parseFloat(o)/(Fl(o,"%")?100:1),Wu([n,a,s,o])}function zx(e){return Ox.default[e]?Em(Ox.default[e]):Lx.test(e)||Dx.test(e)?z$(e):Nx.test(e)||jx.test(e)||Bx.test(e)||Hx.test(e)?V$(e):Ux.test(e)?W$(e):null}var q$={fromString:zx,fromRgb:Em,fromRgba:Ls,fromHsl:Gx,fromHsla:Wu};Yn.default=q$});var Am=F((az,qx)=>{"use strict";g();var Wx=Object.prototype.toString;qx.exports=function(t){var r=Wx.call(t),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Wx.call(t.callee)==="[object Function]"),n}});var rS=F((oz,tS)=>{"
Line truncated
|
||||||
|
`)>=0)return!1;return!0}function YD(e,t){var r;if(e.indent===" ")r=" ";else if(typeof e.indent=="number"&&e.indent>0)r=An.call(Array(e.indent+1)," ");else return null;return{base:r,prev:An.call(Array(t+1),r)}}function Zm(e,t){if(e.length===0)return"";var r=`
|
||||||
|
`+t.prev+t.base;return r+An.call(e,","+r)+`
|
||||||
|
`+t.prev}function uf(e,t){var r=Xm(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=Ri(e,i)?t(e[i],e):""}var a=typeof zm=="function"?zm(e):[],s;if(Us){s={};for(var o=0;o<a.length;o++)s["$"+a[o]]=a[o]}for(var l in e)Ri(e,l)&&(r&&String(Number(l))===l&&l<e.length||Us&&s["$"+l]instanceof Symbol||(VE.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if(typeof zm=="function")for(var c=0;c<a.length;c++)WE.call(e,a[c])&&n.push("["+t(a[c])+"]: "+t(e[a[c]],e));return n}});var tg=F((RV,eA)=>{"use strict";g();var QE=tn(),Gs=br(),XD=JE(),ZD=Xn(),hf=QE("%WeakMap%",!0),pf=QE("%Map%",!0),KD=Gs("WeakMap.prototype.get",!0),JD=Gs("WeakMap.prototype.set",!0),QD=Gs("WeakMap.prototype.has",!0),eN=Gs("Map.prototype.get",!0),tN=Gs("Map.prototype.set",!0),rN=Gs("Map.prototype.has",!0),eg=function(e,t){for(var r=e,n;(n=r.next)!==null;r=n)if(n.key===t)return r.next=n.next,n.next=e.next,e.next=n,n},nN=function(e,t){var r=eg(e,t);return r&&r.value},iN=function(e,t,r){var n=eg(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}},aN=function(e,t){return!!eg(e,t)};eA.exports=function(){var t,r,n,i={assert:function(a){if(!i.has(a))throw new ZD("Side channel does not contain "+XD(a))},get:function(a){if(hf&&a&&(typeof a=="object"||typeof a=="function")){if(t)return KD(t,a)}else if(pf){if(r)return eN(r,a)}else if(n)return nN(n,a)},has:function(a){if(hf&&a&&(typeof a=="object"||typeof a=="function")){if(t)return QD(t,a)}else if(pf){if(r)return rN(r,a)}else if(n)return aN(n,a);return!1},set:function(a,s){hf&&a&&(typeof a=="object"||typeof a=="function")?(t||(t=new hf),JD(t,a,s)):pf?(r||(r=new pf),tN(r,a,s)):(n||(n={key:{},next:null}),iN(n,a,s))}};return i}});var rA=F((OV,tA)=>{"use strict";g();var sN=Rm(),zl=tg()(),Zn=Xn(),rg={assert:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new Zn("`O` is not an object");if(typeof t!="string")throw new Zn("`slot` must be a string");if(zl.assert(e),!rg.has(e,t))throw new Zn("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new Zn("`O` is not an object");if(typeof t!="string")throw new Zn("`slot` must be a string");var r=zl.get(e);return r&&r["$"+t]},has:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new Zn("`O` is not an object");if(typeof t!="string")throw new Zn("`slot` must be a string");var r=zl.get(e);return!!r&&sN(r,"$"+t)},set:function(e,t,r){if(!e||typeof e!="object"&&typeof e!="function")throw new Zn("`O` is not an object");if(typeof t!="string")throw new Zn("`slot` must be a string");var n=zl.get(e);n||(n={},zl.set(e,n)),n["$"+t]=r}};Object.freeze&&Object.freeze(rg);tA.exports=rg});var aA=F((FV,iA)=>{"use strict";g();var Vl=rA(),oN=SyntaxError,nA=typeof StopIteration=="object"?StopIteration:null;iA.exports=function(t){if(!nA)throw new oN("this environment lacks StopIteration");Vl.set(t,"[[Done]]",!1);var r={next:function(){var i=Vl.get(this,"[[Iterator]]"),a=Vl.get(i,"[[Done]]");try{return{done:a,value:a?void 0:i.next()}}catch(s){if(Vl.set(i,"[[Done]]",!0),s!==nA)throw s;return{done:!0,value:void 0}}}};return Vl.set(r,"[[Iterator]]",t),r}});var ng=F((LV,sA)=>{g();var lN={}.toString;sA.exports=Array.isArray||function(e){return lN.call(e)=="[object Array]"}});var ig=F((NV,oA)=>{"use strict";g();var cN=String.prototype.valueOf,uN=function(t){try{return cN.call(t),!0}catch(r){return!1}},fN=Object.prototype.toString,dN="[object String]",hN=Pi()();oA.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:hN?uN(t):fN.call(t)===dN}});var sg=F((jV,uA)=>{"use strict";g();var ag=typeof Map=="function"&&Map.prototype?Map:null,pN=typeof Set=="function"&&Set.prototype?Set:null,mf;ag||(mf=function(t){return!1});var cA=ag?Map.prototype.has:null,lA=pN?Set.prototype.has:null;!mf&&!cA&&(mf=function(t){return!1});uA.exports=mf||function(t){if(!t||typeof t!="object")return!1;try{if(cA.call(t),lA)try{lA.call(t)}catch(r){return!0}return t instanceof ag}catch(r){}return!1}});var lg=F((UV,hA)=>{"use strict";g();var mN=typeof Map=="function"&&Map.prototype?Map:null,og=typeof Set=="function"&&Set.prototype?Set:null,gf;og||(gf=function(t){return!1});var fA=mN?Map.prototype.has:null,dA=og?Set.prototype.has:null;!gf&&!dA&&(gf=function(t){return!1});hA.exports=gf||function(t){if(!t||typeof t!="object")return!1;try{if(dA.call(t),fA)try{fA.call(t)}catch(r){return!0}return t instanceof og}catch(r){}return!1}});var AA=F((zV,wf)=>{"use strict";g();var pA=Hm(),mA=aA();Zu()()||Dl()()?(vf=Symbol.iterator,wf.exports=function(t){if(t!=null&&typeof t[vf]!="undefined")return t[vf]();if(pA(t))return Array.prototype[vf].call(t)}):(gA=ng(),vA=ig(),cg=tn(),yA=cg("%Map%",!0),wA=cg("%Set%",!0),Dr=br(),ug=Dr("Array.prototype.push"),fg=Dr("String.prototype.charCodeAt"),bA=Dr("String.prototype.slice"),_A=function(t,r){var n=t.length;if(r+1>=n)return r+1;var i=fg(t,r);if(i<55296||i>56319)return r+1;var a=fg(t,r+1);return a<56320||a>57343?r+1:r+2},yf=function(t){var r=0;return{next:function(){var
Line truncated
|
||||||
|
`});Pe=!1,z=Q.length}function Re(ct,rt){var Et="="+O,Ie=ct.indexOf(Et,rt),H=c(ct.substring(ct.indexOf("=",rt)+1,Ie)).split(" ");return Y=H[0],O=H[H.length-1],Ie+Et.length-1}for(S&&(S=S.split(" "),Y=S[0],O=S[1]),ge=0;ge<T;ge++)L==P?u(Y,A,ge)?(--ge,he(),L=I):A.charAt(ge)==`
|
||||||
|
`?gt(Pe):J+=A.charAt(ge):L==I?(ge+=Y.length-1,fe=e.tags[A.charAt(ge+1)],ee=fe?A.charAt(ge+1):"_v",ee=="="?(ge=Re(A,ge),L=P):(fe&&ge++,L=N),Pe=ge):u(O,A,ge)?(Q.push({tag:ee,n:c(J),otag:Y,ctag:O,i:ee=="/"?Pe-Y.length:ge+O.length}),J="",ge+=O.length-1,L=P,ee=="{"&&(O=="}}"?ge++:l(Q[Q.length-1]))):J+=A.charAt(ge);return gt(Pe,!0),Q};function l(w){w.n.substr(w.n.length-1)==="}"&&(w.n=w.n.substring(0,w.n.length-1))}function c(w){return w.trim?w.trim():w.replace(/^\s*|\s*$/g,"")}function u(w,A,S){if(A.charAt(S)!=w.charAt(0))return!1;for(var T=1,P=w.length;T<P;T++)if(A.charAt(S+T)!=w.charAt(T))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(w,A,S,T){var P=[],I=null,N=null,L=null;for(N=S[S.length-1];w.length>0;){if(L=w.shift(),N&&N.tag=="<"&&!(L.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[L.tag]<=e.tags.$||h(L,T))S.push(L),L.nodes=d(w,L.tag,S,T);else if(L.tag=="/"){if(S.length===0)throw new Error("Closing tag without opener: /"+L.n);if(I=S.pop(),L.n!=I.n&&!p(L.n,I.n,T))throw new Error("Nesting error: "+I.n+" vs. "+L.n);return I.end=L.i,P}else L.tag==`
|
||||||
|
`&&(L.last=w.length==0||w[0].tag==`
|
||||||
|
`);P.push(L)}if(S.length>0)throw new Error("missing closing tag: "+S.pop().n);return P}function h(w,A){for(var S=0,T=A.length;S<T;S++)if(A[S].o==w.n)return w.tag="#",!0}function p(w,A,S){for(var T=0,P=S.length;T<P;T++)if(S[T].c==w&&S[T].o==A)return!0}function m(w){var A=[];for(var S in w)A.push('"'+b(S)+'": function(c,p,t,i) {'+w[S]+"}");return"{ "+A.join(",")+" }"}function v(w){var A=[];for(var S in w.partials)A.push('"'+b(S)+'":{name:"'+b(w.partials[S].name)+'", '+v(w.partials[S])+"}");return"partials: {"+A.join(",")+"}, subs: "+m(w.subs)}e.stringify=function(w,A,S){return"{code: function (c,p,i) { "+e.wrapMain(w.code)+" },"+v(w)+"}"};var y=0;e.generate=function(w,A,S){y=0;var T={code:"",subs:{},partials:{}};return e.walk(w,T),S.asString?this.stringify(T,A,S):this.makeTemplate(T,A,S)},e.wrapMain=function(w){return'var t=this;t.b(i=i||"");'+w+"return t.fl();"},e.template=e.Template,e.makeTemplate=function(w,A,S){var T=this.makePartials(w);return T.code=new Function("c","p","i",this.wrapMain(w.code)),new this.template(T,A,this,S)},e.makePartials=function(w){var A,S={subs:{},partials:w.partials,name:w.name};for(A in S.partials)S.partials[A]=this.makePartials(S.partials[A]);for(A in w.subs)S.subs[A]=new Function("c","p","t","i",w.subs[A]);return S};function b(w){return w.replace(a,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(i,"\\r").replace(s,"\\u2028").replace(o,"\\u2029")}function x(w){return~w.indexOf(".")?"d":"f"}function E(w,A){var S="<"+(A.prefix||""),T=S+w.n+y++;return A.partials[T]={name:w.n,partials:{}},A.code+='t.b(t.rp("'+b(T)+'",c,p,"'+(w.indent||"")+'"));',T}e.codegen={"#":function(w,A){A.code+="if(t.s(t."+x(w.n)+'("'+b(w.n)+'",c,p,1),c,p,0,'+w.i+","+w.end+',"'+w.otag+" "+w.ctag+'")){t.rs(c,p,function(c,p,t){',e.walk(w.nodes,A),A.code+="});c.pop();}"},"^":function(w,A){A.code+="if(!t.s(t."+x(w.n)+'("'+b(w.n)+'",c,p,1),c,p,1,0,0,"")){',e.walk(w.nodes,A),A.code+="};"},">":E,"<":function(w,A){var S={partials:{},code:"",subs:{},inPartial:!0};e.walk(w.nodes,S);var T=A.partials[E(w,A)];T.subs=S.subs,T.partials=S.partials},$:function(w,A){var S={subs:{},code:"",partials:A.partials,prefix:w.n};e.walk(w.nodes,S),A.subs[w.n]=S.code,A.inPartial||(A.code+='t.sub("'+b(w.n)+'",c,p,i);')},"\n":function(w,A){A.code+=k('"\\n"'+(w.last?"":" + i"))},_v:function(w,A){A.code+="t.b(t.v(t."+x(w.n)+'("'+b(w.n)+'",c,p,0)));'},_t:function(w,A){A.code+=k('"'+b(w.text)+'"')},"{":_,"&":_};function _(w,A){A.code+="t.b(t.t(t."+x(w.n)+'("'+b(w.n)+'",c,p,0)));'}function k(w){return"t.b("+w+");"}e.walk=function(w,A){for(var S,T=0,P=w.length;T<P;T++)S=e.codegen[w[T].tag],S&&S(w[T],A);return A},e.parse=function(w,A,S){return S=S||{},d(w,"",[],S.sectionTags||[])},e.cache={},e.cacheKey=function(w,A){return[w,!!A.asString,!!A.disableLambda,A.delimiters,!!A.modelGet].join("||")},e.compile=function(w,A){A=A||{};var S=e.cacheKey(w,A),T=this.cache[S];if(T){var P=T.partials;for(var I in P)delete P[I].instance;return T}return T=this.generate(this.parse(this.scan(w,A.delimiters),w,A),w,A),this.cache[S]=T}})(typeof A0!="undefined"?A0:Hogan)});var OC=F(k0=>{g();var qj={};(function(e){e.Template=function(d,h,p,m){d=d||{},this.r=d.code||this.r,this.c=p,this.options=m||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},e.Template.prototype={r:function(d,h,p){return""},v:u,t:c,render:function(h,p,m){return this.ri([h],p||{},m)},ri:function(d,h,p){return this.r(d,h,p)},ep:function(d,h){var p=this.partials[d],m=h[p.name];if(p.instance&&p.base==m)return p.instance;if(typeof m=="string"){if(!this.c)throw new Error("No compiler available.");m=this.c.compile(m,this.options)}if(!m)return null;if(this.partials[d].base=m,p.subs){h.stackText||(h.stackText={});for(key in p.subs)h.stackText[key]||(h.stackText[key]=this.activeSub!==void 0&&h.stackText[this.activeSub]?h.stackText[this.activeSub]:this.text);m=r(m,p.subs,p.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=m,m},rp:function(d,h,p,m){var v=this.ep(d,p);return v?v.ri(h,p,m):""},rs:function(d,h,p){var m=d[d.length-1];if(!f(m)){p(d,h,this);return}for(var v=0;v<m.length;v++)d.push(m[v]),p(d,h,this),d.pop()},s:function(d,h,p,m,v,y,b){var x;return f(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,h,p,m,v,y,b)),x=!!d,!m&&x&&h&&h.push(typeof d=="object"?d:h[h.length-1]),x)},d:function(d,h,p,m){var v,y=d.split("."),b=this.f(y[0],h,p,m),x=this.options.modelGet,E=null;if(d==="."&&f(h[h.length-2]))b=h[h.length-1];else for(var _=1;_<y.length;_++)v=t(y[_],b,x),v!==void 0?(E=b,b=v):b="";return m&&!b?!1:(!m&&typeof b=="function"&&(h.push(E),b=this.mv(b,h,p),h.pop()),b)},f:function(d,h,p,m){for(var v=!1,y=null,b=!1,x=this.options.modelGet,E=h.length-1;E>=0;E--)if(y=h[E],v=t(d,y,x),v!==void 0){b=!0;break}return b?(!m&&typeof v=="function"&&(v=this.mv(v,h,p)),v):m?!1:""},ls:function(d,h,p,m,v){var y=this.options.delimiters;return this.options.delimiters=v,this.b(this.ct(c(d.call(h,m)),h,p)),this.options.delimiters=y,!1},ct:function(d,
Line truncated
|
||||||
|
`)}static async _entryToBuffer(t){let r=Buffer.from(t.path),n=Math.ceil((62+r.length+1)/8)*8,i=Buffer.alloc(n),a=new Fr(i),s=hs(t);return a.writeUInt32BE(s.ctimeSeconds),a.writeUInt32BE(s.ctimeNanoseconds),a.writeUInt32BE(s.mtimeSeconds),a.writeUInt32BE(s.mtimeNanoseconds),a.writeUInt32BE(s.dev),a.writeUInt32BE(s.ino),a.writeUInt32BE(s.mode),a.writeUInt32BE(s.uid),a.writeUInt32BE(s.gid),a.writeUInt32BE(s.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(oO(t)),a.write(t.path,r.length,"utf8"),i}async toObject(){let t=Buffer.alloc(12),r=new Fr(t);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let n=[];for(let o of this.entries)if(n.push(e._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&n.push(e._entryToBuffer(l));n=await Promise.all(n);let i=Buffer.concat(n),a=Buffer.concat([t,i]),s=await Vn(a);return Buffer.concat([a,Buffer.from(s,"hex")])}};function tu(e,t,r=!0,n=!0){let i=hs(e),a=hs(t);return r&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||n&&i.ino!==a.ino||i.size!==a.size}var np=null,us=Symbol("IndexCache");function lO(){return{map:new Map,stats:new Map}}async function cO(e,t,r){let n=await e.lstat(t),i=await e.read(t),a=await dp.from(i);r.map.set(t,a),r.stats.set(t,n)}async function uO(e,t,r){let n=r.stats.get(t);if(n===void 0)return!0;let i=await e.lstat(t);return n===null||i===null?!1:tu(n,i)}var yt=class{static async acquire({fs:t,gitdir:r,cache:n,allowUnmerged:i=!0},a){n[us]||(n[us]=lO());let s=`${r}/index`;np===null&&(np=new el.default({maxPending:1/0}));let o,l=[];return await np.acquire(s,async()=>{await uO(t,s,n[us])&&await cO(t,s,n[us]);let c=n[us].map.get(s);if(l=c.unmergedPaths,l.length&&!i)throw new tl(l);if(o=await a(c),c._dirty){let u=await c.toObject();await t.write(s,u),n[us].stats.set(s,await t.lstat(s)),c._dirty=!1}}),o}};function ru(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>-1&&(e=e.slice(t+1)),e}function ps(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}function o2(e){let t=new Map,r=function(i){if(!t.has(i)){let a={type:"tree",fullpath:i,basename:ru(i),metadata:{},children:[]};t.set(i,a),a.parent=r(ps(i)),a.parent&&a.parent!==a&&a.parent.children.push(a)}return t.get(i)},n=function(i,a){if(!t.has(i)){let s={type:"blob",fullpath:i,basename:ru(i),metadata:a,parent:r(ps(i)),children:[]};s.parent&&s.parent.children.push(s),t.set(i,s)}return t.get(i)};r(".");for(let i of e)n(i.path,i);return t}function fO(e){switch(e){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new le(`Unexpected GitTree entry mode: ${e.toString(8)}`)}var hp=class{constructor({fs:t,gitdir:r,cache:n}){this.treePromise=yt.acquire({fs:t,gitdir:r,cache:n},async function(a){return o2(a.entries)});let i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){let r=t._fullpath,i=(await this.treePromise).get(r);if(!i||i.type==="blob")return null;if(i.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let a=i.children.map(s=>s.fullpath);return a.sort(du),a}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){let n=(await this.treePromise).get(t._fullpath);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let i=n.type==="tree"?{}:hs(n.metadata);t._type=n.type==="tree"?"tree":fO(i.mode),t._mode=i.mode,n.type==="tree"?t._stat=void 0:t._stat=i}return t._stat}async content(t){}async oid(t){if(t._oid===!1){let n=(await this.treePromise).get(t._fullpath);t._oid=n.metadata.oid}return t._oid}},hu=Symbol("GitWalkSymbol");function pu(){let e=Object.create(null);return Object.defineProperty(e,hu,{value:function({fs:t,gitdir:r,cache:n}){return new hp({fs:t,gitdir:r,cache:n})}}),Object.freeze(e),e}var Le=class e extends Se{constructor(t){super(`Could not find ${t}.`),this.code=this.name=e.code,this.data={what:t}}};Le.code="NotFoundError";var zt=class e extends Se{constructor(t,r,n,i){super(`Object ${t} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${r}.`),this.code=this.name=e.code,this.data={oid:t,actual:r,expected:n,filepath:i}}};zt.code="ObjectTypeError";var _i=class e extends Se{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=e.code,this.data={value:t}}};_i.code="InvalidOidError";var rl=class e extends Se{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following:
|
||||||
|
[remote "${t}"]
|
||||||
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
||||||
|
`),this.code=this.name=e.code,this.data={remote:t}}};rl.code="NoRefspecError";var nu=class e{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let r=null;this.parsedConfig=t.trim().split(`
|
||||||
|
`).map(n=>{if(/^\s*#/.test(n))return{line:n,comment:!0};let i=n.indexOf(" ");if(n.startsWith("^")){let a=n.slice(1);return this.refs.set(r+"^{}",a),{line:n,ref:r,peeled:a}}else{let a=n.slice(0,i);return r=n.slice(i+1),this.refs.set(r,a),{line:n,ref:r,oid:a}}})}return this}static from(t){return new e(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join(`
|
||||||
|
`)+`
|
||||||
|
`}},iu=class e{constructor({remotePath:t,localPath:r,force:n,matchPrefix:i}){Object.assign(this,{remotePath:t,localPath:r,force:n,matchPrefix:i})}static from(t){let[r,n,i,a,s]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=i==="*";if(l!==(s==="*"))throw new le("Invalid refspec");return new e({remotePath:n,localPath:a,force:o,matchPrefix:l})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}},pp=class e{constructor(t=[]){this.rules=t}static from(t){let r=[];for(let n of t)r.push(iu.from(n));return new e(r)}add(t){let r=iu.from(t);this.rules.push(r)}translate(t){let r=[];for(let n of this.rules)for(let i of t){let a=n.translate(i);a&&r.push([i,a])}return r}translateOne(t){let r=null;for(let n of this.rules){let i=n.translate(t);i&&(r=i)}return r}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}};function dO(e,t){let r=e.replace(/\^\{\}$/,""),n=t.replace(/\^\{\}$/,""),i=-(r<n)||+(r>n);return i===0?e.endsWith("^{}")?1:-1:i}var Fw=new Map;function $w(e){let t=Fw.get(e);return t||(t=hO(e),Fw.set(e,t)),t}function hO(e){return e=e.split("/./").join("/").replace(/\/{2,}/g,"/"),e==="/."?"/":e==="./"||(e.startsWith("./")&&(e=e.slice(2)),e.endsWith("/.")&&(e=e.slice(0,-2)),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e==="")?".":e}function $(...e){return $w(e.map($w).join("/"))}var pO=e=>{e=e.toLowerCase();let t=parseInt(e);return e.endsWith("k")&&(t*=1024),e.endsWith("m")&&(t*=1024*1024),e.endsWith("g")&&(t*=1024*1024*1024),t},Qo=e=>{if(e=e.trim().toLowerCase(),e==="true"||e==="yes"||e==="on")return!0;if(e==="false"||e==="no"||e==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`)},Lw={core:{filemode:Qo,bare:Qo,logallrefupdates:Qo,symlinks:Qo,ignorecase:Qo,bigFileThreshold:pO}},mO=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,gO=/^[A-Za-z0-9-.]+$/,vO=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,yO=/^[A-Za-z][A-Za-z-]*$/,wO=/^(.*?)( *[#;].*)$/,bO=e=>{let t=mO.exec(e);if(t!=null){let[r,n]=t.slice(1);return[r,n]}return null},_O=e=>{let t=vO.exec(e);if(t!=null){let[r,n="true"]=t.slice(1),i=xO(n),a=SO(i);return[r,a]}return null},xO=e=>{let t=wO.exec(e);if(t==null)return e;let[r,n]=t.slice(1);return Dw(r)&&Dw(n)?`${r}${n}`:r},Dw=e=>(e.match(/(?:^|[^\\])"/g)||[]).length%2!==0,SO=e=>e.split("").reduce((t,r,n,i)=>{let a=r==='"'&&i[n-1]!=="\\",s=r==="\\"&&i[n+1]==='"';return a||s?t:t+r},""),Nw=e=>e!=null?e.toLowerCase():null,mp=(e,t,r)=>[Nw(e),t,Nw(r)].filter(n=>n!=null).join("."),Bw=e=>{let t=e.split("."),r=t.shift(),n=t.pop(),i=t.length?t.join("."):void 0;return{section:r,subsection:i,name:n,path:mp(r,i,n),sectionPath:mp(r,i,null)}},EO=(e,t)=>e.reduce((r,n,i)=>t(n)?i:r,-1),gp=class e{constructor(t){let r=null,n=null;this.parsedConfig=t?t.split(`
|
||||||
|
`).map(i=>{let a=null,s=null,o=i.trim(),l=bO(o),c=l!=null;if(c)[r,n]=l;else{let f=_O(o);f!=null&&([a,s]=f)}let u=mp(r,n,a);return{line:i,isSection:c,section:r,subsection:n,name:a,value:s,path:u}}):[]}static from(t){return new e(t)}async get(t,r=!1){let n=Bw(t).path,i=this.parsedConfig.filter(a=>a.path===n).map(({section:a,name:s,value:o})=>{let l=Lw[a]&&Lw[a][s];return l?l(o):o});return r?i:i.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(r=>r.section===t&&r.isSection).map(r=>r.subsection)}async deleteSection(t,r){this.parsedConfig=this.parsedConfig.filter(n=>!(n.section===t&&n.subsection===r))}async append(t,r){return this.set(t,r,!0)}async set(t,r,n=!1){let{section:i,subsection:a,name:s,path:o,sectionPath:l}=Bw(t),c=EO(this.parsedConfig,u=>u.path===o);if(r==null)c!==-1&&this.parsedConfig.splice(c,1);else if(c!==-1){let u=this.parsedConfig[c],f=Object.assign({},u,{name:s,value:r,modified:!0});n?this.parsedConfig.splice(c+1,0,f):this.parsedConfig[c]=f}else{let u=this.parsedConfig.findIndex(d=>d.path===l),f={section:i,subsection:a,name:s,value:r,modified:!0,path:o};if(gO.test(i)&&yO.test(s))if(u>=0)this.parsedConfig.splice(u+1,0,f);else{let d={section:i,subsection:a,modified:!0,path:l};this.parsedConfig.push(d,f)}}}toString(){return this.parsedConfig.map(({line:t,section:r,subsection:n,name:i,value:a,modified:s=!1})=>s?i!=null&&a!=null?typeof a=="string"&&/[#;]/.test(a)?` ${i} = "${a}"`:` ${i} = ${a}`:n!=null?`[${r} "${n}"]`:`[${r}]`:t).join(`
|
||||||
|
`)}},qe=class{static async get({fs:t,gitdir:r}){let n=await t.read(`${r}/config`,{encoding:"utf8"});return gp.from(n)}static async save({fs:t,gitdir:r,config:n}){await t.write(`${r}/config`,n.toString(),{encoding:"utf8"})}},Jc=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],AO=["config","description","index","shallow","commondir"],ip;async function yi(e,t){return ip===void 0&&(ip=new el.default),ip.acquire(e,t)}var W=class e{static async updateRemoteRefs({fs:t,gitdir:r,remote:n,refs:i,symrefs:a,tags:s,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let v of i.values())if(!v.match(/[0-9a-f]{40}/))throw new _i(v);let u=await qe.get({fs:t,gitdir:r});if(!o){if(o=await u.getall(`remote.${n}.fetch`),o.length===0)throw new rl(n);o.unshift(`+HEAD:refs/remotes/${n}/HEAD`)}let f=pp.from(o),d=new Map;if(c){let v=await e.listRefs({fs:t,gitdir:r,filepath:"refs/tags"});await e.deleteRefs({fs:t,gitdir:r,refs:v.map(y=>`refs/tags/${y}`)})}if(s){for(let v of i.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await e.exists({fs:t,gitdir:r,ref:v})){let y=i.get(v);d.set(v,y)}}let h=f.translate([...i.keys()]);for(let[v,y]of h){let b=i.get(v);d.set(y,b)}let p=f.translate([...a.keys()]);for(let[v,y]of p){let b=a.get(v),x=f.translateOne(b);x&&d.set(y,`ref: ${x}`)}let m=[];if(l){for(let v of f.localNamespaces()){let y=(await e.listRefs({fs:t,gitdir:r,filepath:v})).map(b=>`${v}/${b}`);for(let b of y)d.has(b)||m.push(b)}m.length>0&&await e.deleteRefs({fs:t,gitdir:r,refs:m})}for(let[v,y]of d)await yi(v,async()=>t.write($(r,v),`${y.trim()}
|
||||||
|
`,"utf8"));return{pruned:m}}static async writeRef({fs:t,gitdir:r,ref:n,value:i}){if(!i.match(/[0-9a-f]{40}/))throw new _i(i);await yi(n,async()=>t.write($(r,n),`${i.trim()}
|
||||||
|
`,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:r,ref:n,value:i}){await yi(n,async()=>t.write($(r,n),`ref: ${i.trim()}
|
||||||
|
`,"utf8"))}static async deleteRef({fs:t,gitdir:r,ref:n}){return e.deleteRefs({fs:t,gitdir:r,refs:[n]})}static async deleteRefs({fs:t,gitdir:r,refs:n}){await Promise.all(n.map(o=>t.rm($(r,o))));let i=await yi("packed-refs",async()=>t.read(`${r}/packed-refs`,{encoding:"utf8"})),a=nu.from(i),s=a.refs.size;for(let o of n)a.refs.has(o)&&a.delete(o);a.refs.size<s&&(i=a.toString(),await yi("packed-refs",async()=>t.write(`${r}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:r,ref:n,depth:i=void 0}){if(i!==void 0&&(i--,i===-1))return n;if(n.startsWith("ref: "))return n=n.slice(5),e.resolve({fs:t,gitdir:r,ref:n,depth:i});if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let a=await e.packedRefs({fs:t,gitdir:r}),s=Jc(n).filter(o=>!AO.includes(o));for(let o of s){let l=await yi(o,async()=>await t.read(`${r}/${o}`,{encoding:"utf8"})||a.get(o));if(l)return e.resolve({fs:t,gitdir:r,ref:l.trim(),depth:i})}throw new Le(n)}static async exists({fs:t,gitdir:r,ref:n}){try{return await e.expand({fs:t,gitdir:r,ref:n}),!0}catch(i){return!1}}static async expand({fs:t,gitdir:r,ref:n}){if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let i=await e.packedRefs({fs:t,gitdir:r}),a=Jc(n);for(let s of a)if(await yi(s,async()=>t.exists(`${r}/${s}`))||i.has(s))return s;throw new Le(n)}static async expandAgainstMap({ref:t,map:r}){let n=Jc(t);for(let i of n)if(await r.has(i))return i;throw new Le(t)}static resolveAgainstMap({ref:t,fullref:r=t,depth:n=void 0,map:i}){if(n!==void 0&&(n--,n===-1))return{fullref:r,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),e.resolveAgainstMap({ref:t,fullref:r,depth:n,map:i});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:r,oid:t};let a=Jc(t);for(let s of a){let o=i.get(s);if(o)return e.resolveAgainstMap({ref:o.trim(),fullref:s,depth:n,map:i})}throw new Le(t)}static async packedRefs({fs:t,gitdir:r}){let n=await yi("packed-refs",async()=>t.read(`${r}/packed-refs`,{encoding:"utf8"}));return nu.from(n).refs}static async listRefs({fs:t,gitdir:r,filepath:n}){let i=e.packedRefs({fs:t,gitdir:r}),a=null;try{a=await t.readdirDeep(`${r}/${n}`),a=a.map(s=>s.replace(`${r}/${n}/`,""))}catch(s){a=[]}for(let s of(await i).keys())s.startsWith(n)&&(s=s.replace(n+"/",""),a.includes(s)||a.push(s));return a.sort(dO),a}static async listBranches({fs:t,gitdir:r,remote:n}){return n?e.listRefs({fs:t,gitdir:r,filepath:`refs/remotes/${n}`}):e.listRefs({fs:t,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:r}){return(await e.listRefs({fs:t,gitdir:r,filepath:"refs/tags"})).filter(i=>!i.endsWith("^{}"))}};function kO(e,t){return du(jw(e),jw(t))}function jw(e){return e.mode==="040000"?e.path+"/":e.path}function l2(e){switch(e){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new le(`Unexpected GitTree entry mode: ${e}`)}function TO(e){let t=[],r=0;for(;r<e.length;){let n=e.indexOf(32,r);if(n===-1)throw new le(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let i=e.indexOf(0,r);if(i===-1)throw new le(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let a=e.slice(r,n).toString("utf8");a==="40000"&&(a="040000");let s=l2(a),o=e.slice(n+1,i).toString("utf8");if(o.includes("\\")||o.includes("/"))throw new ds(o);let l=e.slice(i+1,i+21).toString("hex");r=i+21,t.push({mode:a,path:o,oid:l,type:s})}return t}function CO(e){if(typeof e=="number"&&(e=e.toString(8)),e.match(/^0?4.*/))return"040000";if(e.match(/^1006.*/))return"100644";if(e.match(/^1007.*/))return"100755";if(e.match(/^120.*/))return"120000";if(e.match(/^160.*/))return"160000";throw new le(`Could not understand file mode: ${e}`)}function PO(e){return!e.oid&&e.sha&&(e.oid=e.sha),e.mode=CO(e.mode),e.type||(e.type=l2(e.mode)),e}var tr=class e{constructor(t){if(Buffer.isBuffer(t))this._entries=TO(t);else if(Array.isArray(t))this._entries=t.map(PO);else throw new le("invalid type passed to GitTree constructor");this._entries.sort(i2)}static from(t){return new e(t)}render(){return this._entries.map(t=>`${t.mode} ${t.type} ${t.oid} ${t.path}`).join(`
|
||||||
|
`)}toObject(){let t=[...this._entries];return t.sort(kO),Buffer.concat(t.map(r=>{let n=Buffer.from(r.mode.replace(/^0/,"")),i=Buffer.from(" "),a=Buffer.from(r.path,"utf8"),s=Buffer.from([0]),o=Buffer.from(r.oid,"hex");return Buffer.concat([n,i,a,s,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let t of this._entries)yield t}},xi=class{static wrap({type:t,object:r}){return Buffer.concat([Buffer.from(`${t} ${r.byteLength.toString()}\0`),Buffer.from(r)])}static unwrap(t){let r=t.indexOf(32),n=t.indexOf(0),i=t.slice(0,r).toString("utf8"),a=t.slice(r+1,n).toString("utf8"),s=t.length-(n+1);if(parseInt(a)!==s)throw new le(`Length mismatch: expected ${a} bytes but got ${s} instead.`);return{type:i,object:Buffer.from(t.slice(n+1))}}};async function RO({fs:e,gitdir:t,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`,i=await e.read(`${t}/${n}`);return i?{object:i,format:"deflated",source:n}:null}function MO(e,t){let r=new Fr(e),n=Hw(r);if(n!==t.byteLength)throw new le(`applyDelta expected source buffer to be ${n} bytes but the provided buffer was ${t.length} bytes`);let i=Hw(r),a,s=Gw(r,t);if(s.byteLength===i)a=s;else{a=Buffer.alloc(i);let o=new Fr(a);for(o.copy(s);!r.eof();)o.copy(Gw(r,t));let l=o.tell();if(i!==l)throw new le(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`)}return a}function Hw(e){let t=0,r=0,n=null;do n=e.readUInt8(),t|=(n&127)<<r,r+=7;while(n&128);return t}function Uw(e,t,r){let n=0,i=0;for(;r--;)t&1&&(n|=e.readUInt8()<<i),t>>=1,i+=8;return n}function Gw(e,t){let r=e.readUInt8(),n=128,i=15,a=112;if(r&n){let s=Uw(e,r&i,4),o=Uw(e,(r&a)>>4,3);return o===0&&(o=65536),t.slice(s,s+o)}else return e.slice(r)}function OO(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function c2(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:OO(e)}var au=class{constructor(t){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=c2(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:r}=await this.stream.next();return t&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;let r=[this.buffer];for(;this.cursor+t>IO(r);){let n=await this._next();if(this._ended)break;r.push(n)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function IO(e){return e.reduce((t,r)=>t+r.length,0)}async function FO(e,t){let r=new au(e),n=await r.read(4);if(n=n.toString("utf8"),n!=="PACK")throw new le(`Invalid PACK header '${n}'`);let i=await r.read(4);if(i=i.readUInt32BE(0),i!==2)throw new le(`Invalid packfile version: ${i}`);let a=await r.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!r.eof()&&a--;){let s=r.tell(),{type:o,length:l,ofs:c,reference:u}=await $O(r),f=new fu.default.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new le(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new le("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-f.strm.avail_in);let h=r.tell();await t({data:f.result,type:o,num:a,offset:s,end:h,reference:u,ofs:c})}}}}async function $O(e){let t=await e.byte(),r=t>>4&7,n=t&15;if(t&128){let s=4;do t=await e.byte(),n|=(t&127)<<s,s+=7;while(t&128)}let i,a;if(r===6){let s=0;i=0;let o=[];do t=await e.byte(),i|=(t&127)<<s,s+=7,o.push(t);while(t&128);a=Buffer.from(o)}return r===7&&(a=await e.read(2
Line truncated
|
||||||
|
`,e}function su(e){let[,t,r,n,i]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:r,timestamp:Number(n),timezoneOffset:VO(i)}}function VO(e){let[,t,r,n]=e.match(/(\+|-)(\d\d)(\d\d)/);return n=(t==="+"?1:-1)*(Number(r)*60+Number(n)),WO(n)}function WO(e){return e===0?e:-e}var pr=class e{constructor(t){if(typeof t=="string")this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString("utf8");else if(typeof t=="object")this._tag=e.render(t);else throw new le("invalid type passed to GitAnnotatedTag constructor")}static from(t){return new e(t)}static render(t){return`object ${t.object}
|
||||||
|
type ${t.type}
|
||||||
|
tag ${t.tag}
|
||||||
|
tagger ${vp(t.tagger)}
|
||||||
|
|
||||||
|
${t.message}
|
||||||
|
${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
||||||
|
|
||||||
|
`))}message(){let t=this.withoutSignature();return t.slice(t.indexOf(`
|
||||||
|
|
||||||
|
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let t=this.justHeaders().split(`
|
||||||
|
`),r=[];for(let i of t)i[0]===" "?r[r.length-1]+=`
|
||||||
|
`+i.slice(1):r.push(i);let n={};for(let i of r){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(s):n[a]=s}return n.tagger&&(n.tagger=su(n.tagger)),n.committer&&(n.committer=su(n.committer)),n}withoutSignature(){let t=zn(this._tag);return t.indexOf(`
|
||||||
|
-----BEGIN PGP SIGNATURE-----`)===-1?t:t.slice(0,t.lastIndexOf(`
|
||||||
|
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
||||||
|
-----BEGIN PGP SIGNATURE-----`)===-1)return;let t=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return zn(t)}payload(){return this.withoutSignature()+`
|
||||||
|
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,r,n){let i=t.payload(),{signature:a}=await r({payload:i,secretKey:n});a=zn(a);let s=i+a;return e.from(s)}};function sp(e){return e.trim().split(`
|
||||||
|
`).map(t=>" "+t).join(`
|
||||||
|
`)+`
|
||||||
|
`}function qO(e){return e.split(`
|
||||||
|
`).map(t=>t.replace(/^ /,"")).join(`
|
||||||
|
`)}var rr=class e{constructor(t){if(typeof t=="string")this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString("utf8");else if(typeof t=="object")this._commit=e.render(t);else throw new le("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:t,signature:r}){let n=e.justHeaders(t),i=e.justMessage(t),a=zn(n+`
|
||||||
|
gpgsig`+sp(r)+`
|
||||||
|
`+i);return new e(a)}static from(t){return new e(t)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return e.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return zn(t.slice(t.indexOf(`
|
||||||
|
|
||||||
|
`)+2))}static justHeaders(t){return t.slice(0,t.indexOf(`
|
||||||
|
|
||||||
|
`))}parseHeaders(){let t=e.justHeaders(this._commit).split(`
|
||||||
|
`),r=[];for(let i of t)i[0]===" "?r[r.length-1]+=`
|
||||||
|
`+i.slice(1):r.push(i);let n={parent:[]};for(let i of r){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(n[a])?n[a].push(s):n[a]=s}return n.author&&(n.author=su(n.author)),n.committer&&(n.committer=su(n.committer)),n}static renderHeaders(t){let r="";if(t.tree?r+=`tree ${t.tree}
|
||||||
|
`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
||||||
|
`,t.parent){if(t.parent.length===void 0)throw new le("commit 'parent' property should be an array");for(let a of t.parent)r+=`parent ${a}
|
||||||
|
`}let n=t.author;r+=`author ${vp(n)}
|
||||||
|
`;let i=t.committer||t.author;return r+=`committer ${vp(i)}
|
||||||
|
`,t.gpgsig&&(r+="gpgsig"+sp(t.gpgsig)),r}static render(t){return e.renderHeaders(t)+`
|
||||||
|
`+zn(t.message)}render(){return this._commit}withoutSignature(){let t=zn(this._commit);if(t.indexOf(`
|
||||||
|
gpgsig`)===-1)return t;let r=t.slice(0,t.indexOf(`
|
||||||
|
gpgsig`)),n=t.slice(t.indexOf(`-----END PGP SIGNATURE-----
|
||||||
|
`)+28);return zn(r+`
|
||||||
|
`+n)}isolateSignature(){let t=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return qO(t)}static async sign(t,r,n){let i=t.withoutSignature(),a=e.justMessage(t._commit),{signature:s}=await r({payload:i,secretKey:n});s=zn(s);let l=e.justHeaders(t._commit)+`
|
||||||
|
gpgsig`+sp(s)+`
|
||||||
|
`+a;return e.from(l)}};async function bs({fs:e,cache:t,gitdir:r,oid:n}){if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:tr.from([]),oid:n};let{type:i,object:a}=await Ye({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=pr.from(a).parse().object,bs({fs:e,cache:t,gitdir:r,oid:n});if(i==="commit")return n=rr.from(a).parse().tree,bs({fs:e,cache:t,gitdir:r,oid:n});if(i!=="tree")throw new zt(n,i,"tree");return{tree:tr.from(a),oid:n}}var yp=class{constructor({fs:t,gitdir:r,ref:n,cache:i}){this.fs=t,this.cache=i,this.gitdir=r,this.mapPromise=(async()=>{let s=new Map,o;try{o=await W.resolve({fs:t,gitdir:r,ref:n})}catch(c){c instanceof Le&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await bs({fs:t,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",s.set(".",l),s})();let a=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){let r=t._fullpath,{fs:n,cache:i,gitdir:a}=this,s=await this.mapPromise,o=s.get(r);if(!o)throw new Error(`No obj for ${r}`);let l=o.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!=="tree")return null;let{type:c,object:u}=await Ye({fs:n,cache:i,gitdir:a,oid:l});if(c!==o.type)throw new zt(l,c,o.type);let f=tr.from(u);for(let d of f)s.set($(r,d.path),d);return f.entries().map(d=>$(r,d.path))}async type(t){if(t._type===!1){let r=await this.mapPromise,{type:n}=r.get(t._fullpath);t._type=n}return t._type}async mode(t){if(t._mode===!1){let r=await this.mapPromise,{mode:n}=r.get(t._fullpath);t._mode=a2(parseInt(n,8))}return t._mode}async stat(t){}async content(t){if(t._content===!1){let r=await this.mapPromise,{fs:n,cache:i,gitdir:a}=this,o=r.get(t._fullpath).oid,{type:l,object:c}=await Ye({fs:n,cache:i,gitdir:a,oid:o});l!=="blob"?t._content=void 0:t._content=new Uint8Array(c)}return t._content}async oid(t){if(t._oid===!1){let n=(await this.mapPromise).get(t._fullpath);t._oid=n.oid}return t._oid}};function bi({ref:e="HEAD"}={}){let t=Object.create(null);return Object.defineProperty(t,hu,{value:function({fs:r,gitdir:n,cache:i}){return new yp({fs:r,gitdir:n,ref:e,cache:i})}}),Object.freeze(t),t}var wp=class{constructor({fs:t,dir:r,gitdir:n,cache:i}){this.fs=t,this.cache=i,this.dir=r,this.gitdir=n;let a=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){let r=t._fullpath,{fs:n,dir:i}=this,a=await n.readdir($(i,r));return a===null?null:a.map(s=>$(r,s))}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){let{fs:r,dir:n}=this,i=await r.lstat(`${n}/${t._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let a=i.isDirectory()?"tree":"blob";a==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(a="special"),t._type=a,i=hs(i),t._mode=i.mode,i.size===-1&&t._actualSize&&(i.size=t._actualSize),t._stat=i}return t._stat}async content(t){if(t._content===!1){let{fs:r,dir:n,gitdir:i}=this;if(await t.type()==="tree")t._content=void 0;else{let s=await(await qe.get({fs:r,gitdir:i})).get("core.autocrlf"),o=await r.read(`${n}/${t._fullpath}`,{autocrlf:s});t._actualSize=o.length,t._stat&&t._stat.size===-1&&(t._stat.size=t._actualSize),t._content=new Uint8Array(o)}}return t._content}async oid(t){if(t._oid===!1){let{fs:r,gitdir:n,cache:i}=this,a;await yt.acquire({fs:r,gitdir:n,cache:i},async function(s){let o=s.entriesMap.get(t._fullpath),l=await t.stat(),u=await(await qe.get({fs:r,gitdir:n})).get("core.filemode"),f=typeof process!="undefined"?process.platform!=="win32":!0;!o||tu(l,o,u,f)?await t.content()===void 0?a=void 0:(a=await Vn(xi.wrap({type:"blob",object:await t.content()})),o&&a===o.oid&&(!u||l.mode===o.mode)&&tu(l,o,u,f)&&s.insert({filepath:t._fullpath,stats:l,oid:a})):a=o.oid}),t._oid=a}return t._oid}};function mu(){let e=Object.create(null);return Object.defineProperty(e,hu,{value:function({fs:t,dir:r,gitdir:n,cache:i}){return new wp({fs:t,dir:r,gitdir:n,cache:i})}}),Object.freeze(e),e}function YO(e,t){let r=t-e;return Array.from({length:r},(n,i)=>e+i)}var f2=typeof Array.prototype.flat=="undefined"?e=>e.reduce((t,r)=>t.concat(r),[]):e=>e.flat(),bp=class{constructor(){this.value=null}consider(t){t!=null&&(this.value===null?this.value=t:t<this.value&&(this.value=t))}reset(){this.value=null}};function*XO(e){let t=new bp,r,n=[],i=e.length;for(let a=0;a<i;a++)n[a]=e[a].next().value,n[a]!==void 0&&t.consider(n[a]);if(t.value!==null)for(;;){let a=[];r=t.value,t.reset();for(let s=0;s<i;s++)n[s
Line truncated
|
||||||
|
`),n=new TextEncoder().encode(n)}catch(i){}return typeof n!="string"&&(n=Buffer.from(n)),n}catch(n){return null}}async write(t,r,n={}){try{await this._writeFile(t,r,n);return}catch(i){await this.mkdir(ps(t)),await this._writeFile(t,r,n)}}async mkdir(t,r=!1){try{await this._mkdir(t);return}catch(n){if(n===null||n.code==="EEXIST")return;if(r)throw n;if(n.code==="ENOENT"){let i=ps(t);if(i==="."||i==="/"||i===t)throw n;await this.mkdir(i),await this.mkdir(t,!0)}}}async rm(t){try{await this._unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(t,r){try{r&&r.recursive?await this._rm(t,r):await this._rmdir(t)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(t){try{let r=await this._readdir(t);return r.sort(du),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(t){let r=await this._readdir(t);return(await Promise.all(r.map(async i=>{let a=t+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}async lstat(t){try{return await this._lstat(t)}catch(r){if(r.code==="ENOENT")return null;throw r}}async readlink(t,r={encoding:"buffer"}){try{let n=await this._readlink(t,r);return Buffer.isBuffer(n)?n:Buffer.from(n)}catch(n){if(n.code==="ENOENT")return null;throw n}}async writelink(t,r){return this._symlink(r.toString("utf8"),t)}};function C(e,t){if(t===void 0)throw new er(e)}async function ou(e,t){return!e&&!t?!1:e&&!t||!e&&t?!0:!(await e.type()==="tree"&&await t.type()==="tree"||await e.type()===await t.type()&&await e.mode()===await t.mode()&&await e.oid()===await t.oid())}async function JO({fs:e,dir:t,gitdir:r=$(t,".git"),commit:n="HEAD",cache:i={}}){try{C("fs",e),C("dir",t),C("gitdir",r);let a=new X(e),s=[bi({ref:n}),mu(),pu()],o=[];await yt.acquire({fs:a,gitdir:r,cache:i},async function(c){o=c.unmergedPaths});let l=await _s({fs:a,cache:i,dir:t,gitdir:r,trees:s,map:async function(c,[u,f,d]){let h=!await ou(f,d),p=o.includes(c),m=!await ou(d,u);if(h||p)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(m)return!1;throw new ml(c)}});await yt.acquire({fs:a,gitdir:r,cache:i},async function(c){for(let u of l)if(u!==!1){if(!u){await a.rmdir(`${t}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let f=new TextDecoder().decode(u.content);await a.write(`${t}/${u.path}`,f,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(a){throw a.caller="git.abortMerge",a}}var xs=class{static async isIgnored({fs:t,dir:r,gitdir:n=$(r,".git"),filepath:i}){if(ru(i)===".git")return!0;if(i===".")return!1;let a="",s=$(n,"info","exclude");await t.exists(s)&&(a=await t.read(s,"utf8"));let o=[{gitignore:$(r,".gitignore"),filepath:i}],l=i.split("/").filter(Boolean);for(let u=1;u<l.length;u++){let f=l.slice(0,u).join("/"),d=l.slice(u).join("/");o.push({gitignore:$(r,f,".gitignore"),filepath:d})}let c=!1;for(let u of o){let f;try{f=await t.read(u.gitignore,"utf8")}catch(p){if(p.code==="NOENT")continue}let d=(0,r2.default)().add(a);d.add(f);let h=ps(u.filepath);if(h!=="."&&d.ignores(h))return!0;c?c=!d.test(u.filepath).unignored:c=d.test(u.filepath).ignored}return c}};async function QO({fs:e,gitdir:t,object:r,format:n,oid:i}){if(n!=="deflated")throw new le("GitObjectStoreLoose expects objects to write to be in deflated format");let a=`objects/${i.slice(0,2)}/${i.slice(2)}`,s=`${t}/${a}`;await e.exists(s)||await e.write(s,r)}var op=null;async function d2(e){return op===null&&(op=t6()),op?e6(e):fu.default.deflate(e)}async function e6(e){let t=new CompressionStream("deflate"),r=new Blob([e]).stream().pipeThrough(t);return new Uint8Array(await new Response(r).arrayBuffer())}function t6(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(e){return!1}}async function mr({fs:e,gitdir:t,type:r,object:n,format:i="content",oid:a=void 0,dryRun:s=!1}){return i!=="deflated"&&(i!=="wrapped"&&(n=xi.wrap({type:r,object:n})),a=await Vn(n),n=Buffer.from(await d2(n))),s||await QO({fs:e,gitdir:t,object:n,format:"deflated",oid:a}),a}function r6(e){let t;for(;~(t=e.indexOf(92));)e[t]=47;return e}async function n6({fs:e,dir:t,gitdir:r=$(t,".git"),filepath:n,cache:i={},force:a=!1,parallel:s=!0}){try{C("fs",e),C("dir",t),C("gitdir",r),C("filepath",n);let o=new X(e);await yt.acquire({fs:o,gitdir:r,cache:i},async l=>xp({dir:t,gitdir:r,fs:o,filepath:n,index:l,force:a,parallel:s}))}catch(o){throw o.caller="git.add",o}}async function xp({dir:e,gitdir:t,fs:r,filepath:n,index:i,force:a,parallel:s}){n=Array.isArray(n)?n:[n];let o=n.map(async f=>{if(!a&&await xs.isIgnored({fs:r,dir:e,gitdir:t,filepath:f}))return;let d=await r.lstat($(e,f));if(!d)throw new Le(f);if(d.isDirectory()){let h=await r.readdir($(e,f));if(s){let p=h.map(m=>xp({dir:e,gitdir:t,fs:r,filepath:[$(f,m)],index:i,force:a,parallel:s}));await Promise.all(p)}else for(let p of h)await xp({dir:e,gitdir:t,fs:r,filepath:[$(f,p)],index:i,force:a,parallel:s})}else{let p=await(await qe.get({fs:r,
Line truncated
|
||||||
|
`,author:l,committer:c,signingKey:u})}async function a6({fs:e,onSign:t,dir:r,gitdir:n=$(r,".git"),ref:i="refs/notes/commits",oid:a,note:s,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{C("fs",e),C("gitdir",n),C("oid",a),C("note",s),u&&C("onSign",t);let d=new X(e),h=await fa({fs:d,gitdir:n,author:l});if(!h)throw new Vt("author");let p=await Ss({fs:d,gitdir:n,author:h,committer:c});if(!p)throw new Vt("committer");return await i6({fs:new X(d),cache:f,onSign:t,gitdir:n,ref:i,oid:a,note:s,force:o,author:h,committer:p,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}async function v2({fs:e,gitdir:t,remote:r,url:n,force:i}){if(r!==Qr.default.clean(r))throw new Wn(r,Qr.default.clean(r));let a=await qe.get({fs:e,gitdir:t});if(!i&&(await a.getSubsections("remote")).includes(r)&&n!==await a.get(`remote.${r}.url`))throw new en("remote",r);await a.set(`remote.${r}.url`,n),await a.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await qe.save({fs:e,gitdir:t,config:a})}async function s6({fs:e,dir:t,gitdir:r=$(t,".git"),remote:n,url:i,force:a=!1}){try{return C("fs",e),C("gitdir",r),C("remote",n),C("url",i),await v2({fs:new X(e),gitdir:r,remote:n,url:i,force:a})}catch(s){throw s.caller="git.addRemote",s}}async function o6({fs:e,cache:t,onSign:r,gitdir:n,ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await W.exists({fs:e,gitdir:n,ref:i}))throw new en("tag",i);let f=await W.resolve({fs:e,gitdir:n,ref:l||"HEAD"}),{type:d}=await Ye({fs:e,cache:t,gitdir:n,oid:f}),h=pr.from({object:f,type:d,tag:i.replace("refs/tags/",""),tagger:a,message:s,gpgsig:o});c&&(h=await pr.sign(h,r,c));let p=await mr({fs:e,gitdir:n,type:"tag",object:h.toObject()});await W.writeRef({fs:e,gitdir:n,ref:i,value:p})}async function l6({fs:e,onSign:t,dir:r,gitdir:n=$(r,".git"),ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{C("fs",e),C("gitdir",n),C("ref",i),c&&C("onSign",t);let d=new X(e),h=await fa({fs:d,gitdir:n,author:a});if(!h)throw new Vt("tagger");return await o6({fs:d,cache:f,onSign:t,gitdir:n,ref:i,tagger:h,message:s,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function c6({fs:e,gitdir:t,ref:r,object:n,checkout:i=!1,force:a=!1}){if(r!==Qr.default.clean(r))throw new Wn(r,Qr.default.clean(r));let s=`refs/heads/${r}`;if(!a&&await W.exists({fs:e,gitdir:t,ref:s}))throw new en("branch",r,!1);let o;try{o=await W.resolve({fs:e,gitdir:t,ref:n||"HEAD"})}catch(l){}o&&await W.writeRef({fs:e,gitdir:t,ref:s,value:o}),i&&await W.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:s})}async function u6({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n,object:i,checkout:a=!1,force:s=!1}){try{return C("fs",e),C("gitdir",r),C("ref",n),await c6({fs:new X(e),gitdir:r,ref:n,object:i,checkout:a,force:s})}catch(o){throw o.caller="git.branch",o}}var y2=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function Tp({fs:e,cache:t,onProgress:r,onPostCheckout:n,dir:i,gitdir:a,remote:s,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0}){let p;if(n)try{p=await W.resolve({fs:e,gitdir:a,ref:"HEAD"})}catch(v){p="0000000000000000000000000000000000000000"}let m;try{m=await W.resolve({fs:e,gitdir:a,ref:o})}catch(v){if(o==="HEAD")throw v;let y=`${s}/${o}`;if(m=await W.resolve({fs:e,gitdir:a,ref:y}),h){let b=await qe.get({fs:e,gitdir:a});await b.set(`branch.${o}.remote`,s),await b.set(`branch.${o}.merge`,`refs/heads/${o}`),await qe.save({fs:e,gitdir:a,config:b})}await W.writeRef({fs:e,gitdir:a,ref:`refs/heads/${o}`,value:m})}if(!c){let v;try{v=await f6({fs:e,cache:t,onProgress:r,dir:i,gitdir:a,ref:o,force:d,filepaths:l})}catch(_){throw _ instanceof Le&&_.data.what===m?new sl(o,m):_}let y=v.filter(([_])=>_==="conflict").map(([_,k])=>k);if(y.length>0)throw new al(y);let b=v.filter(([_])=>_==="error").map(([_,k])=>k);if(b.length>0)throw new le(b.join(", "));if(f){n&&await n({previousHead:p,newHead:m,type:l!=null&&l.length>0?"file":"branch"});return}let x=0,E=v.length;await yt.acquire({fs:e,gitdir:a,cache:t},async function(_){await Promise.all(v.filter(([k])=>k==="delete"||k==="delete-index").map(async function([k,w]){let A=`${i}/${w}`;k==="delete"&&await e.rm(A),_.delete({filepath:w}),r&&await r({phase:"Updating workdir",loaded:++x,total:E})}))}),await yt.acquire({fs:e,gitdir:a,cache:t},async function(_){for(let[k,w]of v)if(k==="rmdir"||k==="rmdir-index"){let A=`${i}/${w}`;try{k==="rmdir-index"&&_.delete({filepath:w}),await e.rmdir(A),r&&await r({phase:"Updating workdir",loaded:++x,total:E})}catch(S){if(S.code==="ENOTEMPTY")console.log(`Did not delete ${w} because directory is not empty`);else throw S}}}),await Promise.all(v.filter(([_])=>_==="mkdir"||_==="mkdir-index").map(async function([_,k]){let w=`${i}/${k}`;await e.mkdir(w),r&&await r({phase:"Updating workdir",loaded:++x,total:E})})),await yt.acquire({fs:e,gitdir:a,cache:t},async
Line truncated
|
||||||
|
`).map(s=>i.add(s))}),i}static async write({fs:t,gitdir:r,oids:n}){la===null&&(la=new el.default);let i=$(r,"shallow");if(n.size>0){let a=[...n].join(`
|
||||||
|
`)+`
|
||||||
|
`;await la.acquire(i,async function(){await t.write(i,a,{encoding:"utf8"})})}else await la.acquire(i,async function(){await t.rm(i)})}};async function g6({fs:e,gitdir:t,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`;return e.exists(`${t}/${n}`)}async function v6({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i}){let a=await e.readdir($(r,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(let s of a){let o=`${r}/objects/pack/${s}`,l=await Ap({fs:e,cache:t,filename:o,getExternalRefDelta:i});if(l.error)throw new le(l.error);if(l.offsets.has(n))return!0}return!1}async function Qw({fs:e,cache:t,gitdir:r,oid:n,format:i="content"}){let a=o=>Ye({fs:e,cache:t,gitdir:r,oid:o}),s=await g6({fs:e,gitdir:r,oid:n});return s||(s=await v6({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:a})),s}function y6(e){let i="5041434b"+"00000002"+"00000000";return e.slice(0,12).toString("hex")===i}function b2(e,t){let r=e.map(n=>n.split("=",1)[0]);return t.filter(n=>{let i=n.split("=",1)[0];return r.includes(i)})}var vu={name:"isomorphic-git",version:"1.27.1",agent:"git/isomorphic-git@1.27.1"},fs=class{constructor(){this._queue=[]}write(t){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:t})}else this._queue.push(t)}end(){if(this._ended=!0,this._waiting){let t=this._waiting;this._waiting=null,t({done:!0})}}destroy(t){this.error=t,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(t=>{this._waiting=t})}};function w6(e){let t=e.indexOf("\r"),r=e.indexOf(`
|
||||||
|
`);return t===-1&&r===-1?-1:t===-1?r+1:r===-1?t+1:r===t+1?r+1:Math.min(t,r)+1}function _2(e){let t=new fs,r="";return(async()=>(await bl(e,n=>{for(n=n.toString("utf8"),r+=n;;){let i=w6(r);if(i===-1)break;t.write(r.slice(0,i)),r=r.slice(i)}}),r.length>0&&t.write(r),t.end()))(),t}var uu=class{static demux(t){let r=We.streamReader(t),n=new fs,i=new fs,a=new fs,s=async function(){let o=await r();if(o===null)return s();if(o===!0){n.end(),a.end(),t.error?i.destroy(t.error):i.end();return}switch(o[0]){case 1:{i.write(o.slice(1));break}case 2:{a.write(o.slice(1));break}case 3:{let l=o.slice(1);a.write(l),n.end(),a.end(),i.destroy(new Error(l.toString("utf8")));return}default:n.write(o)}s()};return s(),{packetlines:n,packfile:i,progress:a}}};async function b6(e){let{packetlines:t,packfile:r,progress:n}=uu.demux(e),i=[],a=[],s=[],o=!1,l=!1;return new Promise((c,u)=>{bl(t,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new _i(h)),i.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new _i(h)),a.push(h)}else if(d.startsWith("ACK")){let[,h,p]=d.split(" ");s.push({oid:h,status:p}),p||(l=!0)}else d.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(e.error?u(e.error):c({shallows:i,unshallows:a,acks:s,nak:o,packfile:r,progress:n}))}).finally(()=>{l||(e.error?u(e.error):c({shallows:i,unshallows:a,acks:s,nak:o,packfile:r,progress:n}))})})}function _6({capabilities:e=[],wants:t=[],haves:r=[],shallows:n=[],depth:i=null,since:a=null,exclude:s=[]}){let o=[];t=[...new Set(t)];let l=` ${e.join(" ")}`;for(let c of t)o.push(We.encode(`want ${c}${l}
|
||||||
|
`)),l="";for(let c of n)o.push(We.encode(`shallow ${c}
|
||||||
|
`));i!==null&&o.push(We.encode(`deepen ${i}
|
||||||
|
`)),a!==null&&o.push(We.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)}
|
||||||
|
`));for(let c of s)o.push(We.encode(`deepen-not ${c}
|
||||||
|
`));o.push(We.flush());for(let c of r)o.push(We.encode(`have ${c}
|
||||||
|
`));return o.push(We.encode(`done
|
||||||
|
`)),o}async function Cp({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:p=null,since:m=null,exclude:v=[],relative:y=!1,tags:b=!1,singleBranch:x=!1,headers:E={},prune:_=!1,pruneTags:k=!1}){let w=c||await ha({fs:e,gitdir:l,test:!0}),A=await qe.get({fs:e,gitdir:l}),S=f||w&&await A.get(`branch.${w}.remote`)||"origin",T=d||await A.get(`remote.${S}.url`);if(typeof T=="undefined")throw new er("remote OR url");let P=u||w&&await A.get(`branch.${w}.merge`)||c||"HEAD";h===void 0&&(h=await A.get("http.corsProxy"));let I=As.getRemoteHelperFor({url:T}),N=await I.discover({http:r,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:T,headers:E,protocolVersion:1}),L=N.auth,ee=N.refs;if(ee.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!N.capabilities.has("shallow"))throw new wi("shallow","depth");if(m!==null&&!N.capabilities.has("deepen-since"))throw new wi("deepen-since","since");if(v.length>0&&!N.capabilities.has("deepen-not"))throw new wi("deepen-not","exclude");if(y===!0&&!N.capabilities.has("deepen-relative"))throw new wi("deepen-relative","relative");let{oid:fe,fullref:J}=W.resolveAgainstMap({ref:P,map:ee});for(let H of ee.keys())H===J||H==="HEAD"||H.startsWith("refs/heads/")||b&&H.startsWith("refs/tags/")||ee.delete(H);let Q=b2([...N.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${vu.agent}`]);y&&Q.push("deepen-relative");let Pe=x?[fe]:ee.values(),ge=x?[w]:await W.listRefs({fs:e,gitdir:l,filepath:"refs"}),z=[];for(let H of ge)try{H=await W.expand({fs:e,gitdir:l,ref:H});let Je=await W.resolve({fs:e,gitdir:l,ref:H});await Qw({fs:e,cache:t,gitdir:l,oid:Je})&&z.push(Je)}catch(Je){}z=[...new Set(z)];let Y=await da.read({fs:e,gitdir:l}),O=N.capabilities.has("shallow")?[...Y]:[],he=_6({capabilities:Q,wants:Pe,haves:z,shallows:O,depth:p,since:m,exclude:v}),ze=Buffer.from(await cu(he)),gt=await I.connect({http:r,onProgress:n,corsProxy:h,service:"git-upload-pack",url:T,auth:L,body:[ze],headers:E}),Re=await b6(gt.body);gt.headers&&(Re.headers=gt.headers);for(let H of Re.shallows)if(!Y.has(H))try{let{object:Je}=await Ye({fs:e,cache:t,gitdir:l,oid:H}),D=new rr(Je),q=await Promise.all(D.headers().parent.map(Ne=>Qw({fs:e,cache:t,gitdir:l,oid:Ne})));q.length===0||q.every(Ne=>Ne)||Y.add(H)}catch(Je){Y.add(H)}for(let H of Re.unshallows)Y.delete(H);if(await da.write({fs:e,gitdir:l,oids:Y}),x){let H=new Map([[J,fe]]),Je=new Map,D=10,q=J;for(;D--;){let bt=N.symrefs.get(q);if(bt===void 0)break;Je.set(q,bt),q=bt}let ve=ee.get(q);ve&&H.set(q,ve);let{pruned:Ne}=await W.updateRemoteRefs({fs:e,gitdir:l,remote:S,refs:H,symrefs:Je,tags:b,prune:_});_&&(Re.pruned=Ne)}else{let{pruned:H}=await W.updateRemoteRefs({fs:e,gitdir:l,remote:S,refs:ee,symrefs:N.symrefs,tags:b,prune:_,pruneTags:k});_&&(Re.pruned=H)}if(Re.HEAD=N.symrefs.get("HEAD"),Re.HEAD===void 0){let{oid:H}=W.resolveAgainstMap({ref:"HEAD",map:ee});for(let[Je,D]of ee.entries())if(Je!=="HEAD"&&D===H){Re.HEAD=Je;break}}let ct=J.startsWith("refs/tags")?"tag":"branch";if(Re.FETCH_HEAD={oid:fe,description:`${ct} '${ca(J)}' of ${T}`},n||i){let H=_2(Re.progress);bl(H,async Je=>{if(i&&await i(Je),n){let D=Je.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);D&&await n({phase:D[1].trim(),loaded:parseInt(D[2],10),total:parseInt(D[3],10)})}})}let rt=Buffer.from(await cu(Re.packfile));if(gt.body.error)throw gt.body.error;let Et=rt.slice(-20).toString("hex"),Ie={defaultBranch:Re.HEAD,fetchHead:Re.FETCH_HEAD.oid,fetchHeadDescription:Re.FETCH_HEAD.description};if(Re.headers&&(Ie.headers=Re.headers),_&&(Ie.pruned=Re.pruned),Et!==""&&!y6(rt)){Ie.packfile=`objects/pack/pack-${Et}.pack`;let H=$(l,Ie.packfile);await e.write(H,rt);let Je=q=>Ye({fs:e,cache:t,gitdir:l,oid:q}),D=await nl.fromPack({pack:rt,getExternalRefDelta:Je,onProgress:n});await e.write(H.replace(/\.pack$/,".idx"),await D.toBuffer())}return Ie}async function x2({fs:e,bare:t=!1,dir:r,gitdir:n=t?r:$(r,".git"),defaultBranch:i="master"}){if(await e.exists(n+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(s=>n+"/"+s);for(let s of a)await e.mkdir(s);await e.write(n+"/config",`[core]
|
||||||
|
repositoryformatversion = 0
|
||||||
|
filemode = false
|
||||||
|
bare = ${t}
|
||||||
|
`+(t?"":` logallrefupdates = true
|
||||||
|
`)+` symlinks = false
|
||||||
|
ignorecase = true
|
||||||
|
`),await e.write(n+"/HEAD",`ref: refs/heads/${i}
|
||||||
|
`)}async function x6({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:p,depth:m,since:v,exclude:y,relative:b,singleBranch:x,noCheckout:E,noTags:_,headers:k}){try{if(await x2({fs:e,gitdir:u}),await v2({fs:e,gitdir:u,remote:p,url:f,force:!1}),d){let S=await qe.get({fs:e,gitdir:u});await S.set("http.corsProxy",d),await qe.save({fs:e,gitdir:u,config:S})}let{defaultBranch:w,fetchHead:A}=await Cp({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:u,ref:h,remote:p,corsProxy:d,depth:m,since:v,exclude:y,relative:b,singleBranch:x,headers:k,tags:!_});if(A===null)return;h=h||w,h=h.replace("refs/heads/",""),await Tp({fs:e,cache:t,onProgress:n,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:E})}catch(w){throw await e.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),w}}async function S6({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c=$(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:p=void 0,since:m=void 0,exclude:v=[],relative:y=!1,singleBranch:b=!1,noCheckout:x=!1,noTags:E=!1,headers:_={},cache:k={}}){try{return C("fs",e),C("http",t),C("gitdir",c),x||C("dir",l),C("url",u),await x6({fs:new X(e),cache:k,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c,url:u,corsProxy:f,ref:d,remote:h,depth:p,since:m,exclude:v,relative:y,singleBranch:b,noCheckout:x,noTags:E,headers:_})}catch(w){throw w.caller="git.clone",w}}async function E6({fs:e,onSign:t,dir:r,gitdir:n=$(r,".git"),message:i,author:a,committer:s,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:p={}}){try{C("fs",e),l||C("message",i),o&&C("onSign",t);let m=new X(e);return await gu({fs:m,cache:p,onSign:t,gitdir:n,message:i,author:a,committer:s,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(m){throw m.caller="git.commit",m}}async function A6({fs:e,dir:t,gitdir:r=$(t,".git"),fullname:n=!1,test:i=!1}){try{return C("fs",e),C("gitdir",r),await ha({fs:new X(e),gitdir:r,fullname:n,test:i})}catch(a){throw a.caller="git.currentBranch",a}}async function k6({fs:e,gitdir:t,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await W.exists({fs:e,gitdir:t,ref:r}))throw new Le(r);let i=await W.expand({fs:e,gitdir:t,ref:r}),a=await ha({fs:e,gitdir:t,fullname:!0});if(i===a){let l=await W.resolve({fs:e,gitdir:t,ref:i});await W.writeRef({fs:e,gitdir:t,ref:"HEAD",value:l})}await W.deleteRef({fs:e,gitdir:t,ref:i});let s=ca(r),o=await qe.get({fs:e,gitdir:t});await o.deleteSection("branch",s),await qe.save({fs:e,gitdir:t,config:o})}async function T6({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n}){try{return C("fs",e),C("ref",n),await k6({fs:new X(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteBranch",i}}async function C6({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n}){try{C("fs",e),C("ref",n),await W.deleteRef({fs:new X(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteRef",i}}async function P6({fs:e,gitdir:t,remote:r}){let n=await qe.get({fs:e,gitdir:t});await n.deleteSection("remote",r),await qe.save({fs:e,gitdir:t,config:n})}async function R6({fs:e,dir:t,gitdir:r=$(t,".git"),remote:n}){try{return C("fs",e),C("remote",n),await P6({fs:new X(e),gitdir:r,remote:n})}catch(i){throw i.caller="git.deleteRemote",i}}async function M6({fs:e,gitdir:t,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await W.deleteRef({fs:e,gitdir:t,ref:r})}async function O6({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n}){try{return C("fs",e),C("ref",n),await M6({fs:new X(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.deleteTag",i}}async function I6({fs:e,gitdir:t,oid:r}){let n=r.slice(0,2);return(await e.readdir(`${t}/objects/${n}`)).map(a=>`${n}${a}`).filter(a=>a.startsWith(r))}async function F6({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i}){let a=[],s=await e.readdir($(r,"objects/pack"));s=s.filter(o=>o.endsWith(".idx"));for(let o of s){let l=`${r}/objects/pack/${o}`,c=await Ap({fs:e,cache:t,filename:l,getExternalRefDelta:i});if(c.error)throw new le(c.error);for(let u of c.offsets.keys())u.startsWith(n)&&a.push(u)}return a}async function $6({fs:e,cache:t,gitdir:r,oid:n}){let i=o=>Ye({fs:e,cache:t,gitdir:r,oid:o}),a=await I6({fs:e,gitdir:r,oid:n}),s=await F6({fs:e,cache:t,gitdir:r,oid:n,getExternalRefDelta:i});for(let o of s)a.indexOf(o)===-1&&a.push(o);if(a.length===1)return a[0];throw a.length>1?new il("oids",n,a):new Le(`an object matching "${n}"`)}async function L6({fs:e,dir:t,gitdir:r=$(t,".git"),oid:n,cache:i={}}){try{return C("fs",e),C("gitdir",r),C("oid",n),await $6({fs:new X(e),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.expandOid",a}}async function D6({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n}){try{return C("fs",e),C("gitdir",r),C("ref",n),await W.expand({fs:new X(e),gitdir:r,ref:n})}catch(i){throw i.caller="git.expandRef",i}}asyn
Line truncated
|
||||||
|
`,d+=p.conflict.a.join(""),d+=`${"=".repeat(f)}
|
||||||
|
`,d+=p.conflict.b.join(""),d+=`${">".repeat(f)} ${n}
|
||||||
|
`);return{cleanMerge:h,mergedText:d}}async function B6({fs:e,cache:t,dir:r,gitdir:n=$(r,".git"),index:i,ourOid:a,baseOid:s,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let p=bi({ref:a}),m=bi({ref:s}),v=bi({ref:o}),y=[],b=[],x=[],E=[],_=await _s({fs:e,cache:t,dir:r,gitdir:n,trees:[p,m,v],map:async function(k,[w,A,S]){let T=ru(k),P=await ou(w,A),I=await ou(S,A);switch(`${P}-${I}`){case"false-false":return{mode:await A.mode(),path:T,oid:await A.oid(),type:await A.type()};case"false-true":return S?{mode:await S.mode(),path:T,oid:await S.oid(),type:await S.type()}:void 0;case"true-false":return w?{mode:await w.mode(),path:T,oid:await w.oid(),type:await w.type()}:void 0;case"true-true":{if(w&&A&&S&&await w.type()==="blob"&&await A.type()==="blob"&&await S.type()==="blob")return j6({fs:e,gitdir:n,path:T,ours:w,base:A,theirs:S,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async N=>{if(N.cleanMerge)d||i.insert({filepath:k,oid:N.mergeResult.oid,stage:0});else if(y.push(k),b.push(k),!d){let L=await A.oid(),ee=await w.oid(),fe=await S.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:L,stage:1}),i.insert({filepath:k,oid:ee,stage:2}),i.insert({filepath:k,oid:fe,stage:3})}return N.mergeResult});if(A&&!w&&S&&await A.type()==="blob"&&await S.type()==="blob"){if(y.push(k),x.push(k),!d){let N=await A.oid(),L=await S.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:N,stage:1}),i.insert({filepath:k,oid:L,stage:3})}return{mode:await S.mode(),oid:await S.oid(),type:"blob",path:T}}if(A&&w&&!S&&await A.type()==="blob"&&await w.type()==="blob"){if(y.push(k),E.push(k),!d){let N=await A.oid(),L=await w.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:N,stage:1}),i.insert({filepath:k,oid:L,stage:2})}return{mode:await w.mode(),oid:await w.oid(),type:"blob",path:T}}if(A&&!w&&!S&&await A.type()==="blob")return;throw new gs}}},reduce:y.length!==0&&(!r||d)?void 0:async(k,w)=>{let A=w.filter(Boolean);if(k&&!(k&&k.type==="tree"&&A.length===0)){if(A.length>0){let T=new tr(A).toObject(),P=await mr({fs:e,gitdir:n,type:"tree",object:T,dryRun:f});k.oid=P}return k}}});return y.length!==0?(r&&!d&&await _s({fs:e,cache:t,dir:r,gitdir:n,trees:[bi({ref:_.oid})],map:async function(k,[w]){let A=`${r}/${k}`;if(await w.type()==="blob"){let S=await w.mode(),T=new TextDecoder().decode(await w.content());await e.write(A,T,{mode:S})}return!0}}),new vs(y,b,x,E)):_.oid}async function j6({fs:e,gitdir:t,path:r,ours:n,base:i,theirs:a,ourName:s,theirName:o,baseName:l,dryRun:c,mergeDriver:u=N6}){let f="blob",d=await i.mode()===await n.mode()?await a.mode():await n.mode();if(await n.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:d,path:r,oid:await n.oid(),type:f}};if(await n.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:d,path:r,oid:await a.oid(),type:f}};if(await a.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:d,path:r,oid:await n.oid(),type:f}};let h=Buffer.from(await n.content()).toString("utf8"),p=Buffer.from(await i.content()).toString("utf8"),m=Buffer.from(await a.content()).toString("utf8"),{mergedText:v,cleanMerge:y}=await u({branches:[l,s,o],contents:[p,h,m],path:r}),b=await mr({fs:e,gitdir:t,type:"blob",object:Buffer.from(v,"utf8"),dryRun:c});return{cleanMerge:y,mergeResult:{mode:d,path:r,oid:b,type:f}}}async function S2({fs:e,cache:t,dir:r,gitdir:n,ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,onSign:m,mergeDriver:v}){i===void 0&&(i=await ha({fs:e,gitdir:n,fullname:!0})),i=await W.expand({fs:e,gitdir:n,ref:i}),a=await W.expand({fs:e,gitdir:n,ref:a});let y=await W.resolve({fs:e,gitdir:n,ref:i}),b=await W.resolve({fs:e,gitdir:n,ref:a}),x=await Pp({fs:e,cache:t,gitdir:n,oids:[y,b]});if(x.length!==1)throw new gs;let E=x[0];if(E===b)return{oid:y,alreadyMerged:!0};if(s&&E===y)return!l&&!c&&await W.writeRef({fs:e,gitdir:n,ref:i,value:b}),{oid:b,fastForward:!0};{if(o)throw new ll;let _=await yt.acquire({fs:e,gitdir:n,cache:t,allowUnmerged:!1},async w=>B6({fs:e,cache:t,dir:r,gitdir:n,index:w,ourOid:y,theirOid:b,baseOid:E,ourName:ca(i),baseName:"base",theirName:ca(a),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(_ instanceof vs)throw _;return f||(f=`Merge branch '${ca(a)}' into ${ca(i)}`),{oid:await gu({fs:e,cache:t,gitdir:n,message:f,ref:i,tree:_,parent:[y,b],author:d,committer:h,signingKey:p,onSign:m,dryRun:l,noUpdateBranch:c}),tree:_,mergeCommit:!0}}}async function E2({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,dir:l,gitdir:c,ref:u,url:f,remote:d,remoteRef:h,prune:p,pruneTags:m,fastForward:v,fastForwardOnly:y,corsProxy:b,singleBranch:x,headers:E,author:_,committer:k,signingKey:w}){try{if(!u){let T=await ha({fs:e,gitdir:c});if(!T)throw new er("ref");u=T}let{fetchHead:A,fetchHeadDescription:S}=await Cp({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailur
Line truncated
|
||||||
|
`)),n.push(We.encode(`agent=${vu.agent}
|
||||||
|
`)),(r||t||e)&&n.push(We.delim()),r&&n.push(We.encode("peel")),t&&n.push(We.encode("symrefs")),e&&n.push(We.encode(`ref-prefix ${e}`)),n.push(We.flush()),n}async function dI({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:a,headers:s={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{C("http",e),C("url",a);let d=await Es.discover({http:e,onAuth:t,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:l});if(d.protocolVersion===1)return k2(d,c,u,f);let h=await fI({prefix:c,symrefs:u,peelTags:f}),p=await Es.connect({http:e,auth:d.auth,headers:s,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,body:h});return uI(p.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function hI({fs:e,dir:t,gitdir:r=$(t,".git")}){try{return C("fs",e),C("gitdir",r),W.listTags({fs:new X(e),gitdir:r})}catch(n){throw n.caller="git.listTags",n}}function pI(e,t){return e.committer.timestamp-t.committer.timestamp}var mI="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function e2({fs:e,cache:t,gitdir:r,oid:n,fileId:i}){if(i===mI)return;let a=n,s,o=await bs({fs:e,cache:t,gitdir:r,oid:n}),l=o.tree;return i===o.oid?s=o.path:(s=await P2({fs:e,cache:t,gitdir:r,tree:l,fileId:i,oid:a}),Array.isArray(s)&&(s.length===0?s=void 0:s.length===1&&(s=s[0]))),s}async function P2({fs:e,cache:t,gitdir:r,tree:n,fileId:i,oid:a,filepaths:s=[],parentPath:o=""}){let l=n.entries().map(function(c){let u;return c.oid===i?(u=$(o,c.path),s.push(u)):c.type==="tree"&&(u=Ye({fs:e,cache:t,gitdir:r,oid:c.oid}).then(function({object:f}){return P2({fs:e,cache:t,gitdir:r,tree:tr.from(f),fileId:i,oid:a,filepaths:s,parentPath:$(o,c.path)})})),u});return await Promise.all(l),s}async function gI({fs:e,cache:t,gitdir:r,filepath:n,ref:i,depth:a,since:s,force:o,follow:l}){let c=typeof s=="undefined"?void 0:Math.floor(s.valueOf()/1e3),u=[],f=await da.read({fs:e,gitdir:r}),d=await W.resolve({fs:e,gitdir:r,ref:i}),h=[await lu({fs:e,cache:t,gitdir:r,oid:d})],p,m,v;function y(b){v&&n&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(n){let x;try{x=await wl({fs:e,cache:t,gitdir:r,oid:b.commit.tree,filepath:n}),m&&p!==x&&u.push(m),p=x,m=b,v=!0}catch(E){if(E instanceof Le){let _=l&&p;if(_&&(_=await e2({fs:e,cache:t,gitdir:r,oid:b.commit.tree,fileId:p}),_))if(Array.isArray(_)){if(m){let k=await e2({fs:e,cache:t,gitdir:r,oid:m.commit.tree,fileId:p});if(Array.isArray(k))if(_=_.filter(w=>k.indexOf(w)===-1),_.length===1)_=_[0],n=_,m&&u.push(m);else{_=!1,m&&u.push(m);break}}}else n=_,m&&u.push(m);if(!_){if(v&&p&&(u.push(m),!o))break;if(!o&&!l)throw E}m=b,v=!1}else throw E}}else u.push(b);if(a!==void 0&&u.length===a){y(b);break}if(!f.has(b.oid))for(let x of b.commit.parent){let E=await lu({fs:e,cache:t,gitdir:r,oid:x});h.map(_=>_.oid).includes(E.oid)||h.push(E)}h.length===0&&y(b),h.sort((x,E)=>pI(x.commit,E.commit))}return u}async function vI({fs:e,dir:t,gitdir:r=$(t,".git"),filepath:n,ref:i="HEAD",depth:a,since:s,force:o,follow:l,cache:c={}}){try{return C("fs",e),C("gitdir",r),C("ref",i),await gI({fs:new X(e),cache:c,gitdir:r,filepath:n,ref:i,depth:a,since:s,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function yI({fs:e,onSign:t,dir:r,gitdir:n=$(r,".git"),ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,cache:m={},mergeDriver:v}){try{C("fs",e),p&&C("onSign",t);let y=new X(e),b=await fa({fs:y,gitdir:n,author:d});if(!b&&(!o||!s))throw new Vt("author");let x=await Ss({fs:y,gitdir:n,author:b,committer:h});if(!x&&(!o||!s))throw new Vt("committer");return await S2({fs:y,cache:m,dir:r,gitdir:n,ours:i,theirs:a,fastForward:s,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:b,committer:x,signingKey:p,onSign:t,mergeDriver:v})}catch(y){throw y.caller="git.merge",y}}var wI={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function R2({fs:e,cache:t,dir:r,gitdir:n=$(r,".git"),oids:i}){let a=new Ep.default,s=[];function o(u,f){let d=Buffer.from(u,f);s.push(d),a.update(d)}async function l({stype:u,object:f}){let d=wI[u],h=f.length,p=h>15?128:0,m=h&15;h=h>>>4;let v=(p|d|m).toString(16);for(o(v,"hex");p;)p=h>127?128:0,v=p|h&127,o(Sp(2,v),"hex"),h=h>>>7;o(Buffer.from(await d2(f)))}o("PACK"),o("00000002","hex"),o(Sp(8,i.length),"hex");for(let u of i){let{type:f,object:d}=await Ye({fs:e,cache:t,gitdir:n,oid:u});await l({write:o,object:d,stype:f})}let c=a.digest();return s.push(c),s}async function bI({fs:e,cache:t,gitdir:r,oids:n,write:i}){let a=await R2({fs:e,cache:t,gitdir:r,oids:n}),s=Buffer.from(await cu(a)),l=`pack-${s.slice(-20).toString("hex")}.pack`;return i?(await e.write($(r,`objects/pack/${l}`),s),{filename:l}):{filename:l,packfile:new Uint8Array(s)}}async function _I({fs:e,dir:t,gitdir:r=$(t,".git"),oids:n,write:i=!1,cache:a={}}){try{return C("fs",e),C("gitdir",
Line truncated
|
||||||
|
`),i=await n();let a=r.toString("utf8").split(`
|
||||||
|
`);if(i=a.shift(),!i.startsWith("unpack "))throw new ua('unpack ok" or "unpack [error message]',i);t.ok=i==="unpack ok",t.ok||(t.error=i.slice(7)),t.refs={};for(let s of a){if(s.trim()==="")continue;let o=s.slice(0,2),l=s.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);t.refs[u]={ok:o==="ok",error:f}}return t}async function AI({capabilities:e=[],triplets:t=[]}){let r=[],n=`\0 ${e.join(" ")}`;for(let i of t)r.push(We.encode(`${i.oldoid} ${i.oid} ${i.fullRef}${n}
|
||||||
|
`)),n="";return r.push(We.flush()),r}async function kI({fs:e,cache:t,http:r,onProgress:n,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p=!1,delete:m=!1,corsProxy:v,headers:y={}}){let b=u||await ha({fs:e,gitdir:c});if(typeof b=="undefined")throw new er("ref");let x=await qe.get({fs:e,gitdir:c});d=d||await x.get(`branch.${b}.pushRemote`)||await x.get("remote.pushDefault")||await x.get(`branch.${b}.remote`)||"origin";let E=h||await x.get(`remote.${d}.pushurl`)||await x.get(`remote.${d}.url`);if(typeof E=="undefined")throw new er("remote OR url");let _=f||await x.get(`branch.${b}.merge`);if(typeof E=="undefined")throw new er("remoteRef");v===void 0&&(v=await x.get("http.corsProxy"));let k=await W.expand({fs:e,gitdir:c,ref:b}),w=m?"0000000000000000000000000000000000000000":await W.resolve({fs:e,gitdir:c,ref:k}),A=As.getRemoteHelperFor({url:E}),S=await A.discover({http:r,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:v,service:"git-receive-pack",url:E,headers:y,protocolVersion:1}),T=S.auth,P;if(!_)P=k;else try{P=await W.expandAgainstMap({ref:_,map:S.refs})}catch(Y){if(Y instanceof Le)P=_.startsWith("refs/")?_:`refs/heads/${_}`;else throw Y}let I=S.refs.get(P)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:E,localRef:{ref:m?"(delete)":k,oid:w},remoteRef:{ref:P,oid:I}}))throw new ws;let N=!S.capabilities.has("no-thin"),L=new Set;if(!m){let Y=[...S.refs.values()],O=new Set;if(I!=="0000000000000000000000000000000000000000"){let he=await Pp({fs:e,cache:t,gitdir:c,oids:[w,I]});for(let ze of he)Y.push(ze);N&&(O=await fp({fs:e,cache:t,gitdir:c,oids:he}))}if(!Y.includes(w)){let he=await SI({fs:e,cache:t,gitdir:c,start:[w],finish:Y});L=await fp({fs:e,cache:t,gitdir:c,oids:he})}if(N){try{let he=await W.resolve({fs:e,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:ze}=await W.resolveAgainstMap({ref:he.replace(`refs/remotes/${d}/`,""),fullref:he,map:S.refs}),gt=[ze];for(let Re of await fp({fs:e,cache:t,gitdir:c,oids:gt}))O.add(Re)}catch(he){}for(let he of O)L.delete(he)}if(w===I&&(p=!0),!p){if(k.startsWith("refs/tags")&&I!=="0000000000000000000000000000000000000000")throw new ys("tag-exists");if(w!=="0000000000000000000000000000000000000000"&&I!=="0000000000000000000000000000000000000000"&&!await T2({fs:e,cache:t,gitdir:c,oid:w,ancestor:I,depth:-1}))throw new ys("not-fast-forward")}}let ee=b2([...S.capabilities],["report-status","side-band-64k",`agent=${vu.agent}`]),fe=await AI({capabilities:ee,triplets:[{oldoid:I,oid:w,fullRef:P}]}),J=m?[]:await R2({fs:e,cache:t,gitdir:c,oids:[...L]}),Q=await A.connect({http:r,onProgress:n,corsProxy:v,service:"git-receive-pack",url:E,auth:T,headers:y,body:[...fe,...J]}),{packfile:Pe,progress:ge}=await uu.demux(Q.body);if(i){let Y=_2(ge);bl(Y,async O=>{await i(O)})}let z=await EI(Pe);if(Q.headers&&(z.headers=Q.headers),d&&z.ok&&z.refs[P].ok&&!k.startsWith("refs/tags")){let Y=`refs/remotes/${d}/${P.replace("refs/heads","")}`;m?await W.deleteRef({fs:e,gitdir:c,ref:Y}):await W.writeRef({fs:e,gitdir:c,ref:Y,value:w})}if(z.ok&&Object.values(z.refs).every(Y=>Y.ok))return z;{let Y=Object.entries(z.refs).filter(([O,he])=>!he.ok).map(([O,he])=>`
|
||||||
|
- ${O}: ${he.error}`).join("");throw new cl(Y,z)}}async function TI({fs:e,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,dir:l,gitdir:c=$(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:p=!1,delete:m=!1,corsProxy:v,headers:y={},cache:b={}}){try{return C("fs",e),C("http",t),C("gitdir",c),await kI({fs:new X(e),cache:b,http:t,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p,delete:m,corsProxy:v,headers:y})}catch(x){throw x.caller="git.push",x}}async function M2({fs:e,cache:t,gitdir:r,oid:n}){let{type:i,object:a}=await Ye({fs:e,cache:t,gitdir:r,oid:n});if(i==="tag")return n=pr.from(a).parse().object,M2({fs:e,cache:t,gitdir:r,oid:n});if(i!=="blob")throw new zt(n,i,"blob");return{oid:n,blob:new Uint8Array(a)}}async function O2({fs:e,cache:t,gitdir:r,oid:n,filepath:i=void 0}){return i!==void 0&&(n=await wl({fs:e,cache:t,gitdir:r,oid:n,filepath:i})),await M2({fs:e,cache:t,gitdir:r,oid:n})}async function _l({fs:e,dir:t,gitdir:r=$(t,".git"),oid:n,filepath:i,cache:a={}}){try{return C("fs",e),C("gitdir",r),C("oid",n),await O2({fs:new X(e),cache:a,gitdir:r,oid:n,filepath:i})}catch(s){throw s.caller="git.readBlob",s}}async function CI({fs:e,dir:t,gitdir:r=$(t,".git"),oid:n,cache:i={}}){try{return C("fs",e),C("gitdir",r),C("oid",n),await lu({fs:new X(e),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.readCommit",a}}async function PI({fs:e,cache:t,gitdir:r,ref:n="refs/notes/commits",oid:i}){let a=await W.resolve({gitdir:r,fs:e,ref:n}),{blob:s}=await O2({fs:e,cache:t,gitdir:r,oid:a,filepath:i});return s}async function RI({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n="refs/notes/commits",oid:i,cache:a={}}){try{return C("fs",e),C("gitdir",r),C("ref",n),C("oid",i),await PI({fs:new X(e),cache:a,gitdir:r,ref:n,oid:i})}catch(s){throw s.caller="git.readNote",s}}async function MI({fs:e,dir:t,gitdir:r=$(t,".git"),oid:n,format:i="parsed",filepath:a=void 0,encoding:s=void 0,cache:o={}}){try{C("fs",e),C("gitdir",r),C("oid",n);let l=new X(e);a!==void 0&&(n=await wl({fs:l,cache:o,gitdir:r,oid:n,filepath:a}));let u=await Ye({fs:l,cache:o,gitdir:r,oid:n,format:i==="parsed"?"content":i});if(u.oid=n,i==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=rr.from(u.object).parse();break;case"tree":u.object=tr.from(u.object).entries();break;case"blob":s?u.object=u.object.toString(s):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=pr.from(u.object).parse();break;default:throw new zt(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function OI({fs:e,cache:t,gitdir:r,oid:n}){let{type:i,object:a}=await Ye({fs:e,cache:t,gitdir:r,oid:n,format:"content"});if(i!=="tag")throw new zt(n,i,"tag");let s=pr.from(a);return{oid:n,tag:s.parse(),payload:s.payload()}}async function II({fs:e,dir:t,gitdir:r=$(t,".git"),oid:n,cache:i={}}){try{return C("fs",e),C("gitdir",r),C("oid",n),await OI({fs:new X(e),cache:i,gitdir:r,oid:n})}catch(a){throw a.caller="git.readTag",a}}async function FI({fs:e,dir:t,gitdir:r=$(t,".git"),oid:n,filepath:i=void 0,cache:a={}}){try{return C("fs",e),C("gitdir",r),C("oid",n),await ks({fs:new X(e),cache:a,gitdir:r,oid:n,filepath:i})}catch(s){throw s.caller="git.readTree",s}}async function $I({fs:e,dir:t,gitdir:r=$(t,".git"),filepath:n,cache:i={}}){try{C("fs",e),C("gitdir",r),C("filepath",n),await yt.acquire({fs:new X(e),gitdir:r,cache:i},async function(a){a.delete({filepath:n})})}catch(a){throw a.caller="git.remove",a}}async function LI({fs:e,cache:t,onSign:r,gitdir:n,ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l}){let c;try{c=await W.resolve({gitdir:n,fs:e,ref:i})}catch(p){if(!(p instanceof Le))throw p}let f=(await ks({fs:e,gitdir:n,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==a);let d=await kp({fs:e,gitdir:n,tree:f});return await gu({fs:e,cache:t,onSign:r,gitdir:n,ref:i,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
||||||
|
`,author:s,committer:o,signingKey:l})}async function DI({fs:e,onSign:t,dir:r,gitdir:n=$(r,".git"),ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l,cache:c={}}){try{C("fs",e),C("gitdir",n),C("oid",a);let u=new X(e),f=await fa({fs:u,gitdir:n,author:s});if(!f)throw new Vt("author");let d=await Ss({fs:u,gitdir:n,author:f,committer:o});if(!d)throw new Vt("committer");return await LI({fs:u,cache:c,onSign:t,gitdir:n,ref:i,oid:a,author:f,committer:d,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function NI({fs:e,gitdir:t,oldref:r,ref:n,checkout:i=!1}){if(n!==Qr.default.clean(n))throw new Wn(n,Qr.default.clean(n));if(r!==Qr.default.clean(r))throw new Wn(r,Qr.default.clean(r));let a=`refs/heads/${r}`,s=`refs/heads/${n}`;if(await W.exists({fs:e,gitdir:t,ref:s}))throw new en("branch",n,!1);let l=await W.resolve({fs:e,gitdir:t,ref:a,depth:1});await W.writeRef({fs:e,gitdir:t,ref:s,value:l}),await W.deleteRef({fs:e,gitdir:t,ref:a});let u=await ha({fs:e,gitdir:t,fullname:!0})===a;(i||u)&&await W.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:s})}async function BI({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n,oldref:i,checkout:a=!1}){try{return C("fs",e),C("gitdir",r),C("ref",n),C("oldref",i),await NI({fs:new X(e),gitdir:r,ref:n,oldref:i,checkout:a})}catch(s){throw s.caller="git.renameBranch",s}}async function I2({gitdir:e,type:t,object:r}){return Vn(xi.wrap({type:t,object:r}))}async function jI({fs:e,dir:t,gitdir:r=$(t,".git"),filepath:n,ref:i,cache:a={}}){try{C("fs",e),C("gitdir",r),C("filepath",n);let s=new X(e),o,l;try{o=await W.resolve({fs:s,gitdir:r,ref:i||"HEAD"})}catch(f){if(i)throw f}if(o)try{o=await wl({fs:s,cache:a,gitdir:r,oid:o,filepath:n})}catch(f){o=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=t&&await s.read($(t,n));u&&(l=await I2({gitdir:r,type:"blob",object:u}),o===l&&(c=await s.lstat($(t,n)))),await yt.acquire({fs:s,gitdir:r,cache:a},async function(f){f.delete({filepath:n}),o&&f.insert({filepath:n,stats:c,oid:o})})}catch(s){throw s.caller="git.reset",s}}async function HI({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n,depth:i}){try{return C("fs",e),C("gitdir",r),C("ref",n),await W.resolve({fs:new X(e),gitdir:r,ref:n,depth:i})}catch(a){throw a.caller="git.resolveRef",a}}async function UI({fs:e,dir:t,gitdir:r=$(t,".git"),path:n,value:i,append:a=!1}){try{C("fs",e),C("gitdir",r),C("path",n);let s=new X(e),o=await qe.get({fs:s,gitdir:r});a?await o.append(n,i):await o.set(n,i),await qe.save({fs:s,gitdir:r,config:o})}catch(s){throw s.caller="git.setConfig",s}}async function GI({fs:e,dir:t,gitdir:r=$(t,".git"),filepath:n,cache:i={}}){try{C("fs",e),C("gitdir",r),C("filepath",n);let a=new X(e);if(await xs.isIgnored({fs:a,gitdir:r,dir:t,filepath:n}))return"ignored";let o=await zI({fs:a,cache:i,gitdir:r}),l=await F2({fs:a,cache:i,gitdir:r,tree:o,path:n}),c=await yt.acquire({fs:a,gitdir:r,cache:i},async function(m){for(let v of m)if(v.path===n)return v;return null}),u=await a.lstat($(t,n)),f=l!==null,d=c!==null,h=u!==null,p=async()=>{if(d&&!tu(c,u))return c.oid;{let m=await a.read($(t,n)),v=await I2({gitdir:r,type:"blob",object:m});return d&&c.oid===v&&u.size!==-1&&yt.acquire({fs:a,gitdir:r,cache:i},async function(y){y.insert({filepath:n,stats:u,oid:v})}),v}};if(!f&&!h&&!d)return"absent";if(!f&&!h&&d)return"*absent";if(!f&&h&&!d)return"*added";if(!f&&h&&d)return await p()===c.oid?"added":"*added";if(f&&!h&&!d)return"deleted";if(f&&!h&&d)return l===c.oid,"*deleted";if(f&&h&&!d)return await p()===l?"*undeleted":"*undeletemodified";if(f&&h&&d){let m=await p();return m===l?m===c.oid?"unmodified":"*unmodified":m===c.oid?"modified":"*modified"}}catch(a){throw a.caller="git.status",a}}async function F2({fs:e,cache:t,gitdir:r,tree:n,path:i}){typeof i=="string"&&(i=i.split("/"));let a=i.shift();for(let s of n)if(s.path===a){if(i.length===0)return s.oid;let{type:o,object:l}=await Ye({fs:e,cache:t,gitdir:r,oid:s.oid});if(o==="tree"){let c=tr.from(l);return F2({fs:e,cache:t,gitdir:r,tree:c,path:i})}if(o==="blob")throw new zt(s.oid,o,"blob",i.join("/"))}return null}async function zI({fs:e,cache:t,gitdir:r}){let n;try{n=await W.resolve({fs:e,gitdir:r,ref:"HEAD"})}catch(a){if(a instanceof Le)return[]}let{tree:i}=await ks({fs:e,cache:t,gitdir:r,oid:n});return i}async function VI({fs:e,dir:t,gitdir:r=$(t,".git"),ref:n="HEAD",filepaths:i=["."],filter:a,cache:s={},ignored:o=!1}){try{C("fs",e),C("gitdir",r),C("ref",n);let l=new X(e);return await _s({fs:l,cache:s,dir:t,gitdir:r,trees:[bi({ref:n}),mu(),pu()],map:async function(c,[u,f,d]){if(!u&&!d&&f&&!o&&await xs.isIgnored({fs:l,dir:t,filepath:c})||!i.some(k=>y2(c,k)))return null;if(a&&!a(c))return;let[h,p,m]=await Promise.all([u&&u.type(),f&&f.type(),d&&d.type()]),v=[h,p,m].includes("blob");if((h==="tree"||h==="special")&&!v)return;if(h==="commit")return null;if((p==="tree"||p==="special")&&!v)return;if(m==="commit")return null;if((m==="tree"||m==="special")&&!v)return;let y=h==="blob"?await u.oid():void 0,b=m==="blob"?a
Line truncated
|
||||||
|
`){return e.split(r).reduce((n,i)=>{let a=t?i.trim():i;return a&&n.push(a),n},[])}function Jp(e,t){return Rl(e,!0).map(r=>t(r))}function Qp(e){return(0,Fu.exists)(e,Fu.FOLDER)}function Ce(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Cb(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function $u(e,t){if(Array.isArray(e)){let r=e.indexOf(t);r>=0&&e.splice(r,1)}else e.delete(t);return t}function Sn(e){return Array.isArray(e)?e:[e]}function Pb(e){return e.replace(/[\s-]+(.)/g,(t,r)=>r.toUpperCase())}function Rb(e){return Sn(e).map(String)}function Fe(e,t=0){if(e==null)return t;let r=parseInt(e,10);return isNaN(r)?t:r}function Al(e,t){let r=[];for(let n=0,i=e.length;n<i;n++)r.push(t,e[n]);return r}function kl(e){return(Array.isArray(e)?Buffer.concat(e):e).toString("utf-8")}function Mb(e,t){return Object.assign({},...t.map(r=>r in e?{[r]:e[r]}:{}))}function Np(e=0){return new Promise(t=>setTimeout(t,e))}function Bp(e){if(e!==!1)return e}var Os,ya,Ml,Lu=V({"src/lib/utils/util.ts"(){"use strict";Os="\0",ya=()=>{},Ml=Object.prototype.toString.call.bind(Object.prototype.toString)}});function En(e,t,r){return t(e)?e:arguments.length>2?r:void 0}function em(e,t){let r=Cu(e)?"string":typeof e;return/number|string|boolean/.test(r)&&(!t||!t.includes(r))}function tm(e){return!!e&&Ml(e)==="[object Object]"}function Ob(e){return typeof e=="function"}var Ol,Mt,Ib,Pu,rm,Fb=V({"src/lib/utils/argument-filters.ts"(){"use strict";Lu(),Cl(),Ol=e=>Array.isArray(e),Mt=e=>typeof e=="string",Ib=e=>Array.isArray(e)&&e.every(Mt),Pu=e=>Mt(e)||Array.isArray(e)&&e.every(Mt),rm=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),jp,R8=V({"src/lib/utils/exit-codes.ts"(){"use strict";jp=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(jp||{})}}),Tl,M8=V({"src/lib/utils/git-output-streams.ts"(){"use strict";Tl=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new Tl(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),ce,Ei,O8=V({"src/lib/utils/line-parser.ts"(){"use strict";ce=class{constructor(e,t){this.matches=[],this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((i,a)=>this.addMatch(i,a,r(a)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,r){let n=r&&e.exec(r);return n&&this.pushMatch(t,n),!!n}pushMatch(e,t){this.matches.push(...t.slice(1))}},Ei=class extends ce{addMatch(e,t,r){return/^remote:\s/.test(String(r))&&super.addMatch(e,t,r)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function $b(...e){let t=process.cwd(),r=Object.assign($r({baseDir:t},Lb),...e.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||t,r.trimmed=r.trimmed===!0,r}var Lb,I8=V({"src/lib/utils/simple-git-options.ts"(){"use strict";Lb={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function nm(e,t=[]){return tm(e)?Object.keys(e).reduce((r,n)=>{let i=e[n];return Cu(i)?r.push(i):em(i,["boolean"])?r.push(n+"="+i):r.push(n),r},t):t}function nr(e,t=0,r=!1){let n=[];for(let i=0,a=t<0?e.length:t;i<a;i++)"string|number".includes(typeof e[i])&&n.push(String(e[i]));return nm(im(e),n),r||n.push(...F8(e)),n}function F8(e){let t=typeof va(e)=="function";return En(va(e,t?1:0),Ol,[])}function im(e){let t=Ob(va(e));return En(va(e,t?1:0),tm)}function et(e,t=!0){let r=Sb(va(e));return t||Eb(r)?r:void 0}var $8=V({"src/lib/utils/task-options.ts"(){"use strict";Fb(),Lu(),Cl()}});function Hp(e,t){return e(t.stdOut,t.stdErr)}function ar(e,t,r,n=!0){return Sn(r).forEach(i=>{for(let a=Rl(i,n),s=0,o=a.length;s<o;s++){let l=(c=0)=>{if(!(s+c>=o))return a[s+c]};t.some(({parse:c})=>c(l,e))}}),e}var L8=V({"src/lib/utils/task-parser.ts"(){"use strict";Lu()}}),Db={};at(Db,{ExitCodes:()=>jp,GitOutputStreams:()=>Tl,LineParser:()=>ce,NOOP:()=>ya,NULL:()=>Os,RemoteLineParser:()=>Ei,append:()=>Ce,appendTaskOptions:()=>nm,asArray:()=>Sn,asCamelCase:()=>Pb,asFunction:()=>Sb,asNumber:()=>Fe,asStringArray:()=>Rb,bufferToString:()=>kl,callTaskParser:()=>Hp,createInstanceConfig:()=>$b,delay:()=>Np,filterArray:()=>Ol,filterFunction:()=>Ob,filterHasLength:()=>rm,filterPlainObject:()=>tm,filterPrimitives:()=>em,filterString:()=>Mt,filterStringArray:()=>Ib,filterStringOrStringArray:()=>Pu,filterType:()=>En,first:()=>kb,folderExists:()=>Qp,forEachLineWithContent:()=>Jp,getTrailingOptions:()=>nr,including:()=>Cb,isUserFunction:()=>Eb,last:()=>va,objectToString:()=>Ml,orVoid:()=>Bp,parseStringResponse:()=>ar,pick:()=>Mb,prefixedArray:()=>Al,remove:()=>$u,splitOn:()=>Ab,toLinesWithContent:()=>Rl,trailingFunctionArgument:()=>et,trailingOptionsArgument:()=>im});var oe=V({"src/lib/utils/index.ts"(){"use strict";Fb(),R8(),M8(),O8(),I8(),$8(),L8(),Lu()}}),Nb=
Line truncated
|
||||||
|
`)){let l=Ab(s,`
|
||||||
|
`);o=l[0],s=l[1]}yield{file:a,key:o,value:s}}}var e_,Z8=V({"src/lib/responses/ConfigList.ts"(){"use strict";oe(),e_=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((e,t)=>Object.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=va(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,r){let n=this.addFile(e);n.hasOwnProperty(t)?Array.isArray(n[t])?n[t].push(r):n[t]=[n[t],r]:n[t]=r,this._all=void 0}}}});function Op(e,t){return typeof e=="string"&&zp.hasOwnProperty(e)?e:t}function K8(e,t,r,n){let i=["config",`--${n}`];return r&&i.push("--add"),i.push(e,t),{commands:i,format:"utf-8",parser(a){return a}}}function J8(e,t){let r=["config","--null","--show-origin","--get-all",e];return t&&r.splice(1,0,`--${t}`),{commands:r,format:"utf-8",parser(n){return Y8(n,e)}}}function Q8(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(r){return q8(r)}}}function eF(){return{addConfig(e,t,...r){return this._runTask(K8(e,t,r[0]===!0,Op(r[1],"local")),et(arguments))},getConfig(e,t){return this._runTask(J8(e,Op(t,void 0)),et(arguments))},listConfig(...e){return this._runTask(Q8(Op(e[0],void 0)),et(arguments))}}}var zp,t_=V({"src/lib/tasks/config.ts"(){"use strict";Z8(),oe(),zp=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(zp||{})}});function tF(e){return r_.has(e)}var Ip,r_,n_=V({"src/lib/tasks/diff-name-status.ts"(){"use strict";Ip=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(Ip||{}),r_=new Set(Object.values(Ip))}});function rF(...e){return new a_().param(...e)}function nF(e){let t=new Set,r={};return Jp(e,n=>{let[i,a,s]=n.split(Os);t.add(i),(r[i]=r[i]||[]).push({line:Fe(a),path:i,preview:s})}),{paths:t,results:r}}function iF(){return{grep(e){let t=et(arguments),r=nr(arguments);for(let i of i_)if(r.includes(i))return this._runTask(ir(`git.grep: use of "${i}" is not supported.`),t);typeof e=="string"&&(e=rF().param(e));let n=["grep","--null","-n","--full-name",...r,...e];return this._runTask({commands:n,format:"utf-8",parser(i){return nF(i)}},t)}}}var i_,xl,z2,a_,s_=V({"src/lib/tasks/grep.ts"(){"use strict";oe(),it(),i_=["-h"],xl=Symbol("grepQuery"),a_=class{constructor(){this[z2]=[]}*[(z2=xl,Symbol.iterator)](){for(let e of this[xl])yield e}and(...e){return e.length&&this[xl].push("--and","(",...Al(e,"-e"),")"),this}param(...e){return this[xl].push(...Al(e,"-e")),this}}}}),o_={};at(o_,{ResetMode:()=>Au,getResetMode:()=>sF,resetTask:()=>aF});function aF(e,t){let r=["reset"];return l_(e)&&r.push(`--${e}`),r.push(...t),Wt(r)}function sF(e){if(l_(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function l_(e){return c_.includes(e)}var Au,c_,u_=V({"src/lib/tasks/reset.ts"(){"use strict";it(),Au=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(Au||{}),c_=Array.from(Object.values(Au))}});function oF(){return(0,Ru.default)("simple-git")}function V2(e,t,r){return!t||!String(t).replace(/\s*/,"")?r?(n,...i)=>{e(n,...i),r(n,...i)}:e:(n,...i)=>{e(`%s ${n}`,t,...i),r&&r(n,...i)}}function lF(e,t,{namespace:r}){if(typeof e=="string")return e;let n=t&&t.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function um(e,t,r,n=oF()){let i=e&&`[${e}]`||"",a=[],s=typeof t=="string"?n.extend(t):t,o=lF(En(t,Mt),s,n);return c(r);function l(u,f){return Ce(a,um(e,o.replace(/^[^:]+/,u),f,n))}function c(u){let f=u&&`[${u}]`||"",d=s&&V2(s,f)||ya,h=V2(n,`${i} ${f}`,d);return Object.assign(s?d:h,{label:e,sibling:l,info:h,step:c})}}var f_=V({"src/lib/git-logger.ts"(){"use strict";oe(),Ru.default.formatters.L=e=>String(rm(e)?e.length:"-"),Ru.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):Ml(e)}}),xu,Vp,cF=V({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";Ai(),f_(),xu=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=xu.getName(e.commands[0]),r=um(this.logLabel,t);return{task:e,logger:r,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:r}]of Array.from(this._queue.entries()))t===e.task?(r.info("Failed %o",e),r("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):r.info("A fatal exception occurred in a previous task, the queue has been purged: %o",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new wr(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"
Line truncated
|
||||||
|
`).map(i$).filter(Boolean);t||r.sort(function(i,a){let s=i.split("."),o=a.split(".");if(s.length===1||o.length===1)return n$(Su(s[0]),Su(o[0]));for(let l=0,c=Math.max(s.length,o.length);l<c;l++){let u=yx(Su(s[l]),Su(o[l]));if(u)return u}return 0});let n=t?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new mb(r,n)}}}),bx={};at(bx,{addAnnotatedTagTask:()=>l$,addTagTask:()=>o$,tagListTask:()=>s$});function s$(e=[]){let t=e.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...e],parser(r){return wx(r,t)}}}function o$(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function l$(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var c$=V({"src/lib/tasks/tag.ts"(){"use strict";a$()}}),u$=T8({"src/git.js"(e,t){"use strict";var{GitExecutor:r}=(dF(),Qe(h_)),{SimpleGitApi:n}=(u4(),Qe(q_)),{Scheduler:i}=(f4(),Qe(Y_)),{configurationErrorTask:a}=(it(),Qe(Gp)),{asArray:s,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:d,trailingFunctionArgument:h,trailingOptionsArgument:p}=(oe(),Qe(Db)),{applyPatchTask:m}=(h4(),Qe(K_)),{branchTask:v,branchLocalTask:y,deleteBranchesTask:b,deleteBranchTask:x}=(E4(),Qe(nx)),{checkIgnoreTask:E}=(T4(),Qe(sx)),{checkIsRepoTask:_}=(Hb(),Qe(Nb)),{cloneTask:k,cloneMirrorTask:w}=(R4(),Qe(ox)),{cleanWithOptionsTask:A,isCleanOptionsArray:S}=(Jb(),Qe(Zb)),{diffSummaryTask:T}=(vm(),Qe(k_)),{fetchTask:P}=($4(),Qe(ux)),{moveTask:I}=(B4(),Qe(dx)),{pullTask:N}=(H4(),Qe(hx)),{pushTagsTask:L}=(H_(),Qe(j_)),{addRemoteTask:ee,getRemotesTask:fe,listRemotesTask:J,remoteTask:Q,removeRemoteTask:Pe}=(Z4(),Qe(mx)),{getResetMode:ge,resetTask:z}=(u_(),Qe(o_)),{stashListTask:Y}=(J4(),Qe(gx)),{addSubModuleTask:O,initSubModuleTask:he,subModuleTask:ze,updateSubModuleTask:gt}=(r$(),Qe(vx)),{addAnnotatedTagTask:Re,addTagTask:ct,tagListTask:rt}=(c$(),Qe(bx)),{straightThroughBufferTask:Et,straightThroughStringTask:Ie}=(it(),Qe(Gp));function H(D,q){this._plugins=q,this._executor=new r(D.baseDir,new i(D.maxConcurrentProcesses),q),this._trimmed=D.trimmed}(H.prototype=Object.create(n.prototype)).constructor=H,H.prototype.customBinary=function(D){return this._plugins.reconfigure("binary",D),this},H.prototype.env=function(D,q){return arguments.length===1&&typeof D=="object"?this._executor.env=D:(this._executor.env=this._executor.env||{})[D]=q,this},H.prototype.stashList=function(D){return this._runTask(Y(p(arguments)||{},o(D)&&D||[]),h(arguments))};function Je(D,q,ve,Ne){return typeof ve!="string"?a(`git.${D}() requires a string 'repoPath'`):q(ve,f(Ne,c),d(arguments))}H.prototype.clone=function(){return this._runTask(Je("clone",k,...arguments),h(arguments))},H.prototype.mirror=function(){return this._runTask(Je("mirror",w,...arguments),h(arguments))},H.prototype.mv=function(D,q){return this._runTask(I(D,q),h(arguments))},H.prototype.checkoutLatestTag=function(D){var q=this;return this.pull(function(){q.tags(function(ve,Ne){q.checkout(Ne.latest,D)})})},H.prototype.pull=function(D,q,ve,Ne){return this._runTask(N(f(D,c),f(q,c),d(arguments)),h(arguments))},H.prototype.fetch=function(D,q){return this._runTask(P(f(D,c),f(q,c),d(arguments)),h(arguments))},H.prototype.silent=function(D){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},H.prototype.tags=function(D,q){return this._runTask(rt(d(arguments)),h(arguments))},H.prototype.rebase=function(){return this._runTask(Ie(["rebase",...d(arguments)]),h(arguments))},H.prototype.reset=function(D){return this._runTask(z(ge(D),d(arguments)),h(arguments))},H.prototype.revert=function(D){let q=h(arguments);return typeof D!="string"?this._runTask(a("Commit must be a string"),q):this._runTask(Ie(["revert",...d(arguments,0,!0),D]),q)},H.prototype.addTag=function(D){let q=typeof D=="string"?ct(D):a("Git.addTag requires a tag name");return this._runTask(q,h(arguments))},H.prototype.addAnnotatedTag=function(D,q){return this._runTask(Re(D,q),h(arguments))},H.prototype.deleteLocalBranch=function(D,q,ve){return this._runTask(x(D,typeof q=="boolean"?q:!1),h(arguments))},H.prototype.deleteLocalBranches=function(D,q,ve){return this._runTask(b(D,typeof q=="boolean"?q:!1),h(arguments))},H.prototype.branch=function(D,q){return this._runTask(v(d(arguments)),h(arguments))},H.prototype.branchLocal=function(D){return this._runTask(y(),h(arguments))},H.prototype.raw=function(D){let q=!Array.isArray(D),ve=[].slice.call(q?arguments:D,0);for(let bt=0;bt<ve.length&&q;bt++)if(!l(ve[bt])){ve.splice(bt,ve.length-bt);break}ve.push(...d(arguments,0,!0));var Ne=h(arguments);return ve.length?this._runTask(Ie(ve,this._trimmed),Ne):this._runTask(a("Raw: must supply one or more command to execute"),Ne)},H.prototype.submoduleAdd=function(D,q,ve){return this._runTask(O(D,q),h(arguments))},H.prototype.submoduleUpdate=function(D,q){return this._runTas
Line truncated
|
||||||
|
|
||||||
|
PROMPT="$1"
|
||||||
|
TEMP_FILE="$OBSIDIAN_GIT_CREDENTIALS_INPUT"
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
rm -f "$TEMP_FILE" "$TEMP_FILE.response"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
echo "$PROMPT" > "$TEMP_FILE"
|
||||||
|
|
||||||
|
while [ ! -e "$TEMP_FILE.response" ]; do
|
||||||
|
if [ ! -e "$TEMP_FILE" ]; then
|
||||||
|
echo "Trigger file got removed: Abort" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
sleep 0.1
|
||||||
|
done
|
||||||
|
|
||||||
|
RESPONSE=$(cat "$TEMP_FILE.response")
|
||||||
|
|
||||||
|
echo "$RESPONSE"
|
||||||
|
`,Ax=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];g();var kx=require("obsidian"),I$={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},$e=class extends kx.SuggestModal{constructor(t,r){if(super(t.app),this.config={...I$,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let n=this.containerEl.querySelector(".prompt-input-container");n.addClass("git-obscure-prompt"),n.setAttr("git-is-obscured","true");let i=n==null?void 0:n.createDiv({cls:"search-input-clear-button"});i.style.marginRight="32px",i.id="git-show-password",i.addEventListener("click",()=>{n.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",n.setAttr("git-is-obscured","false")):(this.inputEl.type="password",n.setAttr("git-is-obscured","true"))})}}openAndGetResult(){return new Promise(t=>{this.resolve=t,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(t=>setTimeout(t,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(t){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[t.length>0?t:" ",...this.config.options]:[t.length>0?t:"...",...this.config.options]}renderSuggestion(t,r){this.config.obscure?r.hide():r.setText(t)}onChooseSuggestion(t,r){if(this.resolve){let n;this.config.allowEmpty&&t===" "?n="":t==="..."?n=void 0:n=t,this.resolve(n)}}};g();function Tx(e,t){let r=Object.assign({},e.lineAuthor,t.lineAuthor);return Object.assign({},e,t,{lineAuthor:r})}var $s=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};g();var cT=Ve(Vx()),uT=require("child_process"),fT=Ve(lT()),Kn=require("obsidian");var Gg=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);function nn(e,t){let r;if(t){if(t.button===0||t.button===1){let n=Kn.Keymap.isModEvent(t);r=e.workspace.getLeaf(n)}}else r=e.workspace.getLeaf(!1);return r}function Tn(e,t,r,n,i){if(t.button==2){let a=e.vault.getAbstractFileByPath(r);if(a!=null){let s=new Kn.Menu;e.workspace.trigger("file-menu",s,a,i,n),s.showAtPosition({x:t.pageX,y:t.pageY})}else{let s=new Kn.Menu;e.workspace.trigger("obsidian-git:menu",s,r,i,n),s.showAtPosition({x:t.pageX,y:t.pageY})}}}function Ii(e){throw new Error("Impossible branch: "+e)}function zg(e){return`rgb(${e.r},${e.g},${e.b})`}function dT(e){var a;let t=(a=cT.fromString(e))==null?void 0:a.toRgbaArray();if(t===void 0)return;let[r,n,i]=t;return{r,g:n,b:i}}function hT(e){return e.diff(Kn.moment.unix(0),"seconds")}function pT(e){if(e.length!==0)return e.slice().sort()[Math.floor(e.length/2)]}function mT(e,t){return(0,fT.default)(e,t,{strict:!0})}function Wl(e,t){return new Proxy(e,{get(r,n){return n==="length"?Math.min(t,r.length):r[n]}})}function gT(e,t,r){return e.length<=t?new Array(t-e.length).fill(r).join("")+e:e.substring(e.length-t)}function vT(e,t){if(t<=0)return e;let r=new Array(t).fill(" ").join(""),n=e.substring(t,e.length);return r+n}function Vg(e,t,r){return e<=t&&t<=r}function Fi(e){let[t,...r]=e.split("/");return[t,r.length===0?void 0:r.join("/")]}function Cn(e){return e.endsWith("/")?e:e.split("/").last().replace(/\.md$/,"")}function yT(e){return e===1?"1 minute":`${e} minutes`}function $B(e){let t=e.lastIndexOf(".");retu
Line truncated
|
||||||
|
`):i="Too many files to list",t=t+`
|
||||||
|
|
||||||
|
Affected files:
|
||||||
|
`+i}return t}};var Ee=class extends Ys{constructor(r){super(r);this.useDefaultWindowsGitPath=!1}async setGitInstance(r=!1){var n;if(await this.isGitInstalled()){let i=this.app.vault.adapter,a=i.getBasePath(),s=a;this.plugin.settings.basePath&&(await i.exists((0,Jn.normalizePath)(this.plugin.settings.basePath))?s=De.join(a,this.plugin.settings.basePath):r||new Jn.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=s,this.git=xx({baseDir:s,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?zu:void 0),config:["core.quotepath=off"],unsafe:{allowUnsafeCustomBinary:!0}});let o=this.plugin.localStorage.getPATHPaths(),l=this.plugin.localStorage.getEnvVars(),c=this.plugin.settings.gitDir;if(o.length>0){let v=process.env.PATH+":"+o.join(":");process.env.PATH=v}c&&(process.env.GIT_DIR=c);for(let v of l){let[y,b]=v.split("=");process.env[y]=b}let u="simple-git",f=",",h=((n=localStorage.debug)!=null?n:"").split(f);if(!h.includes(u)&&!h.includes(`-${u}`)&&(h.push(u),ST.default.enable(h.join(f))),await this.git.checkIsRepo()){let v=await this.git.revparse("--show-cdup"),y=(0,Yl.resolve)(s+Yl.sep+v);this.absoluteRepoPath=y,await this.git.cwd(y)}let p=De.join(a,this.app.vault.configDir,"plugins","obsidian-git"),m=De.join(p,wa);process.env.SSH_ASKPASS==null&&(process.env.SSH_ASKPASS=m),process.env.OBSIDIAN_GIT_CREDENTIALS_INPUT=De.join(p,Vu),process.env.SSH_ASKPASS==m&&this.askpass().catch(v=>this.plugin.displayError(v))}}getRelativeVaultPath(r){let i=this.app.vault.adapter.getBasePath(),a=De.join(this.absoluteRepoPath,r),s=De.relative(i,a);return Jn.Platform.isWin&&(s=s.replace(/\\/g,"/")),s}getRelativeRepoPath(r,n=!0){if(n){let a=this.plugin.app.vault.adapter.getBasePath(),s=this.absoluteRepoPath,o=De.join(a,r),l=De.relative(s,o);return Jn.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return r}async askpass(){let r=this.app.vault.adapter,n=r.getBasePath(),i=De.join(n,this.app.vault.configDir,"plugins","obsidian-git"),a=this.app.vault.configDir+"/plugins/obsidian-git/";await this.addAskPassScriptToExclude(),await _r.writeFile(De.join(i,wa),Ex),await _r.chmod(De.join(i,wa),493),this.watchAbortController=new AbortController;let{signal:s}=this.watchAbortController;try{let o=_r.watch(i,{signal:s});for await(let l of o){if(l.filename!=Vu)continue;let c=a+Vu;if(!await r.exists(c))continue;let u=await r.read(c),f;u.length>60&&(f=new Jn.Notice(u,999999));let d=await new $e(this.plugin,{allowEmpty:!0,obscure:!0,placeholder:u.length>60?"Enter a response to the message.":u}).openAndGetResult();f==null||f.hide(),await r.exists(c)&&await r.write(`${c}.response`,d!=null?d:"")}}catch(o){this.plugin.displayError(o),await _r.rm(De.join(i,wa),{force:!0}),await _r.rm(De.join(i,`${wa}.response`),{force:!0}),await new Promise(l=>setTimeout(l,5e3)),this.plugin.log("Retry watch for ask pass"),await this.askpass()}}async addAskPassScriptToExclude(){try{let r=await this.git.revparse(["--path-format=absolute","--git-path","info/exclude"]),n=De.join(this.app.vault.configDir,"plugins","obsidian-git",wa),i=this.getRelativeRepoPath(n,!0);(await _r.readFile(r,"utf-8")).split(`
|
||||||
|
`).some(l=>l.contains(i))||await _r.appendFile(r,i+`
|
||||||
|
`)}catch(r){console.error("Error while adding askpass script to exclude file:",r)}}unload(){var r;(r=this.watchAbortController)==null||r.abort()}async status(){this.plugin.setPluginState({gitAction:1});let r=await this.git.status();this.plugin.setPluginState({gitAction:0});let n=r.files.map(i=>{let a=this.formatPath(i);return{path:a.path,from:a.from,index:i.index==="?"?"U":i.index,workingDir:i.working_dir==="?"?"U":i.working_dir,vaultPath:this.getRelativeVaultPath(a.path)}});return{all:n,changed:n.filter(i=>i.workingDir!==" "),staged:n.filter(i=>i.index!==" "&&i.index!="U"),conflicted:r.conflicted.map(i=>this.formatPath({path:i}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let n=this.getRelativeRepoPath(r),a=["-C",De.dirname(n),"rev-parse","HEAD"],s=this.git.raw(a);return s.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),s}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((n,i,a,s)=>{if(!(s.contains("submodule")&&s.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");i.on("data",c=>{o+=c.toString("utf8")}),i.on("end",()=>{let u=o.split(`
|
||||||
|
`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Yl.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},n=>this.plugin.displayError(n))})}formatPath(r,n=!1){function i(a){if(a!=null)return a.startsWith('"')&&a.endsWith('"')?a.substring(1,a.length-1):a}return n?{from:i(r.from),path:i(r.path)}:{path:i(r.path)}}async blame(r,n,i){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let a=await this.getSubmoduleOfFile(r),s=a?["-C",a.submodule]:[],o=a?a.relativeFilepath:r;s.push("blame","--porcelain"),i&&s.push("-w");let l=`-C${Gu}`;switch(n){case"inactive":break;case"same-commit":s.push("-C",l);break;case"all-commits":s.push("-C","-C",l);break;default:Ii(n)}s.push("--",o);let c=await this.git.raw(s);return LB(c)}async isTracked(r){let n=await this.getSubmoduleOfFile(r),i=n?["-C",n.submodule]:[],a=n?n.relativeFilepath:r;return i.push("ls-files","--",a),this.git.raw(i).then(s=>s.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let i=await this.getSubmodulePaths();for(let a of i)await this.git.cwd({path:a,root:!1}).add("-A"),await this.git.cwd({path:a,root:!1}).commit(await this.formatCommitMessage(r))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let n=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),n.summary.changes}async commit({message:r,amend:n}){this.plugin.setPluginState({gitAction:4});let i=(await this.git.commit(await this.formatCommitMessage(r),n?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),i}async stage(r,n){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,n),await this.git.add(["--",r]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.add(r!=null?r:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(r!=null?["--",r]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(r,n){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,n),await this.git.reset(["--",r]),this.plugin.setPluginState({gitAction:0})}async discard(r){this.plugin.setPluginState({gitAction:3}),await this.isTracked(r)?await this.git.checkout(["--",r]):await this.app.vault.adapter.rmdir(this.getRelativeVaultPath(r),!0),this.plugin.setPluginState({gitAction:0})}async hashObject(r){r=this.getRelativeRepoPath(r);let n=await this.getSubmoduleOfFile(r),i=n?["-C",n.submodule]:[],a=n?n.relativeFilepath:r;return i.push("hash-object","--",a),this.git.raw(i)}async discardAll({dir:r}){return this.discard(r!=null?r:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let r=await this.branchInfo(),n=await this.git.revparse([r.current]);if(!r.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let i=await this.git.revparse([r.tracking]);if(n!==i){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{switch(this.plugin.settings.syncMethod){case"merge":await this.git.merge([r.tracking]);break;case"rebase":await this.git.rebase([r.tracking])}}catch(o){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${r.current}`,i]),await this.unstageAll({})}catch(o){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`)}this.app.workspace.trigger("obsidian-git:head-change");let a=await this.git.revparse([r.current]);return(await this.git.diff([`${n}..${a}`,"--name-only"])).split(/\r\n|\r|\n/).filter(o=>o.length>0).map(o=>({path:o,workingDir:"P",vaultPath:this.getRelativeVaultPath(o)}))}else return[]}catch(r){this.convertErrors(r)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let s=await this.git.env({...process.env,OBSIDIAN_GIT:1}).subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(s)}let r=await this.git.status(),n=r.tracking,i=r.current;if(!n&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring push of main repo and updating submodules only.");return}let a=(await this.git.diffSummary([i,n,"--
Line truncated
|
||||||
|
`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(n){try{await this.git.branch(["--set-upstream",r])}catch(i){await this.git.push(["--set-upstream",...Fi(r)])}}}updateGitPath(r){return this.setGitInstance()}updateBasePath(r){return this.setGitInstance(!0)}async getDiffString(r,n=!1,i){return n?await this.git.diff(["--cached","--",r]):i?await this.git.show([`${i}`,"--",r]):await this.git.diff(["--",r])}async diff(r,n,i){return await this.git.diff([`${n}..${i}`,"--",r])}async rawCommand(r){let n=r.split(" ");return await this.git.raw(n[0],...n.slice(1))}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(De.dirname(r)))return;let n=await this.git.raw(["-C",De.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(n=n.trim(),(await this.git.raw(["-C",De.dirname(r),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let s=this.app.vault.adapter.getFullPath(De.normalize(r)),o=De.relative(n,s);return{submodule:n,relativeFilepath:o}}async getLastCommitTime(){let r=await this.git.log({n:1});if(r!=null&&r.latest!=null)return new Date(r.latest.date)}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),n=await ql(r||"git",["--version"],{});if(n.error)if(Jn.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${zu}) of Git for Windows.`);let i=await ql(zu,["--version"]);if(i.error)return console.error(i.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(n.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof wr){let n=String(r.message);if(n.contains("Could not resolve host")||n.contains("Unable to resolve host")||n.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||n.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||n.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new $s(n)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(n){let i=n instanceof Error?n.message:String(n);return this.plugin.displayError(`Error checking LFS status: ${i}`),!1}}},ET={hash:"000000",isZeroCommit:!0,summary:""};function LB(e){let r=e.replace(`\r
|
||||||
|
`,`
|
||||||
|
`).split(`
|
||||||
|
`),n={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},i=1;for(let a=0;a<r.length;){if(_T(r[a])){let s=r[a].split(" "),o=DB(s,i,n);for(a++;_T(r[a]);a++){let l=r[a].split(" ");NB(l,n,i)}BB(n.commits.get(o)),i+=1}else if(!(r[a]===""&&a===r.length-1))throw Error(`Expected non-whitespace line or EOF, but found: ${r[a]}`);a++}return n}function DB(e,t,r){let n=e[0];if(r.hashPerLine.push(n),r.originalFileLineNrPerLine.push(parseInt(e[1])),r.finalFileLineNrPerLine.push(parseInt(e[2])),e.length>=4&&r.groupSizePerStartingLine.set(t,parseInt(e[3])),parseInt(e[2])!==t)throw Error(`git-blame output is out of order: ${t} vs ${e[2]}`);return n}function NB(e,t,r){let n=e[0],i=e.slice(1).join(" "),a=t.hashPerLine[r],s=t.commits.get(a)||{hash:a,author:{},committer:{},previous:{}};switch(n){case"summary":s.summary=i;break;case"author":s.author.name=i;break;case"author-mail":s.author.email=xT(i);break;case"author-time":s.author.epochSeconds=parseInt(i);break;case"author-tz":s.author.tz=i;break;case"committer":s.committer.name=i;break;case"committer-mail":s.committer.email=xT(i);break;case"committer-time":s.committer.epochSeconds=parseInt(i);break;case"committer-tz":s.committer.tz=i;break;case"previous":s.previous.commitHash=i;break;case"filename":s.previous.filename=i;break}t.commits.set(a,s)}function BB(e){if(e.summary===void 0)throw Error(`Summary not provided for commit: ${e.hash}`);qg(e.author)&&(e.author=void 0),qg(e.committer)&&(e.committer=void 0),qg(e.previous)&&(e.previous=void 0),e.isZeroCommit=!!e.hash.match(/^0*$/)}function qg(e){return!e||Object.keys(e).length===0}function _T(e){return e.length>0&&e[0].trim()===e[0]}function xT(e){let t=e.startsWith("<")?e.substring(1):e;return t.endsWith(">")?t.substring(0,t.length-1):t}g();var aC=require("@codemirror/state");g();var NT=require("@codemirror/state"),qf=require("obsidian");g();var Xg=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(t,r){if(t)return this.ensureInitialized(t),r(this.eventsPerFilepath.get(t))}forEachSubscriber(t){this.eventsPerFilepath.forEach(r=>r.forEach(t))}ensureInitialized(t){this.eventsPerFilepath.get(t)||this.eventsPerFilepath.set(t,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(t=>t==null?void 0:t.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},Xs=new Xg;g();var zf=require("@codemirror/state"),IT=Ve(Zg());g();var U=require("obsidian");g();g();function an(){}an.prototype={diff:function(t,r){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.callback;typeof i=="function"&&(a=i,i={});var s=this;function o(E){return E=s.postProcess(E,i),a?(setTimeout(function(){a(E)},0),!0):E}t=this.castInput(t,i),r=this.castInput(r,i),t=this.removeEmpty(this.tokenize(t,i)),r=this.removeEmpty(this.tokenize(r,i));var l=r.length,c=t.length,u=1,f=l+c;i.maxEditLength!=null&&(f=Math.min(f,i.maxEditLength));var d=(n=i.timeout)!==null&&n!==void 0?n:1/0,h=Date.now()+d,p=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(p[0],r,t,0,i);if(p[0].oldPos+1>=c&&m+1>=l)return o(AT(s,p[0].lastComponent,r,t,s.useLongestToken));var v=-1/0,y=1/0;function b(){for(var E=Math.max(v,-u);E<=Math.min(y,u);E+=2){var _=void 0,k=p[E-1],w=p[E+1];k&&(p[E-1]=void 0);var A=!1;if(w){var S=w.oldPos-E;A=w&&0<=S&&S<l}var T=k&&k.oldPos+1<c;if(!A&&!T){p[E]=void 0;continue}if(!T||A&&k.oldPos<w.oldPos?_=s.addToPath(w,!0,!1,0,i):_=s.addToPath(k,!1,!0,1,i),m=s.extractCommon(_,r,t,E,i),_.oldPos+1>=c&&m+1>=l)return o(AT(s,_.lastComponent,r,t,s.useLongestToken));p[E]=_,_.oldPos+1>=c&&(y=Math.min(y,E-1)),m+1>=l&&(v=Math.max(v,E+1))}u++}if(a)(function E(){setTimeout(function(){if(u>f||Date.now()>h)return a();b()||E()},0)})();else for(;u<=f&&Date.now()<=h;){var x=b();if(x)return x}},addToPath:function(t,r,n,i,a){var s=t.lastComponent;return s&&!a.oneChangePerToken&&s.added===r&&s.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:r,removed:n,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:s}}},extractCommon:function(t,r,n,i,a){for(var s=r.length,o=n.length,l=t.oldPos,c=l-i,u=0;c+1<s&&l+1<o&&this.equals(n[l+1],r[c+1],a);)c++,l++,u++,a.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!a.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c},equals:function(t,r,n){return n.comparator?n.comparator(t,r):t===r||n.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return Array.from(t)},join:function(t){return t.join("")},
Line truncated
|
||||||
|
`));var r=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var i=0;i<n.length;i++){var a=n[i];i%2&&!t.newlineIsToken?r[r.length-1]+=a:r.push(a)}return r};Bf.equals=function(e,t,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
|
||||||
|
`))&&(e=e.trim()),(!r.newlineIsToken||!t.includes(`
|
||||||
|
`))&&(t=t.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
|
||||||
|
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
||||||
|
`)&&(t=t.slice(0,-1))),an.prototype.equals.call(this,e,t,r)};function RT(e,t,r){return Bf.diff(e,t,r)}var GB=new an;GB.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var zB=new an;zB.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function MT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Df(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MT(Object(r),!0).forEach(function(n){qB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MT(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function VB(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function WB(e){var t=VB(e,"string");return typeof t=="symbol"?t:t+""}function e0(e){"@babel/helpers - typeof";return e0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e0(e)}function qB(e,t,r){return t=WB(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kg(e){return YB(e)||XB(e)||ZB(e)||KB()}function YB(e){if(Array.isArray(e))return t0(e)}function XB(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZB(e,t){if(e){if(typeof e=="string")return t0(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t0(e,t)}}function t0(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function KB(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Zl=new an;Zl.useLongestToken=!0;Zl.tokenize=Bf.tokenize;Zl.castInput=function(e,t){var r=t.undefinedReplacement,n=t.stringifyReplacer,i=n===void 0?function(a,s){return typeof s=="undefined"?r:s}:n;return typeof e=="string"?e:JSON.stringify(r0(e,null,null,i),i," ")};Zl.equals=function(e,t,r){return an.prototype.equals.call(Zl,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"),r)};function r0(e,t,r,n,i){t=t||[],r=r||[],n&&(e=n(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return r[a];var s;if(Object.prototype.toString.call(e)==="[object Array]"){for(t.push(e),s=new Array(e.length),r.push(s),a=0;a<e.length;a+=1)s[a]=r0(e[a],t,r,n,i);return t.pop(),r.pop(),s}if(e&&e.toJSON&&(e=e.toJSON()),e0(e)==="object"&&e!==null){t.push(e),s={},r.push(s);var o=[],l;for(l in e)Object.prototype.hasOwnProperty.call(e,l)&&o.push(l);for(o.sort(),a=0;a<o.length;a+=1)l=o[a],s[l]=r0(e[l],t,r,n,l);t.pop(),r.pop()}else s=e;return s}var n0=new an;n0.tokenize=function(e){return e.slice()};n0.join=n0.removeEmpty=function(e){return e};function OT(e,t,r,n,i,a,s){if(s||(s={}),typeof s=="function"&&(s={callback:s}),typeof s.context=="undefined"&&(s.context=4),s.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(s.callback){var o=s,l=o.callback;RT(r,n,Df(Df({},s),{},{callback:function(f){var d=c(f);l(d)}}))}else return c(RT(r,n,s));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(A){return A.map(function(S){return" "+S})}for(var d=[],h=0,p=0,m=[],v=1,y=1,b=function(){var S=u[x],T=S.lines||QB(S.value);if(S.lines=T,S.added||S.removed){var P;if(!h){var I=u[x-1];h=v,p=y,I&&(m=s.context>0?f(I.lines.slice(-s.context)):[],h-=m.length,p-=m.length)}(P=m).push.apply(P,Kg(T.map(function(J){return(S.added?"+":"-")+J}))),S.added?y+=T.length:v+=T.length}else{if(h)if(T.length<=s.context*2&&x<u.length-2){var N;(N=m).push.apply(N,Kg(f(T)))}else{var L,ee=Math.min(T.length,s.context);(L=m).push.apply(L,Kg(f(T.slice(0,ee))));var fe={oldStart:h,oldLines:v-h+ee,newStart:p,newLines:y-p+ee,lines:m};d.push(fe),h=0,p=0,m=[]}v+=T.length,y+=T.length}},x=0;x<u.length;x++)b();for(var E=0,_=d;E<_.length;E++)for(var k=_[E],w=0;w<k.lines.length;w++)k.lines[w].endsWith(`
|
||||||
|
`)?k.lines[w]=k.lines[w].slice(0,-1):(k.lines.splice(w+1,0,"\\ No newline at end of file"),w++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:d}}}function i0(e){if(Array.isArray(e))return e.map(i0).join(`
|
||||||
|
`);var t=[];e.oldFileName==e.newFileName&&t.push("Index: "+e.oldFileName),t.push("==================================================================="),t.push("--- "+e.oldFileName+(typeof e.oldHeader=="undefined"?"":" "+e.oldHeader)),t.push("+++ "+e.newFileName+(typeof e.newHeader=="undefined"?"":" "+e.newHeader));for(var r=0;r<e.hunks.length;r++){var n=e.hunks[r];n.oldLines===0&&(n.oldStart-=1),n.newLines===0&&(n.newStart-=1),t.push("@@ -"+n.oldStart+","+n.oldLines+" +"+n.newStart+","+n.newLines+" @@"),t.push.apply(t,n.lines)}return t.join(`
|
||||||
|
`)+`
|
||||||
|
`}function JB(e,t,r,n,i,a,s){var o;if(typeof s=="function"&&(s={callback:s}),(o=s)!==null&&o!==void 0&&o.callback){var c=s,u=c.callback;OT(e,t,r,n,i,a,Df(Df({},s),{},{callback:function(d){d?u(i0(d)):u()}}))}else{var l=OT(e,t,r,n,i,a,s);return l?i0(l):void 0}}function jf(e,t,r,n,i,a){return JB(e,e,t,r,n,i,a)}function QB(e){var t=e.endsWith(`
|
||||||
|
`),r=e.split(`
|
||||||
|
`).map(function(n){return n+`
|
||||||
|
`});return t?r.pop():r.push(r.pop().slice(0,-1)),r}var Sa=require("obsidian");g();var $i=require("obsidian"),Hf=class{constructor(t,r){this.plugin=r;this.promises={};this.adapter=t.adapter,this.vault=t,this.lastBasePath=this.plugin.settings.basePath,this.promises.readFile=this.readFile.bind(this),this.promises.writeFile=this.writeFile.bind(this),this.promises.readdir=this.readdir.bind(this),this.promises.mkdir=this.mkdir.bind(this),this.promises.rmdir=this.rmdir.bind(this),this.promises.stat=this.stat.bind(this),this.promises.unlink=this.unlink.bind(this),this.promises.lstat=this.lstat.bind(this),this.promises.readlink=this.readlink.bind(this),this.promises.symlink=this.symlink.bind(this)}async readFile(t,r){var n;if(this.maybeLog("Read: "+t+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let i=this.vault.getAbstractFileByPath(t);return i instanceof $i.TFile?(this.maybeLog("Reuse"),this.vault.read(i)):this.adapter.read(t)}else{if(t.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(t)):(n=this.index)!=null?n:this.adapter.readBinary(t);let i=this.vault.getAbstractFileByPath(t);return i instanceof $i.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(i)):this.adapter.readBinary(t)}}async writeFile(t,r){if(this.maybeLog("Write: "+t),typeof r=="string"){let n=this.vault.getAbstractFileByPath(t);return n instanceof $i.TFile?this.vault.modify(n,r):this.adapter.write(t,r)}else if(t.endsWith(this.gitDir+"/index"))this.index=r,this.indexmtime=Date.now();else{let n=this.vault.getAbstractFileByPath(t);return n instanceof $i.TFile?this.vault.modifyBinary(n,r):this.adapter.writeBinary(t,r)}}async readdir(t){t==="."&&(t="/");let r=await this.adapter.list(t),n=[...r.files,...r.folders],i;return t!=="/"?i=n.map(a=>(0,$i.normalizePath)(a.substring(t.length))):i=n,i}async mkdir(t){return this.adapter.mkdir(t)}async rmdir(t,r){var n,i;return this.adapter.rmdir(t,(i=(n=r==null?void 0:r.options)==null?void 0:n.recursive)!=null?i:!1)}async stat(t){if(t.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.length,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let n=await this.adapter.stat(t);if(n==null)throw{code:"ENOENT"};return this.indexctime=n.ctime,this.indexmtime=n.mtime,{ctimeMs:n.ctime,mtimeMs:n.mtime,size:n.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}t==="."&&(t="/");let r=this.vault.getAbstractFileByPath(t);if(this.maybeLog("Stat: "+t),r instanceof $i.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:r.stat.ctime,mtimeMs:r.stat.mtime,size:r.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let n=await this.adapter.stat(t);if(n)return{ctimeMs:n.ctime,mtimeMs:n.mtime,size:n.size,type:n.type==="folder"?"directory":n.type,isFile:()=>n.type==="file",isDirectory:()=>n.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(t){return this.adapter.remove(t)}async lstat(t){return this.stat(t)}async readlink(t){throw new Error(`readlink of (${t}) is not implemented.`)}async symlink(t){throw new Error(`symlink of (${t}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(t){}};var sn=class extends Ys{constructor(r){super(r);this.FILE=0;this.HEAD=1;this.WORKDIR=2;this.STAGE=3;this.status_mapping={"000":" ","003":"AD","020":"??","022":"A ","023":"AM",100:"D ",101:" D",103:"MD",110:"DA",111:" ",113:"MM",120:"DA",121:" M",122:"M ",123:"MM"};this.noticeLength=999999;this.fs=new Hf(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var r,n;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(n=this.plugin.localStorage.getPassword())!=null?n:void 0}},onAuthFailure:async()=>{new Sa.Notice("Authentication failed. Please try with different credentials");let r=await new $e(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let n=await new $e(this.plugin,{placeholder:"Specify your password/personal access token"}).openAndGetResult();if(n)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(n),{username:r,password:n}}return{cancel:!0}},http:{async request({url:r,method:n,headers:i,body:a}){let s;a&&(s=(await nj(a)).buffer);let o=await(0,Sa.requestUrl)({url:r,method:n,headers:i,body:s,throw:!1});return{url:r,method:n,headers:o.headers,body:[new Uint8Array(o.arrayBuffer)],statusCode:o.status,statusMessag
Line truncated
|
||||||
|
|
||||||
|
`);return{message:l[0],author:{name:o.commit.author.name,email:o.commit.author.email},body:l.slice(1).join(`
|
||||||
|
|
||||||
|
`),date:new Date(o.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(o.commit.parent.first(),o.oid)).map(c=>({path:c.path,status:c.type,vaultPath:this.getRelativeVaultPath(c.path),hash:o.oid}))},hash:o.oid,refs:[]}}))}updateBasePath(r){return this.getRepo().dir=r,Promise.resolve()}async updateUpstreamBranch(r){let[n,i]=Fi(r),a=await this.branchInfo();await this.wrapFS(ie.push({...this.getRepo(),remote:n,remoteRef:i})),await this.setConfig(`branch.${a.current}.merge`,`refs/heads/${i}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,n){return this.walkDifference({walkers:[ie.TREE({ref:r}),ie.TREE({ref:n})]})}async walkDifference({walkers:r,dir:n}){return await this.wrapFS(ie.walk({...this.getRepo(),trees:r,map:async function(a,[s,o]){if(!Gg(a,n))return null;if(await(s==null?void 0:s.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(s==null?void 0:s.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(s),console.log(o)),u!=="equal")return{path:a,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[ie.TREE({ref:"HEAD"}),ie.STAGE()],dir:r})).map(i=>({vaultPath:this.getRelativeVaultPath(i.path),path:i.path}))}async getUnstagedFiles(r="."){let n,i=window.setTimeout(()=>{n=new Sa.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let a=this.getRepo(),s=await this.wrapFS(ie.walk({...a,trees:[ie.WORKDIR(),ie.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await ie.isIgnored({...a,filepath:o})||!Gg(o,r))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),d=[u,f].includes("blob");if((u==="tree"||u==="special")&&!d)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!d)return;let h=f==="blob"?await c.oid():void 0,p;return u==="blob"&&f!=="blob"?p="42":u==="blob"&&(p=await l.oid()),p?p!==h?{path:o,deleted:!1}:null:{path:o,deleted:!0}}}));return window.clearTimeout(i),n==null||n.hide(),s}catch(a){throw window.clearTimeout(i),n==null||n.hide(),this.plugin.displayError(a),a}}async getDiffString(r,n=!1,i){let a=this.getRelativeVaultPath(r),s=async(c,[u])=>{if(r==c){let f=await u.oid();return(await ie.readBlob({...this.getRepo(),oid:f})).blob}};if(i){let c=await _l({...this.getRepo(),filepath:r,oid:i}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof ie.Errors.NotFoundError))throw h}),u=await ie.readCommit({...this.getRepo(),oid:i}),f=await _l({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof ie.Errors.NotFoundError))throw h});return jf(a,f!=null?f:"",c!=null?c:"")}let o=(await ie.walk({...this.getRepo(),trees:[ie.STAGE()],map:s})).first(),l=new TextDecoder().decode(o);if(n){let c=await this.resolveRef("HEAD").then(f=>_l({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof ie.Errors.NotFoundError))throw f});return jf(a,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(a)?c=await this.app.vault.adapter.read(a):c="",jf(a,l,c)}}async getLastCommitTime(){let r=this.getRepo(),n=await this.resolveRef("HEAD"),a=(await ie.readCommit({...r,oid:n})).commit.committer.timestamp;return new Date(a*1e3)}getFileStatusResult(r){let n=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:n[0]=="?"?"U":n[0],workingDir:n[1]=="?"?"U":n[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),n=await this.getConfig("user.email");if(!r||!n)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,n=!0){if(!this.plugin.settings.disablePopups)return new Sa.Notice(r,n?this.noticeLength:void 0)}};function ej(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function tj(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:ej(e)}async function rj(e,t){let r=tj(e);for(;;){let{value:n,done:i}=await r.next();if(n&&await t(n),i)break}r.return&&r.return()}async function nj(e){let t=0,r=[];await rj(e,a=>{r.push(a),t+=a.byteLength});let n=new Uint8Array(t),i=0;for(let a of r)n.set(a,i),i+=a.byteLength;return n}var ij="https://momentjs.com/docs/#/parsing/string-format/",aj="https://publish.obsidian.md/git-doc/Line+Authoring",Uf=class extends U.PluginSettingTab{constructor(r,n){super(r,n);this.plugin=n;this.lineAuthorColorSettings=new Map}get settings(){return this.plugin.settings}display(){let{containerEl:r}=this,n=this.plugin,i;n.settings.differentIntervalCommitAndPush?i="commit":i="commit-and-sync";let a=n.gitReady;r.empty(),a||(r.createEl("p",{text:"Git is not ready. When
Line truncated
|
||||||
|
If turned on, do auto ${i} every ${yT(n.settings.autoSaveInterval)} after stopping file edits.
|
||||||
|
This also prevents auto ${i} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(u=>u.setValue(n.settings.autoBackupAfterFileChange).onChange(async f=>{n.settings.autoBackupAfterFileChange=f,this.refreshDisplayWithDelay(),await n.saveSettings(),n.automaticsManager.reload("commit")})),this.mayDisableSetting(s,n.settings.setLastSaveToLastCommit),s=new U.Setting(r).setName(`Auto ${i} after latest commit`).setDesc(`If turned on, sets last auto ${i} timestamp to the latest commit timestamp. This reduces the frequency of auto ${i} when doing manual commits.`).addToggle(u=>u.setValue(n.settings.setLastSaveToLastCommit).onChange(async f=>{n.settings.setLastSaveToLastCommit=f,await n.saveSettings(),n.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(s,n.settings.autoBackupAfterFileChange),s=new U.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(u=>{u.inputEl.type="number",this.setNonDefaultValue({text:u,settingsProperty:"autoPushInterval"}),u.setPlaceholder(String(je.autoPushInterval)),u.onChange(async f=>{f!==""?n.settings.autoPushInterval=Number(f):n.settings.autoPushInterval=je.autoPushInterval,await n.saveSettings(),n.automaticsManager.reload("push")})}),this.mayDisableSetting(s,!n.settings.differentIntervalCommitAndPush),new U.Setting(r).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(u=>{u.inputEl.type="number",this.setNonDefaultValue({text:u,settingsProperty:"autoPullInterval"}),u.setPlaceholder(String(je.autoPullInterval)),u.onChange(async f=>{f!==""?n.settings.autoPullInterval=Number(f):n.settings.autoPullInterval=je.autoPullInterval,await n.saveSettings(),n.automaticsManager.reload("pull")})}),new U.Setting(r).setName(`Specify custom commit message on auto ${i}`).setDesc("You will get a pop up to specify your message.").addToggle(u=>u.setValue(n.settings.customMessageOnAutoBackup).onChange(async f=>{n.settings.customMessageOnAutoBackup=f,await n.saveSettings(),this.refreshDisplayWithDelay()})),s=new U.Setting(r).setName(`Commit message on auto ${i}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>{u.setPlaceholder(je.autoCommitMessage).onChange(async f=>{f===""?n.settings.autoCommitMessage=je.autoCommitMessage:n.settings.autoCommitMessage=f,await n.saveSettings()}),this.setNonDefaultValue({text:u,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(s,n.settings.customMessageOnAutoBackup),new U.Setting(r).setName("Commit message").setHeading(),new U.Setting(r).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>{u.setPlaceholder(je.commitMessage).onChange(async f=>{f===""?n.settings.commitMessage=je.commitMessage:n.settings.commitMessage=f,await n.saveSettings()}),this.setNonDefaultValue({text:u,settingsProperty:"commitMessage"})}),new U.Setting(r).setName("Commit message script").setDesc("A script that is run using 'sh -c' to generate the commit message. May be used to generate commit messages using AI tools. Available placeholders: {{hostname}}, {{date}}.").addText(u=>{u.onChange(async f=>{f===""?n.settings.commitMessageScript=je.commitMessageScript:n.settings.commitMessageScript=f,await n.saveSettings()}),this.setNonDefaultValue({text:u,settingsProperty:"commitMessageScript"})});let c=new U.Setting(r).setName("{{date}} placeholder format").addMomentFormat(u=>u.setDefaultFormat(n.settings.commitDateFormat).setValue(n.settings.commitDateFormat).onChange(async f=>{n.settings.commitDateFormat=f,await n.saveSettings()}));c.descEl.innerHTML=`
|
||||||
|
Specify custom date format. E.g. "${xm}. See <a href="https://momentjs.com">Moment.js</a> for more formats.`,new U.Setting(r).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText(u=>{var f;return u.setValue((f=n.localStorage.getHostname())!=null?f:"").onChange(d=>{n.localStorage.setHostname(d)})}),new U.Setting(r).setName("Preview commit message").addButton(u=>u.setButtonText("Preview").onClick(async()=>{let f=await n.gitManager.formatCommitMessage(n.settings.commitMessage);new U.Notice(`${f}`)})),new U.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(u=>u.setValue(n.settings.listChangedFilesInMessageBody).onChange(async f=>{n.settings.listChangedFilesInMessageBody=f,await n.saveSettings()})),new U.Setting(r).setName("Pull").setHeading(),n.gitManager instanceof Ee&&new U.Setting(r).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(u=>{let f={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};u.addOptions(f),u.setValue(n.settings.syncMethod),u.onChange(async d=>{n.settings.syncMethod=d,await n.saveSettings()})}),new U.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(u=>u.setValue(n.settings.autoPullOnBoot).onChange(async f=>{n.settings.autoPullOnBoot=f,await n.saveSettings()})),new U.Setting(r).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),s=new U.Setting(r).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${n.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(u=>u.setValue(!n.settings.disablePush).onChange(async f=>{n.settings.disablePush=!f,this.refreshDisplayWithDelay(),await n.saveSettings()})),new U.Setting(r).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${n.settings.disablePush?"":"and push "}only.`).addToggle(u=>u.setValue(n.settings.pullBeforePush).onChange(async f=>{n.settings.pullBeforePush=f,this.refreshDisplayWithDelay(),await n.saveSettings()})),n.gitManager instanceof Ee&&(new U.Setting(r).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new U.Setting(r).setName("History view").setHeading(),new U.Setting(r).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(n.settings.authorInHistoryView),c.onChange(async f=>{n.settings.authorInHistoryView=f,await n.saveSettings(),await n.refresh()})}),new U.Setting(r).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(n.settings.dateInHistoryView).onChange(async u=>{n.settings.dateInHistoryView=u,await n.saveSettings(),await n.refresh()})),new U.Setting(r).setName("Source control view").setHeading(),new U.Setting(r).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(n.settings.refreshSourceControl).onChange(async u=>{n.settings.refreshSourceControl=u,await n.saveSettings()})),new U.Setting(r).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>{c.inputEl.type="number",this.setNonDefaultValue({text:c,settingsProperty:"refreshSourceControlTimer"}),c.setPlaceholder(String(je.refreshSourceControlTimer)),c.onChange(async f=>{f!==""&&Number.isInteger(Number(f))?n.settings.refreshSourceControlTimer=Math.max(Number(f),500):n.settings.refreshSourceControlTimer=je.refreshSourceControlTimer,await n.saveSettings(),n.setRefreshDebouncer()})}),new U.Setting(r).setName("Miscellaneous").setHeading(),n.gitManager instanceof Ee&&new U.Setting(r).setName("Diff view style").setDesc('Set the style for the diff view. Note that the actual diff in "Split" mode is not generated by Git, but the editor itself instead so it may differ from the diff generated by Git. One advantage of this is that you can edit the text in that view.').addDropdown(c=>{let u={split:"Split",git_unified:"Unified"};c.addOptions(u),c.setValue(n.settings.diffStyle),c.onChange(async f=>{n.settings.diffStyle=f,await n.saveSettings()})}),new U.Setting(r).setName("Disable informative notifications").setDesc("Disable informative notifications for git operations t
Line truncated
|
||||||
|
`)),c.onChange(u=>{n.localStorage.setEnvVars(u.split(`
|
||||||
|
`))})}),n.gitManager instanceof Ee&&new U.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(n.localStorage.getPATHPaths().join(`
|
||||||
|
`)),c.onChange(u=>{n.localStorage.setPATHPaths(u.split(`
|
||||||
|
`))})}),n.gitManager instanceof Ee&&new U.Setting(r).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await n.gitManager.setGitInstance()})}),new U.Setting(r).setName("Custom base path (Git repository path)").setDesc(`
|
||||||
|
Sets the relative path to the vault from which the Git binary should be executed.
|
||||||
|
Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows.
|
||||||
|
`).addText(c=>{c.setValue(n.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{n.settings.basePath=u,await n.saveSettings(),n.gitManager.updateBasePath(u||"").catch(f=>n.displayError(f))})}),new U.Setting(r).setName("Custom Git directory path (Instead of '.git')").setDesc('Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(n.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{n.settings.gitDir=u,await n.saveSettings()})}),new U.Setting(r).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(n.localStorage.getPluginDisabled()).onChange(u=>{n.localStorage.setPluginDisabled(u),u?n.unloadPlugin():n.init({fromReload:!0}).catch(f=>n.displayError(f)),new U.Notice("Obsidian must be restarted for the changes to take affect.")})),new U.Setting(r).setName("Support").setHeading(),new U.Setting(r).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{c.buttonEl.outerHTML="<a href='https://ko-fi.com/F1F195IQ5' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi3.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>"});let o=r.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new U.Notice("Debug information copied to clipboard. May contain sensitive information!")},U.Platform.isDesktopApp){let c=r.createDiv();c.setAttr("align","center"),c.setText(`Debugging and logging:
|
||||||
|
You can always see the logs of this and every other plugin by opening the console with`);let u=r.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),U.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(r,n){n&&(r.setDisabled(n),r.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(r){this.settings.lineAuthor.show=r,this.plugin.saveSettings(),r?this.plugin.lineAuthoringFeature.activateFeature():this.plugin.lineAuthoringFeature.deactivateFeature()}async lineAuthorSettingHandler(r,n){this.settings.lineAuthor[r]=n,await this.plugin.saveSettings(),this.plugin.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let r=this.settings.lineAuthor;r.authorDisplay!=="hide"&&(r.lastShownAuthorDisplay=r.authorDisplay),r.dateTimeFormatOptions!=="hide"&&(r.lastShownDateTimeFormatOptions=r.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let r=new U.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.innerHTML=`
|
||||||
|
<a href="${aj}">Feature guide and quick examples</a></br>
|
||||||
|
The commit hash, author name and authoring date can all be individually toggled.</br>Hide everything, to only show the age-colored sidebar.`,r.addToggle(n=>n.setValue(this.settings.lineAuthor.show).onChange(i=>{this.configureLineAuthorShowStatus(i),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let n=new U.Setting(this.containerEl).setName("Follow movement and copies across files and commits").setDesc("").addDropdown(a=>{a.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),a.setValue(this.settings.lineAuthor.followMovement),a.onChange(s=>this.lineAuthorSettingHandler("followMovement",s))});if(n.descEl.innerHTML=`
|
||||||
|
By default (deactivated), each line only shows the newest commit where it was changed.
|
||||||
|
<br/>
|
||||||
|
With <i>same commit</i>, cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown.
|
||||||
|
<br/>
|
||||||
|
With <i>all commits</i>, cut-copy-paste-ing text inbetween multiple commits will be detected.
|
||||||
|
<br/>
|
||||||
|
It uses <a href="https://git-scm.com/docs/git-blame">git-blame</a> and
|
||||||
|
for matches (at least ${Gu} characters) within the same (or all) commit(s), <em>the originating</em> commit's information is shown.`,new U.Setting(this.containerEl).setName("Show commit hash").addToggle(a=>{a.setValue(this.settings.lineAuthor.showCommitHash),a.onChange(s=>this.lineAuthorSettingHandler("showCommitHash",s))}),new U.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(a=>{let s={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};a.addOptions(s),a.setValue(this.settings.lineAuthor.authorDisplay),a.onChange(async o=>this.lineAuthorSettingHandler("authorDisplay",o))}),new U.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(a=>{let s={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeFormatOptions),a.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",o),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let a=new U.Setting(this.containerEl);a.setName("Custom authoring date format").addText(s=>{s.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),s.setPlaceholder("YYYY-MM-DD HH:mm"),s.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",o),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(o)})}),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(this.settings.lineAuthor.dateTimeFormatCustomString)}new U.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(a=>{let s={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeTimezone),a.onChange(async o=>this.lineAuthorSettingHandler("dateTimeTimezone",o))}).descEl.innerHTML=`
|
||||||
|
The time-zone in which the authoring date should be shown.
|
||||||
|
Either your local time-zone (default),
|
||||||
|
the author's time-zone during commit creation or
|
||||||
|
<a href="https://en.wikipedia.org/wiki/UTC%C2%B100:00">UTC\xB100:00</a>.
|
||||||
|
`;let i=new U.Setting(this.containerEl).setName("Oldest age in coloring");i.descEl.innerHTML=this.previewOldestAgeDescriptionHtml(this.settings.lineAuthor.coloringMaxAge)[0],i.addText(a=>{a.setPlaceholder("1y"),a.setValue(this.settings.lineAuthor.coloringMaxAge),a.onChange(async s=>{let[o,l]=this.previewOldestAgeDescriptionHtml(s);i.descEl.innerHTML=o,l&&(await this.lineAuthorSettingHandler("coloringMaxAge",s),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest"),new U.Setting(this.containerEl).setName("Text color").addText(a=>{a.setValue(this.settings.lineAuthor.textColorCss),a.onChange(async s=>{await this.lineAuthorSettingHandler("textColorCss",s)})}).descEl.innerHTML=`
|
||||||
|
The CSS color of the gutter text.<br/>
|
||||||
|
|
||||||
|
It is higly recommended to use
|
||||||
|
<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties">
|
||||||
|
CSS variables</a>
|
||||||
|
defined by themes
|
||||||
|
(e.g. <pre style="display:inline">var(--text-muted)</pre> or
|
||||||
|
<pre style="display:inline">var(--text-on-accent)</pre>,
|
||||||
|
because they automatically adapt to theme changes.<br/>
|
||||||
|
|
||||||
|
See: <a href="https://github.com/obsidian-community/obsidian-theme-template/blob/main/obsidian.css">
|
||||||
|
List of available CSS variables in Obsidian
|
||||||
|
<a/>
|
||||||
|
`,new U.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(a=>{a.setValue(this.settings.lineAuthor.ignoreWhitespace),a.onChange(s=>this.lineAuthorSettingHandler("ignoreWhitespace",s))}).descEl.innerHTML=`
|
||||||
|
Whitespace and newlines are interpreted as
|
||||||
|
part of the document and in changes
|
||||||
|
by default (hence not ignored).
|
||||||
|
This makes the last line being shown as 'changed'
|
||||||
|
when a new subsequent line is added,
|
||||||
|
even if the previously last line's text is the same.
|
||||||
|
<br>
|
||||||
|
If you don't care about purely-whitespace changes
|
||||||
|
(e.g. list nesting / quote indentation changes),
|
||||||
|
then activating this will provide more meaningful change detection.
|
||||||
|
`}}createColorSetting(r){let n=new U.Setting(this.containerEl).setName("").addText(i=>{let a=a0(r,this.settings.lineAuthor),s=a0(r,je.lineAuthor);i.setPlaceholder(zg(s)),i.setValue(zg(a)),i.onChange(async o=>{let l=dT(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,n),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,a0(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let n=this.lineAuthorColorSettings.get(r);if(n){let i=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";n.nameEl.innerText=`Color for ${i} commits`}}refreshColorSettingsDesc(r,n){let i=this.lineAuthorColorSettings.get(r);i&&(i.descEl.innerHTML=this.colorSettingPreviewDescHtml(r,this.settings.lineAuthor,n!==void 0))}colorSettingPreviewDescHtml(r,n,i){let a=i?s0(r,n):"rgba(127,127,127,0.3)",s=U.moment.unix(U.moment.now()/1e3).format("YYYY-MM-DD"),o=i?`abcdef Author Name ${s}`:"invalid color";return`Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and
|
||||||
|
named colors (e.g. 'black', 'purple'). Color preview: ${`<div
|
||||||
|
class="line-author-settings-preview"
|
||||||
|
style="background-color: ${a}; width: 30ch;"
|
||||||
|
>${o}</div>`}`}previewCustomDateTimeDescriptionHtml(r){let n=(0,U.moment)().format(r);return`<a href="${ij}">Format string</a> to display the authoring date.</br>Currently: ${n}`}previewOldestAgeDescriptionHtml(r){let n=Gf(r);return[`The oldest age in the line author coloring. Everything older will have the same color.
|
||||||
|
</br>Smallest valid age is "1d". Currently: ${n!==void 0?`${n.asDays()} days`:"invalid!"}`,n]}setNonDefaultValue({settingsProperty:r,text:n}){let i=this.plugin.settings[r];je[r]!==i&&n.setValue(String(i))}refreshDisplayWithDelay(r=80){setTimeout(()=>this.display(),r)}};function a0(e,t){return e==="oldest"?t.colorOld:t.colorNew}function Gf(e){let t=U.moment.duration("P"+e.toUpperCase());return t.isValid()&&t.asDays()&&t.asDays()>=1?t:void 0}function FT(e,t,r){if(!(e===void 0||t===void 0||r===void 0))return`head${e}-obj${t}-path${r}`}var $T=zf.Annotation.define();function LT(e,t,r){return r.update({annotations:$T.of({key:e,la:t,lineOffsetsFromUnsavedChanges:new Map})})}function sj(e){return e.annotation($T)}var Zs=zf.StateField.define({create:e=>{},update:(e,t)=>{var r;return(r=sj(t))!=null?r:oj(t,e)},compare:(e,t)=>(e==null?void 0:e.key)===(t==null?void 0:t.key)});function Vf(e){var a;let t=IT.sha256.create();if(!e)return t;let{la:r,key:n,lineOffsetsFromUnsavedChanges:i}=e;t.update(r==="untracked"?"t":"f"),t.update(n);for(let[s,o]of(a=i.entries())!=null?a:[])t.update([s,o]);return t}var Nr={get:void 0,save:void 0};function DT(e,t){Nr.get=e,Nr.save=t}function Wf(e){var t,r;return(r=(t=Gf(e.coloringMaxAge))==null?void 0:t.asDays())!=null?r:Gf(je.lineAuthor.coloringMaxAge).asDays()}function oj(e,t){if(t)return e.changes.empty||e.changes.iterChanges((r,n,i,a)=>{var p;let s=e.startState.doc,{newDoc:o}=e,l=s.lineAt(r).number,c=s.lineAt(n).number,u=o.lineAt(i).number,f=o.lineAt(a).number,d=c-l+1,h=f-u+1;for(let m=u;m<=f;m++){let v=(p=t.lineOffsetsFromUnsavedChanges.get(m))!=null?p:0,y=f===m,b=h-d;y&&(v+=b),t.lineOffsetsFromUnsavedChanges.set(m,v)}}),t}var o0=class{constructor(t){this.state=t;this.subscribeMe()}notifyLineAuthoring(t,r){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${t}`);return}let n=this.view.state,i=LT(t,r,n);this.view.dispatch(i)}updateToNewState(t){let r=this.lastSeenPath&&this.filepath!=this.lastSeenPath;return this.state=t,r&&(this.unsubscribeMe(this.lastSeenPath),this.subscribeMe()),this}removeIfStale(){this.view.destroyed&&this.unsubscribeMe(this.lastSeenPath)}subscribeMe(){this.filepath!==void 0&&(Xs.ifFilepathDefinedTransformSubscribers(this.filepath,t=>t.add(this)),this.lastSeenPath=this.filepath)}unsubscribeMe(t){Xs.ifFilepathDefinedTransformSubscribers(t,r=>r.delete(this))}get filepath(){var t,r;return(r=(t=this.state.field(qf.editorInfoField))==null?void 0:t.file)==null?void 0:r.path}get view(){return this.state.field(qf.editorEditorField)}},BT=NT.StateField.define({create:e=>new o0(e),update:(e,t)=>e.updateToNewState(t.state),compare:(e,t)=>e===t});g();function jT(){Ks=void 0,l0=[],Yf=0,Zf.clear(),Kf.clear(),Js.clear()}var Ks,Xf=()=>Ks;function HT(e,t){var i;let r=t.length;if(r<((i=Ks==null?void 0:Ks.length)!=null?i:0))return;Ks={gutter:e,length:r,text:t};let n=Nr.get();r!==n.gutterSpacingFallbackLength&&(n.gutterSpacingFallbackLength=r,Nr.save(n))}var l0=[],lj=15,Yf=0;function UT(e){l0[Yf]=e,Yf=(Yf+1)%lj}function GT(){return pT(l0)}var Zf=new Map,Kf=new Map,Js=new Set;g();var rC=require("@codemirror/state"),nC=require("@codemirror/view");g();var d0=require("@codemirror/view"),JT=Ve(Zg()),ed=require("obsidian");g();g();var Jf={x:-10,y:-10};function zT(){Jf.x===-10&&window.addEventListener("mousedown",e=>{Jf.x=e.clientX,Jf.y=e.clientY})}function VT(){for(let e of Js)if(cj(e,Jf))return e}function cj(e,t){let{x:r,y:n,width:i,height:a}=e.getBoundingClientRect();return r<=t.x&&t.x<=r+i&&n<=t.y&&t.y<=n+a}g();var Kl={};var WT="data-commit";function qT(e,t,r){if(t.hasFocus())return;let n=VT();if(!n)return;let i=fj(n);i&&(!i.isZeroCommit&&!i.isWaitingGutter&&uj(i,e),c0("showCommitHash",e),c0("authorDisplay",e),c0("dateTimeFormatOptions",e))}function uj(e,t){t.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(n=>navigator.clipboard.writeText(e.hash)))}function c0(e,t){var l,c;let r,n,i=Kl.plugin.settings.lineAuthor,a=i[e],s=typeof a=="boolean"?a:a!=="hide",o=je.lineAuthor[e];if(e==="showCommitHash")r="Show commit hash",n=a;else if(e==="authorDisplay"){let u=(l=i.lastShownAuthorDisplay)!=null?l:o;r="Show author "+(s?a:u),n=s?"hide":u}else if(e==="dateTimeFormatOptions"){let u=(c=i.lastShownDateTimeFormatOptions)!=null?c:o;r="Show "+(s?a:u),r+=r.contains("date")?"":" date",n=s?"hide":u}else Ii(e);t.addItem(u=>u.setTitle(r).setSection("obs-git-line-author-configure").setChecked(s).onClick(f=>{var d,h;return(h=(d=Kl.plugin)==null?void 0:d.settingsTab)==null?void 0:h.lineAuthorSettingHandler(e,n)}))}function YT(e,t,r){r.setAttr(WT,JSON.stringify({hash:e.hash,isZeroCommit:e.isZeroCommit,isWaitingGutter:t}))}function fj(e){let t=e.getAttr(WT);return t?JSON.parse(t):void 0}g();function s0(e,t){return e==="oldest"?Qf(0,!1,t).color:Qf(void 0,!0,t).color}function Qf(e,t,r){let n=Wf(r),i=Date.now()/1e3,a=e!=null?e:0,o=(t?0:i-a)/60/60/24,l=Math.pow(Math.clamp(o/n,0,1),1/2.3),c=Line truncated
|
||||||
|
(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,Br.setIcon)(this.iconEl,"globe"):(0,Br.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus&&this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.gitManager.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};g();var sd=require("obsidian"),ad=class extends sd.SuggestModal{constructor(r){super(r.app);this.plugin=r;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(r){let n=(0,sd.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${n}: ${r}`,`${r}: ${n}`]}renderSuggestion(r,n){n.innerText=r}onChooseSuggestion(r,n){this.resolve&&this.resolve(r)}};g();var oC=require("obsidian"),Jl=class{constructor(t){this.plugin=t}saveLastAuto(t,r){r==="backup"?this.plugin.localStorage.setLastAutoBackup(t.toString()):r==="pull"?this.plugin.localStorage.setLastAutoPull(t.toString()):r==="push"&&this.plugin.localStorage.setLastAutoPush(t.toString())}loadLastAuto(){var t,r,n;return{backup:new Date((t=this.plugin.localStorage.getLastAutoBackup())!=null?t:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((n=this.plugin.localStorage.getLastAutoPush())!=null?n:"")}}async init(){await this.setUpAutoCommitAndSync();let t=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let r=this.diff(this.plugin.settings.autoPushInterval,t.push);this.startAutoPush(r)}if(this.plugin.settings.autoPullInterval>0){let r=this.diff(this.plugin.settings.autoPullInterval,t.pull);this.startAutoPull(r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...t){t.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),t.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),t.contains("pull")&&(this.clearAutoPull(),this.plugin.settings.autoPullInterval>0&&this.startAutoPull(this.plugin.settings.autoPullInterval))}async setUpAutoCommitAndSync(){if(this.plugin.settings.setLastSaveToLastCommit){this.clearAutoCommitAndSync();let t=await this.plugin.gitManager.getLastCommitTime();t&&this.saveLastAuto(t,"backup")}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let t=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let r=this.diff(this.plugin.settings.autoSaveInterval,t.backup);this.startAutoCommitAndSync(r)}}}startAutoCommitAndSync(t){let r=(t!=null?t:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?t===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,oC.debounce)(()=>this.doAutoCommitAndSync(),r,!0):(r>2147483647&&(r=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),r))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(async()=>{if(this.plugin.settings.setLastSaveToLastCommit){let t=await this.plugin.gitManager.getLastCommitTime();if(t){this.saveLastAuto(t,"backup");let r=this.diff(this.plugin.settings.autoSaveInterval,t);if(r>0)return this.startAutoCommitAndSync(r),!1}}return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.commit({fromAuto:!0}):await this.plugin.commitAndSync({fromAutoBackup:!0}),!0},t=>{t!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(t){let r=(t!=null?t:this.plugin.settings.autoPullInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPull=window.setTimeout(()=>this.doAutoPull(),r)}doAutoPull(){this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote(),()=>{this.saveLastAuto(new Date,"pull"),this.startAutoPull()})}startAutoPush(t){let r=(t!=null?t:this.plugin.settings.autoPushInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPush=window.setTimeout(()=>this.doAutoPush(),r)}doAutoPush(){this.plugin.promiseQueue.addTask(()=>this.plugin.push(),()=>{this.saveLastAuto(new Date,"push"),this.startAutoPush()})}clearAutoCommitAndSync(){var r;let t=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,t=!0),this.plugin.autoCommitDebouncer&&((r=this.plugin.autoCommitDebouncer)==null||r.cancel(),this.plugin.autoCommitDebouncer=void 0,t=!0),t}clearAutoPull()
Line truncated
|
||||||
|
- ${a.map(o=>o.vaultPath).join(`
|
||||||
|
- `)}
|
||||||
|
Please remove them or add to .gitignore.`),!0}return!1}async writeAndOpenFile(t){t!==void 0&&await this.plugin.app.vault.adapter.write(Fs,t);let r=!1;this.plugin.app.workspace.iterateAllLeaves(n=>{n.getDisplayText()!=""&&Fs.startsWith(n.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(Fs,"/",!0)}openDiff({aFile:t,bFile:r,aRef:n,bRef:i,event:a}){var l,c;let s=this.plugin.settings.diffStyle;eo.Platform.isMobileApp&&(s="git_unified");let o={aFile:t,bFile:r!=null?r:t,aRef:n,bRef:i};s=="split"?(l=nn(this.plugin.app,a))==null||l.setViewState({type:ki.type,active:!0,state:o}):s=="git_unified"&&((c=nn(this.plugin.app,a))==null||c.setViewState({type:Ti.type,active:!0,state:o}))}async runRawCommand(){let t=this.plugin.gitManager;if(!(t instanceof Ee))return;let n=await new $e(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();n!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let i=new eo.Notice(`Running '${n}'...`,999999);try{let a=await t.rawCommand(n);a?(i.setMessage(a),window.setTimeout(()=>i.hide(),5e3)):i.hide()}catch(a){throw i.hide(),a}})}};g();g();g();g();var He;(function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"})(He||(He={}));var pC={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},mC={LINES:"lines",WORDS:"words",NONE:"none"},gC={WORD:"word",CHAR:"char"},Ta;(function(e){e.AUTO="auto",e.DARK="dark",e.LIGHT="light"})(Ta||(Ta={}));g();var Sj=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],Ej=RegExp("["+Sj.join("\\")+"]","g");function vC(e){return e.replace(Ej,"\\$&")}function g0(e){return e&&e.replace(/\\/g,"/")}function yC(e){let t,r,n,i=0;for(t=0,n=e.length;t<n;t++)r=e.charCodeAt(t),i=(i<<5)-i+r,i|=0;return i}function wC(e,t){let r=e.split(".");return r.length>1?r[r.length-1]:t}function bC(e,t){return t.reduce((r,n)=>r||e.startsWith(n),!1)}var _C=["a/","b/","i/","w/","c/","o/"];function Li(e,t,r){let n=r!==void 0?[..._C,r]:_C,i=t?new RegExp(`^${vC(t)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,a=""]=i.exec(e)||[],s=n.find(l=>a.indexOf(l)===0);return(s?a.slice(s.length):a).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function Aj(e,t){return Li(e,"---",t)}function kj(e,t){return Li(e,"+++",t)}function xC(e,t={}){let r=[],n=null,i=null,a=null,s=null,o=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,p=/^new mode (\d{6})/,m=/^deleted file mode (\d{6})/,v=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,x=/^rename from "?(.+)"?/,E=/^rename to "?(.+)"?/,_=/^similarity index (\d+)%/,k=/^dissimilarity index (\d+)%/,w=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,A=/^Binary files (.*) and (.*) differ/,S=/^GIT binary patch/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,P=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,I=/^new file mode (\d{6})/,N=/^deleted file mode (\d{6}),(\d{6})/,L=e.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,`
|
||||||
|
`).split(`
|
||||||
|
`);function ee(){i!==null&&n!==null&&(n.blocks.push(i),i=null)}function fe(){n!==null&&(!n.oldName&&l!==null&&(n.oldName=l),!n.newName&&c!==null&&(n.newName=c),n.newName&&(r.push(n),n=null)),l=null,c=null}function J(){ee(),fe(),n={blocks:[],deletedLines:0,addedLines:0}}function Q(z){ee();let Y;n!==null&&((Y=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(z))?(n.isCombined=!1,a=parseInt(Y[1],10),o=parseInt(Y[2],10)):(Y=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(z))?(n.isCombined=!0,a=parseInt(Y[1],10),s=parseInt(Y[2],10),o=parseInt(Y[3],10)):(z.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),a=0,o=0,n.isCombined=!1)),i={lines:[],oldStartLine:a,oldStartLine2:s,newStartLine:o,header:z}}function Pe(z){if(n===null||i===null||a===null||o===null)return;let Y={content:z},O=n.isCombined?["+ "," +","++"]:["+"],he=n.isCombined?["- "," -","--"]:["-"];bC(z,O)?(n.addedLines++,Y.type=He.INSERT,Y.oldNumber=void 0,Y.newNumber=o++):bC(z,he)?(n.deletedLines++,Y.type=He.DELETE,Y.oldNumber=a++,Y.newNumber=void 0):(Y.type=He.CONTEXT,Y.oldNumber=a++,Y.newNumber=o++),i.lines.push(Y)}function ge(z,Y){let O=Y;for(;O<L.length-3;){if(z.startsWith("diff"))return!1;if(L[O].startsWith(u)&&L[O+1].startsWith(f)&&L[O+2].startsWith(d))return!0;O++}return!1}return L.forEach((z,Y)=>{if(!z||z.startsWith("*"))return;let O,he=L[Y-1],ze=L[Y+1],gt=L[Y+2];if(z.startsWith("diff --git")||z.startsWith("diff --combined")){if(J(),(O=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(z))&&(l=Li(O[1],void 0,t.dstPrefix),c=Li(O[2],void 0,t.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isGitDiff=!0;return}if(z.startsWith("Binary files")&&!(n!=null&&n.isGitDiff)){if(J(),(O=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(z))&&(l=Li(O[1],void 0,t.dstPrefix),c=Li(O[2],void 0,t.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isBinary=!0;return}if((!n||!n.isGitDiff&&n&&z.startsWith(u)&&ze.startsWith(f)&>.startsWith(d))&&J(),n!=null&&n.isTooBig)return;if(n&&(typeof t.diffMaxChanges=="number"&&n.addedLines+n.deletedLines>t.diffMaxChanges||typeof t.diffMaxLineLength=="number"&&z.length>t.diffMaxLineLength)){n.isTooBig=!0,n.addedLines=0,n.deletedLines=0,n.blocks=[],i=null;let ct=typeof t.diffTooBigMessage=="function"?t.diffTooBigMessage(r.length):"Diff too big to be displayed";Q(ct);return}if(z.startsWith(u)&&ze.startsWith(f)||z.startsWith(f)&&he.startsWith(u)){if(n&&!n.oldName&&z.startsWith("--- ")&&(O=Aj(z,t.srcPrefix))){n.oldName=O,n.language=wC(n.oldName,n.language);return}if(n&&!n.newName&&z.startsWith("+++ ")&&(O=kj(z,t.dstPrefix))){n.newName=O,n.language=wC(n.newName,n.language);return}}if(n&&(z.startsWith(d)||n.isGitDiff&&n.oldName&&n.newName&&!i)){Q(z);return}if(i&&(z.startsWith("+")||z.startsWith("-")||z.startsWith(" "))){Pe(z);return}let Re=!ge(z,Y);if(n===null)throw new Error("Where is my file !!!");(O=h.exec(z))?n.oldMode=O[1]:(O=p.exec(z))?n.newMode=O[1]:(O=m.exec(z))?(n.deletedFileMode=O[1],n.isDeleted=!0):(O=v.exec(z))?(n.newFileMode=O[1],n.isNew=!0):(O=y.exec(z))?(Re&&(n.oldName=O[1]),n.isCopy=!0):(O=b.exec(z))?(Re&&(n.newName=O[1]),n.isCopy=!0):(O=x.exec(z))?(Re&&(n.oldName=O[1]),n.isRename=!0):(O=E.exec(z))?(Re&&(n.newName=O[1]),n.isRename=!0):(O=A.exec(z))?(n.isBinary=!0,n.oldName=Li(O[1],void 0,t.srcPrefix),n.newName=Li(O[2],void 0,t.dstPrefix),Q("Binary file")):S.test(z)?(n.isBinary=!0,Q(z)):(O=_.exec(z))?n.unchangedPercentage=parseInt(O[1],10):(O=k.exec(z))?n.changedPercentage=parseInt(O[1],10):(O=w.exec(z))?(n.checksumBefore=O[1],n.checksumAfter=O[2],O[3]&&(n.mode=O[3])):(O=T.exec(z))?(n.checksumBefore=[O[2],O[3]],n.checksumAfter=O[1]):(O=P.exec(z))?(n.oldMode=[O[2],O[3]],n.newMode=O[1]):(O=I.exec(z))?(n.newFileMode=O[1],n.isNew=!0):(O=N.exec(z))&&(n.deletedFileMode=O[1],n.isDeleted=!0)}),ee(),fe(),r}g();g();g();function Qn(){}Qn.prototype={diff:function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n.callback;typeof n=="function"&&(i=n,n={}),this.options=n;var a=this;function s(m){return i?(setTimeout(function(){i(void 0,m)},0),!0):m}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var o=r.length,l=t.length,c=1,u=o+l;n.maxEditLength&&(u=Math.min(u,n.maxEditLength));var f=[{newPos:-1,components:[]}],d=this.extractCommon(f[0],r,t,0);if(f[0].newPos+1>=o&&d+1>=l)return s([{value:this.join(r),count:r.length}]);function h(){for(var m=-1*c;m<=c;m+=2){var v=void 0,y=f[m-1],b=f[m+1],x=(b?b.newPos:0)-m;y&&(f[m-1]=void 0);var E=y&&y.newPos+1<o,_=b&&0<=x&&x<l;if(!E&&!_){f[m]=void 0;continue}if(!E||_&&y.newPos<b.newPos?(v=Pj(b),a.pushComponent(v.components,void 0,!0)):(v=y,v.newPos++,a.pushComponent(v.components,!0,void 0)),x=a.extractCommon(v,r,t,m),v.newPos+1>=o&&x+1>=l)return s(Cj(a,v.components,r,t,a.useLongestToken));f[m]=v}c++}if(i)(function m(){setTimeout(function(){if(c>u)return i();h()||m()},0)})();else for(;c<=u;){var p=h();if(p)return p}},pushCompon
Line truncated
|
||||||
|
`);return this.hoganUtils.render(PC,"wrapper",{colorScheme:io(this.config.colorScheme),filesNumber:t.length,files:r})}};g();var S0=Object.assign(Object.assign({},Ca),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),rc="generic",RC="line-by-line",Uj="icon",Gj="tag",nc=class{constructor(t,r={}){this.hoganUtils=t,this.config=Object.assign(Object.assign({},S0),r)}render(t){let r=t.map(n=>{let i;return n.blocks.length?i=this.generateFileHtml(n):i=this.generateEmptyDiff(),this.makeFileDiffHtml(n,i)}).join(`
|
||||||
|
`);return this.hoganUtils.render(rc,"wrapper",{colorScheme:io(this.config.colorScheme),content:r})}makeFileDiffHtml(t,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(t.blocks)&&t.blocks.length===0)return"";let n=this.hoganUtils.template(RC,"file-diff"),i=this.hoganUtils.template(rc,"file-path"),a=this.hoganUtils.template(Uj,"file"),s=this.hoganUtils.template(Gj,so(t));return n.render({file:t,fileHtmlId:ao(t),diffs:r,filePath:i.render({fileDiffName:Pa(t)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return this.hoganUtils.render(rc,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Tt})}generateFileHtml(t){let r=ro(to(n=>jr(n.content,t.isCombined).content));return t.blocks.map(n=>{let i=this.hoganUtils.render(rc,"block-header",{CSSLineClass:Tt,blockHeader:t.isTooBig?n.header:Di(n.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(n).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(t,t.isCombined,l,c);i+=u,i+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=jr(l.content,t.isCombined);i+=this.generateSingleLineHtml(t,{type:Tt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(t,t.isCombined,s,o);i+=l,i+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).join(`
|
||||||
|
`)}applyLineGroupping(t){let r=[],n=[],i=[];for(let a=0;a<t.lines.length;a++){let s=t.lines[a];(s.type!==He.INSERT&&i.length||s.type===He.CONTEXT&&n.length>0)&&(r.push([[],n,i]),n=[],i=[]),s.type===He.CONTEXT?r.push([[s],[],[]]):s.type===He.INSERT&&n.length===0?r.push([[],[],[s]]):s.type===He.INSERT&&n.length>0?i.push(s):s.type===He.DELETE&&n.push(s)}return(n.length||i.length)&&(r.push([[],n,i]),n=[],i=[]),r}applyRematchMatching(t,r,n){let i=t.length*r.length,a=Math.max.apply(null,[0].concat(t.concat(r).map(o=>o.content.length)));return i<this.config.matchingMaxComparisons&&a<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(t,r):[[t,r]]}processChangedLines(t,r,n,i){let a={right:"",left:""},s=Math.max(n.length,i.length);for(let o=0;o<s;o++){let l=n[o],c=i[o],u=l!==void 0&&c!==void 0?fd(l.content,c.content,r,this.config):void 0,f=l!==void 0&&l.oldNumber!==void 0?Object.assign(Object.assign({},u!==void 0?{prefix:u.oldLine.prefix,content:u.oldLine.content,type:Tt.DELETE_CHANGES}:Object.assign(Object.assign({},jr(l.content,r)),{type:no(l.type)})),{oldNumber:l.oldNumber,newNumber:l.newNumber}):void 0,d=c!==void 0&&c.newNumber!==void 0?Object.assign(Object.assign({},u!==void 0?{prefix:u.newLine.prefix,content:u.newLine.content,type:Tt.INSERT_CHANGES}:Object.assign(Object.assign({},jr(c.content,r)),{type:no(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,{left:h,right:p}=this.generateLineHtml(t,f,d);a.left+=h,a.right+=p}return a}generateLineHtml(t,r,n){return{left:this.generateSingleLineHtml(t,r),right:this.generateSingleLineHtml(t,n)}}generateSingleLineHtml(t,r){if(r===void 0)return"";let n=this.hoganUtils.render(RC,"numbers",{oldNumber:r.oldNumber||"",newNumber:r.newNumber||""});return this.hoganUtils.render(rc,"line",{type:r.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:r.prefix===" "?" ":r.prefix,content:r.content,lineNumber:n,line:r,file:t})}};g();var E0=Object.assign(Object.assign({},Ca),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),ic="generic",zj="side-by-side",Vj="icon",Wj="tag",ac=class{constructor(t,r={}){this.hoganUtils=t,this.config=Object.assign(Object.assign({},E0),r)}render(t){let r=t.map(n=>{let i;return n.blocks.length?i=this.generateFileHtml(n):i=this.generateEmptyDiff(),this.makeFileDiffHtml(n,i)}).join(`
|
||||||
|
`);return this.hoganUtils.render(ic,"wrapper",{colorScheme:io(this.config.colorScheme),content:r})}makeFileDiffHtml(t,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(t.blocks)&&t.blocks.length===0)return"";let n=this.hoganUtils.template(zj,"file-diff"),i=this.hoganUtils.template(ic,"file-path"),a=this.hoganUtils.template(Vj,"file"),s=this.hoganUtils.template(Wj,so(t));return n.render({file:t,fileHtmlId:ao(t),diffs:r,filePath:i.render({fileDiffName:Pa(t)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(ic,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Tt})}}generateFileHtml(t){let r=ro(to(n=>jr(n.content,t.isCombined).content));return t.blocks.map(n=>{let i={left:this.makeHeaderHtml(n.header,t),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(t.isCombined,l,c);i.left+=u,i.right+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=jr(l.content,t.isCombined),{left:f,right:d}=this.generateLineHtml({type:Tt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Tt.CONTEXT,prefix:c,content:u,number:l.newNumber});i.left+=f,i.right+=d});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(t.isCombined,s,o);i.left+=l,i.right+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).reduce((n,i)=>({left:n.left+i.left,right:n.right+i.right}),{left:"",right:""})}applyLineGroupping(t){let r=[],n=[],i=[];for(let a=0;a<t.lines.length;a++){let s=t.lines[a];(s.type!==He.INSERT&&i.length||s.type===He.CONTEXT&&n.length>0)&&(r.push([[],n,i]),n=[],i=[]),s.type===He.CONTEXT?r.push([[s],[],[]]):s.type===He.INSERT&&n.length===0?r.push([[],[],[s]]):s.type===He.INSERT&&n.length>0?i.push(s):s.type===He.DELETE&&n.push(s)}return(n.length||i.length)&&(r.push([[],n,i]),n=[],i=[]),r}applyRematchMatching(t,r,n){let i=t.length*r.length,a=Math.max.apply(null,[0].concat(t.concat(r).map(o=>o.content.length)));return i<this.config.matchingMaxComparisons&&a<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(t,r):[[t,r]]}makeHeaderHtml(t,r){return this.hoganUtils.render(ic,"block-header",{CSSLineClass:Tt,blockHeader:r!=null&&r.isTooBig?t:Di(t),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(t,r,n){let i={right:"",left:""},a=Math.max(r.length,n.length);for(let s=0;s<a;s++){let o=r[s],l=n[s],c=o!==void 0&&l!==void 0?fd(o.content,l.content,t,this.config):void 0,u=o!==void 0&&o.oldNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.oldLine.prefix,content:c.oldLine.content,type:Tt.DELETE_CHANGES}:Object.assign(Object.assign({},jr(o.content,t)),{type:no(o.type)})),{number:o.oldNumber}):void 0,f=l!==void 0&&l.newNumber!==void 0?Object.assign(Object.assign({},c!==void 0?{prefix:c.newLine.prefix,content:c.newLine.content,type:Tt.INSERT_CHANGES}:Object.assign(Object.assign({},jr(l.content,t)),{type:no(l.type)})),{number:l.newNumber}):void 0,{left:d,right:h}=this.generateLineHtml(u,f);i.left+=d,i.right+=h}return i}generateLineHtml(t,r){return{left:this.generateSingleHtml(t),right:this.generateSingleHtml(r)}}generateSingleHtml(t){let r="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(ic,"line",{type:(t==null?void 0:t.type)||`${Tt.CONTEXT} d2h-emptyplaceholder`,lineClass:t!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,contentClass:t!==void 0?n:`${n} d2h-code-side-emptyplaceholder`,prefix:(t==null?void 0:t.prefix)===" "?" ":t==null?void 0:t.prefix,content:t==null?void 0:t.content,lineNumber:t==null?void 0:t.number})}};g();var C0=Ve(T0());g();var ut=Ve(T0()),st={};st["file-summary-line"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<li class="d2h-file-list-line">'),n.b(`
|
||||||
|
`+r),n.b(' <span class="d2h-file-name-wrapper">'),n.b(`
|
||||||
|
`+r),n.b(n.rp("<fileIcon0",e,t," ")),n.b(' <a href="#'),n.b(n.v(n.f("fileHtmlId",e,t,0))),n.b('" class="d2h-file-name">'),n.b(n.v(n.f("fileName",e,t,0))),n.b("</a>"),n.b(`
|
||||||
|
`+r),n.b(' <span class="d2h-file-stats">'),n.b(`
|
||||||
|
`+r),n.b(' <span class="d2h-lines-added">'),n.b(n.v(n.f("addedLines",e,t,0))),n.b("</span>"),n.b(`
|
||||||
|
`+r),n.b(' <span class="d2h-lines-deleted">'),n.b(n.v(n.f("deletedLines",e,t,0))),n.b("</span>"),n.b(`
|
||||||
|
`+r),n.b(" </span>"),n.b(`
|
||||||
|
`+r),n.b(" </span>"),n.b(`
|
||||||
|
`+r),n.b("</li>"),n.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}}},subs:{}});st["file-summary-wrapper"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<div class="d2h-file-list-wrapper '),n.b(n.v(n.f("colorScheme",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-file-list-header">'),n.b(`
|
||||||
|
`+r),n.b(' <span class="d2h-file-list-title">Files changed ('),n.b(n.v(n.f("filesNumber",e,t,0))),n.b(")</span>"),n.b(`
|
||||||
|
`+r),n.b(' <a class="d2h-file-switch d2h-hide">hide</a>'),n.b(`
|
||||||
|
`+r),n.b(' <a class="d2h-file-switch d2h-show">show</a>'),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(' <ol class="d2h-file-list">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.f("files",e,t,0))),n.b(`
|
||||||
|
`+r),n.b(" </ol>"),n.b(`
|
||||||
|
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});st["generic-block-header"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b("<tr>"),n.b(`
|
||||||
|
`+r),n.b(' <td class="'),n.b(n.v(n.f("lineClass",e,t,0))),n.b(" "),n.b(n.v(n.d("CSSLineClass.INFO",e,t,0))),n.b('"></td>'),n.b(`
|
||||||
|
`+r),n.b(' <td class="'),n.b(n.v(n.d("CSSLineClass.INFO",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",e,t,0))),n.b('">'),n.s(n.f("blockHeader",e,t,1),e,t,0,156,173,"{{ }}")&&(n.rs(e,t,function(i,a,s){s.b(s.t(s.f("blockHeader",i,a,0)))}),e.pop()),n.s(n.f("blockHeader",e,t,1),e,t,1,0,0,"")||n.b(" "),n.b("</div>"),n.b(`
|
||||||
|
`+r),n.b(" </td>"),n.b(`
|
||||||
|
`+r),n.b("</tr>"),n.fl()},partials:{},subs:{}});st["generic-empty-diff"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b("<tr>"),n.b(`
|
||||||
|
`+r),n.b(' <td class="'),n.b(n.v(n.d("CSSLineClass.INFO",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(" File without changes"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(" </td>"),n.b(`
|
||||||
|
`+r),n.b("</tr>"),n.fl()},partials:{},subs:{}});st["generic-file-path"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-file-name-wrapper">'),n.b(`
|
||||||
|
`+r),n.b(n.rp("<fileIcon0",e,t," ")),n.b(' <span class="d2h-file-name">'),n.b(n.v(n.f("fileDiffName",e,t,0))),n.b("</span>"),n.b(`
|
||||||
|
`+r),n.b(n.rp("<fileTag1",e,t," ")),n.b("</span>"),n.b(`
|
||||||
|
`+r),n.b('<label class="d2h-file-collapse">'),n.b(`
|
||||||
|
`+r),n.b(' <input class="d2h-file-collapse-input" type="checkbox" name="viewed" value="viewed">'),n.b(`
|
||||||
|
`+r),n.b(" Viewed"),n.b(`
|
||||||
|
`+r),n.b("</label>"),n.fl()},partials:{"<fileIcon0":{name:"fileIcon",partials:{},subs:{}},"<fileTag1":{name:"fileTag",partials:{},subs:{}}},subs:{}});st["generic-line"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b("<tr>"),n.b(`
|
||||||
|
`+r),n.b(' <td class="'),n.b(n.v(n.f("lineClass",e,t,0))),n.b(" "),n.b(n.v(n.f("type",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.f("lineNumber",e,t,0))),n.b(`
|
||||||
|
`+r),n.b(" </td>"),n.b(`
|
||||||
|
`+r),n.b(' <td class="'),n.b(n.v(n.f("type",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.s(n.f("prefix",e,t,1),e,t,0,162,238,"{{ }}")&&(n.rs(e,t,function(i,a,s){s.b(' <span class="d2h-code-line-prefix">'),s.b(s.t(s.f("prefix",i,a,0))),s.b("</span>"),s.b(`
|
||||||
|
`+r)}),e.pop()),n.s(n.f("prefix",e,t,1),e,t,1,0,0,"")||(n.b(' <span class="d2h-code-line-prefix"> </span>'),n.b(`
|
||||||
|
`+r)),n.s(n.f("content",e,t,1),e,t,0,371,445,"{{ }}")&&(n.rs(e,t,function(i,a,s){s.b(' <span class="d2h-code-line-ctn">'),s.b(s.t(s.f("content",i,a,0))),s.b("</span>"),s.b(`
|
||||||
|
`+r)}),e.pop()),n.s(n.f("content",e,t,1),e,t,1,0,0,"")||(n.b(' <span class="d2h-code-line-ctn"><br></span>'),n.b(`
|
||||||
|
`+r)),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(" </td>"),n.b(`
|
||||||
|
`+r),n.b("</tr>"),n.fl()},partials:{},subs:{}});st["generic-wrapper"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<div class="d2h-wrapper '),n.b(n.v(n.f("colorScheme",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.f("content",e,t,0))),n.b(`
|
||||||
|
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});st["icon-file-added"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-added" height="16" title="added" version="1.1" viewBox="0 0 14 16"'),n.b(`
|
||||||
|
`+r),n.b(' width="14">'),n.b(`
|
||||||
|
`+r),n.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM6 9H3V7h3V4h2v3h3v2H8v3H6V9z"></path>'),n.b(`
|
||||||
|
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});st["icon-file-changed"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-changed" height="16" title="modified" version="1.1"'),n.b(`
|
||||||
|
`+r),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
|
||||||
|
`+r),n.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM4 8c0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3-3-1.34-3-3z"></path>'),n.b(`
|
||||||
|
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});st["icon-file-deleted"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-deleted" height="16" title="removed" version="1.1"'),n.b(`
|
||||||
|
`+r),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
|
||||||
|
`+r),n.b(' <path d="M13 1H1C0.45 1 0 1.45 0 2v12c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1V2c0-0.55-0.45-1-1-1z m0 13H1V2h12v12zM11 9H3V7h8v2z"></path>'),n.b(`
|
||||||
|
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});st["icon-file-renamed"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon d2h-moved" height="16" title="renamed" version="1.1"'),n.b(`
|
||||||
|
`+r),n.b(' viewBox="0 0 14 16" width="14">'),n.b(`
|
||||||
|
`+r),n.b(' <path d="M6 9H3V7h3V4l5 4-5 4V9z m8-7v12c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h12c0.55 0 1 0.45 1 1z m-1 0H1v12h12V2z"></path>'),n.b(`
|
||||||
|
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});st["icon-file"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<svg aria-hidden="true" class="d2h-icon" height="16" version="1.1" viewBox="0 0 12 16" width="12">'),n.b(`
|
||||||
|
`+r),n.b(' <path d="M6 5H2v-1h4v1zM2 8h7v-1H2v1z m0 2h7v-1H2v1z m0 2h7v-1H2v1z m10-7.5v9.5c0 0.55-0.45 1-1 1H1c-0.55 0-1-0.45-1-1V2c0-0.55 0.45-1 1-1h7.5l3.5 3.5z m-1 0.5L8 2H1v12h10V5z"></path>'),n.b(`
|
||||||
|
`+r),n.b("</svg>"),n.fl()},partials:{},subs:{}});st["line-by-line-file-diff"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",e,t,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-file-header">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.f("filePath",e,t,0))),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-file-diff">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-code-wrapper">'),n.b(`
|
||||||
|
`+r),n.b(' <table class="d2h-diff-table">'),n.b(`
|
||||||
|
`+r),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.f("diffs",e,t,0))),n.b(`
|
||||||
|
`+r),n.b(" </tbody>"),n.b(`
|
||||||
|
`+r),n.b(" </table>"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});st["line-by-line-numbers"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<div class="line-num1">'),n.b(n.v(n.f("oldNumber",e,t,0))),n.b("</div>"),n.b(`
|
||||||
|
`+r),n.b('<div class="line-num2">'),n.b(n.v(n.f("newNumber",e,t,0))),n.b("</div>"),n.fl()},partials:{},subs:{}});st["side-by-side-file-diff"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",e,t,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",e,t,0))),n.b('">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-file-header">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.f("filePath",e,t,0))),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-files-diff">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-file-side-diff">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-code-wrapper">'),n.b(`
|
||||||
|
`+r),n.b(' <table class="d2h-diff-table">'),n.b(`
|
||||||
|
`+r),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.d("diffs.left",e,t,0))),n.b(`
|
||||||
|
`+r),n.b(" </tbody>"),n.b(`
|
||||||
|
`+r),n.b(" </table>"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-file-side-diff">'),n.b(`
|
||||||
|
`+r),n.b(' <div class="d2h-code-wrapper">'),n.b(`
|
||||||
|
`+r),n.b(' <table class="d2h-diff-table">'),n.b(`
|
||||||
|
`+r),n.b(' <tbody class="d2h-diff-tbody">'),n.b(`
|
||||||
|
`+r),n.b(" "),n.b(n.t(n.d("diffs.right",e,t,0))),n.b(`
|
||||||
|
`+r),n.b(" </tbody>"),n.b(`
|
||||||
|
`+r),n.b(" </table>"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b(" </div>"),n.b(`
|
||||||
|
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});st["tag-file-added"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),n.fl()},partials:{},subs:{}});st["tag-file-changed"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),n.fl()},partials:{},subs:{}});st["tag-file-deleted"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),n.fl()},partials:{},subs:{}});st["tag-file-renamed"]=new ut.Template({code:function(e,t,r){var n=this;return n.b(r=r||""),n.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),n.fl()},partials:{},subs:{}});var sc=class{constructor({compiledTemplates:t={},rawTemplates:r={}}){let n=Object.entries(r).reduce((i,[a,s])=>{let o=C0.compile(s,{asString:!1});return Object.assign(Object.assign({},i),{[a]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},st),t),n)}static compile(t){return C0.compile(t,{asString:!1})}render(t,r,n,i,a){let s=this.templateKey(t,r);try{return this.preCompiledTemplates[s].render(n,i,a)}catch(o){throw new Error(`Could not find template to render '${s}'`)}}template(t,r){return this.preCompiledTemplates[this.templateKey(t,r)]}templateKey(t,r){return`${t}-${r}`}};var Yj=Object.assign(Object.assign(Object.assign({},S0),E0),{outputFormat:pC.LINE_BY_LINE,drawFileList:!0});function FC(e,t={}){let r=Object.assign(Object.assign({},Yj),t),n=typeof e=="string"?xC(e,r):e,i=new sc(r),{colorScheme:a}=r,s={colorScheme:a},o=r.drawFileList?new dd(i,s).render(n):"",l=r.outputFormat==="side-by-side"?new ac(i,r).render(n):new nc(i,r).render(n);return o+l}var pd=require("obsidian");var Ra=class extends pd.ItemView{constructor(r,n){super(r);this.plugin=n;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return Ti.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let n=this.state.bFile.split("/").last();return n!=null&&n.endsWith(".md")&&(n=n.slice(0,-3)),`Diff: ${n}`}return Ti.name}getIcon(){return Ti.icon}async setState(r,n){this.state=r,pd.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await this.refresh()}getState(){return this.state}onClose(){return this.app.workspace.offref(this.gitRefreshRef),this.app.workspace.offref(this.gitViewRefreshRef),super.onClose()}async onOpen(){return await this.refresh(),super.onOpen()}async refresh(){var r;if((r=this.state)!=null&&r.bFile&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let n=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let i=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!n){if(this.plugin.gitManager instanceof Ee&&await this.plugin.gitManager.isTracked(this.state.bFile))n=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(`
|
||||||
|
`);else if(await this.app.vault.adapter.exists(i)){let a=await this.app.vault.adapter.read(i);n=[...`--- /dev/null
|
||||||
|
+++ ${this.state.bFile}
|
||||||
|
@@ -0,0 +1,${a.split(`
|
||||||
|
`).length} @@`.split(`
|
||||||
|
`),...a.split(`
|
||||||
|
`).map(o=>`+${o}`)].join(`
|
||||||
|
`)}}if(n){let a=this.parser.parseFromString(FC(n),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(a)}else{let a=this.contentEl.createDiv({cls:"obsidian-git-center"});a.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),a.createEl("br"),a.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};g();var ho=require("obsidian");var po=require("@codemirror/commands");g();var Me=require("@codemirror/view"),Ae=require("@codemirror/state");g();var P0="\u037C",$C=typeof Symbol=="undefined"?"__"+P0:Symbol.for(P0),R0=typeof Symbol=="undefined"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),LC=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{},md=class{constructor(t,r){this.rules=[];let{finish:n}=r||{};function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function a(s,o,l,c){let u=[],f=/^@(\w+)\b/.exec(s[0]),d=f&&f[1]=="keyframes";if(f&&o==null)return l.push(s[0]+";");for(let h in o){let p=o[h];if(/&/.test(h))a(h.split(/,\s*/).map(m=>s.map(v=>m.replace(/&/,v))).reduce((m,v)=>m.concat(v)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");a(i(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((n&&!f&&!c?s.map(n):s).join(", ")+" {"+u.join(" ")+"}")}for(let s in t)a(i(s),t[s],this.rules)}getRules(){return this.rules.join(`
|
||||||
|
`)}static newName(){let t=LC[$C]||1;return LC[$C]=t+1,P0+t.toString(36)}static mount(t,r,n){let i=t[R0],a=n&&n.nonce;i?a&&i.setNonce(a):i=new M0(t,a),i.mount(Array.isArray(r)?r:[r],t)}},DC=new Map,M0=class{constructor(t,r){let n=t.ownerDocument||t,i=n.defaultView;if(!t.head&&t.adoptedStyleSheets&&i.CSSStyleSheet){let a=DC.get(n);if(a)return t[R0]=a;this.sheet=new i.CSSStyleSheet,DC.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],t[R0]=this}mount(t,r){let n=this.sheet,i=0,a=0;for(let s=0;s<t.length;s++){let o=t[s],l=this.modules.indexOf(o);if(l<a&&l>-1&&(this.modules.splice(l,1),a--,l=-1),l==-1){if(this.modules.splice(a++,0,o),n)for(let c=0;c<o.rules.length;c++)n.insertRule(o.rules[c],i++)}else{for(;a<l;)i+=this.modules[a++].rules.length;i+=o.rules.length,a++}}if(n)r.adoptedStyleSheets.indexOf(this.sheet)<0&&(r.adoptedStyleSheets=[this.sheet,...r.adoptedStyleSheets]);else{let s="";for(let l=0;l<this.modules.length;l++)s+=this.modules[l].getRules()+`
|
||||||
|
`;this.styleTag.textContent=s;let o=r.head||r;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}};var t3=require("@codemirror/language"),Xj=require("@lezer/highlight"),ft=class e{constructor(t,r,n,i){this.fromA=t,this.toA=r,this.fromB=n,this.toB=i}offset(t,r=t){return new e(this.fromA+t,this.toA+t,this.fromB+r,this.toB+r)}};function Oa(e,t,r,n,i,a){if(e==n)return[];let s=N0(e,t,r,n,i,a),o=B0(e,t+s,r,n,i+s,a);t+=s,r-=o,i+=s,a-=o;let l=r-t,c=a-i;if(!l||!c)return[new ft(t,r,i,a)];if(l>c){let f=e.slice(t,r).indexOf(n.slice(i,a));if(f>-1)return[new ft(t,t+f,i,i),new ft(t+f+c,r,a,a)]}else if(c>l){let f=n.slice(i,a).indexOf(e.slice(t,r));if(f>-1)return[new ft(t,t,i,i+f),new ft(r,r,i+f+l,a)]}if(l==1||c==1)return[new ft(t,r,i,a)];let u=n3(e,t,r,n,i,a);if(u){let[f,d,h]=u;return Oa(e,t,f,n,i,d).concat(Oa(e,f+h,r,n,d+h,a))}return Zj(e,t,r,n,i,a)}var oc=1e9;function Zj(e,t,r,n,i,a){let s=r-t,o=a-i;if(oc<1e9&&Math.min(s,o)>oc*16)return Math.min(s,o)>oc*64?[new ft(t,r,i,a)]:NC(e,t,r,n,i,a);let l=Math.ceil((s+o)/2);O0.reset(l),I0.reset(l);let c=(h,p)=>e.charCodeAt(t+h)==n.charCodeAt(i+p),u=(h,p)=>e.charCodeAt(r-h-1)==n.charCodeAt(a-p-1),f=(s-o)%2!=0?I0:null,d=f?null:O0;for(let h=0;h<l;h++){if(h>oc)return NC(e,t,r,n,i,a);let p=O0.advance(h,s,o,l,f,!1,c)||I0.advance(h,s,o,l,d,!0,u);if(p)return Kj(e,t,r,t+p[0],n,i,a,i+p[1])}return[new ft(t,r,i,a)]}var bd=class{constructor(){this.vec=[]}reset(t){this.len=t<<1;for(let r=0;r<this.len;r++)this.vec[r]=-1;this.vec[t+1]=0,this.start=this.end=0}advance(t,r,n,i,a,s,o){for(let l=-t+this.start;l<=t-this.end;l+=2){let c=i+l,u=l==-t||l!=t&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,f=u-l;for(;u<r&&f<n&&o(u,f);)u++,f++;if(this.vec[c]=u,u>r)this.end+=2;else if(f>n)this.start+=2;else if(a){let d=i+(r-n)-l;if(d>=0&&d<this.len&&a.vec[d]!=-1)if(s){let h=a.vec[d];if(h>=r-u)return[h,i+h-d]}else{let h=r-a.vec[d];if(u>=h)return[u,f]}}}return null}},O0=new bd,I0=new bd;function Kj(e,t,r,n,i,a,s,o){let l=!1;return!co(e,n)&&++n==r&&(l=!0),!co(i,o)&&++o==s&&(l=!0),l?[new ft(t,r,a,s)]:Oa(e,t,n,i,a,o).concat(Oa(e,n,r,i,o,s))}function r3(e,t){let r=1,n=Math.min(e,t);for(;r<n;)r=r<<1;return r}function N0(e,t,r,n,i,a){if(t==r||t==a||e.charCodeAt(t)!=n.charCodeAt(i))return 0;let s=r3(r-t,a-i);for(let o=t,l=i;;){let c=o+s,u=l+s;if(c>r||u>a||e.slice(o,c)!=n.slice(l,u)){if(s==1)return o-t-(co(e,o)?0:1);s=s>>1}else{if(c==r||u==a)return c-t;o=c,l=u}}}function B0(e,t,r,n,i,a){if(t==r||i==a||e.charCodeAt(r-1)!=n.charCodeAt(a-1))return 0;let s=r3(r-t,a-i);for(let o=r,l=a;;){let c=o-s,u=l-s;if(c<t||u<i||e.slice(c,o)!=n.slice(u,l)){if(s==1)return r-o-(co(e,o)?0:1);s=s>>1}else{if(c==t||u==i)return r-c;o=c,l=u}}}function F0(e,t,r,n,i,a,s,o){let l=n.slice(i,a),c=null;for(;;){if(c||s<o)return c;for(let u=t+s;;){co(e,u)||u++;let f=u+s;if(co(e,f)||(f+=f==u+1?1:-1),f>=r)break;let d=e.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let p=N0(e,f,r,n,i+h+d.length,a),m=B0(e,t,u,n,i,i+h),v=d.length+p+m;(!c||c[2]<v)&&(c=[u-m,i+h-m,v])}u=f}if(o<0)return c;s=s>>1}}function n3(e,t,r,n,i,a){let s=r-t,o=a-i;if(s<o){let l=n3(n,i,a,e,t,r);return l&&[l[1],l[0],l[2]]}return s<4||o*2<s?null:F0(e,t,r,n,i,a,Math.floor(s/4),-1)}function NC(e,t,r,n,i,a){let s=r-t,o=a-i,l;if(s<o){let d=F0(n,i,a,e,t,r,Math.floor(s/6),50);l=d&&[d[1],d[0],d[2]]}else l=F0(e,t,r,n,i,a,Math.floor(o/6),50);if(!l)return[new ft(t,r,i,a)];let[c,u,f]=l;return Oa(e,t,c,n,i,u).concat(Oa(e,c+f,r,n,u+f,a))}function i3(e,t){for(let r=1;r<e.length;r++){let n=e[r-1],i=e[r];n.toA>i.fromA-t&&n.toB>i.fromB-t&&(e[r-1]=new ft(n.fromA,i.toA,n.fromB,i.toB),e.splice(r--,1))}}function Jj(e,t,r){for(;;){i3(r,1);let n=!1;for(let i=0;i<r.length;i++){let a=r[i],s,o;(s=N0(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=r[i]=new ft(a.fromA+s,a.toA,a.fromB+s,a.toB)),(o=B0(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=r[i]=new ft(a.fromA,a.toA-o,a.fromB,a.toB-o));let l=a.toA-a.fromA,c=a.toB-a.fromB;if(l&&c)continue;let u=a.fromA-(i?r[i-1].toA:0),f=(i<r.length-1?r[i+1].fromA:e.length)-a.toA;if(!u||!f)continue;let d=l?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=d.length&&e.slice(a.fromA-u,a.fromA)==d.slice(d.length-u)?(r[i]=new ft(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),n=!0):f<=d.length&&e.slice(a.toA,a.toA+f)==d.slice(0,f)&&(r[i]=new ft(a.fromA+f,a.toA+f,a.fromB+f,a.toB+f),n=!0)}if(!n)break}return r}function Qj(e,t,r){for(let n=0,i=0;i<e.length;i++){let a=e[i],s=a.toA-a.fromA,o=a.toB-a.fromB;if(s&&o||s>3||o>3){let l=i==e.length-1?t.length:e[i+1].fromA,c=a.fromA-n,u=l-a.toA,f=jC(t,a.fromA,Math.min(c,5)),d=BC(t,a.toA,Math.min(u,5)),h=a.fromA-f,p=d-a.toA;if(!s||!o){let m=Math.max(s,o),[v,y,b]=s?[t,a.fromA,a.toA]:[r,a.fromB,a.toB];h&&p&&(m>h&&t.slice(f,a.fromA)==v.slice(b-h,b)?(a=e[i]=new ft(f,f+s,a.fromB-h,a.toB-h),f=a.fromA,d=BC(t,a.toA,Math.min(l-a.toA,5))):m>p&&t.slice(a.toA,d)==v.slice(y,y+p)&&(a=e[i]=new ft(d-s,d,a.fromB+p,a.toB+p),d=a.toA,f=jC(t,a.fromA,Math.min(a.fro
Line truncated
|
||||||
|
A derived value cannot reference itself recursively
|
||||||
|
https://svelte.dev/e/derived_references_self`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/derived_references_self")}function w3(e){if(G){let t=new Error(`effect_in_teardown
|
||||||
|
\`${e}\` cannot be used inside an effect cleanup function
|
||||||
|
https://svelte.dev/e/effect_in_teardown`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function b3(){if(G){let e=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function _3(e){if(G){let t=new Error(`effect_orphan
|
||||||
|
\`${e}\` can only be used inside an effect (e.g. during component initialisation)
|
||||||
|
https://svelte.dev/e/effect_orphan`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_orphan")}function x3(){if(G){let e=new Error(`effect_update_depth_exceeded
|
||||||
|
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
|
||||||
|
https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function S3(){if(G){let e=new Error(`hydration_failed
|
||||||
|
Failed to hydrate the application
|
||||||
|
https://svelte.dev/e/hydration_failed`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/hydration_failed")}function E3(e){if(G){let t=new Error(`props_invalid_value
|
||||||
|
Cannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value
|
||||||
|
https://svelte.dev/e/props_invalid_value`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/props_invalid_value")}function A3(e){if(G){let t=new Error(`rune_outside_svelte
|
||||||
|
The \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
|
||||||
|
https://svelte.dev/e/rune_outside_svelte`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function k3(){if(G){let e=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function T3(){if(G){let e=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function C3(){if(G){let e=new Error("state_unsafe_local_read\nReading state that was created inside the same derived is forbidden. Consider using `untrack` to read locally created state\nhttps://svelte.dev/e/state_unsafe_local_read");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function P3(){if(G){let e=new Error("state_unsafe_mutation\nUpdating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}g();var ei=!1,ti=!1;g();g();g();var uc=null;function ri(e){let t=Error(),r=t.stack;if(r){let n=r.split(`
|
||||||
|
`),i=[`
|
||||||
|
`];for(let a=0;a<n.length;a++){let s=n[a];if(s!=="Error"){if(s.includes("validate_each_keys"))return null;s.includes("svelte/src/internal")||i.push(s)}}if(i.length===1)return null;It(t,"stack",{value:i.join(`
|
||||||
|
`)}),It(t,"name",{value:`${e}Error`})}return t}var Na=new Set;function Y0(e){Na=e}function ht(e,t){var r={f:0,v:e,reactions:null,equals:Td,version:0};return G&&ti&&(r.created=t!=null?t:ri("CreatedAt"),r.debug=null),r}function pt(e){return v7(ht(e))}function Bi(e,t=!1){var n,i;let r=ht(e);return t||(r.equals=go),ei&&pe!==null&&pe.l!==null&&((i=(n=pe.l).s)!=null?i:n.s=[]).push(r),r}function v7(e){return de!==null&&de.f&2&&(ln===null?O3([e]):ln.push(e)),e}function re(e,t){return de!==null&&ji()&&de.f&18&&(ln===null||!ln.includes(e))&&P3(),yo(e,t)}function yo(e,t){if(!e.equals(t)&&(e.v=t,e.version=Cd(),G&&ti&&(e.updated=ri("UpdatedAt")),M3(e,2048),ji()&&te!==null&&te.f&1024&&!(te.f&32)&&(Ct!==null&&Ct.includes(e)?(Zt(te,2048),wo(te)):ni===null?I3([e]):ni.push(e)),G&&Na.size>0)){let n=Array.from(Na);var r=ii;vo(!0);try{for(let i of n)i.f&1024&&Zt(i,4096),Hi(i)&&ja(i)}finally{vo(r)}Na.clear()}return t}function M3(e,t){var r=e.reactions;if(r!==null)for(var n=ji(),i=r.length,a=0;a<i;a++){var s=r[a],o=s.f;if(!(o&2048)&&!(!n&&s===te)){if(G&&o&262144){Na.add(s);continue}Zt(s,t),o&1280&&(o&2?M3(s,4096):wo(s))}}}g();g();g();var dc="font-weight: bold",hc="font-weight: normal";function F3(e,t,r){G?console.warn(`%c[svelte] hydration_attribute_changed
|
||||||
|
%cThe \`${e}\` attribute on \`${t}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value
|
||||||
|
https://svelte.dev/e/hydration_attribute_changed`,dc,hc):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function bo(e){G?console.warn(`%c[svelte] hydration_mismatch
|
||||||
|
%c${e?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${e}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
|
||||||
|
https://svelte.dev/e/hydration_mismatch`,dc,hc):console.warn("https://svelte.dev/e/hydration_mismatch")}function $3(){G?console.warn(`%c[svelte] lifecycle_double_unmount
|
||||||
|
%cTried to unmount a component that was not mounted
|
||||||
|
https://svelte.dev/e/lifecycle_double_unmount`,dc,hc):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function X0(e,t){G?console.warn(`%c[svelte] ownership_invalid_mutation
|
||||||
|
%c${e?`${e} mutated a value owned by ${t}. This is strongly discouraged. Consider passing values to child components with \`bind:\`, or use a callback instead`:"Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use a callback instead"}
|
||||||
|
https://svelte.dev/e/ownership_invalid_mutation`,dc,hc):console.warn("https://svelte.dev/e/ownership_invalid_mutation")}function Pd(e){G?console.warn(`%c[svelte] state_proxy_equality_mismatch
|
||||||
|
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${e}\` will produce unexpected results
|
||||||
|
https://svelte.dev/e/state_proxy_equality_mismatch`,dc,hc):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}var ae=!1;function or(e){ae=e}var ue;function tt(e){if(e===null)throw bo(),Ni;return ue=e}function Ft(){return tt($t(ue))}function B(e){if(ae){if($t(ue)!==null)throw bo(),Ni;ue=e}}function _o(e=1){if(ae){for(var t=e,r=ue;t--;)r=$t(r);ue=r}}function xo(){for(var e=0,t=ue;;){if(t.nodeType===8){var r=t.data;if(r===$a){if(e===0)return t;e-=1}else(r===mo||r===Fa)&&(e+=1)}var n=$t(t);t.remove(),t=n}}g();g();g();var y7={},w7=/at (?:.+ \()?(.+):(\d+):(\d+)\)?$/,b7=/@(.+):(\d+):(\d+)$/;function _7(){var r;let e=new Error().stack;if(!e)return null;let t=[];for(let n of e.split(`
|
||||||
|
`)){let i=(r=w7.exec(n))!=null?r:b7.exec(n);i&&t.push({file:i[1],line:+i[2],column:+i[3]})}return t}function L3(){var t;let e=(t=_7())==null?void 0:t.slice(4);if(!e)return null;for(let r=0;r<e.length;r++){let n=e[r],i=y7[n.file];if(!i){if(r===0)return null;continue}for(let a of i){if(a.end==null)return null;if(a.start.line<n.line&&a.end.line>n.line)return a.component}}return null}var x7=Symbol("ADD_OWNER");function Z0(e,t){if(t.owners!==null)for(;e;){if(e.owners===null){t.owners=null;break}for(let r of e.owners)t.owners.add(r);e=e.parent}}function D3(e,t){return e.owners===null?!0:e.owners.has(t)||e.parent!==null&&D3(e.parent,t)}function N3(e){var t,r;return(r=(t=e==null?void 0:e.owners)==null?void 0:t.values().next().value)!=null?r:N3(e.parent)}var S7=!1;function B3(e){if(S7)return;let t=L3();if(t&&!D3(e,t)){let r=N3(e);r[Yt]!==t[Yt]?X0(t[Yt],r[Yt]):X0()}}function xe(e,t=null,r){var c,u;var n=null;if(G&&ti&&(n=ri("CreatedAt")),typeof e!="object"||e===null||Sr in e)return e;let i=La(e);if(i!==U0&&i!==g3)return e;var a=new Map,s=on(e),o=ht(0);s&&a.set("length",ht(e.length,n));var l;if(G)if(l={parent:t,owners:null},r){let f=(u=(c=r.v)==null?void 0:c[Da])==null?void 0:u.owners;l.owners=f?new Set(f):null}else l.owners=t===null?pe!==null?new Set([pe.function]):null:new Set;return new Proxy(e,{defineProperty(f,d,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&k3();var p=a.get(d);return p===void 0?(p=ht(h.value,n),a.set(d,p)):re(p,xe(h.value,l)),!0},deleteProperty(f,d){var h=a.get(d);if(h===void 0)d in f&&a.set(d,ht(dt,n));else{if(s&&typeof d=="string"){var p=a.get("length"),m=Number(d);Number.isInteger(m)&&m<p.v&&re(p,m)}re(h,dt),j3(o)}return!0},get(f,d,h){var b;if(G&&d===Da)return l;if(d===Sr)return e;var p=a.get(d),m=d in f;if(p===void 0&&(!m||(b=Ur(f,d))!=null&&b.writable)&&(p=ht(xe(m?f[d]:dt,l),n),a.set(d,p)),p!==void 0){var v=R(p);if(G){var y=v==null?void 0:v[Da];y&&(y==null?void 0:y.parent)!==l&&Z0(l,y)}return v===dt?void 0:v}return Reflect.get(f,d,h)},getOwnPropertyDescriptor(f,d){var h=Reflect.getOwnPropertyDescriptor(f,d);if(h&&"value"in h){var p=a.get(d);p&&(h.value=R(p))}else if(h===void 0){var m=a.get(d),v=m==null?void 0:m.v;if(m!==void 0&&v!==dt)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return h},has(f,d){var v;if(G&&d===Da||d===Sr)return!0;var h=a.get(d),p=h!==void 0&&h.v!==dt||Reflect.has(f,d);if(h!==void 0||te!==null&&(!p||(v=Ur(f,d))!=null&&v.writable)){h===void 0&&(h=ht(p?xe(f[d],l):dt,n),a.set(d,h));var m=R(h);if(m===dt)return!1}return p},set(f,d,h,p){var w;var m=a.get(d),v=d in f;if(s&&d==="length")for(var y=h;y<m.v;y+=1){var b=a.get(y+"");b!==void 0?re(b,dt):y in f&&(b=ht(dt,n),a.set(y+"",b))}if(m===void 0?(!v||(w=Ur(f,d))!=null&&w.writable)&&(m=ht(void 0,n),re(m,xe(h,l)),a.set(d,m)):(v=m.v!==dt,re(m,xe(h,l))),G){var x=h==null?void 0:h[Da];x&&(x==null?void 0:x.parent)!==l&&Z0(l,x),B3(l)}var E=Reflect.getOwnPropertyDescriptor(f,d);if(E!=null&&E.set&&E.set.call(p,h),!v){if(s&&typeof d=="string"){var _=a.get("length"),k=Number(d);Number.isInteger(k)&&k>=_.v&&re(_,k+1)}j3(o)}return!0},ownKeys(f){R(o);var d=Reflect.ownKeys(f).filter(m=>{var v=a.get(m);return v===void 0||v.v!==dt});for(var[h,p]of a)p.v!==dt&&!(h in f)&&d.push(h);return d},setPrototypeOf(){T3()}})}function j3(e,t=1){re(e,e.v+t)}function Md(e){return e!==null&&typeof e=="object"&&Sr in e?e[Sr]:e}function H3(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t();let{indexOf:r,lastIndexOf:n,includes:i}=e;e.indexOf=function(a,s){let o=r.call(this,a,s);if(o===-1){for(let l=s!=null?s:0;l<this.length;l+=1)if(Md(this[l])===a){Pd("array.indexOf(...)");break}}return o},e.lastIndexOf=function(a,s){let o=n.call(this,a,s!=null?s:this.length-1);if(o===-1){for(let l=0;l<=(s!=null?s:this.length-1);l+=1)if(Md(this[l])===a){Pd("array.lastIndexOf(...)");break}}return o},e.includes=function(a,s){let o=i.call(this,a,s);if(!o){for(let l=0;l<this.length;l+=1)if(Md(this[l])===a){Pd("array.includes(...)");break}}return o},Array.__svelte_cleanup=()=>{e.indexOf=r,e.lastIndexOf=n,e.includes=i}}var K0,U3,G3,z3;function Od(){if(K0===void 0){K0=window,U3=document;var e=Element.prototype,t=Node.prototype;G3=Ur(t,"firstChild").get,z3=Ur(t,"nextSibling").get,e.__click=void 0,e.__className="",e.__attributes=null,e.__styles=null,e.__e=void 0,Text.prototype.__t=void 0,G&&(e.__svelte_meta=null,H3())}}function qr(e=""){return document.createTextNode(e)}function Pt(e){return G3.call(e)}function $t(e){return z3.call(e)}function j(e,t){if(!ae)return Pt(e);var r=Pt(ue);if(r===null)r=ue.appendChild(qr());else if(t&&r.nodeType!==3){var n=qr();return r==null||r.before(n),tt(n),n}return tt(r),r}function cr(e,t){var i,a;if(!ae){var r=Pt(e);return r instanceof Comment&&r.data===""?$t(r):r}if(t&&((i=ue)==null?void 0:i.nodeType)!==3){var n=qr();return(a=ue)==null||a.before(n),tt(n),n}return ue}function Z(e,t=1,r=!1){let n=ae?ue:e;for(var i;t--;)i=n,n=$t(n);if(!ae)return n;var a=n==null?void 0:n.nodeType;if(r&&a!==3){var s=qr();return n
Line truncated
|
||||||
|
\`${e}(...)\` can only be used during component initialisation
|
||||||
|
https://svelte.dev/e/lifecycle_outside_component`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}var aP=0,P7=1,eP=new WeakSet,Dd=!1,Nd=aP,gc=!1,Ao=null,ii=!1,$d=!1;function vo(e){ii=e}function iv(e){$d=e}var Ga=[],ko=0,vc=[],de=null;function Rt(e){de=e}var te=null;function ot(e){te=e}var ln=null;function O3(e){ln=e}var Ct=null,Ar=0,ni=null;function I3(e){ni=e}var sP=1,ai=!1,fc=null;var pe=null;var Wr=null;function Cd(){return++sP}function ji(){return!ei||pe!==null&&pe.l===null}function Hi(e){var s,o,l,c;var t=e.f;if(t&2048)return!0;if(t&4096){var r=e.deps,n=(t&256)!==0;if(r!==null){var i;if(t&512){for(i=0;i<r.length;i++)((o=(s=r[i]).reactions)!=null?o:s.reactions=[]).push(e);e.f^=512}for(i=0;i<r.length;i++){var a=r[i];if(Hi(a)&&nv(a),n&&te!==null&&!ai&&!((l=a==null?void 0:a.reactions)!=null&&l.includes(e))&&((c=a.reactions)!=null?c:a.reactions=[]).push(e),a.version>e.version)return!0}}(!n||te!==null&&!ai)&&Zt(e,1024)}return!1}function tP(e,t){for(var r=t;r!==null;){if(r.f&128)try{r.fn(e);return}catch(n){r.f^=128}r=r.parent}throw Dd=!1,e}function rP(e){return(e.f&16384)===0&&(e.parent===null||(e.parent.f&128)===0)}function To(e,t,r,n){var u,f;if(Dd){if(r===null&&(Dd=!1),rP(t))throw e;return}if(r!==null&&(Dd=!0),!G||n===null||!(e instanceof Error)||eP.has(e)){tP(e,t);return}eP.add(e);let i=[],a=(u=t.fn)==null?void 0:u.name;a&&i.push(a);let s=n;for(;s!==null;){if(G){var o=(f=s.function)==null?void 0:f[Yt];if(o){let d=o.split("/").pop();i.push(d)}}s=s.p}let l=/Firefox/.test(navigator.userAgent)?" ":" ";It(e,"message",{value:e.message+`
|
||||||
|
${i.map(d=>`
|
||||||
|
${l}in ${d}`).join("")}
|
||||||
|
`}),It(e,"component_stack",{value:i});let c=e.stack;if(c){let d=c.split(`
|
||||||
|
`),h=[];for(let p=0;p<d.length;p++){let m=d[p];m.includes("svelte/src/internal")||h.push(m)}It(e,"stack",{value:h.join(`
|
||||||
|
`)})}if(tP(e,t),rP(t))throw e}function Id(e){var d,h;var t=Ct,r=Ar,n=ni,i=de,a=ai,s=ln,o=pe,l=e.f;Ct=null,Ar=0,ni=null,de=l&96?null:e,ai=!ii&&(l&256)!==0,ln=null,pe=e.ctx;try{var c=(0,e.fn)(),u=e.deps;if(Ct!==null){var f;if(Ha(e,Ar),u!==null&&Ar>0)for(u.length=Ar+Ct.length,f=0;f<Ct.length;f++)u[Ar+f]=Ct[f];else e.deps=u=Ct;if(!ai)for(f=Ar;f<u.length;f++)((h=(d=u[f]).reactions)!=null?h:d.reactions=[]).push(e)}else u!==null&&Ar<u.length&&(Ha(e,Ar),u.length=Ar);return c}finally{Ct=t,Ar=r,ni=n,de=i,ai=a,ln=s,pe=o}}function R7(e,t){let r=t.reactions;if(r!==null){var n=r.indexOf(e);if(n!==-1){var i=r.length-1;i===0?r=t.reactions=null:(r[n]=r[i],r.pop())}}r===null&&t.f&2&&(Ct===null||!Ct.includes(t))&&(Zt(t,4096),t.f&768||(t.f^=512),Ha(t,0))}function Ha(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)R7(e,r[n])}function ja(e){var t=e.f;if(!(t&16384)){Zt(e,1024);var r=te,n=pe;if(te=e,G){var i=Wr;Wr=e.component_function}try{t&16?Y3(e):uv(e),cv(e),lv(e);var a=Id(e);e.teardown=typeof a=="function"?a:null,e.version=sP,G&&vc.push(e)}catch(s){To(s,e,r,n||e.ctx)}finally{te=r,G&&(Wr=i)}}}function nP(){console.error("Last ten effects were: ",vc.slice(-10).map(e=>e.fn)),vc=[]}function oP(){if(ko>1e3){ko=0;try{x3()}catch(e){if(G&&It(e,"stack",{value:""}),Ao!==null)if(G)try{To(e,Ao,null,null)}catch(t){throw nP(),t}else To(e,Ao,null,null);else throw G&&nP(),e}}ko++}function lP(e){var t=e.length;if(t!==0){oP();var r=ii;ii=!0;try{for(var n=0;n<t;n++){var i=e[n];i.f&1024||(i.f^=1024);var a=[];cP(i,a),M7(a)}}finally{ii=r}}}function M7(e){var t=e.length;if(t!==0)for(var r=0;r<t;r++){var n=e[r];if(!(n.f&24576))try{Hi(n)&&(ja(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?fv(n):n.fn=null))}catch(i){To(i,n,null,n.ctx)}}}function O7(){if(gc=!1,ko>1001)return;let e=Ga;Ga=[],lP(e),gc||(ko=0,Ao=null,G&&(vc=[]))}function wo(e){Nd===aP&&(gc||(gc=!0,queueMicrotask(O7))),Ao=e;for(var t=e;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024))return;t.f^=1024}}Ga.push(t)}function cP(e,t){var r=e.first,n=[];e:for(;r!==null;){var i=r.f,a=(i&32)!==0,s=a&&(i&1024)!==0,o=r.next;if(!s&&!(i&8192))if(i&8){if(a)r.f^=1024;else try{Hi(r)&&ja(r)}catch(f){To(f,r,null,r.ctx)}var l=r.first;if(l!==null){r=l;continue}}else i&4&&n.push(r);if(o===null){let f=r.parent;for(;f!==null;){if(e===f)break e;var c=f.next;if(c!==null){r=c;continue e}f=f.parent}}r=o}for(var u=0;u<n.length;u++)l=n[u],t.push(l),cP(l,t)}function Co(e){var t=Nd,r=Ga;try{oP();let i=[];Nd=P7,Ga=i,gc=!1,lP(r);var n=e==null?void 0:e();return Q3(),(Ga.length>0||i.length>0)&&Co(),ko=0,Ao=null,G&&(vc=[]),n}finally{Nd=t,Ga=r}}function R(e){var f,d;var t=e.f,r=(t&2)!==0;if(r&&t&16384){var n=rv(e);return pc(e),n}if(fc!==null&&fc.add(e),de!==null){ln!==null&&ln.includes(e)&&C3();var i=de.deps;Ct===null&&i!==null&&i[Ar]===e?Ar++:Ct===null?Ct=[e]:Ct.push(e),ni!==null&&te!==null&&te.f&1024&&!(te.f&32)&&ni.includes(e)&&(Zt(te,2048),wo(te))}else if(r&&e.deps===null)for(var a=e,s=a.parent,o=a;s!==null;)if(s.f&2){var l=s;o=l,s=l.parent}else{var c=s;(f=c.deriveds)!=null&&f.includes(o)||((d=c.deriveds)!=null?d:c.deriveds=[]).push(o);break}if(r&&(a=e,Hi(a)&&nv(a)),G&&ti&&uc!==null&&de!==null&&uc.reaction===de){if(e.debug)e.debug();else if(e.created){var u=uc.entries.get(e);u===void 0&&(u={read:[]},uc.entries.set(e,u)),u.read.push(ri("TracedAt"))}}return e.v}function Ue(e){let t=de;try{return de=null,e()}finally{de=t}}var I7=-7169;function Zt(e,t){e.f=e.f&I7|t}function Ze(e,t=!1,r){pe={p:pe,c:null,e:null,m:!1,s:e,x:null,l:null},ei&&!t&&(pe.l={s:null,u:null,r1:[],r2:ht(!1)}),G&&(pe.function=r,Wr=r)}function Ke(e){var s,o;let t=pe;if(t!==null){e!==void 0&&(t.x=e);let l=t.e;if(l!==null){var r=te,n=de;t.e=null;try{for(var i=0;i<l.length;i++){var a=l[i];ot(a.effect),Rt(a.reaction),Er(a.fn)}}finally{ot(r),Rt(n)}}pe=t.p,G&&(Wr=(o=(s=t.p)==null?void 0:s.function)!=null?o:null),t.m=!0}return e||{}}if(G){let e=function(t){if(!(t in globalThis)){let r;Object.defineProperty(globalThis,t,{configurable:!0,get:()=>{if(r!==void 0)return r;A3(t)},set:n=>{r=n}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}g();var uP=new Map;function fP(e,t){var r=uP.get(e);r||(r=new Set,uP.set(e,r)),r.add(t)}g();g();g();g();g();g();function pv(e){ae&&Pt(e)!==null&&So(e)}var dP=!1;function mv(){dP||(dP=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(let r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function Hd(e){var t=de,r=te;Rt(null),ot(null);try{return e()}finally{Rt(t),ot(r)}}function gv(e,t,r,n=r){e.addEventListener(t,()=>Hd(r));let i=e.__on_r;i?e.__on_r=()=>{i(),n(!0)}:e.__on_r=()=>n(!0),mv()}var vv=new Set,Ud=new Set;function hP(e,t,r,n){function i(a){if(n.capture||Po.call(t,a),!a.cancelBubble)return Hd(()=>r.call(this,a))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?fr(()=>{t.addEventListener(e,i,n)}):t.addEventListener(e,i,n),i}function kr(e,t,r,n,i){var a={captu
Line truncated
|
||||||
|
`:""}${(_=t.log.author)==null?void 0:_.name}
|
||||||
|
${(0,Mv.moment)(t.log.date).format(t.plugin.settings.commitDateFormat)}
|
||||||
|
${t.log.message}`)}),l.__click=[L9,i];var c=j(l),u=Z(c,2),f=j(u);{var d=_=>{var k=D9(),w=j(k,!0);ke(()=>Oe(w,t.log.refs.join(", "))),B(k),ne(_,k)};ye(f,_=>{t.log.refs.length>0&&_(d)})}var h=Z(f,2);{var p=_=>{var k=N9(),w=j(k,!0);ke(()=>Oe(w,a(t.log))),B(k),ne(_,k)};ye(h,_=>{var k;t.plugin.settings.authorInHistoryView!="hide"&&((k=t.log.author)!=null&&k.name)&&_(p)})}var m=Z(h,2);{var v=_=>{var k=B9(),w=j(k,!0);ke(()=>Oe(w,(0,Mv.moment)(t.log.date).format(t.plugin.settings.commitDateFormat))),B(k),ne(_,k)};ye(m,_=>{t.plugin.settings.dateInHistoryView&&_(v)})}var y=Z(m,2),b=j(y,!0);B(y),B(u),B(l);var x=Z(l,2);{var E=_=>{var k=j9(),w=j(k);{var A=T=>{_c(T,{get hierarchy(){return R(r)},get plugin(){return t.plugin},get view(){return t.view},topLevel:!0})},S=T=>{var P=si(),I=cr(P);Cr(I,17,()=>t.log.diff.files,Tr,(N,L)=>{bc(N,{get view(){return t.view},get diff(){return R(L)}})}),ne(T,P)};ye(w,T=>{t.showTree?T(A):T(S,!1)})}B(k),dn(3,k,()=>Ln,()=>({duration:150})),ne(_,k)};ye(x,_=>{R(i)||_(E)})}B(o),B(s),ke(()=>{lt(o,"is-collapsed",R(i)),me(l,"data-tooltip-position",R(n)),lt(c,"is-collapsed",R(i)),Oe(b,t.log.message)}),ne(e,s),Ke()}mt(["click"]);function G9(e,t){t().catch(console.error)}var z9=(e,t,r,n)=>{re(t,!R(t)),(0,Iv.setIcon)(r[0],R(t)?"list":"folder"),n(n().settings.treeStructure=R(t),!0),n().saveSettings()},V9=se('<div class="tree-item nav-folder mod-root"></div>'),W9=se('<main class="git-view"><div class="nav-header"><div class="nav-buttons-container"><div id="layoutChange" class="clickable-icon nav-action-button" aria-label="Change Layout"></div> <div id="refresh" class="clickable-icon nav-action-button" data-icon="refresh-cw" aria-label="Refresh"></div></div></div> <div class="nav-files-container" style="position: relative;"><!> <div id="sentinel"></div> <div style="margin-bottom:40px"></div></div></main>'),q9={hash:"svelte-45h",code:""};function Fv(e,t){Ze(t,!0),wt(e,q9);let r=Fn(t,"plugin",15),n=pt(!1),i=xe([]),a=pt(void 0),s=pt(xe(r().settings.treeStructure)),o,l;Dt(()=>{l&&l.empty()}),o=t.view.app.workspace.on("obsidian-git:head-change",()=>void c().catch(console.error)),Dt(()=>{i.forEach(x=>(0,Iv.setIcon)(x,x.getAttr("data-icon")))}),kP(()=>{t.view.app.workspace.offref(o)}),Tv(()=>{let x=new IntersectionObserver(_=>{_[0].isIntersecting&&!R(n)&&u().catch(console.error)}),E=document.querySelector("#sentinel");return E&&x.observe(E),()=>{x.disconnect()}}),c().catch(console.error);function c(){return wc(this,void 0,void 0,function*(){var x;if(!r().gitReady){re(a,void 0);return}re(n,!0);let E=r().gitManager instanceof Ee,_;((x=R(a)===null||R(a)===void 0?void 0:R(a).length)!==null&&x!==void 0?x:0)==0?_=E?50:10:_=R(a).length,re(a,xe(yield r().gitManager.log(void 0,!1,_))),re(n,!1)})}function u(){return wc(this,void 0,void 0,function*(){var x;if(!r().gitReady||R(a)===void 0)return;re(n,!0);let _=r().gitManager instanceof Ee?50:10,k=yield r().gitManager.log(void 0,!1,_,(x=R(a).last())===null||x===void 0?void 0:x.hash);R(a).push(...k.slice(1)),re(n,!1)})}var f=W9(),d=j(f),h=j(d),p=j(h);p.__click=[z9,s,i,r],Ge(p,x=>i[0]=x,()=>i==null?void 0:i[0]);var m=Z(p,2);m.__click=[G9,c],Ge(m,x=>i[1]=x,()=>i==null?void 0:i[1]),B(h),B(d);var v=Z(d,2),y=j(v);{var b=x=>{var E=V9();Cr(E,21,()=>R(a),Tr,(_,k)=>{Ov(_,{get view(){return t.view},get showTree(){return R(s)},get log(){return R(k)},get plugin(){return r()}})}),B(E),ne(x,E)};ye(y,x=>{R(a)&&x(b)})}_o(4),B(v),B(f),ke(()=>{me(p,"data-icon",R(s)?"list":"folder"),lt(m,"loading",R(n))}),ne(e,f),Ke()}mt(["click"]);var xc=class extends PP.ItemView{constructor(t,r){super(t),this.plugin=r,this.hoverPopover=null}getViewType(){return Lr.type}getDisplayText(){return Lr.name}getIcon(){return Lr.icon}onClose(){return this._view&&oi(this._view),super.onClose()}reload(){this._view&&oi(this._view),this._view=Vi(Fv,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};g();var RP=require("obsidian"),Xd=class extends RP.FuzzySuggestModal{constructor(r,n){super(r.app);this.branches=n;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,n){this.resolve(r)}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};g();var LP=require("obsidian");g();var qa=require("obsidian");g();var MP=require("obsidian"),qi=class extends MP.Modal{constructor(r,n,i){super(r);this.deletion=n;this.filename=i;this.resolve=null}myOpen(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let{contentEl:r,titleEl:n}=this;n.setText(`${this.deletion?"Delete":"Discard"} this file?`),r.createEl("p").setText(`Do you really want to ${this.deletion?"delete":"discard the changes of"} "${this.filename}"`);let i=r.createDiv({cls:"modal-button-container"}),a=i.createEl("button",{cls:"mod-warning",text:this.deletion?"Delete":"Discard"});a.addEventListener("click",()=>{this.resolve&&this.resolve(
Line truncated
|
||||||
|
`+a),this.refresh()}handleFileMenu(r,n,i,a){if(!this.gitReady||!this.settings.showFileMenu||!n)return;let s;if(typeof n=="string"?s=n:s=n.path,i=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{n instanceof we.TFile?await this.gitManager.stage(n.path,!0):await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(s,!0)}),this.displayMessage(`Staged ${s}`)})})}),r.addItem(o=>{o.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{n instanceof we.TFile?await this.gitManager.unstage(n.path,!0):await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(s,!0)}),this.displayMessage(`Unstaged ${s}`)})})}),r.addItem(o=>{o.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(l=>{this.addFileToGitignore(s,n instanceof we.TFolder).catch(c=>this.displayError(c))})})),i=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(s,n instanceof we.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;a==="obsidian-git:menu"&&o instanceof we.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(s)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(DP.join(o.getBasePath(),s))})}))}}async migrateSettings(){this.settings.mergeOnPull!=null&&(this.settings.syncMethod=this.settings.mergeOnPull?"merge":"rebase",this.settings.mergeOnPull=void 0,await this.saveSettings()),this.settings.autoCommitMessage===void 0&&(this.settings.autoCommitMessage=this.settings.commitMessage,await this.saveSettings()),this.settings.gitPath!=null&&(this.localStorage.setGitPath(this.settings.gitPath),this.settings.gitPath=void 0,await this.saveSettings()),this.settings.username!=null&&(this.localStorage.setPassword(this.settings.username),this.settings.username=void 0,await this.saveSettings())}unloadPlugin(){var r,n;this.gitReady=!1,this.lineAuthoringFeature.deactivateFeature(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(n=this.statusBar)==null||n.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let i of this.intervalsToClear)window.clearInterval(i);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let r=await this.loadData();r==null&&(r={showedMobileNotice:!0}),this.settings=Tx(je,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return we.Platform.isDesktopApp}async init({fromReload:r=!1}){var n;if(this.settings.showStatusBar&&!this.statusBar){let i=this.addStatusBarItem();this.statusBar=new id(i,this),this.intervalsToClear.push(window.setInterval(()=>{var a;return(a=this.statusBar)==null?void 0:a.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Ee(this),await this.gitManager.setGitInstance()):this.gitManager=new sn(this);let i=await this.gitManager.checkRequirements();switch(i){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new we.Notice("Can't find a valid git repository. Please create one via the given command or clone an existing repo.",1e4);break;case"valid":if(this.gitReady=!0,this.setPluginState({gitAction:0}),we.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new Jd(a,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return void((s=this.branchBar)==null?void 0:s.display().catch(console.error))},6e4))}await((n=this.branchBar)==null?void 0:n.display()),this.lineAuthoringFeature.conditionallyActivateBySettings(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),await this.automaticsManager.init();break;default:this.log("Something weird happened. The 'checkRequirements' result is "+i)}}catch(i){this.displayError(i),console.error(i)}}async createNewRepo(){try{await this.gitManager.init(),new we.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let n=await new $e(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(n){let i="Vault Root",a=await new $e(this,{options:this.gitManager instanceof sn?[i]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.gitManager instanceof sn}).openAn
Line truncated
|
||||||
|
# Additional Instructions
|
||||||
|
I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text.
|
||||||
|
|
||||||
|
\`\`\`diff
|
||||||
|
<<<<<<< HEAD
|
||||||
|
File changes in local repository
|
||||||
|
=======
|
||||||
|
File changes in remote repository
|
||||||
|
>>>>>>> origin/main
|
||||||
|
\`\`\``]),await this.tools.writeAndOpenFile(n==null?void 0:n.join(`
|
||||||
|
`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),i=await new $e(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(i){let a=await this.gitManager.getRemoteUrl(i),o=await new $e(this,{initialValue:a}).openAndGetResult();if(o)return await this.gitManager.setRemote(i,Wg(o)),i}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),n;r.length===0&&(n=await this.editRemotes(),n==null&&(r=await this.gitManager.getRemotes()));let i=new $e(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),a=n!=null?n:await i.openAndGetResult();if(a){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(a);let s=await this.gitManager.getRemoteBranches(a);return await new $e(this,{options:s,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult()}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),i=await new $e(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();i&&await this.gitManager.removeRemote(i)}onActiveLeafChange(r){var s,o;let n=r==null?void 0:r.view;if(!(n!=null&&n.getState().file)&&!(n instanceof Ra||n instanceof Ia))return;let i=this.app.workspace.getLeavesOfType(kt.type).first(),a=this.app.workspace.getLeavesOfType(Lr.type).first();if((s=i==null?void 0:i.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||s.removeClass("is-active"),(o=a==null?void 0:a.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof Ra||(r==null?void 0:r.view)instanceof Ia){let l=r.view.state.bFile;this.lastDiffViewState=r.view.getState();let c;i&&r.view.state.aRef=="HEAD"?c=i.view.containerEl.querySelector(`div.staged div.nav-file-title[data-path='${l}']`):i&&r.view.state.aRef==""?c=i.view.containerEl.querySelector(`div.changes div.nav-file-title[data-path='${l}']`):a&&(c=a.view.containerEl.querySelector(`div.nav-file-title[data-path='${l}']`)),c==null||c.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(r){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(r,n=4*1e3){var i;(i=this.statusBar)==null||i.displayMessage(r.toLowerCase(),n),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new we.Notice(r,5*1e3),this.log(r)}displayError(r,n=10*1e3){var a;if(r instanceof yl.UserCanceledError){new we.Notice("Aborted");return}let i;r instanceof Error?i=r:i=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new we.Notice(i.message,n),console.error(`${this.manifest.id}:`,i.stack),(a=this.statusBar)==null||a.displayMessage(i.message.toLowerCase(),n)}log(...r){console.log(`${this.manifest.id}:`,...r)}};
|
||||||
|
/*! Bundled license information:
|
||||||
|
|
||||||
|
ieee754/index.js:
|
||||||
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||||
|
|
||||||
|
buffer/index.js:
|
||||||
|
(*!
|
||||||
|
* The buffer module from node.js, for the browser.
|
||||||
|
*
|
||||||
|
* @author Feross Aboukhadijeh <https://feross.org>
|
||||||
|
* @license MIT
|
||||||
|
*)
|
||||||
|
|
||||||
|
safe-buffer/index.js:
|
||||||
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
||||||
|
|
||||||
|
crc-32/crc32.js:
|
||||||
|
(*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *)
|
||||||
|
|
||||||
|
js-sha256/src/sha256.js:
|
||||||
|
(**
|
||||||
|
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
||||||
|
*
|
||||||
|
* @version 0.9.0
|
||||||
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||||
|
* @copyright Chen, Yi-Cyuan 2014-2017
|
||||||
|
* @license MIT
|
||||||
|
*)
|
||||||
|
|
||||||
|
feather-icons/dist/feather.js:
|
||||||
|
(*!
|
||||||
|
Copyright (c) 2016 Jed Watson.
|
||||||
|
Licensed under the MIT License (MIT), see
|
||||||
|
http://jedwatson.github.io/classnames
|
||||||
|
*)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"author": "Vinzent",
|
||||||
|
"authorUrl": "https://github.com/Vinzent03",
|
||||||
|
"id": "obsidian-git",
|
||||||
|
"name": "Git",
|
||||||
|
"description": "Integrate Git version control with automatic backup and other advanced features.",
|
||||||
|
"isDesktopOnly": false,
|
||||||
|
"fundingUrl": "https://ko-fi.com/vinzent",
|
||||||
|
"version": "2.34.0"
|
||||||
|
}
|
||||||
+605
@@ -0,0 +1,605 @@
|
|||||||
|
@keyframes loading {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-view"] .button-border {
|
||||||
|
border: 2px solid var(--interactive-accent);
|
||||||
|
border-radius: var(--radius-s);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-view"] .view-content {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="git-history-view"] .view-content {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loading > svg {
|
||||||
|
animation: 2s linear infinite loading;
|
||||||
|
transform-origin: 50% 50%;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-center {
|
||||||
|
margin: auto;
|
||||||
|
text-align: center;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-textarea {
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.obsidian-git-center-button {
|
||||||
|
display: block;
|
||||||
|
margin: 20px auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip.mod-left {
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tooltip.mod-right {
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
.git-tools {
|
||||||
|
display: flex;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
.git-tools .type {
|
||||||
|
padding-left: var(--size-2-1);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-tools .type[data-type="M"] {
|
||||||
|
color: orange;
|
||||||
|
}
|
||||||
|
.git-tools .type[data-type="D"] {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
.git-tools .buttons {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.git-tools .buttons > * {
|
||||||
|
padding: 0 0;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.is-active .git-tools .buttons > * {
|
||||||
|
color: var(--nav-item-color-active);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-author {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-date {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-ref {
|
||||||
|
color: var(--text-accent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-d-none {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-wrapper {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-header {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border-bottom: 1px solid var(--interactive-accent);
|
||||||
|
font-family: var(--font-monospace);
|
||||||
|
height: 35px;
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-header,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats {
|
||||||
|
font-size: 14px;
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-lines-added {
|
||||||
|
border: 1px solid #b4e2b4;
|
||||||
|
border-radius: 5px 0 0 5px;
|
||||||
|
color: #399839;
|
||||||
|
padding: 2px;
|
||||||
|
text-align: right;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-lines-deleted {
|
||||||
|
border: 1px solid #e9aeae;
|
||||||
|
border-radius: 0 5px 5px 0;
|
||||||
|
color: #c33;
|
||||||
|
margin-left: 1px;
|
||||||
|
padding: 2px;
|
||||||
|
text-align: left;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-name-wrapper {
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
font-size: 15px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-name {
|
||||||
|
overflow-x: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-wrapper {
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 3px;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse {
|
||||||
|
-webkit-box-pack: end;
|
||||||
|
-ms-flex-pack: end;
|
||||||
|
-webkit-box-align: center;
|
||||||
|
-ms-flex-align: center;
|
||||||
|
align-items: center;
|
||||||
|
border: 1px solid var(--background-modifier-border);
|
||||||
|
border-radius: 3px;
|
||||||
|
cursor: pointer;
|
||||||
|
display: none;
|
||||||
|
font-size: 12px;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 4px 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse.d2h-selected {
|
||||||
|
background-color: #c8e1ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse-input {
|
||||||
|
margin: 0 4px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-diff-table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
font-family: Menlo, Consolas, monospace;
|
||||||
|
font-size: 13px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-files-diff {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-diff {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-side-diff {
|
||||||
|
display: inline-block;
|
||||||
|
margin-bottom: -8px;
|
||||||
|
margin-right: -4px;
|
||||||
|
overflow-x: scroll;
|
||||||
|
overflow-y: hidden;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line {
|
||||||
|
padding: 0 8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line {
|
||||||
|
display: inline-block;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line {
|
||||||
|
padding: 0 4.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-ctn {
|
||||||
|
word-wrap: normal;
|
||||||
|
background: none;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 0;
|
||||||
|
-webkit-user-select: text;
|
||||||
|
-moz-user-select: text;
|
||||||
|
-ms-user-select: text;
|
||||||
|
user-select: text;
|
||||||
|
vertical-align: middle;
|
||||||
|
white-space: pre;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||||
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
del {
|
||||||
|
background-color: #ffb6ba;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||||
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
del {
|
||||||
|
background-color: #8d232881;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line del,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins {
|
||||||
|
border-radius: 0.2em;
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: -1px;
|
||||||
|
text-decoration: none;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||||
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
ins {
|
||||||
|
background-color: #97f295;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins,
|
||||||
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-code-side-line
|
||||||
|
ins {
|
||||||
|
background-color: #1d921996;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix {
|
||||||
|
word-wrap: normal;
|
||||||
|
background: none;
|
||||||
|
display: inline;
|
||||||
|
padding: 0;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .line-num1 {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .line-num1,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .line-num2 {
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 0.5em;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 3.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .line-num2 {
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border: solid var(--background-modifier-border);
|
||||||
|
border-width: 0 1px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: var(--text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute;
|
||||||
|
text-align: right;
|
||||||
|
width: 7.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber:after {
|
||||||
|
content: "\200b";
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border: solid var(--background-modifier-border);
|
||||||
|
border-width: 0 1px;
|
||||||
|
-webkit-box-sizing: border-box;
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: var(--text-muted);
|
||||||
|
cursor: pointer;
|
||||||
|
display: inline-block;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 0 0.5em;
|
||||||
|
position: absolute;
|
||||||
|
text-align: right;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 4em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-diff-tbody tr {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber:after {
|
||||||
|
content: "\200b";
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-emptyplaceholder,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border-color: var(--background-modifier-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder {
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber,
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber {
|
||||||
|
direction: rtl;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-del {
|
||||||
|
background-color: #fee8e9;
|
||||||
|
border-color: #e9aeae;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-ins {
|
||||||
|
background-color: #dfd;
|
||||||
|
border-color: #b4e2b4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-del {
|
||||||
|
background-color: #521b1d83;
|
||||||
|
border-color: #691d1d73;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-ins {
|
||||||
|
background-color: rgba(30, 71, 30, 0.5);
|
||||||
|
border-color: #13501381;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-info {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
border-color: var(--background-modifier-border);
|
||||||
|
color: var(--text-normal);
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-del.d2h-change {
|
||||||
|
background-color: #fdf2d0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-del.d2h-change {
|
||||||
|
background-color: #55492480;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-ins.d2h-change {
|
||||||
|
background-color: #ded;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-dark
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-diff
|
||||||
|
.d2h-ins.d2h-change {
|
||||||
|
background-color: rgba(37, 78, 37, 0.418);
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a {
|
||||||
|
color: #3572b0;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"]
|
||||||
|
.d2h-file-list-wrapper
|
||||||
|
a:visited {
|
||||||
|
color: #3572b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-header {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-title {
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-line {
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list {
|
||||||
|
display: block;
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li {
|
||||||
|
border-bottom: 1px solid var(--background-modifier-border);
|
||||||
|
margin: 0;
|
||||||
|
padding: 5px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-file-switch {
|
||||||
|
cursor: pointer;
|
||||||
|
display: none;
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-icon {
|
||||||
|
fill: currentColor;
|
||||||
|
margin-right: 10px;
|
||||||
|
vertical-align: middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-deleted {
|
||||||
|
color: #c33;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-added {
|
||||||
|
color: #399839;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-changed {
|
||||||
|
color: #d0b44c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-moved {
|
||||||
|
color: #3572b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-tag {
|
||||||
|
background-color: var(--background-primary);
|
||||||
|
display: -webkit-box;
|
||||||
|
display: -ms-flexbox;
|
||||||
|
display: flex;
|
||||||
|
font-size: 10px;
|
||||||
|
margin-left: 5px;
|
||||||
|
padding: 0 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-deleted-tag {
|
||||||
|
border: 2px solid #c33;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-added-tag {
|
||||||
|
border: 1px solid #399839;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-changed-tag {
|
||||||
|
border: 1px solid #d0b44c;
|
||||||
|
}
|
||||||
|
|
||||||
|
.workspace-leaf-content[data-type="diff-view"] .d2h-moved-tag {
|
||||||
|
border: 1px solid #3572b0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ====================== Line Authoring Information ====================== */
|
||||||
|
|
||||||
|
.cm-gutterElement.obs-git-blame-gutter {
|
||||||
|
/* Add background color to spacing inbetween and around the gutter for better aesthetics */
|
||||||
|
border-width: 0px 2px 0.2px 2px;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: var(--background-secondary);
|
||||||
|
background-color: var(--background-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-gutterElement.obs-git-blame-gutter > div,
|
||||||
|
.line-author-settings-preview {
|
||||||
|
/* delegate text color to settings */
|
||||||
|
color: var(--obs-git-gutter-text);
|
||||||
|
font-family: monospace;
|
||||||
|
height: 100%; /* ensure, that age-based background color occupies entire parent */
|
||||||
|
text-align: right;
|
||||||
|
padding: 0px 6px 0px 6px;
|
||||||
|
white-space: pre; /* Keep spaces and do not collapse them. */
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
/* hide git blame gutter not to superpose text */
|
||||||
|
.cm-gutterElement.obs-git-blame-gutter {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-unified-diff-view,
|
||||||
|
.git-split-diff-view .cm-deletedLine .cm-changedText {
|
||||||
|
background-color: #ee443330;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-unified-diff-view,
|
||||||
|
.git-split-diff-view .cm-insertedLine .cm-changedText {
|
||||||
|
background-color: #22bb2230;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Limits the scrollbar to the view body */
|
||||||
|
.git-view {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
position: relative;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-obscure-prompt[git-is-obscured="true"] #git-show-password:after {
|
||||||
|
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"></path><circle cx="12" cy="12" r="3"></circle></svg>');
|
||||||
|
}
|
||||||
|
|
||||||
|
.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after {
|
||||||
|
-webkit-mask-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svg-icon lucide-eye-off"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"></path><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"></path><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"></path><path d="m2 2 20 20"></path></svg>');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Override styling of Codemirror merge view "collapsed lines" indicator */
|
||||||
|
.git-split-diff-view .ͼ2 .cm-collapsedLines {
|
||||||
|
background: var(--interactive-normal);
|
||||||
|
border-radius: var(--radius-m);
|
||||||
|
color: var(--text-accent);
|
||||||
|
font-size: var(--font-small);
|
||||||
|
padding: var(--size-4-1) var(--size-4-1);
|
||||||
|
}
|
||||||
|
.git-split-diff-view .ͼ2 .cm-collapsedLines:hover {
|
||||||
|
background: var(--interactive-hover);
|
||||||
|
color: var(--text-accent-hover);
|
||||||
|
}
|
||||||
+500
@@ -0,0 +1,500 @@
|
|||||||
|
/*
|
||||||
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||||
|
if you want to view the source visit the plugins github repository
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License obsidian-tasks:
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2021 Clare Macrae, Ilyas Landikov and Martin Schenck
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License rrule (included library):
|
||||||
|
rrule.js: Library for working with recurrence rules for calendar dates.
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Copyright 2010, Jakub Roztocil <jakub@roztocil.name> and Lars Schöning
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
notice, this list of conditions and the following disclaimer in the
|
||||||
|
documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of The author nor the names of its contributors may
|
||||||
|
be used to endorse or promote products derived from this software
|
||||||
|
without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
./rrule.js and ./test/tests.js is based on python-dateutil. LICENCE:
|
||||||
|
|
||||||
|
python-dateutil - Extensions to the standard Python datetime module.
|
||||||
|
====================================================================
|
||||||
|
|
||||||
|
Copyright (c) 2003-2011 - Gustavo Niemeyer <gustavo@niemeyer.net>
|
||||||
|
Copyright (c) 2012 - Tomi Pieviläinen <tomi.pievilainen@iki.fi>
|
||||||
|
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without
|
||||||
|
modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
* Redistributions of source code must retain the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
this list of conditions and the following disclaimer in the documentation
|
||||||
|
and/or other materials provided with the distribution.
|
||||||
|
* Neither the name of the copyright holder nor the names of its
|
||||||
|
contributors may be used to endorse or promote products derived from
|
||||||
|
this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||||
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License chrono-node (included library):
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2014, Wanasit Tanakitrungruang
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License flatpickr (included library):
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2017 Gregory Petrosyan
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License @floating-ui/dom (included library):
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2021 Floating UI contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License boon-js (included library):
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2020-present Jake Chorley
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License eventemitter2 (included library):
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2016 Paolo Fragomeni <http://www.github.com/0x00a> and Contributors
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License i18next (included library):
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2025 i18next
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License mustache (included library):
|
||||||
|
|
||||||
|
The MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2009 Chris Wanstrath (Ruby)
|
||||||
|
Copyright (c) 2010-2014 Jan Lehnardt (JavaScript)
|
||||||
|
Copyright (c) 2010-2015 The mustache.js community
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
License mustache-validator (included library):
|
||||||
|
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Elias Mangoro
|
||||||
|
*/
|
||||||
|
|
||||||
|
"use strict";var $x=Object.create;var Wo=Object.defineProperty,Wx=Object.defineProperties,qx=Object.getOwnPropertyDescriptor,Hx=Object.getOwnPropertyDescriptors,Gx=Object.getOwnPropertyNames,Nu=Object.getOwnPropertySymbols,Bx=Object.getPrototypeOf,Ff=Object.prototype.hasOwnProperty,Rb=Object.prototype.propertyIsEnumerable;var Ob=(r,t,e)=>t in r?Wo(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e,F=(r,t)=>{for(var e in t||(t={}))Ff.call(t,e)&&Ob(r,e,t[e]);if(Nu)for(var e of Nu(t))Rb.call(t,e)&&Ob(r,e,t[e]);return r},de=(r,t)=>Wx(r,Hx(t));var pa=(r,t)=>{var e={};for(var n in r)Ff.call(r,n)&&t.indexOf(n)<0&&(e[n]=r[n]);if(r!=null&&Nu)for(var n of Nu(r))t.indexOf(n)<0&&Rb.call(r,n)&&(e[n]=r[n]);return e};var X=(r,t)=>()=>(r&&(t=r(r=0)),t);var x=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),Cb=(r,t)=>{for(var e in t)Wo(r,e,{get:t[e],enumerable:!0})},Mb=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Gx(t))!Ff.call(r,i)&&i!==e&&Wo(r,i,{get:()=>t[i],enumerable:!(n=qx(t,i))||n.enumerable});return r};var qo=(r,t,e)=>(e=r!=null?$x(Bx(r)):{},Mb(t||!r||!r.__esModule?Wo(e,"default",{value:r,enumerable:!0}):e,r)),Ab=r=>Mb(Wo({},"__esModule",{value:!0}),r);var I=(r,t,e)=>new Promise((n,i)=>{var s=l=>{try{o(e.next(l))}catch(u){i(u)}},a=l=>{try{o(e.throw(l))}catch(u){i(u)}},o=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,a);o((e=e.apply(r,t)).next())});var Te,Ho,Pb,Vx,zx,Nb,Ib,Go,Fb,Kx,Fu,Qx,qb,ma,Zx,Xx,Uf,Jx,eO,tO,Yf,Lu,nO,ga,Ur,ya,Uu,Hb,Lb,ba,Yu,Ub,Yb,jf,jb,Lf,$f,rO,ha,Wf,iO,qf,$b,Wb,Iu,sO,gs,yt,uj,cj,dj,fj,pj,mj,hj,gj,yj,bj,Tj,vj,_j,wj,Gb=X(()=>{Te=r=>typeof r=="string",Ho=()=>{let r,t,e=new Promise((n,i)=>{r=n,t=i});return e.resolve=r,e.reject=t,e},Pb=r=>r==null?"":""+r,Vx=(r,t,e)=>{r.forEach(n=>{t[n]&&(e[n]=t[n])})},zx=/###/g,Nb=r=>r&&r.indexOf("###")>-1?r.replace(zx,"."):r,Ib=r=>!r||Te(r),Go=(r,t,e)=>{let n=Te(t)?t.split("."):t,i=0;for(;i<n.length-1;){if(Ib(r))return{};let s=Nb(n[i]);!r[s]&&e&&(r[s]=new e),Object.prototype.hasOwnProperty.call(r,s)?r=r[s]:r={},++i}return Ib(r)?{}:{obj:r,k:Nb(n[i])}},Fb=(r,t,e)=>{let{obj:n,k:i}=Go(r,t,Object);if(n!==void 0||t.length===1){n[i]=e;return}let s=t[t.length-1],a=t.slice(0,t.length-1),o=Go(r,a,Object);for(;o.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),o=Go(r,a,Object),(o==null?void 0:o.obj)&&typeof o.obj[`${o.k}.${s}`]!="undefined"&&(o.obj=void 0);o.obj[`${o.k}.${s}`]=e},Kx=(r,t,e,n)=>{let{obj:i,k:s}=Go(r,t,Object);i[s]=i[s]||[],i[s].push(e)},Fu=(r,t)=>{let{obj:e,k:n}=Go(r,t);if(!!e&&!!Object.prototype.hasOwnProperty.call(e,n))return e[n]},Qx=(r,t,e)=>{let n=Fu(r,e);return n!==void 0?n:Fu(t,e)},qb=(r,t,e)=>{for(let n in t)n!=="__proto__"&&n!=="constructor"&&(n in r?Te(r[n])||r[n]instanceof String||Te(t[n])||t[n]instanceof String?e&&(r[n]=t[n]):qb(r[n],t[n],e):r[n]=t[n]);return r},ma=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Zx={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},Xx=r=>Te(r)?r.replace(/[&<>"'\/]/g,t=>Zx[t]):r,Uf=class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){let e=this.regExpMap.get(t);if(e!==void 0)return e;let n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}},Jx=[" ",",","?","!",";"],eO=new Uf(20),tO=(r,t,e)=>{t=t||"",e=e||"";let n=Jx.filter(a=>t.indexOf(a)<0&&e.indexOf(a)<0);if(n.length===0)return!0;let i=eO.getRegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`),s=!i.test(r);if(!s){let a=r.indexOf(e);a>0&&!i.test(r.substring(0,a))&&(s=!0)}return s},Yf=function(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!r)return;if(r[t])return Object.prototype.hasOwnProperty.call(r,t)?r[t]:void 0;let n=t.split(e),i=r;for(let s=0;s<n.length;){if(!i||typeof i!="object")return;let a,o="";for(let l=s;l<n.length;++l)if(l!==s&&(o+=e),o+=n[l],a=i[o],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<n.length-1)continue;s+=l-s+1;break}i=a}return i},Lu=r=>r==null?void 0:r.replace("_","-"),nO={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,t){var e,n;(n=(e=console==null?void 0:console[r])==null?void 0:e.apply)==null||n.call(e,console,t)}},ga=class{constructor(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||nO,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"log","",!0)}warn(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"warn","",!0)}error(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return this.forward(e,"error","")}deprecate(){for(var t=arguments.length,e=new Array(t),n=0;n<t;Line truncated
|
||||||
|
path does not include _templates/
|
||||||
|
limit 300
|
||||||
|
show urgency`}},presets:{line1:"",line2:"",name:""},recurringTasks:{heading:"\u041F\u0435\u0440\u044B\u044F\u0434\u044B\u0447\u043D\u044B\u044F \u0437\u0430\u0434\u0430\u0447\u044B",nextLine:{description:"\u0423\u043A\u043B\u044E\u0447\u044D\u043D\u043D\u0435 \u0433\u044D\u0442\u0430\u0433\u0430 \u0437\u0440\u043E\u0431\u0456\u0446\u044C \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0430\u0435 \u043F\u0430\u045E\u0442\u0430\u0440\u044D\u043D\u043D\u0435 \u0437\u0430\u0434\u0430\u0447\u044B \u043D\u0430 \u0440\u0430\u0434\u043A\u0443 \u043D\u0456\u0436\u044D\u0439 \u0437\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043D\u0443\u044E \u0437\u0430\u0434\u0430\u0447\u0443. \u0423 \u0430\u0434\u0432\u0430\u0440\u043E\u0442\u043D\u044B\u043C \u0432\u044B\u043F\u0430\u0434\u043A\u0443 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0430\u0435 \u043F\u0430\u045E\u0442\u0430\u0440\u044D\u043D\u043D\u0435 \u0437'\u044F\u0432\u0456\u0446\u0446\u0430 \u043F\u0435\u0440\u0430\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u043D\u0430\u0439 \u0437\u0430\u0434\u0430\u0447\u0430\u0439.",name:"\u041D\u0430\u0441\u0442\u0443\u043F\u043D\u0430\u0435 \u043F\u0430\u045E\u0442\u0430\u0440\u044D\u043D\u043D\u0435 \u0437'\u044F\u045E\u043B\u044F\u0435\u0446\u0446\u0430 \u043D\u0430 \u0440\u0430\u0434\u043A\u0443 \u043D\u0456\u0436\u044D\u0439"},removeScheduledDate:{description:{line1:"",line2:""},name:""}},seeTheDocumentation:"\u0413\u043B\u044F\u0434\u0437\u0456\u0446\u0435 \u0434\u0430\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u044B\u044E",statuses:{collections:{anuppuccinTheme:"\u0422\u044D\u043C\u0430 AnuPpuccin",auraTheme:"\u0422\u044D\u043C\u0430 Aura",borderTheme:"\u0422\u044D\u043C\u0430 Border",buttons:{addCollection:{name:"{{themeName}}: \u0414\u0430\u0434\u0430\u0446\u044C {{numberOfStatuses}} \u043F\u0430\u0434\u0442\u0440\u044B\u043C\u043E\u045E\u0432\u0430\u043D\u044B\u044F \u0441\u0442\u0430\u0442\u0443\u0441\u044B"}},ebullientworksTheme:"\u0422\u044D\u043C\u0430 Ebullientworks",itsThemeAndSlrvbCheckboxes:"\u0422\u044D\u043C\u0430 ITS \u0456 \u0441\u0446\u044F\u0436\u043A\u0456 SlRvb",lytModeTheme:"\u0422\u044D\u043C\u0430 LYT Mode (\u0442\u043E\u043B\u044C\u043A\u0456 \u0446\u0451\u043C\u043D\u044B \u0440\u044D\u0436\u044B\u043C)",minimalTheme:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0442\u044D\u043C\u0430",thingsTheme:"\u0422\u044D\u043C\u0430 Things"},coreStatuses:{buttons:{checkStatuses:{name:"\u041F\u0440\u0430\u0433\u043B\u044F\u0434\u0437\u0435\u0446\u044C \u0456 \u043F\u0440\u0430\u0432\u0435\u0440\u044B\u0446\u044C \u0432\u0430\u0448\u044B \u0441\u0442\u0430\u0442\u0443\u0441\u044B",tooltip:"\u0421\u0442\u0432\u0430\u0440\u044B\u0446\u044C \u043D\u043E\u0432\u044B \u0444\u0430\u0439\u043B \u0443 \u043A\u0430\u0440\u0430\u043D\u0451\u0432\u0430\u0439 \u0442\u044D\u0447\u0446\u044B \u0441\u0445\u043E\u0432\u0456\u0448\u0447\u0430, \u044F\u043A\u0456 \u0437\u043C\u044F\u0448\u0447\u0430\u0435 \u0434\u044B\u044F\u0433\u0440\u0430\u043C\u0443 Mermaid \u0437 \u0431\u044F\u0433\u0443\u0447\u044B\u043C\u0456 \u043D\u0430\u043B\u0430\u0434\u0430\u043C\u0456 \u0441\u0442\u0430\u0442\u0443\u0441\u0443."}},description:{line1:"\u0413\u044D\u0442\u0430 \u0430\u0441\u043D\u043E\u045E\u043D\u044B\u044F \u0441\u0442\u0430\u0442\u0443\u0441\u044B, \u044F\u043A\u0456\u044F Tasks \u043F\u0430\u0434\u0442\u0440\u044B\u043C\u043B\u0456\u0432\u0430\u0435 \u045E\u043B\u0430\u0441\u043D\u0430, \u0431\u0435\u0437 \u043F\u0430\u0442\u0440\u044D\u0431\u044B \u045E \u043A\u0430\u0440\u044B\u0441\u0442\u0430\u043B\u044C\u043D\u0456\u0446\u043A\u0456\u043C CSS-\u0441\u0442\u044B\u043B\u0456 \u0430\u0431\u043E \u0442\u044D\u043C\u0430\u0442\u044B\u0437\u0430\u0446\u044B\u0456.",line2:"\u0412\u044B \u043C\u043E\u0436\u0430\u0446\u0435 \u0440\u044D\u0434\u0430\u0433\u0430\u0432\u0430\u0446\u044C \u0456 \u0434\u0430\u0434\u0430\u0432\u0430\u0446\u044C \u0441\u0432\u0430\u0435 \u045E\u043B\u0430\u0441\u043D\u044B\u044F \u043A\u0430\u0440\u044B\u0441\u0442\u0430\u043B\u044C\u043D\u0456\u0446\u043A\u0456\u044F \u0441\u0442\u0430\u0442\u0443\u0441\u044B \u045E \u0440\u0430\u0437\u0434\u0437\u0435\u043B\u0435 \u043D\u0456\u0436\u044D\u0439."},heading:"\u0410\u0441\u043D\u043E\u045E\u043D\u044B\u044F \u0441\u0442\u0430\u0442\u0443\u0441\u044B"},customStatuses:{buttons:{addAllUnknown:{name:"\u0414\u0430\u0434\u0430\u0446\u044C \u0443\u0441\u0435 \u043D\u0435\u0432\u044F\u0434\u043E\u043C\u044B\u044F \u0442\u044B\u043F\u044B \u0441\u0442\u0430\u0442\u0443\u0441\u0430\u045E"},addNewStatus:{name:"\u0414\u0430\u0434\u0430\u0446\u044C \u043D\u043E\u0432\u044B \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u0434\u0430\u0447\u044B"},resetCustomStatuses:{name:"\u0421\u043A\u0456\u043D\u0443\u0446\u044C \u043A\u0430\u0440\u044B\u0441\u0442\u0430\u043B\u044C\u043D\u0456\u0446\u043A\u0456\u044F \u0442\u044B\u043F\u044B \u0441\u0442\u0430\u0442\u0443\u0441\u0430\u045E \u0434\u0430 \u0437\u043D\u0430\u0447\u044D\u043D\u043
Line truncated
|
||||||
|
path does not include _templates/
|
||||||
|
limit 300
|
||||||
|
show urgency`}},presets:{line1:"",line2:"",name:""},recurringTasks:{heading:"Wiederkehrende Aufgaben",nextLine:{description:"Aktivieren Sie dies, damit das n\xE4chste Auftreten einer Aufgabe in der Zeile unterhalb der abgeschlossenen Aufgabe erscheint. Ansonsten erscheint es vor der abgeschlossenen Aufgabe.",name:"N\xE4chste Wiederholung erscheint in Zeile darunter"},removeScheduledDate:{description:{line1:"Aktiviert, damit das n\xE4chste Auftreten einer Aufgabe keinen geplanten (\u23F3) Termin hat, wenn mindestens Start-(\u{1F6EB}) oder F\xE4lligkeitsdaten (\u{1F4C5}) vorhanden sind.",line2:"Dies gilt, wenn Sie m\xF6chten, dass Start- und F\xE4lligkeitsdaten beim n\xE4chsten Auftreten beibehalten werden, aber das geplante Datum sp\xE4ter festgelegt wird, sobald Sie planen, daran zu arbeiten."},name:"Geplantes Datum bei Wiederholung entfernen"}},seeTheDocumentation:"Vgl. die Dokumentation",statuses:{collections:{anuppuccinTheme:"AnuPpuccin Theme",auraTheme:"Aura Theme",borderTheme:"Border Theme",buttons:{addCollection:{name:"{{themeName}}: F\xFCge {{numberOfStatuses}} unterst\xFCtzte Status hinzu"}},ebullientworksTheme:"Ebullientworks Theme",itsThemeAndSlrvbCheckboxes:"ITS Theme & SlRvb Kontrollk\xE4stchen",lytModeTheme:"LYT Mode Theme (nur Dunkelmodus)",minimalTheme:"Minimal Theme",thingsTheme:"Things Theme"},coreStatuses:{buttons:{checkStatuses:{name:"\xDCberpr\xFCfen und einsehen Sie Ihre Status-Eintr\xE4ge",tooltip:"Erstellen Sie eine neue Datei im Hauptverzeichnis des Tresors, die ein Mermaid-Diagramm der aktuellen Statuseinstellungen enth\xE4lt."}},description:{line1:"Diese Kern-Status unterst\xFCtzt Tasks nativ ohne benutzerdefiniertes CSS-Styling oder Themes.",line2:"Hinzuf\xFCgen und Bearbeiten Ihrer eigenen benutzerdefinierten Status k\xF6nnen Sie im unteren Abschnitt."},heading:"Kern-Status"},customStatuses:{buttons:{addAllUnknown:{name:"Alle unbekannten Statustypen hinzuf\xFCgen"},addNewStatus:{name:"Neuen Aufgabenstatus hinzuf\xFCgen"},resetCustomStatuses:{name:"Benutzerdefinierte Statustypen auf Standard zur\xFCcksetzen"}},description:{line1:"Zuerst w\xE4hlen und installieren Sie ein CSS-Snippet oder Theme, um benutzerdefinierte Kontrollk\xE4stchen zu formatieren.",line2:"Verwenden Sie dann die untenstehenden Schaltfl\xE4chen, um Ihre benutzerdefinierten Status zu erstellen, sodass sie mit Ihren ausgew\xE4hlten CSS-Kontrollk\xE4stchen \xFCbereinstimmen.",line3:"Hinweis: Status mit dem gleichen Symbol wie ein fr\xFCherer Status ignorieren wir. Best\xE4tigen Sie die tats\xE4chlich geladenen Status, indem Sie den 'Aufgabe erstellen oder bearbeiten'-Befehl ausf\xFChren und das Status-Dropdown anschauen.",line4:"Nutzen Sie die Dokumentation, um loszulegen!"},heading:"Benutzerdefinierte Status"},heading:"Aufgabenstatus"}}}});var Zb,Qb=X(()=>{Zb={main:{loadingPlugin:"Loading plugin: {{name}} v{{version}}",unloadingPlugin:"Unloading plugin: {{name}} v{{version}}"},modals:{customStatusModal:{editAvailableAsCommand:{description:"If enabled this status will be available as a command so you can assign a hotkey and toggle the status using it.",name:"Available as command"},editNextStatusSymbol:{description:"When clicked on this is the symbol that should be used next.",name:"Task Next Status Symbol"},editStatusName:{description:"This is the friendly name of the task status.",name:"Task Status Name"},editStatusSymbol:{description:"This is the character between the square braces. (It can only be edited for Custom statuses, and not Core statuses.)",name:"Task Status Symbol"},editStatusType:{description:"Control how the status behaves for searching and toggling.",name:"Task Status Type"},fixErrorsBeforeSaving:"Fix errors before saving."}},reports:{statusRegistry:{about:{createdBy:"This file was created by the Obsidian Tasks plugin (version {{version}}) to help visualise the task statuses in this vault.",deleteFileAnyTime:"You can delete this file any time.",title:"About this file",updateReport:{line1:"If you change the Tasks status settings, you can get an updated report by:",line2:"Going to `Settings` -> `Tasks`.",line3:"Clicking on `Review and check your Statuses`."}},columnHeadings:{nextStatusSymbol:"Next Status Symbol",problems:"Problems (if any)",statusName:"Status Name",statusSymbol:"Status Symbol",statusType:"Status Type"},loadedSettings:{settingsActuallyUsed:"These are the settings actually used by Tasks.",switchToLivePreview:"Switch to Live Preview or Reading Mode to see the diagram.",title:"Loaded Settings"},messages:{cannotFindNextStatus:"Unexpected failure to find the next status.",duplicateSymbol:"Duplicate symbol '{{symbol}}': this status will be ignored.",emptySymbol:"Empty symbol: this status will be ignored.",nextSymbolUnknown:"Next symbol {{symbol}} is unknown: create a status with symbol {{symbol}}.",notConventionalType:"For information, the conventional type for status symbol {{symbol}} is {{type}}: you may wish to review this type.",wrongTypeAfterDone:{line1:"This `DONE` status is followed
Line truncated
|
||||||
|
path does not include _templates/
|
||||||
|
limit 300
|
||||||
|
show urgency`}},presets:{line1:"You can define named instructions here, that you can re-use in multiple queries. A preset called '{{name}}' can be used in Tasks queries with either '{{instruction1}}' or '{{instruction2}}'.",line2:"Any open Tasks queries are reloaded automatically when presets are edited.",name:"Presets"},recurringTasks:{heading:"Recurring tasks",nextLine:{description:"Enabling this will make the next recurrence of a task appear on the line below the completed task. Otherwise the next recurrence will appear before the completed one.",name:"Next recurrence appears on the line below"},removeScheduledDate:{description:{line1:"Enabling this will make the next recurrence of a task have no Scheduled (\u23F3) date, when at least one of Start (\u{1F6EB}) or Due (\u{1F4C5}) dates is present.",line2:"This is for when you want the Start and Due dates to carry forward to the next recurrence, but you will set the Scheduled date in future, once you plan to work on it."},name:"Remove scheduled date on recurrence"}},seeTheDocumentation:"See the documentation",statuses:{collections:{anuppuccinTheme:"AnuPpuccin Theme",auraTheme:"Aura Theme",borderTheme:"Border Theme",buttons:{addCollection:{name:"{{themeName}}: Add {{numberOfStatuses}} supported Statuses"}},ebullientworksTheme:"Ebullientworks Theme",itsThemeAndSlrvbCheckboxes:"ITS Theme & SlRvb Checkboxes",lytModeTheme:"LYT Mode Theme (Dark mode only)",minimalTheme:"Minimal Theme",thingsTheme:"Things Theme"},coreStatuses:{buttons:{checkStatuses:{name:"Review and check your Statuses",tooltip:"Create a new file in the root of the vault, containing a Mermaid diagram of the current status settings."}},description:{line1:"These are the core statuses that Tasks supports natively, with no need for custom CSS styling or theming.",line2:"You can add edit and add your own custom statuses in the section below."},heading:"Core Statuses"},customStatuses:{buttons:{addAllUnknown:{name:"Add All Unknown Status Types"},addNewStatus:{name:"Add New Task Status"},resetCustomStatuses:{name:"Reset Custom Status Types to Defaults"}},description:{line1:"You should first <b>select and install a CSS Snippet or Theme</b> to style custom checkboxes.",line2:"Then, use the buttons below to set up your custom statuses, to match your chosen CSS checkboxes.",line3:"<b>Note</b> Any statuses with the same symbol as any earlier statuses will be ignored. You can confirm the actually loaded statuses by running the 'Create or edit task' command and looking at the Status drop-down.",line4:"See the documentation to get started!"},heading:"Custom Statuses"},heading:"Task Statuses"}}}});var Jb,Xb=X(()=>{Jb={main:{loadingPlugin:"\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043F\u043B\u0430\u0433\u0438\u043D\u0430: {{name}} v{{version}}",unloadingPlugin:"\u0412\u044B\u0433\u0440\u0443\u0437\u043A\u0430 \u043F\u043B\u0430\u0433\u0438\u043D\u0430: {{name}} v{{version}}"},modals:{customStatusModal:{editAvailableAsCommand:{description:"\u0415\u0441\u043B\u0438 \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u043E, \u044D\u0442\u043E\u0442 \u0441\u0442\u0430\u0442\u0443\u0441 \u0431\u0443\u0434\u0435\u0442 \u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D \u043A\u0430\u043A \u043A\u043E\u043C\u0430\u043D\u0434\u0430, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0432\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C \u0433\u043E\u0440\u044F\u0447\u0443\u044E \u043A\u043B\u0430\u0432\u0438\u0448\u0443 \u0438 \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441 \u0441 \u0435\u0435 \u043F\u043E\u043C\u043E\u0449\u044C\u044E.",name:"\u0414\u043E\u0441\u0442\u0443\u043F\u043D\u043E \u043A\u0430\u043A \u043A\u043E\u043C\u0430\u043D\u0434\u0430"},editNextStatusSymbol:{description:"\u041F\u0440\u0438 \u043D\u0430\u0436\u0430\u0442\u0438\u0438 \u044D\u0442\u043E \u0441\u0438\u043C\u0432\u043E\u043B, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u0441\u043B\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C.",name:"\u0421\u0438\u043C\u0432\u043E\u043B \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0433\u043E \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u0434\u0430\u0447\u0438"},editStatusName:{description:"\u042D\u0442\u043E \u043F\u043E\u043D\u044F\u0442\u043D\u043E\u0435 \u0438\u043C\u044F \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u0434\u0430\u0447\u0438.",name:"\u0418\u043C\u044F \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0437\u0430\u0434\u0430\u0447\u0438"},editStatusSymbol:{description:"\u042D\u0442\u043E \u0441\u0438\u043C\u0432\u043E\u043B \u043C\u0435\u0436\u0434\u0443 \u043A\u0432\u0430\u0434\u0440\u0430\u0442\u043D\u044B\u043C\u0438 \u0441\u043A\u043E\u0431\u043A\u0430\u043C\u0438. (\u0415\u0433\u043E \u043C\u043E\u0436\u043D\u043E \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440
Line truncated
|
||||||
|
path does not include _templates/
|
||||||
|
limit 300
|
||||||
|
show urgency`}},presets:{line1:"",line2:"",name:""},recurringTasks:{heading:"\u041F\u043E\u0432\u0442\u043E\u0440\u044F\u044E\u0449\u0438\u0435\u0441\u044F \u0437\u0430\u0434\u0430\u0447\u0438",nextLine:{description:"\u0412\u043A\u043B\u044E\u0447\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u0439 \u043E\u043F\u0446\u0438\u0438 \u043F\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043A \u0442\u043E\u043C\u0443, \u0447\u0442\u043E \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0435\u043D\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F \u043D\u0430 \u0441\u0442\u0440\u043E\u043A\u0435 \u043D\u0438\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412 \u043F\u0440\u043E\u0442\u0438\u0432\u043D\u043E\u043C \u0441\u043B\u0443\u0447\u0430\u0435 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0435\u043D\u0438\u0435 \u043F\u043E\u044F\u0432\u0438\u0442\u0441\u044F \u043F\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u043E\u0439.",name:"\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0435\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0435\u043D\u0438\u0435 \u043F\u043E\u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u043D\u0430 \u0441\u0442\u0440\u043E\u043A\u0435 \u043D\u0438\u0436\u0435"},removeScheduledDate:{description:{line1:"",line2:""},name:""}},seeTheDocumentation:"\u0421\u043C\u043E\u0442\u0440\u0438\u0442\u0435 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0438\u044E",statuses:{collections:{anuppuccinTheme:"\u0422\u0435\u043C\u0430 AnuPpuccin",auraTheme:"\u0422\u0435\u043C\u0430 Aura",borderTheme:"\u0422\u0435\u043C\u0430 Border",buttons:{addCollection:{name:"{{themeName}}: \u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C {{numberOfStatuses}} \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043C\u044B\u0445 \u0441\u0442\u0430\u0442\u0443\u0441\u043E\u0432"}},ebullientworksTheme:"\u0422\u0435\u043C\u0430 Ebullientworks",itsThemeAndSlrvbCheckboxes:"\u0422\u0435\u043C\u0430 ITS \u0438 \u0444\u043B\u0430\u0436\u043A\u0438 SlRvb",lytModeTheme:"\u0422\u0435\u043C\u0430 LYT Mode (\u0442\u043E\u043B\u044C\u043A\u043E \u0442\u0435\u043C\u043D\u044B\u0439 \u0440\u0435\u0436\u0438\u043C)",minimalTheme:"\u0422\u0435\u043C\u0430 Minimal",thingsTheme:"\u0422\u0435\u043C\u0430 Things"},coreStatuses:{buttons:{checkStatuses:{name:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438 \u043F\u0440\u043E\u0432\u0435\u0440\u0438\u0442\u044C \u0441\u0432\u043E\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u044B",tooltip:"\u0421\u043E\u0437\u0434\u0430\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0444\u0430\u0439\u043B \u0432 \u043A\u043E\u0440\u043D\u0435 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430, \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 Mermaid \u0434\u0438\u0430\u0433\u0440\u0430\u043C\u043C\u0443 \u0442\u0435\u043A\u0443\u0449\u0438\u0445 \u043D\u0430\u0441\u0442\u0440\u043E\u0435\u043A \u0441\u0442\u0430\u0442\u0443\u0441\u043E\u0432."}},description:{line1:"\u042D\u0442\u043E \u043E\u0441\u043D\u043E\u0432\u043D\u044B\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u044B, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 Tasks \u043F\u043E\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043D\u0430\u0447\u0430\u043B\u044C\u043D\u043E, \u0431\u0435\u0437 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E\u0441\u0442\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0445 CSS \u0441\u0442\u0438\u043B\u0435\u0439 \u0438\u043B\u0438 \u0442\u0435\u043C.",line2:"\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u044F\u0442\u044C \u0441\u0432\u043E\u0438 \u0441\u043E\u0431\u0441\u0442\u0432\u0435\u043D\u043D\u044B\u0435 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u044B \u0432 \u0440\u0430\u0437\u0434\u0435\u043B\u0435 \u043D\u0438\u0436\u0435."},heading:"\u041E\u0441\u043D\u043E\u0432\u043D\u044B\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u044B"},customStatuses:{buttons:{addAllUnknown:{name:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432\u0441\u0435 \u043D\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043D\u044B\u0435 \u0442\u0438\u043F\u044B \u0441\u0442\u0430\u0442\u0443\u0441\u043E\u0432"},addNewStatus:{name:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043D\u043E\u0432\u044B\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u0434\u0430\u0447\u0438"},resetCustomStatuses:{name:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043F\u043E\u0
Line truncated
|
||||||
|
path does not include _templates/
|
||||||
|
limit 300
|
||||||
|
show urgency`}},presets:{line1:"",line2:"",name:""},recurringTasks:{heading:"\u041F\u043E\u0432\u0442\u043E\u0440\u044E\u0432\u0430\u043D\u0456 \u0437\u0430\u0434\u0430\u0447\u0456",nextLine:{description:"\u0423\u0432\u0456\u043C\u043A\u043D\u0435\u043D\u043D\u044F \u0446\u044C\u043E\u0433\u043E \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430 \u0437\u043C\u0443\u0441\u0438\u0442\u044C \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0435\u043D\u043D\u044F \u0437\u0430\u0434\u0430\u0447\u0456 \u0437\u2019\u044F\u0432\u043B\u044F\u0442\u0438\u0441\u044F \u043D\u0430 \u0440\u044F\u0434\u043A\u0443 \u043D\u0438\u0436\u0447\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E\u0457 \u0437\u0430\u0434\u0430\u0447\u0456. \u0406\u043D\u0430\u043A\u0448\u0435 \u043D\u0430\u0441\u0442\u0443\u043F\u043D\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0435\u043D\u043D\u044F \u0437\u2019\u044F\u0432\u0438\u0442\u044C\u0441\u044F \u043F\u0435\u0440\u0435\u0434 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043E\u044E.",name:"\u041D\u0430\u0441\u0442\u0443\u043F\u043D\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0435\u043D\u043D\u044F \u0437\u2019\u044F\u0432\u043B\u044F\u0454\u0442\u044C\u0441\u044F \u043D\u0430 \u0440\u044F\u0434\u043A\u0443 \u043D\u0438\u0436\u0447\u0435"},removeScheduledDate:{description:{line1:"",line2:""},name:""}},seeTheDocumentation:"\u041F\u0435\u0440\u0435\u0433\u043B\u044F\u043D\u0443\u0442\u0438 \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430\u0446\u0456\u044E",statuses:{collections:{anuppuccinTheme:"\u0422\u0435\u043C\u0430 AnuPpuccin",auraTheme:"\u0422\u0435\u043C\u0430 Aura",borderTheme:"\u0422\u0435\u043C\u0430 Border",buttons:{addCollection:{name:"{{themeName}}: \u0414\u043E\u0434\u0430\u0442\u0438 {{numberOfStatuses}} \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0432\u0430\u043D\u0438\u0445 \u0441\u0442\u0430\u0442\u0443\u0441\u0456\u0432"}},ebullientworksTheme:"\u0422\u0435\u043C\u0430 Ebullientworks",itsThemeAndSlrvbCheckboxes:"\u0422\u0435\u043C\u0430 ITS \u0456 \u043F\u0440\u0430\u043F\u043E\u0440\u0446\u0456 SlRvb",lytModeTheme:"\u0422\u0435\u043C\u0430 LYT Mode (\u043B\u0438\u0448\u0435 \u0442\u0435\u043C\u043D\u0438\u0439 \u0440\u0435\u0436\u0438\u043C)",minimalTheme:"\u041C\u0456\u043D\u0456\u043C\u0430\u043B\u044C\u043D\u0430 \u0442\u0435\u043C\u0430",thingsTheme:"\u0422\u0435\u043C\u0430 Things"},coreStatuses:{buttons:{checkStatuses:{name:"\u041F\u0435\u0440\u0435\u0433\u043B\u044F\u043D\u0443\u0442\u0438 \u0442\u0430 \u043F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438 \u0432\u0430\u0448\u0456 \u0441\u0442\u0430\u0442\u0443\u0441\u0438",tooltip:"\u0421\u0442\u0432\u043E\u0440\u0456\u0442\u044C \u043D\u043E\u0432\u0438\u0439 \u0444\u0430\u0439\u043B \u0443 \u043A\u043E\u0440\u0435\u043D\u0456 \u0441\u0445\u043E\u0432\u0438\u0449\u0430, \u0449\u043E \u043C\u0456\u0441\u0442\u0438\u0442\u044C \u0434\u0456\u0430\u0433\u0440\u0430\u043C\u0443 Mermaid \u043F\u043E\u0442\u043E\u0447\u043D\u0438\u0445 \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u044C \u0441\u0442\u0430\u0442\u0443\u0441\u0443."}},description:{line1:"\u0426\u0435 \u043E\u0441\u043D\u043E\u0432\u043D\u0456 \u0441\u0442\u0430\u0442\u0443\u0441\u0438, \u044F\u043A\u0456 Tasks \u043F\u0456\u0434\u0442\u0440\u0438\u043C\u0443\u0454 \u043D\u0430\u0442\u0438\u0432\u043D\u043E, \u0431\u0435\u0437 \u043F\u043E\u0442\u0440\u0435\u0431\u0438 \u0432 \u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044C\u043A\u043E\u043C\u0443 CSS-\u0441\u0442\u0438\u043B\u044E\u0432\u0430\u043D\u043D\u0456 \u0447\u0438 \u0442\u0435\u043C\u0430\u0445.",line2:"\u0412\u0438 \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0434\u0430\u0432\u0430\u0442\u0438, \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0442\u0430 \u0434\u043E\u0434\u0430\u0432\u0430\u0442\u0438 \u0432\u043B\u0430\u0441\u043D\u0456 \u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044C\u043A\u0456 \u0441\u0442\u0430\u0442\u0443\u0441\u0438 \u0432 \u0440\u043E\u0437\u0434\u0456\u043B\u0456 \u043D\u0438\u0436\u0447\u0435."},heading:"\u041E\u0441\u043D\u043E\u0432\u043D\u0456 \u0441\u0442\u0430\u0442\u0443\u0441\u0438"},customStatuses:{buttons:{addAllUnknown:{name:"\u0414\u043E\u0434\u0430\u0442\u0438 \u0432\u0441\u0456 \u043D\u0435\u0432\u0456\u0434\u043E\u043C\u0456 \u0442\u0438\u043F\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0456\u0432"},addNewStatus:{name:"\u0414\u043E\u0434\u0430\u0442\u0438 \u043D\u043E\u0432\u0438\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u0434\u0430\u0447\u0456"},resetCustomStatuses:{name:"\u0421\u043A\u0438\u043D\u0443\u0442\u0438 \u043A\u043E\u0440\u0438\u0441\u0442\u0443\u0432\u0430\u0446\u044C\u043A\u0456 \u0442\u0438\u043F\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0456\u0432 \u0434\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u044C \u0437\u0430 \u0437\u0430\u043C\u043E\u0432\u0447\u0443\u0432\u0430\u043D\u043D\uLine truncated
|
||||||
|
path does not include _templates/
|
||||||
|
limit 300
|
||||||
|
show urgency`}},presets:{line1:"",line2:"",name:""},recurringTasks:{heading:"\u91CD\u590D\u6027\u4EFB\u52A1",nextLine:{description:"\u542F\u7528\u6B64\u529F\u80FD\u540E\uFF0C\u4EFB\u52A1\u7684\u4E0B\u4E00\u6B21\u91CD\u590D\u5C06\u663E\u793A\u5728\u5DF2\u5B8C\u6210\u4EFB\u52A1\u7684\u4E0B\u4E00\u884C\u3002\u82E5\u5173\u95ED\u6B64\u529F\u80FD\uFF0C\u5219\u4E0B\u4E00\u6B21\u91CD\u590D\u5C06\u51FA\u73B0\u5728\u5DF2\u5B8C\u6210\u4EFB\u52A1\u7684\u4E0A\u4E00\u884C\u3002",name:"\u628A\u4EFB\u52A1\u7684\u4E0B\u4E00\u6B21\u91CD\u590D\u653E\u5728\u4E0B\u4E00\u884C"},removeScheduledDate:{description:{line1:"\u5F00\u542F\u6B64\u9009\u9879\u540E\uFF0C\u5F53\u4EFB\u52A1\u81F3\u5C11\u8BBE\u7F6E\u4E86\u5F00\u59CB\u65E5\u671F(\u{1F6EB})\u6216\u8BA1\u5212\u65E5\u671F(\u{1F4C5})\u4E2D\u7684\u4E00\u4E2A\u65F6\uFF0C\u8BE5\u4EFB\u52A1\u7684\u4E0B\u4E00\u6B21\u91CD\u590D\u5468\u671F\u5C06\u4E0D\u518D\u5305\u542B\u8BA1\u5212\u65E5\u671F(\u23F3)\u3002",line2:"\u6B64\u529F\u80FD\u9002\u7528\u4E8E\u4F60\u5E0C\u671B\u5C06\u5F00\u59CB\u548C\u622A\u6B62\u65E5\u671F\u5EF6\u7EED\u5230\u4E0B\u4E00\u4E2A\u5468\u671F\uFF0C\u4F46\u8BA1\u5212\u65E5\u671F\u6682\u4E0D\u8BBE\u7F6E\uFF0C\u7B49\u5B9E\u9645\u5F00\u59CB\u5904\u7406\u65F6\u518D\u786E\u5B9A\u7684\u60C5\u51B5\u3002"},name:"\u5728\u91CD\u590D\u6027\u4EFB\u52A1\u4E2D\u79FB\u9664\u8BA1\u5212\u65E5\u671F"}},seeTheDocumentation:"\u53C2\u9605\u6587\u6863",statuses:{collections:{anuppuccinTheme:"AnuPpuccin \u4E3B\u9898",auraTheme:"Aura \u4E3B\u9898",borderTheme:"Border \u4E3B\u9898",buttons:{addCollection:{name:"{{themeName}}: \u6DFB\u52A0 {{numberOfStatuses}} \u79CD\u652F\u6301\u72B6\u6001"}},ebullientworksTheme:"Ebullientworks \u4E3B\u9898",itsThemeAndSlrvbCheckboxes:"ITS \u4E3B\u9898\u548C SlRvb \u590D\u9009\u6846",lytModeTheme:"LYT Mode \u4E3B\u9898 (\u4EC5\u6DF1\u8272\u6A21\u5F0F)",minimalTheme:"Minimal \u4E3B\u9898",thingsTheme:"Things \u4E3B\u9898"},coreStatuses:{buttons:{checkStatuses:{name:"\u67E5\u770B\u5E76\u68C0\u67E5\u60A8\u7684\u72B6\u6001",tooltip:"\u5728\u5E93\u7684\u6839\u76EE\u5F55\u4E0B\u521B\u5EFA\u4E00\u4E2A\u65B0\u6587\u4EF6,\u5305\u542B\u5F53\u524D\u72B6\u6001\u8BBE\u7F6E\u7684 Mermaid \u56FE\u8868."}},description:{line1:"\u8FD9\u4E9B\u662F Tasks \u539F\u751F\u652F\u6301\u7684\u6838\u5FC3\u72B6\u6001\uFF0C\u4E0D\u9700\u8981\u81EA\u5B9A\u4E49CSS\u6837\u5F0F\u6216\u4E3B\u9898\u3002",line2:"\u60A8\u53EF\u4EE5\u5728\u4E0B\u9762\u7F16\u8F91\u548C\u6DFB\u52A0\u81EA\u5B9A\u4E49\u72B6\u6001\u3002"},heading:"\u6838\u5FC3\u72B6\u6001"},customStatuses:{buttons:{addAllUnknown:{name:"\u6DFB\u52A0\u6240\u6709\u672A\u77E5\u72B6\u6001\u7C7B\u578B"},addNewStatus:{name:"\u6DFB\u52A0\u65B0\u4EFB\u52A1\u72B6\u6001"},resetCustomStatuses:{name:"\u91CD\u7F6E\u81EA\u5B9A\u4E49\u72B6\u6001\u7C7B\u578B\u4E3A\u9ED8\u8BA4\u503C"}},description:{line1:"\u60A8\u5E94\u8BE5\u9996\u5148<b>\u9009\u62E9\u5E76\u5B89\u88C5 CSS\u4EE3\u7801\u6BB5\u6216\u4E3B\u9898<b>\u4EE5\u8BBE\u7F6E\u81EA\u5B9A\u4E49\u590D\u9009\u6846\u7684\u6837\u5F0F",line2:"\u7136\u540E\uFF0C\u4F7F\u7528\u4E0B\u9762\u7684\u6309\u94AE\u8BBE\u7F6E\u60A8\u7684\u81EA\u5B9A\u4E49\u72B6\u6001,\u4EE5\u5339\u914D\u60A8\u9009\u62E9\u7684CSS\u590D\u9009\u6846.",line3:"<b>\u6CE8\u610F</b>\u4EFB\u4F55\u4E0E\u66F4\u65E9\u7684\u72B6\u6001\u5177\u6709\u76F8\u540C\u7B26\u53F7\u7684\u72B6\u6001\u90FD\u5C06\u88AB\u5FFD\u7565.\u60A8\u53EF\u4EE5\u901A\u8FC7\u8FD0\u884C\u201CCreate or edit task\u201D\u547D\u4EE4\u5E76\u67E5\u770B\u201CStatus\u201D\u4E0B\u62C9\u5217\u8868\u6765\u786E\u8BA4\u5B9E\u9645\u52A0\u8F7D\u7684\u72B6\u6001\u3002",line4:"\u53C2\u9605\u6587\u6863\uFF01"},heading:"\u81EA\u5B9A\u4E49\u72B6\u6001"},heading:"\u4EFB\u52A1\u72B6\u6001"}}}});var Hf,fO,iT,M,ys=X(()=>{"use strict";Gb();Bb();zb();Qb();Xb();eT();nT();Hf=!1,fO=()=>{let r=localStorage.getItem("language"),t=(r==null?void 0:r.toLowerCase())||"en";return console.log(`Language in Obsidian settings: '${t}'; requesting Tasks in '${t}'.`),t},iT=()=>I(void 0,null,function*(){Hf||(yield yt.init({lng:fO(),fallbackLng:"en",returnEmptyString:!1,resources:{be:{translation:Vb},de:{translation:Kb},en:{translation:Zb},ru:{translation:Jb},uk:{translation:tT},zh:{translation:rT}},interpolation:{escapeValue:!1}}),Hf=!0)}),M=new Proxy(yt,{get(r,t){if(!Hf&&t==="t")throw new Error("i18n.t() called before initialization. Call initializeI18n() first.");return Reflect.get(r,t)}})});var kn,fe,si=X(()=>{"use strict";kn=class{},fe=kn;fe.dateFormat="YYYY-MM-DD",fe.dateTimeFormat="YYYY-MM-DD HH:mm",fe.indentationRegex=/^([\s\t>]*)/,fe.listMarkerRegex=/([-*+]|[0-9]+[.)])/,fe.checkboxRegex=/\[(.)\]/u,fe.afterCheckboxRegex=/ *(.*)/u,fe.taskRegex=new RegExp(kn.indentationRegex.source+kn.listMarkerRegex.source+" +"+kn.checkboxRegex.source+kn.afterCheckboxRegex.source,"u"),fe.nonTaskRegex=new RegExp(kn.indentationRegex.source+kn.listMarkerRegex.source+"? *("+kn.checkboxRegex.source+")?"+kn.afterCheckboxRegex.source,"u"),fe.listItemRegex=new RegExp(kn.indentationRegex.source+kn.listMarkerRegex.source),fe.blockLinkRegex
Line truncated
|
||||||
|
`).map(BL).filter(function(e){return e!==null});return Pt(Pt({},t[0]),t[1])}function Zl(r){var t={},e=/DTSTART(?:;TZID=([^:=]+?))?(?::|=)([^;\s]+)/i.exec(r);if(!e)return t;var n=e[1],i=e[2];return n&&(t.tzid=n),t.dtstart=Vl(i),t}function BL(r){if(r=r.replace(/^\s+|\s+$/,""),!r.length)return null;var t=/^([A-Z]+?)[:;]/.exec(r.toUpperCase());if(!t)return eS(r);var e=t[1];switch(e.toUpperCase()){case"RRULE":case"EXRULE":return eS(r);case"DTSTART":return Zl(r);default:throw new Error("Unsupported RFC prop ".concat(e," in ").concat(r))}}function eS(r){var t=r.replace(/^RRULE:/i,""),e=Zl(t),n=r.replace(/^(?:RRULE|EXRULE):/i,"").split(";");return n.forEach(function(i){var s=i.split("="),a=s[0],o=s[1];switch(a.toUpperCase()){case"FREQ":e.freq=Ae[o.toUpperCase()];break;case"WKST":e.wkst=er[o.toUpperCase()];break;case"COUNT":case"INTERVAL":case"BYSETPOS":case"BYMONTH":case"BYMONTHDAY":case"BYYEARDAY":case"BYWEEKNO":case"BYHOUR":case"BYMINUTE":case"BYSECOND":var l=VL(o),u=a.toLowerCase();e[u]=l;break;case"BYWEEKDAY":case"BYDAY":e.byweekday=zL(o);break;case"DTSTART":case"TZID":var c=Zl(r);e.tzid=c.tzid,e.dtstart=c.dtstart;break;case"UNTIL":e.until=Vl(o);break;case"BYEASTER":e.byeaster=Number(o);break;default:throw new Error("Unknown RRULE property '"+a+"'")}}),e}function VL(r){if(r.indexOf(",")!==-1){var t=r.split(",");return t.map(tS)}return tS(r)}function tS(r){return/^[+-]?\d+$/.test(r)?Number(r):r}function zL(r){var t=r.split(",");return t.map(function(e){if(e.length===2)return er[e];var n=e.match(/^([+-]?\d{1,2})([A-Z]{2})$/);if(!n||n.length<3)throw new SyntaxError("Invalid weekday string: ".concat(e));var i=Number(n[1]),s=n[2],a=er[s].weekday;return new ft(a,i)})}var Vg=X(()=>{bi();Ti();Ms();qt();Jn()});var Is,Gc=X(()=>{qt();Is=function(){function r(t,e){if(isNaN(t.getTime()))throw new RangeError("Invalid date passed to DateWithZone");this.date=t,this.tzid=e}return Object.defineProperty(r.prototype,"isUTC",{get:function(){return!this.tzid||this.tzid.toUpperCase()==="UTC"},enumerable:!1,configurable:!0}),r.prototype.toString=function(){var t=Fa(this.date.getTime(),this.isUTC);return this.isUTC?":".concat(t):";TZID=".concat(this.tzid,":").concat(t)},r.prototype.getTime=function(){return this.date.getTime()},r.prototype.rezonedDate=function(){return this.isUTC?this.date:$k(this.date,this.tzid)},r}()});function Jl(r){for(var t=[],e="",n=Object.keys(r),i=Object.keys(Ql),s=0;s<n.length;s++)if(n[s]!=="tzid"&&!!Fe(i,n[s])){var a=n[s].toUpperCase(),o=r[n[s]],l="";if(!(!Je(o)||At(o)&&!o.length)){switch(a){case"FREQ":l=oe.FREQUENCIES[r.freq];break;case"WKST":On(o)?l=new ft(o).toString():l=o.toString();break;case"BYWEEKDAY":a="BYDAY",l=Ik(o).map(function(p){return p instanceof ft?p:At(p)?new ft(p[0],p[1]):new ft(p)}).toString();break;case"DTSTART":e=KL(o,r.tzid);break;case"UNTIL":l=Fa(o,!r.tzid);break;default:if(At(o)){for(var u=[],c=0;c<o.length;c++)u[c]=String(o[c]);l=u.toString()}else l=String(o)}l&&t.push([a,l])}}var d=t.map(function(p){var b=p[0],T=p[1];return"".concat(b,"=").concat(T.toString())}).join(";"),f="";return d!==""&&(f="RRULE:".concat(d)),[e,f].filter(function(p){return!!p}).join(`
|
||||||
|
`)}function KL(r,t){return r?"DTSTART"+new Is(new Date(r),t).toString():""}var zg=X(()=>{Jn();rn();Ms();qt();Gc()});function QL(r,t){return Array.isArray(r)?!Array.isArray(t)||r.length!==t.length?!1:r.every(function(e,n){return e.getTime()===t[n].getTime()}):r instanceof Date?t instanceof Date&&r.getTime()===t.getTime():r===t}var nS,rS=X(()=>{Wc();qt();rn();nS=function(){function r(){this.all=!1,this.before=[],this.after=[],this.between=[]}return r.prototype._cacheAdd=function(t,e,n){e&&(e=e instanceof Date?$c(e):Wg(e)),t==="all"?this.all=e:(n._value=e,this[t].push(n))},r.prototype._cacheGet=function(t,e){var n=!1,i=e?Object.keys(e):[],s=function(c){for(var d=0;d<i.length;d++){var f=i[d];if(!QL(e[f],c[f]))return!0}return!1},a=this[t];if(t==="all")n=this.all;else if(At(a))for(var o=0;o<a.length;o++){var l=a[o];if(!(i.length&&s(l))){n=l._value;break}}if(!n&&this.all){for(var u=new yi(t,e),o=0;o<this.all.length&&u.accept(this.all[o]);o++);n=u.getValue(),this._cacheAdd(t,n,e)}return At(n)?Wg(n):n instanceof Date?$c(n):n},r}()});var iS,sS,ZL,XL,qi,Ht,aS,oS,JL,e2,Hi,Gt,lS,uS,cS,dS,Kg,fS=X(()=>{bi();rn();iS=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ie(1,31),!0),Ie(2,28),!0),Ie(3,31),!0),Ie(4,30),!0),Ie(5,31),!0),Ie(6,30),!0),Ie(7,31),!0),Ie(8,31),!0),Ie(9,30),!0),Ie(10,31),!0),Ie(11,30),!0),Ie(12,31),!0),Ie(1,7),!0),sS=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ie(1,31),!0),Ie(2,29),!0),Ie(3,31),!0),Ie(4,30),!0),Ie(5,31),!0),Ie(6,30),!0),Ie(7,31),!0),Ie(8,31),!0),Ie(9,30),!0),Ie(10,31),!0),Ie(11,30),!0),Ie(12,31),!0),Ie(1,7),!0),ZL=Xn(1,29),XL=Xn(1,30),qi=Xn(1,31),Ht=Xn(1,32),aS=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ht,!0),XL,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht.slice(0,7),!0),oS=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Ht,!0),ZL,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht,!0),qi,!0),Ht,!0),qi,!0),Ht,!0),Ht.slice(0,7),!0),JL=Xn(-28,0),e2=Xn(-29,0),Hi=Xn(-30,0),Gt=Xn(-31,0),lS=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Gt,!0),e2,!0),Gt,!0),Hi,!0),Gt,!0),Hi,!0),Gt,!0),Gt,!0),Hi,!0),Gt,!0),Hi,!0),Gt,!0),Gt.slice(0,7),!0),uS=Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q(Q([],Gt,!0),JL,!0),Gt,!0),Hi,!0),Gt,!0),Hi,!0),Gt,!0),Gt,!0),Hi,!0),Gt,!0),Hi,!0),Gt,!0),Gt.slice(0,7),!0),cS=[0,31,60,91,121,152,182,213,244,274,305,335,366],dS=[0,31,59,90,120,151,181,212,243,273,304,334,365],Kg=function(){for(var r=[],t=0;t<55;t++)r=r.concat(Xn(7));return r}()});function pS(r,t){var e=Hr(r,1,1),n=Ia(r)?366:365,i=Ia(r+1)?366:365,s=Bl(e),a=hi(e),o=Pt(Pt({yearlen:n,nextyearlen:i,yearordinal:s,yearweekday:a},t2(r)),{wnomask:null});if(Rn(t.byweekno))return o;o.wnomask=Ie(0,n+7);var l,u,c=l=Wt(7-a+t.wkst,7);c>=4?(c=0,u=o.yearlen+Wt(a-t.wkst,7)):u=n-c;for(var d=Math.floor(u/7),f=Wt(u,7),p=Math.floor(d+f/4),b=0;b<t.byweekno.length;b++){var T=t.byweekno[b];if(T<0&&(T+=p+1),T>0&&T<=p){var v=void 0;T>1?(v=c+(T-1)*7,c!==l&&(v-=7-l)):v=c;for(var O=0;O<7&&(o.wnomask[v]=1,v++,o.wdaymask[v]!==t.wkst);O++);}}if(Fe(t.byweekno,1)){var v=c+p*7;if(c!==l&&(v-=7-l),v<n)for(var b=0;b<7&&(o.wnomask[v]=1,v+=1,o.wdaymask[v]!==t.wkst);b++);}if(c){var E=void 0;if(Fe(t.byweekno,-1))E=-1;else{var P=hi(Hr(r-1,1,1)),Y=Wt(7-P.valueOf()+t.wkst,7),q=Ia(r-1)?366:365,ae=void 0;Y>=4?(Y=0,ae=q+Wt(P-t.wkst,7)):ae=n-c,E=Math.floor(52+Wt(ae,7)/4)}if(Fe(t.byweekno,E))for(var v=0;v<c;v++)o.wnomask[v]=1}return o}function t2(r){var t=Ia(r)?366:365,e=Hr(r,1,1),n=hi(e);return t===365?{mmask:iS,mdaymask:oS,nmdaymask:uS,wdaymask:Kg.slice(n),mrange:dS}:{mmask:sS,mdaymask:aS,nmdaymask:lS,wdaymask:Kg.slice(n),mrange:cS}}var mS=X(()=>{bi();qt();rn();fS()});function hS(r,t,e,n,i,s){var a={lastyear:r,lastmonth:t,nwdaymask:[]},o=[];if(s.freq===oe.YEARLY)if(Rn(s.bymonth))o=[[0,e]];else for(var l=0;l<s.bymonth.length;l++)t=s.bymonth[l],o.push(n.slice(t-1,t+1));else s.freq===oe.MONTHLY&&(o=[n.slice(t-1,t+1)]);if(Rn(o))return a;a.nwdaymask=Ie(0,e);for(var l=0;l<o.length;l++)for(var u=o[l],c=u[0],d=u[1]-1,f=0;f<s.bynweekday.length;f++){var p=void 0,b=s.bynweekday[f],T=b[0],v=b[1];v<0?(p=d+(v+1)*7,p-=Wt(i[p]-T,7)):(p=c+(v-1)*7,p+=Wt(7-i[p]+T,7)),c<=p&&p<=d&&(a.nwdaymask[p]=1)}return a}var gS=X(()=>{Jn();rn()});function yS(r,t){t===void 0&&(t=0);var e=r%19,n=Math.floor(r/100),i=r%100,s=Math.floor(n/4),a=n%4,o=Math.floor((n+8)/25),l=Math.floor((n-o+1)/3),u=Math.floor(19*e+n-s-l+15)%30,c=Math.floor(i/4),d=i%4,f=Math.floor(32+2*a+2*c-u-d)%7,p=Math.floor((e+11*u+22*f)/451),b=Math.floor((u+f-7*p+114)/31),T=(u+f-7*p+114)%31+1,v=Date.UTC(r,b-1,T+t),O=Date.UTC(r,0,1);return[Math.ceil((v-O)/(1e3*60*60*24))]}var bS=X(()=>{});var n2,TS,vS=X(()=>{rn();Ti();mS();gS();bS();Hc();qt();n2=function(){function r(t){this.options=t}return r.prototype.rebuild=function(t,e){var n=this.options;if(t!==this.lastyear&&(this.yearinfo=pS(t,n)),at(n.bynweekday)&&(e!==this.lastmonth||t!==this.lastyear)){var i=this.yearinfo,s=i.yearlen,a=i.mrange,o=i.wdaymask;this.monthinfo=hS(t,e,s,a,o,n)}Je(n.byeaster)&&(this.eastermask=yS(t,n.byeaster))},Object.defineProperty(r.prototype,"lastyear",{get:function(){return this.monthinfo?this.monthinfo.lastyear:null},enumerable:!1,config
Line truncated
|
||||||
|
`),n=0;n<e.length;){var i=e[n]=e[n].replace(/\s+$/g,"");i?n>0&&i[0]===" "?(e[n-1]+=i.slice(1),e.splice(n,1)):n+=1:e.splice(n,1)}return e}function f2(r){r.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function xS(r,t){return f2(t),r.split(",").map(function(e){return Vl(e)})}var ES,Xg=X(()=>{bi();Jn();ey();qt();rn();Vg();ES={dtstart:null,cache:!1,unfold:!1,forceset:!1,compatible:!1,tzid:null}});function OS(r){var t=this;return function(e){if(e!==void 0&&(t["_".concat(r)]=e),t["_".concat(r)]!==void 0)return t["_".concat(r)];for(var n=0;n<t._rrule.length;n++){var i=t._rrule[n].origOptions[r];if(i)return i}}}function RS(r,t){if(!(r instanceof oe))throw new TypeError(String(r)+" is not RRule instance");Fe(t.map(String),String(r))||t.push(r)}function CS(r,t){if(!(r instanceof Date))throw new TypeError(String(r)+" is not Date instance");Fe(t.map(Number),Number(r))||(t.push(r),gi(t))}function MS(r,t,e){var n=!e||e.toUpperCase()==="UTC",i=n?"".concat(r,":"):"".concat(r,";TZID=").concat(e,":"),s=t.map(function(a){return Fa(a.valueOf(),n)}).join(",");return"".concat(i).concat(s)}var Jg,ey=X(()=>{bi();Jn();qt();rn();DS();Xg();zg();Jg=function(r){La(t,r);function t(e){e===void 0&&(e=!1);var n=r.call(this,{},e)||this;return n.dtstart=OS.apply(n,["dtstart"]),n.tzid=OS.apply(n,["tzid"]),n._rrule=[],n._rdate=[],n._exrule=[],n._exdate=[],n}return t.prototype._iter=function(e){return SS(e,this._rrule,this._exrule,this._rdate,this._exdate,this.tzid())},t.prototype.rrule=function(e){RS(e,this._rrule)},t.prototype.exrule=function(e){RS(e,this._exrule)},t.prototype.rdate=function(e){CS(e,this._rdate)},t.prototype.exdate=function(e){CS(e,this._exdate)},t.prototype.rrules=function(){return this._rrule.map(function(e){return Vc(e.toString())})},t.prototype.exrules=function(){return this._exrule.map(function(e){return Vc(e.toString())})},t.prototype.rdates=function(){return this._rdate.map(function(e){return new Date(e.getTime())})},t.prototype.exdates=function(){return this._exdate.map(function(e){return new Date(e.getTime())})},t.prototype.valueOf=function(){var e=[];return!this._rrule.length&&this._dtstart&&(e=e.concat(Jl({dtstart:this._dtstart}))),this._rrule.forEach(function(n){e=e.concat(n.toString().split(`
|
||||||
|
`))}),this._exrule.forEach(function(n){e=e.concat(n.toString().split(`
|
||||||
|
`).map(function(i){return i.replace(/^RRULE:/,"EXRULE:")}).filter(function(i){return!/^DTSTART/.test(i)}))}),this._rdate.length&&e.push(MS("RDATE",this._rdate,this.tzid())),this._exdate.length&&e.push(MS("EXDATE",this._exdate,this.tzid())),e},t.prototype.toString=function(){return this.valueOf().join(`
|
||||||
|
`)},t.prototype.clone=function(){var e=new t(!!this._cache);return this._rrule.forEach(function(n){return e.rrule(n.clone())}),this._exrule.forEach(function(n){return e.exrule(n.clone())}),this._rdate.forEach(function(n){return e.rdate(new Date(n.getTime()))}),this._exdate.forEach(function(n){return e.exdate(new Date(n.getTime()))}),e},t}(oe)});var AS=X(()=>{Jn();ey();Xg();Ti();Ms();qt()});var Dt,zc=X(()=>{"use strict";AS();Dt=class{constructor({rrule:t,baseOnToday:e,occurrence:n}){this.rrule=t,this.baseOnToday=e,this.occurrence=n}static fromText({recurrenceRuleText:t,occurrence:e}){try{let n=t.match(/^([a-zA-Z0-9, !]+?)( when done)?$/i);if(n==null)return null;let i=n[1].trim(),s=n[2]!==void 0,a=oe.parseText(i);if(a!==null){let o=e.referenceDate;!s&&o!==null?a.dtstart=window.moment(o).startOf("day").utc(!0).toDate():a.dtstart=window.moment().startOf("day").utc(!0).toDate();let l=new oe(a);return new Dt({rrule:l,baseOnToday:s,occurrence:e})}}catch(n){n instanceof Error&&console.log(n.message)}return null}toText(){let t=this.rrule.toText();return this.baseOnToday&&(t+=" when done"),t}next(t=window.moment(),e=!1){let n=this.nextReferenceDate(t);return n===null?null:this.occurrence.next(n,e)}identicalTo(t){return this.baseOnToday!==t.baseOnToday||!this.occurrence.isIdenticalTo(t.occurrence)?!1:this.toText()===t.toText()}nextReferenceDate(t){return this.baseOnToday?this.nextReferenceDateFromToday(t.clone()).toDate():this.nextReferenceDateFromOriginalReferenceDate().toDate()}nextReferenceDateFromToday(t){let e=new oe(de(F({},this.rrule.origOptions),{dtstart:t.startOf("day").utc(!0).toDate()}));return this.nextAfter(t.endOf("day"),e)}nextReferenceDateFromOriginalReferenceDate(){var e;let t=window.moment((e=this.occurrence.referenceDate)!=null?e:void 0).endOf("day");return this.nextAfter(t,this.rrule)}nextAfter(t,e){t.utc(!0);let n=window.moment.utc(e.after(t.toDate())),i=this.toText(),s=i.match(/every( \d+)? month(s)?(.*)?/);s!==null&&(i.includes(" on ")||(n=Dt.nextAfterMonths(t,n,e,s[1])));let a=i.match(/every( \d+)? year(s)?(.*)?/);return a!==null&&(n=Dt.nextAfterYears(t,n,e,a[1])),Dt.addTimezone(n)}static nextAfterMonths(t,e,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Dt.isSkippingTooManyMonths(t,e,s);)e=Dt.fromOneDayEarlier(t,n);return e}static isSkippingTooManyMonths(t,e,n){let i=e.month()-t.month();return i+=(e.year()-t.year())*12,i>n}static nextAfterYears(t,e,n,i){let s=1;for(i!==void 0&&(s=Number.parseInt(i.trim(),10));Dt.isSkippingTooManyYears(t,e,s);)e=Dt.fromOneDayEarlier(t,n);return e}static isSkippingTooManyYears(t,e,n){return e.year()-t.year()>n}static fromOneDayEarlier(t,e){t.subtract(1,"days").endOf("day");let n=e.origOptions;return n.dtstart=t.startOf("day").toDate(),e=new oe(n),window.moment.utc(e.after(t.toDate()))}static addTimezone(t){return window.moment.utc(t).set({hour:12,minute:0,second:0,millisecond:0}).local(!0).startOf("day")}}});function PS(r,t,e){let n=new Map([["cancelled date","cancelledDate"],["created date","createdDate"],["depends on","dependsOn"],["done date","doneDate"],["due date","dueDate"],["id","id"],["on completion","onCompletion"],["priority","priority"],["recurrence rule","recurrenceRule"],["scheduled date","scheduledDate"],["start date","startDate"]]);for(let[i,s]of n.entries())if(t.startsWith(i))return r.setVisibility(s,e),!0;return t.startsWith("tags")?(r.setTagsVisibility(e),!0):!1}var eu,Kc,Br,Fs=X(()=>{"use strict";eu=(p=>(p.Description="description",p.Id="id",p.DependsOn="dependsOn",p.Priority="priority",p.RecurrenceRule="recurrenceRule",p.OnCompletion="onCompletion",p.CreatedDate="createdDate",p.StartDate="startDate",p.ScheduledDate="scheduledDate",p.DueDate="dueDate",p.CancelledDate="cancelledDate",p.DoneDate="doneDate",p.BlockLink="blockLink",p))(eu||{}),Kc=Object.values(eu),Br=class{constructor(){this.visible={};this.tagsVisible=!0;Kc.forEach(t=>{this.visible[t]=!0})}isShown(t){return this.visible[t]}areTagsShown(){return this.tagsVisible}hide(t){this.visible[t]=!1}setVisibility(t,e){this.visible[t]=e}setTagsVisibility(t){this.tagsVisible=t}get shownComponents(){return Kc.filter(t=>this.visible[t])}get hiddenComponents(){return Kc.filter(t=>!this.visible[t])}get toggleableComponents(){return Kc.filter(t=>t!=="description"&&t!=="blockLink")}toggleVisibilityExceptDescriptionAndBlockLink(){this.toggleableComponents.forEach(t=>{this.visible[t]=!this.visible[t]}),this.setTagsVisibility(!this.areTagsShown())}}});var Bt,gt,Cn=X(()=>{"use strict";Bt=(a=>(a.TODO="TODO",a.DONE="DONE",a.IN_PROGRESS="IN_PROGRESS",a.CANCELLED="CANCELLED",a.NON_TASK="NON_TASK",a.EMPTY="EMPTY",a))(Bt||{}),gt=class{constructor(t,e,n,i,s="TODO"){this.symbol=t,this.name=e,this.nextStatusSymbol=n,this.availableAsCommand=i,this.type=s}}});function NS(r){let t=r.trim().toLowerCase();return t==="delete"?"delete":t==="keep"?"keep":""}function p2(r,t){return r.filter(e=>e!==t)}function m2(r,t){let e=r.status,n=t.status,i=n.type===e.type;return n.type!=="DONE"||i}function IS(r,t){le
Line truncated
|
||||||
|
`})),c=c.slice(0,a.autoSuggestMaxItems),c}}function T2(r,t,e){let n=M2(t.substring(0,e),[["(",")"],["[","]"]])=="("?")":"]",i=r?n+" ":" ",s=r&&t.length>e&&t.charAt(e)===n?1:0;return{postfix:i,insertSkip:s}}function v2(r,t,e){let n=[],i=e.line;js(n,i,r.dueDateSymbol,"due date"),js(n,i,r.startDateSymbol,"start date"),js(n,i,r.scheduledDateSymbol,"scheduled date"),_2(n,r,e),js(n,i,r.recurrenceSymbol,"recurring (repeat)"),w2(n,r,e),$S(t)&&(js(n,i,r.idSymbol,"id"),js(n,i,r.dependsOnSymbol,"depends on id")),js(n,i,r.onCompletionSymbol,"on completion");let s=k2(n,e);return s.length===0&&e.settings.autoSuggestMinMatch===0?n:s}function js(r,t,e,n){t.includes(e)||r.push({displayText:`${e} ${n}`,appendText:`${e} `})}function _2(r,t,e){if(!(i=>Object.values(t.prioritySymbols).some(s=>s.length>0&&i.includes(s)))(e.line)){let i=t.prioritySymbols,s=["High","Medium","Low","Highest","Lowest"];for(let a of s){let o=i[a];r.push({displayText:e.dataviewMode?`${o} priority`:`${o} ${a.toLowerCase()} priority`,appendText:`${o}${e.postfix}`,insertSkip:e.dataviewMode?e.insertSkip:void 0})}}}function w2(r,t,e){if(!e.line.includes(t.createdDateSymbol)){let i=xn.parseDate("today",!0).format(fe.dateFormat);r.push({textToMatch:`${t.createdDateSymbol} created`,displayText:`${t.createdDateSymbol} created today (${i})`,appendText:`${t.createdDateSymbol} ${i}`+e.postfix,insertSkip:e.dataviewMode?e.insertSkip:void 0})}}function k2(r,t){let e=Ha(/([a-zA-Z'_-]*)/g,t),n=[];if(e&&e.length>0){let i=e[0];if(i.length>=Math.max(1,t.settings.autoSuggestMinMatch)){let s=r.filter(a=>{var l;return((l=a.textToMatch)!=null?l:a.displayText).toLowerCase().includes(i.toLowerCase())});for(let a of s){let o=t.dataviewMode&&(a.displayText.includes("priority")||a.displayText.includes("created"))?i.length+t.insertSkip:i.length;n.push({suggestionType:"match",displayText:a.displayText,appendText:a.appendText,insertAt:e.index,insertSkip:o})}}}return n}function WS(r,t){let e=`${t}`,n=`${r} ${t}`;return{displayText:e,appendText:n}}function S2(r,t){let n=`${xn.parseDate(t,!0).format(fe.dateFormat)}`,i=`${t} (${n})`,s=`${r} ${n}`;return{displayText:i,appendText:s}}function D2(r,t,e){let n=["today","tomorrow","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","next week","next month","next year"],i=[],s=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),a=Ha(s,e);if(a&&a.length>=2){let o=a[2];if(o.length<e.settings.autoSuggestMinMatch)return[];let l=o&&o.length>1?xn.parseDate(Nc(o),!0):null;if(l!=null&&l.isValid()){let c=l.format(fe.dateFormat);nd(e,a,[c],WS,i)}let u=sy(n,o,t,!0);nd(e,a,u,S2,i)}return i}function E2(r,t){var a;let e=["every","every day","every week","every month","every month on the","every year","every week on Sunday","every week on Monday","every week on Tuesday","every week on Wednesday","every week on Thursday","every week on Friday","every week on Saturday"],n=[],i=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),s=Ha(i,t);if(s&&s.length>=2){let o=s[1],l=s[2];if(l.length<t.settings.autoSuggestMinMatch)return[];if(l.length>0){let f=(a=Dt.fromText({recurrenceRuleText:l,occurrence:new Zn({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:a.toText();if(f){let p=`${o} ${f}`+t.postfix;if(n.push({suggestionType:"match",displayText:`\u2705 ${f}`,appendText:p,insertAt:s.index,insertSkip:ay(s[0],t)}),s[0]==p)return[]}}let u=t.settings.autoSuggestMaxItems/2,c=sy(e,l,u,!1);c.length===0&&l.trim().length===0&&(c=e.slice(0,u)),nd(t,s,c,(f,p)=>{let b=`${p}`,T=`${f} ${p}`;return{displayText:b,appendText:T}},n)}return n}function x2(r,t,e){let n=["delete","keep"],i=[],s=new RegExp(`(${r})\\s*([0-9a-zA-Z ]*)`,"ug"),a=Ha(s,e);if(a&&a.length>=2){let o=a[2];if(o.length<e.settings.autoSuggestMinMatch)return[];let l=sy(n,o,t,!0);nd(e,a,l,WS,i)}return i}function O2(r,t,e){let n=[],i=new RegExp(`(${r})\\s*(${Ls.source})?`,"ug"),s=Ha(i,e);if(s&&s[0].trim().length<=r.length){let a=ru(t.map(o=>o.id));n.push({suggestionType:"match",displayText:"generate unique id",appendText:`${r} ${a}`+e.postfix,insertAt:s.index,insertSkip:ay(s[0],e)})}return n}function R2(r,t,e,n){let i=[],s=e.dataviewMode?Gi("()[]"):FS(),a=new RegExp(`(${r})([0-9a-zA-Z-_ ^,]*,)*([^,${s}]*)`,"ug"),o=Ha(a,e);if(o&&o.length>=1){let l=o[2]||"",u=o[3],c=[];if(l){let d=l.split(",").map(f=>f.trim());c=t.filter(f=>f.id&&d.includes(f.id))}if(u.length>=e.settings.autoSuggestMinMatch){let d=td(u.trim(),t,n,[],c);for(let f of d)i.push({suggestionType:"match",displayText:`${f.descriptionWithoutTags} - From: ${f.filename}.md`,appendText:`${r}${l}`,insertAt:o.index,insertSkip:r.length+l.length+u.length,taskItDependsOn:f})}}return i}function sy(r,t,e,n){let s=r.filter(a=>t&&t.length>=1&&a.toLowerCase().includes(t.toLowerCase())).slice(0,e);return n&&s.length===0&&(s=r.slice(0,e)),s}function nd(r,t,e,n,i){let s=t[1];for(let a of e){let{displayText:o,appendText:l}=n(s,a);i.push({suggestionType:"match",displayText:o,appendText:l+r.postfix,insertAt:t.index,insertSkip:ay(t[0],r)})}}function Ha(r,t){let e=t.
Line truncated
|
||||||
|
`);n.length>1&&(t=n[0],e=!0);let i=50;return t.length>i&&(t=t.slice(0,i),e=!0),e&&(t+="..."),t}function VS(r,t){let e=`Cannot find preset "${r}" in the Tasks settings`;if(Object.keys(t).length===0)e+=`
|
||||||
|
You can define the instruction(s) for "${r}" in the Tasks settings.`;else{let i=Math.max(...Object.keys(t).map(a=>a.length));e+=`
|
||||||
|
The following presets are defined in the Tasks settings:
|
||||||
|
${Object.entries(t).sort(([a],[o])=>a.localeCompare(o)).map(([a,o])=>`${a.padEnd(i)}: ${N2(o)}`).join(`
|
||||||
|
`)}`}return e}var BS,cy=X(()=>{"use strict";BS={this_file:"path includes {{query.file.path}}",this_folder:"folder includes {{query.file.folder}}",this_folder_only:"filter by function task.file.folder === query.file.folder",this_root:"root includes {{query.file.root}}",hide_date_fields:`# Hide any values for all date fields
|
||||||
|
hide due date
|
||||||
|
hide scheduled date
|
||||||
|
hide start date
|
||||||
|
hide created date
|
||||||
|
hide done date
|
||||||
|
hide cancelled date`,hide_non_date_fields:`# Hide all the non-date fields, but not tags
|
||||||
|
hide id
|
||||||
|
hide depends on
|
||||||
|
hide recurrence rule
|
||||||
|
hide on completion
|
||||||
|
hide priority`,hide_query_elements:`# Hide postpone, edit and backinks
|
||||||
|
hide postpone button
|
||||||
|
hide edit button
|
||||||
|
hide backlinks`,hide_everything:`# Hide everything except description and any tags
|
||||||
|
preset hide_date_fields
|
||||||
|
preset hide_non_date_fields
|
||||||
|
preset hide_query_elements`}});var id,zS=X(()=>{"use strict";id=class{constructor(t=!1,e=!1,n=!1){this.ignoreSortInstructions=t,this.showTaskHiddenData=e,this.recordTimings=n}}});var et,Ga=X(()=>{"use strict";Dr();et=class{constructor(){this.coreStatuses=[ge.TODO.configuration,ge.DONE.configuration],this.customStatuses=[ge.IN_PROGRESS.configuration,ge.CANCELLED.configuration]}static addStatus(t,e){t.push(e)}static replaceStatus(t,e,n){let i=this.findStatusIndex(e,t);return i<=-1?!1:(t.splice(i,1,n),!0)}static findStatusIndex(t,e){let n=new ge(t);return e.findIndex(i=>new ge(i).previewText()==n.previewText())}static deleteStatus(t,e){let n=this.findStatusIndex(e,t);return n<=-1?!1:(t.splice(n,1),!0)}static deleteAllCustomStatuses(t){t.customStatuses.splice(0)}static resetAllCustomStatuses(t){et.deleteAllCustomStatuses(t),new et().customStatuses.forEach(n=>{et.addStatus(t.customStatuses,n)})}static bulkAddStatusCollection(t,e){let n=[];return e.forEach(i=>{t.customStatuses.find(a=>a.symbol==i[0]&&a.name==i[1]&&a.nextStatusSymbol==i[2])?n.push(`The status ${i[1]} (${i[0]}) is already added.`):et.addStatus(t.customStatuses,ge.createFromImportedValue(i))}),n}static allStatuses(t){return t.coreStatuses.concat(t.customStatuses)}static applyToStatusRegistry(t,e){e.clearStatuses(),et.allStatuses(t).forEach(n=>{e.add(n)})}}});var QS,KS=X(()=>{QS=[{index:9999,internalName:"INTERNAL_TESTING_ENABLED_BY_DEFAULT",displayName:"Test Item. Used to validate the Feature Framework.",description:"Description",enabledByDefault:!0,stable:!1}]});var _i,ZS=X(()=>{"use strict";KS();_i=class{constructor(t,e,n,i,s,a){this.internalName=t;this.index=e;this.description=n;this.displayName=i;this.enabledByDefault=s;this.stable=a}static get values(){let t=[];return QS.forEach(e=>{t=[...t,new _i(e.internalName,e.index,e.description,e.displayName,e.enabledByDefault,e.stable)]}),t}static get settingsFlags(){let t={};return _i.values.forEach(e=>{t[e.internalName]=e.enabledByDefault}),t}static fromString(t){for(let e of _i.values)if(t===e.internalName)return e;throw new RangeError(`Illegal argument passed to fromString(): ${t} does not correspond to any available Feature ${this.prototype.constructor.name}`)}}});function dy(r,t){for(let e in r)t[e]===void 0&&(t[e]=r[e])}function au(){return Er[re().taskFormat]}function F2(r){let t=F({},r);return"includes"in t&&!("presets"in t)&&(t.presets=t.includes,delete t.includes),t}var Er,fy,wi,re,nt,$s,XS,Vt=X(()=>{"use strict";oy();nu();uy();Cn();Dr();GS();uy();ys();cy();zS();Ga();ZS();Er={tasksPluginEmoji:{getDisplayName:()=>M.t("settings.format.displayName.tasksEmojiFormat"),taskSerializer:new Us(tu),buildSuggestions:iy(tu,ry,!1)},dataview:{getDisplayName:()=>M.t("settings.format.displayName.dataview"),taskSerializer:new rd,buildSuggestions:qS(iy(ly,ry,!0),[["(",")"],["[","]"]])}},fy={presets:BS,globalQuery:"",globalFilter:"",removeGlobalFilter:!1,taskFormat:"tasksPluginEmoji",setCreatedDate:!1,setDoneDate:!0,setCancelledDate:!0,autoSuggestInEditor:!0,autoSuggestMinMatch:0,autoSuggestMaxItems:20,provideAccessKeys:!0,useFilenameAsScheduledDate:!1,filenameAsScheduledDateFormat:"",filenameAsDateFolders:[],recurrenceOnNextLine:!1,removeScheduledDateOnRecurrence:!1,statusSettings:new et,features:_i.settingsFlags,generalSettings:{},headingOpened:{},debugSettings:new id,loggingOptions:{minLevels:{"":"info",tasks:"info","tasks.Cache":"info","tasks.Events":"info","tasks.File":"info","tasks.Query":"info","tasks.Task":"info"}}},wi=F({},fy);re=()=>(dy(_i.settingsFlags,wi.features),dy(fy.loggingOptions.minLevels,wi.loggingOptions.minLevels),dy(fy.debugSettings,wi.debugSettings),wi.statusSettings.customStatuses.forEach((r,t,e)=>{var i,s;let n=ge.getTypeFromStatusTypeString(r.type);e[t]=new gt((i=r.symbol)!=null?i:" ",r.name,(s=r.nextStatusSymbol)!=null?s:"x",r.availableAsCommand,n)}),F({},wi)),nt=r=>{let t=F2(r);return wi=F(F({},wi),t),re()},$s=(r,t)=>(wi.generalSettings[r]=t,re()),XS=r=>{var t;return(t=wi.features[r])!=null?t:!1}});function sd(r){let e={"<":"<",">":">","&":"&",'"':"""}[r];return e!==void 0?e:r}function JS(r){let t=[...r],e="";return t.forEach(n=>{e+=sd(n)}),e}var eD=X(()=>{"use strict"});var je,Vr=X(()=>{"use strict";eD();Dr();Cn();je=class{constructor(){this._registeredStatuses=[];this.addDefaultStatusTypes()}set(t){this.clearStatuses(),t.forEach(e=>{this.add(e)})}get registeredStatuses(){return this._registeredStatuses.filter(({symbol:t})=>t!==ge.EMPTY.symbol)}static getInstance(){return je.instance||(je.instance=new je),je.instance}add(t){this.hasSymbol(t.symbol)||(t instanceof ge?this._registeredStatuses.push(t):this._registeredStatuses.push(new ge(t)))}bySymbol(t){return this.hasSymbol(t)?this.getSymbol(t):ge.EMPTY}bySymbolOrCreate(t){return this.hasSymbol(t)?this.getSymbol(t):ge.createUnknownStatus(t)}byName(t){return this._registeredStatuses.filter(({name:e})=>e===t).length>0?this._registeredStatuses.filter(({name:e})=>e===t)[0]:ge.EMPTY}resetToDefaultStatuses(){this.clearStatus
Line truncated
|
||||||
|
\`\`\`${n}
|
||||||
|
flowchart LR
|
||||||
|
|
||||||
|
classDef TODO stroke:#f33,stroke-width:3px;
|
||||||
|
classDef DONE stroke:#0c0,stroke-width:3px;
|
||||||
|
classDef IN_PROGRESS stroke:#fa0,stroke-width:3px;
|
||||||
|
classDef CANCELLED stroke:#ddd,stroke-width:3px;
|
||||||
|
classDef NON_TASK stroke:#99e,stroke-width:3px;
|
||||||
|
|
||||||
|
${i.join(`
|
||||||
|
`)}
|
||||||
|
${s.join(`
|
||||||
|
`)}
|
||||||
|
|
||||||
|
linkStyle default stroke:gray
|
||||||
|
\`\`\`
|
||||||
|
`}addEdgeIfNotToInternal(t,e,n,i,s){let a=t.findIndex(u=>u.symbol===e.symbol),o=a!==-1,l=e.type!=="EMPTY";if(o&&l){let u;s?u='-. "\u{1F501}" .-> ':u=" --> ";let c=`${i+1}${u}${a+1}`;n.push(c)}}getMermaidNodeLabel(t,e){let n=JS(t.name),i=t.type;if(e){let s=sd(t.symbol),a=sd(t.nextStatusSymbol),o=`[${s}] -> [${a}]`,l=`'${n}'`,u=`(${i})`;return`["${l}<br>${o}<br>${u}"]:::${i}`}else return`["${n}"]:::${i}`}}});var zr,tD=X(()=>{"use strict";zr=class{constructor(t,e){this.name=t,this.sortOrder=e}get groupText(){return this.name!==""?`%%${this.sortOrder}%% ${this.name}`:""}}});var nD,It,ad=X(()=>{"use strict";nD=require("obsidian");tD();si();It=class{constructor(t){this._date=null;this._date=t}get moment(){return this._date}formatAsDate(t=""){return this.format(fe.dateFormat,t)}formatAsDateAndTime(t=""){return this.format(fe.dateTimeFormat,t)}format(t,e=""){return this._date?this._date.format(t):e}toISOString(t){return this._date?this._date.toISOString(t):""}get category(){let t=window.moment(),e=this.moment;return e?e.isBefore(t,"day")?new zr("Overdue",1):e.isSame(t,"day")?new zr("Today",2):e.isValid()?new zr("Future",3):new zr("Invalid date",0):new zr("Undated",4)}get fromNow(){let t=this.moment;if(!t)return new zr("",0);let e=this.fromNowOrder(t);return new zr(t.fromNow(),e)}fromNowOrder(t){if(!t.isValid())return 0;let e=window.moment(),n=t.isSameOrBefore(e,"day"),i=this.fromNowStartDateOfGroup(t,n,e);return Number((n?1:3)+i.format("YYYYMMDD"))}fromNowStartDateOfGroup(t,e,n){let i=t.fromNow(!0).split(" "),s,a=Number(i[0]);isNaN(a)?s=1:s=a;let o=i[1];return e?n.subtract(s,o):n.add(s,o)}postpone(t="days",e=1){if(!this._date)throw new nD.Notice("Cannot postpone a null date");let n=window.moment().startOf("day");return this._date.isSameOrAfter(n,"day")?this._date.clone().add(e,t):n.add(e,t)}}});var sD=x((rD,iD)=>{(function(r){var t=Object.hasOwnProperty,e=Array.isArray?Array.isArray:function(y){return Object.prototype.toString.call(y)==="[object Array]"},n=10,i=typeof process=="object"&&typeof process.nextTick=="function",s=typeof Symbol=="function",a=typeof Reflect=="object",o=typeof setImmediate=="function",l=o?setImmediate:setTimeout,u=s?a&&typeof Reflect.ownKeys=="function"?Reflect.ownKeys:function(m){var y=Object.getOwnPropertyNames(m);return y.push.apply(y,Object.getOwnPropertySymbols(m)),y}:Object.keys;function c(){this._events={},this._conf&&d.call(this,this._conf)}function d(m){m&&(this._conf=m,m.delimiter&&(this.delimiter=m.delimiter),m.maxListeners!==r&&(this._maxListeners=m.maxListeners),m.wildcard&&(this.wildcard=m.wildcard),m.newListener&&(this._newListener=m.newListener),m.removeListener&&(this._removeListener=m.removeListener),m.verboseMemoryLeak&&(this.verboseMemoryLeak=m.verboseMemoryLeak),m.ignoreErrors&&(this.ignoreErrors=m.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function f(m,y){var _="(node) warning: possible EventEmitter memory leak detected. "+m+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(_+=" Event name: "+y+"."),typeof process!="undefined"&&process.emitWarning){var w=new Error(_);w.name="MaxListenersExceededWarning",w.emitter=this,w.count=m,process.emitWarning(w)}else console.error(_),console.trace&&console.trace()}var p=function(m,y,_){var w=arguments.length;switch(w){case 0:return[];case 1:return[m];case 2:return[m,y];case 3:return[m,y,_];default:for(var S=new Array(w);w--;)S[w]=arguments[w];return S}};function b(m,y){for(var _={},w,S=m.length,C=y?y.length:0,L=0;L<S;L++)w=m[L],_[w]=L<C?y[L]:r;return _}function T(m,y,_){this._emitter=m,this._target=y,this._listeners={},this._listenersCount=0;var w,S;if((_.on||_.off)&&(w=_.on,S=_.off),y.addEventListener?(w=y.addEventListener,S=y.removeEventListener):y.addListener?(w=y.addListener,S=y.removeListener):y.on&&(w=y.on,S=y.off),!w&&!S)throw Error("target does not implement any known event API");if(typeof w!="function")throw TypeError("on method must be a function");if(typeof S!="function")throw TypeError("off method must be a function");this._on=w,this._off=S;var C=m._observers;C?C.push(this):m._observers=[this]}Object.assign(T.prototype,{subscribe:function(m,y,_){var w=this,S=this._target,C=this._emitter,L=this._listeners,j=function(){var D=p.apply(null,arguments),N={data:D,name:y,original:m};if(_){var $=_.call(S,N);$!==!1&&C.emit.apply(C,[N.name].concat(D));return}C.emit.apply(C,[y].concat(D))};if(L[m])throw Error("Event '"+m+"' is already listening");this._listenersCount++,C._newListener&&C._removeListener&&!w._onNewListener?(this._onNewListener=function(D){D===y&&L[m]===null&&(L[m]=j,w._on.call(S,m,j))},C.on("newListener",this._onNewListener),this._onRemoveListener=function(D){D===y&&!C.hasListeners(D)&&L[m]&&(L[m]=null,w._off.call(S,m,j))},L[m]=null,C.on("removeListener",this._onRemoveListener)):(L[m]=j,w._on.call(S,m,j))},unsubscribe:function(m){var y=this,_=this._listeners,w=this._emitter,S,C,L=this._off,j=this._target,D;if(m&&typeof m!="string")throw TypeError("event must
Line truncated
|
||||||
|
`),this.dateFromFileName=new Ba(()=>Ft.fromPath(this.filePath))}parseFileContent(){if(this.listItems===void 0)return this.tasks;let t=new mt(this.filePath,this.fileCache),e=this.fileLines.length,n=null,i=0;for(let s of this.listItems){let a=s.position.start.line;if(a>=e)return this.logger.debug(`${this.filePath} Obsidian gave us a line number ${a} past the end of the file. ${e}.`),this.tasks;if((n===null||n.position.end.line<a)&&(n=qs.getSection(a,this.fileCache.sections),i=0),n===null)continue;let o=this.fileLines[a];if(o===void 0){this.logger.debug(`${this.filePath}: line ${a} - ignoring 'undefined' line.`);continue}let l=new Lt(t,a,n.position.start.line,i,qs.getPrecedingHeader(a,this.fileCache.headings));i=this.parseLine(s,o,l,a,i)}return this.tasks}parseLine(t,e,n,i,s){var o;if(t.task===void 0)return this.createListItem(t,e,i,n),s;let a;try{if(a=pe.fromLine({line:e,taskLocation:n,fallbackDate:this.dateFromFileName.value}),a!==null){let l=(o=this.line2ListItem.get(t.parent))!=null?o:null;l!==null&&(a=new pe(de(F({},a),{parent:l}))),this.line2ListItem.set(i,a),a!==null&&(s++,this.tasks.push(a))}else this.createListItem(t,e,i,n)}catch(l){this.errorReporter(l,this.filePath,t,e)}return s}createListItem(t,e,n,i){var o;let s=(o=this.line2ListItem.get(t.parent))!=null?o:null,a=nr.fromListItemLine(e,s,i);if(a===null){this.logger.warn("Unexpected failure to create a list item from line: "+e+" in file: "+this.filePath);return}this.line2ListItem.set(n,a)}};var qs=class{constructor({metadataCache:t,vault:e,workspace:n,events:i}){this.logger=sn.getLogger("tasks.Cache");this.notifySubscribersDebounced=(0,uD.debounce)(()=>this.notifySubscribersNotDebounced(),100,!0);this.logger.debug("Creating Cache object"),this.metadataCache=t,this.metadataCacheEventReferences=[],this.vault=e,this.workspace=n,this.vaultEventReferences=[],this.events=i,this.eventsEventReferences=[],this.tasksMutex=new ju,this.state="Cold",this.logger.debug("Cache.constructor(): state = Cold"),this.tasks=[],this.loadedAfterFirstResolve=!1,this.subscribeToCache(),this.workspace.onLayoutReady(()=>{this.subscribeToVault(),this.loadVault()}),this.subscribeToEvents()}unload(){this.logger.info("Unloading Cache");for(let t of this.metadataCacheEventReferences)this.metadataCache.offref(t);for(let t of this.vaultEventReferences)this.vault.offref(t);for(let t of this.eventsEventReferences)this.events.off(t)}getTasks(){return this.tasks}getState(){return this.state}notifySubscribers(){this.logger.debug("Cache.notifySubscribers()"),this.notifySubscribersDebounced()}notifySubscribersNotDebounced(){this.logger.debug("Cache.notifySubscribersNotDebounced()"),this.events.triggerCacheUpdate({tasks:this.tasks,state:this.state})}subscribeToCache(){this.logger.debug("Cache.subscribeToCache()");let t=this.metadataCache.on("resolved",()=>I(this,null,function*(){this.loadedAfterFirstResolve||(this.loadedAfterFirstResolve=!0,this.loadVault())}));this.metadataCacheEventReferences.push(t);let e=this.metadataCache.on("changed",n=>{this.tasksMutex.runExclusive(()=>{this.indexFile(n)})});this.metadataCacheEventReferences.push(e)}subscribeToVault(){this.logger.debug("Cache.subscribeToVault()");let{useFilenameAsScheduledDate:t}=re(),e=this.vault.on("create",s=>{s instanceof Va.TFile&&(this.logger.debug(`Cache.subscribeToVault.createdEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.indexFile(s)}))});this.vaultEventReferences.push(e);let n=this.vault.on("delete",s=>{s instanceof Va.TFile&&(this.logger.debug(`Cache.subscribeToVault.deletedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{this.tasks=this.tasks.filter(a=>a.path!==s.path),this.notifySubscribers()}))});this.vaultEventReferences.push(n);let i=this.vault.on("rename",(s,a)=>{s instanceof Va.TFile&&(this.logger.debug(`Cache.subscribeToVault.renamedEventReference() ${s.path}`),this.tasksMutex.runExclusive(()=>{let o=this.metadataCache.getFileCache(s),l=new mt(s.path,o!=null?o:void 0),u=new Ba(()=>Ft.fromPath(s.path));this.tasks=this.tasks.map(c=>{if(c.path!==a)return c;let d=c.taskLocation.fromRenamedFile(l);return t?Ft.updateTaskPath(c,d,u.value):new pe(de(F({},c),{taskLocation:d}))}),this.notifySubscribers()}))});this.vaultEventReferences.push(i)}subscribeToEvents(){this.logger.debug("Cache.subscribeToEvents()");let t=this.events.onRequestCacheUpdate(e=>{e({tasks:this.tasks,state:this.state})});this.eventsEventReferences.push(t)}loadVault(){return this.logger.debug("Cache.loadVault()"),this.tasksMutex.runExclusive(()=>I(this,null,function*(){this.state="Initializing",this.logger.debug("Cache.loadVault(): state = Initializing"),yield Promise.all(this.vault.getMarkdownFiles().map(t=>this.indexFile(t))),this.state="Warm",this.logger.debug("Cache.loadVault(): state = Warm"),this.notifySubscribers()}))}indexFile(t){return I(this,null,function*(){let e=this.metadataCache.getFileCache(t);if(e==null)return;if(!t.path.endsWith(".md")){this.logger.debug("indexFile: skipping non-markdown file: "+t.path);r
Line truncated
|
||||||
|
The following task has been ignored, to prevent Tasks queries getting stuck with 'Loading Tasks ...'
|
||||||
|
Error: ${t}
|
||||||
|
File: ${e}
|
||||||
|
Line number: ${n.position.start.line}
|
||||||
|
Task line: ${i}
|
||||||
|
|
||||||
|
Please create a bug report for this message at
|
||||||
|
https://github.com/obsidian-tasks-group/obsidian-tasks/issues/new/choose
|
||||||
|
to help us find and fix the underlying issue.
|
||||||
|
|
||||||
|
Include:
|
||||||
|
- either a screenshot of the error popup, or copy the text from the console, if on a desktop machine.
|
||||||
|
- the output from running the Obsidian command 'Show debug info'
|
||||||
|
|
||||||
|
The error popup will only be shown when Tasks is starting up, but if the error persists,
|
||||||
|
it will be shown in the console every time this file is edited during the Obsidian
|
||||||
|
session.
|
||||||
|
`;this.logger.error(s),t instanceof Error&&this.logger.error(t.stack?t.stack:"Cannot determine stack"),this.state==="Initializing"&&new Va.Notice(s,1e4)}static getSection(t,e){if(e===void 0)return null;for(let n of e)if(n.position.start.line<=t&&n.position.end.line>=t)return n;return null}static getPrecedingHeader(t,e){if(e===void 0)return null;let n=null;for(let i of e){if(i.position.start.line>t)return n;n=i.heading}return n}};var $y=require("obsidian");var pE=require("obsidian");function tt(){}function vy(r){return r()}function cD(){return Object.create(null)}function zt(r){r.forEach(vy)}function pd(r){return typeof r=="function"}function Kr(r,t){return r!=r?t==t:r!==t||r&&typeof r=="object"||typeof r=="function"}function dD(r){return Object.keys(r).length===0}var fD=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global,lu=class{constructor(t){this.options=t,this._listeners="WeakMap"in fD?new WeakMap:void 0}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return(t=this._observer)!==null&&t!==void 0?t:this._observer=new ResizeObserver(e=>{var n;for(let i of e)lu.entries.set(i.target,i),(n=this._listeners.get(i.target))===null||n===void 0||n(i)})}};lu.entries="WeakMap"in fD?new WeakMap:void 0;var pD=!1;function Y2(){pD=!0}function j2(){pD=!1}function z(r,t){r.appendChild(t)}function Ee(r,t,e){r.insertBefore(t,e||null)}function _e(r){r.parentNode&&r.parentNode.removeChild(r)}function Bs(r,t){for(let e=0;e<r.length;e+=1)r[e]&&r[e].d(t)}function ue(r){return document.createElement(r)}function $2(r){return document.createElementNS("http://www.w3.org/2000/svg",r)}function Ve(r){return document.createTextNode(r)}function xe(){return Ve(" ")}function md(){return Ve("")}function $e(r,t,e,n){return r.addEventListener(t,e,n),()=>r.removeEventListener(t,e,n)}function mD(r){return function(t){return t.preventDefault(),r.call(this,t)}}function B(r,t,e){e==null?r.removeAttribute(t):r.getAttribute(t)!==e&&r.setAttribute(t,e)}function hD(r){let t;return{p(...e){t=e,t.forEach(n=>r.push(n))},r(){t.forEach(e=>r.splice(r.indexOf(e),1))}}}function W2(r){return Array.from(r.childNodes)}function ir(r,t){t=""+t,r.data!==t&&(r.data=t)}function mn(r,t){r.value=t==null?"":t}function _y(r,t,e){for(let n=0;n<r.options.length;n+=1){let i=r.options[n];if(i.__value===t){i.selected=!0;return}}(!e||t!==void 0)&&(r.selectedIndex=-1)}function gD(r){let t=r.querySelector(":checked");return t&&t.__value}var dd;function q2(){if(dd===void 0){dd=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(r){dd=!0}}return dd}function yD(r,t){getComputedStyle(r).position==="static"&&(r.style.position="relative");let n=ue("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;let i=q2(),s;return i?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=$e(window,"message",a=>{a.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=$e(n.contentWindow,"resize",t),t()}),z(r,n),()=>{(i||s&&n.contentWindow)&&s(),_e(n)}}function Si(r,t,e){r.classList[e?"add":"remove"](t)}var Za=class{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=$2(e.nodeName):this.e=ue(e.nodeType===11?"TEMPLATE":e.nodeName),this.t=e.tagName!=="TEMPLATE"?e:e.content,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)Ee(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(_e)}};var uu;function ou(r){uu=r}function H2(){if(!uu)throw new Error("Function called outside component initialization");return uu}function wy(r){H2().$$.on_mount.push(r)}var Ka=[];var ot=[],Qa=[],by=[],G2=Promise.resolve(),Ty=!1;function B2(){Ty||(Ty=!0,G2.then(bD))}function Gs(r){Qa.push(r)}function an(r){by.push(r)}var yy=new Set,za=0;function bD(){if(za!==0)return;let r=uu;do{try{for(;za<Ka.length;){let t=Ka[za];za++,ou(t),V2(t.$$)}}catch(t){throw Ka.length=0,za=0,t}for(ou(null),Ka.length=0,za=0;ot.length;)ot.pop()();for(let t=0;t<Qa.length;t+=1){let e=Qa[t];yy.has(e)||(yy.add(e),e())}Qa.length=0}while(Ka.length);for(;by.length;)by.pop()();Ty=!1,yy.clear(),ou(r)}function V2(r){if(r.fragment!==null){r.update(),zt(r.before_update);let t=r.dirty;r.dirty=[-1],r.fragment&&r.fragment.p(r.ctx,t),r.after_update.forEach(Gs)}}function z2(r){let t=[],e=[];Qa.forEach(n=>r.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Qa=t}var fd=new Set,Hs;function TD(){Hs={r:0,c:[],p:Hs}}function vD(){Hs.r||zt(Hs.c),Hs=Hs.p}function hn(r,t){r&&r.i&&(fd.delete(r),r.i(t))}function An(r,t,e,n){if(r&&r.o){if(fd.has(r
Line truncated
|
||||||
|
|
||||||
|
The task line not updated is:
|
||||||
|
${r.originalMarkdown}
|
||||||
|
|
||||||
|
In this markdown file:
|
||||||
|
"${r.taskLocation.path}"
|
||||||
|
|
||||||
|
Note: further clicks on this checkbox will usually now be ignored until the file is opened (or certain, specific edits are made - it's complicated).
|
||||||
|
|
||||||
|
Recommendations:
|
||||||
|
|
||||||
|
1. Close all panes that have the above file open, and then re-open the file.
|
||||||
|
|
||||||
|
2. Check for exactly identical copies of the task line, in this file, and see if you can make them different.
|
||||||
|
`;wd(c);return}let u=Math.min(Math.pow(10,s),100);o.debug(`timeout = ${u}`),setTimeout(()=>I(void 0,null,function*(){yield nE({originalTask:r,newTasks:t,vault:e,metadataCache:n,workspace:i,previousTries:s+1})}),u)});try{let[u,c,d]=yield rE(r,e),f=[...d.slice(0,u),...t.map(p=>p.toFileLineString()),...d.slice(u+1)];yield e.modify(c,f.join(`
|
||||||
|
`))}catch(u){if(u instanceof Ki){u.message&&tE(u.message),yield l();return}else if(u instanceof kd){yield l();return}else u instanceof Error&&wd(u.message)}});function rE(r,t){return I(this,null,function*(){if(hu===void 0)throw new Ki;let e=t.getAbstractFileByPath(r.path);if(!(e instanceof gu.TFile))throw new Ki(`Tasks: No file found for task ${r.description}. Retrying ...`);if(!SU.includes(e.extension))throw new Error(`Tasks: Does not support files with the ${e.extension} file extension.`);let n=hu.getFileCache(e);if(n==null||n===null)throw new Ki(`Tasks: No file cache found for file ${e.path}. Retrying ...`);let i=n.listItems;if(i===void 0||i.length===0)throw new Ki(`Tasks: No list items found in file cache of ${e.path}. Retrying ...`);let a=(yield t.read(e)).split(`
|
||||||
|
`),o=EU(r,a,i,DU);if(o===void 0)throw new kd;return[o,e,a]})}function Ly(r,t){return I(this,null,function*(){try{let[e,n,i]=yield rE(r,t);return[e,n]}catch(e){e instanceof Ki?e.message&&tE(e.message):e instanceof Error&&wd(e.message)}})}function iE(r,t){return r<t.length}function EU(r,t,e,n){let i=xU(r,t);return i!==void 0||(i=OU(r,t),i!==void 0)?i:RU(r,t,e,n)}function xU(r,t){let e=r.taskLocation.lineNumber;if(iE(e,t)&&t[e]===r.originalMarkdown)return Sd().debug(`Found original markdown at original line number ${e}`),e}function OU(r,t){let e=[];for(let n=0;n<t.length;n++)t[n]===r.originalMarkdown&&e.push(n);if(e.length===1)return e[0]}function RU(r,t,e,n){let i,s=0;for(let a of e){let o=a.position.start.line;if(!iE(o,t))return;if(o<r.taskLocation.sectionStart||a.task===void 0)continue;let l=t[o];if(Ne.getInstance().includedIn(l)){if(s===r.taskLocation.sectionIndex){if(l===r.originalMarkdown)i=o;else{n(`Tasks: Unable to find task in file ${r.taskLocation.path}.
|
||||||
|
Expected task:
|
||||||
|
${r.originalMarkdown}
|
||||||
|
Found task:
|
||||||
|
${l}`);return}break}s++}}return i}Ic();ja();zc();Nt();ed();Cn();var ro=class{constructor(t){this.addGlobalFilterOnSave=t.addGlobalFilterOnSave,this.originalBlocking=t.originalBlocking,this.description=t.description,this.status=t.status,this.priority=t.priority,this.onCompletion=t.onCompletion,this.recurrenceRule=t.recurrenceRule,this.createdDate=t.createdDate,this.startDate=t.startDate,this.scheduledDate=t.scheduledDate,this.dueDate=t.dueDate,this.doneDate=t.doneDate,this.cancelledDate=t.cancelledDate,this.forwardOnly=t.forwardOnly,this.blockedBy=t.blockedBy,this.blocking=t.blocking}static fromTask(t,e){let n=Ne.getInstance().removeAsWordFrom(t.description),i=n!=t.description||!Ne.getInstance().includedIn(t.description),s="none";t.priority==="5"?s="lowest":t.priority==="4"?s="low":t.priority==="2"?s="medium":t.priority==="1"?s="high":t.priority==="0"&&(s="highest");let a=[];for(let l of t.dependsOn){let u=e.find(c=>c.id===l);!u||a.push(u)}let o=e.filter(l=>l.dependsOn.includes(t.id));return new ro({addGlobalFilterOnSave:i,originalBlocking:o,description:n,status:t.status,priority:s,recurrenceRule:t.recurrence?t.recurrence.toText():"",onCompletion:t.onCompletion,createdDate:t.created.formatAsDate(),startDate:t.start.formatAsDate(),scheduledDate:t.scheduled.formatAsDate(),dueDate:t.due.formatAsDate(),doneDate:t.done.formatAsDate(),cancelledDate:t.cancelled.formatAsDate(),forwardOnly:!0,blockedBy:a,blocking:o})}applyEdits(t,e){return I(this,null,function*(){let n=this.description.trim();this.addGlobalFilterOnSave&&(n=Ne.getInstance().prependTo(n));let i=Rs(this.startDate,this.forwardOnly),s=Rs(this.scheduledDate,this.forwardOnly),a=Rs(this.dueDate,this.forwardOnly),o=Rs(this.cancelledDate,this.forwardOnly),l=Rs(this.createdDate,this.forwardOnly),u=Rs(this.doneDate,this.forwardOnly),c=null;this.recurrenceRule&&(c=Dt.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new Zn({startDate:i,scheduledDate:s,dueDate:a})}));let d=this.onCompletion,f=[];for(let E of this.blockedBy){let P=yield CU(E,e);f.push(P)}let p=t.id,b=[],T=[];(this.blocking.toString()!==this.originalBlocking.toString()||this.blocking.length!==0)&&(t.id===""&&(p=ru(e.filter(E=>E.id!=="").map(E=>E.id))),b=this.originalBlocking.filter(E=>!this.blocking.includes(E)),T=this.blocking.filter(E=>!this.originalBlocking.includes(E)));let v=new pe(de(F({},t),{description:n,status:t.status,priority:Mn.priorityValue(this.priority),onCompletion:d,recurrence:c,startDate:i,scheduledDate:s,dueDate:a,doneDate:u,createdDate:l,cancelledDate:o,dependsOn:f.map(E=>E.id),id:p}));for(let E of b){let P=US(E,v);yield Nn({originalTask:E,newTasks:P})}for(let E of T){let P=LS(E,v);yield Nn({originalTask:E,newTasks:P})}let O=this.inferTodaysDate(this.status.type,u,o);return v.handleNewStatusWithRecurrenceInUsersOrder(this.status,O)})}inferTodaysDate(t,e,n){return t==="DONE"&&e!==null?e:t==="CANCELLED"&&n!==null?n:window.moment()}parseAndValidateRecurrence(){var e;if(!this.recurrenceRule)return{parsedRecurrence:"<i>not recurring</>",isRecurrenceValid:!0};let t=(e=Dt.fromText({recurrenceRuleText:this.recurrenceRule,occurrence:new Zn({startDate:null,scheduledDate:null,dueDate:null})}))==null?void 0:e.toText();return t?this.startDate||this.scheduledDate||this.dueDate?{parsedRecurrence:t,isRecurrenceValid:!0}:{parsedRecurrence:"<i>due, scheduled or start date required</i>",isRecurrenceValid:!1}:{parsedRecurrence:"<i>invalid recurrence rule</i>",isRecurrenceValid:!1}}};function CU(r,t){return I(this,null,function*(){if(r.id!=="")return r;let e=t.filter(i=>i.id!==""),n=Jc(r,e.map(i=>i.id));return yield Nn({originalTask:r,newTasks:n}),n})}Vt();function MU(r){let t,e=Ut("Recurs",r[2])+"",n,i,s,a,o,l,u,c,d;return{c(){t=ue("label"),n=xe(),i=ue("input"),s=xe(),a=ue("code"),o=Ve(r[4]),l=xe(),u=new Za(!1),B(t,"for","recurrence"),B(i,"id","recurrence"),B(i,"type","text"),B(i,"class","tasks-modal-date-input"),B(i,"placeholder","Try 'every day when done'"),B(i,"accesskey",r[2]),Si(i,"tasks-modal-error",!r[1]),u.a=null,B(a,"class","tasks-modal-parsed-date")},m(f,p){Ee(f,t,p),t.innerHTML=e,Ee(f,n,p),Ee(f,i,p),mn(i,r[0].recurrenceRule),Ee(f,s,p),Ee(f,a,p),z(a,o),z(a,l),u.m(r[3],a),c||(d=$e(i,"input",r[5]),c=!0)},p(f,[p]){p&4&&e!==(e=Ut("Recurs",f[2])+"")&&(t.innerHTML=e),p&4&&B(i,"accesskey",f[2]),p&1&&i.value!==f[0].recurrenceRule&&mn(i,f[0].recurrenceRule),p&2&&Si(i,"tasks-modal-error",!f[1]),p&8&&u.p(f[3])},i:tt,o:tt,d(f){f&&_e(t),f&&_e(n),f&&_e(i),f&&_e(s),f&&_e(a),c=!1,d()}}}function AU(r,t,e){let{editableTask:n}=t,{isRecurrenceValid:i}=t,{accesskey:s}=t,a,{recurrenceSymbol:o}=Er.tasksPluginEmoji.taskSerializer.symbols;function l(){n.recurrenceRule=this.value,e(0,n)}return r.$$set=u=>{"editableTask"in u&&e(0,n=u.editableTask),"isRecurrenceValid"in u&&e(1,i=u.isRecurrenceValid),"accesskey"in u&&e(2,s=u.accesskey)},r.$$.update=()=>{if(r.$$.dirty&1){e:e(3,{parsedRecurrence:a,isRecurrenceValid:i}=n.parseAndValidateRecurrence(),a,(e(1,i),e(0,n)))}},[n,i,s,a,o,l]}var Uy=class extends rr{co
Line truncated
|
||||||
|
`);t.setLine(o,b)};new Qi({app:n,task:u,onSubmit:c,allTasks:i}).open()};var Wy=require("obsidian");Vr();Nt();si();var hE=(r,t,e)=>{var c;if(r)return e instanceof Wy.MarkdownView;if(!(e instanceof Wy.MarkdownView))return;let n=(c=e.file)==null?void 0:c.path;if(n===void 0)return;let i=t.getCursor(),s=i.line,a=t.getLine(s),o=qy(a,n),l=o.text.length>0,u=s>=t.lineCount()-1;if(l||u)t.setLine(s,o.text);else{let d={line:s,ch:0},f={line:s+1,ch:0};t.replaceRange("",d,f)}t.setCursor(HU(i,o))},qy=(r,t)=>{let e=pe.fromLine({line:r,taskLocation:Lt.fromUnknownPosition(new mt(t)),fallbackDate:null});if(e!==null){let n=e.toggleWithRecurrenceInUsersOrder().map(s=>s.toFileLineString()),i=n.length>0?n.length-1:0;return{text:n.join(`
|
||||||
|
`),moveTo:{line:i}}}else{let n=r.match(fe.taskRegex);if(n!==null){let i=n[3],a=je.getInstance().bySymbol(i).nextStatusSymbol;return{text:r.replace(fe.taskRegex,`$1- [${a}] $4`)}}else if(fe.listItemRegex.test(r)){let i=r.replace(fe.listItemRegex,"$1$2 [ ]");return{text:i,moveTo:{ch:i.length}}}else{let i=r.replace(fe.indentationRegex,"$1- ");return{text:i,moveTo:{ch:i.length}}}}},HU=(r,t)=>{var s;let e={line:0,ch:r.ch},n=F(F({},e),(s=t.moveTo)!=null?s:{}),i=t.text.split(`
|
||||||
|
`)[n.line].length;return{line:r.line+n.line,ch:Math.min(n.ch,i)}};var fb=require("obsidian");Vt();var Zi=class{constructor(){this.hidePostponeButton=!1;this.hideTaskCount=!1;this.hideBacklinks=!1;this.hideEditButton=!1;this.hideUrgency=!0;this.hideTree=!0;this.shortMode=!1;this.explainQuery=!1}};function gE(r,t,e){let n=new Map([["backlink","hideBacklinks"],["edit button","hideEditButton"],["postpone button","hidePostponeButton"],["task count","hideTaskCount"],["tree","hideTree"],["urgency","hideUrgency"]]);for(let[i,s]of n.entries())if(t.startsWith(i))return r[s]=e,!0;return!1}Fs();function Xs(r,t){let e=`Error: ${r}.
|
||||||
|
The error message was:
|
||||||
|
`,n="";return t instanceof Error?n+=t:n+="Unknown error",`${e}"${n}"`}Ws();var GU=Object.prototype.toString,so=Array.isArray||function(t){return GU.call(t)==="[object Array]"};function Gy(r){return typeof r=="function"}function BU(r){return so(r)?"array":typeof r}function Hy(r){return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function yE(r,t){return r!=null&&typeof r=="object"&&t in r}function VU(r,t){return r!=null&&typeof r!="object"&&r.hasOwnProperty&&r.hasOwnProperty(t)}var zU=RegExp.prototype.test;function KU(r,t){return zU.call(r,t)}var QU=/\S/;function ZU(r){return!KU(QU,r)}var XU={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function JU(r){return String(r).replace(/[&<>"'`=\/]/g,function(e){return XU[e]})}var eY=/\s*/,tY=/\s+/,bE=/\s*=/,nY=/\s*\}/,rY=/#|\^|\/|>|\{|&|=|!/;function iY(r,t){if(!r)return[];var e=!1,n=[],i=[],s=[],a=!1,o=!1,l="",u=0;function c(){if(a&&!o)for(;s.length;)delete i[s.pop()];else s=[];a=!1,o=!1}var d,f,p;function b(J){if(typeof J=="string"&&(J=J.split(tY,2)),!so(J)||J.length!==2)throw new Error("Invalid tags: "+J);d=new RegExp(Hy(J[0])+"\\s*"),f=new RegExp("\\s*"+Hy(J[1])),p=new RegExp("\\s*"+Hy("}"+J[1]))}b(t||lr.tags);for(var T=new bu(r),v,O,E,P,Y,q;!T.eos();){if(v=T.pos,E=T.scanUntil(d),E)for(var ae=0,H=E.length;ae<H;++ae)P=E.charAt(ae),ZU(P)?(s.push(i.length),l+=P):(o=!0,e=!0,l+=" "),i.push(["text",P,v,v+1]),v+=1,P===`
|
||||||
|
`&&(c(),l="",u=0,e=!1);if(!T.scan(d))break;if(a=!0,O=T.scan(rY)||"name",T.scan(eY),O==="="?(E=T.scanUntil(bE),T.scan(bE),T.scanUntil(f)):O==="{"?(E=T.scanUntil(p),T.scan(nY),T.scanUntil(f),O="&"):E=T.scanUntil(f),!T.scan(f))throw new Error("Unclosed tag at "+T.pos);if(O==">"?Y=[O,E,v,T.pos,l,u,e]:Y=[O,E,v,T.pos],u++,i.push(Y),O==="#"||O==="^")n.push(Y);else if(O==="/"){if(q=n.pop(),!q)throw new Error('Unopened section "'+E+'" at '+v);if(q[1]!==E)throw new Error('Unclosed section "'+q[1]+'" at '+v)}else O==="name"||O==="{"||O==="&"?o=!0:O==="="&&b(E)}if(c(),q=n.pop(),q)throw new Error('Unclosed section "'+q[1]+'" at '+T.pos);return aY(sY(i))}function sY(r){for(var t=[],e,n,i=0,s=r.length;i<s;++i)e=r[i],e&&(e[0]==="text"&&n&&n[0]==="text"?(n[1]+=e[1],n[3]=e[3]):(t.push(e),n=e));return t}function aY(r){for(var t=[],e=t,n=[],i,s,a=0,o=r.length;a<o;++a)switch(i=r[a],i[0]){case"#":case"^":e.push(i),n.push(i),e=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],e=n.length>0?n[n.length-1][4]:t;break;default:e.push(i)}return t}function bu(r){this.string=r,this.tail=r,this.pos=0}bu.prototype.eos=function(){return this.tail===""};bu.prototype.scan=function(t){var e=this.tail.match(t);if(!e||e.index!==0)return"";var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};bu.prototype.scanUntil=function(t){var e=this.tail.search(t),n;switch(e){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=n.length,n};function io(r,t){this.view=r,this.cache={".":this.view},this.parent=t}io.prototype.push=function(t){return new io(t,this)};io.prototype.lookup=function(t){var e=this.cache,n;if(e.hasOwnProperty(t))n=e[t];else{for(var i=this,s,a,o,l=!1;i;){if(t.indexOf(".")>0)for(s=i.view,a=t.split("."),o=0;s!=null&&o<a.length;)o===a.length-1&&(l=yE(s,a[o])||VU(s,a[o])),s=s[a[o++]];else s=i.view[t],l=yE(i.view,t);if(l){n=s;break}i=i.parent}e[t]=n}return Gy(n)&&(n=n.call(this.view)),n};function ln(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}ln.prototype.clearCache=function(){typeof this.templateCache!="undefined"&&this.templateCache.clear()};ln.prototype.parse=function(t,e){var n=this.templateCache,i=t+":"+(e||lr.tags).join(":"),s=typeof n!="undefined",a=s?n.get(i):void 0;return a==null&&(a=iY(t,e),s&&n.set(i,a)),a};ln.prototype.render=function(t,e,n,i){var s=this.getConfigTags(i),a=this.parse(t,s),o=e instanceof io?e:new io(e,void 0);return this.renderTokens(a,o,n,t,i)};ln.prototype.renderTokens=function(t,e,n,i,s){for(var a="",o,l,u,c=0,d=t.length;c<d;++c)u=void 0,o=t[c],l=o[0],l==="#"?u=this.renderSection(o,e,n,i,s):l==="^"?u=this.renderInverted(o,e,n,i,s):l===">"?u=this.renderPartial(o,e,n,s):l==="&"?u=this.unescapedValue(o,e):l==="name"?u=this.escapedValue(o,e,s):l==="text"&&(u=this.rawValue(o)),u!==void 0&&(a+=u);return a};ln.prototype.renderSection=function(t,e,n,i,s){var a=this,o="",l=e.lookup(t[1]);function u(f){return a.render(f,e,n,s)}if(!!l){if(so(l))for(var c=0,d=l.length;c<d;++c)o+=this.renderTokens(t[4],e.push(l[c]),n,i,s);else if(typeof l=="object"||typeof l=="string"||typeof l=="number")o+=this.renderTokens(t[4],e.push(l),n,i,s);else if(Gy(l)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");l=l.call(e.view,i.slice(t[3],t[5]),u),l!=null&&(o+=l)}else o+=this.renderTokens(t[4],e,n,i,s);return o}};ln.prototype.renderInverted=function(t,e,n,i,s){var a=e.lookup(t[1]);if(!a||so(a)&&a.length===0)return this.renderTokens(t[4],e,n,i,s)};ln.prototype.indentPartial=function(t,e,n){for(var i=e.replace(/[^ \t]/g,""),s=t.split(`
|
||||||
|
`),a=0;a<s.length;a++)s[a].length&&(a>0||!n)&&(s[a]=i+s[a]);return s.join(`
|
||||||
|
`)};ln.prototype.renderPartial=function(t,e,n,i){if(!!n){var s=this.getConfigTags(i),a=Gy(n)?n(t[1]):n[t[1]];if(a!=null){var o=t[6],l=t[5],u=t[4],c=a;l==0&&u&&(c=this.indentPartial(a,u,o));var d=this.parse(c,s);return this.renderTokens(d,e,n,c,i)}}};ln.prototype.unescapedValue=function(t,e){var n=e.lookup(t[1]);if(n!=null)return n};ln.prototype.escapedValue=function(t,e,n){var i=this.getConfigEscape(n)||lr.escape,s=e.lookup(t[1]);if(s!=null)return typeof s=="number"&&i===lr.escape?String(s):i(s)};ln.prototype.rawValue=function(t){return t[1]};ln.prototype.getConfigTags=function(t){return so(t)?t:t&&typeof t=="object"?t.tags:void 0};ln.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!so(t))return t.escape};var lr={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(r){yu.templateCache=r},get templateCache(){return yu.templateCache}},yu=new ln;lr.clearCache=function(){return yu.clearCache()};lr.parse=function(t,e){return yu.parse(t,e)};lr.render=function(t,e,n,i){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+BU(t)+'" was given as the first argument for mustache#render(template, view, partials)');return yu.render(t,e,n,i)};lr.escape=JU;lr.Scanner=bu;lr.Context=io;lr.Writer=ln;var By=lr;var kE=qo(wE());var Xr=class{constructor(t){this.instruction=t}get queryComponent(){return this._queryComponent}set queryComponent(t){this._queryComponent=t}get error(){return this._error}set error(t){this._error=t}isValid(){return this._queryComponent!==void 0}static fromObject(t,e){let n=new Xr(t);return n._queryComponent=e,n}static fromError(t,e){let n=new Xr(t);return n._error=e,n}};var Tu=class extends Xr{};function vu(r,t){try{let e=r.map(([s])=>s),n=t.includes("return")?t:`return ${t}`,i=t&&new Function(...e,n);return i instanceof Function?Tu.fromObject(t,i):Tu.fromError(t,`Problem parsing expression "${t}"`)}catch(e){return Tu.fromError(t,Xs(`Failed parsing expression "${t}"`,e))}}function _u(r,t){let e=t.map(([n,i])=>i);return r(...e)}function zy(r,t,e){try{return _u(r,t)}catch(n){return Xs(`Failed calculating expression "${e}"`,n)}}function Ky(r,t){By.escape=function(e){return e};try{let e=lY(r,t);return By.render(e,(0,kE.default)(t))}catch(e){let n="";throw e instanceof Error?n=`There was an error expanding one or more placeholders.
|
||||||
|
|
||||||
|
The error message was:
|
||||||
|
${e.message.replace(/ > /g,".").replace("Missing Mustache data property","Unknown property")}`:n="Unknown error expanding placeholders.",n+=`
|
||||||
|
|
||||||
|
The problem is in:
|
||||||
|
${r}`,Error(n)}}var oY=new RegExp(["\\{\\{","(.*?)","\\}\\}"].join(""),"g");function lY(r,t){return r.replace(oY,(e,n)=>{let i=uY(t),s=vu(i,n);if(s.isValid()){let a=_u(s.queryComponent,i);if(a===null)throw Error(`Invalid placeholder result 'null'.
|
||||||
|
Check for missing file property in this expression:
|
||||||
|
{{${n}}}`);if(a!==void 0)return a}return e})}function uY(r){return Object.entries(r)}Vt();function Qy(r){return Zy(r,[])}function Zy(r,t){return{query:{file:r,allTasks:t,searchCache:{}},preset:F({},re().presets)}}cy();Vt();var ao=class{constructor(t=""){this.indentation=t}explainQuery(t){if(t.error!==void 0)return this.explainError(t);let e=[];return e.push(this.explainIgnoreGlobalQuery(t)),e.push(this.explainFilters(t)),e.push(this.explainGroups(t)),e.push(this.explainSorters(t)),e.push(this.explainLayout(t)),e.push(this.explainQueryLimits(t)),e.push(this.explainDebugSettings()),e.filter(n=>n!=="").join(`
|
||||||
|
`)}explainError(t){let e="";return e+=`Query has an error:
|
||||||
|
`,e+=t.error+`
|
||||||
|
`,e}explainIgnoreGlobalQuery(t){return t.ignoreGlobalQuery?this.indent(`ignore global query
|
||||||
|
`):""}explainFilters(t){return t.filters.length===0?this.indent(`No filters supplied. All tasks will match the query.
|
||||||
|
`):t.filters.map(e=>e.explainFilterIndented(this.indentation)).join(`
|
||||||
|
`)}explainGroups(t){return this.explainStatements(t.grouping.map(e=>e.statement))}explainSorters(t){return this.explainStatements(t.sorting.map(e=>e.statement))}explainLayout(t){return this.explainStatements(t.layoutStatements)}explainQueryLimits(t){function e(i){let s=`At most ${i} task`;return i!==1&&(s+="s"),s}let n=[];if(t.limit!==void 0){let i=e(t.limit)+`.
|
||||||
|
`;n.push(this.indent(i))}if(t.taskGroupLimit!==void 0){let i=e(t.taskGroupLimit)+` per group (if any "group by" options are supplied).
|
||||||
|
`;n.push(this.indent(i))}return n.join(`
|
||||||
|
`)}explainDebugSettings(){let t="",{debugSettings:e}=re();return e.ignoreSortInstructions&&(t+=this.indent(`NOTE: All sort instructions, including default sort order, are disabled, due to 'ignoreSortInstructions' setting.
|
||||||
|
`)),t}explainStatements(t){return t.length===0?"":t.map(e=>e.explainStatement(this.indentation)).join(`
|
||||||
|
|
||||||
|
`)+`
|
||||||
|
`}indent(t){return this.indentation+t}};pn();var He=class{constructor(t,e=[],n=""){this.description=t,this.symbol=n,this.children=e}static booleanAnd(t){return this.combineOrCreateExplanation("All of",t,"AND")}static booleanOr(t){return this.combineOrCreateExplanation("At least one of",t,"OR")}static booleanNot(t){return new He("None of",t,"NOT")}static booleanXor(t){return new He("Exactly one of",t,"XOR")}asString(t=""){if(this.children.length==0)return t+this.description;let e=t;this.symbol===""?e+=this.description:(e+=this.symbol,this.children.length>1&&(e+=` (${this.description})`),e+=":");let n=t+" ";for(let i=0;i<this.children.length;i++)e+=`
|
||||||
|
${this.children[i].asString(n)}`;return e}static combineOrCreateExplanation(t,e,n){if(e.length===2){let i=e[0],s=e[1];if(i.symbol===n&&s.symbol==="")return i.children.push(s),i}return new He(t,e,n)}};var oo=class{matchesAnyOf(t){return t.some(e=>this.matches(e))}};var lo=class extends oo{constructor(e){super();this.stringToFind=e}matches(e){return lo.stringIncludesCaseInsensitive(e,this.stringToFind)}static stringIncludesCaseInsensitive(e,n){return e.toLocaleLowerCase().includes(n.toLocaleLowerCase())}explanation(e){return new He(e)}};var Xi=class extends oo{constructor(e){super();this.regex=e}static validateAndConstruct(e){let n=/^\/(.+)\/([^/]*)$/,i=e.match(n);if(i!==null){let s=new RegExp(i[1],i[2]);return new Xi(s)}else return null}matches(e){return e.match(this.regex)!==null}static helpMessage(){return String.raw`See https://publish.obsidian.md/tasks/Queries/Regular+Expressions
|
||||||
|
|
||||||
|
Regular expressions must look like this:
|
||||||
|
/pattern/
|
||||||
|
or this:
|
||||||
|
/pattern/flags
|
||||||
|
|
||||||
|
Where:
|
||||||
|
- pattern: The 'regular expression' pattern to search for.
|
||||||
|
- flags: Optional characters that modify the search.
|
||||||
|
i => make the search case-insensitive
|
||||||
|
u => add Unicode support
|
||||||
|
|
||||||
|
Examples: /^Log/
|
||||||
|
/^Log/i
|
||||||
|
/File Name\.md/
|
||||||
|
/waiting|waits|waited/i
|
||||||
|
/\d\d:\d\d/
|
||||||
|
|
||||||
|
The following characters have special meaning in the pattern:
|
||||||
|
to find them literally, you must add a \ before them:
|
||||||
|
[\^$.|?*+()
|
||||||
|
|
||||||
|
CAUTION! Regular expression (or 'regex') searching is a powerful
|
||||||
|
but advanced feature that requires thorough knowledge in order to
|
||||||
|
use successfully, and not miss intended search results.
|
||||||
|
`}explanation(e){let i=cY(e,"using regex: ",this.regexAsString());return new He(i)}regexAsString(){let e=`'${this.regex.source}' with `;switch(this.regex.flags.length){case 0:e+="no flags";break;case 1:e+=`flag '${this.regex.flags}'`;break;default:e+=`flags '${this.regex.flags}'`;break}return e}};function cY(r,t,e){var o;let n=r.match(/\//);if(!n)return"Error explaining instruction. Could not find a slash character";let i=2,s=((o=n.index)!=null?o:i)-i;return`${t.padEnd(s)}${e}`}var un=class{constructor(t,e){this._rawInstruction=t,this._anyContinuationLinesRemoved=e.trim(),this._anyPlaceholdersExpanded=this._anyContinuationLinesRemoved}recordExpandedPlaceholders(t){this._anyPlaceholdersExpanded=t}get rawInstruction(){return this._rawInstruction}get anyContinuationLinesRemoved(){return this._anyContinuationLinesRemoved}get anyPlaceholdersExpanded(){return this._anyPlaceholdersExpanded}explainStatement(t){function e(a,o){o!==a&&(s+=` =>
|
||||||
|
${t}${o}`)}let n=this._rawInstruction.trim(),i=n.split(`
|
||||||
|
`).join(`
|
||||||
|
`+t),s=`${t}${i}`;return this._rawInstruction.includes(`
|
||||||
|
`)&&(s+=`
|
||||||
|
`+t),e(n,this._anyContinuationLinesRemoved),e(this._anyContinuationLinesRemoved,this._anyPlaceholdersExpanded),s}allLinesIdentical(){return this._rawInstruction===this._anyContinuationLinesRemoved&&this._rawInstruction===this._anyPlaceholdersExpanded}};var Mr=class{constructor(t,e,n,i){this._statement=new un(t,t),this.property=e,this.comparator=Mr.maybeReverse(i,n)}setStatement(t){this._statement=t}get statement(){return this._statement}get instruction(){return this._statement.anyPlaceholdersExpanded}static maybeReverse(t,e){return t?Mr.makeReversedComparator(e):e}static makeReversedComparator(t){return(e,n,i)=>t(e,n,i)*-1}};iu();var Ji=class{constructor(t,e,n,i){this._statement=new un(t,t),this.property=e,this.grouper=n,this.reverse=i}setStatement(t){this._statement=t}get statement(){return this._statement}get instruction(){return this._statement.anyPlaceholdersExpanded}};var We=class{canCreateFilterForLine(t){return We.lineMatchesFilter(this.filterRegExp(),t)}static lineMatchesFilter(t,e){return t?t.test(e):!1}static getMatch(t,e){return t?e.match(t):null}fieldNameSingular(){return this.fieldName()}fieldNameSingularEscaped(){return Gi(this.fieldNameSingular())}supportsSorting(){return!1}createSorterFromLine(t){if(!this.supportsSorting())return null;let e=We.getMatch(this.sorterRegExp(),t);if(e===null)return null;let n=!!e[1];return this.createSorter(n)}sorterRegExp(){if(!this.supportsSorting())throw Error(`sorterRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^sort by ${this.fieldNameSingularEscaped()}( reverse)?`,"i")}sorterInstruction(t){let e=`sort by ${this.fieldNameSingular()}`;return t&&(e+=" reverse"),e}comparator(){throw Error(`comparator() unimplemented for ${this.fieldNameSingular()}`)}createSorter(t){return new Mr(this.sorterInstruction(t),this.fieldNameSingular(),this.comparator(),t)}createNormalSorter(){return this.createSorter(!1)}createReverseSorter(){return this.createSorter(!0)}supportsGrouping(){return!1}createGrouperFromLine(t){if(!this.supportsGrouping())return null;let e=We.getMatch(this.grouperRegExp(),t);if(e===null)return null;let n=!!e[1];return this.createGrouper(n)}grouperRegExp(){if(!this.supportsGrouping())throw Error(`grouperRegExp() unimplemented for ${this.fieldNameSingular()}`);return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`,"i")}grouperInstruction(t){let e=`group by ${this.fieldNameSingular()}`;return t&&(e+=" reverse"),e}grouper(){throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`)}createGrouper(t){return new Ji(this.grouperInstruction(t),this.fieldNameSingular(),this.grouper(),t)}createNormalGrouper(){return this.createGrouper(!1)}createReverseGrouper(){return this.createGrouper(!0)}};var Kt=class{constructor(t,e,n){this._statement=new un(t,t),this.explanation=n,this.filterFunction=e}get statement(){return this._statement}setStatement(t){this._statement=t}get instruction(){return this._statement.anyPlaceholdersExpanded}explainFilterIndented(t){let e=this._statement.explainStatement(t);return this.onlyNeedsOneLineExplanation()?`${e}
|
||||||
|
`:`${e} =>
|
||||||
|
${this.explanation.asString(t+" ")}
|
||||||
|
`}simulateExplainFilter(){return this.onlyNeedsOneLineExplanation()?this.explanation:new He(this.instruction+" =>",[this.explanation])}onlyNeedsOneLineExplanation(){return this.explanation.asString("")===this.instruction}};var ke=class{constructor(t){this.object=t}get instruction(){return this.object.instruction}get filter(){return this.object.queryComponent}isValid(){return this.object.isValid()}get error(){return this.object.error}get filterFunction(){if(this.filter)return this.filter.filterFunction}static fromFilter(t){return new ke(Xr.fromObject(t.instruction,t))}static fromError(t,e){return new ke(Xr.fromError(t,e))}};var Xe=class extends We{createFilterOrErrorMessage(t){let e=We.getMatch(this.filterRegExp(),t);if(e===null)return ke.fromError(t,`do not understand query filter (${this.fieldName()})`);let n=e[1].toLowerCase(),i=e[2],s=null;if(n.includes("include"))s=new lo(i);else if(n.includes("regex")){try{s=Xi.validateAndConstruct(i)}catch(l){let u=Xs("Parsing regular expression",l)+`
|
||||||
|
|
||||||
|
${Xi.helpMessage()}`;return ke.fromError(t,u)}if(s===null)return ke.fromError(t,`Invalid instruction: '${t}'
|
||||||
|
|
||||||
|
${Xi.helpMessage()}`)}if(s===null)return ke.fromError(t,`do not understand query filter (${this.fieldName()})`);let a=n.match(/not/)!==null,o=new Kt(t,this.getFilter(s,a),s.explanation(t));return ke.fromFilter(o)}fieldPattern(){return this.fieldNameSingularEscaped()}filterOperatorPattern(){return"includes|does not include|regex matches|regex does not match"}filterRegExp(){return new RegExp(`^(?:${this.fieldPattern()}) (${this.filterOperatorPattern()}) (.*)`,"i")}getFilter(t,e){return n=>{let i=t.matches(this.value(n));return e?!i:i}}comparator(){return(t,e)=>this.value(t).localeCompare(this.value(e),void 0,{numeric:!0})}grouper(){return t=>[this.value(t)]}static escapeMarkdownCharacters(t){return t.replace(/\\/g,"\\\\").replace(/_/g,"\\_")}};var Js=class extends Xe{fieldName(){return"description"}value(t){return Ne.getInstance().removeAsSubstringFrom(t.description)}supportsSorting(){return!0}comparator(){return(t,e)=>{let n=Js.cleanDescription(t.description),i=Js.cleanDescription(e.description);return n.localeCompare(i,void 0,{numeric:!0})}}static cleanDescription(t){t=Ne.getInstance().removeAsSubstringFrom(t);let e=/^\[\[?([^\]]*)]]?/,n=t.match(e);if(n!==null){let i=n[1];t=i.substring(i.indexOf("|")+1)+t.replace(e,"")}return t=this.replaceFormatting(t,/^\*\*([^*]+)\*\*/),t=this.replaceFormatting(t,/^\*([^*]+)\*/),t=this.replaceFormatting(t,/^==([^=]+)==/),t=this.replaceFormatting(t,/^__([^_]+)__/),t=this.replaceFormatting(t,/^_([^_]+)_/),t}static replaceFormatting(t,e){let n=t.match(e);return n!==null&&(t=n[1]+t.replace(e,"")),t}};Ig();Fg();Cs();var Ed=class{findUnexpandedDateText(t){let e=["<%","YYYY-MM-DD"];for(let n of e)if(t.includes(n))return this.unexpandedDateTextMessage(n);return null}unexpandedDateTextMessage(t){return`Instruction contains unexpanded template text: "${t}" - and cannot be interpreted.
|
||||||
|
|
||||||
|
Possible causes:
|
||||||
|
- The query is an a template file, and is not intended to be searched.
|
||||||
|
- A command such as "Replace templates in the active file" needs to be run.
|
||||||
|
- The core "Daily notes" plugin is in use, and the template contained
|
||||||
|
date calculations that it does not support.
|
||||||
|
- Some sample template text was accidentally pasted in to a tasks query,
|
||||||
|
instead of in to a template file.
|
||||||
|
|
||||||
|
See: https://publish.obsidian.md/tasks/Advanced/Daily+Agenda#Instruction+contains+unexpanded+template+text
|
||||||
|
`}};var xd=class{constructor(t,e){this._instruction=t,this._filter=e}canCreateFilterForLine(t){return t.toLocaleLowerCase()===this._instruction.toLocaleLowerCase()}createFilterOrErrorMessage(t){return this.canCreateFilterForLine(t)?ke.fromFilter(new Kt(t,this._filter,new He(t))):ke.fromError(t,`do not understand filter: ${t}`)}};var bn=class{constructor(){this._filters=[]}add(t,e){this._filters.push(new xd(t,e))}canCreateFilterForLine(t){return this._filters.some(e=>e.canCreateFilterForLine(t))}createFilterOrErrorMessage(t){for(let e of this._filters){let n=e.createFilterOrErrorMessage(t);if(n.isValid())return n}return ke.fromError(t,`do not understand filter: ${t}`)}};var Et=class extends We{constructor(e=null){super();e!==null?this.filterInstructions=e:(this.filterInstructions=new bn,this.filterInstructions.add(`has ${this.fieldName()} date`,n=>this.date(n)!==null),this.filterInstructions.add(`no ${this.fieldName()} date`,n=>this.date(n)===null),this.filterInstructions.add(`${this.fieldName()} date is invalid`,n=>{let i=this.date(n);return i!==null&&!i.isValid()}))}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){var f;let n=this.checkForUnexpandedTemplateText(e);if(n)return ke.fromError(e,n);let i=this.filterInstructions.createFilterOrErrorMessage(e);if(i.isValid())return i;let s=We.getMatch(this.filterRegExp(),e);if(s===null)return ke.fromError(e,"do not understand query filter ("+this.fieldName()+" date)");let a=s[1],o=(f=s[2])==null?void 0:f.toLowerCase(),l=s[3],u=xn.parseDateRange(l);if(!u.isValid()){let p=xn.parseDate(a);p.isValid()&&(u=new nn(p,p))}if(!u.isValid())return ke.fromError(e,"do not understand "+this.fieldName()+" date");let c=this.buildFilterFunction(o,u),d=Et.buildExplanation(this.fieldNameForExplanation(),o,this.filterResultIfFieldMissing(),u);return ke.fromFilter(new Kt(e,c,d))}buildFilterFunction(e,n){let i;switch(e){case"before":i=s=>s?s.isBefore(n.start):this.filterResultIfFieldMissing();break;case"after":i=s=>s?s.isAfter(n.end):this.filterResultIfFieldMissing();break;case"on or before":case"in or before":i=s=>s?s.isSameOrBefore(n.end):this.filterResultIfFieldMissing();break;case"on or after":case"in or after":i=s=>s?s.isSameOrAfter(n.start):this.filterResultIfFieldMissing();break;default:i=s=>s?s.isSameOrAfter(n.start)&&s.isSameOrBefore(n.end):this.filterResultIfFieldMissing()}return this.getFilter(i)}getFilter(e){return n=>e(this.date(n))}filterRegExp(){return new RegExp(`^${this.fieldNameForFilterInstruction()} (((?:on|in) or before|before|(?:on|in) or after|after|on|in)? ?(.*))`,"i")}fieldNameForFilterInstruction(){return this.fieldName()}static buildExplanation(e,n,i,s){let a=n,o="YYYY-MM-DD (dddd Do MMMM YYYY)",l;switch(n){case"before":case"on or after":l=s.start.format(o);break;case"after":case"on or before":l=s.end.format(o);break;case"in or before":a="on or before",l=s.end.format(o);break;case"in or after":a="on or after",l=s.start.format(o);break;default:if(!s.start.isSame(s.end)){let c=`${e} date is between:`,d=[new He(`${s.start.format(o)} and`),new He(`${s.end.format(o)} inclusive`)];return i&&d.push(new He(`OR no ${e} date`)),new He(c,d)}a="on",l=s.start.format(o);break}let u=`${e} date is ${a} ${l}`;return i&&(u+=` OR no ${e} date`),new He(u)}fieldNameForExplanation(){return this.fieldName()}supportsSorting(){return!0}comparator(){return(e,n)=>Qn(this.date(e),this.date(n))}supportsGrouping(){return!0}grouper(){return e=>{let n=this.date(e);return n===null?["No "+this.fieldName()+" date"]:n.isValid()?[n.format("YYYY-MM-DD dddd")]:["%%0%% Invalid "+this.fieldName()+" date"]}}checkForUnexpandedTemplateText(e){return new Ed().findUnexpandedDateText(e)}};var Od=class extends Et{fieldName(){return"created"}date(t){return t.createdDate}filterResultIfFieldMissing(){return!1}};var Rd=class extends Et{fieldName(){return"done"}date(t){return t.doneDate}filterResultIfFieldMissing(){return!1}};var uo=class extends Et{fieldName(){return"due"}date(t){return t.dueDate}filterResultIfFieldMissing(){return!1}};var ur=class extends We{constructor(){super(...arguments);this._filters=new bn}canCreateFilterForLine(e){return this._filters.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){return this._filters.createFilterOrErrorMessage(e)}filterRegExp(){return null}};var Cd=class extends ur{constructor(){super(),this._filters.add("exclude sub-items",t=>{if(t.indentation==="")return!0;let e=t.indentation.lastIndexOf(">");return e===-1?!1:/^ ?$/.test(t.indentation.slice(e+1))})}fieldName(){return"exclude"}};function Md(r,t){return[["task",r],["query",t?t.query:null]]}function SE(r,t,e){let n=Md(r,e||null),i=vu(n,t);return i.error?i.error:zy(i.queryComponent,n,t)}var wu=class{constructor(t){this.line=t,this.functionOrError=vu(Md(null,null),t)}isValid(){return this.functionOrError.isValid()}get parseError(){return this.functionOrError.error}evaluate(t,e){if(!this.isValid())throw Error(`ErroLine truncated
|
||||||
|
|
||||||
|
The instruction was converted to the following simplified line:
|
||||||
|
${i.simplifiedLine}
|
||||||
|
|
||||||
|
Where the sub-expressions in the simplified line are:
|
||||||
|
${a}
|
||||||
|
|
||||||
|
For help, see:
|
||||||
|
https://publish.obsidian.md/tasks/Queries/Combining+Filters
|
||||||
|
`;return ke.fromError(e,l)}stringifySubExpressionsForErrorMessage(e){return Object.entries(e).map(([n,i])=>` '${n}': '${i}'
|
||||||
|
=> ${this.stringifySubExpressionStatus(i)}`).join(`
|
||||||
|
`)}stringifySubExpressionStatus(e){let n=Su(e);return n?n.error?`ERROR:
|
||||||
|
${n.error.split(`
|
||||||
|
`).map(s=>s.trim()).join(`
|
||||||
|
`)}`:"OK":`ERROR:
|
||||||
|
do not understand query`}helpMessageFromSimpleError(e,n){return`Could not interpret the following instruction as a Boolean combination:
|
||||||
|
${e}
|
||||||
|
|
||||||
|
The error message is:
|
||||||
|
${n}`}};var Hd=class extends Xe{fieldName(){return"filename"}value(t){let e=t.filename;return e===null?"":e+".md"}supportsSorting(){return!0}supportsGrouping(){return!0}grouper(){return t=>{let e=t.filename;return e===null?["Unknown Location"]:["[["+e+"]]"]}}};var To=class extends We{canCreateFilterForLine(t){return!1}createFilterOrErrorMessage(t){return ke.fromError(t,"Filtering by urgency is not yet supported")}fieldName(){return"urgency"}filterRegExp(){throw Error(`filterRegExp() unimplemented for ${this.fieldName()}`)}supportsSorting(){return!0}comparator(){return(t,e)=>e.urgency-t.urgency}supportsGrouping(){return!0}grouper(){return t=>[`${t.urgency.toFixed(2)}`]}createGrouper(t){return super.createGrouper(!t)}grouperInstruction(t){return super.grouperInstruction(!t)}};var Gd=class extends Xe{constructor(){super()}fieldName(){return"status.name"}value(t){return t.status.name}supportsSorting(){return!0}supportsGrouping(){return!0}};Cn();var ni=class extends We{canCreateFilterForLine(t){let e=new RegExp(`^(?:${this.fieldNameSingularEscaped()})`,"i");return We.lineMatchesFilter(e,t)}createFilterOrErrorMessage(t){let e=We.getMatch(this.filterRegExp(),t);if(e===null)return this.helpMessage(t);let n=e[1].toLowerCase(),i=e[2],s=Bt[i.toUpperCase()];if(!s)return this.helpMessage(t);let a;switch(n){case"is":a=o=>o.status.type===s;break;case"is not":a=o=>o.status.type!==s;break;default:return this.helpMessage(t)}return ke.fromFilter(new Kt(t,a,new He(t)))}filterRegExp(){return new RegExp(`^(?:${this.fieldNameSingularEscaped()}) (is|is not) ([^ ]+)$`,"i")}helpMessage(t){let e=Object.values(Bt).filter(i=>i!=="EMPTY").join(" "),n=`Invalid ${this.fieldNameSingular()} instruction: '${t}'.
|
||||||
|
Allowed options: 'is' and 'is not' (without quotes).
|
||||||
|
Allowed values: ${e}
|
||||||
|
Note: values are case-insensitive,
|
||||||
|
so 'in_progress' works too, for example.
|
||||||
|
Example: ${this.fieldNameSingular()} is not NON_TASK`;return ke.fromError(t,n)}fieldName(){return"status.type"}value(t){return t.status.type}supportsSorting(){return!0}comparator(){return(t,e)=>{let n=ni.groupName(t),i=ni.groupName(e);return n.localeCompare(i,void 0,{numeric:!0})}}supportsGrouping(){return!0}grouper(){return t=>[ni.groupName(t)]}static groupName(t){return t.status.typeGroupText}};var Bd=class extends Xe{fieldName(){return"recurrence"}value(t){return t.recurrence!==null?t.recurrence.toText():""}supportsGrouping(){return!0}grouper(){return t=>t.recurrence!==null?[t.recurrence.toText()]:["None"]}};var Vd=class extends Xe{fieldName(){return"folder"}value(t){return t.file.folder}supportsGrouping(){return!0}grouper(){return t=>[Xe.escapeMarkdownCharacters(this.value(t))]}};var zd=class extends Xe{fieldName(){return"root"}value(t){return t.file.root}supportsGrouping(){return!0}grouper(){return t=>[Xe.escapeMarkdownCharacters(this.value(t))]}};var Kd=class extends Xe{fieldName(){return"backlink"}value(t){let e=t.getLinkText({isFilenameUnique:!0});return e===null?"Unknown Location":e}createFilterOrErrorMessage(t){return ke.fromError(t,"backlink field does not support filtering")}canCreateFilterForLine(t){return!1}supportsGrouping(){return!0}grouper(){return t=>{let e=t.filename;if(e===null)return["Unknown Location"];let n=t.precedingHeader;return n===null?["[["+e+"]]"]:[`[[${e}#${n}|${e} > ${n}]]`]}}};var Qd=class extends Et{fieldName(){return"cancelled"}date(t){return t.cancelledDate}filterResultIfFieldMissing(){return!1}};var Zd=class extends ur{constructor(){super(),this._filters.add("is blocking",(t,e)=>t.isBlocking(e.allTasks)),this._filters.add("is not blocking",(t,e)=>!t.isBlocking(e.allTasks)),this._filters.add("is blocked",(t,e)=>t.isBlocked(e.allTasks)),this._filters.add("is not blocked",(t,e)=>!t.isBlocked(e.allTasks))}fieldName(){return"blocking"}};var Xd=class extends Xe{constructor(){super();this.filterInstructions=new bn;this.filterInstructions.add("has id",e=>e.id.length>0),this.filterInstructions.add("no id",e=>e.id.length===0)}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){let n=this.filterInstructions.createFilterOrErrorMessage(e);return n.isValid()?n:super.createFilterOrErrorMessage(e)}fieldName(){return"id"}value(e){return e.id}supportsSorting(){return!0}supportsGrouping(){return!0}};var Jd=class extends We{constructor(){super();this.filterInstructions=new bn;this.filterInstructions.add("has depends on",e=>e.dependsOn.length>0),this.filterInstructions.add("no depends on",e=>e.dependsOn.length===0)}canCreateFilterForLine(e){return this.filterInstructions.canCreateFilterForLine(e)?!0:super.canCreateFilterForLine(e)}createFilterOrErrorMessage(e){let n=this.filterInstructions.createFilterOrErrorMessage(e);return n.isValid()?n:ke.fromError(e,"Unknown instruction")}fieldName(){return"blocked by"}filterRegExp(){return null}};var ef=class extends ur{fieldName(){return"random"}supportsSorting(){return!0}comparator(){return(t,e)=>this.sortKey(t)-this.sortKey(e)}sortKey(t){let e=i=>{let s=0,a=9;for(;s<i.length;)a=Math.imul(a^i.charCodeAt(s++),387420489);return a^a>>>9},n=window.moment().format("Y-MM-DD");return e(n+" "+t.description)}};var cb=[()=>new Gd,()=>new ni,()=>new es,()=>new Ld,()=>new ea,()=>new Fd,()=>new Qd,()=>new Od,()=>new Id,()=>new Nd,()=>new uo,()=>new Rd,()=>new co,()=>new Vd,()=>new zd,()=>new Kd,()=>new Js,()=>new ta,()=>new Pd,()=>new Cd,()=>new Hd,()=>new To,()=>new Bd,()=>new Ad,()=>new Xd,()=>new Jd,()=>new Zd,()=>new ef,()=>new qd];function Su(r){for(let t of cb){let e=t();if(e.canCreateFilterForLine(r))return e.createFilterOrErrorMessage(r)}return null}function YE(r){let t=/^sort by /i;if(r.match(t)===null)return null;for(let e of cb){let i=e().createSorterFromLine(r);if(i)return i}return null}function jE(r){let t=/^group by /i;if(r.match(t)===null)return null;for(let e of cb){let i=e().createGrouperFromLine(r);if(i)return i}return null}var tf=class{constructor(t,e,n){this.nestingLevel=t,this.displayName=e,this.property=n}};var nf=class{constructor(t,e){this.lastHeadingAtLevel=new Array;this.groupers=e;let i=t.keys().next().value.length;for(let s=0;s<i;s++)this.lastHeadingAtLevel.push("")}getHeadingsForTaskGroup(t){let e=new Array;for(let n=0;n<t.length;n++){let i=t[n];if(i!=this.lastHeadingAtLevel[n]){e.push(new tf(n,i,this.groupers[n].property));for(let s=n;s<t.length;s++)this.lastHeadingAtLevel[s]="";this.lastHeadingAtLevel[n]=i}}return e}};var rf=class{constructor(t){this.children=new Map;this.values=[];this.values=t}generateAllPaths(t=[]){let e=new Map;if(this.children.size==0)return e.set([...t],this.values),e;for(let[n,i]of this.children)t.push(n),i.generateAllPaths(t).forEach((a,o)=>e.set(o,a)),t.pop();return e}};var sf=class extends rf{},af=class{constructor(t,e,n){this.root=new sf(e),this.buildGroupingTree(t,n)}buildGroupingTree(t,e){let n=[
Line truncated
|
||||||
|
`;return t}toString(){let t=`
|
||||||
|
`;t+=`Group names: [${this.groups}]
|
||||||
|
`;for(let e of this.groupHeadings)t+=`${"#".repeat(4+e.nestingLevel)} [${e.property}] ${e.displayName}
|
||||||
|
`;return t+=this.tasksAsStringOfLines(),t}};var vo=class{constructor(t,e,n){this._groups=new Array;this._totalTaskCount=0;this._totalTaskCount=e.length,this._groupers=t;let s=new af(t,e,n).generateTaskTreeStorage();this.addTaskGroups(s),this.sortTaskGroups(),this.setGroupsHeadings(s)}get groupers(){return this._groupers}get groups(){return this._groups}totalTasksCount(){return this._totalTaskCount}toString(){let t="";t+=`Groupers (if any):
|
||||||
|
`;for(let n of this._groupers){let i=n.reverse?" reverse":"";t+=`- ${n.property}${i}
|
||||||
|
`}for(let n of this.groups)t+=n.toString(),t+=`
|
||||||
|
---
|
||||||
|
`;return t+=`
|
||||||
|
${this.totalTasksCount()} tasks
|
||||||
|
`,t}addTaskGroups(t){for(let[e,n]of t){let i=new of(e,n);this.addTaskGroup(i)}}addTaskGroup(t){this._groups.push(t)}sortTaskGroups(){let t=(e,n)=>{let i=e.groups,s=n.groups;for(let a=0;a<i.length;a++){let o=this._groupers[a],l=i[a].localeCompare(s[a],void 0,{numeric:!0});if(l!==0)return o.reverse?-l:l}return 0};this._groups.sort(t)}setGroupsHeadings(t){let e=new nf(t,this._groupers);for(let n of this._groups)n.setGroupHeadings(e.getHeadingsForTaskGroup(n.groups))}applyTaskLimit(t){this._groupers.length!==0&&(this._groups.forEach(e=>{e.applyTaskLimit(t)}),this.recalculateTotalTaskCount())}recalculateTotalTaskCount(){let t=[];this._groups.forEach(n=>{t=[...t,...n.tasks]});let e=[...new Set(t)];this._totalTaskCount=e.length}};var rs=class{constructor(t,e){this.tasksFile=t,this.allTasks=[...e],this._queryContext=this.tasksFile?Zy(this.tasksFile,this.allTasks):void 0}static fromAllTasks(t){return new rs(void 0,t)}get queryPath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}queryContext(){return this._queryContext}};function $E(r){return`task${r!==1?"s":""}`}var ia=class{constructor(t,e){this.totalTasksCountBeforeLimit=0;this._searchErrorMessage=void 0;this.taskGroups=t,this.totalTasksCountBeforeLimit=e}get searchErrorMessage(){return this._searchErrorMessage}set searchErrorMessage(t){this._searchErrorMessage=t}get totalTasksCount(){return this.taskGroups.totalTasksCount()}totalTasksCountDisplayText(){let t=this.totalTasksCount,e=this.totalTasksCountBeforeLimit;return t===e?`${t} ${$E(t)}`:`${t} of ${e} ${$E(e)}`}get groups(){return this.taskGroups.groups}static fromError(t){let e=new ia(new vo([],[],rs.fromAllTasks([])),0);return e._searchErrorMessage=t,e}};function WE(r){return r.endsWith("\\")}function qE(r){return r.endsWith("\\\\")}function WY(r){return r.replace(/^[ \t]*/,"")}function qY(r){return r.replace(/[ \t]*\\$/,"")}function HY(r,t){let e=r;return t&&(e=WY(r)),qE(e)?e=e.slice(0,-1):WE(r)&&(e=qY(e)),e}function lf(r){let t=[],e=!1,n="",i="",s=r+`
|
||||||
|
`;for(let a of s.split(`
|
||||||
|
`)){let o=HY(a,e);e?(n+=`
|
||||||
|
`+a,i+=" "+o):(n=a,i=o),qE(a)?e=!1:e=WE(a),e||(i.trim()!==""&&t.push(new un(n,i)),n="",i="")}return t}function HE(r){return lf(r).map(t=>t.anyContinuationLinesRemoved)}var _o=class{static by(t,e,n){let i=this.defaultSorters().map(a=>a.comparator),s=[];for(let a of t)s.push(a.comparator);return e.sort(_o.makeCompositeComparator([...s,...i],n))}static defaultSorters(){return[new ni().createNormalSorter(),new To().createNormalSorter(),new uo().createNormalSorter(),new ea().createNormalSorter(),new co().createNormalSorter()]}static makeCompositeComparator(t,e){return(n,i)=>{for(let s of t){let a=s(n,i,e);if(a!==0)return a}return 0}}};var GE=0,Ln=class{constructor(t,e=void 0){this.statements=[];this._limit=void 0;this._taskGroupLimit=void 0;this._taskLayoutOptions=new Br;this._queryLayoutOptions=new Zi;this.layoutStatements=[];this._filters=[];this._error=void 0;this._sorting=[];this._grouping=[];this._ignoreGlobalQuery=!1;this.hideOptionsRegexp=/^(hide|show) +(.*)/i;this.shortModeRegexp=/^short/i;this.fullModeRegexp=/^full/i;this.explainQueryRegexp=/^explain/i;this.ignoreGlobalQueryRegexp=/^ignore global query/i;this.logger=sn.getLogger("tasks.Query");this.limitRegexp=/^limit (groups )?(to )?(\d+)( tasks?)?/i;this.commentRegexp=/^#.*/;this.presetRegexp=/^preset +(.*)/i;this._queryId=this.generateQueryId(10),this.source=t,this.tasksFile=e;let n=lf(t);for(let i of n){let s=this.expandPlaceholders(i,e);if(this.error!==void 0)return;this.statements.push(...s)}for(let i of this.statements)try{if(this.parseLine(i),this.error!==void 0)return}catch(s){let a;s instanceof Error?a=s.message:a="Unknown error",this.setError(a,i);return}}removeIllegalGlobalQueryInstructions(){this._ignoreGlobalQuery=!1}get filePath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}get queryId(){return this._queryId}parseLine(t){let e=t.anyPlaceholdersExpanded;switch(!0){case this.presetRegexp.test(e):this.parsePreset(e,t);break;case this.shortModeRegexp.test(e):this._queryLayoutOptions.shortMode=!0,this.saveLayoutStatement(t);break;case this.fullModeRegexp.test(e):this._queryLayoutOptions.shortMode=!1,this.saveLayoutStatement(t);break;case this.explainQueryRegexp.test(e):this._queryLayoutOptions.explainQuery=!0;break;case this.ignoreGlobalQueryRegexp.test(e):this._ignoreGlobalQuery=!0;break;case this.limitRegexp.test(e):this.parseLimit(e);break;case this.parseSortBy(e,t):break;case this.parseGroupBy(e,t):break;case this.hideOptionsRegexp.test(e):this.parseHideOptions(t);break;case this.commentRegexp.test(e):break;case this.parseFilter(e,t):break;default:this.setError("do not understand query",t)}}formatQueryForLogging(){return`
|
||||||
|
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||||
|
${this.source}
|
||||||
|
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||||||
|
`}expandPlaceholders(t,e){let n=t.anyContinuationLinesRemoved;if(n.includes("{{")&&n.includes("}}")&&this.tasksFile===void 0)return this._error=`The query looks like it contains a placeholder, with "{{" and "}}"
|
||||||
|
but no file path has been supplied, so cannot expand placeholder values.
|
||||||
|
The query is:
|
||||||
|
${n}`,[t];if(this.commentRegexp.test(n))return[t];let s=n;if(e){let a=Qy(e),o="";try{let u=0;for(;s!==o&&u<10;)o=s,s=Ky(o,a),u++;s!==n&&(s=lf(s).map(c=>c.anyContinuationLinesRemoved).join(`
|
||||||
|
`))}catch(l){return l instanceof Error?this._error=l.message:this._error="Internal error. expandPlaceholders() threw something other than Error.",[t]}}return this.createStatementsFromExpandedPlaceholders(s,t)}createStatementsFromExpandedPlaceholders(t,e){let n=t.split(`
|
||||||
|
`).map(i=>i.trim()).filter(i=>i.length>0);return n.length===1?(e.recordExpandedPlaceholders(n[0]),[e]):n.map((i,s)=>{let a=`: statement ${s+1} after expansion of placeholder`,o=new un(e.rawInstruction+a,e.anyContinuationLinesRemoved+a);return o.recordExpandedPlaceholders(i),o})}append(t){return this.source===""?t:t.source===""?this:new Ln(`${this.source}
|
||||||
|
${t.source}`,this.tasksFile)}explainQuery(){return new ao().explainQuery(this)}get limit(){return this._limit}get taskGroupLimit(){return this._taskGroupLimit}get taskLayoutOptions(){return this._taskLayoutOptions}get queryLayoutOptions(){return this._queryLayoutOptions}get filters(){return this._filters}addFilter(t){this._filters.push(t)}get sorting(){return this._sorting}get grouping(){return this._grouping}get error(){return this._error}setError(t,e){this._error=Ln.generateErrorMessage(e,t)}static generateErrorMessage(t,e){return t.allLinesIdentical()?`${e}
|
||||||
|
Problem line: "${t.rawInstruction}"`:`${e}
|
||||||
|
Problem statement:
|
||||||
|
${t.explainStatement(" ")}
|
||||||
|
`}get ignoreGlobalQuery(){return this._ignoreGlobalQuery}applyQueryToTasks(t){this.debug(`[search] Executing query: ${this.formatQueryForLogging()}`);let e=new rs(this.tasksFile,t),n;try{this.filters.forEach(l=>{n=l.statement,t=t.filter(u=>l.filterFunction(u,e))}),n=void 0;let{debugSettings:i}=re(),s=i.ignoreSortInstructions?t:_o.by(this.sorting,t,e),a=s.slice(0,this.limit),o=new vo(this.grouping,a,e);return this._taskGroupLimit!==void 0&&o.applyTaskLimit(this._taskGroupLimit),new ia(o,s.length)}catch(i){let a=Xs("Search failed",i);return n&&(a=Ln.generateErrorMessage(n,a)),ia.fromError(a)}}parseHideOptions(t){let e=t.anyPlaceholdersExpanded,n=e.match(this.hideOptionsRegexp);if(n===null)return;let i=n[1].toLowerCase()==="hide",s=n[2].toLowerCase();if(gE(this._queryLayoutOptions,s,i)){this.saveLayoutStatement(t);return}if(PS(this._taskLayoutOptions,s,!i)){this.saveLayoutStatement(t);return}this.setError("do not understand hide/show option",new un(e,e))}saveLayoutStatement(t){this.layoutStatements.push(t)}parseFilter(t,e){var i;let n=Su(t);return n!=null?(n.filter?(n.filter.setStatement(e),this._filters.push(n.filter)):this.setError((i=n.error)!=null?i:"Unknown error",e),!0):!1}parseLimit(t){let e=t.match(this.limitRegexp);if(e===null){this.setError("do not understand query limit",new un(t,t));return}let n=Number.parseInt(e[3],10);e[1]!==void 0?this._taskGroupLimit=n:this._limit=n}parseSortBy(t,e){let n=YE(t);return n?(n.setStatement(e),this._sorting.push(n),!0):!1}parseGroupBy(t,e){let n=jE(t);return n?(n.setStatement(e),this._grouping.push(n),!0):!1}parsePreset(t,e){let n=this.presetRegexp.exec(t);if(n){let i=n[1].trim(),{presets:s}=re(),a=s[i];if(!a){this.setError(VS(i,s),e);return}let o=HE(a);for(let l of o){let u=new un(e.rawInstruction,e.anyContinuationLinesRemoved);if(u.recordExpandedPlaceholders(l),l.includes("{{")&&l.includes("}}")&&this.tasksFile){let c=Qy(this.tasksFile),d=Ky(l,c);u.recordExpandedPlaceholders(d)}this.parseLine(u)}}}generateQueryId(t){return GE+=1,GE.toString().padStart(t,"0")}debug(t,e){this.logger.debugWithId(this._queryId,`"${this.filePath}": ${t}`,e)}warn(t,e){this.logger.warnWithId(this._queryId,`"${this.filePath}": ${t}`,e)}};var db=[{name:"TQ_explain",type:"checkbox",display:"explain",handler:"instruction",trueValue:"explain",falseValue:""},{name:"TQ_short_mode",type:"checkbox",display:"short mode",handler:"instruction",trueValue:"short mode",falseValue:"full mode"},{name:"TQ_show_tree",type:"checkbox",display:"tree",handler:"showAndHide"},{name:"TQ_show_tags",type:"checkbox",display:"tags",handler:"showAndHide"},{name:"TQ_show_id",type:"checkbox",display:"id",handler:"showAndHide"},{name:"TQ_show_depends_on",type:"checkbox",display:"depends on",handler:"showAndHide"},{name:"TQ_show_priority",type:"checkbox",display:"priority",handler:"showAndHide"},{name:"TQ_show_recurrence_rule",type:"checkbox",display:"recurrence rule",handler:"showAndHide"},{name:"TQ_show_on_completion",type:"checkbox",display:"on completion",handler:"showAndHide"},{name:"TQ_show_created_date",type:"checkbox",display:"created date",handler:"showAndHide"},{name:"TQ_show_start_date",type:"checkbox",display:"start date",handler:"showAndHide"},{name:"TQ_show_scheduled_date",type:"checkbox",display:"scheduled date",handler:"showAndHide"},{name:"TQ_show_due_date",type:"checkbox",display:"due date",handler:"showAndHide"},{name:"TQ_show_cancelled_date",type:"checkbox",display:"cancelled date",handler:"showAndHide"},{name:"TQ_show_done_date",type:"checkbox",display:"done date",handler:"showAndHide"},{name:"TQ_show_urgency",type:"checkbox",display:"urgency",handler:"showAndHide"},{name:"TQ_show_backlink",type:"checkbox",display:"backlink",handler:"showAndHide"},{name:"TQ_show_edit_button",type:"checkbox",display:"edit button",handler:"showAndHide"},{name:"TQ_show_postpone_button",type:"checkbox",display:"postpone button",handler:"showAndHide"},{name:"TQ_show_task_count",type:"checkbox",display:"task count",handler:"showAndHide"},{name:"TQ_extra_instructions",type:"text",handler:"addValue"}],Oi=class{source(t){return t?db.map(n=>this.generateInstruction(t,n)).filter(n=>n!=="").join(`
|
||||||
|
`):""}generateInstruction(t,e){let n=t.hasProperty(e.name),i=t.property(e.name);switch(e.handler){case"instruction":return n&&(i?e.trueValue:e.falseValue)||"";case"showAndHide":return n&&(i?"show "+e.display:"hide "+e.display)||"";case"addValue":return n&&i||"";default:throw new Error("Unknown handler type: "+e.handler+".")}}query(t){return new Ln(this.source(t),t)}allPropertyNames(){return db.map(t=>t.name)}allPropertyNamesSorted(){return this.allPropertyNames().sort((t,e)=>t.localeCompare(e))}propertyType(t){var e,n;return(n=(e=db.find(i=>i.name===t))==null?void 0:e.type)!=null?n:void 0}metaBindPluginWidgets(){return"\nshort mode: `INPUT[toggle:TQ_short_mode]`\ntree: `INPUT[toggle:TQ_show_tree]`\ntags: `INPUT[toggle:TQ_show_tags]`\nid: `INPUT[toggle:TQ_show_id]` depends on: `INPUT[toggle:TQ_show_depends_on]`\npriority: `INPUT[toggle:TQ_show_priority]`\nrecurrence rule: `INPUT[toggle:TQ_show_recurrence_rule]` on completion: `INPUT[toggle:TQ_show_on_completion]`\nstart date: `INPUT[toggle:TQ_show_start_date]` scheduled date: `INPUT[toggle:TQ_show_scheduled_date]` due date: `INPUT[toggle:TQ_show_due_date]`\ncreated date: `INPUT[toggle:TQ_show_created_date]` cancelled date: `INPUT[toggle:TQ_show_cancelled_date]` done date: `INPUT[toggle:TQ_show_done_date]`\nurgency: `INPUT[toggle:TQ_show_urgency]`\nbacklink: `INPUT[toggle:TQ_show_backlink]`\nedit button: `INPUT[toggle:TQ_show_edit_button]` postpone button: `INPUT[toggle:TQ_show_postpone_button]`\ntask count: `INPUT[toggle:TQ_show_task_count]`\nextra instructions: `INPUT[textArea:TQ_extra_instructions]`\nexplain: `INPUT[toggle:TQ_explain]`\n"}};function BE(r,t){return I(this,null,function*(){yield r.fileManager.processFrontMatter(t,e=>{let n=new Oi().allPropertyNamesSorted(),i=!1;n.forEach(s=>{s in e||(e[s]=null,i=!0)}),i?new fb.Notice("Properties updated successfully."):new fb.Notice("All supported properties are already present.")})})}var uf=class{get app(){return this.plugin.app}constructor({plugin:t}){this.plugin=t,t.addCommand({id:"edit-task",name:"Create or edit task",icon:"pencil",editorCheckCallback:(e,n,i)=>mE(e,n,i,this.app,this.plugin.getTasks())}),t.addCommand({id:"toggle-done",name:"Toggle task done",icon:"check-in-circle",editorCheckCallback:hE}),t.addCommand({id:"add-query-file-defaults-properties",name:"Add all Query File Defaults properties",icon:"settings",checkCallback:e=>{let n=this.app.workspace.getActiveFile();return!n||n.extension!=="md"?!1:(e||this.ensureQueryFileDefaultsFrontmatter(n).catch(console.error),!0)}})}ensureQueryFileDefaultsFrontmatter(t){return I(this,null,function*(){let{app:e}=this;yield BE(e,t)})}};var is=class{constructor(t=is.empty){this._source=t}static getInstance(){return is.instance||(is.instance=new is),is.instance}set(t){this._source=t}query(t=void 0){let e=new Ln(this._source,t);return e.removeIllegalGlobalQueryInstructions(),e}hasInstructions(){return this._source.trim()!==is.empty}},fr=is;fr.empty="";Ws();var cf=class{constructor({obsidianEvents:t}){this.logger=sn.getLogger("tasks.Events");this.obsidianEvents=t}onCacheUpdate(t){this.logger.debug("TasksEvents.onCacheUpdate()");let e="obsidian-tasks-plugin:cache-update";return this.obsidianEvents.on(e,t)}triggerCacheUpdate(t){this.logger.debug("TasksEvents.triggerCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:cache-update",t)}onRequestCacheUpdate(t){this.logger.debug("TasksEvents.onRequestCacheUpdate()");let e="obsidian-tasks-plugin:request-cache-update";return this.obsidianEvents.on(e,t)}triggerRequestCacheUpdate(t){this.logger.debug("TasksEvents.triggerRequestCacheUpdate()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:request-cache-update",t)}onReloadOpenSearchResults(t){this.logger.debug("TasksEvents.onReloadOpenSearchResults()");let e="obsidian-tasks-plugin:reload-open-search-results";return this.obsidianEvents.on(e,t)}triggerReloadOpenSearchResults(){this.logger.debug("TasksEvents.triggerReloadOpenSearchResults()"),this.obsidianEvents.trigger("obsidian-tasks-plugin:reload-open-search-results")}off(t){this.logger.debug("TasksEvents.off()"),this.obsidianEvents.offref(t)}};var yx=require("obsidian");pn();Fs();Nt();var gx=require("obsidian");pn();Vt();Fs();Vr();Nt();si();Dr();Ga();var pb=class{constructor(t){this.newStatus=t}apply(t){return this.isCheckedForTask(t)?[t]:t.handleNewStatusWithRecurrenceInUsersOrder(this.newStatus)}instructionDisplayName(){return`Change status to: [${this.newStatus.symbol}] ${this.newStatus.name}`}isCheckedForTask(t){return this.newStatus.symbol===t.status.symbol}};function VE(r){let t=[],e=new et().coreStatuses.map(n=>n.symbol);for(let n of[!0,!1])for(let i of r.registeredStatuses)e.includes(i.symbol)===n&&t.push(new pb(i));return t}var zE=require("obsidian");var mb="---",wo=class{apply(t){throw new Error("MenuDividerInstruction.apply(): Method not implemented.")}instructionDisplayName(){return mb}isCheckedForTask(t){return!1}};function ri(r,t){return I(this,null,function*(){yield Nn({originalTask:r,new
Line truncated
|
||||||
|
<span class='flatpickr-weekday'>
|
||||||
|
`+g.join("</span><span class='flatpickr-weekday'>")+`
|
||||||
|
</span>
|
||||||
|
`}}function w(){e.calendarContainer.classList.add("hasWeeks");var h=qe("div","flatpickr-weekwrapper");h.appendChild(qe("span","flatpickr-weekday",e.l10n.weekAbbreviation));var g=qe("div","flatpickr-weeks");return h.appendChild(g),{weekWrapper:h,weekNumbers:g}}function S(h,g){g===void 0&&(g=!0);var k=g?h:h-e.currentMonth;k<0&&e._hidePrevMonthArrow===!0||k>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=k,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,Ze("onYearChange"),R()),K(),Ze("onMonthChange"),da())}function C(h,g){if(h===void 0&&(h=!0),g===void 0&&(g=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,g===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var k=bf(e.config),A=k.hours,G=k.minutes,Z=k.seconds;p(A,G,Z)}e.redraw(),h&&Ze("onChange")}function L(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),Ze("onClose")}function j(){e.config!==void 0&&Ze("onDestroy");for(var h=e._handlers.length;h--;)e._handlers[h].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var g=e.calendarContainer.parentNode;if(g.lastChild&&g.removeChild(g.lastChild),g.parentNode){for(;g.firstChild;)g.parentNode.insertBefore(g.firstChild,g);g.parentNode.removeChild(g)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(k){try{delete e[k]}catch(A){}})}function D(h){return e.calendarContainer.contains(h)}function N(h){if(e.isOpen&&!e.config.inline){var g=vn(h),k=D(g),A=g===e.input||g===e.altInput||e.element.contains(g)||h.path&&h.path.indexOf&&(~h.path.indexOf(e.input)||~h.path.indexOf(e.altInput)),G=!A&&!k&&!D(h.relatedTarget),Z=!e.config.ignoredFocusElements.some(function(ve){return ve.contains(g)});G&&Z&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&l(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function $(h){if(!(!h||e.config.minDate&&h<e.config.minDate.getFullYear()||e.config.maxDate&&h>e.config.maxDate.getFullYear())){var g=h,k=e.currentYear!==g;e.currentYear=g||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),k&&(e.redraw(),Ze("onYearChange"),R())}}function ce(h,g){var k;g===void 0&&(g=!0);var A=e.parseDate(h,void 0,g);if(e.config.minDate&&A&&_n(A,e.config.minDate,g!==void 0?g:!e.minDateHasTime)<0||e.config.maxDate&&A&&_n(A,e.config.maxDate,g!==void 0?g:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(A===void 0)return!1;for(var G=!!e.config.enable,Z=(k=e.config.enable)!==null&&k!==void 0?k:e.config.disable,ve=0,ne=void 0;ve<Z.length;ve++){if(ne=Z[ve],typeof ne=="function"&&ne(A))return G;if(ne instanceof Date&&A!==void 0&&ne.getTime()===A.getTime())return G;if(typeof ne=="string"){var Re=e.parseDate(ne,void 0,!0);return Re&&Re.getTime()===A.getTime()?G:!G}else if(typeof ne=="object"&&A!==void 0&&ne.from&&ne.to&&A.getTime()>=ne.from.getTime()&&A.getTime()<=ne.to.getTime())return G}return!G}function be(h){return e.daysContainer!==void 0?h.className.indexOf("hidden")===-1&&h.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(h):!1}function Oe(h){var g=h.target===e._input,k=e._input.value.trimEnd()!==fa();g&&k&&!(h.relatedTarget&&D(h.relatedTarget))&&e.setDate(e._input.value,!0,h.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function Ge(h){var g=vn(h),k=e.config.wrap?r.contains(g):g===e.
Line truncated
|
||||||
|
`);if(p===void 0)return!1;let b=null;for(let v=0;v<p.length;v=v+1)if(p[v]!==""){b=p[v];break}return b===null?!1:Ne.getInstance().includedIn(b)});if(i.length===0)return;let s=e.sourcePath,a=e.getSectionInfo(t);if(a===null)return;let o=a.text.split(`
|
||||||
|
`),l=0,u=[];for(let f=a.lineStart;f<=a.lineEnd;f++){let p=o[f];if(p===void 0)continue;let b=null,T=pe.fromLine({line:p,taskLocation:new Lt(new mt(s),f,a.lineStart,l,b),fallbackDate:null});T!==null&&(u.push(T),l++)}let c=new Ci({obsidianComponent:n,parentUlElement:t,taskLayoutOptions:new Br,queryLayoutOptions:new Zi});for(let f=0;f<i.length;f++){let p=u[f],b=i[f];if(p===void 0||b===void 0)continue;let T=(d=b.getAttr("data-line"))!=null?d:"0",v=Number.parseInt(T,10),O=yield c.renderTaskLine({task:p,taskIndex:v,isTaskInQueryFile:!0}),E=b.childNodes;for(let q=0;q<E.length;q=q+1){let ae=E[q],H=ae.nodeName.toLowerCase();H==="div"?O.prepend(ae):(H==="ul"||H==="ol")&&O.append(ae)}let P=b.querySelectorAll("[data-footnote-id]"),Y=O.querySelectorAll("[data-footnote-id]");if(P.length===Y.length)for(let q=0;q<P.length;q++)Y[q].replaceWith(P[q]);b.replaceWith(O)}})}};var bx=require("@codemirror/view"),Tx=require("obsidian");Nt();var vx=()=>bx.ViewPlugin.fromClass(kb),kb=class{constructor(t){this.view=t,this.handleClickEvent=this.handleClickEvent.bind(this),this.view.dom.addEventListener("click",this.handleClickEvent)}destroy(){this.view.dom.removeEventListener("click",this.handleClickEvent)}handleClickEvent(t){let{target:e}=t;if(!e||!(e instanceof HTMLInputElement)||e.type!=="checkbox")return!1;let n=e.closest("ul.plugin-tasks-query-result, div.callout-content");if(n){if(n.matches("div.callout-content")){let p=`obsidian-tasks-plugin warning: Tasks cannot add or remove completion dates or make the next copy of a recurring task for tasks written inside a callout when you click their checkboxes in Live Preview.
|
||||||
|
If you wanted Tasks to do these things, please undo your change, then either click the line of the task and use the "Toggle Task Done" command, or switch to Reading View to click the checkbox.`;console.warn(p),new Tx.Notice(p,45e3)}return!1}let{state:i}=this.view,s=this.view.posAtDOM(e),a=i.doc.lineAt(s),o=pe.fromLine({line:a.text,taskLocation:Lt.fromUnknownPosition(new mt("")),fallbackDate:null});if(o===null)return!1;t.preventDefault();let l=o.toggleWithRecurrenceInUsersOrder(),u=l.map(p=>p.toFileLineString()).join(i.lineBreak),c=a.to;if(u===""){let p=a.number<i.doc.lines?i.doc.line(a.number+1):null;p&&(c=p.from)}let d=i.update({changes:{from:a.from,to:c,insert:u}});if(this.view.dispatch(d),l.length===1){let p=l[0].status.symbol!==" ";setTimeout(()=>{e.checked=p},1)}return!0}};var Mi=require("obsidian"),wx=require("obsidian");function _x(r,t,e,n=void 0){let i="";t.isEmpty()||(i+=`Only tasks containing the global filter '${t.get()}'.
|
||||||
|
|
||||||
|
`);let s=new ao(" ");function a(c,d){return`${c}:
|
||||||
|
|
||||||
|
${s.explainQuery(d)}`}let o=new Ln(r,n),l=new Oi().query(n);if(!(o.ignoreGlobalQuery||l.ignoreGlobalQuery)&&e.hasInstructions()){let c=e.query(n);i+=a("Explanation of the global query",c)+`
|
||||||
|
`}return l.source!==""&&(i+=a("Explanation of the Query File Defaults (from properties/frontmatter in the query's file)",l)+`
|
||||||
|
`),i+=a("Explanation of this Tasks code block query",o),i}function kf(r,t,e){let i=new Oi().query(e).append(new Ln(r,e));return i.ignoreGlobalQuery?i:t.query(e).append(i)}Vi();pn();function Ru(r,t,e){t&&r.push(KY(e))}function KY(r){return`tasks-layout-hide-${r}`}var Sf=class{constructor(t){t?this.queryLayoutOptions=t:this.queryLayoutOptions=new Zi}getHiddenClasses(){let t=[],e=[[this.queryLayoutOptions.hideUrgency,"urgency"],[this.queryLayoutOptions.hideBacklinks,"backlinks"],[this.queryLayoutOptions.hideEditButton,"edit-button"],[this.queryLayoutOptions.hidePostponeButton,"postpone-button"]];for(let[n,i]of e)Ru(t,n,i);return this.queryLayoutOptions.shortMode&&t.push("tasks-layout-short-mode"),t}};Fs();var Df=class{constructor(t){t?this.taskLayoutOptions=t:this.taskLayoutOptions=new Br}generateHiddenClasses(){let t=[];return this.taskLayoutOptions.toggleableComponents.forEach(e=>{Ru(t,!this.taskLayoutOptions.isShown(e),e)}),Ru(t,!this.taskLayoutOptions.areTagsShown(),"tags"),t}};Vt();var Cu=class{constructor(t){this.label=t,this.start()}start(){!this.recordTimings()||performance.mark(this.labelForStart())}finish(){!this.recordTimings()||(performance.mark(this.labelForEnd()),performance.measure(this.label,this.labelForStart(),this.labelForEnd()),this.printDuration())}printDuration(){let t=performance.getEntriesByName(this.label),e=t[t.length-1];e?console.log(this.label+":",e.duration.toFixed(2),"milliseconds"):console.log(`Measurement for ${this.label} not found`)}labelForStart(){return`${this.label} - start`}labelForEnd(){return`${this.label} - end`}recordTimings(){let{debugSettings:t}=re();return t.recordTimings}};Nt();var Sb=require("obsidian");var ls=class extends ss{constructor(t,e,n=ri){super(n);let i=(u,c,d,f,p,b)=>{var E;let T=!1,v=Do(e);if(v){let{postponedDate:P}=b(e,v,d,f);(E=e[v])!=null&&E.isSame(P,"day")&&(T=!0)}let O=p(e,f,d);c.setChecked(T).setTitle(O).onClick(()=>ls.postponeOnClickCallback(u,e,f,d,b,n))},s=lx,a=nx;this.addItem(u=>i(t,u,"days",0,s,a)),this.addItem(u=>i(t,u,"day",1,s,a)),this.addSeparator();let o=vb,l=Tb;this.addItem(u=>i(t,u,"days",2,o,l)),this.addItem(u=>i(t,u,"days",3,o,l)),this.addItem(u=>i(t,u,"days",4,o,l)),this.addItem(u=>i(t,u,"days",5,o,l)),this.addItem(u=>i(t,u,"days",6,o,l)),this.addSeparator(),this.addItem(u=>i(t,u,"week",1,o,l)),this.addItem(u=>i(t,u,"weeks",2,o,l)),this.addItem(u=>i(t,u,"weeks",3,o,l)),this.addItem(u=>i(t,u,"month",1,o,l)),this.addSeparator(),this.addItem(u=>i(t,u,"days",2,ux,rx))}static postponeOnClickCallback(o,l,u,c){return I(this,arguments,function*(t,e,n,i,s=Tb,a=ri){var b;let d=Do(e);if(d===null){let T="\u26A0\uFE0F Postponement requires a date: due, scheduled or start.";return new Sb.Notice(T,1e4)}let{postponedDate:f,postponedTask:p}=s(e,d,i,n);(b=e[d])!=null&&b.isSame(f,"day")||(yield a(e,p),ls.postponeSuccessCallback(t,d,f))})}static postponeSuccessCallback(t,e,n){t.style.pointerEvents="none";let i=ax(n,e);new Sb.Notice(i,2e3)}};var Ef=class{constructor(t,e,n,i,s,a=Ci.obsidianMarkdownRenderer){switch(this.source=e,this._tasksFile=n,this.renderMarkdown=i,this.obsidianComponent=s,this.textRenderer=a,t){case"block-language-tasks":this.query=this.makeQueryFromSourceAndTasksFile(),this.queryType="tasks";break;default:this.query=this.makeQueryFromSourceAndTasksFile(),this.queryType="tasks";break}}makeQueryFromSourceAndTasksFile(){return kf(this.source,fr.getInstance(),this.tasksFile)}get tasksFile(){return this._tasksFile}setTasksFile(t){this._tasksFile=t,this.rereadQueryFromFile()}rereadQueryFromFile(){this.query=this.makeQueryFromSourceAndTasksFile()}get filePath(){var t,e;return(e=(t=this.tasksFile)==null?void 0:t.path)!=null?e:void 0}render(t,e,n,i){return I(this,null,function*(){t==="Warm"&&this.query.error===void 0?yield this.renderQuerySearchResults(e,t,n,i):this.query.error!==void 0?this.renderErrorMessage(n,this.query.error):this.renderLoadingMessage(n)})}renderQuerySearchResults(t,e,n,i){return I(this,null,function*(){let s=this.explainAndPerformSearch(e,t,n);if(s.searchErrorMessage!==void 0){this.renderErrorMessage(n,s.searchErrorMessage);return}yield this.renderSearchResults(s,n,i)})}explainAndPerformSearch(t,e,n){let i=new Cu(`Search: ${this.query.queryId} - ${this.filePath}`);i.start(),this.query.debug(`[render] Render called: plugin state: ${t}; searching ${e.length} tasks`),this.query.queryLayoutOptions.explainQuery&&this.createExplanation(n);let s=this.query.applyQueryToTasks(e);return i.finish(),s}renderSearchResults(t,e,n){return I(this,null,function*(){let i=new Cu(`Render: ${this.query.queryId} - ${this.filePath}`);i.start(),yield this.addAllTaskGroups(t.taskGroups,e,n);let s=t.totalTasksCount;this.addTaskCount(e,t),this.query.debug(`[render] ${s} tasks displayed`),i.finish()})}renderErrorMessage(t,e){t.createDiv().innerHTML=`<pre>Tasks query: ${e.replace(/\n/g,"<br>")}</pre>`}renderLoadingMessage(t){t.setText("Loading Tasks ...")}createExplanation(t){let e=_x(this.source,Ne.getInstance(),fr.getInstance(),this.tasksFile),n=Line truncated
|
||||||
|
`,this._markdown+=`${e}
|
||||||
|
`}addRow(t){let e=this.makeRowText(t);this._markdown+=`${e}
|
||||||
|
`}addRowIfNew(t){let e=this.makeRowText(t);this._markdown.includes(e)||(this._markdown+=`${e}
|
||||||
|
`)}makeRowText(t){let e="|";return t.forEach(n=>{e+=` ${n} |`}),e}};ys();pn();Cn();Dr();Vr();function kx(r,t){return r.findIndex(e=>e.symbol===t)}function Ai(r){return r===""?r:"`"+(r!==" "?r:"space")+"`"}function ej(r,t){let e=ge.getTypeForUnknownSymbol(r.symbol);if(r.type===e||e==="TODO"&&r.symbol!==" ")return;let n=Ai(r.symbol),i=Ai(e);t.push(M.t("reports.statusRegistry.messages.notConventionalType",{symbol:n,type:i}))}function tj(r,t,e){let n=t.nextStatusSymbol,i=kx(r,n);if(i===-1){let a=Ai(n);e.push(M.t("reports.statusRegistry.messages.nextSymbolUnknown",{symbol:a}));return}if(t.type!=="DONE")return;let s=r[i];if(s){if(s.type!=="TODO"&&s.type!=="IN_PROGRESS"){let a="https://publish.obsidian.md/tasks/Getting+Started/Statuses/Recurring+Tasks+and+Custom+Statuses",o=Ai(s.type),l=[M.t("reports.statusRegistry.messages.wrongTypeAfterDone.line1",{nextType:o}),M.t("reports.statusRegistry.messages.wrongTypeAfterDone.line2"),M.t("reports.statusRegistry.messages.wrongTypeAfterDone.line3",{helpURL:a})].join("<br>");e.push(l)}}else e.push(M.t("reports.statusRegistry.messages.cannotFindNextStatus"))}function nj(r,t,e){let n=[];if(t.symbol===ge.EMPTY.symbol)return n.push(M.t("reports.statusRegistry.messages.emptySymbol")),n;if(kx(r,t.symbol)!=e){let s=Ai(t.symbol);return n.push(M.t("reports.statusRegistry.messages.duplicateSymbol",{symbol:s})),n}return ej(t,n),tj(r,t,n),n}function Sx(r){let t=new Of([M.t("reports.statusRegistry.columnHeadings.statusSymbol"),M.t("reports.statusRegistry.columnHeadings.nextStatusSymbol"),M.t("reports.statusRegistry.columnHeadings.statusName"),M.t("reports.statusRegistry.columnHeadings.statusType"),M.t("reports.statusRegistry.columnHeadings.problems")]),e=et.allStatuses(r);return e.forEach((n,i)=>{t.addRow([Ai(n.symbol),Ai(n.nextStatusSymbol),n.name,Ai(n.type),nj(e,n,i).join("<br>")])}),t.markdown}function Dx(r){let t=new je;return et.applyToStatusRegistry(r,t),t.registeredStatuses.map((n,i)=>{let s=Ne.getInstance(),a=s.isEmpty()?"":s.get()+" ",o=`Sample task ${i+1}`,l=`status symbol=${Ai(n.symbol)}`,u=`status name='${n.name}'`;return`- [${n.symbol}] ${a}${o}: ${l} ${u}`})}function Ex(r,t,e,n){let s=Sx(r),a=t.mermaidDiagram(!0),o=Dx(r);return`# ${e}
|
||||||
|
|
||||||
|
## ${M.t("reports.statusRegistry.about.title")}
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.about.createdBy",{version:n})}
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.about.updateReport.line1")}
|
||||||
|
|
||||||
|
- ${M.t("reports.statusRegistry.about.updateReport.line2")}
|
||||||
|
- ${M.t("reports.statusRegistry.about.updateReport.line3")}
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.about.deleteFileAnyTime")}
|
||||||
|
|
||||||
|
## ${M.t("reports.statusRegistry.statusSettings.title")}
|
||||||
|
|
||||||
|
<!--
|
||||||
|
${M.t("reports.statusRegistry.statusSettings.comment.line1")}
|
||||||
|
${M.t("reports.statusRegistry.statusSettings.comment.line2")}
|
||||||
|
${M.t("reports.statusRegistry.statusSettings.comment.line3")}
|
||||||
|
-->
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.statusSettings.theseAreStatusValues")}
|
||||||
|
|
||||||
|
${s}
|
||||||
|
## ${M.t("reports.statusRegistry.loadedSettings.title")}
|
||||||
|
|
||||||
|
<!-- ${M.t("reports.statusRegistry.loadedSettings.switchToLivePreview")} -->
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.loadedSettings.settingsActuallyUsed")}
|
||||||
|
${a}
|
||||||
|
|
||||||
|
## ${M.t("reports.statusRegistry.sampleTasks.title")}
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.sampleTasks.line1")}
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.sampleTasks.line2")}
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.sampleTasks.line3")}
|
||||||
|
|
||||||
|
> [!Tip] ${M.t("reports.statusRegistry.sampleTasks.tip.line1")}
|
||||||
|
> ${M.t("reports.statusRegistry.sampleTasks.tip.line2",{url:"https://publish.obsidian.md/tasks/How+To/Style+custom+statuses"})}
|
||||||
|
|
||||||
|
${o.join(`
|
||||||
|
`)}
|
||||||
|
|
||||||
|
## ${M.t("reports.statusRegistry.searchSampleTasks.title")}
|
||||||
|
|
||||||
|
${M.t("reports.statusRegistry.searchSampleTasks.line1")}
|
||||||
|
|
||||||
|
\`\`\`tasks
|
||||||
|
path includes {{query.file.path}}
|
||||||
|
group by status.type
|
||||||
|
group by status.name
|
||||||
|
sort by function task.lineNumber
|
||||||
|
hide postpone button
|
||||||
|
short mode
|
||||||
|
\`\`\`
|
||||||
|
`}ys();function xx(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],['"',"Quote","x","TODO"],["0","Speech bubble 0","0","NON_TASK"],["1","Speech bubble 1","1","NON_TASK"],["2","Speech bubble 2","2","NON_TASK"],["3","Speech bubble 3","3","NON_TASK"],["4","Speech bubble 4","4","NON_TASK"],["5","Speech bubble 5","5","NON_TASK"],["6","Speech bubble 6","6","NON_TASK"],["7","Speech bubble 7","7","NON_TASK"],["8","Speech bubble 8","8","NON_TASK"],["9","Speech bubble 9","9","NON_TASK"]]}function Ox(){return[[" ","incomplete","x","TODO"],["x","complete / done"," ","DONE"],["-","cancelled"," ","CANCELLED"],[">","deferred","x","TODO"],["/","in progress, or half-done","x","IN_PROGRESS"],["!","Important","x","TODO"],["?","question","x","TODO"],["R","review","x","TODO"],["+","Inbox / task that should be processed later","x","TODO"],["b","bookmark","x","TODO"],["B","brainstorm","x","TODO"],["D","deferred or scheduled","x","TODO"],["I","Info","x","TODO"],["i","idea","x","TODO"],["N","note","x","TODO"],["Q","quote","x","TODO"],["W","win / success / reward","x","TODO"],["P","pro","x","TODO"],["C","con","x","TODO"]]}function Rx(){return[[" ","To Do","x","TODO"],["/","In Progress","x","IN_PROGRESS"],["x","Done"," ","DONE"],["-","Cancelled"," ","CANCELLED"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["i","Infomation","x","TODO"],["S","Amount","x","TODO"],["*","Star","x","TODO"],["b","Bookmark","x","TODO"],["\u201C","Quote","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["I","Idea","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function Cx(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],[">","Deferred","x","TODO"],["!","Important","x","TODO"],["?","Question","x","TODO"],["r","Review","x","TODO"]]}function Mx(){return[[" ","Unchecked","x","TODO"],["x","Regular"," ","DONE"],["X","Checked"," ","DONE"],["-","Dropped"," ","CANCELLED"],[">","Forward","x","TODO"],["D","Date","x","TODO"],["?","Question","x","TODO"],["/","Half Done","x","IN_PROGRESS"],["+","Add","x","TODO"],["R","Research","x","TODO"],["!","Important","x","TODO"],["i","Idea","x","TODO"],["B","Brainstorm","x","TODO"],["P","Pro","x","TODO"],["C","Con","x","TODO"],["Q","Quote","x","TODO"],["N","Note","x","TODO"],["b","Bookmark","x","TODO"],["I","Information","x","TODO"],["p","Paraphrase","x","TODO"],["L","Location","x","TODO"],["E","Example","x","TODO"],["A","Answer","x","TODO"],["r","Reward","x","TODO"],["c","Choice","x","TODO"],["d","Doing","x","IN_PROGRESS"],["T","Time","x","TODO"],["@","Character / Person","x","TODO"],["t","Talk","x","TODO"],["O","Outline / Plot","x","TODO"],["~","Conflict","x","TODO"],["W","World","x","TODO"],["f","Clue / Find","x","TODO"],["F","Foreshadow","x","TODO"],["H","Favorite / Health","x","TODO"],["&","Symbolism","x","TODO"],["s","Secret","x","TODO"]]}function Ax(){return[[" ","Unchecked","x","TODO"],["x","Checked"," ","DONE"],[">","Rescheduled","x","TODO"],["<","Scheduled","x","TODO"],["!","Important","x","TODO"],["-","Cancelled"," ","CANCELLED"],["/","In Progress","x","IN_PROGRESS"],["?","Question","x","TODO"],["*","Star","x","TODO"],["n","Note","x","TODO"],["l","Location","x","TODO"],["i","Information","x","TODO"],["I","Idea","x","TODO"],["S","Amount","x","TODO"],["p","Pro","x","TODO"],["c","Con","x","TODO"],["b","Bookmark","x","TODO"],["f","Fire","x","TODO"],["k","Key","x","TODO"],["w","Win","x","TODO"],["u","Up","x","TODO"],["d","Down","x","TODO"]]}function Px(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b","bookmark","x","TODO"],["i","information","x","TODO"],["S","savings","x","TODO"],["I","idea","x","TODO"],["p","pros","x","TODO"],["c","cons","x","TODO"],["f","fire","x","TODO"],["k","key","x","TODO"],["w","win","x","TODO"],["u","up","x","TODO"],["d","down","x","TODO"]]}function Nx(){return[[" ","to-do","x","TODO"],["/","incomplete","x","IN_PROGRESS"],["x","done"," ","DONE"],["-","canceled"," ","CANCELLED"],[">","forwarded","x","TODO"],["<","scheduling","x","TODO"],["?","question","x","TODO"],["!","important","x","TODO"],["*","star","x","TODO"],['"',"quote","x","TODO"],["l","location","x","TODO"],["b",
Line truncated
|
||||||
|
`)+`
|
||||||
|
|
||||||
|
`+M.t("modals.customStatusModal.fixErrorsBeforeSaving");new Ir.Notice(d);return}this.saved=!0,this.close()})),u)),l.addExtraButton(u=>(u.setIcon("cross").setTooltip("Cancel").onClick(()=>{this.saved=!1,this.close()}),u))})}onOpen(){this.display()}static setValidationError(e){e.inputEl.addClass("tasks-settings-is-invalid")}static removeValidationError(e){e.inputEl.removeClass("tasks-settings-is-invalid")}static setValid(e,n){n.length===0?Un.removeValidationError(e):Un.setValidationError(e)}};var Eb=require("obsidian");function Ix(r,t,e){if(t===e||!Object.prototype.hasOwnProperty.call(r,t))return F({},r);let n={};for(let[i,s]of Object.entries(r))i===t?n[e]=s:n[i]=s;return n}var Mu=class{constructor(t,e,n){this.originalName=t,this.isValid=e,this.errorMessage=n}},Rf=class{validateRenames(t){let e={};for(let[n,i]of Object.entries(t)){let s={};for(let[a,o]of Object.entries(t))a!==n&&(s[o]="");e[n]=this.validateRename(s,"",i)}return e}validateRename(t,e,n){if(!n||n.trim()==="")return new Mu(e,!1,"Preset name cannot be empty or all whitespace");for(let i of Object.keys(t))if(i!==e&&i.trim()===n.trim())return new Mu(e,!1,"A preset with this name already exists");return new Mu(e,!0,null)}addPreset(t){let e=this.generateUniqueKey(t),n=F({},t);return n[e]="",{presets:n,newKey:e}}renamePreset(t,e,n){return!n||n.trim()===""||(n=n.trim(),this.wouldCreateDuplicateKey(t,e,n))?null:Ix(t,e,n)}deletePreset(t,e){let n=F({},t);return delete n[e],n}updatePresetValue(t,e,n){let i=F({},t);return i[e]=n,i}wouldCreateDuplicateKey(t,e,n){let i=n.trim();if(e.trim()===i)return!1;for(let s of Object.keys(t))if(s!==e&&s.trim()===i)return!0;return!1}generateUniqueKey(t){let e="new_key",n=1;for(;Object.prototype.hasOwnProperty.call(t,`${e}_${n}`);)n++;return`${e}_${n}`}reorderPreset(t,e,n){let i=Object.keys(t),s=i.indexOf(e);if(s===-1||n<0||n>=i.length)return null;if(s===n)return F({},t);let a=[...i];a.splice(s,1),a.splice(n,0,e);let o={};for(let l of a)o[l]=t[l];return o}};Vt();var Cf=class{constructor(t,e){this.presetsSettingsService=new Rf;this.nameFields=new Map;this.plugin=t,this.events=e}renderPresetsSettings(t){let e=t.createDiv(),n=re(),i=()=>{e.empty(),this.nameFields.clear(),Object.entries(n.presets).forEach(([s,a])=>{this.renderPresetItem(e,n,s,a,i)})};i(),this.createAddNewPresetButton(t,n,i)}renderPresetItem(t,e,n,i,s){let a=t.createDiv({cls:"tasks-presets-wrapper"}),o=new Eb.Setting(a);o.settingEl.addClass("tasks-presets-setting"),a.draggable=!0,a.setAttribute("data-preset-key",n),o.addText(l=>{l.setPlaceholder("Name").setValue(n),l.inputEl.addClass("tasks-presets-key"),this.nameFields.set(n,{inputEl:l.inputEl,originalKey:n});let u=n;l.inputEl.addEventListener("input",d=>{u=d.target.value,this.validateAllInputs()});let c=()=>I(this,null,function*(){if(u&&u!==n){let d=this.presetsSettingsService.renamePreset(e.presets,n,u);d&&(yield this.savePresetsSettings(d,e,s))}});l.inputEl.addEventListener("blur",c),l.inputEl.addEventListener("keydown",d=>I(this,null,function*(){d.key==="Enter"&&(d.preventDefault(),l.inputEl.blur())}))}),o.addTextArea(l=>(l.inputEl.addClass("tasks-presets-value"),l.setPlaceholder("Query or filter text...").setValue(i),this.setupAutoResizingTextarea(l),l.onChange(u=>I(this,null,function*(){let c=this.presetsSettingsService.updatePresetValue(e.presets,n,u);yield this.savePresetsSettings(c,e,null)})))),o.addExtraButton(l=>{l.extraSettingsEl.addClass("tasks-presets-drag-handle"),l.setIcon("grip-vertical").setTooltip("Drag to reorder"),l.extraSettingsEl.style.cursor="grab",l.extraSettingsEl.addEventListener("mousedown",u=>{l.extraSettingsEl.style.cursor="grabbing"}),l.extraSettingsEl.addEventListener("mouseup",u=>{l.extraSettingsEl.style.cursor="grab"})}),o.addExtraButton(l=>{l.extraSettingsEl.addClass("tasks-presets-delete-button"),l.setIcon("cross").setTooltip("Delete").onClick(()=>I(this,null,function*(){let u=this.presetsSettingsService.deletePreset(e.presets,n);yield this.savePresetsSettings(u,e,s)}))}),this.setupDragAndDrop(a,n,e,s),o.infoEl.remove()}setupDragAndDrop(t,e,n,i){t.addEventListener("dragstart",s=>{s.dataTransfer&&(s.dataTransfer.setData("text/plain",e),s.dataTransfer.effectAllowed="move"),t.addClass("tasks-presets-dragging")}),t.addEventListener("dragend",s=>{t.removeClass("tasks-presets-dragging"),this.clearDropIndicators()}),t.addEventListener("dragover",s=>{s.preventDefault(),s.dataTransfer&&(s.dataTransfer.dropEffect="move"),this.showDropIndicator(t,s)}),t.addEventListener("dragleave",s=>{let a=t.getBoundingClientRect(),o=s.clientX,l=s.clientY;(o<a.left||o>a.right||l<a.top||l>a.bottom)&&this.clearDropIndicator(t)}),t.addEventListener("drop",s=>I(this,null,function*(){var c;s.preventDefault();let a=(c=s.dataTransfer)==null?void 0:c.getData("text/plain");if(!a||a===e){this.clearDropIndicators();return}let o=this.calculateDropPosition(t,s),l=this.getTargetIndex(e,o),u=this.presetsSettingsService.reorderPreset(n.presets,a,l);u&&(yield this.savePresetsSettings(u,n,i)),this.clearDropIndicators(
Line truncated
|
||||||
|
|
||||||
|
This message has been written to the console.
|
||||||
|
`,1e4)}var Mf=class extends us.EditorSuggest{constructor(e,n,i){super(e);this.settings=n,this.plugin=i,e.scope.register([],"Tab",()=>{var a;let s=(a=this.context)==null?void 0:a.editor;return s?(s.exec("indentMore"),!1):!0})}onTrigger(e,n,i){if(!this.settings.autoSuggestInEditor||i===void 0)return null;let s=n.getLine(e.line);return HS(s,e,n)?{start:{line:e.line,ch:0},end:{line:e.line,ch:s.length},query:s}:null}getSuggestions(e){var c,d,f;if(e.file===void 0)return[];let n=e.query,i=e.editor.getCursor(),s=this.plugin.getTasks(),a=s.find(p=>p.taskLocation.path==e.file.path&&p.taskLocation.lineNumber==i.line),o=this.getMarkdownFileInfo(e),l=this.canSaveEdits(o);return((f=(d=(c=au()).buildSuggestions)==null?void 0:d.call(c,n,i.ch,this.settings,s,l,a))!=null?f:[]).map(p=>de(F({},p),{context:e}))}getMarkdownFileInfo(e){return e.editor.cm.state.field(us.editorInfoField)}canSaveEdits(e){return e instanceof us.MarkdownView}renderSuggestion(e,n){n.setText(e.displayText)}selectSuggestion(e,n){return I(this,null,function*(){var u,c,d;let i=e.context.editor;if(e.suggestionType==="empty"){this.close();let f=new KeyboardEvent("keydown",{code:"Enter",key:"Enter"});(c=(u=i==null?void 0:i.cm)==null?void 0:u.contentDOM)==null||c.dispatchEvent(f);return}if(e.taskItDependsOn!=null){let f=Jc(e.taskItDependsOn,this.plugin.getTasks().map(p=>p.id));if(e.appendText+=` ${f.id}`,e.taskItDependsOn!==f)if(e.context.file.path==f.path){let p=e.taskItDependsOn.originalMarkdown,b={line:e.taskItDependsOn.lineNumber,ch:0},T={line:e.taskItDependsOn.lineNumber,ch:p.length},v=e.context.editor.getRange(b,T);if(v!==p){let O=`Error adding new ID, due to mismatched data in Tasks memory and the editor:
|
||||||
|
task line in memory: '${e.taskItDependsOn.originalMarkdown}'
|
||||||
|
|
||||||
|
task line in editor: '${v}'
|
||||||
|
|
||||||
|
file: '${f.path}'
|
||||||
|
`;aj(O);return}e.context.editor.replaceRange(f.toFileLineString(),b,T)}else Nn({originalTask:e.taskItDependsOn,newTasks:f})}let s=e.context.editor.getCursor(),a={line:s.line,ch:(d=e.insertAt)!=null?d:s.ch},o=e.insertSkip?{line:s.line,ch:a.ch+e.insertSkip}:void 0;e.context.editor.replaceRange(e.appendText,a,o),e.context.editor.setCursor({line:s.line,ch:a.ch+e.appendText.length});let l=this.getMarkdownFileInfo(e.context);this.canSaveEdits(l)&&(yield l.save())})}};Ga();var Lx=(r,t)=>{let e,n=new Promise((a,o)=>{e=a});return t(r,a=>{let o=a.map(l=>l.toFileLineString()).join(`
|
||||||
|
`);e(o)}).open(),n};var Ux=(r,t)=>{let e=Dd({line:"",path:""});return new Qi({app:r,task:e,onSubmit:t,allTasks:[]})};var Yx=r=>({createTaskLineModal:()=>Lx(r,Ux),executeToggleTaskDoneCommand:(t,e)=>qy(t,e).text});pn();var Af=class extends jx.Plugin{get apiV1(){return Yx(this.app)}onload(){return I(this,null,function*(){yield iT(),sn.registerConsoleLogger(),hy("info",M.t("main.loadingPlugin",{name:this.manifest.name,version:this.manifest.version})),yield this.loadSettings();let{loggingOptions:e}=re();sn.configure(e);let n=new cf({obsidianEvents:this.app.workspace});this.addSettingTab(new Au({plugin:this,events:n})),eE({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace}),yield this.loadTaskStatuses(),this.cache=new qs({metadataCache:this.app.metadataCache,vault:this.app.vault,workspace:this.app.workspace,events:n}),this.inlineRenderer=new wf({plugin:this}),this.queryRenderer=new xf({plugin:this,events:n}),this.setObsidianPropertiesTypes(),this.registerEditorExtension(vx()),this.registerEditorSuggest(new Mf(this.app,re(),this)),new uf({plugin:this})})}loadTaskStatuses(){return I(this,null,function*(){let{statusSettings:e}=re();et.applyToStatusRegistry(e,je.getInstance())})}onunload(){var e;hy("info",M.t("main.unloadingPlugin",{name:this.manifest.name,version:this.manifest.version})),(e=this.cache)==null||e.unload()}loadSettings(){return I(this,null,function*(){let e=yield this.loadData();nt(e),e=re(),Ne.getInstance().set(e.globalFilter),Ne.getInstance().setRemoveGlobalFilter(e.removeGlobalFilter),fr.getInstance().set(e.globalQuery),yield this.loadTaskStatuses()})}saveSettings(){return I(this,null,function*(){yield this.saveData(re())})}getTasks(){return this.cache===void 0?[]:this.cache.getTasks()}getState(){return this.cache===void 0?"Cold":this.cache.getState()}setObsidianPropertiesTypes(){var e;try{let n=this.app.metadataTypeManager,i=n.getAllProperties(),s=new Oi;for(let a of s.allPropertyNamesSorted()){let o=s.propertyType(a);((e=i[a])==null?void 0:e.type)!==o&&n.setType(a,o)}}catch(n){console.error("setObsidianPropertiesTypes error",n)}}};
|
||||||
|
/*!
|
||||||
|
* EventEmitter2
|
||||||
|
* https://github.com/hij1nx/EventEmitter2
|
||||||
|
*
|
||||||
|
* Copyright (c) 2013 hij1nx
|
||||||
|
* Licensed under the MIT license.
|
||||||
|
*/
|
||||||
|
/*!
|
||||||
|
* mustache.js - Logic-less {{mustache}} templates with JavaScript
|
||||||
|
* http://github.com/janl/mustache.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* nosourcemap */
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"id": "obsidian-tasks-plugin",
|
||||||
|
"name": "Tasks",
|
||||||
|
"version": "7.20.0",
|
||||||
|
"minAppVersion": "1.4.0",
|
||||||
|
"description": "Track tasks across your vault. Supports due dates, recurring tasks, done dates, sub-set of checklist items, and filtering.",
|
||||||
|
"helpUrl": "https://publish.obsidian.md/tasks/",
|
||||||
|
"author": "Clare Macrae and Ilyas Landikov (created by Martin Schenck)",
|
||||||
|
"authorUrl": "https://github.com/obsidian-tasks-group",
|
||||||
|
"fundingUrl": "https://github.com/sponsors/claremacrae",
|
||||||
|
"isDesktopOnly": false
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@charset "UTF-8";.flatpickr-calendar{background:transparent;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-touch-action:manipulation;touch-action:manipulation;background:#fff;-webkit-box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08);box-shadow:1px 0 #e6e6e6,-1px 0 #e6e6e6,0 1px #e6e6e6,0 -1px #e6e6e6,0 3px 13px #00000014}.flatpickr-calendar.open,.flatpickr-calendar.inline{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){-webkit-box-shadow:none!important;box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){-webkit-box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6;box-shadow:-2px 0 #e6e6e6,5px 0 #e6e6e6}.flatpickr-calendar .hasWeeks .dayContainer,.flatpickr-calendar .hasTime .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:before,.flatpickr-calendar:after{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:before,.flatpickr-calendar.arrowRight:before,.flatpickr-calendar.rightMost:after,.flatpickr-calendar.arrowRight:after{left:auto;right:22px}.flatpickr-calendar.arrowCenter:before,.flatpickr-calendar.arrowCenter:after{left:50%;right:50%}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:before,.flatpickr-calendar.arrowTop:after{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:before,.flatpickr-calendar.arrowBottom:after{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex}.flatpickr-months .flatpickr-month{background:transparent;color:#000000e6;fill:#000000e6;height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1}.flatpickr-months .flatpickr-prev-month,.flatpickr-months .flatpickr-next-month{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:#000000e6;fill:#000000e6}.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,.flatpickr-months .flatpickr-next-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-prev-month i,.flatpickr-months .flatpickr-next-month i{position:relative}.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,.flatpickr-months .flatpickr-next-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,.flatpickr-months .flatpickr-next-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-prev-month:hover,.flatpickr-months .flatpickr-next-month:hover{color:#959ea9}.flatpickr-months .flatpickr-prev-month:hover svg,.flatpickr-months .flatpickr-next-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-prev-month svg,.flatpickr-months .flatpickr-next-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-prev-month svg path,.flatpickr-months .flatpickr-next-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-outer-spin-button,.numInputWrapper input::-webkit-inner-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-heLine truncated
|
||||||
Vendored
+177
@@ -0,0 +1,177 @@
|
|||||||
|
{
|
||||||
|
"main": {
|
||||||
|
"id": "5264d0ea8ac8807f",
|
||||||
|
"type": "split",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "edeb259ae14540cf",
|
||||||
|
"type": "tabs",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "8188756fe7aea28c",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "empty",
|
||||||
|
"state": {},
|
||||||
|
"icon": "lucide-file",
|
||||||
|
"title": "新标签页"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"direction": "vertical"
|
||||||
|
},
|
||||||
|
"left": {
|
||||||
|
"id": "191fe3de41bb119c",
|
||||||
|
"type": "split",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "40fe3c4d6bdf609d",
|
||||||
|
"type": "tabs",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "472183c37fecefe7",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "file-explorer",
|
||||||
|
"state": {
|
||||||
|
"sortOrder": "alphabetical",
|
||||||
|
"autoReveal": false
|
||||||
|
},
|
||||||
|
"icon": "lucide-folder-closed",
|
||||||
|
"title": "文件列表"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "7522de70b2eb7bc3",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "search",
|
||||||
|
"state": {
|
||||||
|
"query": "",
|
||||||
|
"matchingCase": false,
|
||||||
|
"explainSearch": false,
|
||||||
|
"collapseAll": false,
|
||||||
|
"extraContext": false,
|
||||||
|
"sortOrder": "alphabetical"
|
||||||
|
},
|
||||||
|
"icon": "lucide-search",
|
||||||
|
"title": "搜索"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "79928a14ed0d8b2d",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "bookmarks",
|
||||||
|
"state": {},
|
||||||
|
"icon": "lucide-bookmark",
|
||||||
|
"title": "书签"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"direction": "horizontal",
|
||||||
|
"width": 300
|
||||||
|
},
|
||||||
|
"right": {
|
||||||
|
"id": "343fa5e3edfc32ef",
|
||||||
|
"type": "split",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "6eb65634f662a76d",
|
||||||
|
"type": "tabs",
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"id": "255862dc8754e160",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "backlink",
|
||||||
|
"state": {
|
||||||
|
"collapseAll": false,
|
||||||
|
"extraContext": false,
|
||||||
|
"sortOrder": "alphabetical",
|
||||||
|
"showSearch": false,
|
||||||
|
"searchQuery": "",
|
||||||
|
"backlinkCollapsed": false,
|
||||||
|
"unlinkedCollapsed": true
|
||||||
|
},
|
||||||
|
"icon": "links-coming-in",
|
||||||
|
"title": "反向链接"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "1c71ec70483dbf0f",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "outgoing-link",
|
||||||
|
"state": {
|
||||||
|
"linksCollapsed": false,
|
||||||
|
"unlinkedCollapsed": true
|
||||||
|
},
|
||||||
|
"icon": "links-going-out",
|
||||||
|
"title": "出链"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "6e8956314744a59d",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "tag",
|
||||||
|
"state": {
|
||||||
|
"sortOrder": "frequency",
|
||||||
|
"useHierarchy": true,
|
||||||
|
"showSearch": false,
|
||||||
|
"searchQuery": ""
|
||||||
|
},
|
||||||
|
"icon": "lucide-tags",
|
||||||
|
"title": "标签"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "deab112f742d4e72",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "outline",
|
||||||
|
"state": {
|
||||||
|
"followCursor": false,
|
||||||
|
"showSearch": false,
|
||||||
|
"searchQuery": ""
|
||||||
|
},
|
||||||
|
"icon": "lucide-list",
|
||||||
|
"title": "大纲"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "d6059cc1a4b1cbf5",
|
||||||
|
"type": "leaf",
|
||||||
|
"state": {
|
||||||
|
"type": "calendar",
|
||||||
|
"state": {},
|
||||||
|
"icon": "calendar-with-checkmark",
|
||||||
|
"title": "Calendar"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"direction": "horizontal",
|
||||||
|
"width": 300,
|
||||||
|
"collapsed": true
|
||||||
|
},
|
||||||
|
"left-ribbon": {
|
||||||
|
"hiddenItems": {
|
||||||
|
"switcher:打开快速切换": false,
|
||||||
|
"graph:查看关系图谱": false,
|
||||||
|
"canvas:新建白板": false,
|
||||||
|
"daily-notes:打开/创建今天的日记": false,
|
||||||
|
"templates:插入模板": false,
|
||||||
|
"command-palette:打开命令面板": false,
|
||||||
|
"obsidian-git:Open Git source control": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"active": "8188756fe7aea28c",
|
||||||
|
"lastOpenFiles": []
|
||||||
|
}
|
||||||
Reference in new issue
Block a user