vault backup: 2026-05-15 08:43:33

Affected files:
.obsidian/community-plugins.json
.obsidian/plugins/obsidian-git/data.json
.obsidian/plugins/obsidian-git/main.js
.obsidian/plugins/obsidian-git/manifest.json
.obsidian/plugins/obsidian-git/styles.css
3️⃣3d print.md
Untitled 1.md
Untitled 2.md
Untitled 3.md
Untitled.md
Алтай купить.md
Блошинка.md
Взять в РФ.md
Детские песни.md
Инвентаризация дом Алтай.md
Крепеж номенклатура.md
Приложение для ведения бюджета.md
⏳ Отложенные.md
⛺Взять в поход.md
✅ Список дел.md
🇷🇺Задачи РФ.md
🍎App ideas.md
🍔 Рецепты.md
🍿 Фильмы.md
🎤Караока.md
🎮Игры.md
🏕️Взять в поездку.md
🏡Home automation.md
📚 Книги.md
🙋 Активности с ребёнком.md
🛍️ Заказать.md
🧱Леруа.md
🪆Посетить.md
This commit is contained in:
git-alex-phone committed 2026-05-15 08:43:33 +06:00
1 parent 6981d28eb3
commit 7be18a4156
33 files changed
+3306

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
[
"obsidian-git"
]
+68
View File
@@ -0,0 +1,68 @@
{
"commitMessage": "vault backup: {{date}}",
"autoCommitMessage": "vault backup: {{date}}",
"commitMessageScript": "",
"commitDateFormat": "YYYY-MM-DD HH:mm:ss",
"autoSaveInterval": 5,
"autoPushInterval": 0,
"autoPullInterval": 30,
"autoPullOnBoot": true,
"autoCommitOnlyStaged": false,
"disablePush": false,
"pullBeforePush": true,
"disablePopups": false,
"showErrorNotices": true,
"disablePopupsForNoChanges": false,
"listChangedFilesInMessageBody": true,
"showStatusBar": true,
"updateSubmodules": false,
"syncMethod": "merge",
"mergeStrategy": "none",
"customMessageOnAutoBackup": false,
"autoBackupAfterFileChange": true,
"treeStructure": false,
"refreshSourceControl": false,
"basePath": "",
"differentIntervalCommitAndPush": false,
"changedFilesInStatusBar": false,
"showedMobileNotice": true,
"refreshSourceControlTimer": 7000,
"showBranchStatusBar": true,
"setLastSaveToLastCommit": false,
"submoduleRecurseCheckout": false,
"gitDir": "",
"showFileMenu": true,
"authorInHistoryView": "hide",
"dateInHistoryView": false,
"diffStyle": "split",
"hunks": {
"showSigns": false,
"hunkCommands": false,
"statusBar": "disabled"
},
"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"
}
}
+452
View File
@@ -0,0 +1,452 @@
/*
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 VD=Object.create;var bc=Object.defineProperty;var YD=Object.getOwnPropertyDescriptor;var XD=Object.getOwnPropertyNames;var ZD=Object.getPrototypeOf,KD=Object.prototype.hasOwnProperty;var Yb=t=>{throw TypeError(t)};var QD=(t,e,r)=>e in t?bc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var JD=(t,e)=>()=>(t&&(e=t(t=0)),e);var I=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),eL=(t,e)=>{for(var r in e)bc(t,r,{get:e[r],enumerable:!0})},Xb=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of XD(e))!KD.call(t,i)&&i!==r&&bc(t,i,{get:()=>e[i],enumerable:!(n=YD(e,i))||n.enumerable});return t};var Ct=(t,e,r)=>(r=t!=null?VD(ZD(t)):{},Xb(e||!t||!t.__esModule?bc(r,"default",{value:t,enumerable:!0}):r,t)),tL=t=>Xb(bc({},"__esModule",{value:!0}),t);var qe=(t,e,r)=>QD(t,typeof e!="symbol"?e+"":e,r),Fm=(t,e,r)=>e.has(t)||Yb("Cannot "+r);var $=(t,e,r)=>(Fm(t,e,"read from private field"),r?r.call(t):e.get(t)),me=(t,e,r)=>e.has(t)?Yb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),de=(t,e,r,n)=>(Fm(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),wt=(t,e,r)=>(Fm(t,e,"access private method"),r);var Qb=I(Ff=>{"use strict";p();Ff.byteLength=nL;Ff.toByteArray=sL;Ff.fromByteArray=lL;var ri=[],fn=[],rL=typeof Uint8Array!="undefined"?Uint8Array:Array,Om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(la=0,Zb=Om.length;la<Zb;++la)ri[la]=Om[la],fn[Om.charCodeAt(la)]=la;var la,Zb;fn[45]=62;fn[95]=63;function Kb(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function nL(t){var e=Kb(t),r=e[0],n=e[1];return(r+n)*3/4-n}function iL(t,e,r){return(e+r)*3/4-r}function sL(t){var e,r=Kb(t),n=r[0],i=r[1],s=new rL(iL(t,n,i)),a=0,o=i>0?n-4:n,l;for(l=0;l<o;l+=4)e=fn[t.charCodeAt(l)]<<18|fn[t.charCodeAt(l+1)]<<12|fn[t.charCodeAt(l+2)]<<6|fn[t.charCodeAt(l+3)],s[a++]=e>>16&255,s[a++]=e>>8&255,s[a++]=e&255;return i===2&&(e=fn[t.charCodeAt(l)]<<2|fn[t.charCodeAt(l+1)]>>4,s[a++]=e&255),i===1&&(e=fn[t.charCodeAt(l)]<<10|fn[t.charCodeAt(l+1)]<<4|fn[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function aL(t){return ri[t>>18&63]+ri[t>>12&63]+ri[t>>6&63]+ri[t&63]}function oL(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(aL(n));return i.join("")}function lL(t){for(var e,r=t.length,n=r%3,i=[],s=16383,a=0,o=r-n;a<o;a+=s)i.push(oL(t,a,a+s>o?o:a+s));return n===1?(e=t[r-1],i.push(ri[e>>2]+ri[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ri[e>>10]+ri[e>>4&63]+ri[e<<2&63]+"=")),i.join("")}});var Jb=I(Mm=>{p();Mm.read=function(t,e,r,n,i){var s,a,o=i*8-n-1,l=(1<<o)-1,c=l>>1,u=-7,f=r?i-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=s*256+t[e+f],f+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;u>0;a=a*256+t[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-c}return(h?-1:1)*a*Math.pow(2,s-n)};Mm.write=function(t,e,r,n,i,s){var a,o,l,c=s*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:s-1,m=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*l-1)*Math.pow(2,i),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+h]=o&255,h+=m,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;t[r+h]=a&255,h+=m,a/=256,c-=8);t[r+h-m]|=g*128}});var qm=I(Co=>{"use strict";p();var Dm=Qb(),ko=Jb(),e_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Co.Buffer=F;Co.SlowBuffer=pL;Co.INSPECT_MAX_BYTES=50;var Of=2147483647;Co.kMaxLength=Of;F.TYPED_ARRAY_SUPPORT=cL();!F.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 cL(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(F.prototype,"parent",{enumerable:!0,get:function(){if(F.isBuffer(this))return this.buffer}});Object.defineProperty(F.prototype,"offset",{enumerable:!0,get:function(){if(F.isBuffer(this))return this.byteOffset}});function Bi(t){if(t>Of)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,F.prototype),e}function F(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Hm(t)}return i_(t,e,r)}F.poolSize=8192;function i_(t,e,r){if(typeof t=="string")return fL(t,e);if(ArrayBuffer.isView(t))return dL(t);if(t==null)throw new TypeError("Line truncated
If you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment.
Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=t.code,this.data={message:e}}};he.code="InternalError";var zo=class t extends Re{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=t.code,this.data={filepath:e}}};zo.code="UnsafeFilepathError";var mn=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let n=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,n}write(e,r,n){let i=this.buffer.write(e,this._start,r,n);return this._start+=r,i}copy(e,r,n){let i=e.copy(this.buffer,this._start,r,n);return this._start+=i,i}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};function Nd(t,e){return-(t<e)||+(t>e)}function nk(t,e){return Nd(t.path,e.path)}function ik(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}var di=2**32;function OE(t,e,r,n){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=n.valueOf());let i=Math.floor(r/1e3),s=(r-i*1e3)*1e6;return[i,s]}function Vo(t){let[e,r]=OE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[n,i]=OE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%di,ctimeNanoseconds:r%di,mtimeSeconds:n%di,mtimeNanoseconds:i%di,dev:t.dev%di,ino:t.ino%di,mode:ik(t.mode%di),uid:t.uid%di,gid:t.gid%di,size:t.size>-1?t.size%di:0}}function W3(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}var Qg=null;async function zi(t){return Qg===null&&(Qg=await V3()),Qg?sk(t):z3(t)}function z3(t){return new rk().update(t).digest("hex")}async function sk(t){let e=await crypto.subtle.digest("SHA-1",t);return W3(e)}async function V3(){try{return await sk(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(t){}return!1}function Y3(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function X3(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}var uv=class t{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return t.fromBuffer(e);if(e===null)return new t(null);throw new he("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new he("Index file is empty (.git/index)");let r=new t,n=new mn(e),i=n.toString("utf8",4);if(i!=="DIRC")throw new he(`Invalid dircache magic file number: ${i}`);let s=await zi(e.slice(0,-20)),a=e.slice(-20).toString("hex");if(a!==s)throw new he(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${s}`);let o=n.readUInt32BE();if(o!==2)throw new he(`Unsupported dircache version: ${o}`);let l=n.readUInt32BE(),c=0;for(;!n.eof()&&c<l;){let u={};u.ctimeSeconds=n.readUInt32BE(),u.ctimeNanoseconds=n.readUInt32BE(),u.mtimeSeconds=n.readUInt32BE(),u.mtimeNanoseconds=n.readUInt32BE(),u.dev=n.readUInt32BE(),u.ino=n.readUInt32BE(),u.mode=n.readUInt32BE(),u.uid=n.readUInt32BE(),u.gid=n.readUInt32BE(),u.size=n.readUInt32BE(),u.oid=n.slice(20).toString("hex");let f=n.readUInt16BE();u.flags=Y3(f);let d=e.indexOf(0,n.tell()+1)-n.tell();if(d<1)throw new he(`Got a path length of: ${d}`);if(u.path=n.toString("utf8",d),u.path.includes("..\\")||u.path.includes("../"))throw new zo(u.path);let h=8-(n.tell()-12)%8;for(h===0&&(h=8);h--;){let m=n.readUInt8();if(m!==0)throw new he(`Expected 1-8 null characters but got '${m}' after ${u.path}`);if(n.eof())throw new he("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(nk)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:n,stage:i=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid Line truncated
`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),n=Math.ceil((62+r.length+1)/8)*8,i=Buffer.alloc(n),s=new mn(i),a=Vo(e);return s.writeUInt32BE(a.ctimeSeconds),s.writeUInt32BE(a.ctimeNanoseconds),s.writeUInt32BE(a.mtimeSeconds),s.writeUInt32BE(a.mtimeNanoseconds),s.writeUInt32BE(a.dev),s.writeUInt32BE(a.ino),s.writeUInt32BE(a.mode),s.writeUInt32BE(a.uid),s.writeUInt32BE(a.gid),s.writeUInt32BE(a.size),s.write(e.oid,20,"hex"),s.writeUInt16BE(X3(e)),s.write(e.path,r.length,"utf8"),i}async toObject(){let e=Buffer.alloc(12),r=new mn(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let n=[];for(let o of this.entries)if(n.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&n.push(t._entryToBuffer(l));n=await Promise.all(n);let i=Buffer.concat(n),s=Buffer.concat([e,i]),a=await zi(s);return Buffer.concat([s,Buffer.from(a,"hex")])}};function Td(t,e,r=!0,n=!0){let i=Vo(t),s=Vo(e);return r&&i.mode!==s.mode||i.mtimeSeconds!==s.mtimeSeconds||i.ctimeSeconds!==s.ctimeSeconds||i.uid!==s.uid||i.gid!==s.gid||n&&i.ino!==s.ino||i.size!==s.size}var Jg=null,ev=Symbol("IndexCache");function Z3(){return{map:new Map,stats:new Map}}async function K3(t,e,r){let[n,i]=await Promise.all([t.lstat(e),t.read(e)]),s=await uv.from(i);r.map.set(e,s),r.stats.set(e,n)}async function Q3(t,e,r){let n=r.stats.get(e);if(n===void 0)return!0;if(n===null)return!1;let i=await t.lstat(e);return i===null?!1:Td(n,i)}var ht=class{static async acquire({fs:e,gitdir:r,cache:n,allowUnmerged:i=!0},s){n[ev]||(n[ev]=Z3());let a=`${r}/index`;Jg===null&&(Jg=new Wc({maxPending:1/0}));let o,l=[];return await Jg.acquire(a,async()=>{let c=n[ev];await Q3(e,a,c)&&await K3(e,a,c);let u=c.map.get(a);if(l=u.unmergedPaths,l.length&&!i)throw new Vc(l);if(o=await s(u),u._dirty){let f=await u.toObject();await e.write(a,f),c.stats.set(a,await e.lstat(a)),u._dirty=!1}}),o}};function Pd(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function Sa(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function ak(t){let e=new Map,r=function(i){if(!e.has(i)){let s={type:"tree",fullpath:i,basename:Pd(i),metadata:{},children:[]};e.set(i,s),s.parent=r(Sa(i)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(i)},n=function(i,s){if(!e.has(i)){let a={type:"blob",fullpath:i,basename:Pd(i),metadata:s,parent:r(Sa(i)),children:[]};a.parent&&a.parent.children.push(a),e.set(i,a)}return e.get(i)};r(".");for(let i of t)n(i.path,i);return e}function J3(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new he(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var fv=class{constructor({fs:e,gitdir:r,cache:n}){this.treePromise=ht.acquire({fs:e,gitdir:r,cache:n},async function(s){return ak(s.entries)});let i=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,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(e){let r=e._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 s=i.children.map(a=>a.fullpath);return s.sort(Nd),s}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let n=(await this.treePromise).get(e._fullpath);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let i=n.type==="tree"?{}:Vo(n.metadata);e._type=n.type==="tree"?"tree":J3(i.mode),e._mode=i.mode,n.type==="tree"?e._stat=void 0:e._stat=i}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let n=(await this.treePromise).get(e._fullpath);e._oid=n.metadata.oid}return e._oid}},Bd=Symbol("GitWalkSymbol");function Ca(){let t=Object.create(null);return Object.defineProperty(t,Bd,{value:function({fs:e,gitdir:r,cache:n}){return new fv({fs:e,gitdir:r,cache:n})}}),Object.freeze(t),t}var Be=class t extends Re{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};Be.code="NotFoundError";var fr=class t extends Re{constructor(e,r,n,i){super(`Object ${e} ${i?`at ${i}`:""}was anticipated to be a ${n} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:n,filepath:i}}};fr.code="ObjectTypeError";var Rs=class t extends Re{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};Rs.code="InvalidOidError";var Yc=class t extends Re{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following:
[remote "${e}"]
fetch = +refs/heads/*:refs/remotes/origin/*
`),this.code=this.name=t.code,this.data={remote:e}}};Yc.code="NoRefspecError";var Rd=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(`
`).map(n=>{if(/^\s*#/.test(n))return{line:n,comment:!0};let i=n.indexOf(" ");if(n.startsWith("^")){let s=n.slice(1);return this.refs.set(r+"^{}",s),{line:n,ref:r,peeled:s}}else{let s=n.slice(0,i);return r=n.slice(i+1),this.refs.set(r,s),{line:n,ref:r,oid:s}}})}return this}static from(e){return new t(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
`)+`
`}},$d=class t{constructor({remotePath:e,localPath:r,force:n,matchPrefix:i}){Object.assign(this,{remotePath:e,localPath:r,force:n,matchPrefix:i})}static from(e){let[r,n,i,s,a]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=i==="*";if(l!==(a==="*"))throw new he("Invalid refspec");return new t({remotePath:n,localPath:s,force:o,matchPrefix:l})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}},dv=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let n of e)r.push($d.from(n));return new t(r)}add(e){let r=$d.from(e);this.rules.push(r)}translate(e){let r=[];for(let n of this.rules)for(let i of e){let s=n.translate(i);s&&r.push([i,s])}return r}translateOne(e){let r=null;for(let n of this.rules){let i=n.translate(e);i&&(r=i)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function e8(t,e){let r=t.replace(/\^\{\}$/,""),n=e.replace(/\^\{\}$/,""),i=-(r<n)||+(r>n);return i===0?t.endsWith("^{}")?1:-1:i}function t8(t,e){let r="",n=0,i=-1,s=0,a="\0";for(let o=0;o<=t.length;++o){if(o<t.length)a=t[o];else{if(a==="/")break;a="/"}if(a==="/"){if(!(i===o-1||s===1))if(s===2){if(r.length<2||n!==2||r.at(-1)!=="."||r.at(-2)!=="."){if(r.length>2){let l=r.lastIndexOf("/");l===-1?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),i=o,s=0;continue}else if(r.length!==0){r="",n=0,i=o,s=0;continue}}e&&(r+=r.length>0?"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(i+1,o):r=t.slice(i+1,o),n=o-i-1;i=o,s=0}else a==="."&&s!==-1?++s:s=-1}return r}function r8(t){if(!t.length)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=t8(t,!e),t.length?(r&&(t+="/"),e?`/${t}`:t):e?"/":r?"./":"."}function D(...t){if(t.length===0)return".";let e;for(let r=0;r<t.length;++r){let n=t[r];n.length>0&&(e===void 0?e=n:e+="/"+n)}return e===void 0?".":r8(e)}var n8=t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},qc=t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},ME={core:{filemode:qc,bare:qc,logallrefupdates:qc,symlinks:qc,ignorecase:qc,bigFileThreshold:n8}},i8=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,s8=/^[A-Za-z0-9-.]+$/,a8=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,o8=/^[A-Za-z][A-Za-z-]*$/,l8=/^(.*?)( *[#;].*)$/,c8=t=>{let e=i8.exec(t);if(e!=null){let[r,n]=e.slice(1);return[r,n]}return null},u8=t=>{let e=a8.exec(t);if(e!=null){let[r,n="true"]=e.slice(1),i=f8(n),s=d8(i);return[r,s]}return null},f8=t=>{let e=l8.exec(t);if(e==null)return t;let[r,n]=e.slice(1);return DE(r)&&DE(n)?`${r}${n}`:r},DE=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,d8=t=>t.split("").reduce((e,r,n,i)=>{let s=r==='"'&&i[n-1]!=="\\",a=r==="\\"&&i[n+1]==='"';return s||a?e:e+r},""),LE=t=>t!=null?t.toLowerCase():null,hv=(t,e,r)=>[LE(t),e,LE(r)].filter(n=>n!=null).join("."),NE=t=>{let e=t.split("."),r=e.shift(),n=e.pop(),i=e.length?e.join("."):void 0;return{section:r,subsection:i,name:n,path:hv(r,i,n),sectionPath:hv(r,i,null),isSection:!!r}},h8=(t,e)=>t.reduce((r,n,i)=>e(n)?i:r,-1),pv=class t{constructor(e){let r=null,n=null;this.parsedConfig=e?e.split(`
`).map(i=>{let s=null,a=null,o=i.trim(),l=c8(o),c=l!=null;if(c)[r,n]=l;else{let f=u8(o);f!=null&&([s,a]=f)}let u=hv(r,n,s);return{line:i,isSection:c,section:r,subsection:n,name:s,value:a,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let n=NE(e).path,i=this.parsedConfig.filter(s=>s.path===n).map(({section:s,name:a,value:o})=>{let l=ME[s]&&ME[s][a];return l?l(o):o});return r?i:i.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(n=>!(n.section===e&&n.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,n=!1){let{section:i,subsection:s,name:a,path:o,sectionPath:l,isSection:c}=NE(e),u=h8(this.parsedConfig,f=>f.path===o);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let f=this.parsedConfig[u],d=Object.assign({},f,{name:a,value:r,modified:!0});n?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:i,subsection:s,name:a,value:r,modified:!0,path:o};if(s8.test(i)&&o8.test(a))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:i,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:n,name:i,value:s,modified:a=!1})=>a?i!=null&&s!=null?typeof s=="string"&&/[#;]/.test(s)?` ${i} = "${s}"`:` ${i} = ${s}`:n!=null?`[${r} "${n}"]`:`[${r}]`:e).join(`
`)}},lt=class{static async get({fs:e,gitdir:r}){let n=await e.read(`${r}/config`,{encoding:"utf8"});return pv.from(n)}static async save({fs:e,gitdir:r,config:n}){await e.write(`${r}/config`,n.toString(),{encoding:"utf8"})}},Ad=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],p8=["config","description","index","shallow","commondir"],tv;async function Ts(t,e){return tv===void 0&&(tv=new Wc),tv.acquire(t,e)}var z=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:n,refs:i,symrefs:s,tags:a,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 Rs(v);let u=await lt.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${n}.fetch`),o.length===0)throw new Yc(n);o.unshift(`+HEAD:refs/remotes/${n}/HEAD`)}let f=dv.from(o),d=new Map;if(c){let v=await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:r,refs:v.map(w=>`refs/tags/${w}`)})}if(a){for(let v of i.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:v})){let w=i.get(v);d.set(v,w)}}let h=f.translate([...i.keys()]);for(let[v,w]of h){let b=i.get(v);d.set(w,b)}let m=f.translate([...s.keys()]);for(let[v,w]of m){let b=s.get(v),k=f.translateOne(b);k&&d.set(w,`ref: ${k}`)}let g=[];if(l){for(let v of f.localNamespaces()){let w=(await t.listRefs({fs:e,gitdir:r,filepath:v})).map(b=>`${v}/${b}`);for(let b of w)d.has(b)||g.push(b)}g.length>0&&await t.deleteRefs({fs:e,gitdir:r,refs:g})}for(let[v,w]of d)await Ts(v,async()=>e.write(D(r,v),`${w.trim()}
`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:n,value:i}){if(!i.match(/[0-9a-f]{40}/))throw new Rs(i);await Ts(n,async()=>e.write(D(r,n),`${i.trim()}
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:n,value:i}){await Ts(n,async()=>e.write(D(r,n),`ref: ${i.trim()}
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:n}){return t.deleteRefs({fs:e,gitdir:r,refs:[n]})}static async deleteRefs({fs:e,gitdir:r,refs:n}){await Promise.all(n.map(o=>e.rm(D(r,o))));let i=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),s=Rd.from(i),a=s.refs.size;for(let o of n)s.refs.has(o)&&s.delete(o);s.refs.size<a&&(i=s.toString(),await Ts("packed-refs",async()=>e.write(`${r}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:e,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),t.resolve({fs:e,gitdir:r,ref:n,depth:i});if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let s=await t.packedRefs({fs:e,gitdir:r}),a=Ad(n).filter(o=>!p8.includes(o));for(let o of a){let l=await Ts(o,async()=>await e.read(`${r}/${o}`,{encoding:"utf8"})||s.get(o));if(l)return t.resolve({fs:e,gitdir:r,ref:l.trim(),depth:i})}throw new Be(n)}static async exists({fs:e,gitdir:r,ref:n}){try{return await t.expand({fs:e,gitdir:r,ref:n}),!0}catch(i){return!1}}static async expand({fs:e,gitdir:r,ref:n}){if(n.length===40&&/[0-9a-f]{40}/.test(n))return n;let i=await t.packedRefs({fs:e,gitdir:r}),s=Ad(n);for(let a of s)if(await Ts(a,async()=>e.exists(`${r}/${a}`))||i.has(a))return a;throw new Be(n)}static async expandAgainstMap({ref:e,map:r}){let n=Ad(e);for(let i of n)if(await r.has(i))return i;throw new Be(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:n=void 0,map:i}){if(n!==void 0&&(n--,n===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:n,map:i});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let s=Ad(e);for(let a of s){let o=i.get(a);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:a,depth:n,map:i})}throw new Be(e)}static async packedRefs({fs:e,gitdir:r}){let n=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return Rd.from(n).refs}static async listRefs({fs:e,gitdir:r,filepath:n}){let i=t.packedRefs({fs:e,gitdir:r}),s=null;try{s=await e.readdirDeep(`${r}/${n}`),s=s.map(a=>a.replace(`${r}/${n}/`,""))}catch(a){s=[]}for(let a of(await i).keys())a.startsWith(n)&&(a=a.replace(n+"/",""),s.includes(a)||s.push(a));return s.sort(e8),s}static async listBranches({fs:e,gitdir:r,remote:n}){return n?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${n}`}):t.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(i=>!i.endsWith("^{}"))}};function m8(t,e){return Nd(BE(t),BE(e))}function BE(t){return t.mode==="040000"?t.path+"/":t.path}function ok(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new he(`Unexpected GitTree entry mode: ${t}`)}function g8(t){let e=[],r=0;for(;r<t.length;){let n=t.indexOf(32,r);if(n===-1)throw new he(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let i=t.indexOf(0,r);if(i===-1)throw new he(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let s=t.slice(r,n).toString("utf8");s==="40000"&&(s="040000");let a=ok(s),o=t.slice(n+1,i).toString("utf8");if(o.includes("\\")||o.includes("/"))throw new zo(o);let l=t.slice(i+1,i+21).toString("hex");r=i+21,e.push({mode:s,path:o,oid:l,type:a})}return e}function v8(t){if(typeof t=="number"&&(t=t.toString(8)),t.match(/^0?4.*/))return"040000";if(t.match(/^1006.*/))return"100644";if(t.match(/^1007.*/))return"100755";if(t.match(/^120.*/))return"120000";if(t.match(/^160.*/))return"160000";throw new he(`Could not understand file mode: ${t}`)}function w8(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=v8(t.mode),t.type||(t.type=ok(t.mode)),t}var Er=class t{constructor(e){if(Buffer.isBuffer(e))this._entries=g8(e);else if(Array.isArray(e))this._entries=e.map(w8);else throw new he("invalid type passed to GitTree constructor");this._entries.sort(nk)}static from(e){return new t(e)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
`)}toObject(){let e=[...this._entries];return e.sort(m8),Buffer.concat(e.map(r=>{let n=Buffer.from(r.mode.replace(/^0/,"")),i=Buffer.from(" "),s=Buffer.from(r.path,"utf8"),a=Buffer.from([0]),o=Buffer.from(r.oid,"hex");return Buffer.concat([n,i,s,a,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},$s=class{static wrap({type:e,object:r}){let n=`${e} ${r.length}\0`,i=n.length,s=i+r.length,a=new Uint8Array(s);for(let o=0;o<i;o++)a[o]=n.charCodeAt(o);return a.set(r,i),a}static unwrap(e){let r=e.indexOf(32),n=e.indexOf(0),i=e.slice(0,r).toString("utf8"),s=e.slice(r+1,n).toString("utf8"),a=e.length-(n+1);if(parseInt(s)!==a)throw new he(`Length mismatch: expected ${s} bytes but got ${a} instead.`);return{type:i,object:Buffer.from(e.slice(n+1))}}};async function lk({fs:t,gitdir:e,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`,i=await t.read(`${e}/${n}`);return i?{object:i,format:"deflated",source:n}:null}function y8(t,e){let r=new mn(t),n=HE(r);if(n!==e.byteLength)throw new he(`applyDelta expected source buffer to be ${n} bytes but the provided buffer was ${e.length} bytes`);let i=HE(r),s,a=GE(r,e);if(a.byteLength===i)s=a;else{s=Buffer.alloc(i);let o=new mn(s);for(o.copy(a);!r.eof();)o.copy(GE(r,e));let l=o.tell();if(i!==l)throw new he(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`)}return s}function HE(t){let e=0,r=0,n=null;do n=t.readUInt8(),e|=(n&127)<<r,r+=7;while(n&128);return e}function UE(t,e,r){let n=0,i=0;for(;r--;)e&1&&(n|=t.readUInt8()<<i),e>>=1,i+=8;return n}function GE(t,e){let r=t.readUInt8(),n=128,i=15,s=112;if(r&n){let a=UE(t,r&i,4),o=UE(t,(r&s)>>4,3);return o===0&&(o=65536),e.slice(a,a+o)}else return t.slice(r)}function b8(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function ck(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:b8(t)}var Id=class{constructor(e){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=ck(e),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(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(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(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>_8(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 _8(t){return t.reduce((e,r)=>e+r.length,0)}async function x8(t,e){let r=new Id(t),n=await r.read(4);if(n=n.toString("utf8"),n!=="PACK")throw new he(`Invalid PACK header '${n}'`);let i=await r.read(4);if(i=i.readUInt32BE(0),i!==2)throw new he(`Invalid packfile version: ${i}`);let s=await r.read(4);if(s=s.readUInt32BE(0),!(s<1))for(;!r.eof()&&s--;){let a=r.tell(),{type:o,length:l,ofs:c,reference:u}=await S8(r),f=new xv.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new he(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new he("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 e({data:f.result,type:o,num:s,offset:a,end:h,reference:u,ofs:c})}}}}async function S8(t){let e=await t.byte(),r=e>>4&7,n=e&15;if(e&128){let a=4;do e=await t.byte(),n|=(e&127)<<a,a+=7;while(e&128)}let i,s;if(r===6){let a=0;i=0;let o=[];do e=await t.byte(),i|=(e&127)<<a,a+=7,o.push(e);while(e&128);s=Buffer.fro Line truncated
`,t}function Fd(t){let[,e,r,n,i]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(n),timezoneOffset:F8(i)}}function F8(t){let[,e,r,n]=t.match(/(\+|-)(\d\d)(\d\d)/);return n=(e==="+"?1:-1)*(Number(r)*60+Number(n)),O8(n)}function O8(t){return t===0?t:-t}var Zr=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(Buffer.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new he("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new t(e)}static render(e){return`object ${e.object}
type ${e.type}
tag ${e.tag}
tagger ${mv(e.tagger)}
${e.message}
${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(`
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(`
`),r=[];for(let i of e)i[0]===" "?r[r.length-1]+=`
`+i.slice(1):r.push(i);let n={};for(let i of r){let s=i.slice(0,i.indexOf(" ")),a=i.slice(i.indexOf(" ")+1);Array.isArray(n[s])?n[s].push(a):n[s]=a}return n.tagger&&(n.tagger=Fd(n.tagger)),n.committer&&(n.committer=Fd(n.committer)),n}withoutSignature(){let e=Wi(this._tag);return e.indexOf(`
-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(`
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return Wi(e)}payload(){return this.withoutSignature()+`
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,n){let i=e.payload(),{signature:s}=await r({payload:i,secretKey:n});s=Wi(s);let a=i+s;return t.from(a)}};function nv(t){return t.trim().split(`
`).map(e=>" "+e).join(`
`)+`
`}function M8(t){return t.split(`
`).map(e=>e.replace(/^ /,"")).join(`
`)}var kr=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(Buffer.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new he("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let n=t.justHeaders(e),i=t.justMessage(e),s=Wi(n+`
gpgsig`+nv(r)+`
`+i);return new t(s)}static from(e){return new t(e)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return t.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return Wi(e.slice(e.indexOf(`
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
`))}parseHeaders(){let e=t.justHeaders(this._commit).split(`
`),r=[];for(let i of e)i[0]===" "?r[r.length-1]+=`
`+i.slice(1):r.push(i);let n={parent:[]};for(let i of r){let s=i.slice(0,i.indexOf(" ")),a=i.slice(i.indexOf(" ")+1);Array.isArray(n[s])?n[s].push(a):n[s]=a}return n.author&&(n.author=Fd(n.author)),n.committer&&(n.committer=Fd(n.committer)),n}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree}
`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
`,e.parent){if(e.parent.length===void 0)throw new he("commit 'parent' property should be an array");for(let s of e.parent)r+=`parent ${s}
`}let n=e.author;r+=`author ${mv(n)}
`;let i=e.committer||e.author;return r+=`committer ${mv(i)}
`,e.gpgsig&&(r+="gpgsig"+nv(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+`
`+Wi(e.message)}render(){return this._commit}withoutSignature(){let e=Wi(this._commit);if(e.indexOf(`
gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(`
gpgsig`)),n=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
`)+28);return Wi(r+`
`+n)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return M8(e)}static async sign(e,r,n){let i=e.withoutSignature(),s=t.justMessage(e._commit),{signature:a}=await r({payload:i,secretKey:n});a=Wi(a);let l=t.justHeaders(e._commit)+`
gpgsig`+nv(a)+`
`+s;return t.from(l)}};async function Jo({fs:t,cache:e,gitdir:r,oid:n}){if(n==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Er.from([]),oid:n};let{type:i,object:s}=await Xe({fs:t,cache:e,gitdir:r,oid:n});if(i==="tag")return n=Zr.from(s).parse().object,Jo({fs:t,cache:e,gitdir:r,oid:n});if(i==="commit")return n=kr.from(s).parse().tree,Jo({fs:t,cache:e,gitdir:r,oid:n});if(i!=="tree")throw new fr(n,i,"tree");return{tree:Er.from(s),oid:n}}var gv=class{constructor({fs:e,gitdir:r,ref:n,cache:i}){this.fs=e,this.cache=i,this.gitdir=r,this.mapPromise=(async()=>{let a=new Map,o;try{o=await z.resolve({fs:e,gitdir:r,ref:n})}catch(c){c instanceof Be&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Jo({fs:e,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",a.set(".",l),a})();let s=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 s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:n,cache:i,gitdir:s}=this,a=await this.mapPromise,o=a.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 Xe({fs:n,cache:i,gitdir:s,oid:l});if(c!==o.type)throw new fr(l,c,o.type);let f=Er.from(u);for(let d of f)a.set(D(r,d.path),d);return f.entries().map(d=>D(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:n}=r.get(e._fullpath);e._type=n}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:n}=r.get(e._fullpath);e._mode=ik(parseInt(n,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:n,cache:i,gitdir:s}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await Xe({fs:n,cache:i,gitdir:s,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let n=(await this.mapPromise).get(e._fullpath);e._oid=n.oid}return e._oid}};function Xr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,Bd,{value:function({fs:r,gitdir:n,cache:i}){return new gv({fs:r,gitdir:n,ref:t,cache:i})}}),Object.freeze(e),e}var vv=class{constructor({fs:e,dir:r,gitdir:n,cache:i}){this.fs=e,this.cache=i,this.dir=r,this.gitdir=n,this.config=null;let s=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 s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:n,dir:i}=this,s=await n.readdir(D(i,r));return s===null?null:s.map(a=>D(r,a))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:n}=this,i=await r.lstat(`${n}/${e._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=i.isDirectory()?"tree":"blob";s==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(s="special"),e._type=s,i=Vo(i),e._mode=i.mode,i.size===-1&&e._actualSize&&(i.size=e._actualSize),e._stat=i}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:n,gitdir:i}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await r.readlink(`${n}/${e._fullpath}`);else{let o=await(await this._getGitConfig(r,i)).get("core.autocrlf");s=await r.read(`${n}/${e._fullpath}`,{autocrlf:o})}e._actualSize=s.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(s)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:n,gitdir:i,cache:s}=this,a;await ht.acquire({fs:n,gitdir:i,cache:s},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(n,i)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||Td(c,l,f,d)){let h=await e.content();h===void 0?a=void 0:(a=await zi($s.wrap({type:"blob",object:h})),l&&a===l.oid&&(!f||c.mode===l.mode)&&Td(c,l,f,d)&&o.insert({filepath:e._fullpath,stats:c,oid:a}))}else a=l.oid}),e._oid=a}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await lt.get({fs:e,gitdir:r}),this.config)}};function sl(){let t=Object.create(null);return Object.defineProperty(t,Bd,{value:function({fs:e,dir:r,gitdir:n,cache:i}){return new vv({fs:e,dir:r,gitdir:n,cache:i})}}),Object.freeze(t),t}function D8(t,e){let r=e-t;return Array.from({length:r},(n,i)=>t+i)}var dk=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),wv=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:e<this.value&&(this.value=e))}reset(){th Line truncated
`),n=new TextEncoder().encode(n)}catch(i){}return typeof n!="string"&&(n=Buffer.from(n)),n}catch(n){return null}}async write(e,r,n={}){try{await this._writeFile(e,r,n)}catch(i){await this.mkdir(Sa(e)),await this._writeFile(e,r,n)}}async mkdir(e,r=!1){try{await this._mkdir(e)}catch(n){if(n===null||n.code==="EEXIST")return;if(r)throw n;if(n.code==="ENOENT"){let i=Sa(e);if(i==="."||i==="/"||i===e)throw n;await this.mkdir(i),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(n){if(n.code!=="ENOENT")throw n}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Nd),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async i=>{let s=e+"/"+i;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((i,s)=>i.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let n=await this._readlink(e,r);return Buffer.isBuffer(n)?n:Buffer.from(n)}catch(n){if(n.code==="ENOENT"||(n.code||"").includes("ENS"))return null;throw n}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function T(t,e){if(e===void 0)throw new Sr(t)}async function J({fsp:t,dotgit:e}){T("fsp",t),T("dotgit",e);let r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(n=>n.trimRight().substr(8)).then(n=>D(Sa(e),n)):e}async function Od(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}async function hk({fs:t,dir:e,gitdir:r=D(e,".git"),commit:n="HEAD",cache:i={}}){try{T("fs",t),T("dir",e),T("gitdir",r);let s=new Q(t),a=[Xr({ref:n}),sl(),Ca()],o=[],l=await J({fsp:s,dotgit:r});await ht.acquire({fs:s,gitdir:l,cache:i},async function(u){o=u.unmergedPaths});let c=await Fs({fs:s,cache:i,dir:e,gitdir:l,trees:a,map:async function(u,[f,d,h]){let m=!await Od(d,h),g=o.includes(u),v=!await Od(h,f);if(m||g)return f?{path:u,mode:await f.mode(),oid:await f.oid(),type:await f.type(),content:await f.content()}:void 0;if(v)return!1;throw new ou(u)}});await ht.acquire({fs:s,gitdir:l,cache:i},async function(u){for(let f of c)if(f!==!1){if(!f){await s.rmdir(`${e}/${f.path}`,{recursive:!0}),u.delete({filepath:f.path});continue}if(f.type==="blob"){let d=new TextDecoder().decode(f.content);await s.write(`${e}/${f.path}`,d,{mode:f.mode}),u.insert({filepath:f.path,oid:f.oid,stage:0})}}})}catch(s){throw s.caller="git.abortMerge",s}}var Os=class{static async isIgnored({fs:e,dir:r,gitdir:n=D(r,".git"),filepath:i}){if(Pd(i)===".git")return!0;if(i===".")return!1;let s="",a=D(n,"info","exclude");await e.exists(a)&&(s=await e.read(a,"utf8"));let o=[{gitignore:D(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:D(r,f,".gitignore"),filepath:d})}let c=!1;for(let u of o){let f;try{f=await e.read(u.gitignore,"utf8")}catch(m){if(m.code==="NOENT")continue}let d=j3().add(s);d.add(f);let h=Sa(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 H8({fs:t,gitdir:e,object:r,format:n,oid:i}){if(n!=="deflated")throw new he("GitObjectStoreLoose expects objects to write to be in deflated format");let s=`objects/${i.slice(0,2)}/${i.slice(2)}`,a=`${e}/${s}`;await t.exists(a)||await t.write(a,r)}var iv=null;async function pk(t){return iv===null&&(iv=G8()),iv?U8(t):xv.deflate(t)}async function U8(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}function G8(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(t){return!1}}async function Ar({fs:t,gitdir:e,type:r,object:n,format:i="content",oid:s=void 0,dryRun:a=!1}){return i!=="deflated"&&(i!=="wrapped"&&(n=$s.wrap({type:r,object:n})),s=await zi(n),n=Buffer.from(await pk(n))),a||await H8({fs:t,gitdir:e,object:n,format:"deflated",oid:s}),s}function mk(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}async function gk({fs:t,dir:e,gitdir:r=D(e,".git"),filepath:n,cache:i={},force:s=!1,parallel:a=!0}){try{T("fs",t),T("dir",e),T("gitdir",r),T("filepath",n);let o=new Q(t),l=await J({fsp:o,dotgit:r});await ht.acquire({fs:o,gitdir:l,cache:i},async c=>{let f=await(await lt.get({fs:o,gitdir:l})).get("core.autocrlf");return bv({dir:e,gitdir:l,fs:o,filepath:n,index:c,force:s,parallel:a,autocrlf:f})})}catch(o){throw o.caller="git.add",o}}async function bv({dir:t,gitdir:e,fs:r,filepath:n,index:i,force:s,parallel:a,autocrlf:o}){n=Array.isArray(n)?n:[n];let l=n.map(asy Line truncated
`,author:l,committer:c,signingKey:u})}async function _k({fs:t,onSign:e,dir:r,gitdir:n=D(r,".git"),ref:i="refs/notes/commits",oid:s,note:a,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{T("fs",t),T("gitdir",n),T("oid",s),T("note",a),u&&T("onSign",e);let d=new Q(t),h=await Ms({fs:d,gitdir:n,author:l});if(!h)throw new Kt("author");let m=await el({fs:d,gitdir:n,author:h,committer:c});if(!m)throw new Kt("committer");let g=await J({fsp:d,dotgit:n});return await j8({fs:d,cache:f,onSign:e,gitdir:g,ref:i,oid:s,note:a,force:o,author:h,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}var q8=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function uu(t,e){if(typeof t!="string")throw new TypeError("Reference name must be a string");return!q8.test(t)&&(!!e||t.includes("/"))}async function xk({fs:t,gitdir:e,remote:r,url:n,force:i}){if(!uu(r,!0))throw new Dn(r,zc.clean(r));let s=await lt.get({fs:t,gitdir:e});if(!i&&(await s.getSubsections("remote")).includes(r)&&n!==await s.get(`remote.${r}.url`))throw new Mn("remote",r);await s.set(`remote.${r}.url`,n),await s.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await lt.save({fs:t,gitdir:e,config:s})}async function Sk({fs:t,dir:e,gitdir:r=D(e,".git"),remote:n,url:i,force:s=!1}){try{T("fs",t),T("gitdir",r),T("remote",n),T("url",i);let a=new Q(t),o=await J({fsp:a,dotgit:r});return await xk({fs:a,gitdir:o,remote:n,url:i,force:s})}catch(a){throw a.caller="git.addRemote",a}}async function W8({fs:t,cache:e,onSign:r,gitdir:n,ref:i,tagger:s,message:a=i,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await z.exists({fs:t,gitdir:n,ref:i}))throw new Mn("tag",i);let f=await z.resolve({fs:t,gitdir:n,ref:l||"HEAD"}),{type:d}=await Xe({fs:t,cache:e,gitdir:n,oid:f}),h=Zr.from({object:f,type:d,tag:i.replace("refs/tags/",""),tagger:s,message:a,gpgsig:o});c&&(h=await Zr.sign(h,r,c));let m=await Ar({fs:t,gitdir:n,type:"tag",object:h.toObject()});await z.writeRef({fs:t,gitdir:n,ref:i,value:m})}async function Ek({fs:t,onSign:e,dir:r,gitdir:n=D(r,".git"),ref:i,tagger:s,message:a=i,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{T("fs",t),T("gitdir",n),T("ref",i),c&&T("onSign",e);let d=new Q(t),h=await J({fsp:d,dotgit:n}),m=await Ms({fs:d,gitdir:h,author:s});if(!m)throw new Kt("tagger");return await W8({fs:d,cache:f,onSign:e,gitdir:h,ref:i,tagger:m,message:a,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function z8({fs:t,gitdir:e,ref:r,object:n,checkout:i=!1,force:s=!1}){if(!uu(r,!0))throw new Dn(r,zc.clean(r));let a=`refs/heads/${r}`;if(!s&&await z.exists({fs:t,gitdir:e,ref:a}))throw new Mn("branch",r,!1);let o;try{o=await z.resolve({fs:t,gitdir:e,ref:n||"HEAD"})}catch(l){}o&&await z.writeRef({fs:t,gitdir:e,ref:a,value:o}),i&&await z.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function kk({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n,object:i,checkout:s=!1,force:a=!1}){try{T("fs",t),T("gitdir",r),T("ref",n);let o=new Q(t),l=await J({fsp:o,dotgit:r});return await z8({fs:o,gitdir:l,ref:n,object:i,checkout:s,force:a})}catch(o){throw o.caller="git.branch",o}}var Ak=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function Ev({fs:t,cache:e,onProgress:r,onPostCheckout:n,dir:i,gitdir:s,remote:a,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,nonBlocking:m=!1,batchSize:g=100}){let v;if(n)try{v=await z.resolve({fs:t,gitdir:s,ref:"HEAD"})}catch(b){v="0000000000000000000000000000000000000000"}let w;try{w=await z.resolve({fs:t,gitdir:s,ref:o})}catch(b){if(o==="HEAD")throw b;let k=`${a}/${o}`;if(w=await z.resolve({fs:t,gitdir:s,ref:k}),h){let x=await lt.get({fs:t,gitdir:s});await x.set(`branch.${o}.remote`,a),await x.set(`branch.${o}.merge`,`refs/heads/${o}`),await lt.save({fs:t,gitdir:s,config:x})}await z.writeRef({fs:t,gitdir:s,ref:`refs/heads/${o}`,value:w})}if(!c){let b;try{b=await V8({fs:t,cache:e,onProgress:r,dir:i,gitdir:s,ref:o,force:d,filepaths:l})}catch(y){throw y instanceof Be&&y.data.what===w?new Qc(o,w):y}let k=b.filter(([y])=>y==="conflict").map(([y,S])=>S);if(k.length>0)throw new Kc(k);let x=b.filter(([y])=>y==="error").map(([y,S])=>S);if(x.length>0)throw new he(x.join(", "));if(f){n&&await n({previousHead:v,newHead:w,type:l!=null&&l.length>0?"file":"branch"});return}let E=0,A=b.length;if(await ht.acquire({fs:t,gitdir:s,cache:e},async function(y){await Promise.all(b.filter(([S])=>S==="delete"||S==="delete-index").map(async function([S,_]){let C=`${i}/${_}`;S==="delete"&&await t.rm(C),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}))}),await ht.acquire({fs:t,gitdir:s,cache:e},async function(y){for(let[S,_]of b)if(S==="rmdir"||S==="rmdir-index"){let C=`${i}/${_}`;try{S==="rmdir"&&await t.rmdir(C),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}catch(P){if(P.code==="ENOTEMPTY") Line truncated
`).map(a=>i.add(a))}),i}static async write({fs:e,gitdir:r,oids:n}){_a===null&&(_a=new Wc);let i=D(r,"shallow");if(n.size>0){let s=[...n].join(`
`)+`
`;await _a.acquire(i,async function(){await e.write(i,s,{encoding:"utf8"})})}else await _a.acquire(i,async function(){await e.rm(i)})}};async function J8({fs:t,gitdir:e,oid:r}){let n=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${n}`)}async function e6({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:i}){let s=await t.readdir(D(r,"objects/pack"));s=s.filter(a=>a.endsWith(".idx"));for(let a of s){let o=`${r}/objects/pack/${a}`,l=await Sv({fs:t,cache:e,filename:o,getExternalRefDelta:i});if(l.error)throw new he(l.error);if(l.offsets.has(n))return!0}return!1}async function JE({fs:t,cache:e,gitdir:r,oid:n,format:i="content"}){let s=o=>Xe({fs:t,cache:e,gitdir:r,oid:o}),a=await J8({fs:t,gitdir:r,oid:n});return a||(a=await e6({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:s})),a}function t6(t){let i="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===i}function Tk(t,e){let r=t.map(n=>n.split("=",1)[0]);return e.filter(n=>{let i=n.split("=",1)[0];return r.includes(i)})}var Ud={name:"isomorphic-git",version:"1.36.3",agent:"git/isomorphic-git@1.36.3"},Wo=class{constructor(){this._queue=[]}write(e){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:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,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(e=>{this._waiting=e})}};function r6(t){let e=t.indexOf("\r"),r=t.indexOf(`
`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}function Pk(t){let e=new Wo,r="";return(async()=>(await hu(t,n=>{for(n=n.toString("utf8"),r+=n;;){let i=r6(r);if(i===-1)break;e.write(r.slice(0,i)),r=r.slice(i)}}),r.length>0&&e.write(r),e.end()))(),e}var Dd=class{static demux(e){let r=st.streamReader(e),n=new Wo,i=new Wo,s=new Wo,a=async function(){let o=await r();if(o===null)return a();if(o===!0){n.end(),s.end(),e.error?i.destroy(e.error):i.end();return}switch(o[0]){case 1:{i.write(o.slice(1));break}case 2:{s.write(o.slice(1));break}case 3:{let l=o.slice(1);s.write(l),n.end(),s.end(),i.destroy(new Error(l.toString("utf8")));return}default:n.write(o)}a()};return a(),{packetlines:n,packfile:i,progress:s}}};async function n6(t){let{packetlines:e,packfile:r,progress:n}=Dd.demux(t),i=[],s=[],a=[],o=!1,l=!1;return new Promise((c,u)=>{hu(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Rs(h)),i.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Rs(h)),s.push(h)}else if(d.startsWith("ACK")){let[,h,m]=d.split(" ");a.push({oid:h,status:m}),m||(l=!0)}else d.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(t.error?u(t.error):c({shallows:i,unshallows:s,acks:a,nak:o,packfile:r,progress:n}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:i,unshallows:s,acks:a,nak:o,packfile:r,progress:n}))})})}function i6({capabilities:t=[],wants:e=[],haves:r=[],shallows:n=[],depth:i=null,since:s=null,exclude:a=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(st.encode(`want ${c}${l}
`)),l="";for(let c of n)o.push(st.encode(`shallow ${c}
`));i!==null&&o.push(st.encode(`deepen ${i}
`)),s!==null&&o.push(st.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)}
`));for(let c of a)o.push(st.encode(`deepen-not ${c}
`));o.push(st.flush());for(let c of r)o.push(st.encode(`have ${c}
`));return o.push(st.encode(`done
`)),o}async function Av({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:m=null,since:g=null,exclude:v=[],relative:w=!1,tags:b=!1,singleBranch:k=!1,headers:x={},prune:E=!1,pruneTags:A=!1}){let y=c||await Ls({fs:t,gitdir:l,test:!0}),S=await lt.get({fs:t,gitdir:l}),_=f||y&&await S.get(`branch.${y}.remote`)||"origin",C=d||await S.get(`remote.${_}.url`);if(typeof C=="undefined")throw new Sr("remote OR url");let P=u||y&&await S.get(`branch.${y}.merge`)||c||"HEAD";h===void 0&&(h=await S.get("http.corsProxy"));let N=nl.getRemoteHelperFor({url:C}),B=await N.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:C,headers:x,protocolVersion:1}),H=B.auth,ce=B.refs;if(ce.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(m!==null&&!B.capabilities.has("shallow"))throw new Ps("shallow","depth");if(g!==null&&!B.capabilities.has("deepen-since"))throw new Ps("deepen-since","since");if(v.length>0&&!B.capabilities.has("deepen-not"))throw new Ps("deepen-not","exclude");if(w===!0&&!B.capabilities.has("deepen-relative"))throw new Ps("deepen-relative","relative");let{oid:Pe,fullref:ve}=z.resolveAgainstMap({ref:P,map:ce});for(let M of ce.keys())M===ve||M==="HEAD"||M.startsWith("refs/heads/")||b&&M.startsWith("refs/tags/")||ce.delete(M);let ie=Tk([...B.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Ud.agent}`]);w&&ie.push("deepen-relative");let xe=k?[Pe]:ce.values(),we=k?[y]:await z.listRefs({fs:t,gitdir:l,filepath:"refs"}),W=[];for(let M of we)try{M=await z.expand({fs:t,gitdir:l,ref:M});let O=await z.resolve({fs:t,gitdir:l,ref:M});await JE({fs:t,cache:e,gitdir:l,oid:O})&&W.push(O)}catch(O){}W=[...new Set(W)];let X=await ka.read({fs:t,gitdir:l}),q=B.capabilities.has("shallow")?[...X]:[],De=i6({capabilities:ie,wants:xe,haves:W,shallows:q,depth:m,since:g,exclude:v}),ar=Buffer.from(await Md(De)),Ft=await N.connect({http:r,onProgress:n,corsProxy:h,service:"git-upload-pack",url:C,auth:H,body:[ar],headers:x}),Ie=await n6(Ft.body);Ft.headers&&(Ie.headers=Ft.headers);for(let M of Ie.shallows)if(!X.has(M))try{let{object:O}=await Xe({fs:t,cache:e,gitdir:l,oid:M}),oe=new kr(O),Ce=await Promise.all(oe.headers().parent.map(wr=>JE({fs:t,cache:e,gitdir:l,oid:wr})));Ce.length===0||Ce.every(wr=>wr)||X.add(M)}catch(O){X.add(M)}for(let M of Ie.unshallows)X.delete(M);if(await ka.write({fs:t,gitdir:l,oids:X}),k){let M=new Map([[ve,Pe]]),O=new Map,oe=10,Ce=ve;for(;oe--;){let bo=B.symrefs.get(Ce);if(bo===void 0)break;O.set(Ce,bo),Ce=bo}let Ot=ce.get(Ce);Ot&&M.set(Ce,Ot);let{pruned:wr}=await z.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:M,symrefs:O,tags:b,prune:E});E&&(Ie.pruned=wr)}else{let{pruned:M}=await z.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:ce,symrefs:B.symrefs,tags:b,prune:E,pruneTags:A});E&&(Ie.pruned=M)}if(Ie.HEAD=B.symrefs.get("HEAD"),Ie.HEAD===void 0){let{oid:M}=z.resolveAgainstMap({ref:"HEAD",map:ce});for(let[O,oe]of ce.entries())if(O!=="HEAD"&&oe===M){Ie.HEAD=O;break}}let kt=ve.startsWith("refs/tags")?"tag":"branch";if(Ie.FETCH_HEAD={oid:Pe,description:`${kt} '${xa(ve)}' of ${C}`},n||i){let M=Pk(Ie.progress);hu(M,async O=>{if(i&&await i(O),n){let oe=O.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);oe&&await n({phase:oe[1].trim(),loaded:parseInt(oe[2],10),total:parseInt(oe[3],10)})}})}let At=Buffer.from(await Md(Ie.packfile));if(Ft.body.error)throw Ft.body.error;let je=At.slice(-20).toString("hex"),Z={defaultBranch:Ie.HEAD,fetchHead:Ie.FETCH_HEAD.oid,fetchHeadDescription:Ie.FETCH_HEAD.description};if(Ie.headers&&(Z.headers=Ie.headers),E&&(Z.pruned=Ie.pruned),je!==""&&!t6(At)){Z.packfile=`objects/pack/pack-${je}.pack`;let M=D(l,Z.packfile);await t.write(M,At);let O=Ce=>Xe({fs:t,cache:e,gitdir:l,oid:Ce}),oe=await Xc.fromPack({pack:At,getExternalRefDelta:O,onProgress:n});await t.write(M.replace(/\.pack$/,".idx"),await oe.toBuffer())}return Z}async function Rk({fs:t,bare:e=!1,dir:r,gitdir:n=e?r:D(r,".git"),defaultBranch:i="master"}){if(await t.exists(n+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(a=>n+"/"+a);for(let a of s)await t.mkdir(a);await t.write(n+"/config",`[core]
repositoryformatversion = 0
filemode = false
bare = ${e}
`+(e?"":` logallrefupdates = true
`)+` symlinks = false
ignorecase = true
`),await t.write(n+"/HEAD",`ref: refs/heads/${i}
`)}async function s6({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:m,depth:g,since:v,exclude:w,relative:b,singleBranch:k,noCheckout:x,noTags:E,headers:A,nonBlocking:y,batchSize:S=100}){try{if(await Rk({fs:t,gitdir:u}),await xk({fs:t,gitdir:u,remote:m,url:f,force:!1}),d){let P=await lt.get({fs:t,gitdir:u});await P.set("http.corsProxy",d),await lt.save({fs:t,gitdir:u,config:P})}let{defaultBranch:_,fetchHead:C}=await Av({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:u,ref:h,remote:m,corsProxy:d,depth:g,since:v,exclude:w,relative:b,singleBranch:k,headers:A,tags:!E});if(C===null)return;h=h||_,h=h.replace("refs/heads/",""),await Ev({fs:t,cache:e,onProgress:n,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:m,noCheckout:x,nonBlocking:y,batchSize:S})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}async function $k({fs:t,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:c=D(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:m=void 0,since:g=void 0,exclude:v=[],relative:w=!1,singleBranch:b=!1,noCheckout:k=!1,noTags:x=!1,headers:E={},cache:A={},nonBlocking:y=!1,batchSize:S=100}){try{T("fs",t),T("http",e),T("gitdir",c),k||T("dir",l),T("url",u);let _=new Q(t),C=await J({fsp:_,dotgit:c});return await s6({fs:_,cache:A,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:C,url:u,corsProxy:f,ref:d,remote:h,depth:m,since:g,exclude:v,relative:w,singleBranch:b,noCheckout:k,noTags:x,headers:E,nonBlocking:y,batchSize:S})}catch(_){throw _.caller="git.clone",_}}async function Ik({fs:t,onSign:e,dir:r,gitdir:n=D(r,".git"),message:i,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:m={}}){try{T("fs",t),l||T("message",i),o&&T("onSign",e);let g=new Q(t),v=await J({fsp:g,dotgit:n});return await Hd({fs:g,cache:m,onSign:e,gitdir:v,message:i,author:s,committer:a,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(g){throw g.caller="git.commit",g}}async function Fk({fs:t,dir:e,gitdir:r=D(e,".git"),fullname:n=!1,test:i=!1}){try{T("fs",t),T("gitdir",r);let s=new Q(t),a=await J({fsp:s,dotgit:r});return await Ls({fs:s,gitdir:a,fullname:n,test:i})}catch(s){throw s.caller="git.currentBranch",s}}async function a6({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await z.exists({fs:t,gitdir:e,ref:r}))throw new Be(r);let i=await z.expand({fs:t,gitdir:e,ref:r}),s=await Ls({fs:t,gitdir:e,fullname:!0});if(i===s){let l=await z.resolve({fs:t,gitdir:e,ref:i});await z.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await z.deleteRef({fs:t,gitdir:e,ref:i});let a=xa(r),o=await lt.get({fs:t,gitdir:e});await o.deleteSection("branch",a),await lt.save({fs:t,gitdir:e,config:o})}async function Ok({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n}){try{T("fs",t),T("ref",n);let i=new Q(t),s=await J({fsp:i,dotgit:r});return await a6({fs:i,gitdir:s,ref:n})}catch(i){throw i.caller="git.deleteBranch",i}}async function Mk({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n}){try{T("fs",t),T("ref",n);let i=new Q(t),s=await J({fsp:i,dotgit:r});await z.deleteRef({fs:i,gitdir:s,ref:n})}catch(i){throw i.caller="git.deleteRef",i}}async function o6({fs:t,gitdir:e,remote:r}){let n=await lt.get({fs:t,gitdir:e});await n.deleteSection("remote",r),await lt.save({fs:t,gitdir:e,config:n})}async function Dk({fs:t,dir:e,gitdir:r=D(e,".git"),remote:n}){try{T("fs",t),T("remote",n);let i=new Q(t),s=await J({fsp:i,dotgit:r});return await o6({fs:i,gitdir:s,remote:n})}catch(i){throw i.caller="git.deleteRemote",i}}async function l6({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await z.deleteRef({fs:t,gitdir:e,ref:r})}async function Lk({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n}){try{T("fs",t),T("ref",n);let i=new Q(t),s=await J({fsp:i,dotgit:r});return await l6({fs:i,gitdir:s,ref:n})}catch(i){throw i.caller="git.deleteTag",i}}async function c6({fs:t,gitdir:e,oid:r}){let n=r.slice(0,2);return(await t.readdir(`${e}/objects/${n}`)).map(s=>`${n}${s}`).filter(s=>s.startsWith(r))}async function u6({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:i}){let s=[],a=await t.readdir(D(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await Sv({fs:t,cache:e,filename:l,getExternalRefDelta:i});if(c.error)throw new he(c.error);for(let u of c.offsets.keys())u.startsWith(n)&&s.push(u)}return s}async function f6({fs:t,cache:e,gitdir:r,oid:n}){let i=o=>Xe({fs:t,cache:e,gitdir:r,oid:o}),s=await c6({fs:t,gitdir:r,oid:n}),a=await u6({fs:t,cache:e,gitdir:r,oid:n,getExternalRefDelta:i});for(let o of a)s.indexOf(o)===-1&&s.push(o);if(s.length===1)return s[0];throw s.length>1?new Zc("oids",n,s):new Be(`an object matching "${n}"`)}async function Nk({fs:t,dir:e,gitdir:r=D(e," Line truncated
`,d+=m.conflict.a.join(""),d+=`${"=".repeat(f)}
`,d+=m.conflict.b.join(""),d+=`${">".repeat(f)} ${n}
`);return{cleanMerge:h,mergedText:d}}async function h6({fs:t,cache:e,dir:r,gitdir:n=D(r,".git"),index:i,ourOid:s,baseOid:a,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let m=Xr({ref:s}),g=Xr({ref:a}),v=Xr({ref:o}),w=[],b=[],k=[],x=[],E=await Fs({fs:t,cache:e,dir:r,gitdir:n,trees:[m,g,v],map:async function(A,[y,S,_]){let C=Pd(A),P=await Od(y,S),N=await Od(_,S);switch(`${P}-${N}`){case"false-false":return{mode:await S.mode(),path:C,oid:await S.oid(),type:await S.type()};case"false-true":return!_&&await y.type()==="tree"?{mode:await y.mode(),path:C,oid:await y.oid(),type:await y.type()}:_?{mode:await _.mode(),path:C,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!y&&await _.type()==="tree"?{mode:await _.mode(),path:C,oid:await _.oid(),type:await _.type()}:y?{mode:await y.mode(),path:C,oid:await y.oid(),type:await y.type()}:void 0;case"true-true":{if(y&&_&&await y.type()==="tree"&&await _.type()==="tree")return{mode:await y.mode(),path:C,oid:await y.oid(),type:"tree"};if(y&&_&&await y.type()==="blob"&&await _.type()==="blob")return p6({fs:t,gitdir:n,path:C,ours:y,base:S,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async B=>{if(B.cleanMerge)d||i.insert({filepath:A,oid:B.mergeResult.oid,stage:0});else if(w.push(A),b.push(A),!d){let H="";S&&await S.type()==="blob"&&(H=await S.oid());let ce=await y.oid(),Pe=await _.oid();i.delete({filepath:A}),H&&i.insert({filepath:A,oid:H,stage:1}),i.insert({filepath:A,oid:ce,stage:2}),i.insert({filepath:A,oid:Pe,stage:3})}return B.mergeResult});if(S&&!y&&_&&await S.type()==="blob"&&await _.type()==="blob"){if(w.push(A),k.push(A),!d){let B=await S.oid(),H=await _.oid();i.delete({filepath:A}),i.insert({filepath:A,oid:B,stage:1}),i.insert({filepath:A,oid:H,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:C}}if(S&&y&&!_&&await S.type()==="blob"&&await y.type()==="blob"){if(w.push(A),x.push(A),!d){let B=await S.oid(),H=await y.oid();i.delete({filepath:A}),i.insert({filepath:A,oid:B,stage:1}),i.insert({filepath:A,oid:H,stage:2})}return{mode:await y.mode(),oid:await y.oid(),type:"blob",path:C}}if(S&&!y&&!_&&(await S.type()==="blob"||await S.type()==="tree"))return;throw new Xo}}},reduce:w.length!==0&&(!r||d)?void 0:async(A,y)=>{let S=y.filter(Boolean);if(A&&!(A&&A.type==="tree"&&S.length===0&&A.path!==".")){if(S.length>0||A.path==="."&&S.length===0){let C=new Er(S).toObject(),P=await Ar({fs:t,gitdir:n,type:"tree",object:C,dryRun:f});A.oid=P}return A}}});return w.length!==0?(r&&!d&&await Fs({fs:t,cache:e,dir:r,gitdir:n,trees:[Xr({ref:E.oid})],map:async function(A,[y]){let S=`${r}/${A}`;if(await y.type()==="blob"){let _=await y.mode(),C=new TextDecoder().decode(await y.content());await t.write(S,C,{mode:_})}return!0}}),new Zo(w,b,k,x)):E.oid}async function p6({fs:t,gitdir:e,path:r,ours:n,base:i,theirs:s,ourName:a,theirName:o,baseName:l,dryRun:c,mergeDriver:u=d6}){let f="blob",d="100755",h="",m="";i&&await i.type()==="blob"&&(d=await i.mode(),h=await i.oid(),m=Buffer.from(await i.content()).toString("utf8"));let g=d===await n.mode()?await s.mode():await n.mode();if(await n.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await n.oid(),type:f}};if(await n.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await s.oid(),type:f}};if(await s.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await n.oid(),type:f}};let v=Buffer.from(await n.content()).toString("utf8"),w=Buffer.from(await s.content()).toString("utf8"),{mergedText:b,cleanMerge:k}=await u({branches:[l,a,o],contents:[m,v,w],path:r}),x=await Ar({fs:t,gitdir:e,type:"blob",object:Buffer.from(b,"utf8"),dryRun:c});return{cleanMerge:k,mergeResult:{mode:g,path:r,oid:x,type:f}}}async function Hk({fs:t,cache:e,dir:r,gitdir:n,ours:i,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:m,onSign:g,mergeDriver:v,allowUnrelatedHistories:w=!1}){i===void 0&&(i=await Ls({fs:t,gitdir:n,fullname:!0})),i=await z.expand({fs:t,gitdir:n,ref:i}),s=await z.expand({fs:t,gitdir:n,ref:s});let b=await z.resolve({fs:t,gitdir:n,ref:i}),k=await z.resolve({fs:t,gitdir:n,ref:s}),x=await Cv({fs:t,cache:e,gitdir:n,oids:[b,k]});if(x.length!==1)if(x.length===0&&w)x.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new Xo;let E=x[0];if(E===k)return{oid:b,alreadyMerged:!0};if(a&&E===b)return!l&&!c&&await z.writeRef({fs:t,gitdir:n,ref:i,value:k}),{oid:k,fastForward:!0};{if(o)throw new eu;let A=await ht.acquire({fs:t,gitdir:n,cache:e,allowUnmerged:!1},async S=>h6({fs:t,cache:e,dir:r,gitdir:n,index:S,ourOid:b,theirOid:k,baseOid:E,ourName:xa(i),baseName:"base",theirName:xa(s),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(A instanceof Zo)throw A;return f||(f=`Merge branch '${xa(s)}' into ${xa(i)}`),{oid:await Hd({fs:t,cache:e,gitdir:n,message:f,ref:i,tree:A,parent:[b,k],author:d,committer:h,signingK Line truncated
`)),n.push(st.encode(`agent=${Ud.agent}
`)),(r||e||t)&&n.push(st.delim()),r&&n.push(st.encode("peel")),e&&n.push(st.encode("symrefs")),t&&n.push(st.encode(`ref-prefix ${t}`)),n.push(st.flush()),n}async function uA({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{T("http",t),T("url",s);let d=await rl.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:n,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(d.protocolVersion===1)return Zk(d,c,u,f);let h=await x6({prefix:c,symrefs:u,peelTags:f}),m=await rl.connect({http:t,auth:d.auth,headers:a,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:s,body:h});return _6(m.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function fA({fs:t,dir:e,gitdir:r=D(e,".git")}){try{T("fs",t),T("gitdir",r);let n=new Q(t),i=await J({fsp:n,dotgit:r});return z.listTags({fs:n,gitdir:i})}catch(n){throw n.caller="git.listTags",n}}function S6(t,e){return t.committer.timestamp-e.committer.timestamp}var E6="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function ek({fs:t,cache:e,gitdir:r,oid:n,fileId:i}){if(i===E6)return;let s=n,a,o=await Jo({fs:t,cache:e,gitdir:r,oid:n}),l=o.tree;return i===o.oid?a=o.path:(a=await dA({fs:t,cache:e,gitdir:r,tree:l,fileId:i,oid:s}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function dA({fs:t,cache:e,gitdir:r,tree:n,fileId:i,oid:s,filepaths:a=[],parentPath:o=""}){let l=n.entries().map(function(c){let u;return c.oid===i?(u=D(o,c.path),a.push(u)):c.type==="tree"&&(u=Xe({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return dA({fs:t,cache:e,gitdir:r,tree:Er.from(f),fileId:i,oid:s,filepaths:a,parentPath:D(o,c.path)})})),u});return await Promise.all(l),a}async function k6({fs:t,cache:e,gitdir:r,filepath:n,ref:i,depth:s,since:a,force:o,follow:l}){let c=typeof a=="undefined"?void 0:Math.floor(a.valueOf()/1e3),u=[],f=await ka.read({fs:t,gitdir:r}),d=await z.resolve({fs:t,gitdir:r,ref:i}),h=[await tl({fs:t,cache:e,gitdir:r,oid:d})],m,g,v;function w(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 k;try{k=await fu({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:n}),g&&m!==k&&u.push(g),m=k,g=b,v=!0}catch(x){if(x instanceof Be){let E=l&&m;if(E&&(E=await ek({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:m}),E))if(Array.isArray(E)){if(g){let A=await ek({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:m});if(Array.isArray(A))if(E=E.filter(y=>A.indexOf(y)===-1),E.length===1)E=E[0],n=E,g&&u.push(g);else{E=!1,g&&u.push(g);break}}}else n=E,g&&u.push(g);if(!E){if(v&&m&&(u.push(g),!o))break;if(!o&&!l)throw x}g=b,v=!1}else throw x}}else u.push(b);if(s!==void 0&&u.length===s){w(b);break}if(!f.has(b.oid))for(let k of b.commit.parent){let x=await tl({fs:t,cache:e,gitdir:r,oid:k});h.map(E=>E.oid).includes(x.oid)||h.push(x)}h.length===0&&w(b),h.sort((k,x)=>S6(k.commit,x.commit))}return u}async function hA({fs:t,dir:e,gitdir:r=D(e,".git"),filepath:n,ref:i="HEAD",depth:s,since:a,force:o,follow:l,cache:c={}}){try{T("fs",t),T("gitdir",r),T("ref",i);let u=new Q(t),f=await J({fsp:u,dotgit:r});return await k6({fs:u,cache:c,gitdir:f,filepath:n,ref:i,depth:s,since:a,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function pA({fs:t,onSign:e,dir:r,gitdir:n=D(r,".git"),ours:i,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:m,cache:g={},mergeDriver:v,allowUnrelatedHistories:w=!1}){try{T("fs",t),m&&T("onSign",e);let b=new Q(t),k=await J({fsp:b,dotgit:n}),x=await Ms({fs:b,gitdir:k,author:d});if(!x&&(!o||!a))throw new Kt("author");let E=await el({fs:b,gitdir:k,author:x,committer:h});if(!E&&(!o||!a))throw new Kt("committer");return await Hk({fs:b,cache:g,dir:r,gitdir:k,ours:i,theirs:s,fastForward:a,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:x,committer:E,signingKey:m,onSign:e,mergeDriver:v,allowUnrelatedHistories:w})}catch(b){throw b.caller="git.merge",b}}var A6={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function mA({fs:t,cache:e,dir:r,gitdir:n=D(r,".git"),oids:i}){let s=new rk,a=[];function o(u,f){let d=Buffer.from(u,f);a.push(d),s.update(d)}async function l({stype:u,object:f}){let d=A6[u],h=f.length,m=h>15?128:0,g=h&15;h=h>>>4;let v=(m|d|g).toString(16);for(o(v,"hex");m;)m=h>127?128:0,v=m|h&127,o(_v(2,v),"hex"),h=h>>>7;o(Buffer.from(await pk(f)))}o("PACK"),o("00000002","hex"),o(_v(8,i.length),"hex");for(let u of i){let{type:f,object:d}=await Xe({fs:t,cache:e,gitdir:n,oid:u});await l({write:o,object:d,stype:f})}let c=s.digest();return a.push(c),a}async function C6({fs:t,cache:e,gitdir:r,oids:n,write:i}){let s=await mA({fs:t,cache:e,gitdir:r,oids:n}),a=Buffer.from(await Md(s)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return i?(await t.write(D(r,`objects/pack/${l}`),a),{filename:l}):{filena Line truncated
`),i=await n();let s=r.toString("utf8").split(`
`);if(i=s.shift(),!i.startsWith("unpack "))throw new Ea('unpack ok" or "unpack [error message]',i);e.ok=i==="unpack ok",e.ok||(e.error=i.slice(7)),e.refs={};for(let a of s){if(a.trim()==="")continue;let o=a.slice(0,2),l=a.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function R6({capabilities:t=[],triplets:e=[]}){let r=[],n=`\0 ${t.join(" ")}`;for(let i of e)r.push(st.encode(`${i.oldoid} ${i.oid} ${i.fullRef}${n}
`)),n="";return r.push(st.flush()),r}async function $6({fs:t,cache:e,http:r,onProgress:n,onMessage:i,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:m=!1,delete:g=!1,corsProxy:v,headers:w={}}){let b=u||await Ls({fs:t,gitdir:c});if(typeof b=="undefined")throw new Sr("ref");let k=await lt.get({fs:t,gitdir:c});d=d||await k.get(`branch.${b}.pushRemote`)||await k.get("remote.pushDefault")||await k.get(`branch.${b}.remote`)||"origin";let x=h||await k.get(`remote.${d}.pushurl`)||await k.get(`remote.${d}.url`);if(typeof x=="undefined")throw new Sr("remote OR url");let E=f||await k.get(`branch.${b}.merge`);if(typeof x=="undefined")throw new Sr("remoteRef");v===void 0&&(v=await k.get("http.corsProxy"));let A=await z.expand({fs:t,gitdir:c,ref:b}),y=g?"0000000000000000000000000000000000000000":await z.resolve({fs:t,gitdir:c,ref:A}),S=nl.getRemoteHelperFor({url:x}),_=await S.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:v,service:"git-receive-pack",url:x,headers:w,protocolVersion:1}),C=_.auth,P;if(!E)P=A;else try{P=await z.expandAgainstMap({ref:E,map:_.refs})}catch(X){if(X instanceof Be)P=E.startsWith("refs/")?E:`refs/heads/${E}`;else throw X}let N=_.refs.get(P)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:x,localRef:{ref:g?"(delete)":A,oid:y},remoteRef:{ref:P,oid:N}}))throw new Qo;let B=!_.capabilities.has("no-thin"),H=new Set;if(!g){let X=[..._.refs.values()],q=new Set;if(N!=="0000000000000000000000000000000000000000"){let De=await Cv({fs:t,cache:e,gitdir:c,oids:[y,N]});for(let ar of De)X.push(ar);B&&(q=await lv({fs:t,cache:e,gitdir:c,oids:De}))}if(!X.includes(y)){let De=await T6({fs:t,cache:e,gitdir:c,start:[y],finish:X});H=await lv({fs:t,cache:e,gitdir:c,oids:De})}if(B){try{let De=await z.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:ar}=await z.resolveAgainstMap({ref:De.replace(`refs/remotes/${d}/`,""),fullref:De,map:_.refs}),Ft=[ar];for(let Ie of await lv({fs:t,cache:e,gitdir:c,oids:Ft}))q.add(Ie)}catch(De){}for(let De of q)H.delete(De)}if(y===N&&(m=!0),!m){if(A.startsWith("refs/tags")&&N!=="0000000000000000000000000000000000000000")throw new Ko("tag-exists");if(y!=="0000000000000000000000000000000000000000"&&N!=="0000000000000000000000000000000000000000"&&!await tA({fs:t,cache:e,gitdir:c,oid:y,ancestor:N,depth:-1}))throw new Ko("not-fast-forward")}}let ce=Tk([..._.capabilities],["report-status","side-band-64k",`agent=${Ud.agent}`]),Pe=await R6({capabilities:ce,triplets:[{oldoid:N,oid:y,fullRef:P}]}),ve=g?[]:await mA({fs:t,cache:e,gitdir:c,oids:[...H]}),ie=await S.connect({http:r,onProgress:n,corsProxy:v,service:"git-receive-pack",url:x,auth:C,headers:w,body:[...Pe,...ve]}),{packfile:xe,progress:we}=await Dd.demux(ie.body);if(i){let X=Pk(we);hu(X,async q=>{await i(q)})}let W=await P6(xe);if(ie.headers&&(W.headers=ie.headers),d&&W.ok&&W.refs[P].ok&&!A.startsWith("refs/tags")){let X=`refs/remotes/${d}/${P.replace("refs/heads","")}`;g?await z.deleteRef({fs:t,gitdir:c,ref:X}):await z.writeRef({fs:t,gitdir:c,ref:X,value:y})}if(W.ok&&Object.values(W.refs).every(X=>X.ok))return W;{let X=Object.entries(W.refs).filter(([q,De])=>!De.ok).map(([q,De])=>`
- ${q}: ${De.error}`).join("");throw new tu(X,W)}}async function wA({fs:t,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,dir:l,gitdir:c=D(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:m=!1,delete:g=!1,corsProxy:v,headers:w={},cache:b={}}){try{T("fs",t),T("http",e),T("gitdir",c);let k=new Q(t),x=await J({fsp:k,dotgit:c});return await $6({fs:k,cache:b,http:e,onProgress:r,onMessage:n,onAuth:i,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,gitdir:x,ref:u,remoteRef:f,remote:d,url:h,force:m,delete:g,corsProxy:v,headers:w})}catch(k){throw k.caller="git.push",k}}async function yA({fs:t,cache:e,gitdir:r,oid:n}){let{type:i,object:s}=await Xe({fs:t,cache:e,gitdir:r,oid:n});if(i==="tag")return n=Zr.from(s).parse().object,yA({fs:t,cache:e,gitdir:r,oid:n});if(i!=="blob")throw new fr(n,i,"blob");return{oid:n,blob:new Uint8Array(s)}}async function bA({fs:t,cache:e,gitdir:r,oid:n,filepath:i=void 0}){return i!==void 0&&(n=await fu({fs:t,cache:e,gitdir:r,oid:n,filepath:i})),await yA({fs:t,cache:e,gitdir:r,oid:n})}async function _A({fs:t,dir:e,gitdir:r=D(e,".git"),oid:n,filepath:i,cache:s={}}){try{T("fs",t),T("gitdir",r),T("oid",n);let a=new Q(t),o=await J({fsp:a,dotgit:r});return await bA({fs:a,cache:s,gitdir:o,oid:n,filepath:i})}catch(a){throw a.caller="git.readBlob",a}}async function Tv({fs:t,dir:e,gitdir:r=D(e,".git"),oid:n,cache:i={}}){try{T("fs",t),T("gitdir",r),T("oid",n);let s=new Q(t),a=await J({fsp:s,dotgit:r});return await tl({fs:s,cache:i,gitdir:a,oid:n})}catch(s){throw s.caller="git.readCommit",s}}async function I6({fs:t,cache:e,gitdir:r,ref:n="refs/notes/commits",oid:i}){let s=await z.resolve({gitdir:r,fs:t,ref:n}),{blob:a}=await bA({fs:t,cache:e,gitdir:r,oid:s,filepath:i});return a}async function xA({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n="refs/notes/commits",oid:i,cache:s={}}){try{T("fs",t),T("gitdir",r),T("ref",n),T("oid",i);let a=new Q(t),o=await J({fsp:a,dotgit:r});return await I6({fs:a,cache:s,gitdir:o,ref:n,oid:i})}catch(a){throw a.caller="git.readNote",a}}async function SA({fs:t,dir:e,gitdir:r=D(e,".git"),oid:n,format:i="parsed",filepath:s=void 0,encoding:a=void 0,cache:o={}}){try{T("fs",t),T("gitdir",r),T("oid",n);let l=new Q(t),c=await J({fsp:l,dotgit:r});s!==void 0&&(n=await fu({fs:l,cache:o,gitdir:c,oid:n,filepath:s}));let f=await Xe({fs:l,cache:o,gitdir:c,oid:n,format:i==="parsed"?"content":i});if(f.oid=n,i==="parsed")switch(f.format="parsed",f.type){case"commit":f.object=kr.from(f.object).parse();break;case"tree":f.object=Er.from(f.object).entries();break;case"blob":a?f.object=f.object.toString(a):(f.object=new Uint8Array(f.object),f.format="content");break;case"tag":f.object=Zr.from(f.object).parse();break;default:throw new fr(f.oid,f.type,"blob|commit|tag|tree")}else(f.format==="deflated"||f.format==="wrapped")&&(f.type=f.format);return f}catch(l){throw l.caller="git.readObject",l}}async function F6({fs:t,cache:e,gitdir:r,oid:n}){let{type:i,object:s}=await Xe({fs:t,cache:e,gitdir:r,oid:n,format:"content"});if(i!=="tag")throw new fr(n,i,"tag");let a=Zr.from(s);return{oid:n,tag:a.parse(),payload:a.payload()}}async function EA({fs:t,dir:e,gitdir:r=D(e,".git"),oid:n,cache:i={}}){try{T("fs",t),T("gitdir",r),T("oid",n);let s=new Q(t),a=await J({fsp:s,dotgit:r});return await F6({fs:s,cache:i,gitdir:a,oid:n})}catch(s){throw s.caller="git.readTag",s}}async function kA({fs:t,dir:e,gitdir:r=D(e,".git"),oid:n,filepath:i=void 0,cache:s={}}){try{T("fs",t),T("gitdir",r),T("oid",n);let a=new Q(t),o=await J({fsp:a,dotgit:r});return await al({fs:a,cache:s,gitdir:o,oid:n,filepath:i})}catch(a){throw a.caller="git.readTree",a}}async function AA({fs:t,dir:e,gitdir:r=D(e,".git"),filepath:n,cache:i={}}){try{T("fs",t),T("gitdir",r),T("filepath",n);let s=new Q(t),a=await J({fsp:s,dotgit:r});await ht.acquire({fs:s,gitdir:a,cache:i},async function(o){o.delete({filepath:n})})}catch(s){throw s.caller="git.remove",s}}async function O6({fs:t,cache:e,onSign:r,gitdir:n,ref:i="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l}){let c;try{c=await z.resolve({gitdir:n,fs:t,ref:i})}catch(m){if(!(m instanceof Be))throw m}let f=(await al({fs:t,cache:e,gitdir:n,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(m=>m.path!==s);let d=await du({fs:t,gitdir:n,tree:f});return await Hd({fs:t,cache:e,onSign:r,gitdir:n,ref:i,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
`,author:a,committer:o,signingKey:l})}async function CA({fs:t,onSign:e,dir:r,gitdir:n=D(r,".git"),ref:i="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l,cache:c={}}){try{T("fs",t),T("gitdir",n),T("oid",s);let u=new Q(t),f=await J({fsp:u,dotgit:n}),d=await Ms({fs:u,gitdir:f,author:a});if(!d)throw new Kt("author");let h=await el({fs:u,gitdir:f,author:d,committer:o});if(!h)throw new Kt("committer");return await O6({fs:u,cache:c,onSign:e,gitdir:f,ref:i,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function M6({fs:t,gitdir:e,oldref:r,ref:n,checkout:i=!1}){if(!uu(n,!0))throw new Dn(n,zc.clean(n));if(!uu(r,!0))throw new Dn(r,zc.clean(r));let s=`refs/heads/${r}`,a=`refs/heads/${n}`;if(await z.exists({fs:t,gitdir:e,ref:a}))throw new Mn("branch",n,!1);let l=await z.resolve({fs:t,gitdir:e,ref:s,depth:1});await z.writeRef({fs:t,gitdir:e,ref:a,value:l}),await z.deleteRef({fs:t,gitdir:e,ref:s});let u=await Ls({fs:t,gitdir:e,fullname:!0})===s;(i||u)&&await z.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function TA({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n,oldref:i,checkout:s=!1}){try{T("fs",t),T("gitdir",r),T("ref",n),T("oldref",i);let a=new Q(t),o=await J({fsp:a,dotgit:r});return await M6({fs:a,gitdir:o,ref:n,oldref:i,checkout:s})}catch(a){throw a.caller="git.renameBranch",a}}async function PA({gitdir:t,type:e,object:r}){return zi($s.wrap({type:e,object:r}))}async function RA({fs:t,dir:e,gitdir:r=D(e,".git"),filepath:n,ref:i,cache:s={}}){try{T("fs",t),T("gitdir",r),T("filepath",n);let a=new Q(t),o=await J({fsp:a,dotgit:r}),l,c;try{l=await z.resolve({fs:a,gitdir:o,ref:i||"HEAD"})}catch(d){if(i)throw d}if(l)try{l=await fu({fs:a,cache:s,gitdir:o,oid:l,filepath:n})}catch(d){l=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},f=e&&await a.read(D(e,n));f&&(c=await PA({gitdir:o,type:"blob",object:f}),l===c&&(u=await a.lstat(D(e,n)))),await ht.acquire({fs:a,gitdir:o,cache:s},async function(d){d.delete({filepath:n}),l&&d.insert({filepath:n,stats:u,oid:l})})}catch(a){throw a.caller="git.reset",a}}async function $A({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n,depth:i}){try{T("fs",t),T("gitdir",r),T("ref",n);let s=new Q(t),a=await J({fsp:s,dotgit:r});return await z.resolve({fs:s,gitdir:a,ref:n,depth:i})}catch(s){throw s.caller="git.resolveRef",s}}async function IA({fs:t,dir:e,gitdir:r=D(e,".git"),path:n,value:i,append:s=!1}){try{T("fs",t),T("gitdir",r),T("path",n);let a=new Q(t),o=await J({fsp:a,dotgit:r}),l=await lt.get({fs:a,gitdir:o});s?await l.append(n,i):await l.set(n,i),await lt.save({fs:a,gitdir:o,config:l})}catch(a){throw a.caller="git.setConfig",a}}async function FA({fs:t,gitdir:e,commit:r}){let n=kr.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"commit",object:n,format:"content"})}var Ld=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),n=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${n}`}static createStashReflogEntry(e,r,n){let i=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${s} ${r} ${i} ${e.email} ${a} ${o} ${n}
`}static getStashReflogEntry(e,r=!1){return e.split(`
`).filter(s=>s).reverse().map((s,a)=>r?`stash@{${a}}: ${s.split(" ")[1]}`:s)}},D6={stage:Ca,workdir:sl},cv;async function il(t,e){return cv===void 0&&(cv=new Wc),cv.acquire(t,e)}async function L6(t,e,r,n,i=null){let s=D(r,n),a=await t.lstat(s);if(!a)throw new Be(s);if(a.isDirectory())throw new he(`${s}: file expected, but found directory`);let o=i?await lk({fs:t,gitdir:e,oid:i}):void 0,l=o?i:void 0;return o||await il({fs:t,gitdir:e,currentFilepath:s},async()=>{let c=a.isSymbolicLink()?await t.readlink(s).then(mk):await t.read(s);if(c===null)throw new Be(s);l=await Ar({fs:t,gitdir:e,type:"blob",object:c})}),l}async function N6({fs:t,dir:e,gitdir:r,entries:n}){async function i(s){if(s.type==="tree"){if(!s.oid){let a=await Promise.all(s.children.map(i));s.oid=await du({fs:t,gitdir:r,tree:a}),s.mode=16384}}else s.type==="blob"&&(s.oid=await L6(t,r,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(n.map(i))}async function tk({fs:t,dir:e,gitdir:r,treePair:n}){let i=n[1]==="stage",s=n.map(h=>typeof h=="string"?D6[h]():h),a=[],u=await Fs({fs:t,cache:{},dir:e,gitdir:r,trees:s,map:async(h,[m,g])=>{if(!(h==="."||await Os.isIgnored({fs:t,dir:e,gitdir:r,filepath:h}))&&g)return(!m||await m.oid()!==await g.oid()&&await g.oid()!==void 0)&&a.push([m,g]),{mode:await g.mode(),path:h,oid:await g.oid(),type:await g.type()}},reduce:async(h,m)=>(m=m.filter(Boolean),h?(h.children=m,h):m.length>0?m:void 0),iterate:async(h,m)=>{let g=[];for(let v of m){let[w,b]=v;i?b&&(await t.exists(`${e}/${b.toString()}`)?g.push(v):a.push([null,b])):w&&(b?g.push(v):a.push([w,null]))}return g.length?Promise.all(g.map(h)):[]}});if(a.length===0||u.length===0)return null;let d=(await N6({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return du({fs:t,gitdir:r,tree:d})}async function B6({fs:t,dir:e,gitdir:r,stashCommit:n,parentCommit:i,wasStaged:s}){let a=[],o=[],l=await Fs({fs:t,cache:{},dir:e,gitdir:r,trees:[Xr({ref:i}),Xr({ref:n})],map:async(c,[u,f])=>{if(c==="."||await Os.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=f?await f.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!f&&u){let m=d==="tree"?"rmdir":"rm";return d==="tree"&&a.push(c),d==="blob"&&s&&o.push({filepath:c,oid:await u.oid()}),{method:m,filepath:c}}let h=await f.oid();if(!u||await u.oid()!==h)return d==="tree"?{method:"mkdir",filepath:c}:(s&&o.push({filepath:c,oid:h,stats:await t.lstat(D(e,c))}),{method:"write",filepath:c,oid:h})}});await il({fs:t,gitdir:r,dirRemoved:a,ops:l},async()=>{for(let c of l){let u=D(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!a.some(f=>u.startsWith(f))){let{object:f}=await Xe({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,f)}break}}}),await ht.acquire({fs:t,gitdir:r,cache:{}},async c=>{o.forEach(({filepath:u,stats:f,oid:d})=>{c.insert({filepath:u,stats:f,oid:d})})})}var Aa=class t{constructor({fs:e,dir:r,gitdir:n=D(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:n,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return D(this.gitdir,t.refStash)}get refLogsStashPath(){return D(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await Ms({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Kt("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:n}){return FA({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:n,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Dn(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let n=await this.getStashSHA(e,r);return n?tl({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(e){return z.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let n=await this.getAuthor(),i=Ld.createStashReflogEntry(n,e,r),s=this.refLogsStashPath;await il({filepath:s,entry:i},async()=>{let a=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,a+i,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return Ld.getStashReflogEntry(r,e)}};async function OA({fs:t,dir:e,gitdir:r,message:n=""}){let i=new Aa({fs:t,dir:e,gitdir:r});await i.getAuthor();let s=await Ls({fs:t,gitdir:r,fullname:!1}),a=await z.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await Tv({fs:t,dir:e,gitdir:r,oid:a})).commit.message,c=[a],u=null,f=Xr({ref:"HEAD"}),d=await tk({fs:t,dir:e,gitdir Line truncated
`)+`
`,"utf8");let c=o[o.length-1].split(" ")[1];await i.writeStashRef(c)}else await t.rm(l)})}async function G6({fs:t,dir:e,gitdir:r}){return new Aa({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function j6({fs:t,dir:e,gitdir:r}){let n=new Aa({fs:t,dir:e,gitdir:r}),i=[n.refStashPath,n.refLogsStashPath];await il(i,async()=>{await Promise.all(i.map(async s=>{if(await t.exists(s))return t.rm(s)}))})}async function q6({fs:t,dir:e,gitdir:r,refIdx:n=0}){await MA({fs:t,dir:e,gitdir:r,refIdx:n}),await DA({fs:t,dir:e,gitdir:r,refIdx:n})}async function LA({fs:t,dir:e,gitdir:r=D(e,".git"),op:n="push",message:i="",refIdx:s=0}){T("fs",t),T("dir",e),T("gitdir",r),T("op",n);let a={push:H6,apply:MA,drop:DA,list:G6,clear:j6,pop:q6,create:U6},o=["apply","drop","pop"];try{let l=new Q(t),c=await J({fsp:l,dotgit:r});["refs","logs","logs/refs"].map(d=>D(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=a[n];if(f){if(o.includes(n)&&s<0)throw new Dn(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:i,refIdx:s})}throw new Error(`To be implemented: ${n}`)}catch(l){throw l.caller="git.stash",l}}async function NA({fs:t,dir:e,gitdir:r=D(e,".git"),filepath:n,cache:i={}}){try{T("fs",t),T("gitdir",r),T("filepath",n);let s=new Q(t),a=await J({fsp:s,dotgit:r});if(await Os.isIgnored({fs:s,gitdir:a,dir:e,filepath:n}))return"ignored";let l=await W6({fs:s,cache:i,gitdir:a}),c=await BA({fs:s,cache:i,gitdir:a,tree:l,path:n}),u=await ht.acquire({fs:s,gitdir:a,cache:i},async function(v){for(let w of v)if(w.path===n)return w;return null}),f=await s.lstat(D(e,n)),d=c!==null,h=u!==null,m=f!==null,g=async()=>{if(h&&!Td(u,f))return u.oid;{let v=await s.read(D(e,n)),w=await PA({gitdir:a,type:"blob",object:v});return h&&u.oid===w&&f.size!==-1&&ht.acquire({fs:s,gitdir:a,cache:i},async function(b){b.insert({filepath:n,stats:f,oid:w})}),w}};if(!d&&!m&&!h)return"absent";if(!d&&!m&&h)return"*absent";if(!d&&m&&!h)return"*added";if(!d&&m&&h)return await g()===u.oid?"added":"*added";if(d&&!m&&!h)return"deleted";if(d&&!m&&h)return c===u.oid,"*deleted";if(d&&m&&!h)return await g()===c?"*undeleted":"*undeletemodified";if(d&&m&&h){let v=await g();return v===c?v===u.oid?"unmodified":"*unmodified":v===u.oid?"modified":"*modified"}}catch(s){throw s.caller="git.status",s}}async function BA({fs:t,cache:e,gitdir:r,tree:n,path:i}){typeof i=="string"&&(i=i.split("/"));let s=i.shift();for(let a of n)if(a.path===s){if(i.length===0)return a.oid;let{type:o,object:l}=await Xe({fs:t,cache:e,gitdir:r,oid:a.oid});if(o==="tree"){let c=Er.from(l);return BA({fs:t,cache:e,gitdir:r,tree:c,path:i})}if(o==="blob")throw new fr(a.oid,o,"blob",i.join("/"))}return null}async function W6({fs:t,cache:e,gitdir:r}){let n;try{n=await z.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(s){if(s instanceof Be)return[]}let{tree:i}=await al({fs:t,cache:e,gitdir:r,oid:n});return i}async function HA({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n="HEAD",filepaths:i=["."],filter:s,cache:a={},ignored:o=!1}){try{T("fs",t),T("gitdir",r),T("ref",n);let l=new Q(t),c=await J({fsp:l,dotgit:r});return await Fs({fs:l,cache:a,dir:e,gitdir:c,trees:[Xr({ref:n}),sl(),Ca()],map:async function(u,[f,d,h]){if(!f&&!h&&d&&!o&&await Os.isIgnored({fs:l,dir:e,filepath:u})||!i.some(y=>Ak(u,y)))return null;if(s&&!s(u))return;let[m,g,v]=await Promise.all([f&&f.type(),d&&d.type(),h&&h.type()]),w=[m,g,v].includes("blob");if((m==="tree"||m==="special")&&!w)return;if(m==="commit")return null;if((g==="tree"||g==="special")&&!w)return;if(v==="commit")return null;if((v==="tree"||v==="special")&&!w)return;let b=m==="blob"?await f.oid():void 0,k=v==="blob"?await h.oid():void 0,x;m!=="blob"&&g==="blob"&&v!=="blob"?x="42":g==="blob"&&(x=await d.oid());let E=[void 0,b,x,k],A=E.map(y=>E.indexOf(y));return A.shift(),[u,...A]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function UA({fs:t,dir:e,gitdir:r=D(e,".git"),ref:n,object:i,force:s=!1}){try{T("fs",t),T("gitdir",r),T("ref",n);let a=new Q(t);if(n===void 0)throw new Sr("ref");n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`;let o=await J({fsp:a,dotgit:r}),l=await z.resolve({fs:a,gitdir:o,ref:i||"HEAD"});if(!s&&await z.exists({fs:a,gitdir:o,ref:n}))throw new Mn("tag",n);await z.writeRef({fs:a,gitdir:o,ref:n,value:l})}catch(a){throw a.caller="git.tag",a}}async function GA({fs:t,dir:e,gitdir:r=D(e,".git"),cache:n={},filepath:i,oid:s,mode:a,add:o,remove:l,force:c}){try{T("fs",t),T("gitdir",r),T("filepath",i);let u=new Q(t),f=await J({fsp:u,dotgit:r});if(l)return await ht.acquire({fs:u,gitdir:f,cache:n},async function(h){if(!c){let m=await u.lstat(D(e,i));if(m){if(m.isDirectory())throw new Is("directory");return}}h.has({filepath:i})&&h.delete({filepath:i})});let d;if(!s){if(d=await u.lstat(D(e,i)),!d)throw new Be(`file at "${i}" on disk and "remove" not set`);if(d.isDirectory())throw new Is("directory")}return await ht.acquire({fs:u,gitdir:f,cache:n},async function(h){if(!o&&!h.has({filepath:i}))throw new Be(`file at Line truncated
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a5(t,e){if(t){if(typeof t=="string")return hC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hC(t,e)}}function hC(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function o5(t,e){if(!(typeof Symbol=="undefined"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,i=!1,s=void 0;try{for(var a=t[Symbol.iterator](),o;!(n=(o=a.next()).done)&&(r.push(o.value),!(e&&r.length===e));n=!0);}catch(l){i=!0,s=l}finally{try{!n&&a.return!=null&&a.return()}finally{if(i)throw s}}return r}}function l5(t){if(Array.isArray(t))return t}var mC=/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?$/,gC=/^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])?$/,vC=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,wC=/^rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,yC=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,bC=/^rgba?\(\s*(\d+%)\s+(\d+%)\s+(\d+%)(?:\s*\/\s*(0|1|0?\.\d+|\d+%))?\s*\)$/,_C=/^hsla?\(\s*(\d+)(deg|rad|grad|turn)?\s*,\s*(\d+)%\s*,\s*(\d+)%(?:\s*,\s*(0|1|0?\.\d+|\d+%))?\s*\)$/;function gu(t,e){return t.indexOf(e)>-1}function c5(t,e,r){var n=t/255,i=e/255,s=r/255,a=Math.max(n,i,s),o=Math.min(n,i,s),l=a-o,c=(a+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=function(){switch(a){case n:return(i-s)/l%6;case i:return(s-n)/l+2;default:return(n-i)/l+4}}();return[f*60,u*100,c*100]}function u5(t,e,r){var n=t/60,i=e/100,s=r/100,a=(1-Math.abs(2*s-1))*i,o=a*(1-Math.abs(n%2-1)),l=s-a/2,c=function(){return n<1?[a,o,0]:n<2?[o,a,0]:n<3?[0,a,o]:n<4?[0,o,a]:n<5?[o,0,a]:[a,0,o]}(),u=dr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var f5=function(){function t(e){var r=dr(e,4),n=r[0],i=r[1],s=r[2],a=r[3];n5(this,t),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(s,10),255),0),a==null?1:Math.max(Math.min(parseFloat(a),255),0)]}return i5(t,[{key:"toRgbString",value:function(){var r=dr(this.values,4),n=r[0],i=r[1],s=r[2],a=r[3];return a===1?"rgb(".concat(n,", ").concat(i,", ").concat(s,")"):"rgba(".concat(n,", ").concat(i,", ").concat(s,", ").concat(a,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),n=dr(r,4),i=n[0],s=n[1],a=n[2],o=n[3];return o===1?"hsl(".concat(i,", ").concat(s,"%, ").concat(a,"%)"):"hsla(".concat(i,", ").concat(s,"%, ").concat(a,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=dr(this.values,4),n=r[0],i=r[1],s=r[2],a=r[3];return n=Number(n).toString(16).padStart(2,"0"),i=Number(i).toString(16).padStart(2,"0"),s=Number(s).toString(16).padStart(2,"0"),a=a<1?parseInt(a*255,10).toString(16).padStart(2,"0"):"","#".concat(n).concat(i).concat(s).concat(a)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=dr(this.values,4),n=r[0],i=r[1],s=r[2],a=r[3],o=c5(n,i,s),l=dr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,a]}}]),t}();function fl(t){var e=dr(t,4),r=e[0],n=e[1],i=e[2],s=e[3];return new f5([r,n,i,s])}function qv(t){var e=dr(t,3),r=e[0],n=e[1],i=e[2];return fl([r,n,i,1])}function Kd(t){var e=dr(t,4),r=e[0],n=e[1],i=e[2],s=e[3],a=u5(r,n,i),o=dr(a,3),l=o[0],c=o[1],u=o[2];return fl([l,c,u,s])}function xC(t){var e=dr(t,3),r=e[0],n=e[1],i=e[2];return Kd([r,n,i,1])}function d5(t){var e=mC.exec(t)||gC.exec(t),r=dr(e,5),n=r[1],i=r[2],s=r[3],a=r[4];return n=parseInt(n.length<2?n.repeat(2):n,16),i=parseInt(i.length<2?i.repeat(2):i,16),s=parseInt(s.length<2?s.repeat(2):s,16),a=a&&(parseInt(a.length<2?a.repeat(2):a,16)/255).toPrecision(1)||1,fl([n,i,s,a])}function h5(t){var e=vC.exec(t)||yC.exec(t)||wC.exec(t)||bC.exec(t),r=dr(e,5),n=r[1],i=r[2],s=r[3],a=r[4];return n=gu(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),i=gu(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),s=gu(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),a=a===void 0?1:parseFloat(a)/(gu(a,"%")?100:1),fl([n,i,s,a])}function p5(t){var e=_C.exec(t),r=dr(e,6),n=r[1],i=r[2],s=r[3],a=r[4],o=r[5];return i=i||"deg",n=(0,r5.default)(parseFloat(n),i,"deg"),s=parseFloat(s),a=parseFloat(a),o=o===void 0?1:parseFloat(o)/(gu(o,"%")?100:1),Kd([n,s,a,o])}function SC(t){return fC.default[t]?qv(fC.default[t]):mC.test(t)||gC.test(t)?d5(t):vC.test(t)||yC.test(t)||wC.test(t)||bC.test(t)?h5(t):_C.test(t)?p5(t):null}var m5={fromString:SC,fromRgb:qv,fromRgba:fl,fromHsl:xC,fromHsla:Kd};Yi.default=m5});var Wv=I((OK,AC)=>{"use strict";p();var kC=Object.prototype.toString;AC.exports=function(e){var r=kC.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&kC.call(e.callee)==="[object Function]"),n}});var MC=I((DK,OC)=>{" Line truncated
`)>=0)return!1;return!0}function FU(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=pi.call(Array(t.indent+1)," ");else return null;return{base:r,prev:pi.call(Array(e+1),r)}}function uw(t,e){if(t.length===0)return"";var r=`
`+e.prev+e.base;return r+pi.call(t,","+r)+`
`+e.prev}function nh(t,e){var r=cw(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=Xi(t,i)?e(t[i],t):""}var s=typeof iw=="function"?iw(t):[],a;if(dl){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var l in t)Xi(t,l)&&(r&&String(Number(l))===l&&l<t.length||dl&&a["$"+l]instanceof Symbol||(IT.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof iw=="function")for(var c=0;c<s.length;c++)FT.call(t,s[c])&&n.push("["+e(s[c])+"]: "+e(t[s[c]],t));return n}});var UT=I((vQ,HT)=>{"use strict";p();var OU=ku(),MU=_r(),ah=function(t,e,r){for(var n=t,i;(i=n.next)!=null;n=i)if(i.key===e)return n.next=i.next,r||(i.next=t.next,t.next=i),i},DU=function(t,e){if(t){var r=ah(t,e);return r&&r.value}},LU=function(t,e,r){var n=ah(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},NU=function(t,e){return t?!!ah(t,e):!1},BU=function(t,e){if(t)return ah(t,e,!0)};HT.exports=function(){var e,r={assert:function(n){if(!r.has(n))throw new MU("Side channel does not contain "+OU(n))},delete:function(n){var i=e&&e.next,s=BU(e,n);return s&&i&&i===s&&(e=void 0),!!s},get:function(n){return DU(e,n)},has:function(n){return NU(e,n)},set:function(n,i){e||(e={next:void 0}),LU(e,n,i)}};return r}});var pw=I((yQ,jT)=>{"use strict";p();var HU=si(),Au=Lt(),UU=ku(),GU=_r(),GT=HU("%Map%",!0),jU=Au("Map.prototype.get",!0),qU=Au("Map.prototype.set",!0),WU=Au("Map.prototype.has",!0),zU=Au("Map.prototype.delete",!0),VU=Au("Map.prototype.size",!0);jT.exports=!!GT&&function(){var e,r={assert:function(n){if(!r.has(n))throw new GU("Side channel does not contain "+UU(n))},delete:function(n){if(e){var i=zU(e,n);return VU(e)===0&&(e=void 0),i}return!1},get:function(n){if(e)return jU(e,n)},has:function(n){return e?WU(e,n):!1},set:function(n,i){e||(e=new GT),qU(e,n,i)}};return r}});var WT=I((_Q,qT)=>{"use strict";p();var YU=si(),lh=Lt(),XU=ku(),oh=pw(),ZU=_r(),hl=YU("%WeakMap%",!0),KU=lh("WeakMap.prototype.get",!0),QU=lh("WeakMap.prototype.set",!0),JU=lh("WeakMap.prototype.has",!0),e4=lh("WeakMap.prototype.delete",!0);qT.exports=hl?function(){var e,r,n={assert:function(i){if(!n.has(i))throw new ZU("Side channel does not contain "+XU(i))},delete:function(i){if(hl&&i&&(typeof i=="object"||typeof i=="function")){if(e)return e4(e,i)}else if(oh&&r)return r.delete(i);return!1},get:function(i){return hl&&i&&(typeof i=="object"||typeof i=="function")&&e?KU(e,i):r&&r.get(i)},has:function(i){return hl&&i&&(typeof i=="object"||typeof i=="function")&&e?JU(e,i):!!r&&r.has(i)},set:function(i,s){hl&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new hl),QU(e,i,s)):oh&&(r||(r=oh()),r.set(i,s))}};return n}:oh});var mw=I((SQ,zT)=>{"use strict";p();var t4=_r(),r4=ku(),n4=UT(),i4=pw(),s4=WT(),a4=s4||i4||n4;zT.exports=function(){var e,r={assert:function(n){if(!r.has(n))throw new t4("Side channel does not contain "+r4(n))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,i){e||(e=a4()),e.set(n,i)}};return r}});var YT=I((kQ,VT)=>{"use strict";p();var o4=Yf(),Cu=mw()(),Zi=_r(),gw={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Zi("`O` is not an object");if(typeof e!="string")throw new Zi("`slot` must be a string");if(Cu.assert(t),!gw.has(t,e))throw new Zi("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Zi("`O` is not an object");if(typeof e!="string")throw new Zi("`slot` must be a string");var r=Cu.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Zi("`O` is not an object");if(typeof e!="string")throw new Zi("`slot` must be a string");var r=Cu.get(t);return!!r&&o4(r,"$"+e)},set:function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Zi("`O` is not an object");if(typeof e!="string")throw new Zi("`slot` must be a string");var n=Cu.get(t);n||(n={},Cu.set(t,n)),n["$"+e]=r}};Object.freeze&&Object.freeze(gw);VT.exports=gw});var KT=I((CQ,ZT)=>{"use strict";p();var Tu=YT(),l4=Hf(),XT=typeof StopIteration=="object"?StopIteration:null;ZT.exports=function(e){if(!XT)throw new l4("this environment lacks StopIteration");Tu.set(e,"[[Done]]",!1);var r={next:function(){var i=Tu.get(this,"[[Iterator]]"),s=!!Tu.get(i,"[[Done]]");try{return{done:s,value:s?void 0:i.next()}}catch(a){if(Tu.set(i,"[[Done]]",!0),a!==XT)throw a;return{done:!0,value:void 0}}}};return Tu.set(r,"[[Iterator]]",e),r}});var vw=I((PQ,JT)=>{"use strict";p();var QT=Lt(),c4=QT("String.prototype.valueOf"),u4=function(e){try{return c4(e),!0}catch(r){return!1}},f4=QT("Object.prototype.toString"),d4="[object String]",h4=_s()();JT.exports=function(e){return typeof e=="string"?!0:!e||typeof e!="object"?!1:h4?u4(e):f4(e)===d4}});var yw=I(($Q,r2)=>{"use strict";p();var ww=typeof Map=="function"&&Map.prototype?Map:null,p4=typeof Set=="function"&&Set.prototype?Set:null,ch;ww||(ch=function(e){return!1});var t2=ww?Map.prototype.has:null,e2=p4?Set.prototyp Line truncated
`});xe=!1,W=ie.length}function Ie(kt,At){var je="="+q,Z=kt.indexOf(je,At),M=c(kt.substring(kt.indexOf("=",At)+1,Z)).split(" ");return X=M[0],q=M[M.length-1],Z+je.length-1}for(_&&(_=_.split(" "),X=_[0],q=_[1]),we=0;we<C;we++)H==P?u(X,S,we)?(--we,De(),H=N):S.charAt(we)==`
`?Ft(xe):ve+=S.charAt(we):H==N?(we+=X.length-1,Pe=t.tags[S.charAt(we+1)],ce=Pe?S.charAt(we+1):"_v",ce=="="?(we=Ie(S,we),H=P):(Pe&&we++,H=B),xe=we):u(q,S,we)?(ie.push({tag:ce,n:c(ve),otag:X,ctag:q,i:ce=="/"?xe-X.length:we+q.length}),ve="",we+=q.length-1,H=P,ce=="{"&&(q=="}}"?we++:l(ie[ie.length-1]))):ve+=S.charAt(we);return Ft(xe,!0),ie};function l(y){y.n.substr(y.n.length-1)==="}"&&(y.n=y.n.substring(0,y.n.length-1))}function c(y){return y.trim?y.trim():y.replace(/^\s*|\s*$/g,"")}function u(y,S,_){if(S.charAt(_)!=y.charAt(0))return!1;for(var C=1,P=y.length;C<P;C++)if(S.charAt(_+C)!=y.charAt(C))return!1;return!0}var f={_t:!0,"\n":!0,$:!0,"/":!0};function d(y,S,_,C){var P=[],N=null,B=null,H=null;for(B=_[_.length-1];y.length>0;){if(H=y.shift(),B&&B.tag=="<"&&!(H.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[H.tag]<=t.tags.$||h(H,C))_.push(H),H.nodes=d(y,H.tag,_,C);else if(H.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+H.n);if(N=_.pop(),H.n!=N.n&&!m(H.n,N.n,C))throw new Error("Nesting error: "+N.n+" vs. "+H.n);return N.end=H.i,P}else H.tag==`
`&&(H.last=y.length==0||y[0].tag==`
`);P.push(H)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return P}function h(y,S){for(var _=0,C=S.length;_<C;_++)if(S[_].o==y.n)return y.tag="#",!0}function m(y,S,_){for(var C=0,P=_.length;C<P;C++)if(_[C].c==y&&_[C].o==S)return!0}function g(y){var S=[];for(var _ in y)S.push('"'+b(_)+'": function(c,p,t,i) {'+y[_]+"}");return"{ "+S.join(",")+" }"}function v(y){var S=[];for(var _ in y.partials)S.push('"'+b(_)+'":{name:"'+b(y.partials[_].name)+'", '+v(y.partials[_])+"}");return"partials: {"+S.join(",")+"}, subs: "+g(y.subs)}t.stringify=function(y,S,_){return"{code: function (c,p,i) { "+t.wrapMain(y.code)+" },"+v(y)+"}"};var w=0;t.generate=function(y,S,_){w=0;var C={code:"",subs:{},partials:{}};return t.walk(y,C),_.asString?this.stringify(C,S,_):this.makeTemplate(C,S,_)},t.wrapMain=function(y){return'var t=this;t.b(i=i||"");'+y+"return t.fl();"},t.template=t.Template,t.makeTemplate=function(y,S,_){var C=this.makePartials(y);return C.code=new Function("c","p","i",this.wrapMain(y.code)),new this.template(C,S,this,_)},t.makePartials=function(y){var S,_={subs:{},partials:y.partials,name:y.name};for(S in _.partials)_.partials[S]=this.makePartials(_.partials[S]);for(S in y.subs)_.subs[S]=new Function("c","p","t","i",y.subs[S]);return _};function b(y){return y.replace(s,"\\\\").replace(r,'\\"').replace(n,"\\n").replace(i,"\\r").replace(a,"\\u2028").replace(o,"\\u2029")}function k(y){return~y.indexOf(".")?"d":"f"}function x(y,S){var _="<"+(S.prefix||""),C=_+y.n+w++;return S.partials[C]={name:y.n,partials:{}},S.code+='t.b(t.rp("'+b(C)+'",c,p,"'+(y.indent||"")+'"));',C}t.codegen={"#":function(y,S){S.code+="if(t.s(t."+k(y.n)+'("'+b(y.n)+'",c,p,1),c,p,0,'+y.i+","+y.end+',"'+y.otag+" "+y.ctag+'")){t.rs(c,p,function(c,p,t){',t.walk(y.nodes,S),S.code+="});c.pop();}"},"^":function(y,S){S.code+="if(!t.s(t."+k(y.n)+'("'+b(y.n)+'",c,p,1),c,p,1,0,0,"")){',t.walk(y.nodes,S),S.code+="};"},">":x,"<":function(y,S){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(y.nodes,_);var C=S.partials[x(y,S)];C.subs=_.subs,C.partials=_.partials},$:function(y,S){var _={subs:{},code:"",partials:S.partials,prefix:y.n};t.walk(y.nodes,_),S.subs[y.n]=_.code,S.inPartial||(S.code+='t.sub("'+b(y.n)+'",c,p,i);')},"\n":function(y,S){S.code+=A('"\\n"'+(y.last?"":" + i"))},_v:function(y,S){S.code+="t.b(t.v(t."+k(y.n)+'("'+b(y.n)+'",c,p,0)));'},_t:function(y,S){S.code+=A('"'+b(y.text)+'"')},"{":E,"&":E};function E(y,S){S.code+="t.b(t.t(t."+k(y.n)+'("'+b(y.n)+'",c,p,0)));'}function A(y){return"t.b("+y+");"}t.walk=function(y,S){for(var _,C=0,P=y.length;C<P;C++)_=t.codegen[y[C].tag],_&&_(y[C],S);return S},t.parse=function(y,S,_){return _=_||{},d(y,"",[],_.sectionTags||[])},t.cache={},t.cacheKey=function(y,S){return[y,!!S.asString,!!S.disableLambda,S.delimiters,!!S.modelGet].join("||")},t.compile=function(y,S){S=S||{};var _=t.cacheKey(y,S),C=this.cache[_];if(C){var P=C.partials;for(var N in P)delete P[N].instance;return C}return C=this.generate(this.parse(this.scan(y,S.delimiters),y,S),y,S),this.cache[_]=C}})(typeof Ay!="undefined"?Ay:Hogan)});var MO=I(Cy=>{p();var PV={};(function(t){t.Template=function(d,h,m,g){d=d||{},this.r=d.code||this.r,this.c=m,this.options=g||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},t.Template.prototype={r:function(d,h,m){return""},v:u,t:c,render:function(h,m,g){return this.ri([h],m||{},g)},ri:function(d,h,m){return this.r(d,h,m)},ep:function(d,h){var m=this.partials[d],g=h[m.name];if(m.instance&&m.base==g)return m.instance;if(typeof g=="string"){if(!this.c)throw new Error("No compiler available.");g=this.c.compile(g,this.options)}if(!g)return null;if(this.partials[d].base=g,m.subs){h.stackText||(h.stackText={});for(key in m.subs)h.stackText[key]||(h.stackText[key]=this.activeSub!==void 0&&h.stackText[this.activeSub]?h.stackText[this.activeSub]:this.text);g=r(g,m.subs,m.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=g,g},rp:function(d,h,m,g){var v=this.ep(d,m);return v?v.ri(h,m,g):""},rs:function(d,h,m){var g=d[d.length-1];if(!f(g)){m(d,h,this);return}for(var v=0;v<g.length;v++)d.push(g[v]),m(d,h,this),d.pop()},s:function(d,h,m,g,v,w,b){var k;return f(d)&&d.length===0?!1:(typeof d=="function"&&(d=this.ms(d,h,m,g,v,w,b)),k=!!d,!g&&k&&h&&h.push(typeof d=="object"?d:h[h.length-1]),k)},d:function(d,h,m,g){var v,w=d.split("."),b=this.f(w[0],h,m,g),k=this.options.modelGet,x=null;if(d==="."&&f(h[h.length-2]))b=h[h.length-1];else for(var E=1;E<w.length;E++)v=e(w[E],b,k),v!==void 0?(x=b,b=v):b="";return g&&!b?!1:(!g&&typeof b=="function"&&(h.push(x),b=this.mv(b,h,m),h.pop()),b)},f:function(d,h,m,g){for(var v=!1,w=null,b=!1,k=this.options.modelGet,x=h.length-1;x>=0;x--)if(w=h[x],v=e(d,w,k),v!==void 0){b=!0;break}return b?(!g&&typeof v=="function"&&(v=this.mv(v,h,m)),v):g?!1:""},ls:function(d,h,m,g,v,w){var b=this.options.delimiters;return this.options.delimiters=w,this.b(this.ct(c(d.call(h,v,m)),h,g)),this.options.delimiters=b,!1},ct:functio 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"
`,JA=["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"];p();p();p();var hi=class{diff(e,r,n={}){let i;typeof n=="function"?(i=n,n={}):"callback"in n&&(i=n.callback);let s=this.castInput(e,n),a=this.castInput(r,n),o=this.removeEmpty(this.tokenize(s,n)),l=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,l,n,i)}diffWithOptionsObj(e,r,n,i){var s;let a=b=>{if(b=this.postProcess(b,n),i){setTimeout(function(){i(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));let f=(s=n.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(h[0],r,e,0,n);if(h[0].oldPos+1>=l&&m+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,v=1/0,w=()=>{for(let b=Math.max(g,-c);b<=Math.min(v,c);b+=2){let k,x=h[b-1],E=h[b+1];x&&(h[b-1]=void 0);let A=!1;if(E){let S=E.oldPos-b;A=E&&0<=S&&S<o}let y=x&&x.oldPos+1<l;if(!A&&!y){h[b]=void 0;continue}if(!y||A&&x.oldPos<E.oldPos?k=this.addToPath(E,!0,!1,0,n):k=this.addToPath(x,!1,!0,1,n),m=this.extractCommon(k,r,e,b,n),k.oldPos+1>=l&&m+1>=o)return a(this.buildValues(k.lastComponent,r,e))||!0;h[b]=k,k.oldPos+1>=l&&(v=Math.min(v,b-1)),m+1>=o&&(g=Math.max(g,b+1))}c++};if(i)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return i(void 0);w()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=w();if(b)return b}}addToPath(e,r,n,i,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===n?{oldPos:e.oldPos+i,lastComponent:{count:a.count+1,added:r,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:a}}}extractCommon(e,r,n,i,s){let a=r.length,o=n.length,l=e.oldPos,c=l-i,u=0;for(;c+1<a&&l+1<o&&this.equals(n[l+1],r[c+1],s);)c++,l++,u++,s.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(e.lastComponent={count:u,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c}equals(e,r,n){return n.comparator?n.comparator(e,r):e===r||!!n.ignoreCase&&e.toLowerCase()===r.toLowerCase()}removeEmpty(e){let r=[];for(let n=0;n<e.length;n++)e[n]&&r.push(e[n]);return r}castInput(e,r){return e}tokenize(e,r){return Array.from(e)}join(e){return e.join("")}postProcess(e,r){return e}get useLongestToken(){return!1}buildValues(e,r,n){let i=[],s;for(;e;)i.push(e),s=e.previousComponent,delete e.previousComponent,e=s;i.reverse();let a=i.length,o=0,l=0,c=0;for(;o<a;o++){let u=i[o];if(u.removed)u.value=this.join(n.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let f=r.slice(l,l+u.count);f=f.map(function(d,h){let m=n[c+h];return m.length>d.length?m:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return i}};p();var Iv=class extends hi{},eC=new Iv;function Fv(t,e,r){return eC.diff(t,e,r)}p();p();function Ov(t,e){let r;for(r=0;r<t.length&&r<e.length;r++)if(t[r]!=e[r])return t.slice(0,r);return t.slice(0,r)}function Mv(t,e){let r;if(!t||!e||t[t.length-1]!=e[e.length-1])return"";for(r=0;r<t.length&&r<e.length;r++)if(t[t.length-(r+1)]!=e[e.length-(r+1)])return t.slice(-r);return t.slice(-r)}function Vd(t,e,r){if(t.slice(0,e.length)!=e)throw Error(`string ${JSON.stringify(t)} doesn't start with prefix ${JSON.stringify(e)}; this is Line truncated
`))&&(e=e.trim()),(!n.newlineIsToken||!r.includes(`
`))&&(r=r.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
`)&&(e=e.slice(0,-1)),r.endsWith(`
`)&&(r=r.slice(0,-1))),super.equals(e,r,n)}},K6=new Hv;function Uv(t,e,r){return K6.diff(t,e,r)}function Q6(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,`
`));let r=[],n=t.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let i=0;i<n.length;i++){let s=n[i];i%2&&!e.newlineIsToken?r[r.length-1]+=s:r.push(s)}return r}p();var nC={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Gv(t,e,r,n,i,s,a){let o;a?typeof a=="function"?o={callback:a}:o=a:o={},typeof o.context=="undefined"&&(o.context=4);let l=o.context;if(o.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(o.callback){let{callback:u}=o;Uv(r,n,Object.assign(Object.assign({},o),{callback:f=>{let d=c(f);u(d)}}))}else return c(Uv(r,n,o));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(b){return b.map(function(k){return" "+k})}let d=[],h=0,m=0,g=[],v=1,w=1;for(let b=0;b<u.length;b++){let k=u[b],x=k.lines||J6(k.value);if(k.lines=x,k.added||k.removed){if(!h){let E=u[b-1];h=v,m=w,E&&(g=l>0?f(E.lines.slice(-l)):[],h-=g.length,m-=g.length)}for(let E of x)g.push((k.added?"+":"-")+E);k.added?w+=x.length:v+=x.length}else{if(h)if(x.length<=l*2&&b<u.length-2)for(let E of f(x))g.push(E);else{let E=Math.min(x.length,l);for(let y of f(x.slice(0,E)))g.push(y);let A={oldStart:h,oldLines:v-h+E,newStart:m,newLines:w-m+E,lines:g};d.push(A),h=0,m=0,g=[]}v+=x.length,w+=x.length}}for(let b of d)for(let k=0;k<b.lines.length;k++)b.lines[k].endsWith(`
`)?b.lines[k]=b.lines[k].slice(0,-1):(b.lines.splice(k+1,0,"\\ No newline at end of file"),k++);return{oldFileName:t,newFileName:e,oldHeader:i,newHeader:s,hunks:d}}}function Zd(t,e){if(e||(e=nC),Array.isArray(t)){if(t.length>1&&!e.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(n=>Zd(n,e)).join(`
`)}let r=[];e.includeIndex&&t.oldFileName==t.newFileName&&r.push("Index: "+t.oldFileName),e.includeUnderline&&r.push("==================================================================="),e.includeFileHeaders&&(r.push("--- "+t.oldFileName+(typeof t.oldHeader=="undefined"?"":" "+t.oldHeader)),r.push("+++ "+t.newFileName+(typeof t.newHeader=="undefined"?"":" "+t.newHeader)));for(let n=0;n<t.hunks.length;n++){let i=t.hunks[n];i.oldLines===0&&(i.oldStart-=1),i.newLines===0&&(i.newStart-=1),r.push("@@ -"+i.oldStart+","+i.oldLines+" +"+i.newStart+","+i.newLines+" @@");for(let s of i.lines)r.push(s)}return r.join(`
`)+`
`}function iC(t,e,r,n,i,s,a){if(typeof a=="function"&&(a={callback:a}),a!=null&&a.callback){let{callback:o}=a;Gv(t,e,r,n,i,s,Object.assign(Object.assign({},a),{callback:l=>{o(l?Zd(l,a.headerOptions):void 0)}}))}else{let o=Gv(t,e,r,n,i,s,a);return o?Zd(o,a==null?void 0:a.headerOptions):void 0}}function mu(t,e,r,n,i,s){return iC(t,t,e,r,n,i,s)}function J6(t){let e=t.endsWith(`
`),r=t.split(`
`).map(n=>n+`
`);return e?r.pop():r.push(r.pop().slice(0,-1)),r}var te=Ct(Pv()),Ra=require("obsidian");p();function sC(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var ul=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};p();var aC=require("obsidian"),t5={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},Ze=class extends aC.SuggestModal{constructor(e,r){if(super(e.app),this.config={...t5,...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(e=>{this.resolve=e,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(e=>setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,r){this.config.obscure?r.hide():r.setText(e)}onChooseSuggestion(e,r){if(this.resolve){let n;this.config.allowEmpty&&e===" "?n="":e==="..."?n=void 0:n=e,this.resolve(n)}}};p();var qP=Ct(EC()),WP=require("child_process"),zP=Ct(jP()),Ki=require("obsidian");function Eh(t){throw new Error(`Unexpected object: ${t}`)}function Pu(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var Yw=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function Bn(t,e){let r;if(e){if(e.button===0||e.button===1){let n=Ki.Keymap.isModEvent(e);r=t.workspace.getLeaf(n)}}else r=t.workspace.getLeaf(!1);return r}function gi(t,e,r,n,i){if(e.button==2){let s=t.vault.getAbstractFileByPath(r);if(s!=null){let a=new Ki.Menu;t.workspace.trigger("file-menu",a,s,i,n),a.showAtPosition({x:e.pageX,y:e.pageY})}else{let a=new Ki.Menu;t.workspace.trigger("obsidian-git:menu",a,r,i,n),a.showAtPosition({x:e.pageX,y:e.pageY})}}}function js(t){throw new Error("Impossible branch: "+t)}function Xw(t){return`rgb(${t.r},${t.g},${t.b})`}function VP(t){var s;let e=(s=qP.fromString(t))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[r,n,i]=e;return{r,g:n,b:i}}function YP(t){return t.diff(Ki.moment.unix(0),"seconds")}function XP(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function ZP(t,e){return(0,zP.default)(t,e,{strict:!0})}function Ru(t,e){return new Proxy(t,{get(r,n){return n==="length"?Math.min(e,r.length):r[n]}})}function KP(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function QP(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),n=t.substring(e,t.length);return r+n}function Zw(t,e,r){return t<=e&&e<=r}function Qi(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function vi(t){return t.endsWith("/")?t:t.split("/").last().replace(/\.md$/,"")}function JP(t){return t===1?"1 minute":`${t} minutes`}function yG(t){let e=t.lastIndexOf(".");return t.substring(e+1)}function ml(t){if(t.endsWith(".md"))return!1;let e=yG(t);return JA.includes(e)}function Kw(t){return(t.startsWith("https://github.com/")||t.startsWith("https://gitlab.com/"))&&(t.endsWith(".git")||(t=t+".git")),t}function gl(t,e){let r=e.vault.getAbstractFileByPath(t);if(!(r instanceof Ki.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(r.extension)}catch(n){return!0}}function eR({isFolder:t,gitRelativePath:e}){let r="/";return r+=e,t&&(r+="/"),r.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function vl(t,e,r,n){let i=e.target;t.workspace.trigger("hover-link",{event:e,source:r.getViewType(),hoverParent:r,targetEl:i,linktext:n})}function $u(t,e,r={}){return new Promise((n,i)=>{let s=(0,WP.spawn)(t,e,r),a="",o="";s.stdout.on("data",l=>{a+=l.toString()}),s.stderr.on("data",l=>{o+=l.toString()}),s.on("error",l=>{n({error:new Error(l.message),stdout:a,stderr:a,code:1})}),s.on("close",l=>{n({stdout:a,stderr:o,code:l!=null?l:1,error:void 0})})})}p();var tR=require("os"),kh=require("obsidian"),wl=class{constructor(e){this.plugin=e,this.app=e.app}getRelativeVaultPath(e){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,r=!0){return r&&this.plugin.settings.basePath.length>0?e.substring(this.plugin.settings.basePath.length+1):e}unload(){}_getTreeStructure(e,r=0){let n=[];for(e=[...e];e.length>0;){let i=e.first(),s=i.path.substring(r) Line truncated
`):i="Too many files to list",e=e+`
Affected files:
`+i}return e}};p();var qs=require("obsidian"),Ah=class{constructor(e,r){this.plugin=r;this.promises={};this.adapter=e.adapter,this.vault=e,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(e,r){var n;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let i=this.vault.getAbstractFileByPath(e);return i instanceof qs.TFile?(this.maybeLog("Reuse"),this.vault.read(i)):this.adapter.read(e)}else{if(e.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(n=this.index)!=null?n:this.adapter.readBinary(e);let i=this.vault.getAbstractFileByPath(e);return i instanceof qs.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(i)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let n=this.vault.getAbstractFileByPath(e);return n instanceof qs.TFile?this.vault.modify(n,r):this.adapter.write(e,r)}else if(e.endsWith(this.gitDir+"/index"))this.index=r,this.indexmtime=Date.now();else{let n=this.vault.getAbstractFileByPath(e);return n instanceof qs.TFile?this.vault.modifyBinary(n,r):this.adapter.writeBinary(e,r)}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),n=[...r.files,...r.folders],i;return e!=="/"?i=n.map(s=>(0,qs.normalizePath)(s.substring(e.length))):i=n,i}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var n,i;return this.adapter.rmdir(e,(i=(n=r==null?void 0:r.options)==null?void 0:n.recursive)!=null?i:!1)}async stat(e){if(e.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.byteLength,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let n=await this.adapter.stat(e);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}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof qs.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(e);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(e){return this.adapter.remove(e)}async lstat(e){return this.stat(e)}async readlink(e){throw new Error(`readlink of (${e}) is not implemented.`)}async symlink(e){throw new Error(`symlink of (${e}) 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(e){}};var oR=Ct(aR()),Hn=class extends wl{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 Ah(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 Ra.Notice("Authentication failed. Please try with different credentials");let r=await new Ze(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let n=await new Ze(this.plugin,{placeholder:"Specify your password/personal access token",obscure:!0}).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:s}){let a;s&&(a=await SG(s));let o=await(0,Ra.requestUrl)({url:r,method:n,headers:i,body:a,throw:!1});return{url:r,method:n,headers:o.headers,body:xG(o.arrayBuffer),statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(r){try{let n=await r 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]=Qi(r),s=await this.branchInfo();await this.wrapFS(te.default.push({...this.getRepo(),remote:n,remoteRef:i})),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${i}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,n){return this.walkDifference({walkers:[te.default.TREE({ref:r}),te.default.TREE({ref:n})]})}async walkDifference({walkers:r,dir:n}){return await this.wrapFS(te.default.walk({...this.getRepo(),trees:r,map:async function(s,[a,o]){if(!Yw(s,n))return null;if(await(a==null?void 0:a.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(a==null?void 0:a.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(a),console.log(o)),u!=="equal")return{path:s,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[te.default.TREE({ref:"HEAD"}),te.default.STAGE()],dir:r})).map(i=>({vaultPath:this.getRelativeVaultPath(i.path),path:i.path}))}async getUnstagedFiles(r="."){let n,i=window.setTimeout(()=>{n=new Ra.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),a=await this.wrapFS(te.default.walk({...s,trees:[te.default.WORKDIR(),te.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await te.default.isIgnored({...s,filepath:o})||!Yw(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,m;return u==="blob"&&f!=="blob"?m="42":u==="blob"&&(m=await l.oid()),m?h?m!==h?{path:o,type:"M"}:null:{path:o,type:"A"}:{path:o,type:"D"}}}));return window.clearTimeout(i),n==null||n.hide(),a}catch(s){throw window.clearTimeout(i),n==null||n.hide(),this.plugin.displayError(s),s}}async getDiffString(r,n=!1,i){let s=this.getRelativeVaultPath(r),a=async(c,[u])=>{if(r==c){let f=await u.oid();return(await te.default.readBlob({...this.getRepo(),oid:f})).blob}};if(i){let c=await(0,te.readBlob)({...this.getRepo(),filepath:r,oid:i}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof te.default.Errors.NotFoundError))throw h}),u=await te.default.readCommit({...this.getRepo(),oid:i}),f=await(0,te.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof te.default.Errors.NotFoundError))throw h});return mu(s,f!=null?f:"",c!=null?c:"")}let o=(await te.default.walk({...this.getRepo(),trees:[te.default.STAGE()],map:a})).first(),l=new TextDecoder().decode(o);if(n){let c=await this.resolveRef("HEAD").then(f=>(0,te.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof te.default.Errors.NotFoundError))throw f});return mu(s,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(s)?c=await this.app.vault.adapter.read(s):c="",mu(s,l,c)}}async getLastCommitTime(){let r=this.getRepo(),n=await this.resolveRef("HEAD"),s=(await te.default.readCommit({...r,oid:n})).commit.committer.timestamp;return new Date(s*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 Ra.Notice(r,n?this.noticeLength:void 0)}};async function*xG(t){yield new Uint8Array(t)}async function SG(t){let e=new ReadableStream({async start(n){for await(let i of t)n.enqueue(i);n.close()}});return await new Response(e).arrayBuffer()}p();var nF=Ct(Ph()),Jr=Ct(require("fs/promises")),Ji=require("obsidian"),Ue=Ct(require("path")),Uu=require("path");p();var Bh=Ct(hR(),1);p();var Jw=new WeakMap;function Sl(...t){let e=new String(t);return Jw.set(e,t),e}function wn(t){return t instanceof String&&Jw.has(t)}function El(t){var e;return(e=Jw.get(t))!=null?e:[]}var Lh=Ct(Ph(),1),j$=require("child_process");var CI=Ct(t0(),1),NI=require("node:path");p();function*pR(t,e){let r=e==="global";for(let n of t)n.isGlobal===r&&(yield n)}var GG=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),jG=new Set(["--get","--get-all","--ge Line truncated
`){return t.split(r).reduce((n,i)=>{let s=e?i.trim():i;return s&&n.push(s),n},[])}function E0(t,e){return Lu(t,!0).map(r=>e(r))}function k0(t){return(0,Bh.exists)(t,Bh.FOLDER)}function _n(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function s$(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Hh(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function wi(t){return Array.isArray(t)?t:[t]}function a$(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function Rl(t){return wi(t).map(e=>e instanceof String?e:String(e))}function We(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}function Ou(t,e){let r=[];for(let n=0,i=t.length;n<i;n++)r.push(e,t[n]);return r}function Mu(t){return(Array.isArray(t)?Buffer.concat(t):t).toString("utf-8")}function o$(t,e){let r={};return e.forEach(n=>{t[n]!==void 0&&(r[n]=t[n])}),r}function l0(t=0){return new Promise(e=>setTimeout(e,t))}function c0(t){if(t!==!1)return t}var Cl,Da,Nu,Uh=V({"src/lib/utils/util.ts"(){"use strict";A0(),Cl="\0",Da=()=>{},Nu=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Qt(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function u0(t,e){let r=wn(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function Gh(t){return!!t&&Nu(t)==="[object Object]"}function l$(t){return typeof t=="function"}var Bu,c$,ct,Mh,jh,A0=V({"src/lib/utils/argument-filters.ts"(){"use strict";Uh(),Bu=t=>Array.isArray(t),c$=t=>typeof t=="number",ct=t=>typeof t=="string"||wn(t),Mh=t=>ct(t)||Array.isArray(t)&&t.every(ct),jh=t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number"}}),f0,_j=V({"src/lib/utils/exit-codes.ts"(){"use strict";f0=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(f0||{})}}),Dh,xj=V({"src/lib/utils/git-output-streams.ts"(){"use strict";Dh=class u${constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new u$(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function Sj(){throw new Error("LineParser:useMatches not implemented")}var pe,Ws,Ej=V({"src/lib/utils/line-parser.ts"(){"use strict";pe=class{constructor(t,e){this.matches=[],this.useMatches=Sj,this.parse=(r,n)=>(this.resetMatches(),this._regExp.every((i,s)=>this.addMatch(i,s,r(s)))?this.useMatches(n,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let n=r&&t.exec(r);return n&&this.pushMatch(e,n),!!n}pushMatch(t,e){this.matches.push(...e.slice(1))}},Ws=class extends pe{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function f$(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...d$},...t.filter(n=>typeof n=="object"&&n));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var d$,kj=V({"src/lib/utils/simple-git-options.ts"(){"use strict";d$={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function C0(t,e=[]){return Gh(t)?Object.keys(t).reduce((r,n)=>{let i=t[n];if(wn(i))r.push(i);else if(u0(i,["boolean"]))r.push(n+"="+i);else if(Array.isArray(i))for(let s of i)u0(s,["string","number"])||r.push(n+"="+s);else r.push(n);return r},e):e}function hr(t,e=0,r=!1){let n=[];for(let i=0,s=e<0?t.length:e;i<s;i++)"string|number".includes(typeof t[i])&&n.push(String(t[i]));return C0(T0(t),n),r||n.push(...Aj(t)),n}function Aj(t){let e=typeof Ma(t)=="function";return Rl(Qt(Ma(t,e?1:0),Bu,[]))}function T0(t){let e=l$(Ma(t));return Qt(Ma(t,e?1:0),Gh)}function tt(t,e=!0){let r=e$(Ma(t));return e||t$(r)?r:void 0}var Cj=V({"src/lib/utils/task-options.ts"(){"use strict";A0(),Uh()}});function d0(t,e){return t(e.stdOut,e.stdErr)}function Rr(t,e,r,n=!0){return wi(r).forEach(i=>{for(let s=Lu(i,n),a=0,o=s.length;a<o;a++){let l=(c=0)=>{if(!(a+c>=o))return s[a+c]};e.some(({parse:c})=>c(l,t))}}),t}var Tj=V({"src/lib/utils/task-parser.ts"(){"use strict";Uh()}}),h$={};yt(h$,{ExitCodes:()=>f0,GitOutputStreams:()=>Dh,LineParser:()=>pe,NOOP:()=>Da,NULL:()=>Cl,RemoteLineParser:()=>Ws,append:()=>_n,appendTaskOptions:()=>C0,asArray:()=>wi,asCamelCase:()=>a$,asFunction:()=>e$,asNumber:()=>We,asStringArray:()=>Rl,bufferToString:()=>Mu,callTaskParser:()=>d0,createInstanceConfig:()=>f$,delay:()=>l0,filterArray:()=>Bu,filterFunction:()=>l$,filterHasLength:()=>jh,filterNumber:()=>c$,filterPlainObject:()=>Gh,filterPrimitives:()=>u0,filterString:()=>ct,filterStringOrStringArray:()=>Mh,filterType:()=>Qt,first:()=>n$,folderExists:()=>k0,forEachLineWithContent:()=>E0,getTrailingOptions:()=>hr,including:()=>s$,isUserFunction:()=>t$,last:()=>Ma,objectToString:()=>Nu,orVoid:()=>c0,parseStringResponse:()=>Rr,pick:()=>o$,prefixedArray:()=>Ou,remove:()=>Hh,splitOn:()=>r$,toLinesWithContent:()=>Lu,trailingFunctionArgument:()=>tt,trailingOptionsArg Line truncated
`)){let l=r$(a,`
`);o=l[0],a=l[1]}yield{file:s,key:o,value:a}}}var R$,Gj=V({"src/lib/responses/ConfigList.ts"(){"use strict";ue(),R$=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){return this._all||(this._all=this.files.reduce((t,e)=>Object.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=Ma(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let n=this.addFile(t);Object.hasOwn(n,e)?Array.isArray(n[e])?n[e].push(r):n[e]=[n[e],r]:n[e]=r,this._all=void 0}}}});function r0(t,e){return typeof t=="string"&&Object.hasOwn(m0,t)?t:e}function jj(t,e,r,n){let i=["config",`--${n}`];return r&&i.push("--add"),i.push(t,e),{commands:i,format:"utf-8",parser(s){return s}}}function qj(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(n){return Hj(n,t)}}}function Wj(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return Bj(r)}}}function zj(){return{addConfig(t,e,...r){return this._runTask(jj(t,e,r[0]===!0,r0(r[1],"local")),tt(arguments))},getConfig(t,e){return this._runTask(qj(t,r0(e,void 0)),tt(arguments))},listConfig(...t){return this._runTask(Wj(r0(t[0],void 0)),tt(arguments))}}}var m0,$$=V({"src/lib/tasks/config.ts"(){"use strict";Gj(),ue(),m0=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(m0||{})}});function Vj(t){return I$.has(t)}var n0,I$,F$=V({"src/lib/tasks/diff-name-status.ts"(){"use strict";n0=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(n0||{}),I$=new Set(Object.values(n0))}});function Yj(...t){return new M$().param(...t)}function Xj(t){let e=new Set,r={};return E0(t,n=>{let[i,s,a]=n.split(Cl);e.add(i),(r[i]=r[i]||[]).push({line:We(s),path:i,preview:a})}),{paths:e,results:r}}function Zj(){return{grep(t){let e=tt(arguments),r=hr(arguments);for(let i of O$)if(r.includes(i))return this._runTask(Tr(`git.grep: use of "${i}" is not supported.`),e);typeof t=="string"&&(t=Yj().param(t));let n=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:n,format:"utf-8",parser(i){return Xj(i)}},e)}}}var O$,Fu,_R,M$,D$=V({"src/lib/tasks/grep.ts"(){"use strict";ue(),mt(),O$=["-h"],Fu=Symbol("grepQuery"),M$=class{constructor(){this[_R]=[]}*[(_R=Fu,Symbol.iterator)](){for(let t of this[Fu])yield t}and(...t){return t.length&&this[Fu].push("--and","(",...Ou(t,"-e"),")"),this}param(...t){return this[Fu].push(...Ou(t,"-e")),this}}}}),L$={};yt(L$,{ResetMode:()=>Ih,getResetMode:()=>Qj,resetTask:()=>Kj});function Kj(t,e){let r=["reset"];return N$(t)&&r.push(`--${t}`),r.push(...e),pr(r)}function Qj(t){if(N$(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function N$(t){return typeof t=="string"&&B$.includes(t)}var Ih,B$,H$=V({"src/lib/tasks/reset.ts"(){"use strict";ue(),mt(),Ih=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Ih||{}),B$=Rl(Object.values(Ih))}});function Jj(){return(0,Lh.default)("simple-git")}function xR(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(n,...i)=>{t(n,...i),r(n,...i)}:t:(n,...i)=>{t(`%s ${n}`,e,...i),r&&r(n,...i)}}function eq(t,e,{namespace:r}){if(typeof t=="string")return t;let n=e&&e.namespace||"";return n.startsWith(r)?n.substr(r.length+1):n||r}function O0(t,e,r,n=Jj()){let i=t&&`[${t}]`||"",s=[],a=typeof e=="string"?n.extend(e):e,o=eq(Qt(e,ct),a,n);return c(r);function l(u,f){return _n(s,O0(t,o.replace(/^[^:]+/,u),f,n))}function c(u){let f=u&&`[${u}]`||"",d=a&&xR(a,f)||Da,h=xR(n,`${i} ${f}`,d);return Object.assign(a?d:h,{label:t,sibling:l,info:h,step:c})}}var U$=V({"src/lib/git-logger.ts"(){"use strict";ue(),Lh.default.formatters.L=t=>String(jh(t)?t.length:"-"),Lh.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Nu(t)}}),G$,tq=V({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;zs(),U$(),G$=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let n=t.getName(r.commands[0]),i=O0(this.logLabel,n);return{task:r,logger:i,name:n}}push(r){let n=this.createProgress(r);return n.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,n),n}fatal(r){for(let[n,{logger:i}]of Array.from(this._queue.entries()))n===r.task?(i.info("Failed %o",r),i("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):i.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(n);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(r){this.withProgress(r)&&this._queue.delete(r)}attempt(r){let n=this.withProgress(r);if(!n)throw new Pr(void 0,"TasksPendingQueue: attempt called for an unknown task");return n.lo Line truncated
`).map(ZW).filter(Boolean);e||r.sort(function(i,s){let a=i.split("."),o=s.split(".");if(a.length===1||o.length===1)return XW($h(a[0]),$h(o[0]));for(let l=0,c=Math.max(a.length,o.length);l<c;l++){let u=ZI($h(a[l]),$h(o[l]));if(u)return u}return 0});let n=e?r[0]:[...r].reverse().find(i=>i.indexOf(".")>=0);return new VR(r,n)}}}),QI={};yt(QI,{addAnnotatedTagTask:()=>ez,addTagTask:()=>JW,tagListTask:()=>QW});function QW(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return KI(r,e)}}}function JW(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function ez(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var tz=V({"src/lib/tasks/tag.ts"(){"use strict";KW()}}),rz=yj({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(iq(),pt(q$)),{SimpleGitApi:n}=(iW(),pt(kI)),{Scheduler:i}=(sW(),pt(AI)),{adhocExecTask:s,configurationErrorTask:a}=(mt(),pt(p0)),{asArray:o,filterArray:l,filterPrimitives:c,filterString:u,filterStringOrStringArray:f,filterType:d,getTrailingOptions:h,trailingFunctionArgument:m,trailingOptionsArgument:g}=(ue(),pt(h$)),{applyPatchTask:v}=(oW(),pt(PI)),{branchTask:w,branchLocalTask:b,deleteBranchesTask:k,deleteBranchTask:x}=(wW(),pt(DI)),{checkIgnoreTask:E}=(xW(),pt(HI)),{checkIsRepoTask:A}=(v$(),pt(p$)),{cleanWithOptionsTask:y,isCleanOptionsArray:S}=(T$(),pt(A$)),{diffSummaryTask:_}=(U0(),pt(nI)),{fetchTask:C}=(CW(),pt(GI)),{moveTask:P}=($W(),pt(qI)),{pullTask:N}=(FW(),pt(WI)),{pushTagsTask:B}=(wI(),pt(vI)),{addRemoteTask:H,getRemotesTask:ce,listRemotesTask:Pe,remoteTask:ve,removeRemoteTask:ie}=(GW(),pt(VI)),{getResetMode:xe,resetTask:we}=(H$(),pt(L$)),{stashListTask:W}=(qW(),pt(YI)),{addSubModuleTask:X,initSubModuleTask:q,subModuleTask:De,updateSubModuleTask:ar}=(YW(),pt(XI)),{addAnnotatedTagTask:Ft,addTagTask:Ie,tagListTask:kt}=(tz(),pt(QI)),{straightThroughBufferTask:At,straightThroughStringTask:je}=(mt(),pt(p0));function Z(M,O){this._plugins=O,this._executor=new r(M.baseDir,new i(M.maxConcurrentProcesses),O),this._trimmed=M.trimmed}(Z.prototype=Object.create(n.prototype)).constructor=Z,Z.prototype.customBinary=function(M){return this._plugins.reconfigure("binary",M),this},Z.prototype.env=function(M,O){return arguments.length===1&&typeof M=="object"?this._executor.env=M:(this._executor.env=this._executor.env||{})[M]=O,this},Z.prototype.stashList=function(M){return this._runTask(W(g(arguments)||{},l(M)&&M||[]),m(arguments))},Z.prototype.mv=function(M,O){return this._runTask(P(M,O),m(arguments))},Z.prototype.checkoutLatestTag=function(M){var O=this;return this.pull(function(){O.tags(function(oe,Ce){O.checkout(Ce.latest,M)})})},Z.prototype.pull=function(M,O,oe,Ce){return this._runTask(N(d(M,u),d(O,u),h(arguments)),m(arguments))},Z.prototype.fetch=function(M,O){return this._runTask(C(d(M,u),d(O,u),h(arguments)),m(arguments))},Z.prototype.silent=function(M){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},Z.prototype.tags=function(M,O){return this._runTask(kt(h(arguments)),m(arguments))},Z.prototype.rebase=function(){return this._runTask(je(["rebase",...h(arguments)]),m(arguments))},Z.prototype.reset=function(M){return this._runTask(we(xe(M),h(arguments)),m(arguments))},Z.prototype.revert=function(M){let O=m(arguments);return typeof M!="string"?this._runTask(a("Commit must be a string"),O):this._runTask(je(["revert",...h(arguments,0,!0),M]),O)},Z.prototype.addTag=function(M){let O=typeof M=="string"?Ie(M):a("Git.addTag requires a tag name");return this._runTask(O,m(arguments))},Z.prototype.addAnnotatedTag=function(M,O){return this._runTask(Ft(M,O),m(arguments))},Z.prototype.deleteLocalBranch=function(M,O,oe){return this._runTask(x(M,typeof O=="boolean"?O:!1),m(arguments))},Z.prototype.deleteLocalBranches=function(M,O,oe){return this._runTask(k(M,typeof O=="boolean"?O:!1),m(arguments))},Z.prototype.branch=function(M,O){return this._runTask(w(h(arguments)),m(arguments))},Z.prototype.branchLocal=function(M){return this._runTask(b(),m(arguments))},Z.prototype.raw=function(M){let O=!Array.isArray(M),oe=[].slice.call(O?arguments:M,0);for(let Ot=0;Ot<oe.length&&O;Ot++)if(!c(oe[Ot])){oe.splice(Ot,oe.length-Ot);break}oe.push(...h(arguments,0,!0));var Ce=m(arguments);return oe.length?this._runTask(je(oe,this._trimmed),Ce):this._runTask(a("Raw: must supply one or more command to execute"),Ce)},Z.prototype.submoduleAdd=function(M,O,oe){return this._runTask(X(M,O),m(arguments))},Z.prototype.submoduleUpdate=function(M,O){return this._runTask(ar(h(arguments,!0)),m(arguments))},Z.prototype.submoduleInit=function(M,O){return this._runTask(q(h(arguments,!0)),m(arguments))},Z.prototype.subModule=function(M,O){return this._runTask(De(h(arguments)),m(arguments))},Z.prototype.listRemote=function(){return this._runTask(Pe(h(arguments)),m(arguments))},Z.prototype.addRe Line truncated
`).some(l=>l.contains(i))||await Jr.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(r){let n=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let i=await this.git.status(n!=null?["--",n]:[]);this.plugin.setPluginState({gitAction:0});let s=i.files.map(a=>{let o=this.formatPath(a);return{path:o.path,from:o.from,index:a.index==="?"?"U":a.index,workingDir:a.working_dir==="?"?"U":a.working_dir,vaultPath:this.getRelativeVaultPath(o.path)}});return{all:s,changed:s.filter(a=>a.workingDir!==" "),staged:s.filter(a=>a.index!==" "&&a.index!="U"),conflicted:i.conflicted.map(a=>this.formatPath({path:a}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let n=this.getRelativeRepoPath(r),s=["-C",Ue.dirname(n),"rev-parse","HEAD"],a=this.git.raw(s);return a.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),(await a).trim()}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((n,i,s,a)=>{if(!(a.contains("submodule")&&a.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]+Uu.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},n=>this.plugin.displayError(n))})}formatPath(r){function n(i){if(i!=null)return i.startsWith('"')&&i.endsWith('"')?i.substring(1,i.length-1):i}return r.from!=null?{from:n(r.from),path:n(r.path)}:{path:n(r.path)}}async blame(r,n,i){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let s=await this.getSubmoduleOfFile(r),a=s?["-C",s.submodule]:[],o=s?s.relativeFilepath:r;a.push("blame","--porcelain"),i&&a.push("-w");let l=`-C${qd}`;switch(n){case"inactive":break;case"same-commit":a.push("-C",l);break;case"all-commits":a.push("-C","-C",l);break;default:js(n)}a.push("--",o);let c=await this.git.raw(a);return xz(c)}async isTracked(r){let n=await this.getSubmoduleOfFile(r),i=n?["-C",n.submodule]:[],s=n?n.relativeFilepath:r;return i.push("ls-files","--",s),this.git.raw(i).then(a=>a.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let i=await this.getSubmodulePaths();for(let s of i)await this.git.cwd({path:s,root:!1}).add("-A"),await this.git.cwd({path:s,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]),this.plugin.setPluginState({gitAction:0})}async applyPatch(r){let n=Ue.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(n,r),await this.git.applyPatch(n,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(n)}async getUntrackedPaths(r){let n=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let i=[];n!=null&&i.push("--",n);let s=await this.git.clean(Oa.RECURSIVE+Oa.DRY_RUN,i);return this.plugin.setPluginState({gitAction:0}),s.paths}async hashObject(r){r=this.getRelativeRepoPath(r);let n=await this.getSubmoduleOfFile(r),i=n?["-C",n.submodule]:[],s=n?n.relativeFilepath:r;return i.push("hash-object","--",s),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{let o=[r.tracking];switch(this.plugin.settings.mergeStrategy!=="none"&&o.push(`--strategy-option=${this.plugin.settings.mergeStrategy}`),this.plugin.settings.syncMethod){case"merge":await this.git.merge(o);break;case"rebase":await this.git.rebase(o)}}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 s=await this.git.revparse([r.current]);return(await this.git.diff([`${n}..${s}`,"--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 a=aw 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){let[s,a]=Qi(r),o=await this.branchInfo();await this.git.push(["--set-upstream",s,`${o.current}:${a}`])}}}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(Ue.dirname(r)))return;let n=await this.git.raw(["-C",Ue.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",Ue.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 a=this.app.vault.adapter.getFullPath(Ue.normalize(r)),o=Ue.relative(n,a);return{submodule:n,relativeFilepath:o}}async getLastCommitTime(){try{let r=await this.git.log({n:1});if(r!=null&&r.latest!=null)return new Date(r.latest.date)}catch(r){if(r instanceof Pr){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),n=await $u(r||"git",["--version"],{});if(n.error)if(Ji.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${Wd}) of Git for Windows.`);let i=await $u(Wd,["--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 Pr){let n=String(r.message);if(n.contains("Could not resolve host")||n.contains("Unable to resolve host")||n.contains("Unable to open connection")||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 ul(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}}},iF={hash:"000000",isZeroCommit:!0,summary:""};function xz(t){let r=t.replace(`\r
`,`
`).split(`
`),n={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},i=1;for(let s=0;s<r.length;){if(tF(r[s])){let a=r[s].split(" "),o=Sz(a,i,n);for(s++;tF(r[s]);s++){let l=r[s].split(" ");Ez(l,n,i)}kz(n.commits.get(o)),i+=1}else if(!(r[s]===""&&s===r.length-1))throw Error(`Expected non-whitespace line or EOF, but found: ${r[s]}`);s++}return n}function Sz(t,e,r){let n=t[0];if(r.hashPerLine.push(n),r.originalFileLineNrPerLine.push(parseInt(t[1])),r.finalFileLineNrPerLine.push(parseInt(t[2])),t.length>=4&&r.groupSizePerStartingLine.set(e,parseInt(t[3])),parseInt(t[2])!==e)throw Error(`git-blame output is out of order: ${e} vs ${t[2]}`);return n}function Ez(t,e,r){let n=t[0],i=t.slice(1).join(" "),s=e.hashPerLine[r],a=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(n){case"summary":a.summary=i;break;case"author":a.author.name=i;break;case"author-mail":a.author.email=rF(i);break;case"author-time":a.author.epochSeconds=parseInt(i);break;case"author-tz":a.author.tz=i;break;case"committer":a.committer.name=i;break;case"committer-mail":a.committer.email=rF(i);break;case"committer-time":a.committer.epochSeconds=parseInt(i);break;case"committer-tz":a.committer.tz=i;break;case"previous":a.previous.commitHash=i;break;case"filename":a.previous.filename=i;break}e.commits.set(s,a)}function kz(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);W0(t.author)&&(t.author=void 0),W0(t.committer)&&(t.committer=void 0),W0(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function W0(t){return!t||Object.keys(t).length===0}function tF(t){return t.length>0&&t[0].trim()===t[0]}function rF(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}p();var PF=require("@codemirror/state");p();var z0=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(e,r){if(e)return this.ensureInitialized(e),r(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(r=>r.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},es=new z0;p();var Zh=require("@codemirror/state"),sF=Ct(V0());function aF(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var oF=Zh.StateEffect.define();function lF(t,e,r){return r.update({effects:oF.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var $l=Zh.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(oF))return r.value;return Az(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function Kh(t){var s;let e=sF.sha256.create();if(!t)return e;let{la:r,key:n,lineOffsetsFromUnsavedChanges:i}=t;e.update(r==="untracked"?"t":"f"),e.update(n);for(let[a,o]of(s=i.entries())!=null?s:[])e.update([a,o]);return e}var xn={get:void 0,save:void 0};function cF(t,e){xn.get=t,xn.save=e}function Qh(t){var e,r;return(r=(e=Xh(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:Xh(et.lineAuthor.coloringMaxAge).asDays()}function Az(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,n,i,s)=>{var m;let a=t.startState.doc,{newDoc:o}=t,l=a.lineAt(r).number,c=a.lineAt(n).number,u=o.lineAt(i).number,f=o.lineAt(s).number,d=c-l+1,h=f-u+1;for(let g=u;g<=f;g++){let v=(m=e.lineOffsetsFromUnsavedChanges.get(g))!=null?m:0,w=f===g,b=h-d;w&&(v+=b),e.lineOffsetsFromUnsavedChanges.set(g,v)}}),e}p();function uF(){Il=void 0,Y0=[],Jh=0,tp.clear(),rp.clear(),Fl.clear()}var Il,ep=()=>Il;function fF(t,e){var i;let r=e.length;if(r<((i=Il==null?void 0:Il.length)!=null?i:0))return;Il={gutter:t,length:r,text:e};let n=xn.get();r!==n.gutterSpacingFallbackLength&&(n.gutterSpacingFallbackLength=r,xn.save(n))}var Y0=[],Cz=15,Jh=0;function dF(t){Y0[Jh]=t,Jh=(Jh+1)%Cz}function hF(){return XP(Y0)}var tp=new Map,rp=new Map,Fl=new Set;p();var AF=require("@codemirror/state"),CF=require("@codemirror/view");p();var Q0=require("@codemirror/view"),xF=Ct(V0()),Ol=require("obsidian");p();p();var np={x:-10,y:-10};function pF(){np.x===-10&&window.addEventListener("mousedown",t=>{np.x=t.clientX,np.y=t.clientY})}function mF(){for(let t of Fl)if(Tz(t,np))return t}function Tz(t,e){let{x:r,y:n,width:i,height:s}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+i&&n<=e.y&&e.y<=n+s}var gF="data-commit";function vF(t,e,r){if(e.hasFocus())return;let n=mF();if(!n)return;let i=Rz(n);i&&(!i.isZeroCommit&&!i.isWaitingGutter&&Pz(i,t),X0("showCommitHash",t),X0("authorDisplay",t),X0("dateTimeFormatOptions",t))}function Pz(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-aut Line truncated
If turned on, do auto ${i} every ${JP(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(f=>f.setValue(n.settings.autoBackupAfterFileChange).onChange(async d=>{n.settings.autoBackupAfterFileChange=d,this.refreshDisplayWithDelay(),await n.saveSettings(),n.automaticsManager.reload("commit")})),this.mayDisableSetting(a,n.settings.setLastSaveToLastCommit),a=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(f=>f.setValue(n.settings.setLastSaveToLastCommit).onChange(async d=>{n.settings.setLastSaveToLastCommit=d,await n.saveSettings(),n.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(a,n.settings.autoBackupAfterFileChange),a=new U.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPushInterval"}),f.setPlaceholder(String(et.autoPushInterval)),f.onChange(async d=>{d!==""?n.settings.autoPushInterval=Number(d):n.settings.autoPushInterval=et.autoPushInterval,await n.saveSettings(),n.automaticsManager.reload("push")})}),this.mayDisableSetting(a,!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(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPullInterval"}),f.setPlaceholder(String(et.autoPullInterval)),f.onChange(async d=>{d!==""?n.settings.autoPullInterval=Number(d):n.settings.autoPullInterval=et.autoPullInterval,await n.saveSettings(),n.automaticsManager.reload("pull")})}),new U.Setting(r).setName(`Auto ${i} only staged files`).setDesc(`If turned on, only staged files are committed on ${i}. If turned off, all changed files are committed.`).addToggle(f=>f.setValue(n.settings.autoCommitOnlyStaged).onChange(async d=>{n.settings.autoCommitOnlyStaged=d,await n.saveSettings()})),new U.Setting(r).setName(`Specify custom commit message on auto ${i}`).setDesc("You will get a pop up to specify your message.").addToggle(f=>f.setValue(n.settings.customMessageOnAutoBackup).onChange(async d=>{n.settings.customMessageOnAutoBackup=d,await n.saveSettings(),this.refreshDisplayWithDelay()})),a=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(f=>{f.setPlaceholder(et.autoCommitMessage).onChange(async d=>{d===""?n.settings.autoCommitMessage=et.autoCommitMessage:n.settings.autoCommitMessage=d,await n.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(a,n.settings.customMessageOnAutoBackup),new U.Setting(r).setName("Commit message").setHeading();let c=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). Leave empty to require manual input on each commit.");c.addTextArea(f=>{c.addButton(d=>{d.setIcon("reset").setTooltip(`Set to default: "${et.commitMessage}"`).onClick(()=>{f.setValue(et.commitMessage),f.onChanged()})}),f.setValue(n.settings.commitMessage),f.onChange(async d=>{n.settings.commitMessage=d,await n.saveSettings()})}),U.Platform.isDesktopApp&&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(f=>{f.onChange(async d=>{d===""?n.settings.commitMessageScript=et.commitMessageScript:n.settings.commitMessageScript=d,await n.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"commitMessageScript"})});let u=new U.Setting(r).setName("{{date}} placeholder format").addMomentFormat(f=>f.setDefaultFormat(n.settings.commitDateFormat).setValue(n.settings.commitDateFormat).onChange(async d=>{n.settings.commitDateFormat=d,await n.saveSettings()}));u.descEl.innerHTML=`
Specify custom date format. E.g. "${$v}. 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. Defaults to the OS hostname if not set on desktop.").addText(f=>{var d;return f.setValue((d=n.localStorage.getHostname())!=null?d:"").onChange(h=>{n.localStorage.setHostname(h)})}),new U.Setting(r).setName("Preview commit message").addButton(f=>f.setButtonText("Preview").onClick(async()=>{let d=await n.gitManager.formatCommitMessage(n.settings.commitMessage);new U.Notice(`${d}`)})),new U.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(f=>f.setValue(n.settings.listChangedFilesInMessageBody).onChange(async d=>{n.settings.listChangedFilesInMessageBody=d,await n.saveSettings()})),new U.Setting(r).setName("Pull").setHeading(),n.gitManager instanceof Se&&new U.Setting(r).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(f=>{let d={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};f.addOptions(d),f.setValue(n.settings.syncMethod),f.onChange(async h=>{n.settings.syncMethod=h,await n.saveSettings()})}),new U.Setting(r).setName("Merge strategy on conflicts").setDesc("Decide how to solve conflicts when pulling remote changes. This can be used to favor your local changes or the remote changes automatically.").addDropdown(f=>{let d={none:"None (git default)",ours:"Our changes",theirs:"Their changes"};f.addOptions(d),f.setValue(n.settings.mergeStrategy),f.onChange(async h=>{n.settings.mergeStrategy=h,await n.saveSettings()})}),new U.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(f=>f.setValue(n.settings.autoPullOnBoot).onChange(async d=>{n.settings.autoPullOnBoot=d,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(),a=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(f=>f.setValue(!n.settings.disablePush).onChange(async d=>{n.settings.disablePush=!d,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(f=>f.setValue(n.settings.pullBeforePush).onChange(async d=>{n.settings.pullBeforePush=d,this.refreshDisplayWithDelay(),await n.saveSettings()})),n.gitManager instanceof Se&&(new U.Setting(r).setName("Hunk management").setDesc("Hunks are sections of grouped line changes right in your editor.").setHeading(),new U.Setting(r).setName("Signs").setDesc("This allows you to see your changes right in your editor via colored markers and stage/reset/preview individual hunks.").addToggle(f=>f.setValue(n.settings.hunks.showSigns).onChange(async d=>{n.settings.hunks.showSigns=d,await n.saveSettings(),n.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Hunk commands").setDesc("Adds commands to stage/reset individual Git diff hunks and navigate between them via 'Go to next/prev hunk' commands.").addToggle(f=>f.setValue(n.settings.hunks.hunkCommands).onChange(async d=>{n.settings.hunks.hunkCommands=d,await n.saveSettings(),n.editorIntegration.refreshSignsSettings()})),new U.Setting(r).setName("Status bar with summary of line changes").addDropdown(f=>f.addOptions({disabled:"Disabled",colored:"Colored",monochrome:"Monochrome"}).setValue(n.settings.hunks.statusBar).onChange(async d=>{n.settings.hunks.statusBar=d,await n.saveSettings(),n.editorIntegration.refreshSignsSettings()})),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.Settin Line truncated
`)),c.onChange(u=>{n.localStorage.setEnvVars(u.split(`
`))})}),n.gitManager instanceof Se&&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 Se&&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('Corresponds to the GIT_DIR environment variable. 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.editorIntegration.activateLineAuthoring():this.plugin.editorIntegration.deactiveLineAuthoring()}async lineAuthorSettingHandler(r,n){this.settings.lineAuthor[r]=n,await this.plugin.saveSettings(),this.plugin.editorIntegration.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.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.innerHTML=`
<a href="${jz}">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(s=>{s.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),s.setValue(this.settings.lineAuthor.followMovement),s.onChange(a=>this.lineAuthorSettingHandler("followMovement",a))});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 ${qd} 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(s=>{s.setValue(this.settings.lineAuthor.showCommitHash),s.onChange(a=>this.lineAuthorSettingHandler("showCommitHash",a))}),new U.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(s=>{let a={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};s.addOptions(a),s.setValue(this.settings.lineAuthor.authorDisplay),s.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(s=>{let a={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};s.addOptions(a),s.setValue(this.settings.lineAuthor.dateTimeFormatOptions),s.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",o),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let s=new U.Setting(this.containerEl);s.setName("Custom authoring date format").addText(a=>{a.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),a.setPlaceholder("YYYY-MM-DD HH:mm"),a.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",o),s.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(o)})}),s.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(this.settings.lineAuthor.dateTimeFormatCustomString)}new U.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(s=>{let a={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};s.addOptions(a),s.setValue(this.settings.lineAuthor.dateTimeTimezone),s.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(s=>{s.setPlaceholder("1y"),s.setValue(this.settings.lineAuthor.coloringMaxAge),s.onChange(async a=>{let[o,l]=this.previewOldestAgeDescriptionHtml(a);i.descEl.innerHTML=o,l&&(await this.lineAuthorSettingHandler("coloringMaxAge",a),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest"),new U.Setting(this.containerEl).setName("Text color").addText(s=>{s.setValue(this.settings.lineAuthor.textColorCss),s.onChange(async a=>{await this.lineAuthorSettingHandler("textColorCss",a)})}).descEl.innerHTML=`
The CSS color of the gutter text.<br/>
It is highly 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(s=>{s.setValue(this.settings.lineAuthor.ignoreWhitespace),s.onChange(a=>this.lineAuthorSettingHandler("ignoreWhitespace",a))}).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 s=ry(r,this.settings.lineAuthor),a=ry(r,et.lineAuthor);i.setPlaceholder(Xw(a)),i.setValue(Xw(s)),i.onChange(async o=>{let l=VP(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,ry(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 s=i?sp(r,n):"rgba(127,127,127,0.3)",a=U.moment.unix(U.moment.now()/1e3).format("YYYY-MM-DD"),o=i?`abcdef Author Name ${a}`:"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: ${s}; width: 30ch;"
>${o}</div>`}`}previewCustomDateTimeDescriptionHtml(r){let n=(0,U.moment)().format(r);return`<a href="${Gz}">Format string</a> to display the authoring date.</br>Currently: ${n}`}previewOldestAgeDescriptionHtml(r){let n=Xh(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];et[r]!==i&&(typeof i=="string"||typeof i=="number"||typeof i=="boolean"?n.setValue(String(i)):n.setValue(JSON.stringify(i)))}refreshDisplayWithDelay(r=80){setTimeout(()=>this.display(),r)}};function ry(t,e){return t==="oldest"?e.colorOld:e.colorNew}function Xh(t){let e=U.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}p();var en=require("obsidian");var lp=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),r.registerEvent(r.app.workspace.on("obsidian-git:refreshed",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,r){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:r}),this.display()}display(){this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){switch((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv(),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.style.float="left",this.pausedEl=this.statusBarEl.createDiv(),this.pausedEl.setAttribute("data-tooltip-position","top"),this.pausedEl.style.float="left",this.iconEl=this.statusBarEl.createDiv(),this.iconEl.style.float="left",this.textEl=this.statusBarEl.createDiv(),this.textEl.style.float="right",this.textEl.style.marginLeft="5px"),this.plugin.localStorage.getConflict()?((0,en.setIcon)(this.conflictEl,"alert-circle"),this.conflictEl.ariaLabel="You have merge conflicts. Resolve them and commit afterwards.",this.conflictEl.style.marginRight="5px",this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.style.marginRight=""),this.plugin.localStorage.getPausedAutomatics()?((0,en.setIcon)(this.pausedEl,"pause-circle"),this.pausedEl.ariaLabel="Automatic routines are currently paused.",this.pausedEl.style.marginRight="5px",this.pausedEl.addClass(this.base+"paused")):(this.pausedEl.empty(),this.pausedEl.style.marginRight=""),this.plugin.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,en.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,en.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,en.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,en.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,en.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,en.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var n;let e=this.lastCommitTimestamp,r=this.plugin.state.offlineMode;if(e){let i=(0,en.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${r?"Offline: ":""}Last Commit: ${i}`,(n=this.unPushedCommits)!=null&&n&&(this.statusBarEl.ariaLabel+=`
(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,en.setIcon)(this.iconEl,"globe"):(0,en.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()}};p();var up=require("obsidian"),cp=class extends up.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,up.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)}};p();var $F=require("obsidian"),Gu=class{constructor(e){this.plugin=e}saveLastAuto(e,r){r==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):r==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):r==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,r,n;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),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 e=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let r=this.diff(this.plugin.settings.autoPushInterval,e.push);this.startAutoPush(r)}if(this.plugin.settings.autoPullInterval>0){let r=this.diff(this.plugin.settings.autoPullInterval,e.pull);this.startAutoPull(r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...e){this.plugin.localStorage.getPausedAutomatics()||(e.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),e.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),e.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 e=await this.plugin.gitManager.getLastCommitTime();e&&this.saveLastAuto(e,"backup")}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let e=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let r=this.diff(this.plugin.settings.autoSaveInterval,e.backup);this.startAutoCommitAndSync(r)}}}startAutoCommitAndSync(e){let r=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?e===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,$F.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 r=await this.plugin.gitManager.getLastCommitTime();if(r){this.saveLastAuto(r,"backup");let n=this.diff(this.plugin.settings.autoSaveInterval,r);if(n>0)return this.startAutoCommitAndSync(n),!1}}let e=this.plugin.settings.autoCommitOnlyStaged;return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.commit({fromAuto:!0,onlyStaged:e}):await this.plugin.commitAndSync({fromAutoBackup:!0,onlyStaged:e}),!0},e=>{e!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(e){let r=(e!=null?e: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(e){let r=(e!=null?e: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 e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCommitDebo Line truncated
`)}static newName(){let e=NF[LF]||1;return NF[LF]=e+1,ny+e.toString(36)}static mount(e,r,n){let i=e[iy],s=n&&n.nonce;i?s&&i.setNonce(s):i=new sy(e,s),i.mount(Array.isArray(r)?r:[r],e)}},BF=new Map,sy=class{constructor(e,r){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=BF.get(n);if(s)return e[iy]=s;this.sheet=new i.CSSStyleSheet,BF.set(n,this)}else this.styleTag=n.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[iy]=this}mount(e,r){let n=this.sheet,i=0,s=0;for(let a=0;a<e.length;a++){let o=e[a],l=this.modules.indexOf(o);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),n)for(let c=0;c<o.rules.length;c++)n.insertRule(o.rules[c],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=o.rules.length,s++}}if(n)r.adoptedStyleSheets.indexOf(this.sheet)<0&&(r.adoptedStyleSheets=[this.sheet,...r.adoptedStyleSheets]);else{let a="";for(let l=0;l<this.modules.length;l++)a+=this.modules[l].getRules()+`
`;this.styleTag.textContent=a;let o=r.head||r;this.styleTag.parentNode!=o&&o.insertBefore(this.styleTag,o.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var nO=require("@codemirror/language"),qz=require("@lezer/highlight"),bt=class t{constructor(e,r,n,i){this.fromA=e,this.toA=r,this.fromB=n,this.toB=i}offset(e,r=e){return new t(this.fromA+e,this.toA+e,this.fromB+r,this.toB+r)}};function Ba(t,e,r,n,i,s){if(t==n)return[];let a=hy(t,e,r,n,i,s),o=py(t,e+a,r,n,i+a,s);e+=a,r-=o,i+=a,s-=o;let l=r-e,c=s-i;if(!l||!c)return[new bt(e,r,i,s)];if(l>c){let f=t.slice(e,r).indexOf(n.slice(i,s));if(f>-1)return[new bt(e,e+f,i,i),new bt(e+f+c,r,s,s)]}else if(c>l){let f=n.slice(i,s).indexOf(t.slice(e,r));if(f>-1)return[new bt(e,e,i,i+f),new bt(r,r,i+f+l,s)]}if(l==1||c==1)return[new bt(e,r,i,s)];let u=sO(t,e,r,n,i,s);if(u){let[f,d,h]=u;return Ba(t,e,f,n,i,d).concat(Ba(t,f+h,r,n,d+h,s))}return Wz(t,e,r,n,i,s)}var qu=1e9,Wu=0,dy=!1;function Wz(t,e,r,n,i,s){let a=r-e,o=s-i;if(qu<1e9&&Math.min(a,o)>qu*16||Wu>0&&Date.now()>Wu)return Math.min(a,o)>qu*64?[new bt(e,r,i,s)]:HF(t,e,r,n,i,s);let l=Math.ceil((a+o)/2);ay.reset(l),oy.reset(l);let c=(h,m)=>t.charCodeAt(e+h)==n.charCodeAt(i+m),u=(h,m)=>t.charCodeAt(r-h-1)==n.charCodeAt(s-m-1),f=(a-o)%2!=0?oy:null,d=f?null:ay;for(let h=0;h<l;h++){if(h>qu||Wu>0&&!(h&63)&&Date.now()>Wu)return HF(t,e,r,n,i,s);let m=ay.advance(h,a,o,l,f,!1,c)||oy.advance(h,a,o,l,d,!0,u);if(m)return zz(t,e,r,e+m[0],n,i,s,i+m[1])}return[new bt(e,r,i,s)]}var wp=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;r<this.len;r++)this.vec[r]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,r,n,i,s,a,o){for(let l=-e+this.start;l<=e-this.end;l+=2){let c=i+l,u=l==-e||l!=e&&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(s){let d=i+(r-n)-l;if(d>=0&&d<this.len&&s.vec[d]!=-1)if(a){let h=s.vec[d];if(h>=r-u)return[h,i+h-d]}else{let h=r-s.vec[d];if(u>=h)return[u,f]}}}return null}},ay=new wp,oy=new wp;function zz(t,e,r,n,i,s,a,o){let l=!1;return!Ll(t,n)&&++n==r&&(l=!0),!Ll(i,o)&&++o==a&&(l=!0),l?[new bt(e,r,s,a)]:Ba(t,e,n,i,s,o).concat(Ba(t,n,r,i,o,a))}function iO(t,e){let r=1,n=Math.min(t,e);for(;r<n;)r=r<<1;return r}function hy(t,e,r,n,i,s){if(e==r||e==s||t.charCodeAt(e)!=n.charCodeAt(i))return 0;let a=iO(r-e,s-i);for(let o=e,l=i;;){let c=o+a,u=l+a;if(c>r||u>s||t.slice(o,c)!=n.slice(l,u)){if(a==1)return o-e-(Ll(t,o)?0:1);a=a>>1}else{if(c==r||u==s)return c-e;o=c,l=u}}}function py(t,e,r,n,i,s){if(e==r||i==s||t.charCodeAt(r-1)!=n.charCodeAt(s-1))return 0;let a=iO(r-e,s-i);for(let o=r,l=s;;){let c=o-a,u=l-a;if(c<e||u<i||t.slice(c,o)!=n.slice(u,l)){if(a==1)return r-o-(Ll(t,o)?0:1);a=a>>1}else{if(c==e||u==i)return r-c;o=c,l=u}}}function ly(t,e,r,n,i,s,a,o){let l=n.slice(i,s),c=null;for(;;){if(c||a<o)return c;for(let u=e+a;;){Ll(t,u)||u++;let f=u+a;if(Ll(t,f)||(f+=f==u+1?1:-1),f>=r)break;let d=t.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let m=hy(t,f,r,n,i+h+d.length,s),g=py(t,e,u,n,i,i+h),v=d.length+m+g;(!c||c[2]<v)&&(c=[u-g,i+h-g,v])}u=f}if(o<0)return c;a=a>>1}}function sO(t,e,r,n,i,s){let a=r-e,o=s-i;if(a<o){let l=sO(n,i,s,t,e,r);return l&&[l[1],l[0],l[2]]}return a<4||o*2<a?null:ly(t,e,r,n,i,s,Math.floor(a/4),-1)}function HF(t,e,r,n,i,s){dy=!0;let a=r-e,o=s-i,l;if(a<o){let d=ly(n,i,s,t,e,r,Math.floor(a/6),50);l=d&&[d[1],d[0],d[2]]}else l=ly(t,e,r,n,i,s,Math.floor(o/6),50);if(!l)return[new bt(e,r,i,s)];let[c,u,f]=l;return Ba(t,e,c,n,i,u).concat(Ba(t,c+f,r,n,u+f,s))}function aO(t,e){for(let r=1;r<t.length;r++){let n=t[r-1],i=t[r];n.toA>i.fromA-e&&n.toB>i.fromB-e&&(t[r-1]=new bt(n.fromA,i.toA,n.fromB,i.toB),t.splice(r--,1))}}function Vz(t,e,r){for(;;){aO(r,1);let n=!1;for(let i=0;i<r.length;i++){let s=r[i],a,o;(a=hy(t,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=r[i]=new bt(s.fromA+a,s.toA,s.fromB+a,s.toB)),(o=py(t,s.fromA,s.toA,e,s.fromB,s.toB))&&(s=r[i]=new bt(s.fromA,s.toA-o,s.fromB,s.toB-o));let l=s.toA-s.fromA,c=s.toB-s.fromB;if(l&&c)continue;let u=s.fromA-(i?r[i-1].toA:0),f=(i<r.length-1?r[i+1].fromA:t.length)-s.toA;if(!u||!f)continue;let d=l?t.slice(s.fromA,s.toA):e.slice(s.fromB,s.toB);u<=d.length&&t.slice(s.fromA-u,s.fromA)==d.slice(d.length-u)?(r[i]=new bt(s.fromA-u,s.toA-u,s.fromB-u,s.toB-u),n=!0):f<=d.length&&t.slice(s.toA,s.toA+f)==d.slice(0,f)&&(r[i]=new bt(s.fromA+f,s.toA+f,s.fromB+f,s.toB+f),n=!0)}if(!n)break}return r}function Yz(t,e,r){for(let n=0,i=0;i<t.length;i++){let s=t[i],a=s.toA-s.fromA,o=s.toB-s.fromB;if(a&&o||a>3||o>3){let l=i==t.length-1?e.length:t[i+1].fromA,c=s.fromA-n,u=l-s.toA,f=GF(e,s.fromA,c),d=UF(e,s.toA,u),h=s.fromA-f,m=d-s.toA;if((!a||!o)&&h&&m){let g=Math.max(a,o),[v,w,b]=a?[e,s.fromA,s.toA]:[r,s.fromB,s.toB];g>h&&e.slice(f,s.fromA)==v.slice(b-h,b)?(s=t[i]=new bt(f,f+a,s.fromB-h,s.toB-h),f=s.fromA,d=UF(e,s.toA,l-s.toA)):g>m&&e.slice(s.toA,d)==v.slice(w,w+m)&&(s=t[i]=new bt(d-a,d,s.fromB+m,s.toB+m),d=s. Line truncated
`),s=e.split(`
`);for(let a of r){let{oldStart:o,oldLines:l,newStart:c,newLines:u}=a,f=Nt.createHunk(o,l,c,u);if(a.oldLines>0){for(let d=o;d<o+l;d++)f.removed.lines.push(i[d-1]);o+l>i.length&&i.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(a.newLines>0){for(let d=c;d<c+u;d++)f.added.lines.push(s[d-1]);c+u>s.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}n.push(f)}return n}function wy(t,e,r){let n=e.lineAt(t.fromA).number,i=t.fromA==t.toA?0:_p(e,t.endA)-n+1,s=r.lineAt(t.fromB).number,a=t.fromB==t.toB?0:_p(r,t.endB)-s+1,o={oldStart:n,oldLines:i,newStart:s,newLines:a};return o.oldLines==0&&(o.oldStart-=1),o.newLines==0&&(o.newStart-=1),o}var vO={scanLimit:1e3,timeout:200};function uV(t,e,r,n){let i=gy.Text.of(t.split(`
`)),s=gy.Text.of(e.split(`
`)),a=r&&n?ts.updateB(r,i,s,n,vO):ts.build(i,s,vO),o=[];for(let l=0;l<a.length;l++){let c=a[l],u=wy(c,i,s);o.push(u)}return{hunks:vy(t,e,o),chunks:a}}function wO(t,e,r,n){return uV(t,e,r,n)}var Bl=require("obsidian");function _p(t,e){let r=t.lineAt(e);return!(r.text.length==0&&r.number==t.lines)?r.number:r.number-1}var Gn=class{static hasHunksData(e){let r=e.field($r,!1);return!!r&&!r.isDirty}static getHunks(e,r){let n=e.field($r);return n?r?n.stagedHunks:n.hunks:[]}static getHunkAtPos(e,r,n){if(!e.field($r))return;let s=e.doc.lineAt(r).number,a=this.getHunks(e,n);return Nt.findHunk(s,a)[0]}static getCursorHunk(e,r){if(!e.field($r))return;let i=e.selection.main.head;return this.getHunkAtPos(e,i,r)}static getHunk(e,r,n){if(n!=null)return this.getHunkAtPos(e,n,r);if(e.selection.main.empty)return this.getCursorHunk(e,r);let i=e.selection.main.from,s=e.selection.main.to,a=e.doc.lineAt(i).number,o=_p(e.doc,s),l=this.getHunks(e,r),c=Nt.createPartialHunk(l,a,o);if(!c)return;let u=e.field($r);if(r){let f=a,d=o;for(let h of u.hunks)a>h.vend&&(f=f-(h.added.count-h.removed.count)),o>h.vend&&(d=d-(h.added.count-h.removed.count));c.added.lines=u.compareText.split(`
`).slice(f-1,d),u.compareTextHead?c.removed.lines=u.compareTextHead.split(`
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count):c.removed.lines=[]}else c.added.lines=e.doc.toString().split(`
`).slice(a-1,o),o===e.doc.lines&&!e.doc.toString().endsWith(`
`)&&(c.added.no_nl_at_eof=!0),c.removed.lines=u.compareText.split(`
`).slice(c.removed.start-1,c.removed.start-1+c.removed.count),c.removed.start+c.removed.count-1===u.compareText.split(`
`).length&&!u.compareText.endsWith(`
`)&&(c.removed.no_nl_at_eof=!0);return c}},$r=Nl.StateField.define({create:t=>{},update:(t,e)=>{let r=t?{...t}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},n=!1;for(let i of e.effects)i.is(Hl)&&(r.compareText=i.value.compareText,r.compareTextHead=i.value.compareTextHead,n=(t==null?void 0:t.compareText)!==i.value.compareText,n&&(r.chunks=void 0)),i.is(Vu)&&yO(r,i.value,e.state);if(r.compareText!==void 0){if(n||e.docChanged){r.isDirty=!0;let i=fV(e,r.compareText,r.chunks,r.maxDiffTimeMs);i&&yO(r,i,e.state)}}else r.compareText=void 0,r.compareTextHead=void 0,r.chunks=void 0,r.hunks=[],r.stagedHunks=[],r.isDirty=!1;return r}});function yO(t,e,r){var i,s;t.hunks=e.hunks,t.chunks=e.chunks,t.isDirty=!1,t.maxDiffTimeMs=Math.max(.95*t.maxDiffTimeMs,e.diffDuration);let n=r.field(Bl.editorInfoField).file;(s=(i=Ln.plugin)==null?void 0:i.editorIntegration.signsFeature.changeStatusBar)==null||s.display(t.hunks,n)}var yy=Nl.StateField.define({create:()=>({debouncer:(0,Bl.debounce)(t=>{let{state:e,compareText:r,previousChunks:n,changeDesc:i}=t,s=bO(e,r,n,i);e.field(Bl.editorEditorField).dispatch({effects:Vu.of(s)})},1e3,!0),maxDiffTimeMs:0}),update:(t,e)=>{var r;for(let n of e.effects)if(n.is(Vu))return t.changeDesc=void 0,t;return!t.changeDesc&&e.changes?t.changeDesc=e.changes:t.changeDesc=(r=t.changeDesc)==null?void 0:r.composeDesc(e.changes),t}});function bO(t,e,r,n){let i=t.doc.toString(),s=performance.now(),{hunks:a,chunks:o}=wO(e,i,r,n),l=performance.now()-s;return{hunks:a,chunks:o,diffDuration:l}}function fV(t,e,r,n){let i=t.state,s=Math.abs(t.changes.length-t.changes.newLength),a=i.field(yy);if(s>1e3||n>16)a.debouncer({state:i,compareText:e,previousChunks:r,changeDesc:a.changeDesc});else return a.changeDesc=void 0,bO(i,e,r,t.changes)}var Hl=Nl.StateEffect.define(),Vu=Nl.StateEffect.define();function _O(t,e){return e.update({effects:Hl.of(t)})}p();p();p();var rt;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(rt||(rt={}));var xO={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},SO={LINES:"lines",WORDS:"words",NONE:"none"},EO={WORD:"word",CHAR:"char"},Ua;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(Ua||(Ua={}));p();var dV=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],hV=RegExp("["+dV.join("\\")+"]","g");function kO(t){return t.replace(hV,"\\$&")}function by(t){return t&&t.replace(/\\/g,"/")}function AO(t){let e,r,n,i=0;for(e=0,n=t.length;e<n;e++)r=t.charCodeAt(e),i=(i<<5)-i+r,i|=0;return i}function xp(t){let e=t.length,r=-1/0;for(let n=0;n<e;n++)r=Math.max(r,t[n]);return r}function CO(t,e){let r=t.split(".");return r.length>1?r[r.length-1]:e}function TO(t,e){return e.reduce((r,n)=>r||t.startsWith(n),!1)}var PO=["a/","b/","i/","w/","c/","o/"];function Vs(t,e,r){let n=r!==void 0?[...PO,r]:PO,i=e?new RegExp(`^${kO(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=i.exec(t)||[],a=n.find(l=>s.indexOf(l)===0);return(a?s.slice(a.length):s).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function pV(t,e){return Vs(t,"---",e)}function mV(t,e){return Vs(t,"+++",e)}function RO(t,e={}){let r=[],n=null,i=null,s=null,a=null,o=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,m=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,v=/^new file mode (\d{6})/,w=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,k=/^rename from "?(.+)"?/,x=/^rename to "?(.+)"?/,E=/^similarity index (\d+)%/,A=/^dissimilarity index (\d+)%/,y=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,S=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,C=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,P=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,N=/^new file mode (\d{6})/,B=/^deleted file mode (\d{6}),(\d{6})/,H=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,`
`).split(`
`);function ce(){i!==null&&n!==null&&(n.blocks.push(i),i=null)}function Pe(){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 ve(){ce(),Pe(),n={blocks:[],deletedLines:0,addedLines:0}}function ie(W){ce();let X;n!==null&&((X=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(W))?(n.isCombined=!1,s=parseInt(X[1],10),o=parseInt(X[2],10)):(X=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(W))?(n.isCombined=!0,s=parseInt(X[1],10),a=parseInt(X[2],10),o=parseInt(X[3],10)):(W.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,o=0,n.isCombined=!1)),i={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:o,header:W}}function xe(W){if(n===null||i===null||s===null||o===null)return;let X={content:W},q=n.isCombined?["+ "," +","++"]:["+"],De=n.isCombined?["- "," -","--"]:["-"];TO(W,q)?(n.addedLines++,X.type=rt.INSERT,X.oldNumber=void 0,X.newNumber=o++):TO(W,De)?(n.deletedLines++,X.type=rt.DELETE,X.oldNumber=s++,X.newNumber=void 0):(X.type=rt.CONTEXT,X.oldNumber=s++,X.newNumber=o++),i.lines.push(X)}function we(W,X){let q=X;for(;q<H.length-3;){if(W.startsWith("diff"))return!1;if(H[q].startsWith(u)&&H[q+1].startsWith(f)&&H[q+2].startsWith(d))return!0;q++}return!1}return H.forEach((W,X)=>{if(!W||W.startsWith("*"))return;let q,De=H[X-1],ar=H[X+1],Ft=H[X+2];if(W.startsWith("diff --git")||W.startsWith("diff --combined")){if(ve(),(q=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(W))&&(l=Vs(q[1],void 0,e.dstPrefix),c=Vs(q[2],void 0,e.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isGitDiff=!0;return}if(W.startsWith("Binary files")&&!(n!=null&&n.isGitDiff)){if(ve(),(q=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(W))&&(l=Vs(q[1],void 0,e.dstPrefix),c=Vs(q[2],void 0,e.srcPrefix)),n===null)throw new Error("Where is my file !!!");n.isBinary=!0;return}if((!n||!n.isGitDiff&&n&&W.startsWith(u)&&ar.startsWith(f)&&Ft.startsWith(d))&&ve(),n!=null&&n.isTooBig)return;if(n&&(typeof e.diffMaxChanges=="number"&&n.addedLines+n.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&W.length>e.diffMaxLineLength)){n.isTooBig=!0,n.addedLines=0,n.deletedLines=0,n.blocks=[],i=null;let kt=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";ie(kt);return}if(W.startsWith(u)&&ar.startsWith(f)||W.startsWith(f)&&De.startsWith(u)){if(n&&!n.oldName&&W.startsWith("--- ")&&(q=pV(W,e.srcPrefix))){n.oldName=q,n.language=CO(n.oldName,n.language);return}if(n&&!n.newName&&W.startsWith("+++ ")&&(q=mV(W,e.dstPrefix))){n.newName=q,n.language=CO(n.newName,n.language);return}}if(n&&(W.startsWith(d)||n.isGitDiff&&n.oldName&&n.newName&&!i)){ie(W);return}if(i&&(W.startsWith("+")||W.startsWith("-")||W.startsWith(" "))){xe(W);return}let Ie=!we(W,X);if(n===null)throw new Error("Where is my file !!!");(q=h.exec(W))?n.oldMode=q[1]:(q=m.exec(W))?n.newMode=q[1]:(q=g.exec(W))?(n.deletedFileMode=q[1],n.isDeleted=!0):(q=v.exec(W))?(n.newFileMode=q[1],n.isNew=!0):(q=w.exec(W))?(Ie&&(n.oldName=q[1]),n.isCopy=!0):(q=b.exec(W))?(Ie&&(n.newName=q[1]),n.isCopy=!0):(q=k.exec(W))?(Ie&&(n.oldName=q[1]),n.isRename=!0):(q=x.exec(W))?(Ie&&(n.newName=q[1]),n.isRename=!0):(q=S.exec(W))?(n.isBinary=!0,n.oldName=Vs(q[1],void 0,e.srcPrefix),n.newName=Vs(q[2],void 0,e.dstPrefix),ie("Binary file")):_.test(W)?(n.isBinary=!0,ie(W)):(q=E.exec(W))?n.unchangedPercentage=parseInt(q[1],10):(q=A.exec(W))?n.changedPercentage=parseInt(q[1],10):(q=y.exec(W))?(n.checksumBefore=q[1],n.checksumAfter=q[2],q[3]&&(n.mode=q[3])):(q=C.exec(W))?(n.checksumBefore=[q[2],q[3]],n.checksumAfter=q[1]):(q=P.exec(W))?(n.oldMode=[q[2],q[3]],n.newMode=q[1]):(q=N.exec(W))?(n.newFileMode=q[1],n.isNew=!0):(q=B.exec(W))&&(n.deletedFileMode=q[1],n.isDeleted=!0)}),ce(),Pe(),r}p();p();p();function vV(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}function Ul(t){return(e,r)=>{let n=t(e).trim(),i=t(r).trim();return vV(n,i)/(n.length+i.length)}}function Gl(t){function e(n,i,s=new Map){let a=1/0,o;for(let l=0;l<n.length;++l)for(let c=0;c<i.length;++c){let u=JSON.stringify([n[l],i[c]]),f;s.has(u)&&(f=s.get(u))||(f=t(n[l],i[c]),s.set(u,f)),f<a&&(a=f,o={indexA:l,indexB:c,score:a})}return o}function r(n,i,s=0,a=new Map){let o=e(n,i,a);if(!o||n.length+i.length<3)return[[n,i]];let l=n.slice(0,o.indexA),c=i.slice(0,o.indexB),u=[n[o.indexA]],f=[i[o.indexB]],d=o.indexA+1,h=o.indexB+1,m=n.slice(d),g=i.slice(h),v=r(l,c,s+1,a),w=r(u,f,s+1,a),b=r(m,g,s+1,a),k=w;return(o.indexA>0||o.indexB>0)&&(k=v.concat(k)),(n.length>d||i.length>h)&&(k=k.concat(b)),k}return r}var qt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO: Line truncated
`);return this.hoganUtils.render(IO,"wrapper",{colorScheme:ql(this.config.colorScheme),filesNumber:e.length,files:r})}};p();var Ey=Object.assign(Object.assign({},Ga),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Yu="generic",FO="line-by-line",EV="icon",kV="tag",Xu=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Ey),r)}render(e){let r=e.map(n=>{let i;return n.blocks.length?i=this.generateFileHtml(n):i=this.generateEmptyDiff(),this.makeFileDiffHtml(n,i)}).join(`
`);return this.hoganUtils.render(Yu,"wrapper",{colorScheme:ql(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let n=this.hoganUtils.template(FO,"file-diff"),i=this.hoganUtils.template(Yu,"file-path"),s=this.hoganUtils.template(EV,"file"),a=this.hoganUtils.template(kV,zl(e));return n.render({file:e,fileHtmlId:Wl(e),diffs:r,filePath:i.render({fileDiffName:ja(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return this.hoganUtils.render(Yu,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:qt})}generateFileHtml(e){let r=Gl(Ul(n=>Sn(n.content,e.isCombined).content));return e.blocks.map(n=>{let i=this.hoganUtils.render(Yu,"block-header",{CSSLineClass:qt,blockHeader:e.isTooBig?n.header:Ys(n.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(n).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);i+=u,i+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=Sn(l.content,e.isCombined);i+=this.generateSingleLineHtml(e,{type:qt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,a,o);i+=l,i+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),i}).join(`
`)}applyLineGroupping(e){let r=[],n=[],i=[];for(let s=0;s<e.lines.length;s++){let a=e.lines[s];(a.type!==rt.INSERT&&i.length||a.type===rt.CONTEXT&&n.length>0)&&(r.push([[],n,i]),n=[],i=[]),a.type===rt.CONTEXT?r.push([[a],[],[]]):a.type===rt.INSERT&&n.length===0?r.push([[],[],[a]]):a.type===rt.INSERT&&n.length>0?i.push(a):a.type===rt.DELETE&&n.push(a)}return(n.length||i.length)&&(r.push([[],n,i]),n=[],i=[]),r}applyRematchMatching(e,r,n){let i=e.length*r.length,s=xp(e.concat(r).map(o=>o.content.length));return i<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(e,r):[[e,r]]}processChangedLines(e,r,n,i){let s={right:"",left:""},a=Math.max(n.length,i.length);for(let o=0;o<a;o++){let l=n[o],c=i[o],u=l!==void 0&&c!==void 0?Sp(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:qt.DELETE_CHANGES}:Object.assign(Object.assign({},Sn(l.content,r)),{type:jl(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:qt.INSERT_CHANGES}:Object.assign(Object.assign({},Sn(c.content,r)),{type:jl(c.type)})),{oldNumber:c.oldNumber,newNumber:c.newNumber}):void 0,{left:h,right:m}=this.generateLineHtml(e,f,d);s.left+=h,s.right+=m}return s}generateLineHtml(e,r,n){return{left:this.generateSingleLineHtml(e,r),right:this.generateSingleLineHtml(e,n)}}generateSingleLineHtml(e,r){if(r===void 0)return"";let n=this.hoganUtils.render(FO,"numbers",{oldNumber:r.oldNumber||"",newNumber:r.newNumber||""});return this.hoganUtils.render(Yu,"line",{type:r.type,lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line",prefix:r.prefix===" "?"&nbsp;":r.prefix,content:r.content,lineNumber:n,line:r,file:e})}};p();var ky=Object.assign(Object.assign({},Ga),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Zu="generic",AV="side-by-side",CV="icon",TV="tag",Ku=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},ky),r)}render(e){let r=e.map(n=>{let i;return n.blocks.length?i=this.generateFileHtml(n):i=this.generateEmptyDiff(),this.makeFileDiffHtml(n,i)}).join(`
`);return this.hoganUtils.render(Zu,"wrapper",{colorScheme:ql(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let n=this.hoganUtils.template(AV,"file-diff"),i=this.hoganUtils.template(Zu,"file-path"),s=this.hoganUtils.template(CV,"file"),a=this.hoganUtils.template(TV,zl(e));return n.render({file:e,fileHtmlId:Wl(e),diffs:r,filePath:i.render({fileDiffName:ja(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Zu,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:qt})}}generateFileHtml(e){let r=Gl(Ul(n=>Sn(n.content,e.isCombined).content));return e.blocks.map(n=>{let i={left:this.makeHeaderHtml(n.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(n).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);i.left+=u,i.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=Sn(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:qt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:qt.CONTEXT,prefix:c,content:u,number:l.newNumber});i.left+=f,i.right+=d});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,a,o);i.left+=l,i.right+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),i}).reduce((n,i)=>({left:n.left+i.left,right:n.right+i.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],n=[],i=[];for(let s=0;s<e.lines.length;s++){let a=e.lines[s];(a.type!==rt.INSERT&&i.length||a.type===rt.CONTEXT&&n.length>0)&&(r.push([[],n,i]),n=[],i=[]),a.type===rt.CONTEXT?r.push([[a],[],[]]):a.type===rt.INSERT&&n.length===0?r.push([[],[],[a]]):a.type===rt.INSERT&&n.length>0?i.push(a):a.type===rt.DELETE&&n.push(a)}return(n.length||i.length)&&(r.push([[],n,i]),n=[],i=[]),r}applyRematchMatching(e,r,n){let i=e.length*r.length,s=xp(e.concat(r).map(o=>o.content.length));return i<this.config.matchingMaxComparisons&&s<this.config.maxLineSizeInBlockForComparison&&(this.config.matching==="lines"||this.config.matching==="words")?n(e,r):[[e,r]]}makeHeaderHtml(e,r){return this.hoganUtils.render(Zu,"block-header",{CSSLineClass:qt,blockHeader:r!=null&&r.isTooBig?e:Ys(e),lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})}processChangedLines(e,r,n){let i={right:"",left:""},s=Math.max(r.length,n.length);for(let a=0;a<s;a++){let o=r[a],l=n[a],c=o!==void 0&&l!==void 0?Sp(o.content,l.content,e,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:qt.DELETE_CHANGES}:Object.assign(Object.assign({},Sn(o.content,e)),{type:jl(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:qt.INSERT_CHANGES}:Object.assign(Object.assign({},Sn(l.content,e)),{type:jl(l.type)})),{number:l.newNumber}):void 0,{left:d,right:h}=this.generateLineHtml(u,f);i.left+=d,i.right+=h}return i}generateLineHtml(e,r){return{left:this.generateSingleHtml(e),right:this.generateSingleHtml(r)}}generateSingleHtml(e){let r="d2h-code-side-linenumber",n="d2h-code-side-line";return this.hoganUtils.render(Zu,"line",{type:(e==null?void 0:e.type)||`${qt.CONTEXT} d2h-emptyplaceholder`,lineClass:e!==void 0?r:`${r} d2h-code-side-emptyplaceholder`,contentClass:e!==void 0?n:`${n} d2h-code-side-emptyplaceholder`,prefix:(e==null?void 0:e.prefix)===" "?"&nbsp;":e==null?void 0:e.prefix,content:e==null?void 0:e.content,lineNumber:e==null?void 0:e.number})}};p();var Py=Ct(Ty());p();var _t=Ct(Ty()),gt={};gt["file-summary-line"]=new _t.Template({code:function(t,e,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",t,e," ")),n.b(' <a href="#'),n.b(n.v(n.f("fileHtmlId",t,e,0))),n.b('" class="d2h-file-name">'),n.b(n.v(n.f("fileName",t,e,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",t,e,0))),n.b("</span>"),n.b(`
`+r),n.b(' <span class="d2h-lines-deleted">'),n.b(n.v(n.f("deletedLines",t,e,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:{}});gt["file-summary-wrapper"]=new _t.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div class="d2h-file-list-wrapper '),n.b(n.v(n.f("colorScheme",t,e,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",t,e,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",t,e,0))),n.b(`
`+r),n.b(" </ol>"),n.b(`
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});gt["generic-block-header"]=new _t.Template({code:function(t,e,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",t,e,0))),n.b(" "),n.b(n.v(n.d("CSSLineClass.INFO",t,e,0))),n.b('"></td>'),n.b(`
`+r),n.b(' <td class="'),n.b(n.v(n.d("CSSLineClass.INFO",t,e,0))),n.b('">'),n.b(`
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",t,e,0))),n.b('">'),n.s(n.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(n.rs(t,e,function(i,s,a){a.b(a.t(a.f("blockHeader",i,s,0)))}),t.pop()),n.s(n.f("blockHeader",t,e,1),t,e,1,0,0,"")||n.b("&nbsp;"),n.b("</div>"),n.b(`
`+r),n.b(" </td>"),n.b(`
`+r),n.b("</tr>"),n.fl()},partials:{},subs:{}});gt["generic-empty-diff"]=new _t.Template({code:function(t,e,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",t,e,0))),n.b('">'),n.b(`
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",t,e,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:{}});gt["generic-file-path"]=new _t.Template({code:function(t,e,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",t,e," ")),n.b(' <span class="d2h-file-name">'),n.b(n.v(n.f("fileDiffName",t,e,0))),n.b("</span>"),n.b(`
`+r),n.b(n.rp("<fileTag1",t,e," ")),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:{}});gt["generic-line"]=new _t.Template({code:function(t,e,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",t,e,0))),n.b(" "),n.b(n.v(n.f("type",t,e,0))),n.b('">'),n.b(`
`+r),n.b(" "),n.b(n.t(n.f("lineNumber",t,e,0))),n.b(`
`+r),n.b(" </td>"),n.b(`
`+r),n.b(' <td class="'),n.b(n.v(n.f("type",t,e,0))),n.b('">'),n.b(`
`+r),n.b(' <div class="'),n.b(n.v(n.f("contentClass",t,e,0))),n.b('">'),n.b(`
`+r),n.s(n.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(n.rs(t,e,function(i,s,a){a.b(' <span class="d2h-code-line-prefix">'),a.b(a.t(a.f("prefix",i,s,0))),a.b("</span>"),a.b(`
`+r)}),t.pop()),n.s(n.f("prefix",t,e,1),t,e,1,0,0,"")||(n.b(' <span class="d2h-code-line-prefix">&nbsp;</span>'),n.b(`
`+r)),n.s(n.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(n.rs(t,e,function(i,s,a){a.b(' <span class="d2h-code-line-ctn">'),a.b(a.t(a.f("content",i,s,0))),a.b("</span>"),a.b(`
`+r)}),t.pop()),n.s(n.f("content",t,e,1),t,e,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:{}});gt["generic-wrapper"]=new _t.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div class="d2h-wrapper '),n.b(n.v(n.f("colorScheme",t,e,0))),n.b('">'),n.b(`
`+r),n.b(" "),n.b(n.t(n.f("content",t,e,0))),n.b(`
`+r),n.b("</div>"),n.fl()},partials:{},subs:{}});gt["icon-file-added"]=new _t.Template({code:function(t,e,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:{}});gt["icon-file-changed"]=new _t.Template({code:function(t,e,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:{}});gt["icon-file-deleted"]=new _t.Template({code:function(t,e,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:{}});gt["icon-file-renamed"]=new _t.Template({code:function(t,e,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:{}});gt["icon-file"]=new _t.Template({code:function(t,e,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:{}});gt["line-by-line-file-diff"]=new _t.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",t,e,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",t,e,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",t,e,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",t,e,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:{}});gt["line-by-line-numbers"]=new _t.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div class="line-num1">'),n.b(n.v(n.f("oldNumber",t,e,0))),n.b("</div>"),n.b(`
`+r),n.b('<div class="line-num2">'),n.b(n.v(n.f("newNumber",t,e,0))),n.b("</div>"),n.fl()},partials:{},subs:{}});gt["side-by-side-file-diff"]=new _t.Template({code:function(t,e,r){var n=this;return n.b(r=r||""),n.b('<div id="'),n.b(n.v(n.f("fileHtmlId",t,e,0))),n.b('" class="d2h-file-wrapper" data-lang="'),n.b(n.v(n.d("file.language",t,e,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",t,e,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",t,e,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",t,e,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:{}});gt["tag-file-added"]=new _t.Template({code:function(t,e,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:{}});gt["tag-file-changed"]=new _t.Template({code:function(t,e,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:{}});gt["tag-file-deleted"]=new _t.Template({code:function(t,e,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:{}});gt["tag-file-renamed"]=new _t.Template({code:function(t,e,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 Qu=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let n=Object.entries(r).reduce((i,[s,a])=>{let o=Py.compile(a,{asString:!1});return Object.assign(Object.assign({},i),{[s]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},gt),e),n)}static compile(e){return Py.compile(e,{asString:!1})}render(e,r,n,i,s){let a=this.templateKey(e,r);try{return this.preCompiledTemplates[a].render(n,i,s)}catch(o){throw new Error(`Could not find template to render '${a}'`)}}template(e,r){return this.preCompiledTemplates[this.templateKey(e,r)]}templateKey(e,r){return`${e}-${r}`}};var RV=Object.assign(Object.assign(Object.assign({},Ey),ky),{outputFormat:xO.LINE_BY_LINE,drawFileList:!0});function Ap(t,e={}){let r=Object.assign(Object.assign({},RV),e),n=typeof t=="string"?RO(t,r):t,i=new Qu(r),{colorScheme:s}=r,a={colorScheme:s},o=r.drawFileList?new Ep(i,a).render(n):"",l=r.outputFormat==="side-by-side"?new Ku(i,r).render(n):new Xu(i,r).render(n);return o+l}var UO=Ct(BO());var qa=require("obsidian"),Ry=Ju.StateEffect.define();function Xs(t,e){let r=t.state,n=r.field(Tp),i=r.field($r),s=r.doc.lineAt(e!=null?e:r.selection.main.head).number,a=Nt.findHunk(s,i==null?void 0:i.hunks)[0];if(!a)return;let o=r.doc.line(Math.max(1,a.added.start)).from,l=n.has(o);return r.field(qa.editorEditorField).dispatch({effects:Ry.of({pos:o,add:!l})})}var Tp=Ju.StateField.define({create:()=>new Set,update(t,e){let r=new Set;for(let n of e.effects)n.is(Ry)&&(n.value.add?t.add(n.value.pos):t.delete(n.value.pos));for(let n of t)r.add(e.changes.mapPos(n));return r}}),GO=Ju.StateField.define({create:t=>HO(t),update(t,e){return e.docChanged||e.effects.some(r=>r.is(Hl)||r.is(Ry))?HO(e.state):t},provide:t=>Cp.showTooltip.computeN([t],e=>e.field(t))}),jO=Cp.EditorView.baseTheme({".cm-tooltip.git-diff-tooltip":{"z-index":"var(--layer-popover)",backgroundColor:"var(--background-primary-alt)",border:"var(--border-width) solid var(--background-primary-alt)",borderRadius:"var(--radius-s)"},".cm-tooltip.git-diff-tooltip .tooltip-toolbar":{display:"flex",padding:"var(--size-2-1)"}});function HO(t){let e=t.field($r);return e?[...t.field(Tp)].map(n=>{let i=t.doc.lineAt(n),s=Nt.findHunk(i.number,e.hunks)[0];if(s)return{pos:n,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>$V(s,t,n)}}).filter(n=>n!==void 0):[]}function $V(t,e,r){var g,v;let n=Nt.createPatch("file",[t],"10064",!1).join(`
`)+`
`,i=Ap(n,{colorScheme:UO.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(i,"text/html").querySelector(".d2h-file-diff"),a=document.createElement("div"),o=document.createElement("div");o.addClass("tooltip-toolbar");let l=(w,b)=>{let k=document.createElement("div");return(0,qa.setIcon)(k,w),k.setAttr("aria-label",b),k.addClass("clickable-icon"),k},c=l("x","Close hunk"),u=l("plus","Stage hunk"),f=l("undo","Reset hunk");o.appendChild(c),o.appendChild(u),o.appendChild(f),a.appendChild(o),a.appendChild(s),a.addClass("git-diff-tooltip","git-diff");let d=e.field(qa.editorEditorField);c.onclick=()=>{Xs(d,r)},u.onclick=()=>{let w=Ln.plugin;w&&(w.promiseQueue.addTask(()=>w.hunkActions.stageHunk(r)),Xs(d,r))},f.onclick=()=>{let w=Ln.plugin;w&&(w.hunkActions.resetHunk(r),Xs(d,r))};let h=(v=(g=Ln.plugin)==null?void 0:g.app.workspace.getActiveViewOfType(qa.MarkdownView))==null?void 0:v.scope,m=h==null?void 0:h.register(null,"Escape",(w,b)=>{Xs(d,r)});return{dom:a,destroy:()=>{m&&(h==null||h.unregister(m))},update:w=>{r=w.changes.mapPos(r)}}}function qO(t){let e=t.app;t.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let r=t.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(r)||await e.vault.adapter.write(r,"");let n=await e.vault.adapter.read(r),s=await new dp(e,n).openAndGetReslt();s!==void 0&&(await e.vault.adapter.write(r,s),await t.refresh())}}),t.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var i;let r=e.workspace.getLeavesOfType(jt.type),n;r.length===0?(n=(i=e.workspace.getRightLeaf(!1))!=null?i:e.workspace.getLeaf(),await n.setViewState({type:jt.type})):n=r.first(),await e.workspace.revealLeaf(n),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var i;let r=e.workspace.getLeavesOfType(gn.type),n;r.length===0?(n=(i=e.workspace.getRightLeaf(!1))!=null?i:e.workspace.getLeaf(),await n.setViewState({type:gn.type})):n=r.first(),await e.workspace.revealLeaf(n),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:r=>{let n=e.workspace.getActiveFile();if(r)return n!==null;{let i=t.gitManager.getRelativeRepoPath(n.path,!0);t.tools.openDiff({aFile:i,aRef:""})}}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(r,{file:n})=>{if(n)return IF(r,n,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(r,{file:n})=>{if(n)return FF(n,t.gitManager)}}),t.addCommand({id:"pull",name:"Pull",callback:()=>t.promiseQueue.addTask(()=>t.pullChangesFromRemote())}),t.addCommand({id:"fetch",name:"Fetch",callback:()=>t.promiseQueue.addTask(()=>t.fetch())}),t.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>t.promiseQueue.addTask(()=>t.switchRemoteBranch())}),t.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:r=>{let n=e.workspace.getActiveFile();if(r)return n!==null;t.addFileToGitignore(n.path,n instanceof jn.TFolder).catch(i=>t.displayError(i))}}),t.addCommand({id:"push",name:"Commit-and-sync",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1}))}),t.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>t.promiseQueue.addTask(async()=>{await t.commitAndSync({fromAutoBackup:!1}),window.close()})}),t.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit",name:"Commit all changes",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1}))}),t.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit-smart",name:"Commit",callback:()=>t.promiseQueue.addTask(async()=>{let n=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:n})})}),t.addCommand({id:"commit-staged",name:"Commit staged",checkCallback:function(r){if(r)return!1;t.promiseQueue.addTask(async()=>t.commit({fromAuto:!1,requestCustomMessage:!1}))}}),jn.Platform.isDesktopApp&&t.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),t.addCommand({id:"commit-smart-specified-message",name:"Commit with specific message",callback:()=>t.promiseQueue.addTask(async()=>{let n=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:n})})}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",checkCallback:function(r){return Line truncated
- ${s.map(o=>o.vaultPath).join(`
- `)}
Please remove them or add to .gitignore.`),!0}return!1}async writeAndOpenFile(e){e!==void 0&&await this.plugin.app.vault.adapter.write(ol,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(n=>{n.getDisplayText()!=""&&ol.startsWith(n.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(ol,"/",!0)}openDiff({aFile:e,bFile:r,aRef:n,bRef:i,event:s}){var l,c;let a=this.plugin.settings.diffStyle;Vl.Platform.isMobileApp&&(a="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:n,bRef:i};a=="split"?(l=Bn(this.plugin.app,s))==null||l.setViewState({type:Ns.type,active:!0,state:o}):a=="git_unified"&&((c=Bn(this.plugin.app,s))==null||c.setViewState({type:Bs.type,active:!0,state:o}))}async runRawCommand(){let e=this.plugin.gitManager;if(!(e instanceof Se))return;let n=await new Ze(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();n!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let i=new Vl.Notice(`Running '${n}'...`,999999);try{let s=await e.rawCommand(n);s?(i.setMessage(s),window.setTimeout(()=>i.hide(),5e3)):i.hide()}catch(s){throw i.hide(),s}})}};p();var Rp=require("obsidian");var Wa=class extends Rp.ItemView{constructor(r,n){super(r);this.plugin=n;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.contentEl.addClass("git-diff"),this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return Bs.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 Bs.name}getIcon(){return Bs.icon}async setState(r,n){this.state=r,Rp.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 Se&&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 s=await this.app.vault.adapter.read(i);n=[...`--- /dev/null
+++ ${this.state.bFile}
@@ -0,0 +1,${s.split(`
`).length} @@`.split(`
`),...s.split(`
`).map(o=>`+${o}`)].join(`
`)}}if(n){let s=this.parser.parseFromString(Ap(n),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(s)}else{let s=this.contentEl.createDiv({cls:"obsidian-git-center"});s.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),s.createEl("br"),s.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};p();var rs=require("obsidian");var Xl=require("@codemirror/commands");var $p=require("@codemirror/search"),Yl=require("@codemirror/state"),kn=require("@codemirror/view");var za=class extends rs.ItemView{constructor(r,n){super(r);this.plugin=n;this.refreshing=!1;this.ignoreNextModification=!1;this.navigation=!0,this.registerEvent(this.app.workspace.on("obsidian-git:status-changed",()=>{this.mergeView?this.updateRefEditors().catch(console.error):this.createMergeView().catch(console.error)})),this.intervalRef=window.setInterval(()=>{this.mergeView&&this.updateRefEditors().catch(console.error)},30*1e3),this.registerEvent(this.app.vault.on("modify",i=>{this.state.bRef==null&&i.path===this.state.bFile&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",i=>{this.state.bRef==null&&i.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",i=>{this.state.bRef==null&&i.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(i,s)=>{this.state.bRef==null&&(i.path===this.state.bFile||s===this.state.bFile)&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,rs.debounce)(i=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),i).catch(a=>this.plugin.displayError(a)))},1e3,!1)}getViewType(){return Ns.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let n=this.state.bFile.split("/").last();n!=null&&n.endsWith(".md")&&(n=n.slice(0,-3));let i;return this.state.bRef==null?i=" (Working Tree)":this.state.bRef==""?i=" (Index)":i="("+this.state.bRef.substring(0,7)+")",`Diff: ${n} ${i}`}return Ns.name}getIcon(){return Ns.icon}async setState(r,n){this.state=r,rs.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(r,n),await this.createMergeView()}getState(){return this.state}onClose(){return window.clearInterval(this.intervalRef),super.onClose()}async onOpen(){return await this.createMergeView(),super.onOpen()}async gitShow(r,n){try{return await this.plugin.gitManager.show(r,n,!1)}catch(i){if(i instanceof Pr&&(i.message.includes("does not exist")||i.message.includes("unknown revision or path")||i.message.includes("exists on disk, but not in")||i.message.includes("fatal: bad object")))return i.message.includes("fatal: bad object")&&this.plugin.displayError(i.message),"";throw i}}async bShouldBeEditable(){if(this.state.bRef!=null)return!1;let r=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);return await this.app.vault.adapter.exists(r)}async updateModifiableEditor(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.b;this.refreshing=!0;let n=await this.app.vault.adapter.read(this.state.bFile);if(n!=r.state.doc.toString()){let i=r.state.update({changes:{from:0,to:r.state.doc.length,insert:n},annotations:[Yl.Transaction.remote.of(!0)]});r.dispatch(i)}this.refreshing=!1}async updateRefEditors(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.a,n=this.mergeView.b;this.refreshing=!0;let i=await this.gitShow(this.state.aRef,this.state.aFile),s;if(this.state.bRef!=null&&(s=await this.gitShow(this.state.bRef,this.state.bFile)),i!=r.state.doc.toString()){let a=r.state.update({changes:{from:0,to:r.state.doc.length,insert:i}});r.dispatch(a)}if(s!=null&&s!=n.state.doc.toString()){let a=n.state.update({changes:{from:0,to:n.state.doc.length,insert:s}});n.dispatch(a)}this.refreshing=!1}renderButtons(){let r=document.createElement("div"),n=r.createDiv();if(n.addClass("clickable-icon"),n.setAttr("aria-label",this.state.bRef==null?"Stage hunk":"Unstage hunk"),(0,rs.setIcon)(n,this.state.bRef==null?"plus":"minus"),n.onmousedown=async i=>{var h;let s=this.mergeView.b,a=this.mergeView.a,o=my(s.state),l=(h=r.parentElement)==null?void 0:h.indexOf(r),c=o.chunks[l],u=wy(c,a.state.doc,s.state.doc),f=vy(this.mergeView.a.state.doc.toString(),this.mergeView.b.state.doc.toString(),[u])[0],d=Nt.createPatch(this.state.bFile,[f],"100644",this.state.bRef!=null).join(`
`)+`
`;await this.plugin.gitManager.applyPatch(d),this.plugin.app.workspace.trigger("obsidian-git:refresh")},this.state.bRef==null){let i=r.createDiv();i.addClass("clickable-icon"),i.setAttr("aria-label","Reset hunk"),(0,rs.setIcon)(i,"undo"),i.onmousedown=s=>{var f;let a=this.mergeView.a,o=this.mergeView.b,l=my(o.state),c=(f=r.parentElement)==null?void 0:f.indexOf(r),u=l.chunks[c];if(u){let d=u.fromA,h=u.toA,m=u.fromB,g=u.toB,v=a.state.sliceDoc(d,Math.max(d,h-1));d!=h&&g<=o.state.doc.length&&(v+=a.state.lineBreak),o.dispatch({changes:{from:m,to:Math.min(o.state.doc.length,g),insert:v},userEvent:"revert"})}}}return r.onmousedown=i=>{i.preventDefault(),i.stopPropagation()},r}async createMergeView(){var r,n,i;if((r=this.state)!=null&&r.aFile&&((n=this.state)!=null&&n.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0,(i=this.mergeView)==null||i.destroy();let s=this.containerEl.children[1];s.empty(),this.contentEl.addClass("git-split-diff-view","git-diff"),this.bIsEditable=await this.bShouldBeEditable();let a=await this.gitShow(this.state.aRef,this.state.aFile),o;if(this.state.bRef!=null)o=await this.gitShow(this.state.bRef,this.state.bFile);else{let g=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);await this.app.vault.adapter.exists(g)?o=await this.app.vault.adapter.read(g):o=""}let l=[(0,kn.lineNumbers)(),(0,$p.highlightSelectionMatches)(),(0,kn.drawSelection)(),kn.keymap.of([...Xl.standardKeymap,Xl.indentWithTab]),(0,Xl.history)(),(0,$p.search)(),kn.EditorView.lineWrapping],c=this,u=kn.ViewPlugin.define(g=>({update(v){if(v.docChanged&&!v.transactions.some(w=>w.annotation(Yl.Transaction.remote))){let w=g.state.doc.toString();c.fileSaveDebouncer(w)}}})),f={doc:a,extensions:[...l,kn.EditorView.editable.of(!1),Yl.EditorState.readOnly.of(!0)]},d=[...l];this.bIsEditable?d.push(u):d.push(kn.EditorView.editable.of(!1),Yl.EditorState.readOnly.of(!0));let h={doc:o,extensions:d};s.addClasses(["cm-s-obsidian","mod-cm6","markdown-source-view","cm-content"]);let m=this.plugin.gitManager instanceof Se&&(this.state.bRef===void 0||this.state.bRef==="");this.mergeView=new bp({b:h,a:f,collapseUnchanged:{minSize:6,margin:4},renderRevertControl:m?()=>this.renderButtons():void 0,revertControls:m?"a-to-b":void 0,diffConfig:{scanLimit:this.bIsEditable?1e3:1e4},parent:s}),this.refreshing=!1}}};p();var _D=require("obsidian");p();p();p();var WO="5";var zO,VO,YO;typeof window!="undefined"&&((YO=(VO=(zO=window.__svelte)!=null?zO:window.__svelte={}).v)!=null?YO:VO.v=new Set).add(WO);p();p();p();var tf="[",bi="[!",Va="]",ns={};var Ke=Symbol(),An=Symbol("filename"),XO=Symbol("hmr"),ZO="http://www.w3.org/1999/xhtml";p();p();p();p();var Ip=!0;p();var L=!1;p();var is=Array.isArray,KO=Array.prototype.indexOf,qn=Array.prototype.includes,Zl=Array.from,$y=Object.keys,Jt=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,Iy=Object.getOwnPropertyDescriptors,Fy=Object.prototype,QO=Array.prototype,Kl=Object.getPrototypeOf,Oy=Object.isExtensible;function My(t){return typeof t=="function"}var Fr=()=>{};function Fp(t){for(var e=0;e<t.length;e++)t[e]()}function Op(){var t,e,r=new Promise((n,i)=>{t=n,e=i});return{promise:r,resolve:t,reject:e}}p();p();var Wt=Symbol("$state"),rf=Symbol("legacy props"),JO=Symbol(""),Mp=Symbol("proxy path"),_i=new class extends Error{constructor(){super(...arguments);qe(this,"name","StaleReactionError");qe(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Ql=3,Or=8;p();p();function Dp(t){if(L){let e=new Error(`lifecycle_outside_component
\`${t}(...)\` can only be used during component initialisation
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function eM(){if(L){let t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function Dy(){if(L){let t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function tM(){if(L){let t=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function Ly(t,e,r){if(L){let n=new Error(`each_key_duplicate
${r?`Keyed each block has duplicate key \`${r}\` at indexes ${t} and ${e}`:`Keyed each block has duplicate key at indexes ${t} and ${e}`}
https://svelte.dev/e/each_key_duplicate`);throw n.name="Svelte error",n}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function rM(t){if(L){let e=new Error(`effect_in_teardown
\`${t}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function nM(){if(L){let t=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 t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function iM(t){if(L){let e=new Error(`effect_orphan
\`${t}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function sM(){if(L){let t=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function aM(){if(L){let t=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function oM(t){if(L){let e=new Error(`props_invalid_value
Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function lM(t){if(L){let e=new Error(`rune_outside_svelte
The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function cM(){if(L){let t=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 t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function uM(){if(L){let t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function fM(){if(L){let t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` 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 t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function dM(){if(L){let t=new Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}p();p();p();var Zs="font-weight: bold",Ks="font-weight: normal";function hM(t,e){L?console.warn(`%c[svelte] await_waterfall
%cAn async derived, \`${t}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
https://svelte.dev/e/await_waterfall`,Zs,Ks):console.warn("https://svelte.dev/e/await_waterfall")}function pM(t,e,r){L?console.warn(`%c[svelte] hydration_attribute_changed
%cThe \`${t}\` attribute on \`${e}\` 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`,Zs,Ks):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Ya(t){L?console.warn(`%c[svelte] hydration_mismatch
%c${t?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${t}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,Zs,Ks):console.warn("https://svelte.dev/e/hydration_mismatch")}function mM(){L?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,Zs,Ks):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Lp(t){L?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,Zs,Ks):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function gM(){L?console.warn(`%c[svelte] state_proxy_unmount
%cTried to unmount a state proxy, rather than a component
https://svelte.dev/e/state_proxy_unmount`,Zs,Ks):console.warn("https://svelte.dev/e/state_proxy_unmount")}function vM(){L?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Zs,Ks):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function wM(t){L?console.warn(`%c[svelte] transition_slide_display
%cThe \`slide\` transition does not work correctly for elements with \`display: ${t}\`
https://svelte.dev/e/transition_slide_display`,Zs,Ks):console.warn("https://svelte.dev/e/transition_slide_display")}var re=!1;function Bt(t){re=t}var ge;function Ge(t){if(t===null)throw Ya(),ns;return ge=t}function er(){return Ge(Yt(ge))}function G(t){if(re){if(Yt(ge)!==null)throw Ya(),ns;ge=t}}function Xa(t=1){if(re){for(var e=t,r=ge;e--;)r=Yt(r);ge=r}}function ss(t=!0){for(var e=0,r=ge;;){if(r.nodeType===Or){var n=r.data;if(n===Va){if(e===0)return r;e-=1}else(n===tf||n===bi)&&(e+=1)}var i=Yt(r);t&&r.remove(),r=i}}function Np(t){if(!t||t.nodeType!==Or)throw Ya(),ns;return t.data}p();p();p();p();function Bp(t){return t===this.v}function Ny(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Hp(t){return!Ny(t,this.v)}p();var tr=!1,as=!1,Wn=!1;p();p();p();var nf=null;function Mr(t,e){return t.label=e,Up(t.v,e),t}function Up(t,e){var r;return(r=t==null?void 0:t[Mp])==null||r.call(t,e),t}p();function xi(t){let e=new Error,r=FV();return r.length===0?null:(r.unshift(`
`),Jt(e,"stack",{value:r.join(`
`)}),Jt(e,"name",{value:t}),e)}function FV(){let t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];let r=e.split(`
`),n=[];for(let i=0;i<r.length;i++){let s=r[i],a=s.replaceAll("\\","/");if(s.trim()!=="Error"){if(s.includes("validate_each_keys"))return[];a.includes("svelte/src/internal")||a.includes("node_modules/.vite")||n.push(s)}}return n}p();var ke=null;function os(t){ke=t}var Si=null;function Jl(t){Si=t}var zn=null;function Gp(t){zn=t}function at(t,e=!1,r){ke={p:ke,i:!1,c:null,e:null,s:t,x:null,l:as&&!e?{s:null,u:null,$:[]}:null},L&&(ke.function=r,zn=r)}function ot(t){var i;var e=ke,r=e.e;if(r!==null){e.e=null;for(var n of r)Hy(n)}return t!==void 0&&(e.x=t),e.i=!0,ke=e.p,L&&(zn=(i=ke==null?void 0:ke.function)!=null?i:null),t!=null?t:{}}function Ei(){return!as||ke!==null&&ke.l===null}p();p();var Za=[];function bM(){var t=Za;Za=[],Fp(t)}function vt(t){if(Za.length===0&&!Ka){var e=Za;queueMicrotask(()=>{e===Za&&bM()})}Za.push(t)}function _M(){for(;Za.length>0;)bM()}p();var Uy=new WeakMap;function jp(t){var e=ne;if(e===null)return le.f|=8388608,t;if(L&&t instanceof Error&&!Uy.has(t)&&Uy.set(t,OV(t,e)),e.f&32768)Ai(t,e);else{if(!(e.f&128))throw L&&!e.parent&&t instanceof Error&&xM(t),t;e.b.error(t)}}function Ai(t,e){for(;e!==null;){if(e.f&128)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw L&&t instanceof Error&&xM(t),t}function OV(t,e){var a,o,l;let r=Ir(t,"message");if(!(r&&!r.configurable)){for(var n=sf?" ":" ",i=`
${n}in ${((a=e.fn)==null?void 0:a.name)||"<unknown>"}`,s=e.ctx;s!==null;)i+=`
${n}in ${(o=s.function)==null?void 0:o[An].split("/").pop()}`,s=s.p;return{message:t.message+`
${i}
`,stack:(l=t.stack)==null?void 0:l.split(`
`).filter(c=>!c.includes("svelte/src/internal")).join(`
`)}}}function xM(t){let e=Uy.get(t);e&&(Jt(t,"message",{value:e.message}),Jt(t,"stack",{value:e.stack}))}p();p();var MV=-7169;function Le(t,e){t.f=t.f&MV|e}function tc(t){t.f&512||t.deps===null?Le(t,1024):Le(t,4096)}function SM(t){if(t!==null)for(let e of t)!(e.f&2)||!(e.f&32768)||(e.f^=32768,SM(e.deps))}function qp(t,e,r){t.f&2048?e.add(t):t.f&4096&&r.add(t),SM(t.deps),Le(t,1024)}var rc=new Set,ye=null,lf=null,Rt=null,Lr=[],zp=null,Gy=!1,Ka=!1,nc,ic,Qa,sc,cf,uf,Ja,ls,ac,Ci,jy,qy,kM,zy=class zy{constructor(){me(this,Ci);qe(this,"committed",!1);qe(this,"current",new Map);qe(this,"previous",new Map);me(this,nc,new Set);me(this,ic,new Set);me(this,Qa,0);me(this,sc,0);me(this,cf,null);me(this,uf,new Set);me(this,Ja,new Set);me(this,ls,new Map);qe(this,"is_fork",!1);me(this,ac,!1)}is_deferred(){return this.is_fork||$(this,sc)>0}skip_effect(e){$(this,ls).has(e)||$(this,ls).set(e,{d:[],m:[]})}unskip_effect(e){var r=$(this,ls).get(e);if(r){$(this,ls).delete(e);for(var n of r.d)Le(n,2048),gr(n);for(n of r.m)Le(n,4096),gr(n)}}process(e){var i;Lr=[],this.apply();var r=[],n=[];for(let s of e)wt(this,Ci,jy).call(this,s,r,n);if(this.is_deferred()){wt(this,Ci,qy).call(this,n),wt(this,Ci,qy).call(this,r);for(let[s,a]of $(this,ls))TM(s,a)}else{for(let s of $(this,nc))s();$(this,nc).clear(),$(this,Qa)===0&&wt(this,Ci,kM).call(this),lf=this,ye=null,EM(n),EM(r),lf=null,(i=$(this,cf))==null||i.resolve()}Rt=null}capture(e,r){r!==Ke&&!this.previous.has(e)&&this.previous.set(e,r),e.f&8388608||(this.current.set(e,e.v),Rt==null||Rt.set(e,e.v))}activate(){ye=this,this.apply()}deactivate(){ye===this&&(ye=null,Rt=null)}flush(){if(this.activate(),Lr.length>0){if(Wy(),ye!==null&&ye!==this)return}else $(this,Qa)===0&&this.process([]);this.deactivate()}discard(){for(let e of $(this,ic))e(this);$(this,ic).clear()}increment(e){de(this,Qa,$(this,Qa)+1),e&&de(this,sc,$(this,sc)+1)}decrement(e){de(this,Qa,$(this,Qa)-1),e&&de(this,sc,$(this,sc)-1),!$(this,ac)&&(de(this,ac,!0),vt(()=>{de(this,ac,!1),this.is_deferred()?Lr.length>0&&this.flush():this.revive()}))}revive(){for(let e of $(this,uf))$(this,Ja).delete(e),Le(e,2048),gr(e);for(let e of $(this,Ja))Le(e,4096),gr(e);this.flush()}oncommit(e){$(this,nc).add(e)}ondiscard(e){$(this,ic).add(e)}settled(){var e;return((e=$(this,cf))!=null?e:de(this,cf,Op())).promise}static ensure(){if(ye===null){let e=ye=new zy;rc.add(ye),Ka||vt(()=>{ye===e&&e.flush()})}return ye}apply(){if(!(!tr||!this.is_fork&&rc.size===1)){Rt=new Map(this.current);for(let e of rc)if(e!==this)for(let[r,n]of e.previous)Rt.has(r)||Rt.set(r,n)}}};nc=new WeakMap,ic=new WeakMap,Qa=new WeakMap,sc=new WeakMap,cf=new WeakMap,uf=new WeakMap,Ja=new WeakMap,ls=new WeakMap,ac=new WeakMap,Ci=new WeakSet,jy=function(e,r,n){var d;e.f^=1024;for(var i=e.first,s=null;i!==null;){var a=i.f,o=(a&96)!==0,l=o&&(a&1024)!==0,c=l||(a&8192)!==0||$(this,ls).has(i);if(tr&&s===null&&a&128&&((d=i.b)!=null&&d.is_pending)&&(s=i),!c&&i.fn!==null){o?i.f^=1024:s!==null&&a&16777228?s.b.defer_effect(i):a&4?r.push(i):tr&&a&16777224?n.push(i):ta(i)&&(a&16&&$(this,Ja).add(i),ea(i));var u=i.first;if(u!==null){i=u;continue}}var f=i.parent;for(i=i.next;i===null&&f!==null;)f===s&&(s=null),i=f.next,f=f.parent}},qy=function(e){for(var r=0;r<e.length;r+=1)qp(e[r],$(this,uf),$(this,Ja))},kM=function(){var i;if(rc.size>1){this.previous.clear();var e=Rt,r=!0;for(let s of rc){if(s===this){r=!1;continue}let a=[];for(let[l,c]of this.current){if(s.current.has(l))if(r&&c!==s.current.get(l))s.current.set(l,c);else continue;a.push(l)}if(a.length===0)continue;let o=[...s.current.keys()].filter(l=>!this.current.has(l));if(o.length>0){var n=Lr;Lr=[];let l=new Set,c=new Map;for(let u of a)AM(u,o,l,c);if(Lr.length>0){ye=s,s.apply();for(let u of Lr)wt(i=s,Ci,jy).call(i,u,[],[]);s.deactivate()}Lr=n}}ye=null,Rt=e}this.committed=!0,rc.delete(this)};var Br=zy;function eo(t){var e=Ka;Ka=!0;try{var r;for(t&&(ye!==null&&Wy(),r=t());;){if(_M(),Lr.length===0&&(ye==null||ye.flush(),Lr.length===0))return zp=null,r;Wy()}}finally{Ka=e}}function Wy(){var s;Gy=!0;var t=L?new Set:null;try{for(var e=0;Lr.length>0;){var r=Br.ensure();if(e++>1e3){if(L){var n=new Map;for(let a of r.current.keys())for(let[o,l]of(s=a.updated)!=null?s:[]){var i=n.get(o);i||(i={error:l.error,count:0},n.set(o,i)),i.count+=l.count}for(let a of n.values())a.error&&console.error(a.error)}LV()}if(r.process(Lr),Ti.clear(),L)for(let a of r.current.keys())t.add(a)}}finally{if(Lr=[],Gy=!1,zp=null,L)for(let a of t)a.updated=null}}function LV(){try{sM()}catch(t){L&&Jt(t,"stack",{value:""}),Ai(t,zp)}}var Dr=null;function EM(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if(!(n.f&24576)&&ta(n)&&(Dr=new Set,ea(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?Vy(n):n.fn=null),(Dr==null?void 0:Dr.size)>0)){Ti.clear();for(let i of Dr){if(i.f&24576)continue;let s=[i],a=i.parent;for(;a!==null;)Dr.has(a)&&(Dr.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){let l=s[o];l.f&24576||ea(l)}}Dr.clear Line truncated
`).some(l=>l.startsWith("https://svelte.dev/e/")))throw o;return o!==ns&&console.warn("Failed to hydrate: ",o),e.recover===!1&&aM(),im(),hc(r),Bt(!1),ia(t,e)}finally{Bt(n),Ge(i)}}var mc=new Map;function iD(t,{target:e,anchor:r,props:n={},events:i,context:s,intro:a=!0}){im();var o=new Set,l=f=>{for(var d=0;d<f.length;d++){var h=f[d];if(!o.has(h)){o.add(h);var m=nD(h);e.addEventListener(h,pc,{passive:m});var g=mc.get(h);g===void 0?(document.addEventListener(h,pc,{passive:m}),mc.set(h,1)):mc.set(h,g+1)}}};l(Zl(hb)),cm.add(l);var c=void 0,u=qM(()=>{var f=r!=null?r:e.appendChild(It());return Ky(f,{pending:()=>{}},d=>{at({});var h=ke;if(s&&(h.c=s),i&&(n.$$events=i),re&&Mi(d,null),fm=a,c=t(d,n)||{},fm=!0,re&&(ne.nodes.end=ge,ge===null||ge.nodeType!==Or||ge.data!==Va))throw Ya(),ns;ot()}),()=>{var m;for(var d of o){e.removeEventListener(d,pc);var h=mc.get(d);--h===0?(document.removeEventListener(d,pc),mc.delete(d)):mc.set(d,h)}cm.delete(l),f!==r&&((m=f.parentNode)==null||m.removeChild(f))}});return pb.set(c,u),c}var pb=new WeakMap;function hs(t,e){let r=pb.get(t);return r?(pb.delete(t),r(e)):(L&&(Wt in t?gM():mM()),Promise.resolve())}p();p();p();var Qn,Di,ln,fo,wf,yf,dm,ps=class{constructor(e,r=!0){qe(this,"anchor");me(this,Qn,new Map);me(this,Di,new Map);me(this,ln,new Map);me(this,fo,new Set);me(this,wf,!0);me(this,yf,()=>{var e=ye;if($(this,Qn).has(e)){var r=$(this,Qn).get(e),n=$(this,Di).get(r);if(n)gf(n),$(this,fo).delete(r);else{var i=$(this,ln).get(r);i&&($(this,Di).set(r,i.effect),$(this,ln).delete(r),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),n=i.effect)}for(let[s,a]of $(this,Qn)){if($(this,Qn).delete(s),s===e)break;let o=$(this,ln).get(a);o&&(ut(o.effect),$(this,ln).delete(a))}for(let[s,a]of $(this,Di)){if(s===r||$(this,fo).has(s))continue;let o=()=>{if(Array.from($(this,Qn).values()).includes(s)){var c=document.createDocumentFragment();Qp(a,c),c.append(It()),$(this,ln).set(s,{effect:a,fragment:c})}else ut(a);$(this,fo).delete(s),$(this,Di).delete(s)};$(this,wf)||!n?($(this,fo).add(s),Fi(a,o,!1)):o()}}});me(this,dm,e=>{$(this,Qn).delete(e);let r=Array.from($(this,Qn).values());for(let[n,i]of $(this,ln))r.includes(n)||(ut(i.effect),$(this,ln).delete(n))});this.anchor=e,de(this,wf,r)}ensure(e,r){var n=ye,i=sm();if(r&&!$(this,Di).has(e)&&!$(this,ln).has(e))if(i){var s=document.createDocumentFragment(),a=It();s.append(a),$(this,ln).set(e,{effect:Ht(()=>r(a)),fragment:s})}else $(this,Di).set(e,Ht(()=>r(this.anchor)));if($(this,Qn).set(n,e),i){for(let[o,l]of $(this,Di))o===e?n.unskip_effect(l):n.skip_effect(l);for(let[o,l]of $(this,ln))o===e?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit($(this,yf)),n.ondiscard($(this,dm))}else re&&(this.anchor=ge),$(this,yf).call(this)}};Qn=new WeakMap,Di=new WeakMap,ln=new WeakMap,fo=new WeakMap,wf=new WeakMap,yf=new WeakMap,dm=new WeakMap;if(L){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;lM(e)},set:n=>{r=n}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function ho(t){ke===null&&Dp("onMount"),as&&ke.l!==null?i9(ke).m.push(t):sr(()=>{let e=ze(t);if(typeof e=="function")return e})}function i9(t){var r;var e=t.l;return(r=e.u)!=null?r:e.u={a:[],b:[],m:[]}}p();p();var oD=new Map;function lD(t,e){var r=oD.get(t);r||(r=new Set,oD.set(t,r)),r.add(e)}p();p();p();p();p();p();p();p();p();function Ae(t,e,r=!1){re&&er();var n=new ps(t),i=r?65536:0;function s(a,o){if(re){let c=Np(t)===bi;if(a===c){var l=ss();Ge(l),n.anchor=l,Bt(!1),n.ensure(a,o),Bt(!0);return}}n.ensure(a,o)}rn(()=>{var a=!1;e((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},i)}p();var Cde=Symbol("NaN");p();p();function cn(t,e){return e}function f9(t,e,r){var f;for(var n=[],i=e.length,s,a=e.length,o=0;o<i;o++){let d=e[o];Fi(d,()=>{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=t.outrogroups;gb(Zl(s.done)),h.delete(s),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;hc(u),u.append(c),t.items.clear()}gb(e,!l)}else s={pending:new Set(e),done:new Set},((f=t.outrogroups)!=null?f:t.outrogroups=new Set).add(s)}function gb(t,e=!0){for(var r=0;r<t.length;r++)ut(t[r],e)}var gc;function un(t,e,r,n,i,s=null){var a=t,o=new Map,l=(e&4)!==0;if(l){var c=t;a=re?Ge(Zt(c)):c.appendChild(It())}re&&er();var u=null,f=ao(()=>{var w=r();return is(w)?w:w==null?[]:Zl(w)}),d,h=!0;function m(){v.fallback=u,d9(v,d,a,e,n),u!==null&&(d.length===0?u.f&33554432?(u.f^=33554432,_f(u,null,a)):gf(u):Fi(u,()=>{u=null}))}var g=rn(()=>{d=R(f);var w=d.length;let b=!1;if(re){var k=Np(a)===bi;k!==(w===0)&&(a=ss(),Ge(a),Bt(!1),b=!0)}for(var x=new Set,E=ye,A=sm(),y=0;y<w;y+=1){re&&ge.nodeType===Or&&ge.data===Va&&(a=ge,b=!0,Bt(!1));var S=d[y],_=n(S,y),C=h?null:o.get(_);C?(C.v&&Zn(C.v,S),C.i&&Zn(C.i,y),A&&E.unskip_effect(C.e)):(C=h9(o,h?a:gc!=null?gc:gc=It(),S,_,y,i,e,r),h||(C.e.f|=33554432),o.set(_,C)),x.add(_)}if(w===0&&s&&!u&&(h?u=H Line truncated
\r\f\xA0\v\uFEFF`];function mD(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var s=i.length,a=0;(a=n.indexOf(i,a))>=0;){var o=a+s;(a===0||pD.includes(n[a-1]))&&(o===n.length||pD.includes(n[o]))?n=(a===0?"":n.substring(0,a))+n.substring(o+1):a=o}}return n===""?null:n}p();function ft(t,e,r,n,i,s){var a=t.__className;if(re||a!==r||a===void 0){var o=mD(r,n,s);(!re||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&t.classList.toggle(l,c)}return s}p();p();var T9=Symbol("class"),P9=Symbol("style"),R9=Symbol("is custom element"),$9=Symbol("is html");function _e(t,e,r,n){var i=I9(t);if(re&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){n||O9(t,e,r!=null?r:"");return}i[e]!==(i[e]=r)&&(e==="loading"&&(t[JO]=r),r==null?t.removeAttribute(e):typeof r!="string"&&F9(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function I9(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[R9]:t.nodeName.includes("-"),[$9]:t.namespaceURI===ZO}}var gD=new Map;function F9(t){var e=t.getAttribute("is")||t.nodeName,r=gD.get(e);if(r)return r;gD.set(e,r=[]);for(var n,i=t,s=Element.prototype;s!==i;){n=Iy(i);for(var a in n)n[a].set&&r.push(a);i=Kl(i)}return r}function O9(t,e,r){var n;L&&(e==="srcset"&&M9(t,r)||wb((n=t.getAttribute(e))!=null?n:"",r)||pM(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function wb(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function vD(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function M9(t,e){var r=vD(t.srcset),n=vD(e);return n.length===r.length&&n.every(([i,s],a)=>s===r[a][1]&&(wb(r[a][0],i)||wb(i,r[a][0])))}p();p();p();function _b(t,e,r=e){var n=new WeakSet;ob(t,"input",async i=>{L&&t.type==="checkbox"&&Dy();var s=i?t.defaultValue:t.value;if(s=yb(t)?bb(s):s,r(s),ye!==null&&n.add(ye),await lm(),s!==(s=e())){var a=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=s!=null?s:"",o!==null){var c=t.value.length;a===o&&o===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=a,t.selectionEnd=Math.min(o,c))}}}),(re&&t.defaultValue!==t.value||ze(e)==null&&t.value)&&(r(yb(t)?bb(t.value):t.value),ye!==null&&n.add(ye)),Xt(()=>{var a;L&&t.type==="checkbox"&&Dy();var i=e();if(t===document.activeElement){var s=(a=lf)!=null?a:ye;if(n.has(s))return}yb(t)&&i===bb(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i!=null?i:"")})}function yb(t){var e=t.type;return e==="number"||e==="range"}function bb(t){return t===""?null:+t}p();p();p();p();p();function yD(t,e){return t===e||(t==null?void 0:t[Wt])===e}function it(t={},e,r,n){return Wr(()=>{var i,s;return Xt(()=>{i=s,s=(n==null?void 0:n())||[],ze(()=>{t!==r(...s)&&(e(t,...s),i&&yD(r(...i),t)&&e(null,...i))})}),()=>{vt(()=>{s&&yD(r(...s),t)&&e(null,...s)})}}),t}p();p();p();p();p();p();p();p();p();var mm=!1,Vge=Symbol();function Sb(t){var e=mm;try{return mm=!1,[t(),mm]}finally{mm=e}}function Pn(t,e,r,n){var k,x;var i=!as||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=n,l=!0,c=()=>(l&&(l=!1,o=a?ze(n):n),o),u;if(s){var f=Wt in t||rf in t;u=(x=(k=Ir(t,e))==null?void 0:k.set)!=null?x:f&&e in t?E=>t[e]=E:void 0}var d,h=!1;s?[d,h]=Sb(()=>t[e]):d=t[e],d===void 0&&n!==void 0&&(d=c(),u&&(i&&oM(e),u(d)));var m;if(i?m=()=>{var E=t[e];return E===void 0?c():(l=!0,E)}:m=()=>{var E=t[e];return E!==void 0&&(o=void 0),E===void 0?o:E},i&&!(r&4))return m;if(u){var g=t.$$legacy;return function(E,A){return arguments.length>0?((!i||!A||g||h)&&u(A?m():E),E):m()}}var v=!1,w=(r&1?so:ao)(()=>(v=!1,m()));L&&(w.label=e),s&&R(w);var b=ne;return function(E,A){if(arguments.length>0){let y=A?R(w):i&&s?Ye(E):E;return se(w,y),v=!0,o!==void 0&&(o=y),E}return Tn&&v||b.f&16384?w.v:R(w)}}p();p();p();function bD(t){return new Eb(t)}var gs,Rn,Eb=class{constructor(e){me(this,gs);me(this,Rn);var s,a;var r=new Map,n=(o,l)=>{var c=lo(l,!1,!1);return r.set(o,c),c};let i=new Proxy({...e.props||{},$$events:{}},{get(o,l){var c;return R((c=r.get(l))!=null?c:n(l,Reflect.get(o,l)))},has(o,l){var c;return l===rf?!0:(R((c=r.get(l))!=null?c:n(l,Reflect.get(o,l))),Reflect.has(o,l))},set(o,l,c){var u;return se((u=r.get(l))!=null?u:n(l,c),c),Reflect.set(o,l,c)}});de(this,Rn,(e.hydrate?mb:ia)(e.component,{target:e.target,anchor:e.anchor,props:i,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover})),!tr&&(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&eo(),de(this,gs,i.$$events);for(let o of Object.keys($(this,Rn)))o==="$set"||o==="$destroy"||o==="$on"||Jt(this,o,{get(){return $(this,Rn)[o]},set(l){$(this,Rn)[o]=l},enumerable:!0});$(this,Rn).$set=o=>{Object.assign(i,o)},$(this,Rn).$destroy=()=>{hs($(this,Rn))}}$set(e){$(this,Rn).$set(e)}$on(e,r){$(this,gs)[e]=$(this,gs)[e]||[];let n=(...i)=>r.call(this,...i);return $(this,gs)[e].push(n),()=>{$(this,gs)[e]=$( Line truncated
`:""}${(S=e.log.author)==null?void 0:S.name}
${(0,Cb.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)}
${e.log.message}`}]),ae(t,o),ot()}Et(["click"]);var d7=fe('<div class="tree-item nav-folder mod-root"></div>'),h7=fe('<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" 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>'),p7={hash:"svelte-12n6twc",code:""};function Rb(t,e){at(e,!0),ti(t,p7);let r=Pn(e,"plugin",15),n=Me(!1),i=Ye([]),s=Me(void 0),a=Me(Ye(r().settings.treeStructure)),o;sr(()=>{o&&o.empty()}),ho(()=>{e.view.registerEvent(e.view.app.workspace.on("obsidian-git:head-change",()=>void c().catch(console.error)))}),sr(()=>{i.forEach(x=>(0,Pb.setIcon)(x,x.getAttr("data-icon")))}),ho(()=>{let x=new IntersectionObserver(A=>{A[0].isIntersecting&&!R(n)&&u().catch(console.error)}),E=document.querySelector("#sentinel");return E&&x.observe(E),()=>{x.disconnect()}}),c().catch(console.error);function l(){c().catch(console.error)}function c(){return po(this,void 0,void 0,function*(){var x;if(!r().gitReady){se(s,void 0);return}se(n,!0);let E=r().gitManager instanceof Se,A;((x=R(s)===null||R(s)===void 0?void 0:R(s).length)!==null&&x!==void 0?x:0)==0?A=E?50:10:A=R(s).length,se(s,yield r().gitManager.log(void 0,!1,A),!0),se(n,!1)})}function u(){return po(this,void 0,void 0,function*(){var x;if(!r().gitReady||R(s)===void 0)return;se(n,!0);let A=r().gitManager instanceof Se?50:10,y=yield r().gitManager.log(void 0,!1,A,(x=R(s).last())===null||x===void 0?void 0:x.hash);R(s).push(...y.slice(1)),se(n,!1)})}var f=h7(),d=j(f),h=j(d),m=j(h);m.__click=()=>{se(a,!R(a)),(0,Pb.setIcon)(i[0],R(a)?"list":"folder"),r(r().settings.treeStructure=R(a),!0),r().saveSettings()},it(m,x=>i[0]=x,()=>i==null?void 0:i[0]);var g=ee(m,2);let v;g.__click=l,it(g,x=>i[1]=x,()=>i==null?void 0:i[1]),G(h),G(d);var w=ee(d,2),b=j(w);{var k=x=>{var E=d7();un(E,21,()=>R(s),cn,(A,y)=>{Tb(A,{get view(){return e.view},get showTree(){return R(a)},get log(){return R(y)},get plugin(){return r()}})}),G(E),ae(x,E)};Ae(b,x=>{R(s)&&x(k)})}Xa(4),G(w),G(f),Ne(()=>{_e(m,"data-icon",R(a)?"list":"folder"),v=ft(g,1,"clickable-icon nav-action-button",null,v,{loading:R(n)})}),ae(t,f),ot()}Et(["click"]);var Ef=class extends _D.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return gn.type}getDisplayText(){return gn.name}getIcon(){return gn.icon}onClose(){return this._view&&hs(this._view),super.onClose()}reload(){this._view&&hs(this._view),this._view=ia(Rb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};p();var xD=require("obsidian"),vm=class extends xD.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)})}};p();var kD=require("obsidian");p();var vo=require("obsidian");p();var kf=require("obsidian");p();var SD=require("obsidian");var vc=class extends SD.Modal{constructor({app:r,path:n,filesToDeleteCount:i,filesToDiscardCount:s}){super(r);this.resolve=null;this.path=n,this.deleteCount=i,this.discardCount=s}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:n,titleEl:i}=this,s="";this.path!=""&&(r>1?s=`files in "${this.path}"`:s=`"${this.path}"`),i.setText(`${this.discardCount==0?"Delete":"Discard"} ${s}`),this.deleteCount>0&&n.createEl("p").setText(`Are you sure you want to DELETE the ${Pu(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&n.createEl("p").setText(`Are you sure you want to discard ALL changes in ${Pu(this.discardCount,"tracked file")}?`);let a=n.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${Pu(r,"file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("delete"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("delete"),this.close()})}if(this.discardCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`Discard all ${Pu(this.discardCount,"tracked file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("discard"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("discard"),this.close()})}let o=a.createEl("button",{text:"Cancel"});o.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),o.addEventListener("keypress",()=>(this.resolve&&this.resolve(!1),this.close()))}onClose(){let{contentEl:r}=th Line truncated
`);i.removed.lines.length>0&&!i.removed.no_nl_at_eof&&(c+=`
`),n.replaceRange(c,n.offsetToPos(o),n.offsetToPos(l)),n.setSelection(n.offsetToPos(o))}}async stageHunk(e){if(!await this.plugin.isAllInitialized()||!this.editor)return;let{editor:r}=this.editor,n=Gn.getHunk(r.state,!1,e),i=!1;if(n||(n=Gn.getHunk(r.state,!0,e),i=!0),!n)return;let s=r.state.field(AD.editorInfoField).file.path,a=Nt.createPatch(s,[n],"100644",i).join(`
`)+`
`;await this.gitManager.applyPatch(a),this.plugin.app.workspace.trigger("obsidian-git:refresh")}goToHunk(e){if(!this.editor)return;let{editor:r,obEditor:n}=this.editor,i=Gn.getHunks(r.state,!1),s=n.getCursor().line+1,a=Nt.findNearestHunk(s,i,e,!0);if(a==null)return;let o=i[a];if(o){let l=o.added.start-1;n.setCursor(l,0),n.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};p();p();var wo=require("obsidian");var _m=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof wo.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),cF(()=>this.plg.settings.lineAuthor,e=>{this.plg.settings.lineAuthor=e,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;yF(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new ap(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(e){console.warn("Git: Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&wo.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Se?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(RF),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.headChangeEvent=this.createHeadChangeEvent(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),pF(),this.plg.registerEvent(this.gutterContextMenuEvent),this.plg.registerEvent(this.refreshOnCssChangeEvent),this.plg.registerEvent(this.fileOpenEvent),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileModificationEvent),this.plg.registerEvent(this.headChangeEvent),this.plg.registerEvent(this.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.gutterContextMenuEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.vault.offref(this.fileModificationEvent),this.plg.app.workspace.offref(this.headChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var r;return void((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e).catch(console.error))})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var n;return e instanceof wo.TFile&&((n=this.lineAuthorInfoProvider)==null?void 0:n.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var r;return e instanceof wo.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e))})}createHeadChangeEvent(){return this.plg.app.workspace.on("obsidian-git:head-change",()=>{this.refreshLineAuthorViews()})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",vF)}};p();var wc=require("obsidian");p();p();var yo=require("@codemirror/state"),Sm=require("@codemirror/view");var xm=class extends Sm.GutterMarker{constructor(r,n){super();this.type=r;this.staged=n}toDOM(r){let n=document.createElement("div");return n.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&n.setText("~"),n}},Ib=yo.StateField.define({create:()=>yo.RangeSet.empty,update:(t,e)=>{let r=e.state.field($r,!1);if(!r)return yo Line truncated
`+s),this.app.workspace.trigger("obsidian-git:refresh")}handleFileMenu(r,n,i,s){if(!this.gitReady||!this.settings.showFileMenu||!n)return;let a;if(typeof n=="string"?a=n:a=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 be.TFile?await this.stageFile(n):(await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{n instanceof be.TFile?await this.unstageFile(n):(await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(l=>{this.addFileToGitignore(a,n instanceof be.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(a,n instanceof be.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;s==="obsidian-git:menu"&&o instanceof be.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(a)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(FD.join(o.getBasePath(),a))})}))}}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.editorIntegration.onUnloadPlugin(),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=sC(et,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return be.Platform.isDesktopApp}async init({fromReload:r=!1}){var n;if(this.settings.showStatusBar&&!this.statusBar){let i=this.addStatusBarItem();this.statusBar=new lp(i,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return(s=this.statusBar)==null?void 0:s.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Se(this),await this.gitManager.setGitInstance()):this.gitManager=new Hn(this);let i=await this.gitManager.checkRequirements(),s=this.localStorage.getPausedAutomatics();switch(i){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new be.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}),be.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new ym(a,this),this.intervalsToClear.push(window.setInterval(()=>{var o;return void((o=this.branchBar)==null?void 0:o.display().catch(console.error))},6e4))}await((n=this.branchBar)==null?void 0:n.display()),this.editorIntegration.onReady(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&!s&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),s||await this.automaticsManager.init(),s&&new be.Notice("Automatic routines are currently paused.");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 be.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let n=await new Ze(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(n){let i="Vault Root",s=await new Ze(this,{options:this.gitManager instanceof Hn?[i]:[],placeholder 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 Ze(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(i){let s=await this.gitManager.getRemoteUrl(i),o=await new Ze(this,{initialValue:s,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(i,Kw(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 Ze(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),s=n!=null?n:await i.openAndGetResult();if(s){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(s);let a=await this.gitManager.getRemoteBranches(s),l=await new Ze(this,{options:a,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return l==null?void 0:l.startsWith(s+"/")?l:`${s}/${l}`}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),i=await new Ze(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();i&&await this.gitManager.removeRemote(i)}onActiveLeafChange(r){var a,o;let n=r==null?void 0:r.view;if(!(n!=null&&n.getState().file)&&!(n instanceof Wa||n instanceof za))return;let i=this.app.workspace.getLeavesOfType(jt.type).first(),s=this.app.workspace.getLeavesOfType(gn.type).first();if((a=i==null?void 0:i.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||a.removeClass("is-active"),(o=s==null?void 0:s.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof Wa||(r==null?void 0:r.view)instanceof za){let c=r.view.state.bFile.replace(/["\\]/g,"\\$&");this.lastDiffViewState=r.view.getState();let u;i&&r.view.state.aRef=="HEAD"?u=i.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path="${c}"]`):i&&r.view.state.aRef==""?u=i.view.containerEl.querySelector(`div.changes div.tree-item-self[data-path="${c}"]`):s&&(u=s.view.containerEl.querySelector(`div.tree-item-self[data-path='${c}']`)),u==null||u.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 be.Notice(r,5*1e3),this.log(r)}displayError(r,n=10*1e3){var s;if(r instanceof ID.Errors.UserCanceledError){new be.Notice("Aborted");return}let i;r instanceof Error?i=r:i=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new be.Notice(i.message,n),console.error(`${this.manifest.id}:`,i.stack),(s=this.statusBar)==null||s.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 *)
isomorphic-git/index.cjs:
(*!
* This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements.
* SPDX-License-Identifier: LGPL-3.0-or-later
* Copyright (c) James Prevett and other ZenFS contributors.
*)
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
*)
*/
/* nosourcemap */
+10
View File
@@ -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.38.2"
}
+710
View File
@@ -0,0 +1,710 @@
@keyframes loading {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.git-signs-gutter {
.cm-gutterElement {
/* Needed to align the sign properly for different line heigts. Such as
* when having a heading or list item.
*/
padding-top: 0 !important;
}
}
.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-left: 0;
padding-top: 0;
padding-right: 0;
}
.workspace-leaf-content[data-type="git-history-view"] .view-content {
padding-left: 0;
padding-top: 0;
padding-right: 0;
}
.loading {
overflow: hidden;
}
.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;
}
/* Limits the scrollbar to the view body */
.git-view {
display: flex;
flex-direction: column;
position: relative;
height: 100%;
}
/* Re-enable wrapping of nav buttns to prevent overflow on smaller screens #*/
.workspace-drawer .git-view .nav-buttons-container {
flex-wrap: wrap;
}
.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;
}
.workspace-leaf-content[data-type="git-view"] .tree-item-self,
.workspace-leaf-content[data-type="git-history-view"] .tree-item-self {
align-items: center;
}
.workspace-leaf-content[data-type="git-view"]
.tree-item-self:hover
.clickable-icon,
.workspace-leaf-content[data-type="git-history-view"]
.tree-item-self:hover
.clickable-icon {
color: var(--icon-color-hover);
}
/* Highlight an item as active if it's diff is currently opened */
.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);
}
/* ====== diff2html ======
The following styles are adapted from the obsidian-version-history plugin by
@kometenstaub https://github.com/kometenstaub/obsidian-version-history-diff/blob/main/src/styles.scss
which itself is adapted from the diff2html library with the following original license:
https://github.com/rtfpessoa/diff2html/blob/master/LICENSE.md
Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/
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.
*/
.theme-dark,
.theme-light {
--git-delete-bg: #ff475040;
--git-delete-hl: #96050a75;
--git-insert-bg: #68d36840;
--git-insert-hl: #23c02350;
--git-change-bg: #ffd55840;
--git-selected: #3572b0;
--git-delete: #c33;
--git-insert: #399839;
--git-change: #d0b44c;
--git-move: #3572b0;
}
.git-diff {
.d2h-d-none {
display: none;
}
.d2h-wrapper {
text-align: left;
border-radius: 0.25em;
overflow: auto;
}
.d2h-file-header.d2h-file-header {
background-color: var(--background-secondary);
border-bottom: 1px solid var(--background-modifier-border);
font-family:
Source Sans Pro,
Helvetica Neue,
Helvetica,
Arial,
sans-serif;
height: 35px;
padding: 5px 10px;
}
.d2h-file-header,
.d2h-file-stats {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
.d2h-file-header {
display: none;
}
.d2h-file-stats {
font-size: 14px;
margin-left: auto;
}
.d2h-lines-added {
border: 1px solid var(--color-green);
border-radius: 5px 0 0 5px;
color: var(--color-green);
padding: 2px;
text-align: right;
vertical-align: middle;
}
.d2h-lines-deleted {
border: 1px solid var(--color-red);
border-radius: 0 5px 5px 0;
color: var(--color-red);
margin-left: 1px;
padding: 2px;
text-align: left;
vertical-align: middle;
}
.d2h-file-name-wrapper {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
font-size: 15px;
width: 100%;
}
.d2h-file-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--text-normal);
font-size: var(--h5-size);
}
.d2h-file-wrapper {
border: 1px solid var(--background-secondary-alt);
border-radius: 3px;
margin-bottom: 1em;
max-height: 100%;
}
.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-secondary-alt);
border-radius: 3px;
cursor: pointer;
display: none;
font-size: 12px;
justify-content: flex-end;
padding: 4px 8px;
}
.d2h-file-collapse.d2h-selected {
background-color: var(--git-selected);
}
.d2h-file-collapse-input {
margin: 0 4px 0 0;
}
.d2h-diff-table {
border-collapse: collapse;
font-family: var(--font-monospace);
font-size: var(--code-size);
width: 100%;
}
.d2h-files-diff {
width: 100%;
}
.d2h-file-diff {
/*
overflow-y: scroll;
*/
border-radius: 5px;
font-size: var(--font-text-size);
line-height: var(--line-height-normal);
}
.d2h-file-side-diff {
display: inline-block;
margin-bottom: -8px;
margin-right: -4px;
overflow-x: scroll;
overflow-y: hidden;
width: 50%;
}
.d2h-code-line {
padding-left: 6em;
padding-right: 1.5em;
}
.d2h-code-line,
.d2h-code-side-line {
display: inline-block;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
white-space: nowrap;
width: 100%;
}
.d2h-code-side-line {
/* needed to be changed */
padding-left: 0.5em;
padding-right: 0.5em;
}
.d2h-code-line-ctn {
word-wrap: normal;
background: none;
display: inline-block;
padding: 0;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
vertical-align: middle;
width: 100%;
/* only works for line-by-line */
white-space: pre-wrap;
}
.d2h-code-line del,
.d2h-code-side-line del {
background-color: var(--git-delete-hl);
color: var(--text-normal);
}
.d2h-code-line del,
.d2h-code-line ins,
.d2h-code-side-line del,
.d2h-code-side-line ins {
border-radius: 0.2em;
display: inline-block;
margin-top: -1px;
text-decoration: none;
vertical-align: middle;
}
.d2h-code-line ins,
.d2h-code-side-line ins {
background-color: var(--git-insert-hl);
text-align: left;
}
.d2h-code-line-prefix {
word-wrap: normal;
background: none;
display: inline;
padding: 0;
white-space: pre;
}
.line-num1 {
float: left;
}
.line-num1,
.line-num2 {
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
/*
padding: 0 0.5em;
*/
text-overflow: ellipsis;
width: 2.5em;
padding-left: 0;
}
.line-num2 {
float: right;
}
.d2h-code-linenumber {
background-color: var(--background-primary);
border: solid var(--background-modifier-border);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-faint);
cursor: pointer;
display: inline-block;
position: absolute;
text-align: right;
width: 5.5em;
}
.d2h-code-linenumber:after {
content: "\200b";
}
.d2h-code-side-linenumber {
background-color: var(--background-primary);
border: solid var(--background-modifier-border);
border-width: 0 1px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: var(--text-faint);
cursor: pointer;
overflow: hidden;
padding: 0 0.5em;
text-align: right;
text-overflow: ellipsis;
width: 4em;
/* needed to be changed */
display: table-cell;
position: relative;
}
.d2h-code-side-linenumber:after {
content: "\200b";
}
.d2h-code-side-emptyplaceholder,
.d2h-emptyplaceholder {
background-color: var(--background-primary);
border-color: var(--background-modifier-border);
}
.d2h-code-line-prefix,
.d2h-code-linenumber,
.d2h-code-side-linenumber,
.d2h-emptyplaceholder {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.d2h-code-linenumber,
.d2h-code-side-linenumber {
direction: rtl;
}
.d2h-del {
background-color: var(--git-delete-bg);
border-color: var(--git-delete-hl);
}
.d2h-ins {
background-color: var(--git-insert-bg);
border-color: var(--git-insert-hl);
}
.d2h-info {
background-color: var(--background-primary);
border-color: var(--background-modifier-border);
color: var(--text-faint);
}
.d2h-del,
.d2h-ins,
.d2h-file-diff .d2h-change {
color: var(--text-normal);
}
.d2h-file-diff .d2h-del.d2h-change {
background-color: var(--git-change-bg);
}
.d2h-file-diff .d2h-ins.d2h-change {
background-color: var(--git-insert-bg);
}
.d2h-file-list-wrapper {
a {
text-decoration: none;
cursor: default;
-webkit-user-drag: none;
}
svg {
display: none;
}
}
.d2h-file-list-header {
text-align: left;
}
.d2h-file-list-title {
display: none;
}
.d2h-file-list-line {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
text-align: left;
}
.d2h-file-list {
}
.d2h-file-list > li {
border-bottom: 1px solid var(--background-modifier-border);
margin: 0;
padding: 5px 10px;
}
.d2h-file-list > li:last-child {
border-bottom: none;
}
.d2h-file-switch {
cursor: pointer;
display: none;
font-size: 10px;
}
.d2h-icon {
fill: currentColor;
margin-right: 10px;
vertical-align: middle;
}
.d2h-deleted {
color: var(--git-delete);
}
.d2h-added {
color: var(--git-insert);
}
.d2h-changed {
color: var(--git-change);
}
.d2h-moved {
color: var(--git-move);
}
.d2h-tag {
background-color: var(--background-secondary);
display: -webkit-box;
display: -ms-flexbox;
display: flex;
font-size: 10px;
margin-left: 5px;
padding: 0 2px;
}
.d2h-deleted-tag {
border: 1px solid var(--git-delete);
}
.d2h-added-tag {
border: 1px solid var(--git-insert);
}
.d2h-changed-tag {
border: 1px solid var(--git-change);
}
.d2h-moved-tag {
border: 1px solid var(--git-move);
}
/* needed for line-by-line*/
.d2h-diff-tbody {
position: relative;
}
}
/* ====================== 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;
}
.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);
}
.git-signs-gutter {
.cm-gutterElement {
display: grid;
}
}
.git-gutter-marker:hover {
border-radius: 2px;
}
.git-gutter-marker.git-add {
background-color: var(--color-green);
justify-self: center;
height: inherit;
width: 0.2rem;
}
.git-gutter-marker.git-change {
background-color: var(--color-yellow);
justify-self: center;
height: inherit;
width: 0.2rem;
}
.git-gutter-marker.git-changedelete {
color: var(--color-yellow);
font-weight: var(--font-bold);
font-size: 1rem;
justify-self: center;
height: inherit;
}
.git-gutter-marker.git-delete {
background-color: var(--color-red);
height: 0.2rem;
width: 0.8rem;
align-self: end;
}
.git-gutter-marker.git-topdelete {
background-color: var(--color-red);
height: 0.2rem;
width: 0.8rem;
align-self: start;
}
div:hover > .git-gutter-marker.git-change {
width: 0.6rem;
}
div:hover > .git-gutter-marker.git-add {
width: 0.6rem;
}
div:hover > .git-gutter-marker.git-delete {
height: 0.6rem;
}
div:hover > .git-gutter-marker.git-topdelete {
height: 0.6rem;
}
div:hover > .git-gutter-marker.git-changedelete {
font-weight: var(--font-bold);
}
.git-gutter-marker.staged {
opacity: 0.5;
}
.git-diff {
.cm-merge-revert {
width: 4em;
}
/* Ensure that merge revert markers are positioned correctly */
.cm-merge-revert > * {
position: absolute;
background-color: var(--background-secondary);
display: flex;
}
}
/* Prevent shifting of the editor when git signs gutter is the only gutter present */
.cm-gutters.cm-gutters-before:has(> .git-signs-gutter:only-child) {
margin-inline-end: 0;
.git-signs-gutter {
margin-inline-start: -1rem;
}
}
.git-changes-status-bar-colored {
.git-add {
color: var(--color-green);
}
.git-change {
color: var(--color-yellow);
}
.git-delete {
color: var(--color-red);
}
}
.git-changes-status-bar .git-add {
margin-right: 0.3em;
}
.git-changes-status-bar .git-change {
margin-right: 0.3em;
}