commit 93ad6229ffdb5a084da56b699124e43d93295082 Author: fretuks Date: Thu Mar 12 12:16:42 2026 +0100 vault backup: 2026-03-12 12:16:42 diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..493970c --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,10 @@ +{ + "alwaysUpdateLinks": true, + "pdfExportSettings": { + "includeName": true, + "pageSize": "A4", + "landscape": false, + "margin": "0", + "downscalePercent": 100 + } +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json new file mode 100644 index 0000000..d3f66fa --- /dev/null +++ b/.obsidian/community-plugins.json @@ -0,0 +1,3 @@ +[ + "obsidian-git" +] \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..bfa047a --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "properties": true, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": true, + "sync": true, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json new file mode 100644 index 0000000..5df6dd4 --- /dev/null +++ b/.obsidian/graph.json @@ -0,0 +1,79 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": false, + "colorGroups": [ + { + "query": "path:Combat ", + "color": { + "a": 1, + "rgb": 14048348 + } + }, + { + "query": "path:Effects ", + "color": { + "a": 1, + "rgb": 14069084 + } + }, + { + "query": "path:Factions ", + "color": { + "a": 1, + "rgb": 11392604 + } + }, + { + "query": "path:Oaths ", + "color": { + "a": 1, + "rgb": 6084188 + } + }, + { + "query": "path:Races ", + "color": { + "a": 1, + "rgb": 6084269 + } + }, + { + "query": "path:Resonances", + "color": { + "a": 1, + "rgb": 6073814 + } + }, + { + "query": "path:World ", + "color": { + "a": 1, + "rgb": 6053078 + } + }, + { + "query": "path:Players ", + "color": { + "a": 1, + "rgb": 11361494 + } + } + ], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1.4910498960499, + "lineSizeMultiplier": 1, + "collapse-forces": false, + "centerStrength": 0, + "repelStrength": 20, + "linkStrength": 1, + "linkDistance": 30, + "scale": 0.04542757772157008, + "close": true +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js new file mode 100644 index 0000000..e501aea --- /dev/null +++ b/.obsidian/plugins/obsidian-git/main.js @@ -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 FD=Object.create;var pc=Object.defineProperty;var ID=Object.getOwnPropertyDescriptor;var OD=Object.getOwnPropertyNames;var MD=Object.getPrototypeOf,DD=Object.prototype.hasOwnProperty;var Nb=t=>{throw TypeError(t)};var LD=(t,e,r)=>e in t?pc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var BD=(t,e)=>()=>(t&&(e=t(t=0)),e);var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ND=(t,e)=>{for(var r in e)pc(t,r,{get:e[r],enumerable:!0})},Hb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of OD(e))!DD.call(t,n)&&n!==r&&pc(t,n,{get:()=>e[n],enumerable:!(i=ID(e,n))||i.enumerable});return t};var Mt=(t,e,r)=>(r=t!=null?FD(MD(t)):{},Hb(e||!t||!t.__esModule?pc(r,"default",{value:t,enumerable:!0}):r,t)),HD=t=>Hb(pc({},"__esModule",{value:!0}),t);var ze=(t,e,r)=>LD(t,typeof e!="symbol"?e+"":e,r),Tm=(t,e,r)=>e.has(t)||Nb("Cannot "+r);var $=(t,e,r)=>(Tm(t,e,"read from private field"),r?r.call(t):e.get(t)),pe=(t,e,r)=>e.has(t)?Nb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),fe=(t,e,r,i)=>(Tm(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),bt=(t,e,r)=>(Tm(t,e,"access private method"),r);var jb=F(Tf=>{"use strict";p();Tf.byteLength=GD;Tf.toByteArray=qD;Tf.fromByteArray=WD;var Qi=[],fi=[],UD=typeof Uint8Array!="undefined"?Uint8Array:Array,Cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oa=0,Ub=Cm.length;oa0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function GD(t){var e=Gb(t),r=e[0],i=e[1];return(r+i)*3/4-i}function jD(t,e,r){return(e+r)*3/4-r}function qD(t){var e,r=Gb(t),i=r[0],n=r[1],s=new UD(jD(t,i,n)),a=0,o=n>0?i-4:i,l;for(l=0;l>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=fi[t.charCodeAt(l)]<<2|fi[t.charCodeAt(l+1)]>>4,s[a++]=e&255),n===1&&(e=fi[t.charCodeAt(l)]<<10|fi[t.charCodeAt(l+1)]<<4|fi[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function zD(t){return Qi[t>>18&63]+Qi[t>>12&63]+Qi[t>>6&63]+Qi[t&63]}function VD(t,e,r){for(var i,n=[],s=e;so?o:a+s));return i===1?(e=t[r-1],n.push(Qi[e>>2]+Qi[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(Qi[e>>10]+Qi[e>>4&63]+Qi[e<<2&63]+"=")),n.join("")}});var qb=F(Pm=>{p();Pm.read=function(t,e,r,i,n){var s,a,o=n*8-i-1,l=(1<>1,u=-7,f=r?n-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+=i;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,i),s=s-c}return(h?-1:1)*a*Math.pow(2,s-i)};Pm.write=function(t,e,r,i,n,s){var a,o,l,c=s*8-n-1,u=(1<>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,m=i?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,n),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[r+h]=o&255,h+=m,o/=256,n-=8);for(a=a<0;t[r+h]=a&255,h+=m,a/=256,c-=8);t[r+h-m]|=g*128}});var Bm=F(Ao=>{"use strict";p();var Rm=jb(),Eo=qb(),zb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ao.Buffer=I;Ao.SlowBuffer=JD;Ao.INSPECT_MAX_BYTES=50;var Cf=2147483647;Ao.kMaxLength=Cf;I.TYPED_ARRAY_SUPPORT=YD();!I.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 YD(){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(I.prototype,"parent",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.buffer}});Object.defineProperty(I.prototype,"offset",{enumerable:!0,get:function(){if(I.isBuffer(this))return this.byteOffset}});function Ln(t){if(t>Cf)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,I.prototype),e}function I(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 Om(t)}return Xb(t,e,r)}I.poolSize=8192;function Xb(t,e,r){if(typeof t=="string")return ZD(t,e);if(ArrayBuffer.isView(t))return KD(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Ji(t,ArrayBuffer)||t&&Ji(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ji(t,SharedArrayBuffer)||t&&Ji(t.buffer,SharedArrayBuffer)))return Fm(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return I.from(i,e,r);let n=QD(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return I.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}I.from=function(t,e,r){return Xb(t,e,r)};Object.setPrototypeOf(I.prototype,Uint8Array.prototype);Object.setPrototypeOf(I,Uint8Array);function Zb(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function XD(t,e,r){return Zb(t),t<=0?Ln(t):e!==void 0?typeof r=="string"?Ln(t).fill(e,r):Ln(t).fill(e):Ln(t)}I.alloc=function(t,e,r){return XD(t,e,r)};function Om(t){return Zb(t),Ln(t<0?0:Mm(t)|0)}I.allocUnsafe=function(t){return Om(t)};I.allocUnsafeSlow=function(t){return Om(t)};function ZD(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!I.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Kb(t,e)|0,i=Ln(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function $m(t){let e=t.length<0?0:Mm(t.length)|0,r=Ln(e);for(let i=0;i=Cf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Cf.toString(16)+" bytes");return t|0}function JD(t){return+t!=t&&(t=0),I.alloc(+t)}I.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==I.prototype};I.compare=function(e,r){if(Ji(e,Uint8Array)&&(e=I.from(e,e.offset,e.byteLength)),Ji(r,Uint8Array)&&(r=I.from(r,r.offset,r.byteLength)),!I.isBuffer(e)||!I.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,a=Math.min(i,n);sn.length?(I.isBuffer(a)||(a=I.from(a)),a.copy(n,s)):Uint8Array.prototype.set.call(n,a,s);else if(I.isBuffer(a))a.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n};function Kb(t,e){if(I.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ji(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Im(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return a_(t).length;default:if(n)return i?-1:Im(t).length;e=(""+e).toLowerCase(),n=!0}}I.byteLength=Kb;function eL(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return uL(this,e,r);case"utf8":case"utf-8":return Jb(this,e,r);case"ascii":return lL(this,e,r);case"latin1":case"binary":return cL(this,e,r);case"base64":return aL(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fL(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}I.prototype._isBuffer=!0;function la(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}I.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};zb&&(I.prototype[zb]=I.prototype.inspect);I.prototype.compare=function(e,r,i,n,s){if(Ji(e,Uint8Array)&&(e=I.from(e,e.offset,e.byteLength)),!I.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let a=s-n,o=i-r,l=Math.min(a,o),c=this.slice(n,s),u=e.slice(r,i);for(let f=0;f2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Lm(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=I.from(e,i)),I.isBuffer(e))return e.length===0?-1:Vb(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Vb(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Vb(t,e,r,i,n){let s=1,a=t.length,o=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,o/=2,r/=2}function l(u,f){return s===1?u[f]:u.readUInt16BE(f*s)}let c;if(n){let u=-1;for(c=r;ca&&(r=a-o),c=r;c>=0;c--){let u=!0;for(let f=0;fn&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let a;for(a=0;a>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return tL(this,e,r,i);case"utf8":case"utf-8":return rL(this,e,r,i);case"ascii":case"latin1":case"binary":return iL(this,e,r,i);case"base64":return nL(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return sL(this,e,r,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};I.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function aL(t,e,r){return e===0&&r===t.length?Rm.fromByteArray(t):Rm.fromByteArray(t.slice(e,r))}function Jb(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n239?4:s>223?3:s>191?2:1;if(n+o<=r){let l,c,u,f;switch(o){case 1:s<128&&(a=s);break;case 2:l=t[n+1],(l&192)===128&&(f=(s&31)<<6|l&63,f>127&&(a=f));break;case 3:l=t[n+1],c=t[n+2],(l&192)===128&&(c&192)===128&&(f=(s&15)<<12|(l&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:l=t[n+1],c=t[n+2],u=t[n+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(f=(s&15)<<18|(l&63)<<12|(c&63)<<6|u&63,f>65535&&f<1114112&&(a=f))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=o}return oL(i)}var Wb=4096;function oL(t){let e=t.length;if(e<=Wb)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii)&&(r=i);let n="";for(let s=e;si&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),rr)throw new RangeError("Trying to access beyond buffer length")}I.prototype.readUintLE=I.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||Dt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a>>0,r=r>>>0,i||Dt(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};I.prototype.readUint8=I.prototype.readUInt8=function(e,r){return e=e>>>0,r||Dt(e,1,this.length),this[e]};I.prototype.readUint16LE=I.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Dt(e,2,this.length),this[e]|this[e+1]<<8};I.prototype.readUint16BE=I.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Dt(e,2,this.length),this[e]<<8|this[e+1]};I.prototype.readUint32LE=I.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};I.prototype.readUint32BE=I.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};I.prototype.readBigUInt64LE=ws(function(e){e=e>>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<>>0,r=r>>>0,i||Dt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a=s&&(n-=Math.pow(2,8*r)),n};I.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||Dt(e,r,this.length);let n=r,s=1,a=this[e+--n];for(;n>0&&(s*=256);)a+=this[e+--n]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*r)),a};I.prototype.readInt8=function(e,r){return e=e>>>0,r||Dt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};I.prototype.readInt16LE=function(e,r){e=e>>>0,r||Dt(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};I.prototype.readInt16BE=function(e,r){e=e>>>0,r||Dt(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};I.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};I.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};I.prototype.readBigInt64LE=ws(function(e){e=e>>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<>>0,ko(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&mc(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,r||Dt(e,4,this.length),Eo.read(this,e,!0,23,4)};I.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Dt(e,4,this.length),Eo.read(this,e,!1,23,4)};I.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Dt(e,8,this.length),Eo.read(this,e,!0,52,8)};I.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Dt(e,8,this.length),Eo.read(this,e,!1,52,8)};function br(t,e,r,i,n,s){if(!I.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}I.prototype.writeUintLE=I.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;br(this,e,r,i,o,0)}let s=1,a=0;for(this[r]=e&255;++a>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;br(this,e,r,i,o,0)}let s=i-1,a=1;for(this[r+s]=e&255;--s>=0&&(a*=256);)this[r+s]=e/a&255;return r+i};I.prototype.writeUint8=I.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,1,255,0),this[r]=e&255,r+1};I.prototype.writeUint16LE=I.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};I.prototype.writeUint16BE=I.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};I.prototype.writeUint32LE=I.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};I.prototype.writeUint32BE=I.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function e_(t,e,r,i,n){s_(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function t_(t,e,r,i,n){s_(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}I.prototype.writeBigUInt64LE=ws(function(e,r=0){return e_(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeBigUInt64BE=ws(function(e,r=0){return t_(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});I.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);br(this,e,r,i,l-1,-l)}let s=0,a=1,o=0;for(this[r]=e&255;++s>0)-o&255;return r+i};I.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);br(this,e,r,i,l-1,-l)}let s=i-1,a=1,o=0;for(this[r+s]=e&255;--s>=0&&(a*=256);)e<0&&o===0&&this[r+s+1]!==0&&(o=1),this[r+s]=(e/a>>0)-o&255;return r+i};I.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};I.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};I.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};I.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};I.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||br(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};I.prototype.writeBigInt64LE=ws(function(e,r=0){return e_(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});I.prototype.writeBigInt64BE=ws(function(e,r=0){return t_(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function r_(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function i_(t,e,r,i,n){return e=+e,r=r>>>0,n||r_(t,e,r,4,34028234663852886e22,-34028234663852886e22),Eo.write(t,e,r,i,23,4),r+4}I.prototype.writeFloatLE=function(e,r,i){return i_(this,e,r,!0,i)};I.prototype.writeFloatBE=function(e,r,i){return i_(this,e,r,!1,i)};function n_(t,e,r,i,n){return e=+e,r=r>>>0,n||r_(t,e,r,8,17976931348623157e292,-17976931348623157e292),Eo.write(t,e,r,i,52,8),r+8}I.prototype.writeDoubleLE=function(e,r,i){return n_(this,e,r,!0,i)};I.prototype.writeDoubleBE=function(e,r,i){return n_(this,e,r,!1,i)};I.prototype.copy=function(e,r,i,n){if(!I.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s2**32?n=Yb(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Yb(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Yb(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function dL(t,e,r){ko(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&mc(e,t.length-(r+1))}function s_(t,e,r,i,n,s){if(t>r||t3?e===0||e===BigInt(0)?o=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:o=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:o=`>= ${e}${a} and <= ${r}${a}`,new So.ERR_OUT_OF_RANGE("value",o,t)}dL(i,n,s)}function ko(t,e){if(typeof t!="number")throw new So.ERR_INVALID_ARG_TYPE(e,"number",t)}function mc(t,e,r){throw Math.floor(t)!==t?(ko(t,r),new So.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new So.ERR_BUFFER_OUT_OF_BOUNDS:new So.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var hL=/[^+/0-9A-Za-z-_]/g;function pL(t){if(t=t.split("=")[0],t=t.trim().replace(hL,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Im(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let a=0;a55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function mL(t){let e=[];for(let r=0;r>8,n=r%256,s.push(n),s.push(i);return s}function a_(t){return Rm.toByteArray(pL(t))}function Pf(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function Ji(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Lm(t){return t!==t}var vL=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function ws(t){return typeof BigInt=="undefined"?wL:t}function wL(){throw new Error("BigInt not supported")}});var o_,Nm,Buffer,p=BD(()=>{o_=require("obsidian");o_.Platform.isMobileApp?Nm=Bm().Buffer:Nm=global.Buffer;Buffer=Nm});var c_=F((c7,l_)=>{"use strict";p();var Yr=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process=="undefined"||typeof process.domain=="undefined")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||Yr.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||Yr.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||Yr.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=Yr.DEFAULT_MAX_PENDING};Yr.DEFAULT_TIMEOUT=0;Yr.DEFAULT_MAX_OCCUPATION_TIME=0;Yr.DEFAULT_MAX_EXECUTION_TIME=0;Yr.DEFAULT_MAX_PENDING=1e3;Yr.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,s=null,a=null;typeof r!="function"&&(i=r,r=null,a=new this.Promise(function(b,k){n=b,s=k})),i=i||{};var o=!1,l=null,c=null,u=null,f=this,d=function(b,k,x){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(f.queues[t]&&f.queues[t].length===0&&delete f.queues[t],f.domainReentrant&&delete f.domains[t]),o||(a?k?s(k):n(x):typeof r=="function"&&r(k,x),o=!0),b&&f.queues[t]&&f.queues[t].length>0&&f.queues[t].shift()()},h=function(b){if(o)return d(b);l&&(clearTimeout(l),l=null),f.domainReentrant&&b&&(f.domains[t]=process.domain);var k=i.maxExecutionTime||f.maxExecutionTime;if(k&&(u=setTimeout(function(){f.queues[t]&&d(b,new Error("Maximum execution time is exceeded "+t))},k)),e.length===1){var x=!1;try{e(function(E,A){x||(x=!0,d(b,E,A))})}catch(E){x||(x=!0,d(b,E))}}else f._promiseTry(function(){return e()}).then(function(E){d(b,void 0,E)},function(E){d(b,E)})};f.domainReentrant&&process.domain&&(h=process.domain.bind(h));var m=i.maxPending||f.maxPending;if(!f.queues[t])f.queues[t]=[],h(!0);else if(f.domainReentrant&&process.domain&&process.domain===f.domains[t])h(!1);else if(f.queues[t].length>=m)d(!1,new Error("Too many pending tasks in queue "+t));else{var g=function(){h(!0)};i.skipQueue?f.queues[t].unshift(g):f.queues[t].push(g);var v=i.timeout||f.timeout;v&&(l=setTimeout(function(){l=null,d(!1,new Error("async-lock timed out in queue "+t))},v))}var w=i.maxOccupationTime||f.maxOccupationTime;if(w&&(c=setTimeout(function(){f.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},w)),a)return a};Yr.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,s=function(o,l){return function(c){n.acquire(o,l,c,i)}},a=t.reduceRight(function(o,l){return s(l,o)},e);if(typeof r=="function")a(r);else return new this.Promise(function(o,l){a.length===1?a(function(c,u){c?l(c):o(u)}):o(a())})};Yr.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};Yr.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};l_.exports=Yr});var f_=F((f7,u_)=>{"use strict";p();u_.exports=c_()});var d_=F((h7,Hm)=>{p();typeof Object.create=="function"?Hm.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Hm.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var $f=F((Um,p_)=>{p();var Rf=Bm(),en=Rf.Buffer;function h_(t,e){for(var r in t)e[r]=t[r]}en.from&&en.alloc&&en.allocUnsafe&&en.allocUnsafeSlow?p_.exports=Rf:(h_(Rf,Um),Um.Buffer=ca);function ca(t,e,r){return en(t,e,r)}ca.prototype=Object.create(en.prototype);h_(en,ca);ca.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return en(t,e,r)};ca.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=en(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ca.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return en(t)};ca.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Rf.SlowBuffer(t)}});var Ff=F((g7,m_)=>{p();var yL={}.toString;m_.exports=Array.isArray||function(t){return yL.call(t)=="[object Array]"}});var _r=F((w7,g_)=>{"use strict";p();g_.exports=TypeError});var If=F((b7,v_)=>{"use strict";p();v_.exports=Object});var Gm=F((x7,w_)=>{"use strict";p();w_.exports=Error});var b_=F((E7,y_)=>{"use strict";p();y_.exports=EvalError});var x_=F((A7,__)=>{"use strict";p();__.exports=RangeError});var E_=F((C7,S_)=>{"use strict";p();S_.exports=ReferenceError});var Of=F((R7,k_)=>{"use strict";p();k_.exports=SyntaxError});var T_=F((F7,A_)=>{"use strict";p();A_.exports=URIError});var P_=F((O7,C_)=>{"use strict";p();C_.exports=Math.abs});var $_=F((D7,R_)=>{"use strict";p();R_.exports=Math.floor});var I_=F((B7,F_)=>{"use strict";p();F_.exports=Math.max});var M_=F((H7,O_)=>{"use strict";p();O_.exports=Math.min});var L_=F((G7,D_)=>{"use strict";p();D_.exports=Math.pow});var N_=F((q7,B_)=>{"use strict";p();B_.exports=Math.round});var U_=F((V7,H_)=>{"use strict";p();H_.exports=Number.isNaN||function(e){return e!==e}});var j_=F((Y7,G_)=>{"use strict";p();var bL=U_();G_.exports=function(e){return bL(e)||e===0?e:e<0?-1:1}});var z_=F((Z7,q_)=>{"use strict";p();q_.exports=Object.getOwnPropertyDescriptor});var ys=F((Q7,V_)=>{"use strict";p();var Mf=z_();if(Mf)try{Mf([],"length")}catch(t){Mf=null}V_.exports=Mf});var gc=F((eY,W_)=>{"use strict";p();var Df=Object.defineProperty||!1;if(Df)try{Df({},"a",{value:1})}catch(t){Df=!1}W_.exports=Df});var vc=F((rY,Y_)=>{"use strict";p();Y_.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==!0)return!1}return!0}});var Lf=F((nY,Z_)=>{"use strict";p();var X_=typeof Symbol!="undefined"&&Symbol,_L=vc();Z_.exports=function(){return typeof X_!="function"||typeof Symbol!="function"||typeof X_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_L()}});var jm=F((aY,K_)=>{"use strict";p();K_.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var qm=F((lY,Q_)=>{"use strict";p();var xL=If();Q_.exports=xL.getPrototypeOf||null});var tx=F((uY,ex)=>{"use strict";p();var SL="Function.prototype.bind called on incompatible ",EL=Object.prototype.toString,kL=Math.max,AL="[object Function]",J_=function(e,r){for(var i=[],n=0;n{"use strict";p();var PL=tx();rx.exports=Function.prototype.bind||PL});var Bf=F((pY,ix)=>{"use strict";p();ix.exports=Function.prototype.call});var Nf=F((gY,nx)=>{"use strict";p();nx.exports=Function.prototype.apply});var ax=F((wY,sx)=>{"use strict";p();sx.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var zm=F((bY,ox)=>{"use strict";p();var RL=To(),$L=Nf(),FL=Bf(),IL=ax();ox.exports=IL||RL.call(FL,$L)});var Hf=F((xY,lx)=>{"use strict";p();var OL=To(),ML=_r(),DL=Bf(),LL=zm();lx.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new ML("a function is required");return LL(OL,DL,e)}});var px=F((EY,hx)=>{"use strict";p();var BL=Hf(),cx=ys(),fx;try{fx=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Vm=!!fx&&cx&&cx(Object.prototype,"__proto__"),dx=Object,ux=dx.getPrototypeOf;hx.exports=Vm&&typeof Vm.get=="function"?BL([Vm.get]):typeof ux=="function"?function(e){return ux(e==null?e:dx(e))}:!1});var Uf=F((AY,wx)=>{"use strict";p();var mx=jm(),gx=qm(),vx=px();wx.exports=mx?function(e){return mx(e)}:gx?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return gx(e)}:vx?function(e){return vx(e)}:null});var Gf=F((CY,yx)=>{"use strict";p();var NL=Function.prototype.call,HL=Object.prototype.hasOwnProperty,UL=To();yx.exports=UL.call(NL,HL)});var tn=F((RY,kx)=>{"use strict";p();var Ee,GL=If(),jL=Gm(),qL=b_(),zL=x_(),VL=E_(),$o=Of(),Ro=_r(),WL=T_(),YL=P_(),XL=$_(),ZL=I_(),KL=M_(),QL=L_(),JL=N_(),eB=j_(),Sx=Function,Wm=function(t){try{return Sx('"use strict"; return ('+t+").constructor;")()}catch(e){}},wc=ys(),tB=gc(),Ym=function(){throw new Ro},rB=wc?function(){try{return arguments.callee,Ym}catch(t){try{return wc(arguments,"callee").get}catch(e){return Ym}}}():Ym,Co=Lf()(),Lt=Uf(),iB=qm(),nB=jm(),Ex=Nf(),yc=Bf(),Po={},sB=typeof Uint8Array=="undefined"||!Lt?Ee:Lt(Uint8Array),ua={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Ee:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Ee:ArrayBuffer,"%ArrayIteratorPrototype%":Co&&Lt?Lt([][Symbol.iterator]()):Ee,"%AsyncFromSyncIteratorPrototype%":Ee,"%AsyncFunction%":Po,"%AsyncGenerator%":Po,"%AsyncGeneratorFunction%":Po,"%AsyncIteratorPrototype%":Po,"%Atomics%":typeof Atomics=="undefined"?Ee:Atomics,"%BigInt%":typeof BigInt=="undefined"?Ee:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Ee:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Ee:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Ee:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":jL,"%eval%":eval,"%EvalError%":qL,"%Float16Array%":typeof Float16Array=="undefined"?Ee:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Ee:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Ee:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Ee:FinalizationRegistry,"%Function%":Sx,"%GeneratorFunction%":Po,"%Int8Array%":typeof Int8Array=="undefined"?Ee:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Ee:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Ee:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Co&&Lt?Lt(Lt([][Symbol.iterator]())):Ee,"%JSON%":typeof JSON=="object"?JSON:Ee,"%Map%":typeof Map=="undefined"?Ee:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Co||!Lt?Ee:Lt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":GL,"%Object.getOwnPropertyDescriptor%":wc,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Ee:Promise,"%Proxy%":typeof Proxy=="undefined"?Ee:Proxy,"%RangeError%":zL,"%ReferenceError%":VL,"%Reflect%":typeof Reflect=="undefined"?Ee:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Ee:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Co||!Lt?Ee:Lt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Ee:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Co&&Lt?Lt(""[Symbol.iterator]()):Ee,"%Symbol%":Co?Symbol:Ee,"%SyntaxError%":$o,"%ThrowTypeError%":rB,"%TypedArray%":sB,"%TypeError%":Ro,"%Uint8Array%":typeof Uint8Array=="undefined"?Ee:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Ee:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Ee:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Ee:Uint32Array,"%URIError%":WL,"%WeakMap%":typeof WeakMap=="undefined"?Ee:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Ee:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Ee:WeakSet,"%Function.prototype.call%":yc,"%Function.prototype.apply%":Ex,"%Object.defineProperty%":tB,"%Object.getPrototypeOf%":iB,"%Math.abs%":YL,"%Math.floor%":XL,"%Math.max%":ZL,"%Math.min%":KL,"%Math.pow%":QL,"%Math.round%":JL,"%Math.sign%":eB,"%Reflect.getPrototypeOf%":nB};if(Lt)try{null.error}catch(t){bx=Lt(Lt(t)),ua["%Error.prototype%"]=bx}var bx,aB=function t(e){var r;if(e==="%AsyncFunction%")r=Wm("async function () {}");else if(e==="%GeneratorFunction%")r=Wm("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Wm("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Lt&&(r=Lt(n.prototype))}return ua[e]=r,r},_x={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bc=To(),jf=Gf(),oB=bc.call(yc,Array.prototype.concat),lB=bc.call(Ex,Array.prototype.splice),xx=bc.call(yc,String.prototype.replace),qf=bc.call(yc,String.prototype.slice),cB=bc.call(yc,RegExp.prototype.exec),uB=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fB=/\\(\\)?/g,dB=function(e){var r=qf(e,0,1),i=qf(e,-1);if(r==="%"&&i!=="%")throw new $o("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new $o("invalid intrinsic syntax, expected opening `%`");var n=[];return xx(e,uB,function(s,a,o,l){n[n.length]=o?xx(l,fB,"$1"):a||s}),n},hB=function(e,r){var i=e,n;if(jf(_x,i)&&(n=_x[i],i="%"+n[0]+"%"),jf(ua,i)){var s=ua[i];if(s===Po&&(s=aB(i)),typeof s=="undefined"&&!r)throw new Ro("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new $o("intrinsic "+e+" does not exist!")};kx.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Ro("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ro('"allowMissing" argument must be a boolean');if(cB(/^%?[^%]*%?$/,e)===null)throw new $o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=dB(e),n=i.length>0?i[0]:"",s=hB("%"+n+"%",r),a=s.name,o=s.value,l=!1,c=s.alias;c&&(n=c[0],lB(i,oB([0,1],c)));for(var u=1,f=!0;u=i.length){var g=wc(o,d);f=!!g,f&&"get"in g&&!("originalValue"in g.get)?o=g.get:o=o[d]}else f=jf(o,d),o=o[d];f&&!l&&(ua[a]=o)}}return o}});var Bt=F((FY,Cx)=>{"use strict";p();var Ax=tn(),Tx=Hf(),pB=Tx([Ax("%String.prototype.indexOf%")]);Cx.exports=function(e,r){var i=Ax(e,!!r);return typeof i=="function"&&pB(e,".prototype.")>-1?Tx([i]):i}});var Fx=F((OY,$x)=>{"use strict";p();var Rx=Function.prototype.toString,Fo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Zm,zf;if(typeof Fo=="function"&&typeof Object.defineProperty=="function")try{Zm=Object.defineProperty({},"length",{get:function(){throw zf}}),zf={},Fo(function(){throw 42},null,Zm)}catch(t){t!==zf&&(Fo=null)}else Fo=null;var mB=/^\s*class\b/,Km=function(e){try{var r=Rx.call(e);return mB.test(r)}catch(i){return!1}},Xm=function(e){try{return Km(e)?!1:(Rx.call(e),!0)}catch(r){return!1}},Vf=Object.prototype.toString,gB="[object Object]",vB="[object Function]",wB="[object GeneratorFunction]",yB="[object HTMLAllCollection]",bB="[object HTML document.all class]",_B="[object HTMLCollection]",xB=typeof Symbol=="function"&&!!Symbol.toStringTag,SB=!(0 in[,]),Qm=function(){return!1};typeof document=="object"&&(Px=document.all,Vf.call(Px)===Vf.call(document.all)&&(Qm=function(e){if((SB||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var r=Vf.call(e);return(r===yB||r===bB||r===_B||r===gB)&&e("")==null}catch(i){}return!1}));var Px;$x.exports=Fo?function(e){if(Qm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Fo(e,null,Zm)}catch(r){if(r!==zf)return!1}return!Km(e)&&Xm(e)}:function(e){if(Qm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(xB)return Xm(e);if(Km(e))return!1;var r=Vf.call(e);return r!==vB&&r!==wB&&!/^\[object HTML/.test(r)?!1:Xm(e)}});var Mx=F((DY,Ox)=>{"use strict";p();var EB=Fx(),kB=Object.prototype.toString,Ix=Object.prototype.hasOwnProperty,AB=function(e,r,i){for(var n=0,s=e.length;n=3&&(n=i),PB(e)?AB(e,r,n):typeof e=="string"?TB(e,r,n):CB(e,r,n)}});var Lx=F((BY,Dx)=>{"use strict";p();Dx.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Nx=F((HY,Bx)=>{"use strict";p();var Jm=Lx(),RB=typeof globalThis=="undefined"?global:globalThis;Bx.exports=function(){for(var e=[],r=0;r{"use strict";p();var Hx=gc(),$B=Of(),Io=_r(),Ux=ys();Gx.exports=function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new Io("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Io("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Io("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Io("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Io("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Io("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,l=!!Ux&&Ux(e,r);if(Hx)Hx(e,r,{configurable:a===null&&l?l.configurable:!a,enumerable:n===null&&l?l.enumerable:!n,value:i,writable:s===null&&l?l.writable:!s});else if(o||!n&&!s&&!a)e[r]=i;else throw new $B("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Yf=F((qY,qx)=>{"use strict";p();var eg=gc(),jx=function(){return!!eg};jx.hasArrayLengthDefineBug=function(){if(!eg)return null;try{return eg([],"length",{value:1}).length!==1}catch(e){return!0}};qx.exports=jx});var Xx=F((VY,Yx)=>{"use strict";p();var FB=tn(),zx=Wf(),IB=Yf()(),Vx=ys(),Wx=_r(),OB=FB("%Math.floor%");Yx.exports=function(e,r){if(typeof e!="function")throw new Wx("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||OB(r)!==r)throw new Wx("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in e&&Vx){var a=Vx(e,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(s=!1)}return(n||s||!i)&&(IB?zx(e,"length",r,!0,!0):zx(e,"length",r)),e}});var Kx=F((YY,Zx)=>{"use strict";p();var MB=To(),DB=Nf(),LB=zm();Zx.exports=function(){return LB(MB,DB,arguments)}});var fa=F((ZY,Xf)=>{"use strict";p();var BB=Xx(),Qx=gc(),NB=Hf(),Jx=Kx();Xf.exports=function(e){var r=NB(arguments),i=e.length-(arguments.length-1);return BB(r,1+(i>0?i:0),!0)};Qx?Qx(Xf.exports,"apply",{value:Jx}):Xf.exports.apply=Jx});var bs=F((QY,e1)=>{"use strict";p();var HB=vc();e1.exports=function(){return HB()&&!!Symbol.toStringTag}});var ng=F((eX,n1)=>{"use strict";p();var Qf=Mx(),UB=Nx(),t1=fa(),rg=Bt(),Kf=ys(),Zf=Uf(),GB=rg("Object.prototype.toString"),i1=bs()(),r1=typeof globalThis=="undefined"?global:globalThis,tg=UB(),ig=rg("String.prototype.slice"),jB=rg("Array.prototype.indexOf",!0)||function(e,r){for(var i=0;i-1?r:r!=="Object"?!1:zB(e)}return Kf?qB(e):null}});var a1=F((rX,s1)=>{"use strict";p();var VB=ng();s1.exports=function(e){return!!VB(e)}});var l1=F((nX,o1)=>{"use strict";p();var WB=_r(),YB=Bt(),XB=YB("TypedArray.prototype.buffer",!0),ZB=a1();o1.exports=XB||function(e){if(!ZB(e))throw new WB("Not a Typed Array");return e.buffer}});var f1=F((aX,u1)=>{"use strict";p();var Ci=$f().Buffer,KB=Ff(),QB=l1(),JB=ArrayBuffer.isView||function(e){try{return QB(e),!0}catch(r){return!1}},eN=typeof Uint8Array!="undefined",c1=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined",tN=c1&&(Ci.prototype instanceof Uint8Array||Ci.TYPED_ARRAY_SUPPORT);u1.exports=function(e,r){if(Ci.isBuffer(e))return e.constructor&&!("isBuffer"in e)?Ci.from(e):e;if(typeof e=="string")return Ci.from(e,r);if(c1&&JB(e)){if(e.byteLength===0)return Ci.alloc(0);if(tN){var i=Ci.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=Ci.from(n);if(s.length===e.byteLength)return s}if(eN&&e instanceof Uint8Array)return Ci.from(e);var a=KB(e);if(a)for(var o=0;o255||~~l!==l)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||Ci.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return Ci.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var h1=F((lX,d1)=>{"use strict";p();var rN=$f().Buffer,iN=f1();function td(t,e){this._block=rN.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}td.prototype.update=function(t,e){t=iN(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};td.prototype._update=function(){throw new Error("_update must be implemented by subclass")};d1.exports=td});var g1=F((uX,m1)=>{"use strict";p();var nN=d_(),p1=h1(),sN=$f().Buffer,aN=[1518500249,1859775393,-1894007588,-899497514],oN=new Array(80);function _c(){this.init(),this._w=oN,p1.call(this,64,56)}nN(_c,p1);_c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function lN(t){return t<<1|t>>>31}function cN(t){return t<<5|t>>>27}function uN(t){return t<<30|t>>>2}function fN(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}_c.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=lN(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=cN(r)+fN(c,i,n,s)+a+e[l]+aN[c]|0;a=s,s=n,n=uN(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};_c.prototype._hash=function(){var t=sN.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};m1.exports=_c});var w1=F(sg=>{p();var v1;(function(t){typeof DO_NOT_EXPORT_CRC=="undefined"?typeof sg=="object"?t(sg):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(v1={}):t(v1={})})(function(t){t.version="1.2.2";function e(){for(var y=0,S=new Array(256),_=0;_!=256;++_)y=_,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,y=y&1?-306674912^y>>>1:y>>>1,S[_]=y;return typeof Int32Array!="undefined"?new Int32Array(S):S}var r=e();function i(y){var S=0,_=0,T=0,P=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(T=0;T!=256;++T)P[T]=y[T];for(T=0;T!=256;++T)for(_=y[T],S=256+T;S<4096;S+=256)_=P[S]=_>>>8^y[_&255];var D=[];for(T=1;T!=16;++T)D[T-1]=typeof Int32Array!="undefined"?P.subarray(T*256,T*256+256):P.slice(T*256,T*256+256);return D}var n=i(r),s=n[0],a=n[1],o=n[2],l=n[3],c=n[4],u=n[5],f=n[6],d=n[7],h=n[8],m=n[9],g=n[10],v=n[11],w=n[12],b=n[13],k=n[14];function x(y,S){for(var _=S^-1,T=0,P=y.length;T>>8^r[(_^y.charCodeAt(T++))&255];return~_}function E(y,S){for(var _=S^-1,T=y.length-15,P=0;P>8&255]^w[y[P++]^_>>16&255]^v[y[P++]^_>>>24]^g[y[P++]]^m[y[P++]]^h[y[P++]]^d[y[P++]]^f[y[P++]]^u[y[P++]]^c[y[P++]]^l[y[P++]]^o[y[P++]]^a[y[P++]]^s[y[P++]]^r[y[P++]];for(T+=15;P>>8^r[(_^y[P++])&255];return~_}function A(y,S){for(var _=S^-1,T=0,P=y.length,D=0,B=0;T>>8^r[(_^D)&255]:D<2048?(_=_>>>8^r[(_^(192|D>>6&31))&255],_=_>>>8^r[(_^(128|D&63))&255]):D>=55296&&D<57344?(D=(D&1023)+64,B=y.charCodeAt(T++)&1023,_=_>>>8^r[(_^(240|D>>8&7))&255],_=_>>>8^r[(_^(128|D>>2&63))&255],_=_>>>8^r[(_^(128|B>>6&15|(D&3)<<4))&255],_=_>>>8^r[(_^(128|B&63))&255]):(_=_>>>8^r[(_^(224|D>>12&15))&255],_=_>>>8^r[(_^(128|D>>6&63))&255],_=_>>>8^r[(_^(128|D&63))&255]);return~_}t.table=r,t.bstr=x,t.buf=E,t.str=A})});var Bn=F(fr=>{"use strict";p();var dN=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function hN(t,e){return Object.prototype.hasOwnProperty.call(t,e)}fr.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)hN(r,i)&&(t[i]=r[i])}}return t};fr.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var pN={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var s=0;s{"use strict";p();var gN=Bn(),vN=4,y1=0,b1=1,wN=2;function Mo(t){for(var e=t.length;--e>=0;)t[e]=0}var yN=0,A1=1,bN=2,_N=3,xN=258,dg=29,Tc=256,Sc=Tc+1+dg,Oo=30,hg=19,T1=2*Sc+1,da=15,ag=16,SN=7,pg=256,C1=16,P1=17,R1=18,ug=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],rd=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],EN=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],$1=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],kN=512,Nn=new Array((Sc+2)*2);Mo(Nn);var xc=new Array(Oo*2);Mo(xc);var Ec=new Array(kN);Mo(Ec);var kc=new Array(xN-_N+1);Mo(kc);var mg=new Array(dg);Mo(mg);var id=new Array(Oo);Mo(id);function og(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var F1,I1,O1;function lg(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function M1(t){return t<256?Ec[t]:Ec[256+(t>>>7)]}function Ac(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function xr(t,e,r){t.bi_valid>ag-r?(t.bi_buf|=e<>ag-t.bi_valid,t.bi_valid+=r-ag):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function AN(t){t.bi_valid===16?(Ac(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function TN(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,u,f,d,h,m,g=0;for(d=0;d<=da;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;cl&&(d=l,g++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,h=0,u>=o&&(h=a[u-o]),m=r[u*2],t.opt_len+=m*(d+h),s&&(t.static_len+=m*(n[u*2+1]+h)));if(g!==0){do{for(d=l-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(d=l;d!==0;d--)for(u=t.bl_count[d];u!==0;)f=t.heap[--c],!(f>i)&&(r[f*2+1]!==d&&(t.opt_len+=(d-r[f*2+1])*r[f*2],r[f*2+1]=d),u--)}}function L1(t,e,r){var i=new Array(da+1),n=0,s,a;for(s=1;s<=da;s++)i[s]=n=n+r[s-1]<<1;for(a=0;a<=e;a++){var o=t[a*2+1];o!==0&&(t[a*2]=D1(i[o]++,o))}}function CN(){var t,e,r,i,n,s=new Array(da+1);for(r=0,i=0;i>=7;i8?Ac(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function PN(t,e,r,i){N1(t),i&&(Ac(t,r),Ac(t,~r)),gN.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function _1(t,e,r,i){var n=e*2,s=r*2;return t[n]>1;a>=1;a--)cg(t,r,a);c=s;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],cg(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=o,r[c*2]=r[a*2]+r[o*2],t.depth[c]=(t.depth[a]>=t.depth[o]?t.depth[a]:t.depth[o])+1,r[a*2+1]=r[o*2+1]=c,t.heap[1]=c++,cg(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],TN(t,e),L1(r,l,t.bl_count)}function S1(t,e,r){var i,n=-1,s,a=e[0*2+1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)s=a,a=e[(i+1)*2+1],!(++o=3&&t.bl_tree[$1[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function $N(t,e,r,i){var n;for(xr(t,e-257,5),xr(t,r-1,5),xr(t,i-4,4),n=0;n>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return y1;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return b1;for(r=32;r0?(t.strm.data_type===wN&&(t.strm.data_type=FN(t)),fg(t,t.l_desc),fg(t,t.d_desc),a=RN(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=r+5,r+4<=n&&e!==-1?H1(t,e,r,i):t.strategy===vN||s===n?(xr(t,(A1<<1)+(i?1:0),3),x1(t,Nn,xc)):(xr(t,(bN<<1)+(i?1:0),3),$N(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),x1(t,t.dyn_ltree,t.dyn_dtree)),B1(t),i&&N1(t)}function DN(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(kc[r]+Tc+1)*2]++,t.dyn_dtree[M1(e)*2]++),t.last_lit===t.lit_bufsize-1}Do._tr_init=IN;Do._tr_stored_block=H1;Do._tr_flush_block=MN;Do._tr_tally=DN;Do._tr_align=ON});var gg=F((wX,G1)=>{"use strict";p();function LN(t,e,r,i){for(var n=t&65535|0,s=t>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do n=n+e[i++]|0,s=s+n|0;while(--a);n%=65521,s%=65521}return n|s<<16|0}G1.exports=LN});var vg=F((bX,j1)=>{"use strict";p();function BN(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var NN=BN();function HN(t,e,r,i){var n=NN,s=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return t^-1}j1.exports=HN});var nd=F((xX,q1)=>{"use strict";p();q1.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var J1=F(an=>{"use strict";p();var dr=Bn(),di=U1(),Y1=gg(),_s=vg(),UN=nd(),ga=0,GN=1,jN=3,As=4,z1=5,sn=0,V1=1,hi=-2,qN=-3,wg=-5,zN=-1,VN=1,sd=2,WN=3,YN=4,XN=0,ZN=2,cd=8,KN=9,QN=15,JN=8,eH=29,tH=256,bg=tH+1+eH,rH=30,iH=19,nH=2*bg+1,sH=15,Ce=3,Es=258,Pi=Es+Ce+1,aH=32,ud=42,_g=69,ad=73,od=91,ld=103,ha=113,Pc=666,Ct=1,Rc=2,pa=3,No=4,oH=3;function ks(t,e){return t.msg=UN[e],e}function W1(t){return(t<<1)-(t>4?9:0)}function Ss(t){for(var e=t.length;--e>=0;)t[e]=0}function xs(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(dr.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function qt(t,e){di._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,xs(t.strm)}function Ie(t,e){t.pending_buf[t.pending++]=e}function Cc(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function lH(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,dr.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=Y1(t.adler,e,n,r):t.state.wrap===2&&(t.adler=_s(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function X1(t,e){var r=t.max_chain_length,i=t.strstart,n,s,a=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-Pi?t.strstart-(t.w_size-Pi):0,c=t.window,u=t.w_mask,f=t.prev,d=t.strstart+Es,h=c[i+a-1],m=c[i+a];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do if(n=e,!(c[n+a]!==m||c[n+a-1]!==h||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&ia){if(t.match_start=e,a=s,s>=o)break;h=c[i+a-1],m=c[i+a]}}while((e=f[e&u])>l&&--r!==0);return a<=t.lookahead?a:t.lookahead}function ma(t){var e=t.w_size,r,i,n,s,a;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Pi)){dr.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);s+=e}if(t.strm.avail_in===0)break;if(i=lH(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=Ce)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ma(t),t.lookahead===0&&e===ga)return Ct;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,qt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Pi&&(qt(t,!1),t.strm.avail_out===0))return Ct}return t.insert=0,e===As?(qt(t,!0),t.strm.avail_out===0?pa:No):(t.strstart>t.block_start&&(qt(t,!1),t.strm.avail_out===0),Ct)}function yg(t,e){for(var r,i;;){if(t.lookahead=Ce&&(t.ins_h=(t.ins_h<=Ce)if(i=di._tr_tally(t,t.strstart-t.match_start,t.match_length-Ce),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Ce){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=Ce&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=Ce-1)),t.prev_length>=Ce&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-Ce,i=di._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-Ce),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<=Ce&&t.strstart>0&&(n=t.strstart-1,i=a[n],i===a[++n]&&i===a[++n]&&i===a[++n])){s=t.strstart+Es;do;while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Ce?(r=di._tr_tally(t,1,t.match_length-Ce),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=di._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(qt(t,!1),t.strm.avail_out===0))return Ct}return t.insert=0,e===As?(qt(t,!0),t.strm.avail_out===0?pa:No):t.last_lit&&(qt(t,!1),t.strm.avail_out===0)?Ct:Rc}function fH(t,e){for(var r;;){if(t.lookahead===0&&(ma(t),t.lookahead===0)){if(e===ga)return Ct;break}if(t.match_length=0,r=di._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(qt(t,!1),t.strm.avail_out===0))return Ct}return t.insert=0,e===As?(qt(t,!0),t.strm.avail_out===0?pa:No):t.last_lit&&(qt(t,!1),t.strm.avail_out===0)?Ct:Rc}function nn(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var Bo;Bo=[new nn(0,0,0,0,cH),new nn(4,4,8,4,yg),new nn(4,5,16,8,yg),new nn(4,6,32,32,yg),new nn(4,4,16,16,Lo),new nn(8,16,32,32,Lo),new nn(8,16,128,128,Lo),new nn(8,32,128,256,Lo),new nn(32,128,258,1024,Lo),new nn(32,258,258,4096,Lo)];function dH(t){t.window_size=2*t.w_size,Ss(t.head),t.max_lazy_match=Bo[t.level].max_lazy,t.good_match=Bo[t.level].good_length,t.nice_match=Bo[t.level].nice_length,t.max_chain_length=Bo[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Ce-1,t.match_available=0,t.ins_h=0}function hH(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=cd,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new dr.Buf16(nH*2),this.dyn_dtree=new dr.Buf16((2*rH+1)*2),this.bl_tree=new dr.Buf16((2*iH+1)*2),Ss(this.dyn_ltree),Ss(this.dyn_dtree),Ss(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new dr.Buf16(sH+1),this.heap=new dr.Buf16(2*bg+1),Ss(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new dr.Buf16(2*bg+1),Ss(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Z1(t){var e;return!t||!t.state?ks(t,hi):(t.total_in=t.total_out=0,t.data_type=ZN,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?ud:ha,t.adler=e.wrap===2?0:1,e.last_flush=ga,di._tr_init(e),sn)}function K1(t){var e=Z1(t);return e===sn&&dH(t.state),e}function pH(t,e){return!t||!t.state||t.state.wrap!==2?hi:(t.state.gzhead=e,sn)}function Q1(t,e,r,i,n,s){if(!t)return hi;var a=1;if(e===zN&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>KN||r!==cd||i<8||i>15||e<0||e>9||s<0||s>YN)return ks(t,hi);i===8&&(i=9);var o=new hH;return t.state=o,o.strm=t,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<z1||e<0)return t?ks(t,hi):hi;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===Pc&&e!==As)return ks(t,t.avail_out===0?wg:hi);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===ud)if(i.wrap===2)t.adler=0,Ie(i,31),Ie(i,139),Ie(i,8),i.gzhead?(Ie(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Ie(i,i.gzhead.time&255),Ie(i,i.gzhead.time>>8&255),Ie(i,i.gzhead.time>>16&255),Ie(i,i.gzhead.time>>24&255),Ie(i,i.level===9?2:i.strategy>=sd||i.level<2?4:0),Ie(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Ie(i,i.gzhead.extra.length&255),Ie(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=_s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=_g):(Ie(i,0),Ie(i,0),Ie(i,0),Ie(i,0),Ie(i,0),Ie(i,i.level===9?2:i.strategy>=sd||i.level<2?4:0),Ie(i,oH),i.status=ha);else{var a=cd+(i.w_bits-8<<4)<<8,o=-1;i.strategy>=sd||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,a|=o<<6,i.strstart!==0&&(a|=aH),a+=31-a%31,i.status=ha,Cc(i,a),i.strstart!==0&&(Cc(i,t.adler>>>16),Cc(i,t.adler&65535)),t.adler=1}if(i.status===_g)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),xs(t),n=i.pending,i.pending===i.pending_buf_size));)Ie(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=ad)}else i.status=ad;if(i.status===ad)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),xs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.gzindex=0,i.status=od)}else i.status=od;if(i.status===od)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),xs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=_s(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.status=ld)}else i.status=ld;if(i.status===ld&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&xs(t),i.pending+2<=i.pending_buf_size&&(Ie(i,t.adler&255),Ie(i,t.adler>>8&255),t.adler=0,i.status=ha)):i.status=ha),i.pending!==0){if(xs(t),t.avail_out===0)return i.last_flush=-1,sn}else if(t.avail_in===0&&W1(e)<=W1(r)&&e!==As)return ks(t,wg);if(i.status===Pc&&t.avail_in!==0)return ks(t,wg);if(t.avail_in!==0||i.lookahead!==0||e!==ga&&i.status!==Pc){var l=i.strategy===sd?fH(i,e):i.strategy===WN?uH(i,e):Bo[i.level].func(i,e);if((l===pa||l===No)&&(i.status=Pc),l===Ct||l===pa)return t.avail_out===0&&(i.last_flush=-1),sn;if(l===Rc&&(e===GN?di._tr_align(i):e!==z1&&(di._tr_stored_block(i,0,0,!1),e===jN&&(Ss(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),xs(t),t.avail_out===0))return i.last_flush=-1,sn}return e!==As?sn:i.wrap<=0?V1:(i.wrap===2?(Ie(i,t.adler&255),Ie(i,t.adler>>8&255),Ie(i,t.adler>>16&255),Ie(i,t.adler>>24&255),Ie(i,t.total_in&255),Ie(i,t.total_in>>8&255),Ie(i,t.total_in>>16&255),Ie(i,t.total_in>>24&255)):(Cc(i,t.adler>>>16),Cc(i,t.adler&65535)),xs(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?sn:V1)}function vH(t){var e;return!t||!t.state?hi:(e=t.state.status,e!==ud&&e!==_g&&e!==ad&&e!==od&&e!==ld&&e!==ha&&e!==Pc?ks(t,hi):(t.state=null,e===ha?ks(t,qN):sn))}function wH(t,e){var r=e.length,i,n,s,a,o,l,c,u;if(!t||!t.state||(i=t.state,a=i.wrap,a===2||a===1&&i.status!==ud||i.lookahead))return hi;for(a===1&&(t.adler=Y1(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(a===0&&(Ss(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new dr.Buf8(i.w_size),dr.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),o=t.avail_in,l=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,ma(i);i.lookahead>=Ce;){n=i.strstart,s=i.lookahead-(Ce-1);do i.ins_h=(i.ins_h<{"use strict";p();var fd=Bn(),eS=!0,tS=!0;try{String.fromCharCode.apply(null,[0])}catch(t){eS=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){tS=!1}var $c=new fd.Buf8(256);for(Hn=0;Hn<256;Hn++)$c[Hn]=Hn>=252?6:Hn>=248?5:Hn>=240?4:Hn>=224?3:Hn>=192?2:1;var Hn;$c[254]=$c[254]=1;Ho.string2buf=function(t){var e,r,i,n,s,a=t.length,o=0;for(n=0;n>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function rS(t,e){if(e<65534&&(t.subarray&&tS||!t.subarray&&eS))return String.fromCharCode.apply(null,fd.shrinkBuf(t,e));for(var r="",i=0;i4){o[i++]=65533,r+=s-1;continue}for(n&=s===2?31:s===3?15:7;s>1&&r1){o[i++]=65533;continue}n<65536?o[i++]=n:(n-=65536,o[i++]=55296|n>>10&1023,o[i++]=56320|n&1023)}return rS(o,i)};Ho.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+$c[t[r]]>e?r:e}});var Sg=F((CX,iS)=>{"use strict";p();function yH(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}iS.exports=yH});var oS=F(Oc=>{"use strict";p();var Fc=J1(),Ic=Bn(),kg=xg(),Ag=nd(),bH=Sg(),aS=Object.prototype.toString,_H=0,Eg=4,Uo=0,nS=1,sS=2,xH=-1,SH=0,EH=8;function va(t){if(!(this instanceof va))return new va(t);this.options=Ic.assign({level:xH,method:EH,chunkSize:16384,windowBits:15,memLevel:8,strategy:SH,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new bH,this.strm.avail_out=0;var r=Fc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Uo)throw new Error(Ag[r]);if(e.header&&Fc.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=kg.string2buf(e.dictionary):aS.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=Fc.deflateSetDictionary(this.strm,i),r!==Uo)throw new Error(Ag[r]);this._dict_set=!0}}va.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Eg:_H,typeof t=="string"?r.input=kg.string2buf(t):aS.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Ic.Buf8(i),r.next_out=0,r.avail_out=i),n=Fc.deflate(r,s),n!==nS&&n!==Uo)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Eg||s===sS))&&(this.options.to==="string"?this.onData(kg.buf2binstring(Ic.shrinkBuf(r.output,r.next_out))):this.onData(Ic.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==nS);return s===Eg?(n=Fc.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Uo):(s===sS&&(this.onEnd(Uo),r.avail_out=0),!0)};va.prototype.onData=function(t){this.chunks.push(t)};va.prototype.onEnd=function(t){t===Uo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ic.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Tg(t,e){var r=new va(e);if(r.push(t,!0),r.err)throw r.msg||Ag[r.err];return r.result}function kH(t,e){return e=e||{},e.raw=!0,Tg(t,e)}function AH(t,e){return e=e||{},e.gzip=!0,Tg(t,e)}Oc.Deflate=va;Oc.deflate=Tg;Oc.deflateRaw=kH;Oc.gzip=AH});var cS=F((FX,lS)=>{"use strict";p();var dd=30,TH=12;lS.exports=function(e,r){var i,n,s,a,o,l,c,u,f,d,h,m,g,v,w,b,k,x,E,A,y,S,_,T,P;i=e.state,n=e.next_in,T=e.input,s=n+(e.avail_in-5),a=e.next_out,P=e.output,o=a-(r-e.avail_out),l=a+(e.avail_out-257),c=i.dmax,u=i.wsize,f=i.whave,d=i.wnext,h=i.window,m=i.hold,g=i.bits,v=i.lencode,w=i.distcode,b=(1<>>24,m>>>=E,g-=E,E=x>>>16&255,E===0)P[a++]=x&65535;else if(E&16){A=x&65535,E&=15,E&&(g>>=E,g-=E),g<15&&(m+=T[n++]<>>24,m>>>=E,g-=E,E=x>>>16&255,E&16){if(y=x&65535,E&=15,gc){e.msg="invalid distance too far back",i.mode=dd;break e}if(m>>>=E,g-=E,E=a-o,y>E){if(E=y-E,E>f&&i.sane){e.msg="invalid distance too far back",i.mode=dd;break e}if(S=0,_=h,d===0){if(S+=u-E,E2;)P[a++]=_[S++],P[a++]=_[S++],P[a++]=_[S++],A-=3;A&&(P[a++]=_[S++],A>1&&(P[a++]=_[S++]))}else{S=a-y;do P[a++]=P[S++],P[a++]=P[S++],P[a++]=P[S++],A-=3;while(A>2);A&&(P[a++]=P[S++],A>1&&(P[a++]=P[S++]))}}else if(E&64){e.msg="invalid distance code",i.mode=dd;break e}else{x=w[(x&65535)+(m&(1<>3,n-=A,g-=A<<3,m&=(1<{"use strict";p();var uS=Bn(),Go=15,fS=852,dS=592,hS=0,Cg=1,pS=2,CH=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],PH=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],RH=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],$H=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];mS.exports=function(e,r,i,n,s,a,o,l){var c=l.bits,u=0,f=0,d=0,h=0,m=0,g=0,v=0,w=0,b=0,k=0,x,E,A,y,S,_=null,T=0,P,D=new uS.Buf16(Go+1),B=new uS.Buf16(Go+1),N=null,ce=0,Pe,ve,se;for(u=0;u<=Go;u++)D[u]=0;for(f=0;f=1&&D[h]===0;h--);if(m>h&&(m=h),h===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d0&&(e===hS||h!==1))return-1;for(B[1]=0,u=1;ufS||e===pS&&b>dS)return 1;for(;;){Pe=u-v,o[f]P?(ve=N[ce+o[f]],se=_[T+o[f]]):(ve=96,se=0),x=1<>v)+E]=Pe<<24|ve<<16|se|0;while(E!==0);for(x=1<>=1;if(x!==0?(k&=x-1,k+=x):k=0,f++,--D[u]===0){if(u===h)break;u=r[i+o[f]]}if(u>m&&(k&y)!==A){for(v===0&&(v=m),S+=d,g=u-v,w=1<fS||e===pS&&b>dS)return 1;A=k&y,s[A]=m<<24|g<<16|S-a|0}}return k!==0&&(s[S+k]=u-v<<24|64<<16|0),l.bits=m,0}});var KS=F(Ri=>{"use strict";p();var Xr=Bn(),Og=gg(),on=vg(),FH=cS(),Mc=gS(),IH=0,GS=1,jS=2,vS=4,OH=5,hd=6,wa=0,MH=1,DH=2,pi=-2,qS=-3,Mg=-4,LH=-5,wS=8,zS=1,yS=2,bS=3,_S=4,xS=5,SS=6,ES=7,kS=8,AS=9,TS=10,gd=11,Un=12,Pg=13,CS=14,Rg=15,PS=16,RS=17,$S=18,FS=19,pd=20,md=21,IS=22,OS=23,MS=24,DS=25,LS=26,$g=27,BS=28,NS=29,tt=30,Dg=31,BH=32,NH=852,HH=592,UH=15,GH=UH;function HS(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function jH(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Xr.Buf16(320),this.work=new Xr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function VS(t){var e;return!t||!t.state?pi:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=zS,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Xr.Buf32(NH),e.distcode=e.distdyn=new Xr.Buf32(HH),e.sane=1,e.back=-1,wa)}function WS(t){var e;return!t||!t.state?pi:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,VS(t))}function YS(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?pi:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,WS(t))}function XS(t,e){var r,i;return t?(i=new jH,t.state=i,i.window=null,r=YS(t,e),r!==wa&&(t.state=null),r):pi}function qH(t){return XS(t,GH)}var US=!0,Fg,Ig;function zH(t){if(US){var e;for(Fg=new Xr.Buf32(512),Ig=new Xr.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Mc(GS,t.lens,0,288,Fg,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Mc(jS,t.lens,0,32,Ig,0,t.work,{bits:5}),US=!1}t.lencode=Fg,t.lenbits=9,t.distcode=Ig,t.distbits=5}function ZS(t,e,r,i){var n,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(Xr.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),Xr.arraySet(s.window,e,r-i,n,s.wnext),i-=n,i?(Xr.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=on(r.check,_,2,0),c=0,u=0,r.mode=yS;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=tt;break}if((c&15)!==wS){t.msg="unknown compression method",r.mode=tt;break}if(c>>>=4,u-=4,y=(c&15)+8,r.wbits===0)r.wbits=y;else if(y>r.wbits){t.msg="invalid window size",r.mode=tt;break}r.dmax=1<>8&1),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=on(r.check,_,2,0)),c=0,u=0,r.mode=bS;case bS:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,r.check=on(r.check,_,4,0)),c=0,u=0,r.mode=_S;case _S:for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>8),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=on(r.check,_,2,0)),c=0,u=0,r.mode=xS;case xS:if(r.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>>8&255,r.check=on(r.check,_,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=SS;case SS:if(r.flags&1024&&(h=r.length,h>o&&(h=o),h&&(r.head&&(y=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Xr.arraySet(r.head.extra,i,s,h,y)),r.flags&512&&(r.check=on(r.check,i,h,s)),o-=h,s+=h,r.length-=h),r.length))break e;r.length=0,r.mode=ES;case ES:if(r.flags&2048){if(o===0)break e;h=0;do y=i[s+h++],r.head&&y&&r.length<65536&&(r.head.name+=String.fromCharCode(y));while(y&&h>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=Un;break;case TS:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>=u&7,u-=u&7,r.mode=$g;break}for(;u<3;){if(o===0)break e;o--,c+=i[s++]<>>=1,u-=1,c&3){case 0:r.mode=CS;break;case 1:if(zH(r),r.mode=pd,e===hd){c>>>=2,u-=2;break e}break;case 2:r.mode=RS;break;case 3:t.msg="invalid block type",r.mode=tt}c>>>=2,u-=2;break;case CS:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=tt;break}if(r.length=c&65535,c=0,u=0,r.mode=Rg,e===hd)break e;case Rg:r.mode=PS;case PS:if(h=r.length,h){if(h>o&&(h=o),h>l&&(h=l),h===0)break e;Xr.arraySet(n,i,s,h,a),o-=h,s+=h,l-=h,a+=h,r.length-=h;break}r.mode=Un;break;case RS:for(;u<14;){if(o===0)break e;o--,c+=i[s++]<>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=tt;break}r.have=0,r.mode=$S;case $S:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},S=Mc(IH,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,S){t.msg="invalid code lengths set",r.mode=tt;break}r.have=0,r.mode=FS;case FS:for(;r.have>>24,b=v>>>16&255,k=v&65535,!(w<=u);){if(o===0)break e;o--,c+=i[s++]<>>=w,u-=w,r.lens[r.have++]=k;else{if(k===16){for(P=w+2;u>>=w,u-=w,r.have===0){t.msg="invalid bit length repeat",r.mode=tt;break}y=r.lens[r.have-1],h=3+(c&3),c>>>=2,u-=2}else if(k===17){for(P=w+3;u>>=w,u-=w,y=0,h=3+(c&7),c>>>=3,u-=3}else{for(P=w+7;u>>=w,u-=w,y=0,h=11+(c&127),c>>>=7,u-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=tt;break}for(;h--;)r.lens[r.have++]=y}}if(r.mode===tt)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=tt;break}if(r.lenbits=9,T={bits:r.lenbits},S=Mc(GS,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,S){t.msg="invalid literal/lengths set",r.mode=tt;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},S=Mc(jS,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,S){t.msg="invalid distances set",r.mode=tt;break}if(r.mode=pd,e===hd)break e;case pd:r.mode=md;case md:if(o>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=s,t.avail_in=o,r.hold=c,r.bits=u,FH(t,d),a=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,c=r.hold,u=r.bits,r.mode===Un&&(r.back=-1);break}for(r.back=0;v=r.lencode[c&(1<>>24,b=v>>>16&255,k=v&65535,!(w<=u);){if(o===0)break e;o--,c+=i[s++]<>x)],w=v>>>24,b=v>>>16&255,k=v&65535,!(x+w<=u);){if(o===0)break e;o--,c+=i[s++]<>>=x,u-=x,r.back+=x}if(c>>>=w,u-=w,r.back+=w,r.length=k,b===0){r.mode=LS;break}if(b&32){r.back=-1,r.mode=Un;break}if(b&64){t.msg="invalid literal/length code",r.mode=tt;break}r.extra=b&15,r.mode=IS;case IS:if(r.extra){for(P=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=OS;case OS:for(;v=r.distcode[c&(1<>>24,b=v>>>16&255,k=v&65535,!(w<=u);){if(o===0)break e;o--,c+=i[s++]<>x)],w=v>>>24,b=v>>>16&255,k=v&65535,!(x+w<=u);){if(o===0)break e;o--,c+=i[s++]<>>=x,u-=x,r.back+=x}if(c>>>=w,u-=w,r.back+=w,b&64){t.msg="invalid distance code",r.mode=tt;break}r.offset=k,r.extra=b&15,r.mode=MS;case MS:if(r.extra){for(P=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=tt;break}r.mode=DS;case DS:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=tt;break}h>r.wnext?(h-=r.wnext,m=r.wsize-h):m=r.wnext-h,h>r.length&&(h=r.length),g=r.window}else g=n,m=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do n[a++]=g[m++];while(--h);r.length===0&&(r.mode=md);break;case LS:if(l===0)break e;n[a++]=r.length,l--,r.mode=md;break;case $g:if(r.wrap){for(;u<32;){if(o===0)break e;o--,c|=i[s++]<{"use strict";p();QS.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var eE=F((HX,JS)=>{"use strict";p();function ZH(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}JS.exports=ZH});var rE=F(Lc=>{"use strict";p();var jo=KS(),Dc=Bn(),vd=xg(),pt=Lg(),Bg=nd(),KH=Sg(),QH=eE(),tE=Object.prototype.toString;function ya(t){if(!(this instanceof ya))return new ya(t);this.options=Dc.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new KH,this.strm.avail_out=0;var r=jo.inflateInit2(this.strm,e.windowBits);if(r!==pt.Z_OK)throw new Error(Bg[r]);if(this.header=new QH,jo.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=vd.string2buf(e.dictionary):tE.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=jo.inflateSetDictionary(this.strm,e.dictionary),r!==pt.Z_OK)))throw new Error(Bg[r])}ya.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,s,a,o,l,c,u=!1;if(this.ended)return!1;a=e===~~e?e:e===!0?pt.Z_FINISH:pt.Z_NO_FLUSH,typeof t=="string"?r.input=vd.binstring2buf(t):tE.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Dc.Buf8(i),r.next_out=0,r.avail_out=i),s=jo.inflate(r,pt.Z_NO_FLUSH),s===pt.Z_NEED_DICT&&n&&(s=jo.inflateSetDictionary(this.strm,n)),s===pt.Z_BUF_ERROR&&u===!0&&(s=pt.Z_OK,u=!1),s!==pt.Z_STREAM_END&&s!==pt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===pt.Z_STREAM_END||r.avail_in===0&&(a===pt.Z_FINISH||a===pt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=vd.utf8border(r.output,r.next_out),l=r.next_out-o,c=vd.buf2string(r.output,o),r.next_out=l,r.avail_out=i-l,l&&Dc.arraySet(r.output,r.output,o,l,0),this.onData(c)):this.onData(Dc.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==pt.Z_STREAM_END);return s===pt.Z_STREAM_END&&(a=pt.Z_FINISH),a===pt.Z_FINISH?(s=jo.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===pt.Z_OK):(a===pt.Z_SYNC_FLUSH&&(this.onEnd(pt.Z_OK),r.avail_out=0),!0)};ya.prototype.onData=function(t){this.chunks.push(t)};ya.prototype.onEnd=function(t){t===pt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Dc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Ng(t,e){var r=new ya(e);if(r.push(t,!0),r.err)throw r.msg||Bg[r.err];return r.result}function JH(t,e){return e=e||{},e.raw=!0,Ng(t,e)}Lc.Inflate=ya;Lc.inflate=Ng;Lc.inflateRaw=JH;Lc.ungzip=Ng});var sE=F((qX,nE)=>{"use strict";p();var e3=Bn().assign,t3=oS(),r3=rE(),i3=Lg(),iE={};e3(iE,t3,r3,i3);nE.exports=iE});var lE=F((VX,oE)=>{"use strict";p();var aE=(t,e)=>function(...r){let i=e.promiseModule;return new i((n,s)=>{e.multiArgs?r.push((...a)=>{e.errorFirst?a[0]?s(a):(a.shift(),n(a)):n(a)}):e.errorFirst?r.push((a,o)=>{a?s(a):n(o)}):r.push(n),t.apply(this,r)})};oE.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=s=>{let a=o=>typeof o=="string"?s===o:o.test(s);return e.include?e.include.some(a):!e.exclude.some(a)},n;r==="function"?n=function(...s){return e.excludeMain?t(...s):aE(t,e).apply(this,s)}:n=Object.create(Object.getPrototypeOf(t));for(let s in t){let a=t[s];n[s]=typeof a=="function"&&i(s)?aE(a,e):a}return n}});var vE=F((YX,gE)=>{p();function cE(t){return Array.isArray(t)?t:[t]}var Gg="",uE=" ",Hg="\\",n3=/^\s+$/,s3=/(?:[^\\]|^)\\$/,a3=/^\\!/,o3=/^\\#/,l3=/\r?\n/g,c3=/^\.*\/|^\.+$/,Ug="/",hE="node-ignore";typeof Symbol!="undefined"&&(hE=Symbol.for("node-ignore"));var fE=hE,u3=(t,e,r)=>Object.defineProperty(t,e,{value:r}),f3=/([0-z])-([0-z])/g,pE=()=>!1,d3=t=>t.replace(f3,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Gg),h3=t=>{let{length:e}=t;return t.slice(0,e-e%2)},p3=[[/^\uFEFF/,()=>Gg],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?uE:Gg)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+uE}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Hg],[/\\\\/g,()=>Hg],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Hg?`\\[${r}${h3(i)}${n}`:n==="]"&&i.length%2===0?`[${d3(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],dE=Object.create(null),m3=(t,e)=>{let r=dE[t];return r||(r=p3.reduce((i,[n,s])=>i.replace(n,s.bind(t)),t),dE[t]=r),e?new RegExp(r,"i"):new RegExp(r)},zg=t=>typeof t=="string",g3=t=>t&&zg(t)&&!n3.test(t)&&!s3.test(t)&&t.indexOf("#")!==0,v3=t=>t.split(l3),jg=class{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}},w3=(t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(a3,"!").replace(o3,"#");let n=m3(t,e);return new jg(r,t,i,n)},y3=(t,e)=>{throw new e(t)},Gn=(t,e,r)=>zg(t)?t?Gn.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),mE=t=>c3.test(t);Gn.isNotRelative=mE;Gn.convert=t=>t;var qg=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){u3(this,fE,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[fE]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(g3(e)){let r=w3(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,cE(zg(e)?v3(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(s=>{let{negative:a}=s;if(n===a&&i!==n||a&&!i&&!n&&!r)return;s.regex.test(e)&&(i=!a,n=a)}),{ignored:i,unignored:n}}_test(e,r,i,n){let s=e&&Gn.convert(e);return Gn(s,e,this._allowRelativePaths?pE:y3),this._t(s,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Ug)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let s=this._t(n.join(Ug)+Ug,r,i,n);return r[e]=s.ignored?s:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return cE(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},wd=t=>new qg(t),b3=t=>Gn(t&&Gn.convert(t),t,pE);wd.isPathValid=b3;wd.default=wd;gE.exports=wd;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Gn.convert=t;let e=/^[a-z]:\//i;Gn.isNotRelative=r=>e.test(r)||mE(r)}});var yE=F((ZX,wE)=>{"use strict";p();function _3(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ln(t,e,r){return e=e instanceof RegExp?e:new RegExp(_3(e),"g"),t.replace(e,r)}var x3={clean:function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=ln(e,"./","/"),e=ln(e,"..","."),e=ln(e," ","-"),e=ln(e,/^[~^:?*\\\-]/g,""),e=ln(e,/[~^:?*\\]/g,"-"),e=ln(e,/[~^:?*\\\-]$/g,""),e=ln(e,"@{","-"),e=ln(e,/\.$/g,""),e=ln(e,/\/$/g,""),e=ln(e,/\.lock$/g,""),e}};wE.exports=x3});var _E=F((QX,bE)=>{p();bE.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=null,l=n+1,c=[],u=[],f=[],d="",h=-1,m=0,g=1,v,w,b=function(){n>=s&&(v=r,w=n,r=i,i=v,n=s,s=w,a=!0,l=n+1)},k=function(y,S,_){return{x:y,y:S,k:_}},x=function(y,S){return{elem:y,t:S}},E=function(y,S,_){var T,P,D;for(S>_?T=c[y-1+l]:T=c[y+1+l],D=Math.max(S,_),P=D-y;P=0;--D)for(;TP-T?(a?f[f.length]=new x(i[P],h):f[f.length]=new x(i[P],g),++_,++P):y[D].y-y[D].x=y+1;--N)_[N+l]=E(N,_[N-1+l]+1,_[N+1+l]);_[y+l]=E(y,_[y-1+l]+1,_[y+1+l])}while(_[y+l]!==s);for(o=y+2*T,P=c[y+l],D=[];P!==-1;)D[D.length]=new k(u[P].x,u[P].y,null),P=u[P].k;A(D)}}}});var EE=F((eZ,SE)=>{p();var S3=_E();function E3(t,e){var r=new S3(t,e);r.compose();for(var i=r.getses(),n,s,a=t.length-1,o=e.length-1,l=i.length-1;l>=0;--l)i[l].t===r.SES_COMMON?(s?(s.chain={file1index:a,file2index:o,chain:null},s=s.chain):(n={file1index:a,file2index:o,chain:null},s=n),a--,o--):i[l].t===r.SES_DELETE?a--:i[l].t===r.SES_ADD&&o--;var c={file1index:-1,file2index:-1,chain:null};return s?(s.chain=c,n):c}function xE(t,e){for(var r=[],i=t.length,n=e.length,s=E3(t,e);s!==null;s=s.chain){var a=i-s.file1index-1,o=n-s.file2index-1;i=s.file1index,n=s.file2index,(a||o)&&r.push({file1:[i+1,a],file2:[n+1,o]})}return r.reverse(),r}function k3(t,e,r){var i,n=xE(e,t),s=xE(e,r),a=[];function o(B,N){a.push([B.file1[0],N,B.file1[1],B.file2[0],B.file2[1]])}for(i=0;ic&&(l.push([1,c,B-c]),c=B)}for(var f=0;fg)break;g=Math.max(g,w+v[2]),f++}if(u(m),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var k=h[1],x=b[k],E=h[0],A=E+h[2],y=h[3],S=y+h[4];x[0]=Math.min(y,x[0]),x[1]=Math.max(S,x[1]),x[2]=Math.min(E,x[2]),x[3]=Math.max(A,x[3])}var _=b[0][0]+(m-b[0][2]),T=b[0][1]+(g-b[0][3]),P=b[2][0]+(m-b[2][2]),D=b[2][1]+(g-b[2][3]);l.push([-1,_,T-_,m,g-m,P,D-P])}c=g}return u(e.length),l}function A3(t,e,r){var i=[],n=[t,e,r],s=k3(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var m=0;m{"use strict";p();Object.defineProperty(X,"__esModule",{value:!0});function Ms(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Nc=Ms(f_()),WE=Ms(g1()),T3=Ms(w1()),gv=Ms(sE()),yd=Ms(lE()),C3=Ms(vE()),Hc=Ms(yE()),P3=Ms(EE()),Re=class t extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new t(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}},Uc=class t extends Re{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=t.code,this.data={filepaths:e}}};Uc.code="UnmergedPathsError";var he=class t extends Re{constructor(e){super(`An internal error caused this command to fail. + +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 mi=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 i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}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 Fd(t,e){return-(te)}function YE(t,e){return Fd(t.path,e.path)}function XE(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 cn=2**32;function kE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),s=(r-n*1e3)*1e6;return[n,s]}function Vo(t){let[e,r]=kE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=kE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%cn,ctimeNanoseconds:r%cn,mtimeSeconds:i%cn,mtimeNanoseconds:n%cn,dev:t.dev%cn,ino:t.ino%cn,mode:XE(t.mode%cn),uid:t.uid%cn,gid:t.gid%cn,size:t.size>-1?t.size%cn:0}}function R3(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}var Vg=null;async function qn(t){return Vg===null&&(Vg=await F3()),Vg?ZE(t):$3(t)}function $3(t){return new WE().update(t).digest("hex")}async function ZE(t){let e=await crypto.subtle.digest("SHA-1",t);return R3(e)}async function F3(){try{return await ZE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(t){}return!1}function I3(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function O3(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 nv=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,i=new mi(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new he(`Invalid dircache magic file number: ${n}`);let s=await qn(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=i.readUInt32BE();if(o!==2)throw new he(`Unsupported dircache version: ${o}`);let l=i.readUInt32BE(),c=0;for(;!i.eof()&&ce.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:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=Vo(r);let s=Buffer.from(e),a={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:s.length<4095?s.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(` +`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=Buffer.alloc(i),s=new mi(n),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(O3(e)),s.write(e.path,r.length,"utf8"),n}async toObject(){let e=Buffer.alloc(12),r=new mi(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let o of this.entries)if(i.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&i.push(t._entryToBuffer(l));i=await Promise.all(i);let n=Buffer.concat(i),s=Buffer.concat([e,n]),a=await qn(s);return Buffer.concat([s,Buffer.from(a,"hex")])}};function xd(t,e,r=!0,i=!0){let n=Vo(t),s=Vo(e);return r&&n.mode!==s.mode||n.mtimeSeconds!==s.mtimeSeconds||n.ctimeSeconds!==s.ctimeSeconds||n.uid!==s.uid||n.gid!==s.gid||i&&n.ino!==s.ino||n.size!==s.size}var Wg=null,Yg=Symbol("IndexCache");function M3(){return{map:new Map,stats:new Map}}async function D3(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),s=await nv.from(n);r.map.set(e,s),r.stats.set(e,i)}async function L3(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:xd(i,n)}var mt=class{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},s){i[Yg]||(i[Yg]=M3());let a=`${r}/index`;Wg===null&&(Wg=new Nc({maxPending:1/0}));let o,l=[];return await Wg.acquire(a,async()=>{let c=i[Yg];await L3(e,a,c)&&await D3(e,a,c);let u=c.map.get(a);if(l=u.unmergedPaths,l.length&&!n)throw new Uc(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 Sd(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function xa(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function KE(t){let e=new Map,r=function(n){if(!e.has(n)){let s={type:"tree",fullpath:n,basename:Sd(n),metadata:{},children:[]};e.set(n,s),s.parent=r(xa(n)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(n)},i=function(n,s){if(!e.has(n)){let a={type:"blob",fullpath:n,basename:Sd(n),metadata:s,parent:r(xa(n)),children:[]};a.parent&&a.parent.children.push(a),e.set(n,a)}return e.get(n)};r(".");for(let n of t)i(n.path,n);return e}function B3(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 sv=class{constructor({fs:e,gitdir:r,cache:i}){this.treePromise=mt.acquire({fs:e,gitdir:r,cache:i},async function(s){return KE(s.entries)});let n=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let s=n.children.map(a=>a.fullpath);return s.sort(Fd),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 i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:Vo(i.metadata);e._type=i.type==="tree"?"tree":B3(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}},Id=Symbol("GitWalkSymbol");function Aa(){let t=Object.create(null);return Object.defineProperty(t,Id,{value:function({fs:e,gitdir:r,cache:i}){return new sv({fs:e,gitdir:r,cache:i})}}),Object.freeze(t),t}var He=class t extends Re{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};He.code="NotFoundError";var hr=class t extends Re{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};hr.code="ObjectTypeError";var Ps=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}}};Ps.code="InvalidOidError";var Gc=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}}};Gc.code="NoRefspecError";var Ed=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(` +`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let s=i.slice(1);return this.refs.set(r+"^{}",s),{line:i,ref:r,peeled:s}}else{let s=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,s),{line:i,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(` +`)+` +`}},kd=class t{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,s,a]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=n==="*";if(l!==(a==="*"))throw new he("Invalid refspec");return new t({remotePath:i,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}},av=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(kd.from(i));return new t(r)}add(e){let r=kd.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let s=i.translate(n);s&&r.push([n,s])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function N3(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(ri);return n===0?t.endsWith("^{}")?1:-1:n}function H3(t,e){let r="",i=0,n=-1,s=0,a="\0";for(let o=0;o<=t.length;++o){if(o2){let l=r.lastIndexOf("/");l===-1?(r="",i=0):(r=r.slice(0,l),i=r.length-1-r.lastIndexOf("/")),n=o,s=0;continue}else if(r.length!==0){r="",i=0,n=o,s=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,o):r=t.slice(n+1,o),i=o-n-1;n=o,s=0}else a==="."&&s!==-1?++s:s=-1}return r}function U3(t){if(!t.length)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=H3(t,!e),t.length?(r&&(t+="/"),e?`/${t}`:t):e?"/":r?"./":"."}function O(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":U3(e)}var G3=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},Bc=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}`)},AE={core:{filemode:Bc,bare:Bc,logallrefupdates:Bc,symlinks:Bc,ignorecase:Bc,bigFileThreshold:G3}},j3=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,q3=/^[A-Za-z0-9-.]+$/,z3=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,V3=/^[A-Za-z][A-Za-z-]*$/,W3=/^(.*?)( *[#;].*)$/,Y3=t=>{let e=j3.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},X3=t=>{let e=z3.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=Z3(i),s=K3(n);return[r,s]}return null},Z3=t=>{let e=W3.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return TE(r)&&TE(i)?`${r}${i}`:r},TE=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,K3=t=>t.split("").reduce((e,r,i,n)=>{let s=r==='"'&&n[i-1]!=="\\",a=r==="\\"&&n[i+1]==='"';return s||a?e:e+r},""),CE=t=>t!=null?t.toLowerCase():null,ov=(t,e,r)=>[CE(t),e,CE(r)].filter(i=>i!=null).join("."),PE=t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:ov(r,n,i),sectionPath:ov(r,n,null),isSection:!!r}},Q3=(t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),lv=class t{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(` +`).map(n=>{let s=null,a=null,o=n.trim(),l=Y3(o),c=l!=null;if(c)[r,i]=l;else{let f=X3(o);f!=null&&([s,a]=f)}let u=ov(r,i,s);return{line:n,isSection:c,section:r,subsection:i,name:s,value:a,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let i=PE(e).path,n=this.parsedConfig.filter(s=>s.path===i).map(({section:s,name:a,value:o})=>{let l=AE[s]&&AE[s][a];return l?l(o):o});return r?n:n.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(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:s,name:a,path:o,sectionPath:l,isSection:c}=PE(e),u=Q3(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});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:n,subsection:s,name:a,value:r,modified:!0,path:o};if(q3.test(n)&&V3.test(a))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:n,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:s,modified:a=!1})=>a?n!=null&&s!=null?typeof s=="string"&&/[#;]/.test(s)?` ${n} = "${s}"`:` ${n} = ${s}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(` +`)}},ct=class{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return lv.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}},bd=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],J3=["config","description","index","shallow","commondir"],Xg;async function Ts(t,e){return Xg===void 0&&(Xg=new Nc),Xg.acquire(t,e)}var W=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:s,tags:a,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let v of n.values())if(!v.match(/[0-9a-f]{40}/))throw new Ps(v);let u=await ct.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${i}.fetch`),o.length===0)throw new Gc(i);o.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let f=av.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 n.keys())if(v.startsWith("refs/tags")&&!v.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:v})){let w=n.get(v);d.set(v,w)}}let h=f.translate([...n.keys()]);for(let[v,w]of h){let b=n.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(O(r,v),`${w.trim()} +`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new Ps(n);await Ts(i,async()=>e.write(O(r,i),`${n.trim()} +`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await Ts(i,async()=>e.write(O(r,i),`ref: ${n.trim()} +`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return t.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(o=>e.rm(O(r,o))));let n=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),s=Ed.from(n),a=s.refs.size;for(let o of i)s.refs.has(o)&&s.delete(o);s.refs.sizee.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),t.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let s=await t.packedRefs({fs:e,gitdir:r}),a=bd(i).filter(o=>!J3.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:n})}throw new He(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await t.expand({fs:e,gitdir:r,ref:i}),!0}catch(n){return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await t.packedRefs({fs:e,gitdir:r}),s=bd(i);for(let a of s)if(await Ts(a,async()=>e.exists(`${r}/${a}`))||n.has(a))return a;throw new He(i)}static async expandAgainstMap({ref:e,map:r}){let i=bd(e);for(let n of i)if(await r.has(n))return n;throw new He(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let s=bd(e);for(let a of s){let o=n.get(a);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:a,depth:i,map:n})}throw new He(e)}static async packedRefs({fs:e,gitdir:r}){let i=await Ts("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return Ed.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=t.packedRefs({fs:e,gitdir:r}),s=null;try{s=await e.readdirDeep(`${r}/${i}`),s=s.map(a=>a.replace(`${r}/${i}/`,""))}catch(a){s=[]}for(let a of(await n).keys())a.startsWith(i)&&(a=a.replace(i+"/",""),s.includes(a)||s.push(a));return s.sort(N3),s}static async listBranches({fs:e,gitdir:r,remote:i}){return i?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):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(n=>!n.endsWith("^{}"))}};function e8(t,e){return Fd(RE(t),RE(e))}function RE(t){return t.mode==="040000"?t.path+"/":t.path}function QE(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 t8(t){let e=[],r=0;for(;r`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(` +`)}toObject(){let e=[...this._entries];return e.sort(e8),Buffer.concat(e.map(r=>{let i=Buffer.from(r.mode.replace(/^0/,"")),n=Buffer.from(" "),s=Buffer.from(r.path,"utf8"),a=Buffer.from([0]),o=Buffer.from(r.oid,"hex");return Buffer.concat([i,n,s,a,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},Rs=class{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,s=n+r.length,a=new Uint8Array(s);for(let o=0;o>=1,n+=8;return i}function IE(t,e){let r=t.readUInt8(),i=128,n=15,s=112;if(r&i){let a=FE(t,r&n,4),o=FE(t,(r&s)>>4,3);return o===0&&(o=65536),e.slice(a,a+o)}else return t.slice(r)}function s8(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function ek(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:s8(t)}var Ad=class{constructor(e){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=ek(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>a8(r);){let i=await this._next();if(this._ended)break;r.push(i)}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 a8(t){return t.reduce((e,r)=>e+r.length,0)}async function o8(t,e){let r=new Ad(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new he(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new he(`Invalid packfile version: ${n}`);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 l8(r),f=new gv.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 l8(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let a=4;do e=await t.byte(),i|=(e&127)<n+1<<7|s,-1)}function d8(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<2048*1024*1024)throw new he("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+4*255);let a=i.readUInt32BE(),o=[];for(let u=0;u{u===null&&(u=x);let E=Math.floor((u-x)*100/u);E!==f&&i&&await i({phase:"Receiving objects",loaded:u-x,total:u}),f=E,w=n[w],["commit","tree","blob","tag"].includes(w)?s[k]={type:w,offset:k}:w==="ofs-delta"?s[k]={type:w,offset:k}:w==="ref-delta"&&(s[k]={type:w,offset:k})});let d=Object.keys(s).map(Number);for(let[v,w]of d.entries()){let b=v+1===d.length?e.byteLength-20:d[v+1],k=s[w],x=T3.buf(e.slice(w,b))>>>0;k.end=b,k.crc=x}let h=new t({pack:Promise.resolve(e),packfileSha:a,crcs:l,hashes:o,offsets:c,getExternalRefDelta:r});f=null;let m=0,g=[0,0,0,0,0,0,0,0,0,0,0,0];for(let v in s){v=Number(v);let w=Math.floor(m*100/u);w!==f&&i&&await i({phase:"Resolving deltas",loaded:m,total:u}),m++,f=w;let b=s[v];if(!b.oid)try{h.readDepth=0,h.externalReadDepth=0;let{type:k,object:x}=await h.readSlice({start:v});g[h.readDepth]+=1;let E=await qn(Rs.wrap({type:k,object:x}));b.oid=E,o.push(E),c.set(E,v),l[E]=b.crc}catch(k){continue}}return o.sort(),h}async toBuffer(){let e=[],r=(c,u)=>{e.push(Buffer.from(c,u))};r("ff744f63","hex"),r("00000002","hex");let i=new mi(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let f of this.hashes)parseInt(f.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new mi(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let s=new mi(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)s.writeUInt32BE(this.offsets.get(c));e.push(s.buffer),r(this.packfileSha,"hex");let a=Buffer.concat(e),o=await qn(a),l=Buffer.alloc(20);return l.write(o,"hex"),Buffer.concat([a,l])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new he(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new he("Tried to read from a GitPackIndex with no packfile loaded into memory");let i=(await this.pack).slice(e),n=new mi(i),s=n.readUInt8(),a=s&112,o=r[a];if(o===void 0)throw new he("Unrecognized type: 0b"+a.toString(2));let l=s&15,c=l;s&128&&(c=d8(n,l));let f=null,d=null;if(o==="ofs_delta"){let m=f8(n),g=e-m;({object:f,type:o}=await this.readSlice({start:g}))}if(o==="ref_delta"){let m=n.slice(20).toString("hex");({object:f,type:o}=await this.read({oid:m}))}let h=i.slice(n.tell());if(d=Buffer.from(await tk(h)),d.byteLength!==c)throw new he(`Packfile told us object would have length ${c} but it had length ${d.byteLength}`);return f&&(d=Buffer.from(n8(d,f))),this.readDepth>3&&(this.offsetCache[e]={type:o,object:d}),{type:o,format:"content",object:d}}},_d=Symbol("PackfileCache");async function h8({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let s=await t.read(e);return jc.fromIdx({idx:s,getExternalRefDelta:r})}function vv({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}){e[_d]||(e[_d]=new Map);let a=e[_d].get(r);return a||(a=h8({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}),e[_d].set(r,a)),a}async function p8({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:s}){let a=await t.readdir(O(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await vv({fs:t,cache:e,filename:l,getExternalRefDelta:s});if(c.error)throw new he(c.error);if(c.offsets.has(i)){if(!c.pack){let f=l.replace(/idx$/,"pack");c.pack=t.read(f)}let u=await c.read({oid:i,getExternalRefDelta:s});return u.format="content",u.source=`objects/pack/${o.replace(/idx$/,"pack")}`,u}}return null}async function Ke({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=u=>Ke({fs:t,cache:e,gitdir:r,oid:u}),a;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(a={format:"wrapped",object:Buffer.from("tree 0\0")}),a||(a=await JE({fs:t,gitdir:r,oid:i})),!a){if(a=await p8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s}),!a)throw new He(i);return a}if(n==="deflated"||(a.format==="deflated"&&(a.object=Buffer.from(await tk(a.object)),a.format="wrapped"),n==="wrapped"))return a;let o=await qn(a.object);if(o!==i)throw new he(`SHA check failed! Expected ${i}, computed ${o}`);let{object:l,type:c}=Rs.unwrap(a.object);if(a.type=c,a.object=l,a.format="content",n==="content")return a;throw new he(`invalid requested format "${n}"`)}var $i=class t extends Re{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=t.code,this.data={noun:e,where:r,canForce:i}}};$i.code="AlreadyExistsError";var qc=class t extends Re{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=t.code,this.data={nouns:e,short:r,matches:i}}};qc.code="AmbiguousError";var zc=class t extends Re{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=t.code,this.data={filepaths:e}}};zc.code="CheckoutConflictError";var Vc=class t extends Re{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=t.code,this.data={ref:e,oid:r}}};Vc.code="CommitNotFetchedError";var Wc=class t extends Re{constructor(){super("Empty response from git server."),this.code=this.name=t.code,this.data={}}};Wc.code="EmptyServerResponseError";var Yc=class t extends Re{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=t.code,this.data={}}};Yc.code="FastForwardError";var Xc=class t extends Re{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=t.code,this.data={prettyDetails:e,result:r}}};Xc.code="GitPushError";var Wo=class t extends Re{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=t.code,this.data={statusCode:e,statusMessage:r,response:i}}};Wo.code="HttpError";var $s=class t extends Re{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=t.code,this.data={reason:e}}};$s.code="InvalidFilepathError";var Fi=class t extends Re{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=t.code,this.data={ref:e,suggestion:r}}};Fi.code="InvalidRefNameError";var Zc=class t extends Re{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=t.code,this.data={depth:e}}};Zc.code="MaxDepthError";var Yo=class t extends Re{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=t.code,this.data={}}};Yo.code="MergeNotSupportedError";var Xo=class t extends Re{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=t.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};Xo.code="MergeConflictError";var Jt=class t extends Re{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=t.code,this.data={role:e}}};Jt.code="MissingNameError";var Sr=class t extends Re{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=t.code,this.data={parameter:e}}};Sr.code="MissingParameterError";var Kc=class t extends Re{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=t.code,this.data={errors:e},this.errors=e}};Kc.code="MultipleGitError";var Sa=class t extends Re{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=t.code,this.data={expected:e,actual:r}}};Sa.code="ParseError";var Zo=class t extends Re{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=t.code,this.data={reason:e}}};Zo.code="PushRejectedError";var Cs=class t extends Re{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=t.code,this.data={capability:e,parameter:r}}};Cs.code="RemoteCapabilityError";var Qc=class t extends Re{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=t.code,this.data={preview:e,response:r}}};Qc.code="SmartHttpError";var Jc=class t extends Re{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=t.code,this.data={url:e,transport:r,suggestion:i}}};Jc.code="UnknownTransportError";var eu=class t extends Re{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=t.code,this.data={url:e}}};eu.code="UrlParseError";var Ko=class t extends Re{constructor(){super("The operation was canceled."),this.code=this.name=t.code,this.data={}}};Ko.code="UserCanceledError";var tu=class t extends Re{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=t.code,this.data={filepath:e}}};tu.code="IndexResetError";var ru=class t extends Re{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=t.code,this.data={ref:e}}};ru.code="NoCommitError";var rk=Object.freeze({__proto__:null,AlreadyExistsError:$i,AmbiguousError:qc,CheckoutConflictError:zc,CommitNotFetchedError:Vc,EmptyServerResponseError:Wc,FastForwardError:Yc,GitPushError:Xc,HttpError:Wo,InternalError:he,InvalidFilepathError:$s,InvalidOidError:Ps,InvalidRefNameError:Fi,MaxDepthError:Zc,MergeNotSupportedError:Yo,MergeConflictError:Xo,MissingNameError:Jt,MissingParameterError:Sr,MultipleGitError:Kc,NoRefspecError:Gc,NotFoundError:He,ObjectTypeError:hr,ParseError:Sa,PushRejectedError:Zo,RemoteCapabilityError:Cs,SmartHttpError:Qc,UnknownTransportError:Jc,UnsafeFilepathError:zo,UrlParseError:eu,UserCanceledError:Ko,UnmergedPathsError:Uc,IndexResetError:tu,NoCommitError:ru});function cv({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=m8(i),`${t} <${e}> ${r} ${i}`}function m8(t){let e=g8(v8(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}function g8(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}function v8(t){return t===0?t:-t}function jn(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+` +`,t}function Td(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:w8(n)}}function w8(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),y8(i)}function y8(t){return t===0?t:-t}var Kr=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 ${cv(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 n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.tagger&&(i.tagger=Td(i.tagger)),i.committer&&(i.committer=Td(i.committer)),i}withoutSignature(){let e=jn(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 jn(e)}payload(){return this.withoutSignature()+` +`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:s}=await r({payload:n,secretKey:i});s=jn(s);let a=n+s;return t.from(a)}};function Kg(t){return t.trim().split(` +`).map(e=>" "+e).join(` +`)+` +`}function b8(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 i=t.justHeaders(e),n=t.justMessage(e),s=jn(i+` +gpgsig`+Kg(r)+` +`+n);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 jn(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 n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.author&&(i.author=Td(i.author)),i.committer&&(i.committer=Td(i.committer)),i}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 i=e.author;r+=`author ${cv(i)} +`;let n=e.committer||e.author;return r+=`committer ${cv(n)} +`,e.gpgsig&&(r+="gpgsig"+Kg(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+` +`+jn(e.message)}render(){return this._commit}withoutSignature(){let e=jn(this._commit);if(e.indexOf(` +gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(` +gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE----- +`)+28);return jn(r+` +`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return b8(e)}static async sign(e,r,i){let n=e.withoutSignature(),s=t.justMessage(e._commit),{signature:a}=await r({payload:n,secretKey:i});a=jn(a);let l=t.justHeaders(e._commit)+` +gpgsig`+Kg(a)+` +`+s;return t.from(l)}};async function Qo({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Er.from([]),oid:i};let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,Qo({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=kr.from(s).parse().tree,Qo({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new hr(i,n,"tree");return{tree:Er.from(s),oid:i}}var uv=class{constructor({fs:e,gitdir:r,ref:i,cache:n}){this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let a=new Map,o;try{o=await W.resolve({fs:e,gitdir:r,ref:i})}catch(c){c instanceof He&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Qo({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:i,cache:n,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 Ke({fs:i,cache:n,gitdir:s,oid:l});if(c!==o.type)throw new hr(l,c,o.type);let f=Er.from(u);for(let d of f)a.set(O(r,d.path),d);return f.entries().map(d=>O(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=XE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:s}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await Ke({fs:i,cache:n,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 i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};function Zr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,Id,{value:function({fs:r,gitdir:i,cache:n}){return new uv({fs:r,gitdir:i,ref:t,cache:n})}}),Object.freeze(e),e}var fv=class{constructor({fs:e,dir:r,gitdir:i,cache:n}){this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,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:i,dir:n}=this,s=await i.readdir(O(n,r));return s===null?null:s.map(a=>O(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:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=n.isDirectory()?"tree":"blob";s==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(s="special"),e._type=s,n=Vo(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await r.readlink(`${i}/${e._fullpath}`);else{let o=await(await this._getGitConfig(r,n)).get("core.autocrlf");s=await r.read(`${i}/${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:i,gitdir:n,cache:s}=this,a;await mt.acquire({fs:i,gitdir:n,cache:s},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||xd(c,l,f,d)){let h=await e.content();h===void 0?a=void 0:(a=await qn(Rs.wrap({type:"blob",object:h})),l&&a===l.oid&&(!f||c.mode===l.mode)&&xd(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 ct.get({fs:e,gitdir:r}),this.config)}};function nl(){let t=Object.create(null);return Object.defineProperty(t,Id,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new fv({fs:e,dir:r,gitdir:i,cache:n})}}),Object.freeze(t),t}function _8(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}var ik=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),dv=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:ec,reduce:a=async(l,c)=>{let u=ik(c);return l!==void 0&&u.unshift(l),u},iterate:o=(l,c)=>Promise.all([...c].map(l))}){let l=n.map(h=>h[Id]({fs:t,dir:r,gitdir:i,cache:e})),c=new Array(l.length).fill("."),u=_8(0,l.length),f=async h=>{u.forEach(v=>{let w=h[v];h[v]=w&&new l[v].ConstructEntry(w)});let g=(await Promise.all(u.map(v=>{let w=h[v];return w?l[v].readdir(w):[]}))).map(v=>(v===null?[]:v)[Symbol.iterator]());return{entries:h,children:x8(g)}},d=async h=>{let{entries:m,children:g}=await f(h),v=m.find(b=>b&&b._fullpath)._fullpath,w=await s(v,m);if(w!==null){let b=await o(d,g);return b=b.filter(k=>k!==void 0),a(w,b)}};return d(c)}async function hv(t,e){let r=await t.readdir(e);r==null?await t.rm(e):r.length?await Promise.all(r.map(i=>{let n=O(e,i);return t.lstat(n).then(s=>{if(s)return s.isDirectory()?hv(t,n):t.rm(n)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}function S8(t){return E8(t)&&OE(t.then)&&OE(t.catch)}function E8(t){return t&&typeof t=="object"}function OE(t){return typeof t=="function"}function ME(t){return S8((r=>{try{return r.readFile().catch(i=>i)}catch(i){return i}})(t))}var DE=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function LE(t,e){if(ME(e))for(let r of DE)t[`_${r}`]=e[r].bind(e);else for(let r of DE)t[`_${r}`]=yd(e[r].bind(e));ME(e)?(e.cp&&(t._cp=e.cp.bind(e)),e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=hv.bind(null,t)):(e.cp&&(t._cp=yd(e.cp.bind(e))),e.rm?t._rm=yd(e.rm.bind(e)):e.rmdir.length>2?t._rm=yd(e.rmdir.bind(e)):t._rm=hv.bind(null,t))}var J=class{constructor(e){if(typeof e._original_unwrapped_fs!="undefined")return e;let r=Object.getOwnPropertyDescriptor(e,"promises");r&&r.enumerable?LE(this,e.promises):LE(this,e),this._original_unwrapped_fs=e}async exists(e,r={}){try{return await this._stat(e),!0}catch(i){if(i.code==="ENOENT"||i.code==="ENOTDIR"||(i.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',i),i}}async read(e,r={}){try{let i=await this._readFile(e,r);if(r.autocrlf==="true")try{i=new TextDecoder("utf8",{fatal:!0}).decode(i),i=i.replace(/\r\n/g,` +`),i=new TextEncoder().encode(i)}catch(n){}return typeof i!="string"&&(i=Buffer.from(i)),i}catch(i){return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i)}catch(n){await this.mkdir(xa(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e)}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=xa(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),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(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Fd),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let s=e+"/"+n;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((n,s)=>n.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 i=await this._readlink(e,r);return Buffer.isBuffer(i)?i:Buffer.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function C(t,e){if(e===void 0)throw new Sr(t)}async function ee({fsp:t,dotgit:e}){C("fsp",t),C("dotgit",e);let r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(i=>i.trimRight().substr(8)).then(i=>O(xa(e),i)):e}async function Cd(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 nk({fs:t,dir:e,gitdir:r=O(e,".git"),commit:i="HEAD",cache:n={}}){try{C("fs",t),C("dir",e),C("gitdir",r);let s=new J(t),a=[Zr({ref:i}),nl(),Aa()],o=[],l=await ee({fsp:s,dotgit:r});await mt.acquire({fs:s,gitdir:l,cache:n},async function(u){o=u.unmergedPaths});let c=await Fs({fs:s,cache:n,dir:e,gitdir:l,trees:a,map:async function(u,[f,d,h]){let m=!await Cd(d,h),g=o.includes(u),v=!await Cd(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 tu(u)}});await mt.acquire({fs:s,gitdir:l,cache:n},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 Is=class{static async isIgnored({fs:e,dir:r,gitdir:i=O(r,".git"),filepath:n}){if(Sd(n)===".git")return!0;if(n===".")return!1;let s="",a=O(i,"info","exclude");await e.exists(a)&&(s=await e.read(a,"utf8"));let o=[{gitignore:O(r,".gitignore"),filepath:n}],l=n.split("/").filter(Boolean);for(let u=1;u{let f=await(await ct.get({fs:o,gitdir:l})).get("core.autocrlf");return pv({dir:e,gitdir:l,fs:o,filepath:i,index:c,force:s,parallel:a,autocrlf:f})})}catch(o){throw o.caller="git.add",o}}async function pv({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:s,parallel:a,autocrlf:o}){i=Array.isArray(i)?i:[i];let l=i.map(async d=>{if(!s&&await Is.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let h=await r.lstat(O(t,d));if(!h)throw new He(d);if(h.isDirectory()){let m=await r.readdir(O(t,d));if(a){let g=m.map(v=>pv({dir:t,gitdir:e,fs:r,filepath:[O(d,v)],index:n,force:s,parallel:a,autocrlf:o}));await Promise.all(g)}else for(let g of m)await pv({dir:t,gitdir:e,fs:r,filepath:[O(d,g)],index:n,force:s,parallel:a,autocrlf:o})}else{let m=h.isSymbolicLink()?await r.readlink(O(t,d)).then(ak):await r.read(O(t,d),{autocrlf:o});if(m===null)throw new He(d);let g=await Ar({fs:r,gitdir:e,type:"blob",object:m});n.insert({filepath:d,stats:h,oid:g})}}),c=await Promise.allSettled(l),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new Kc(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function iu({fs:t,gitdir:e,path:r}){return(await ct.get({fs:t,gitdir:e})).get(r)}function lk(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}async function Os({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),s={name:await iu({fs:t,gitdir:e,path:"user.name"}),email:await iu({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},a=lk({},s,i?i.author:void 0,r);if(a.name!==void 0)return a}async function Jo({fs:t,gitdir:e,author:r,committer:i,commit:n}){let s=Math.floor(Date.now()/1e3),a={name:await iu({fs:t,gitdir:e,path:"user.name"}),email:await iu({fs:t,gitdir:e,path:"user.email"})||"",timestamp:s,timezoneOffset:new Date(s*1e3).getTimezoneOffset()},o=lk({},a,n?n.committer:void 0,r,i);if(o.name!==void 0)return o}async function ck({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,ck({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new hr(i,n,"commit");return{commit:kr.from(s),oid:i}}async function el({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:s}=await ck({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,commit:n.parse(),payload:n.withoutSignature()}}async function Od({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h}){let m=!1,g=!1;f||(g=!(await t.read(`${i}/HEAD`,{encoding:"utf8"})).startsWith("ref:"),f=await W.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let v,w;try{v=await W.resolve({fs:t,gitdir:i,ref:f}),w=await el({fs:t,gitdir:i,oid:v,cache:{}})}catch(x){m=!0}if(l&&m)throw new ru(f);let b=l?await Os({fs:t,gitdir:i,author:s,commit:w.commit}):await Os({fs:t,gitdir:i,author:s});if(!b)throw new Jt("author");let k=l?await Jo({fs:t,gitdir:i,author:b,committer:a,commit:w.commit}):await Jo({fs:t,gitdir:i,author:b,committer:a});if(!k)throw new Jt("committer");return mt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(x){let A=KE(x.entries).get(".");if(h||(h=await uk({fs:t,gitdir:i,inode:A,dryRun:c})),d?d=await Promise.all(d.map(_=>W.resolve({fs:t,gitdir:i,ref:_}))):l?d=w.commit.parent:d=v?[v]:[],!n)if(l)n=w.commit.message;else throw new Sr("message");let y=kr.from({tree:h,parent:d,author:b,committer:k,message:n});o&&(y=await kr.sign(y,r,o));let S=await Ar({fs:t,gitdir:i,type:"commit",object:y.toObject(),dryRun:c});return!u&&!c&&await W.writeRef({fs:t,gitdir:i,ref:g?"HEAD":f,value:S}),S})}async function uk({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let l of n)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await uk({fs:t,gitdir:e,inode:l,dryRun:i}));let s=n.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),a=Er.from(s);return await Ar({fs:t,gitdir:e,type:"tree",object:a.toObject(),dryRun:i})}async function su({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new $s("leading-slash");if(n.endsWith("/"))throw new $s("trailing-slash");let s=i,a=await Qo({fs:t,cache:e,gitdir:r,oid:i}),o=a.tree;if(n==="")i=a.oid;else{let l=n.split("/");i=await fk({fs:t,cache:e,gitdir:r,tree:o,pathArray:l,oid:s,filepath:n})}return i}async function fk({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a}){let o=n.shift();for(let l of i)if(l.path===o){if(n.length===0)return l.oid;{let{type:c,object:u}=await Ke({fs:t,cache:e,gitdir:r,oid:l.oid});if(c!=="tree")throw new hr(s,c,"tree",a);return i=Er.from(u),fk({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a})}}throw new He(`file or directory found at "${s}:${a}"`)}async function sl({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await su({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:s,oid:a}=await Qo({fs:t,cache:e,gitdir:r,oid:i});return{oid:a,tree:s.entries()}}async function au({fs:t,gitdir:e,tree:r}){let i=Er.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}async function C8({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:s,note:a,force:o,author:l,committer:c,signingKey:u}){let f;try{f=await W.resolve({gitdir:i,fs:t,ref:n})}catch(w){if(!(w instanceof He))throw w}let h=(await sl({fs:t,cache:e,gitdir:i,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(o)h=h.filter(w=>w.path!==s);else for(let w of h)if(w.path===s)throw new $i("note",s);typeof a=="string"&&(a=Buffer.from(a,"utf8"));let m=await Ar({fs:t,gitdir:i,type:"blob",object:a,format:"content"});h.push({mode:"100644",path:s,oid:m,type:"blob"});let g=await au({fs:t,gitdir:i,tree:h});return await Od({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:g,parent:f&&[f],message:`Note added by 'isomorphic-git addNote' +`,author:l,committer:c,signingKey:u})}async function dk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n="refs/notes/commits",oid:s,note:a,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{C("fs",t),C("gitdir",i),C("oid",s),C("note",a),u&&C("onSign",e);let d=new J(t),h=await Os({fs:d,gitdir:i,author:l});if(!h)throw new Jt("author");let m=await Jo({fs:d,gitdir:i,author:h,committer:c});if(!m)throw new Jt("committer");let g=await ee({fsp:d,dotgit:i});return await C8({fs:d,cache:f,onSign:e,gitdir:g,ref:n,oid:s,note:a,force:o,author:h,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}var P8=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function nu(t,e){if(typeof t!="string")throw new TypeError("Reference name must be a string");return!P8.test(t)&&(!!e||t.includes("/"))}async function hk({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!nu(r,!0))throw new Fi(r,Hc.clean(r));let s=await ct.get({fs:t,gitdir:e});if(!n&&(await s.getSubsections("remote")).includes(r)&&i!==await s.get(`remote.${r}.url`))throw new $i("remote",r);await s.set(`remote.${r}.url`,i),await s.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await ct.save({fs:t,gitdir:e,config:s})}async function pk({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i,url:n,force:s=!1}){try{C("fs",t),C("gitdir",r),C("remote",i),C("url",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await hk({fs:a,gitdir:o,remote:i,url:n,force:s})}catch(a){throw a.caller="git.addRemote",a}}async function R8({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await W.exists({fs:t,gitdir:i,ref:n}))throw new $i("tag",n);let f=await W.resolve({fs:t,gitdir:i,ref:l||"HEAD"}),{type:d}=await Ke({fs:t,cache:e,gitdir:i,oid:f}),h=Kr.from({object:f,type:d,tag:n.replace("refs/tags/",""),tagger:s,message:a,gpgsig:o});c&&(h=await Kr.sign(h,r,c));let m=await Ar({fs:t,gitdir:i,type:"tag",object:h.toObject()});await W.writeRef({fs:t,gitdir:i,ref:n,value:m})}async function mk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{C("fs",t),C("gitdir",i),C("ref",n),c&&C("onSign",e);let d=new J(t),h=await ee({fsp:d,dotgit:i}),m=await Os({fs:d,gitdir:h,author:s});if(!m)throw new Jt("tagger");return await R8({fs:d,cache:f,onSign:e,gitdir:h,ref:n,tagger:m,message:a,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function $8({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:s=!1}){if(!nu(r,!0))throw new Fi(r,Hc.clean(r));let a=`refs/heads/${r}`;if(!s&&await W.exists({fs:t,gitdir:e,ref:a}))throw new $i("branch",r,!1);let o;try{o=await W.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(l){}o&&await W.writeRef({fs:t,gitdir:e,ref:a,value:o}),n&&await W.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function gk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,object:n,checkout:s=!1,force:a=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let o=new J(t),l=await ee({fsp:o,dotgit:r});return await $8({fs:o,gitdir:l,ref:i,object:n,checkout:s,force:a})}catch(o){throw o.caller="git.branch",o}}var vk=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function wv({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,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(i)try{v=await W.resolve({fs:t,gitdir:s,ref:"HEAD"})}catch(b){v="0000000000000000000000000000000000000000"}let w;try{w=await W.resolve({fs:t,gitdir:s,ref:o})}catch(b){if(o==="HEAD")throw b;let k=`${a}/${o}`;if(w=await W.resolve({fs:t,gitdir:s,ref:k}),h){let x=await ct.get({fs:t,gitdir:s});await x.set(`branch.${o}.remote`,a),await x.set(`branch.${o}.merge`,`refs/heads/${o}`),await ct.save({fs:t,gitdir:s,config:x})}await W.writeRef({fs:t,gitdir:s,ref:`refs/heads/${o}`,value:w})}if(!c){let b;try{b=await F8({fs:t,cache:e,onProgress:r,dir:n,gitdir:s,ref:o,force:d,filepaths:l})}catch(y){throw y instanceof He&&y.data.what===w?new Vc(o,w):y}let k=b.filter(([y])=>y==="conflict").map(([y,S])=>S);if(k.length>0)throw new zc(k);let x=b.filter(([y])=>y==="error").map(([y,S])=>S);if(x.length>0)throw new he(x.join(", "));if(f){i&&await i({previousHead:v,newHead:w,type:l!=null&&l.length>0?"file":"branch"});return}let E=0,A=b.length;if(await mt.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 T=`${n}/${_}`;S==="delete"&&await t.rm(T),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}))}),await mt.acquire({fs:t,gitdir:s,cache:e},async function(y){for(let[S,_]of b)if(S==="rmdir"||S==="rmdir-index"){let T=`${n}/${_}`;try{S==="rmdir"&&await t.rmdir(T),y.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}catch(P){if(P.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw P}}}),await Promise.all(b.filter(([y])=>y==="mkdir"||y==="mkdir-index").map(async function([y,S]){let _=`${n}/${S}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++E,total:A})})),m){let y=b.filter(([_])=>_==="create"||_==="create-index"||_==="update"||_==="mkdir-index"),S=await BE("Update Working Dir",y.map(([_,T,P,D,B])=>()=>O8({fs:t,cache:e,gitdir:s,dir:n},[_,T,P,D,B])),r,g);await mt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(_){await BE("Update Index",S.map(([T,P,D])=>()=>I8({index:_,fullpath:T,oid:P,stats:D})),r,g)})}else await mt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(y){await Promise.all(b.filter(([S])=>S==="create"||S==="create-index"||S==="update"||S==="mkdir-index").map(async function([S,_,T,P,D]){let B=`${n}/${_}`;try{if(S!=="create-index"&&S!=="mkdir-index"){let{object:ce}=await Ke({fs:t,cache:e,gitdir:s,oid:T});if(D&&await t.rm(B),P===33188)await t.write(B,ce);else if(P===33261)await t.write(B,ce,{mode:511});else if(P===40960)await t.writelink(B,ce);else throw new he(`Invalid mode 0o${P.toString(8)} detected in blob ${T}`)}let N=await t.lstat(B);P===33261&&(N.mode=493),S==="mkdir-index"&&(N.mode=57344),y.insert({filepath:_,stats:N,oid:T}),r&&await r({phase:"Updating workdir",loaded:++E,total:A})}catch(N){console.log(N)}}))});i&&await i({previousHead:v,newHead:w,type:l!=null&&l.length>0?"file":"branch"})}if(!u){let b=await W.expand({fs:t,gitdir:s,ref:o});b.startsWith("refs/heads")?await W.writeSymbolicRef({fs:t,gitdir:s,ref:"HEAD",value:b}):await W.writeRef({fs:t,gitdir:s,ref:"HEAD",value:w})}}async function F8({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:s,force:a,filepaths:o}){let l=0;return Fs({fs:t,cache:e,dir:i,gitdir:n,trees:[Zr({ref:s}),nl(),Aa()],map:async function(c,[u,f,d]){if(c===".")return;if(o&&!o.some(m=>vk(c,m)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++l}),[!!d,!!u,!!f].map(Number).join("")){case"000":return;case"001":return a&&o&&o.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await f.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await f.oid()?a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]:await u.mode()!==await f.mode()?a?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await f.oid()?a?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!a)return;if(f){if(await f.oid()!==await d.oid()&&await f.oid()!==await u.oid())return a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]}else if(a)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=ik(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function I8({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}async function O8({fs:t,cache:e,gitdir:r,dir:i},[n,s,a,o,l]){let c=`${i}/${s}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:f}=await Ke({fs:t,cache:e,gitdir:r,oid:a});if(l&&await t.rm(c),o===33188)await t.write(c,f);else if(o===33261)await t.write(c,f,{mode:511});else if(o===40960)await t.writelink(c,f);else throw new he(`Invalid mode 0o${o.toString(8)} detected in blob ${a}`)}let u=await t.lstat(c);return o===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[s,a,u]}async function BE(t,e,r,i){let n=[];try{for(let s=0;sl());(await Promise.allSettled(a)).forEach(l=>{l.status==="fulfilled"&&n.push(l.value)}),r&&await r({phase:"Updating workdir",loaded:s+a.length,total:e.length})}return n}catch(s){console.error(`Error during ${t}: ${s}`)}return n}async function yv({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=O(i,".git"),remote:s="origin",ref:a,filepaths:o,noCheckout:l=!1,noUpdateHead:c=a===void 0,dryRun:u=!1,force:f=!1,track:d=!0,cache:h={},nonBlocking:m=!1,batchSize:g=100}){try{C("fs",t),C("dir",i),C("gitdir",n);let v=a||"HEAD",w=new J(t),b=await ee({fsp:w,dotgit:n});return await wv({fs:w,cache:h,onProgress:e,onPostCheckout:r,dir:i,gitdir:b,remote:s,ref:v,filepaths:o,noCheckout:l,noUpdateHead:c,dryRun:u,force:f,track:d,nonBlocking:m,batchSize:g})}catch(v){throw v.caller="git.checkout",v}}var M8=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function _a(t){let e=M8.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}async function Ds({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await W.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await W.resolve({fs:t,gitdir:e,ref:n})}catch(s){return}if(n.startsWith("refs/"))return r?n:_a(n)}function D8(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}function wk({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}async function ou(t,e){let r=ek(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}async function Pd(t){let e=0,r=[];await ou(t,s=>{r.push(s),e+=s.byteLength});let i=new Uint8Array(e),n=0;for(let s of r)i.set(s,n),n+=s.byteLength;return i}function NE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}function mv(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}var at=class{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=Buffer.from(e));let r=e.length+4,i=mv(4,r);return Buffer.concat([Buffer.from(i,"utf8"),e])}static streamReader(e){let r=new Ad(e);return async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let s=await r.read(n-4);return s==null?!0:s}catch(n){return e.error=n,!0}}}};async function HE(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),s=r.slice(i+1);e[n]=s}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}async function UE(t,{service:e}){let r=new Set,i=new Map,n=new Map,s=at.streamReader(t),a=await s();for(;a===null;)a=await s();if(a===!0)throw new Wc;if(a.includes("version 2"))return HE(s);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new Sa(`# service=${e}\\n`,a.toString("utf8"));let o=await s();for(;o===null;)o=await s();if(o===!0)return{capabilities:r,refs:i,symrefs:n};if(o=o.toString("utf8"),o.includes("version 2"))return HE(s);let[l,c]=Jg(o,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,f]=Jg(l," "," ");for(i.set(f,u);;){let d=await s();if(d===!0)break;if(d!==null){let[h,m]=Jg(d.toString("utf8")," "," ");i.set(m,h)}}}for(let u of r)if(u.startsWith("symref=")){let f=u.match(/symref=([^:]+):(.*)/);f.length===3&&n.set(f[1],f[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}function Jg(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new Sa(`Two strings separated by '${r}'`,t.toString("utf8"));return i}var GE=(t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,jE=(t,e)=>{(e.username||e.password)&&(t.Authorization=wk(e)),e.headers&&Object.assign(t,e.headers)},ev=async t=>{try{let e=Buffer.from(await Pd(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch(e){return{}}},tl=class{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:s,corsProxy:a,service:o,url:l,headers:c,protocolVersion:u}){let{url:f,auth:d}=NE(l),h=a?GE(a,f):f;(d.username||d.password)&&(c.Authorization=wk(d)),u===2&&(c["Git-Protocol"]="version=2");let m,g,v=!1;do if(m=await e.request({onProgress:r,method:"GET",url:`${h}/info/refs?service=${o}`,headers:c}),g=!1,m.statusCode===401||m.statusCode===203){let w=v?s:i;if(w){if(d=await w(f,{...d,headers:{...c}}),d&&d.cancel)throw new Ko;d&&(jE(c,d),v=!0,g=!0)}}else m.statusCode===200&&v&&n&&await n(f,d);while(g);if(m.statusCode!==200){let{response:w}=await ev(m);throw new Wo(m.statusCode,m.statusMessage,w)}if(m.headers["content-type"]===`application/x-${o}-advertisement`){let w=await UE(m.body,{service:o});return w.auth=d,w}else{let{preview:w,response:b,data:k}=await ev(m);try{let x=await UE([k],{service:o});return x.auth=d,x}catch(x){throw new Qc(w,b)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:s,auth:a,body:o,headers:l}){let c=NE(s);c&&(s=c.url),i&&(s=GE(i,s)),l["content-type"]=`application/x-${n}-request`,l.accept=`application/x-${n}-result`,jE(l,a);let u=await e.request({onProgress:r,method:"POST",url:`${s}/${n}`,body:o,headers:l});if(u.statusCode!==200){let{response:f}=ev(u);throw new Wo(u.statusCode,u.statusMessage,f)}return u}},rl=class{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",tl),r.set("https",tl);let i=L8({url:e});if(!i)throw new eu(e);if(r.has(i.transport))return r.get(i.transport);throw new Jc(e,i.transport,i.transport==="ssh"?D8(e):void 0)}};function L8({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}var ba=null,Ea=class{static async read({fs:e,gitdir:r}){ba===null&&(ba=new Nc);let i=O(r,"shallow"),n=new Set;return await ba.acquire(i,async function(){let s=await e.read(i,{encoding:"utf8"});if(s===null||s.trim()==="")return n;s.trim().split(` +`).map(a=>n.add(a))}),n}static async write({fs:e,gitdir:r,oids:i}){ba===null&&(ba=new Nc);let n=O(r,"shallow");if(i.size>0){let s=[...i].join(` +`)+` +`;await ba.acquire(n,async function(){await e.write(n,s,{encoding:"utf8"})})}else await ba.acquire(n,async function(){await e.rm(n)})}};async function B8({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}async function N8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=await t.readdir(O(r,"objects/pack"));s=s.filter(a=>a.endsWith(".idx"));for(let a of s){let o=`${r}/objects/pack/${a}`,l=await vv({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(l.error)throw new he(l.error);if(l.offsets.has(i))return!0}return!1}async function qE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=o=>Ke({fs:t,cache:e,gitdir:r,oid:o}),a=await B8({fs:t,gitdir:r,oid:i});return a||(a=await N8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s})),a}function H8(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}function yk(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}var Md={name:"isomorphic-git",version:"1.36.3",agent:"git/isomorphic-git@1.36.3"},qo=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 U8(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 bk(t){let e=new qo,r="";return(async()=>(await ou(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=U8(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}var Rd=class{static demux(e){let r=at.streamReader(e),i=new qo,n=new qo,s=new qo,a=async function(){let o=await r();if(o===null)return a();if(o===!0){i.end(),s.end(),e.error?n.destroy(e.error):n.end();return}switch(o[0]){case 1:{n.write(o.slice(1));break}case 2:{s.write(o.slice(1));break}case 3:{let l=o.slice(1);s.write(l),i.end(),s.end(),n.destroy(new Error(l.toString("utf8")));return}default:i.write(o)}a()};return a(),{packetlines:i,packfile:n,progress:s}}};async function G8(t){let{packetlines:e,packfile:r,progress:i}=Rd.demux(t),n=[],s=[],a=[],o=!1,l=!1;return new Promise((c,u)=>{ou(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Ps(h)),n.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new Ps(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:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))})})}function j8({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:s=null,exclude:a=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(at.encode(`want ${c}${l} +`)),l="";for(let c of i)o.push(at.encode(`shallow ${c} +`));n!==null&&o.push(at.encode(`deepen ${n} +`)),s!==null&&o.push(at.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)} +`));for(let c of a)o.push(at.encode(`deepen-not ${c} +`));o.push(at.flush());for(let c of r)o.push(at.encode(`have ${c} +`));return o.push(at.encode(`done +`)),o}async function bv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,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 Ds({fs:t,gitdir:l,test:!0}),S=await ct.get({fs:t,gitdir:l}),_=f||y&&await S.get(`branch.${y}.remote`)||"origin",T=d||await S.get(`remote.${_}.url`);if(typeof T=="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 D=rl.getRemoteHelperFor({url:T}),B=await D.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:T,headers:x,protocolVersion:1}),N=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 Cs("shallow","depth");if(g!==null&&!B.capabilities.has("deepen-since"))throw new Cs("deepen-since","since");if(v.length>0&&!B.capabilities.has("deepen-not"))throw new Cs("deepen-not","exclude");if(w===!0&&!B.capabilities.has("deepen-relative"))throw new Cs("deepen-relative","relative");let{oid:Pe,fullref:ve}=W.resolveAgainstMap({ref:P,map:ce});for(let q of ce.keys())q===ve||q==="HEAD"||q.startsWith("refs/heads/")||b&&q.startsWith("refs/tags/")||ce.delete(q);let se=yk([...B.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Md.agent}`]);w&&se.push("deepen-relative");let xe=k?[Pe]:ce.values(),we=k?[y]:await W.listRefs({fs:t,gitdir:l,filepath:"refs"}),z=[];for(let q of we)try{q=await W.expand({fs:t,gitdir:l,ref:q});let Z=await W.resolve({fs:t,gitdir:l,ref:q});await qE({fs:t,cache:e,gitdir:l,oid:Z})&&z.push(Z)}catch(Z){}z=[...new Set(z)];let Q=await Ea.read({fs:t,gitdir:l}),j=B.capabilities.has("shallow")?[...Q]:[],Le=j8({capabilities:se,wants:xe,haves:z,shallows:j,depth:m,since:g,exclude:v}),lr=Buffer.from(await Pd(Le)),It=await D.connect({http:r,onProgress:i,corsProxy:h,service:"git-upload-pack",url:T,auth:N,body:[lr],headers:x}),Fe=await G8(It.body);It.headers&&(Fe.headers=It.headers);for(let q of Fe.shallows)if(!Q.has(q))try{let{object:Z}=await Ke({fs:t,cache:e,gitdir:l,oid:q}),L=new kr(Z),V=await Promise.all(L.headers().parent.map(qe=>qE({fs:t,cache:e,gitdir:l,oid:qe})));V.length===0||V.every(qe=>qe)||Q.add(q)}catch(Z){Q.add(q)}for(let q of Fe.unshallows)Q.delete(q);if(await Ea.write({fs:t,gitdir:l,oids:Q}),k){let q=new Map([[ve,Pe]]),Z=new Map,L=10,V=ve;for(;L--;){let Ot=B.symrefs.get(V);if(Ot===void 0)break;Z.set(V,Ot),V=Ot}let Te=ce.get(V);Te&&q.set(V,Te);let{pruned:qe}=await W.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:q,symrefs:Z,tags:b,prune:E});E&&(Fe.pruned=qe)}else{let{pruned:q}=await W.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:ce,symrefs:B.symrefs,tags:b,prune:E,pruneTags:A});E&&(Fe.pruned=q)}if(Fe.HEAD=B.symrefs.get("HEAD"),Fe.HEAD===void 0){let{oid:q}=W.resolveAgainstMap({ref:"HEAD",map:ce});for(let[Z,L]of ce.entries())if(Z!=="HEAD"&&L===q){Fe.HEAD=Z;break}}let At=ve.startsWith("refs/tags")?"tag":"branch";if(Fe.FETCH_HEAD={oid:Pe,description:`${At} '${_a(ve)}' of ${T}`},i||n){let q=bk(Fe.progress);ou(q,async Z=>{if(n&&await n(Z),i){let L=Z.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);L&&await i({phase:L[1].trim(),loaded:parseInt(L[2],10),total:parseInt(L[3],10)})}})}let Tt=Buffer.from(await Pd(Fe.packfile));if(It.body.error)throw It.body.error;let jt=Tt.slice(-20).toString("hex"),Ze={defaultBranch:Fe.HEAD,fetchHead:Fe.FETCH_HEAD.oid,fetchHeadDescription:Fe.FETCH_HEAD.description};if(Fe.headers&&(Ze.headers=Fe.headers),E&&(Ze.pruned=Fe.pruned),jt!==""&&!H8(Tt)){Ze.packfile=`objects/pack/pack-${jt}.pack`;let q=O(l,Ze.packfile);await t.write(q,Tt);let Z=V=>Ke({fs:t,cache:e,gitdir:l,oid:V}),L=await jc.fromPack({pack:Tt,getExternalRefDelta:Z,onProgress:i});await t.write(q.replace(/\.pack$/,".idx"),await L.toBuffer())}return Ze}async function _k({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:O(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(a=>i+"/"+a);for(let a of s)await t.mkdir(a);await t.write(i+"/config",`[core] + repositoryformatversion = 0 + filemode = false + bare = ${e} +`+(e?"":` logallrefupdates = true +`)+` symlinks = false + ignorecase = true +`),await t.write(i+"/HEAD",`ref: refs/heads/${n} +`)}async function q8({fs:t,cache:e,http:r,onProgress:i,onMessage:n,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 _k({fs:t,gitdir:u}),await hk({fs:t,gitdir:u,remote:m,url:f,force:!1}),d){let P=await ct.get({fs:t,gitdir:u});await P.set("http.corsProxy",d),await ct.save({fs:t,gitdir:u,config:P})}let{defaultBranch:_,fetchHead:T}=await bv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,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(T===null)return;h=h||_,h=h.replace("refs/heads/",""),await wv({fs:t,cache:e,onProgress:i,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 xk({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:c=O(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{C("fs",t),C("http",e),C("gitdir",c),k||C("dir",l),C("url",u);let _=new J(t),T=await ee({fsp:_,dotgit:c});return await q8({fs:_,cache:A,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:T,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 Sk({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:m={}}){try{C("fs",t),l||C("message",n),o&&C("onSign",e);let g=new J(t),v=await ee({fsp:g,dotgit:i});return await Od({fs:g,cache:m,onSign:e,gitdir:v,message:n,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 Ek({fs:t,dir:e,gitdir:r=O(e,".git"),fullname:i=!1,test:n=!1}){try{C("fs",t),C("gitdir",r);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await Ds({fs:s,gitdir:a,fullname:i,test:n})}catch(s){throw s.caller="git.currentBranch",s}}async function z8({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await W.exists({fs:t,gitdir:e,ref:r}))throw new He(r);let n=await W.expand({fs:t,gitdir:e,ref:r}),s=await Ds({fs:t,gitdir:e,fullname:!0});if(n===s){let l=await W.resolve({fs:t,gitdir:e,ref:n});await W.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await W.deleteRef({fs:t,gitdir:e,ref:n});let a=_a(r),o=await ct.get({fs:t,gitdir:e});await o.deleteSection("branch",a),await ct.save({fs:t,gitdir:e,config:o})}async function kk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await z8({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}async function Ak({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});await W.deleteRef({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}async function V8({fs:t,gitdir:e,remote:r}){let i=await ct.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await ct.save({fs:t,gitdir:e,config:i})}async function Tk({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i}){try{C("fs",t),C("remote",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await V8({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}async function W8({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await W.deleteRef({fs:t,gitdir:e,ref:r})}async function Ck({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await W8({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}async function Y8({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(s=>`${i}${s}`).filter(s=>s.startsWith(r))}async function X8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=[],a=await t.readdir(O(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await vv({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(c.error)throw new he(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&s.push(u)}return s}async function Z8({fs:t,cache:e,gitdir:r,oid:i}){let n=o=>Ke({fs:t,cache:e,gitdir:r,oid:o}),s=await Y8({fs:t,gitdir:r,oid:i}),a=await X8({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let o of a)s.indexOf(o)===-1&&s.push(o);if(s.length===1)return s[0];throw s.length>1?new qc("oids",i,s):new He(`an object matching "${i}"`)}async function Pk({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await Z8({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.expandOid",s}}async function Rk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i}){try{C("fs",t),C("gitdir",r),C("ref",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await W.expand({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.expandRef",n}}async function _v({fs:t,cache:e,gitdir:r,oids:i}){let n={},s=i.length,a=i.map((o,l)=>({index:l,oid:o}));for(;a.length;){let o=new Set;for(let{oid:c,index:u}of a)n[c]||(n[c]=new Set),n[c].add(u),n[c].size===s&&o.add(c);if(o.size>0)return[...o];let l=new Map;for(let{oid:c,index:u}of a)try{let{object:f}=await Ke({fs:t,cache:e,gitdir:r,oid:c}),d=kr.from(f),{parent:h}=d.parseHeaders();for(let m of h)(!n[m]||!n[m].has(u))&&l.set(m+":"+u,{oid:m,index:u})}catch(f){}a=Array.from(l.values())}return[]}var tv=/^.*(\r?\n|$)/gm;function K8({branches:t,contents:e}){let r=t[1],i=t[2],n=e[0],s=e[1],a=e[2],o=s.match(tv),l=n.match(tv),c=a.match(tv),u=P3(o,l,c),f=7,d="",h=!0;for(let m of u)m.ok&&(d+=m.ok.join("")),m.conflict&&(h=!1,d+=`${"<".repeat(f)} ${r} +`,d+=m.conflict.a.join(""),d+=`${"=".repeat(f)} +`,d+=m.conflict.b.join(""),d+=`${">".repeat(f)} ${i} +`);return{cleanMerge:h,mergedText:d}}async function Q8({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),index:n,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=Zr({ref:s}),g=Zr({ref:a}),v=Zr({ref:o}),w=[],b=[],k=[],x=[],E=await Fs({fs:t,cache:e,dir:r,gitdir:i,trees:[m,g,v],map:async function(A,[y,S,_]){let T=Sd(A),P=await Cd(y,S),D=await Cd(_,S);switch(`${P}-${D}`){case"false-false":return{mode:await S.mode(),path:T,oid:await S.oid(),type:await S.type()};case"false-true":return!_&&await y.type()==="tree"?{mode:await y.mode(),path:T,oid:await y.oid(),type:await y.type()}:_?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!y&&await _.type()==="tree"?{mode:await _.mode(),path:T,oid:await _.oid(),type:await _.type()}:y?{mode:await y.mode(),path:T,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:T,oid:await y.oid(),type:"tree"};if(y&&_&&await y.type()==="blob"&&await _.type()==="blob")return J8({fs:t,gitdir:i,path:T,ours:y,base:S,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async B=>{if(B.cleanMerge)d||n.insert({filepath:A,oid:B.mergeResult.oid,stage:0});else if(w.push(A),b.push(A),!d){let N="";S&&await S.type()==="blob"&&(N=await S.oid());let ce=await y.oid(),Pe=await _.oid();n.delete({filepath:A}),N&&n.insert({filepath:A,oid:N,stage:1}),n.insert({filepath:A,oid:ce,stage:2}),n.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(),N=await _.oid();n.delete({filepath:A}),n.insert({filepath:A,oid:B,stage:1}),n.insert({filepath:A,oid:N,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:T}}if(S&&y&&!_&&await S.type()==="blob"&&await y.type()==="blob"){if(w.push(A),x.push(A),!d){let B=await S.oid(),N=await y.oid();n.delete({filepath:A}),n.insert({filepath:A,oid:B,stage:1}),n.insert({filepath:A,oid:N,stage:2})}return{mode:await y.mode(),oid:await y.oid(),type:"blob",path:T}}if(S&&!y&&!_&&(await S.type()==="blob"||await S.type()==="tree"))return;throw new Yo}}},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 T=new Er(S).toObject(),P=await Ar({fs:t,gitdir:i,type:"tree",object:T,dryRun:f});A.oid=P}return A}}});return w.length!==0?(r&&!d&&await Fs({fs:t,cache:e,dir:r,gitdir:i,trees:[Zr({ref:E.oid})],map:async function(A,[y]){let S=`${r}/${A}`;if(await y.type()==="blob"){let _=await y.mode(),T=new TextDecoder().decode(await y.content());await t.write(S,T,{mode:_})}return!0}}),new Xo(w,b,k,x)):E.oid}async function J8({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:s,ourName:a,theirName:o,baseName:l,dryRun:c,mergeDriver:u=K8}){let f="blob",d="100755",h="",m="";n&&await n.type()==="blob"&&(d=await n.mode(),h=await n.oid(),m=Buffer.from(await n.content()).toString("utf8"));let g=d===await i.mode()?await s.mode():await i.mode();if(await i.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};if(await i.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 i.oid(),type:f}};let v=Buffer.from(await i.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 $k({fs:t,cache:e,dir:r,gitdir:i,ours:n,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}){n===void 0&&(n=await Ds({fs:t,gitdir:i,fullname:!0})),n=await W.expand({fs:t,gitdir:i,ref:n}),s=await W.expand({fs:t,gitdir:i,ref:s});let b=await W.resolve({fs:t,gitdir:i,ref:n}),k=await W.resolve({fs:t,gitdir:i,ref:s}),x=await _v({fs:t,cache:e,gitdir:i,oids:[b,k]});if(x.length!==1)if(x.length===0&&w)x.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new Yo;let E=x[0];if(E===k)return{oid:b,alreadyMerged:!0};if(a&&E===b)return!l&&!c&&await W.writeRef({fs:t,gitdir:i,ref:n,value:k}),{oid:k,fastForward:!0};{if(o)throw new Yc;let A=await mt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async S=>Q8({fs:t,cache:e,dir:r,gitdir:i,index:S,ourOid:b,theirOid:k,baseOid:E,ourName:_a(n),baseName:"base",theirName:_a(s),dryRun:l,abortOnConflict:u,mergeDriver:v}));if(A instanceof Xo)throw A;return f||(f=`Merge branch '${_a(s)}' into ${_a(n)}`),{oid:await Od({fs:t,cache:e,gitdir:i,message:f,ref:n,tree:A,parent:[b,k],author:d,committer:h,signingKey:m,onSign:g,dryRun:l,noUpdateBranch:c}),tree:A,mergeCommit:!0}}}async function Fk({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,dir:l,gitdir:c,ref:u,url:f,remote:d,remoteRef:h,prune:m,pruneTags:g,fastForward:v,fastForwardOnly:w,corsProxy:b,singleBranch:k,headers:x,author:E,committer:A,signingKey:y}){try{if(!u){let T=await Ds({fs:t,gitdir:c});if(!T)throw new Sr("ref");u=T}let{fetchHead:S,fetchHeadDescription:_}=await bv({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:c,corsProxy:b,ref:u,url:f,remote:d,remoteRef:h,singleBranch:k,headers:x,prune:m,pruneTags:g});await $k({fs:t,cache:e,gitdir:c,ours:u,theirs:S,fastForward:v,fastForwardOnly:w,message:`Merge ${_}`,author:E,committer:A,signingKey:y,dryRun:!1,noUpdateBranch:!1}),await wv({fs:t,cache:e,onProgress:i,dir:l,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(S){throw S.caller="git.pull",S}}async function Ik({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=O(o,".git"),ref:c,url:u,remote:f,remoteRef:d,corsProxy:h,singleBranch:m,headers:g={},cache:v={}}){try{C("fs",t),C("http",e),C("gitdir",l);let w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0},b=new J(t),k=await ee({fsp:b,dotgit:l});return await Fk({fs:b,cache:v,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:k,ref:c,url:u,remote:f,remoteRef:d,fastForwardOnly:!0,corsProxy:h,singleBranch:m,headers:g,author:w,committer:w})}catch(w){throw w.caller="git.fastForward",w}}async function Ok({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=O(o,".git"),ref:c,remote:u,remoteRef: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,cache:y={}}){try{C("fs",t),C("http",e),C("gitdir",l);let S=new J(t),_=await ee({fsp:S,dotgit:l});return await bv({fs:S,cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,gitdir:_,ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:m,since:g,exclude:v,relative:w,tags:b,singleBranch:k,headers:x,prune:E,pruneTags:A})}catch(S){throw S.caller="git.fetch",S}}async function Mk({fs:t,dir:e,gitdir:r=O(e,".git"),oids:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oids",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await _v({fs:s,cache:n,gitdir:a,oids:i})}catch(s){throw s.caller="git.findMergeBase",s}}async function Dk({fs:t,filepath:e}){if(await t.exists(O(e,".git")))return e;{let r=xa(e);if(r===e)throw new He(`git root for ${e}`);return Dk({fs:t,filepath:r})}}async function Lk({fs:t,filepath:e}){try{return C("fs",t),C("filepath",e),await Dk({fs:new J(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}async function Bk({fs:t,dir:e,gitdir:r=O(e,".git"),path:i}){try{C("fs",t),C("gitdir",r),C("path",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await iu({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfig",n}}async function e6({fs:t,gitdir:e,path:r}){return(await ct.get({fs:t,gitdir:e})).getall(r)}async function Nk({fs:t,dir:e,gitdir:r=O(e,".git"),path:i}){try{C("fs",t),C("gitdir",r),C("path",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await e6({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}async function Hk({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1}){try{C("http",t),C("url",s);let c=await rl.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[f,d]of c.refs){let h=f.split("/"),m=h.pop(),g=u;for(let v of h)g[v]=g[v]||{},g=g[v];g[m]=d}for(let[f,d]of c.symrefs){let h=f.split("/"),m=h.pop(),g=u;for(let v of h)g[v]=g[v]||{},g=g[v];g[m]=d}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function Uk(t,e,r,i){let n=[];for(let[s,a]of t.refs){if(e&&!s.startsWith(e))continue;if(s.endsWith("^{}")){if(i){let l=s.replace("^{}",""),c=n[n.length-1],u=c.ref===l?c:n.find(f=>f.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=a}continue}let o={ref:s,oid:a};r&&t.symrefs.has(s)&&(o.target=t.symrefs.get(s)),n.push(o)}return n}async function Gk({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2}){try{C("http",t),C("url",s);let u=await rl.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let f={};for(let d of u.capabilities){let[h,m]=d.split("=");m?f[h]=m:f[h]=!0}return{protocolVersion:1,capabilities:f,refs:Uk(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function t6({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Rs.wrap({type:t,object:e})),i=await qn(e)),{oid:i,object:e}}async function jk({object:t}){try{C("object",t),typeof t=="string"?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await t6({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}async function r6({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:s}){try{s=O(i,s);let a=await t.read(s),o=c=>Ke({fs:t,cache:e,gitdir:n,oid:c}),l=await jc.fromPack({pack:a,getExternalRefDelta:o,onProgress:r});return await t.write(s.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(a){throw a.caller="git.indexPack",a}}async function qk({fs:t,onProgress:e,dir:r,gitdir:i=O(r,".git"),filepath:n,cache:s={}}){try{C("fs",t),C("dir",r),C("gitdir",r),C("filepath",n);let a=new J(t),o=await ee({fsp:a,dotgit:i});return await r6({fs:a,cache:s,onProgress:e,dir:r,gitdir:o,filepath:n})}catch(a){throw a.caller="git.indexPack",a}}async function zk({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:O(r,".git"),defaultBranch:n="master"}){try{C("fs",t),C("gitdir",i),e||C("dir",r);let s=new J(t),a=await ee({fsp:s,dotgit:i});return await _k({fs:s,bare:e,dir:r,gitdir:a,defaultBranch:n})}catch(s){throw s.caller="git.init",s}}async function Vk({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:s}){let a=await Ea.read({fs:t,gitdir:r});if(!i)throw new Sr("oid");if(!n)throw new Sr("ancestor");if(i===n)return!1;let o=[i],l=new Set,c=0;for(;o.length;){if(c++===s)throw new Zc(s);let u=o.shift(),{type:f,object:d}=await Ke({fs:t,cache:e,gitdir:r,oid:u});if(f!=="commit")throw new hr(u,f,"commit");let h=kr.from(d).parse();for(let m of h.parent)if(m===n)return!0;if(!a.has(u))for(let m of h.parent)l.has(m)||(o.push(m),l.add(m))}return!1}async function Wk({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,ancestor:n,depth:s=-1,cache:a={}}){try{C("fs",t),C("gitdir",r),C("oid",i),C("ancestor",n);let o=new J(t),l=await ee({fsp:o,dotgit:r});return await Vk({fs:o,cache:a,gitdir:l,oid:i,ancestor:n,depth:s})}catch(o){throw o.caller="git.isDescendent",o}}async function Yk({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i}){try{C("fs",t),C("dir",e),C("gitdir",r),C("filepath",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return Is.isIgnored({fs:n,dir:e,gitdir:s,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}async function Xk({fs:t,dir:e,gitdir:r=O(e,".git"),remote:i}){try{C("fs",t),C("gitdir",r);let n=new J(t),s=await ee({fsp:n,dotgit:r});return W.listBranches({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.listBranches",n}}async function i6({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await W.resolve({gitdir:e,fs:t,ref:r}),s=[];return await Zk({fs:t,cache:i,gitdir:e,oid:n,filenames:s,prefix:""}),s}else return mt.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(s=>s.path)})}async function Zk({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:s}){let{tree:a}=await sl({fs:t,cache:e,gitdir:r,oid:i});for(let o of a)o.type==="tree"?await Zk({fs:t,cache:e,gitdir:r,oid:o.oid,filenames:n,prefix:O(s,o.path)}):n.push(O(s,o.path))}async function Kk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,cache:n={}}){try{C("fs",t),C("gitdir",r);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await i6({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listFiles",s}}async function n6({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await W.resolve({gitdir:r,fs:t,ref:i})}catch(o){if(o instanceof He)return[]}return(await sl({fs:t,cache:e,gitdir:r,oid:n})).tree.map(o=>({target:o.path,note:o.oid}))}async function Qk({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{C("fs",t),C("gitdir",r),C("ref",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await n6({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listNotes",s}}async function Jk({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i}){try{C("fs",t),C("gitdir",r);let n=new J(t),s=await ee({fsp:n,dotgit:r});return W.listRefs({fs:n,gitdir:s,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}async function s6({fs:t,gitdir:e}){let r=await ct.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async s=>{let a=await r.get(`remote.${s}.url`);return{remote:s,url:a}}))}async function eA({fs:t,dir:e,gitdir:r=O(e,".git")}){try{C("fs",t),C("gitdir",r);let i=new J(t),n=await ee({fsp:i,dotgit:r});return await s6({fs:i,gitdir:n})}catch(i){throw i.caller="git.listRemotes",i}}async function a6(t){let e=at.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,s,...a]=i.split(" "),o={ref:s,oid:n};for(let l of a){let[c,u]=l.split(":");c==="symref-target"?o.target=u:c==="peeled"&&(o.peeled=u)}r.push(o)}return r}async function o6({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(at.encode(`command=ls-refs +`)),i.push(at.encode(`agent=${Md.agent} +`)),(r||e||t)&&i.push(at.delim()),r&&i.push(at.encode("peel")),e&&i.push(at.encode("symrefs")),t&&i.push(at.encode(`ref-prefix ${t}`)),i.push(at.flush()),i}async function tA({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{C("http",t),C("url",s);let d=await tl.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(d.protocolVersion===1)return Uk(d,c,u,f);let h=await o6({prefix:c,symrefs:u,peelTags:f}),m=await tl.connect({http:t,auth:d.auth,headers:a,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,body:h});return a6(m.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function rA({fs:t,dir:e,gitdir:r=O(e,".git")}){try{C("fs",t),C("gitdir",r);let i=new J(t),n=await ee({fsp:i,dotgit:r});return W.listTags({fs:i,gitdir:n})}catch(i){throw i.caller="git.listTags",i}}function l6(t,e){return t.committer.timestamp-e.committer.timestamp}var c6="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function zE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===c6)return;let s=i,a,o=await Qo({fs:t,cache:e,gitdir:r,oid:i}),l=o.tree;return n===o.oid?a=o.path:(a=await iA({fs:t,cache:e,gitdir:r,tree:l,fileId:n,oid:s}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function iA({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:s,filepaths:a=[],parentPath:o=""}){let l=i.entries().map(function(c){let u;return c.oid===n?(u=O(o,c.path),a.push(u)):c.type==="tree"&&(u=Ke({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return iA({fs:t,cache:e,gitdir:r,tree:Er.from(f),fileId:n,oid:s,filepaths:a,parentPath:O(o,c.path)})})),u});return await Promise.all(l),a}async function u6({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:s,since:a,force:o,follow:l}){let c=typeof a=="undefined"?void 0:Math.floor(a.valueOf()/1e3),u=[],f=await Ea.read({fs:t,gitdir:r}),d=await W.resolve({fs:t,gitdir:r,ref:n}),h=[await el({fs:t,cache:e,gitdir:r,oid:d})],m,g,v;function w(b){v&&i&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(i){let k;try{k=await su({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:i}),g&&m!==k&&u.push(g),m=k,g=b,v=!0}catch(x){if(x instanceof He){let E=l&&m;if(E&&(E=await zE({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:m}),E))if(Array.isArray(E)){if(g){let A=await zE({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],i=E,g&&u.push(g);else{E=!1,g&&u.push(g);break}}}else i=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 el({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)=>l6(k.commit,x.commit))}return u}async function nA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,ref:n="HEAD",depth:s,since:a,force:o,follow:l,cache:c={}}){try{C("fs",t),C("gitdir",r),C("ref",n);let u=new J(t),f=await ee({fsp:u,dotgit:r});return await u6({fs:u,cache:c,gitdir:f,filepath:i,ref:n,depth:s,since:a,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function sA({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ours:n,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{C("fs",t),m&&C("onSign",e);let b=new J(t),k=await ee({fsp:b,dotgit:i}),x=await Os({fs:b,gitdir:k,author:d});if(!x&&(!o||!a))throw new Jt("author");let E=await Jo({fs:b,gitdir:k,author:x,committer:h});if(!E&&(!o||!a))throw new Jt("committer");return await $k({fs:b,cache:g,dir:r,gitdir:k,ours:n,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 f6={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function aA({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),oids:n}){let s=new WE,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=f6[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(mv(2,v),"hex"),h=h>>>7;o(Buffer.from(await sk(f)))}o("PACK"),o("00000002","hex"),o(mv(8,n.length),"hex");for(let u of n){let{type:f,object:d}=await Ke({fs:t,cache:e,gitdir:i,oid:u});await l({write:o,object:d,stype:f})}let c=s.digest();return a.push(c),a}async function d6({fs:t,cache:e,gitdir:r,oids:i,write:n}){let s=await aA({fs:t,cache:e,gitdir:r,oids:i}),a=Buffer.from(await Pd(s)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return n?(await t.write(O(r,`objects/pack/${l}`),a),{filename:l}):{filename:l,packfile:new Uint8Array(a)}}async function oA({fs:t,dir:e,gitdir:r=O(e,".git"),oids:i,write:n=!1,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oids",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await d6({fs:a,cache:s,gitdir:o,oids:i,write:n})}catch(a){throw a.caller="git.packObjects",a}}async function lA({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=O(o,".git"),ref:c,url:u,remote:f,remoteRef:d,prune:h=!1,pruneTags:m=!1,fastForward:g=!0,fastForwardOnly:v=!1,corsProxy:w,singleBranch:b,headers:k={},author:x,committer:E,signingKey:A,cache:y={}}){try{C("fs",t),C("gitdir",l);let S=new J(t),_=await ee({fsp:S,dotgit:l}),T=await Os({fs:S,gitdir:_,author:x});if(!T)throw new Jt("author");let P=await Jo({fs:S,gitdir:_,author:T,committer:E});if(!P)throw new Jt("committer");return await Fk({fs:S,cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:_,ref:c,url:u,remote:f,remoteRef:d,fastForward:g,fastForwardOnly:v,corsProxy:w,singleBranch:b,headers:k,author:T,committer:P,signingKey:A,prune:h,pruneTags:m})}catch(S){throw S.caller="git.pull",S}}async function h6({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),start:n,finish:s}){let a=await Ea.read({fs:t,gitdir:i}),o=new Set,l=new Set;for(let f of n)o.add(await W.resolve({fs:t,gitdir:i,ref:f}));for(let f of s)try{let d=await W.resolve({fs:t,gitdir:i,ref:f});l.add(d)}catch(d){}let c=new Set;async function u(f){c.add(f);let{type:d,object:h}=await Ke({fs:t,cache:e,gitdir:i,oid:f});if(d==="tag"){let g=Kr.from(h).headers().object;return u(g)}if(d!=="commit")throw new hr(f,d,"commit");if(!a.has(f)){let g=kr.from(h).headers().parent;for(f of g)!l.has(f)&&!c.has(f)&&await u(f)}}for(let f of o)await u(f);return c}async function rv({fs:t,cache:e,dir:r,gitdir:i=O(r,".git"),oids:n}){let s=new Set;async function a(o){if(s.has(o))return;s.add(o);let{type:l,object:c}=await Ke({fs:t,cache:e,gitdir:i,oid:o});if(l==="tag"){let f=Kr.from(c).headers().object;await a(f)}else if(l==="commit"){let f=kr.from(c).headers().tree;await a(f)}else if(l==="tree"){let u=Er.from(c);for(let f of u)f.type==="blob"&&s.add(f.oid),f.type==="tree"&&await a(f.oid)}}for(let o of n)await a(o);return s}async function p6(t){let e={},r="",i=at.streamReader(t),n=await i();for(;n!==!0;)n!==null&&(r+=n.toString("utf8")+` +`),n=await i();let s=r.toString("utf8").split(` +`);if(n=s.shift(),!n.startsWith("unpack "))throw new Sa('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.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 m6({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(at.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i} +`)),i="";return r.push(at.flush()),r}async function g6({fs:t,cache:e,http:r,onProgress:i,onMessage:n,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 Ds({fs:t,gitdir:c});if(typeof b=="undefined")throw new Sr("ref");let k=await ct.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 W.expand({fs:t,gitdir:c,ref:b}),y=g?"0000000000000000000000000000000000000000":await W.resolve({fs:t,gitdir:c,ref:A}),S=rl.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}),T=_.auth,P;if(!E)P=A;else try{P=await W.expandAgainstMap({ref:E,map:_.refs})}catch(Q){if(Q instanceof He)P=E.startsWith("refs/")?E:`refs/heads/${E}`;else throw Q}let D=_.refs.get(P)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:x,localRef:{ref:g?"(delete)":A,oid:y},remoteRef:{ref:P,oid:D}}))throw new Ko;let B=!_.capabilities.has("no-thin"),N=new Set;if(!g){let Q=[..._.refs.values()],j=new Set;if(D!=="0000000000000000000000000000000000000000"){let Le=await _v({fs:t,cache:e,gitdir:c,oids:[y,D]});for(let lr of Le)Q.push(lr);B&&(j=await rv({fs:t,cache:e,gitdir:c,oids:Le}))}if(!Q.includes(y)){let Le=await h6({fs:t,cache:e,gitdir:c,start:[y],finish:Q});N=await rv({fs:t,cache:e,gitdir:c,oids:Le})}if(B){try{let Le=await W.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:lr}=await W.resolveAgainstMap({ref:Le.replace(`refs/remotes/${d}/`,""),fullref:Le,map:_.refs}),It=[lr];for(let Fe of await rv({fs:t,cache:e,gitdir:c,oids:It}))j.add(Fe)}catch(Le){}for(let Le of j)N.delete(Le)}if(y===D&&(m=!0),!m){if(A.startsWith("refs/tags")&&D!=="0000000000000000000000000000000000000000")throw new Zo("tag-exists");if(y!=="0000000000000000000000000000000000000000"&&D!=="0000000000000000000000000000000000000000"&&!await Vk({fs:t,cache:e,gitdir:c,oid:y,ancestor:D,depth:-1}))throw new Zo("not-fast-forward")}}let ce=yk([..._.capabilities],["report-status","side-band-64k",`agent=${Md.agent}`]),Pe=await m6({capabilities:ce,triplets:[{oldoid:D,oid:y,fullRef:P}]}),ve=g?[]:await aA({fs:t,cache:e,gitdir:c,oids:[...N]}),se=await S.connect({http:r,onProgress:i,corsProxy:v,service:"git-receive-pack",url:x,auth:T,headers:w,body:[...Pe,...ve]}),{packfile:xe,progress:we}=await Rd.demux(se.body);if(n){let Q=bk(we);ou(Q,async j=>{await n(j)})}let z=await p6(xe);if(se.headers&&(z.headers=se.headers),d&&z.ok&&z.refs[P].ok&&!A.startsWith("refs/tags")){let Q=`refs/remotes/${d}/${P.replace("refs/heads","")}`;g?await W.deleteRef({fs:t,gitdir:c,ref:Q}):await W.writeRef({fs:t,gitdir:c,ref:Q,value:y})}if(z.ok&&Object.values(z.refs).every(Q=>Q.ok))return z;{let Q=Object.entries(z.refs).filter(([j,Le])=>!Le.ok).map(([j,Le])=>` + - ${j}: ${Le.error}`).join("");throw new Xc(Q,z)}}async function cA({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,dir:l,gitdir:c=O(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:m=!1,delete:g=!1,corsProxy:v,headers:w={},cache:b={}}){try{C("fs",t),C("http",e),C("gitdir",c);let k=new J(t),x=await ee({fsp:k,dotgit:c});return await g6({fs:k,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,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 uA({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Kr.from(s).parse().object,uA({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new hr(i,n,"blob");return{oid:i,blob:new Uint8Array(s)}}async function fA({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await su({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await uA({fs:t,cache:e,gitdir:r,oid:i})}async function dA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,filepath:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await fA({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readBlob",a}}async function xv({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await el({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readCommit",s}}async function v6({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let s=await W.resolve({gitdir:r,fs:t,ref:i}),{blob:a}=await fA({fs:t,cache:e,gitdir:r,oid:s,filepath:n});return a}async function hA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="refs/notes/commits",oid:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("ref",i),C("oid",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await v6({fs:a,cache:s,gitdir:o,ref:i,oid:n})}catch(a){throw a.caller="git.readNote",a}}async function pA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,format:n="parsed",filepath:s=void 0,encoding:a=void 0,cache:o={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});s!==void 0&&(i=await su({fs:l,cache:o,gitdir:c,oid:i,filepath:s}));let f=await Ke({fs:l,cache:o,gitdir:c,oid:i,format:n==="parsed"?"content":n});if(f.oid=i,n==="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=Kr.from(f.object).parse();break;default:throw new hr(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 w6({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await Ke({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new hr(i,n,"tag");let a=Kr.from(s);return{oid:i,tag:a.parse(),payload:a.payload()}}async function mA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await w6({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readTag",s}}async function gA({fs:t,dir:e,gitdir:r=O(e,".git"),oid:i,filepath:n=void 0,cache:s={}}){try{C("fs",t),C("gitdir",r),C("oid",i);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await sl({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readTree",a}}async function vA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});await mt.acquire({fs:s,gitdir:a,cache:n},async function(o){o.delete({filepath:i})})}catch(s){throw s.caller="git.remove",s}}async function y6({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l}){let c;try{c=await W.resolve({gitdir:i,fs:t,ref:n})}catch(m){if(!(m instanceof He))throw m}let f=(await sl({fs:t,cache:e,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(m=>m.path!==s);let d=await au({fs:t,gitdir:i,tree:f});return await Od({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote' +`,author:a,committer:o,signingKey:l})}async function wA({fs:t,onSign:e,dir:r,gitdir:i=O(r,".git"),ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l,cache:c={}}){try{C("fs",t),C("gitdir",i),C("oid",s);let u=new J(t),f=await ee({fsp:u,dotgit:i}),d=await Os({fs:u,gitdir:f,author:a});if(!d)throw new Jt("author");let h=await Jo({fs:u,gitdir:f,author:d,committer:o});if(!h)throw new Jt("committer");return await y6({fs:u,cache:c,onSign:e,gitdir:f,ref:n,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function b6({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!nu(i,!0))throw new Fi(i,Hc.clean(i));if(!nu(r,!0))throw new Fi(r,Hc.clean(r));let s=`refs/heads/${r}`,a=`refs/heads/${i}`;if(await W.exists({fs:t,gitdir:e,ref:a}))throw new $i("branch",i,!1);let l=await W.resolve({fs:t,gitdir:e,ref:s,depth:1});await W.writeRef({fs:t,gitdir:e,ref:a,value:l}),await W.deleteRef({fs:t,gitdir:e,ref:s});let u=await Ds({fs:t,gitdir:e,fullname:!0})===s;(n||u)&&await W.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function yA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,oldref:n,checkout:s=!1}){try{C("fs",t),C("gitdir",r),C("ref",i),C("oldref",n);let a=new J(t),o=await ee({fsp:a,dotgit:r});return await b6({fs:a,gitdir:o,ref:i,oldref:n,checkout:s})}catch(a){throw a.caller="git.renameBranch",a}}async function bA({gitdir:t,type:e,object:r}){return qn(Rs.wrap({type:e,object:r}))}async function _A({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,ref:n,cache:s={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let a=new J(t),o=await ee({fsp:a,dotgit:r}),l,c;try{l=await W.resolve({fs:a,gitdir:o,ref:n||"HEAD"})}catch(d){if(n)throw d}if(l)try{l=await su({fs:a,cache:s,gitdir:o,oid:l,filepath:i})}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(O(e,i));f&&(c=await bA({gitdir:o,type:"blob",object:f}),l===c&&(u=await a.lstat(O(e,i)))),await mt.acquire({fs:a,gitdir:o,cache:s},async function(d){d.delete({filepath:i}),l&&d.insert({filepath:i,stats:u,oid:l})})}catch(a){throw a.caller="git.reset",a}}async function xA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,depth:n}){try{C("fs",t),C("gitdir",r),C("ref",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});return await W.resolve({fs:s,gitdir:a,ref:i,depth:n})}catch(s){throw s.caller="git.resolveRef",s}}async function SA({fs:t,dir:e,gitdir:r=O(e,".git"),path:i,value:n,append:s=!1}){try{C("fs",t),C("gitdir",r),C("path",i);let a=new J(t),o=await ee({fsp:a,dotgit:r}),l=await ct.get({fs:a,gitdir:o});s?await l.append(i,n):await l.set(i,n),await ct.save({fs:a,gitdir:o,config:l})}catch(a){throw a.caller="git.setConfig",a}}async function EA({fs:t,gitdir:e,commit:r}){let i=kr.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}var $d=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${s} ${r} ${n} ${e.email} ${a} ${o} ${i} +`}static getStashReflogEntry(e,r=!1){return e.split(` +`).filter(s=>s).reverse().map((s,a)=>r?`stash@{${a}}: ${s.split(" ")[1]}`:s)}},_6={stage:Aa,workdir:nl},iv;async function il(t,e){return iv===void 0&&(iv=new Nc),iv.acquire(t,e)}async function x6(t,e,r,i,n=null){let s=O(r,i),a=await t.lstat(s);if(!a)throw new He(s);if(a.isDirectory())throw new he(`${s}: file expected, but found directory`);let o=n?await JE({fs:t,gitdir:e,oid:n}):void 0,l=o?n:void 0;return o||await il({fs:t,gitdir:e,currentFilepath:s},async()=>{let c=a.isSymbolicLink()?await t.readlink(s).then(ak):await t.read(s);if(c===null)throw new He(s);l=await Ar({fs:t,gitdir:e,type:"blob",object:c})}),l}async function S6({fs:t,dir:e,gitdir:r,entries:i}){async function n(s){if(s.type==="tree"){if(!s.oid){let a=await Promise.all(s.children.map(n));s.oid=await au({fs:t,gitdir:r,tree:a}),s.mode=16384}}else s.type==="blob"&&(s.oid=await x6(t,r,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(i.map(n))}async function VE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",s=i.map(h=>typeof h=="string"?_6[h]():h),a=[],u=await Fs({fs:t,cache:{},dir:e,gitdir:r,trees:s,map:async(h,[m,g])=>{if(!(h==="."||await Is.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;n?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 S6({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 au({fs:t,gitdir:r,tree:d})}async function E6({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:s}){let a=[],o=[],l=await Fs({fs:t,cache:{},dir:e,gitdir:r,trees:[Zr({ref:n}),Zr({ref:i})],map:async(c,[u,f])=>{if(c==="."||await Is.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(O(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=O(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 Ke({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,f)}break}}}),await mt.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 ka=class t{constructor({fs:e,dir:r,gitdir:i=O(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return O(this.gitdir,t.refStash)}get refLogsStashPath(){return O(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await Os({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Jt("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:i}){return EA({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,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 Fi(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?el({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return W.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=$d.createStashReflogEntry(i,e,r),s=this.refLogsStashPath;await il({filepath:s,entry:n},async()=>{let a=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,a+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return $d.getStashReflogEntry(r,e)}};async function kA({fs:t,dir:e,gitdir:r,message:i=""}){let n=new ka({fs:t,dir:e,gitdir:r});await n.getAuthor();let s=await Ds({fs:t,gitdir:r,fullname:!1}),a=await W.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await xv({fs:t,dir:e,gitdir:r,oid:a})).commit.message,c=[a],u=null,f=Zr({ref:"HEAD"}),d=await VE({fs:t,dir:e,gitdir:r,treePair:[Zr({ref:"HEAD"}),"stage"]});if(d){let v=await n.writeStashCommit({message:`stash-Index: WIP on ${s} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(v),u=d,f=Aa()}let h=await VE({fs:t,dir:e,gitdir:r,treePair:[f,"workdir"]});if(h){let v=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${s} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(v),u=h}if(!u||!d&&!h)throw new He("changes, nothing to stash");let m=(i.trim()||`WIP on ${s}`)+`: ${a.substring(0,7)} ${l}`;return{stashCommit:await n.writeStashCommit({message:m,tree:u,parent:c}),stashMsg:m,branch:s,stashMgr:n}}async function k6({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n,stashMsg:s,branch:a,stashMgr:o}=await kA({fs:t,dir:e,gitdir:r,message:i});return await o.writeStashRef(n),await o.writeStashReflogEntry({stashCommit:n,message:s}),await yv({fs:t,dir:e,gitdir:r,ref:a,track:!1,force:!0}),n}async function A6({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n}=await kA({fs:t,dir:e,gitdir:r,message:i});return n}async function AA({fs:t,dir:e,gitdir:r,refIdx:i=0}){let s=await new ka({fs:t,dir:e,gitdir:r}).readStashCommit(i),{parent:a=null}=s.commit?s.commit:{};if(!(!a||!Array.isArray(a)))for(let o=0;o{await t.exists(a)&&await t.rm(a)});let o=await n.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(i,1);let l=n.refLogsStashPath;await il({reflogEntries:o,stashReflogPath:l,stashMgr:n},async()=>{if(o.length){await t.write(l,o.reverse().join(` +`)+` +`,"utf8");let c=o[o.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(l)})}async function T6({fs:t,dir:e,gitdir:r}){return new ka({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function C6({fs:t,dir:e,gitdir:r}){let i=new ka({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await il(n,async()=>{await Promise.all(n.map(async s=>{if(await t.exists(s))return t.rm(s)}))})}async function P6({fs:t,dir:e,gitdir:r,refIdx:i=0}){await AA({fs:t,dir:e,gitdir:r,refIdx:i}),await TA({fs:t,dir:e,gitdir:r,refIdx:i})}async function CA({fs:t,dir:e,gitdir:r=O(e,".git"),op:i="push",message:n="",refIdx:s=0}){C("fs",t),C("dir",e),C("gitdir",r),C("op",i);let a={push:k6,apply:AA,drop:TA,list:T6,clear:C6,pop:P6,create:A6},o=["apply","drop","pop"];try{let l=new J(t),c=await ee({fsp:l,dotgit:r});["refs","logs","logs/refs"].map(d=>O(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=a[i];if(f){if(o.includes(i)&&s<0)throw new Fi(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:n,refIdx:s})}throw new Error(`To be implemented: ${i}`)}catch(l){throw l.caller="git.stash",l}}async function PA({fs:t,dir:e,gitdir:r=O(e,".git"),filepath:i,cache:n={}}){try{C("fs",t),C("gitdir",r),C("filepath",i);let s=new J(t),a=await ee({fsp:s,dotgit:r});if(await Is.isIgnored({fs:s,gitdir:a,dir:e,filepath:i}))return"ignored";let l=await R6({fs:s,cache:n,gitdir:a}),c=await RA({fs:s,cache:n,gitdir:a,tree:l,path:i}),u=await mt.acquire({fs:s,gitdir:a,cache:n},async function(v){for(let w of v)if(w.path===i)return w;return null}),f=await s.lstat(O(e,i)),d=c!==null,h=u!==null,m=f!==null,g=async()=>{if(h&&!xd(u,f))return u.oid;{let v=await s.read(O(e,i)),w=await bA({gitdir:a,type:"blob",object:v});return h&&u.oid===w&&f.size!==-1&&mt.acquire({fs:s,gitdir:a,cache:n},async function(b){b.insert({filepath:i,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 RA({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let s=n.shift();for(let a of i)if(a.path===s){if(n.length===0)return a.oid;let{type:o,object:l}=await Ke({fs:t,cache:e,gitdir:r,oid:a.oid});if(o==="tree"){let c=Er.from(l);return RA({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(o==="blob")throw new hr(a.oid,o,"blob",n.join("/"))}return null}async function R6({fs:t,cache:e,gitdir:r}){let i;try{i=await W.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(s){if(s instanceof He)return[]}let{tree:n}=await sl({fs:t,cache:e,gitdir:r,oid:i});return n}async function $A({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:s,cache:a={},ignored:o=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});return await Fs({fs:l,cache:a,dir:e,gitdir:c,trees:[Zr({ref:i}),nl(),Aa()],map:async function(u,[f,d,h]){if(!f&&!h&&d&&!o&&await Is.isIgnored({fs:l,dir:e,filepath:u})||!n.some(y=>vk(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 FA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,object:n,force:s=!1}){try{C("fs",t),C("gitdir",r),C("ref",i);let a=new J(t);if(i===void 0)throw new Sr("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let o=await ee({fsp:a,dotgit:r}),l=await W.resolve({fs:a,gitdir:o,ref:n||"HEAD"});if(!s&&await W.exists({fs:a,gitdir:o,ref:i}))throw new $i("tag",i);await W.writeRef({fs:a,gitdir:o,ref:i,value:l})}catch(a){throw a.caller="git.tag",a}}async function IA({fs:t,dir:e,gitdir:r=O(e,".git"),cache:i={},filepath:n,oid:s,mode:a,add:o,remove:l,force:c}){try{C("fs",t),C("gitdir",r),C("filepath",n);let u=new J(t),f=await ee({fsp:u,dotgit:r});if(l)return await mt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!c){let m=await u.lstat(O(e,n));if(m){if(m.isDirectory())throw new $s("directory");return}}h.has({filepath:n})&&h.delete({filepath:n})});let d;if(!s){if(d=await u.lstat(O(e,n)),!d)throw new He(`file at "${n}" on disk and "remove" not set`);if(d.isDirectory())throw new $s("directory")}return await mt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!o&&!h.has({filepath:n}))throw new He(`file at "${n}" in index and "add" not set`);let m;if(s)m={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:a,uid:0,gid:0,size:0};else{m=d;let g=m.isSymbolicLink()?await u.readlink(O(e,n)):await u.read(O(e,n));s=await Ar({fs:u,gitdir:f,type:"blob",format:"content",object:g})}return h.insert({filepath:n,oid:s,stats:m}),s})}catch(u){throw u.caller="git.updateIndex",u}}function OA(){try{return Md.version}catch(t){throw t.caller="git.version",t}}async function MA({fs:t,dir:e,gitdir:r=O(e,".git"),trees:i,map:n,reduce:s,iterate:a,cache:o={}}){try{C("fs",t),C("gitdir",r),C("trees",i);let l=new J(t),c=await ee({fsp:l,dotgit:r});return await Fs({fs:l,cache:o,dir:e,gitdir:c,trees:i,map:n,reduce:s,iterate:a})}catch(l){throw l.caller="git.walk",l}}async function DA({fs:t,dir:e,gitdir:r=O(e,".git"),blob:i}){try{C("fs",t),C("gitdir",r),C("blob",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await Ar({fs:n,gitdir:s,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}async function LA({fs:t,dir:e,gitdir:r=O(e,".git"),commit:i}){try{C("fs",t),C("gitdir",r),C("commit",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await EA({fs:n,gitdir:s,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}async function BA({fs:t,dir:e,gitdir:r=O(e,".git"),type:i,object:n,format:s="parsed",oid:a,encoding:o=void 0}){try{let l=new J(t),c=await ee({fsp:l,dotgit:r});if(s==="parsed"){switch(i){case"commit":n=kr.from(n).toObject();break;case"tree":n=Er.from(n).toObject();break;case"blob":n=Buffer.from(n,o);break;case"tag":n=Kr.from(n).toObject();break;default:throw new hr(a||"",i,"blob|commit|tag|tree")}s="content"}return a=await Ar({fs:l,gitdir:c,type:i,object:n,oid:a,format:s}),a}catch(l){throw l.caller="git.writeObject",l}}async function NA({fs:t,dir:e,gitdir:r=O(e,".git"),ref:i,value:n,force:s=!1,symbolic:a=!1}){try{C("fs",t),C("gitdir",r),C("ref",i),C("value",n);let o=new J(t);if(!nu(i,!0))throw new Fi(i,Hc.clean(i));let l=await ee({fsp:o,dotgit:r});if(!s&&await W.exists({fs:o,gitdir:l,ref:i}))throw new $i("ref",i);a?await W.writeSymbolicRef({fs:o,gitdir:l,ref:i,value:n}):(n=await W.resolve({fs:o,gitdir:l,ref:n}),await W.writeRef({fs:o,gitdir:l,ref:i,value:n}))}catch(o){throw o.caller="git.writeRef",o}}async function $6({fs:t,gitdir:e,tag:r}){let i=Kr.from(r).toObject();return await Ar({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}async function HA({fs:t,dir:e,gitdir:r=O(e,".git"),tag:i}){try{C("fs",t),C("gitdir",r),C("tag",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await $6({fs:n,gitdir:s,tag:i})}catch(n){throw n.caller="git.writeTag",n}}async function UA({fs:t,dir:e,gitdir:r=O(e,".git"),tree:i}){try{C("fs",t),C("gitdir",r),C("tree",i);let n=new J(t),s=await ee({fsp:n,dotgit:r});return await au({fs:n,gitdir:s,tree:i})}catch(n){throw n.caller="git.writeTree",n}}var F6={Errors:rk,STAGE:Aa,TREE:Zr,WORKDIR:nl,add:ok,abortMerge:nk,addNote:dk,addRemote:pk,annotatedTag:mk,branch:gk,checkout:yv,clone:xk,commit:Sk,getConfig:Bk,getConfigAll:Nk,setConfig:SA,currentBranch:Ek,deleteBranch:kk,deleteRef:Ak,deleteRemote:Tk,deleteTag:Ck,expandOid:Pk,expandRef:Rk,fastForward:Ik,fetch:Ok,findMergeBase:Mk,findRoot:Lk,getRemoteInfo:Hk,getRemoteInfo2:Gk,hashBlob:jk,indexPack:qk,init:zk,isDescendent:Wk,isIgnored:Yk,listBranches:Xk,listFiles:Kk,listNotes:Qk,listRefs:Jk,listRemotes:eA,listServerRefs:tA,listTags:rA,log:nA,merge:sA,packObjects:oA,pull:lA,push:cA,readBlob:dA,readCommit:xv,readNote:hA,readObject:pA,readTag:mA,readTree:gA,remove:vA,removeNote:wA,renameBranch:yA,resetIndex:_A,updateIndex:IA,resolveRef:xA,status:PA,statusMatrix:$A,tag:FA,version:OA,walk:MA,writeBlob:DA,writeCommit:LA,writeObject:BA,writeRef:NA,writeTag:HA,writeTree:UA,stash:CA};X.Errors=rk;X.STAGE=Aa;X.TREE=Zr;X.WORKDIR=nl;X.abortMerge=nk;X.add=ok;X.addNote=dk;X.addRemote=pk;X.annotatedTag=mk;X.branch=gk;X.checkout=yv;X.clone=xk;X.commit=Sk;X.currentBranch=Ek;X.default=F6;X.deleteBranch=kk;X.deleteRef=Ak;X.deleteRemote=Tk;X.deleteTag=Ck;X.expandOid=Pk;X.expandRef=Rk;X.fastForward=Ik;X.fetch=Ok;X.findMergeBase=Mk;X.findRoot=Lk;X.getConfig=Bk;X.getConfigAll=Nk;X.getRemoteInfo=Hk;X.getRemoteInfo2=Gk;X.hashBlob=jk;X.indexPack=qk;X.init=zk;X.isDescendent=Wk;X.isIgnored=Yk;X.listBranches=Xk;X.listFiles=Kk;X.listNotes=Qk;X.listRefs=Jk;X.listRemotes=eA;X.listServerRefs=tA;X.listTags=rA;X.log=nA;X.merge=sA;X.packObjects=oA;X.pull=lA;X.push=cA;X.readBlob=dA;X.readCommit=xv;X.readNote=hA;X.readObject=pA;X.readTag=mA;X.readTree=gA;X.remove=vA;X.removeNote=wA;X.renameBranch=yA;X.resetIndex=_A;X.resolveRef=xA;X.setConfig=SA;X.stash=CA;X.status=PA;X.statusMatrix=$A;X.tag=FA;X.updateIndex=IA;X.version=OA;X.walk=MA;X.writeBlob=DA;X.writeCommit=LA;X.writeObject=BA;X.writeRef=NA;X.writeTag=HA;X.writeTree=UA});var JA=F((UZ,QA)=>{"use strict";p();QA.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var tT=F((jZ,eT)=>{p();var Lv={px:{px:1,cm:37.79527559055118,mm:3.7795275590551185,in:96,pt:1.3333333333333333,pc:16},cm:{px:.026458333333333334,cm:1,mm:.1,in:2.54,pt:.035277777777777776,pc:.42333333333333334},mm:{px:.26458333333333334,cm:10,mm:1,in:25.4,pt:.35277777777777775,pc:4.233333333333333},in:{px:.010416666666666666,cm:.39370078740157477,mm:.03937007874015748,in:1,pt:.013888888888888888,pc:.16666666666666666},pt:{px:.75,cm:28.346456692913385,mm:2.834645669291339,in:72,pt:1,pc:12},pc:{px:.0625,cm:2.3622047244094486,mm:.2362204724409449,in:6,pt:.08333333333333333,pc:1},deg:{deg:1,grad:.9,rad:180/Math.PI,turn:360},grad:{deg:1.1111111111111112,grad:1,rad:200/Math.PI,turn:400},rad:{deg:Math.PI/180,grad:Math.PI/200,rad:1,turn:Math.PI*2},turn:{deg:.002777777777777778,grad:.0025,rad:.5/Math.PI,turn:1},s:{s:1,ms:.001},ms:{s:1e3,ms:1},Hz:{Hz:1,kHz:1e3},kHz:{Hz:.001,kHz:1},dpi:{dpi:1,dpcm:.39370078740157477,dppx:.010416666666666666},dpcm:{dpi:2.54,dpcm:1,dppx:.026458333333333334},dppx:{dpi:96,dpcm:37.79527559055118,dppx:1}};eT.exports=function(t,e,r,i){if(!Lv.hasOwnProperty(r))throw new Error("Cannot convert to "+r);if(!Lv[r].hasOwnProperty(e))throw new Error("Cannot convert from "+e+" to "+r);var n=Lv[r][e]*t;return i!==!1?(i=Math.pow(10,parseInt(i)||5),Math.round(n*i)/i):n}});var mT=F(Vn=>{"use strict";p();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.fromRgba=ul;Vn.fromRgb=Bv;Vn.fromHsla=zd;Vn.fromHsl=hT;Vn.fromString=pT;Vn.default=void 0;var rT=sT(JA()),U6=sT(tT());function sT(t){return t&&t.__esModule?t:{default:t}}function G6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iT(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,i=new Array(e);r-1}function Y6(t,e,r){var i=t/255,n=e/255,s=r/255,a=Math.max(i,n,s),o=Math.min(i,n,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 i:return(n-s)/l%6;case n:return(s-i)/l+2;default:return(i-n)/l+4}}();return[f*60,u*100,c*100]}function X6(t,e,r){var i=t/60,n=e/100,s=r/100,a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(i%2-1)),l=s-a/2,c=function(){return i<1?[a,o,0]:i<2?[o,a,0]:i<3?[0,a,o]:i<4?[0,o,a]:i<5?[o,0,a]:[a,0,o]}(),u=pr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var Z6=function(){function t(e){var r=pr(e,4),i=r[0],n=r[1],s=r[2],a=r[3];G6(this,t),this.values=[Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(s,10),255),0),a==null?1:Math.max(Math.min(parseFloat(a),255),0)]}return j6(t,[{key:"toRgbString",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return a===1?"rgb(".concat(i,", ").concat(n,", ").concat(s,")"):"rgba(".concat(i,", ").concat(n,", ").concat(s,", ").concat(a,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),i=pr(r,4),n=i[0],s=i[1],a=i[2],o=i[3];return o===1?"hsl(".concat(n,", ").concat(s,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(s,"%, ").concat(a,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return i=Number(i).toString(16).padStart(2,"0"),n=Number(n).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(i).concat(n).concat(s).concat(a)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=pr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3],o=Y6(i,n,s),l=pr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,a]}}]),t}();function ul(t){var e=pr(t,4),r=e[0],i=e[1],n=e[2],s=e[3];return new Z6([r,i,n,s])}function Bv(t){var e=pr(t,3),r=e[0],i=e[1],n=e[2];return ul([r,i,n,1])}function zd(t){var e=pr(t,4),r=e[0],i=e[1],n=e[2],s=e[3],a=X6(r,i,n),o=pr(a,3),l=o[0],c=o[1],u=o[2];return ul([l,c,u,s])}function hT(t){var e=pr(t,3),r=e[0],i=e[1],n=e[2];return zd([r,i,n,1])}function K6(t){var e=aT.exec(t)||oT.exec(t),r=pr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=parseInt(i.length<2?i.repeat(2):i,16),n=parseInt(n.length<2?n.repeat(2):n,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,ul([i,n,s,a])}function Q6(t){var e=lT.exec(t)||uT.exec(t)||cT.exec(t)||fT.exec(t),r=pr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=uu(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),n=uu(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),s=uu(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),a=a===void 0?1:parseFloat(a)/(uu(a,"%")?100:1),ul([i,n,s,a])}function J6(t){var e=dT.exec(t),r=pr(e,6),i=r[1],n=r[2],s=r[3],a=r[4],o=r[5];return n=n||"deg",i=(0,U6.default)(parseFloat(i),n,"deg"),s=parseFloat(s),a=parseFloat(a),o=o===void 0?1:parseFloat(o)/(uu(o,"%")?100:1),zd([i,s,a,o])}function pT(t){return rT.default[t]?Bv(rT.default[t]):aT.test(t)||oT.test(t)?K6(t):lT.test(t)||uT.test(t)||cT.test(t)||fT.test(t)?Q6(t):dT.test(t)?J6(t):null}var e5={fromString:pT,fromRgb:Bv,fromRgba:ul,fromHsl:hT,fromHsla:zd};Vn.default=e5});var Nv=F((WZ,vT)=>{"use strict";p();var gT=Object.prototype.toString;vT.exports=function(e){var r=gT.call(e),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&gT.call(e.callee)==="[object Function]"),i}});var AT=F((XZ,kT)=>{"use strict";p();var ET;Object.keys||(fu=Object.prototype.hasOwnProperty,Hv=Object.prototype.toString,wT=Nv(),Uv=Object.prototype.propertyIsEnumerable,yT=!Uv.call({toString:null},"toString"),bT=Uv.call(function(){},"prototype"),du=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Vd=function(t){var e=t.constructor;return e&&e.prototype===t},_T={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},xT=function(){if(typeof window=="undefined")return!1;for(var t in window)try{if(!_T["$"+t]&&fu.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Vd(window[t])}catch(e){return!0}}catch(e){return!0}return!1}(),ST=function(t){if(typeof window=="undefined"||!xT)return Vd(t);try{return Vd(t)}catch(e){return!1}},ET=function(e){var r=e!==null&&typeof e=="object",i=Hv.call(e)==="[object Function]",n=wT(e),s=r&&Hv.call(e)==="[object String]",a=[];if(!r&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var o=bT&&i;if(s&&e.length>0&&!fu.call(e,0))for(var l=0;l0)for(var c=0;c{"use strict";p();var t5=Array.prototype.slice,r5=Nv(),TT=Object.keys,Wd=TT?function(e){return TT(e)}:AT(),CT=Object.keys;Wd.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(i){return r5(i)?CT(t5.call(i)):CT(i)})}else Object.keys=Wd;return Object.keys||Wd};PT.exports=Wd});var Ns=F((JZ,IT)=>{"use strict";p();var i5=Yd(),n5=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",s5=Object.prototype.toString,a5=Array.prototype.concat,RT=Wf(),o5=function(t){return typeof t=="function"&&s5.call(t)==="[object Function]"},$T=Yf()(),l5=function(t,e,r,i){if(e in t){if(i===!0){if(t[e]===r)return}else if(!o5(i)||!i())return}$T?RT(t,e,r,!0):RT(t,e,r)},FT=function(t,e){var r=arguments.length>2?arguments[2]:{},i=i5(e);n5&&(i=a5.call(i,Object.getOwnPropertySymbols(e)));for(var n=0;n{"use strict";p();var c5=Yd(),MT=vc()(),DT=Bt(),Xd=If(),u5=DT("Array.prototype.push"),OT=DT("Object.prototype.propertyIsEnumerable"),f5=MT?Xd.getOwnPropertySymbols:null;LT.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var i=Xd(e);if(arguments.length===1)return i;for(var n=1;n{"use strict";p();var jv=Gv(),d5=function(){if(!Object.assign)return!1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},i=0;i{"use strict";p();var p5=Ns(),m5=qv();NT.exports=function(){var e=m5();return p5(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e}});var qT=F((oK,jT)=>{"use strict";p();var g5=Ns(),v5=fa(),w5=Gv(),UT=qv(),y5=HT(),b5=v5.apply(UT()),GT=function(e,r){return b5(Object,arguments)};g5(GT,{getPolyfill:UT,implementation:w5,shim:y5});jT.exports=GT});var zv=F((cK,WT)=>{"use strict";p();var zT=tn(),VT=fa(),_5=VT(zT("String.prototype.indexOf"));WT.exports=function(e,r){var i=zT(e,!!r);return typeof i=="function"&&_5(e,".prototype.")>-1?VT(i):i}});var XT=F((fK,YT)=>{"use strict";p();var pu=function(){return typeof function(){}.name=="string"},hu=Object.getOwnPropertyDescriptor;if(hu)try{hu([],"length")}catch(t){hu=null}pu.functionsHaveConfigurableNames=function(){if(!pu()||!hu)return!1;var e=hu(function(){},"name");return!!e&&!!e.configurable};var x5=Function.prototype.bind;pu.boundFunctionsHaveNames=function(){return pu()&&typeof x5=="function"&&function(){}.bind().name!==""};YT.exports=pu});var QT=F((hK,KT)=>{"use strict";p();var ZT=Wf(),S5=Yf()(),E5=XT().functionsHaveConfigurableNames(),k5=_r();KT.exports=function(e,r){if(typeof e!="function")throw new k5("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||E5)&&(S5?ZT(e,"name",r,!0,!0):ZT(e,"name",r)),e}});var Vv=F((mK,JT)=>{"use strict";p();var A5=QT(),T5=_r(),C5=Object;JT.exports=A5(function(){if(this==null||this!==C5(this))throw new T5("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0)});var Wv=F((vK,eC)=>{"use strict";p();var P5=Vv(),R5=Ns().supportsDescriptors,$5=Object.getOwnPropertyDescriptor;eC.exports=function(){if(R5&&/a/mig.flags==="gim"){var e=$5(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var r="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){r+="d"}}),Object.defineProperty(i,"sticky",{get:function(){r+="y"}}),e.get.call(i),r==="dy")return e.get}}return P5}});var iC=F((yK,rC)=>{"use strict";p();var F5=Ns().supportsDescriptors,I5=Wv(),O5=ys(),M5=Object.defineProperty,D5=Gm(),tC=Uf(),L5=/a/;rC.exports=function(){if(!F5||!tC)throw new D5("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=I5(),r=tC(L5),i=O5(r,"flags");return(!i||i.get!==e)&&M5(r,"flags",{configurable:!0,enumerable:!1,get:e}),e}});var oC=F((_K,aC)=>{"use strict";p();var B5=Ns(),N5=fa(),H5=Vv(),nC=Wv(),U5=iC(),sC=N5(nC());B5(sC,{getPolyfill:nC,implementation:H5,shim:U5});aC.exports=sC});var Xv=F((SK,cC)=>{"use strict";p();var G5=bs()(),j5=Bt(),Yv=j5("Object.prototype.toString"),Zd=function(e){return G5&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Yv(e)==="[object Arguments]"},lC=function(e){return Zd(e)?!0:e!==null&&typeof e=="object"&&"length"in e&&typeof e.length=="number"&&e.length>=0&&Yv(e)!=="[object Array]"&&"callee"in e&&Yv(e.callee)==="[object Function]"},q5=function(){return Zd(arguments)}();Zd.isLegacyArguments=lC;cC.exports=q5?Zd:lC});var uC=F(()=>{p()});var yu=F((CK,RC)=>{p();var sw=typeof Map=="function"&&Map.prototype,Zv=Object.getOwnPropertyDescriptor&&sw?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qd=sw&&Zv&&typeof Zv.get=="function"?Zv.get:null,fC=sw&&Map.prototype.forEach,aw=typeof Set=="function"&&Set.prototype,Kv=Object.getOwnPropertyDescriptor&&aw?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Jd=aw&&Kv&&typeof Kv.get=="function"?Kv.get:null,dC=aw&&Set.prototype.forEach,z5=typeof WeakMap=="function"&&WeakMap.prototype,gu=z5?WeakMap.prototype.has:null,V5=typeof WeakSet=="function"&&WeakSet.prototype,vu=V5?WeakSet.prototype.has:null,W5=typeof WeakRef=="function"&&WeakRef.prototype,hC=W5?WeakRef.prototype.deref:null,Y5=Boolean.prototype.valueOf,X5=Object.prototype.toString,Z5=Function.prototype.toString,K5=String.prototype.match,ow=String.prototype.slice,Hs=String.prototype.replace,Q5=String.prototype.toUpperCase,pC=String.prototype.toLowerCase,SC=RegExp.prototype.test,mC=Array.prototype.concat,fn=Array.prototype.join,J5=Array.prototype.slice,gC=Math.floor,ew=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Qv=Object.getOwnPropertySymbols,tw=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,fl=typeof Symbol=="function"&&typeof Symbol.iterator=="object",wu=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===fl||!0)?Symbol.toStringTag:null,EC=Object.prototype.propertyIsEnumerable,vC=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function wC(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||SC.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-gC(-t):gC(t);if(i!==t){var n=String(i),s=ow.call(e,n.length+1);return Hs.call(n,r,"$&_")+"."+Hs.call(Hs.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Hs.call(e,r,"$&_")}var rw=uC(),yC=rw.custom,bC=TC(yC)?yC:null,kC={__proto__:null,double:'"',single:"'"},e4={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};RC.exports=function t(e,r,i,n){var s=r||{};if(Wn(s,"quoteStyle")&&!Wn(kC,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Wn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Wn(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Wn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Wn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=s.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return PC(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return o?wC(e,l):l}if(typeof e=="bigint"){var c=String(e)+"n";return o?wC(e,c):c}var u=typeof s.depth=="undefined"?5:s.depth;if(typeof i=="undefined"&&(i=0),i>=u&&u>0&&typeof e=="object")return iw(e)?"[Array]":"[Object]";var f=w4(s,i);if(typeof n=="undefined")n=[];else if(CC(n,e)>=0)return"[Circular]";function d(B,N,ce){if(N&&(n=J5.call(n),n.push(N)),ce){var Pe={depth:s.depth};return Wn(s,"quoteStyle")&&(Pe.quoteStyle=s.quoteStyle),t(B,Pe,i+1,n)}return t(B,s,i+1,n)}if(typeof e=="function"&&!_C(e)){var h=c4(e),m=Kd(e,d);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(m.length>0?" { "+fn.call(m,", ")+" }":"")}if(TC(e)){var g=fl?Hs.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):tw.call(e);return typeof e=="object"&&!fl?mu(g):g}if(m4(e)){for(var v="<"+pC.call(String(e.nodeName)),w=e.attributes||[],b=0;b",v}if(iw(e)){if(e.length===0)return"[]";var k=Kd(e,d);return f&&!v4(k)?"["+nw(k,f)+"]":"[ "+fn.call(k,", ")+" ]"}if(i4(e)){var x=Kd(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!EC.call(e,"cause")?"{ ["+String(e)+"] "+fn.call(mC.call("[cause]: "+d(e.cause),x),", ")+" }":x.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+fn.call(x,", ")+" }"}if(typeof e=="object"&&a){if(bC&&typeof e[bC]=="function"&&rw)return rw(e,{depth:u-i});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(u4(e)){var E=[];return fC&&fC.call(e,function(B,N){E.push(d(N,e,!0)+" => "+d(B,e))}),xC("Map",Qd.call(e),E,f)}if(h4(e)){var A=[];return dC&&dC.call(e,function(B){A.push(d(B,e))}),xC("Set",Jd.call(e),A,f)}if(f4(e))return Jv("WeakMap");if(p4(e))return Jv("WeakSet");if(d4(e))return Jv("WeakRef");if(s4(e))return mu(d(Number(e)));if(o4(e))return mu(d(ew.call(e)));if(a4(e))return mu(Y5.call(e));if(n4(e))return mu(d(String(e)));if(typeof window!="undefined"&&e===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&e===globalThis||typeof global!="undefined"&&e===global)return"{ [object globalThis] }";if(!r4(e)&&!_C(e)){var y=Kd(e,d),S=vC?vC(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",T=!S&&wu&&Object(e)===e&&wu in e?ow.call(Us(e),8,-1):_?"Object":"",P=S||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",D=P+(T||_?"["+fn.call(mC.call([],T||[],_||[]),": ")+"] ":"");return y.length===0?D+"{}":f?D+"{"+nw(y,f)+"}":D+"{ "+fn.call(y,", ")+" }"}return String(e)};function AC(t,e,r){var i=r.quoteStyle||e,n=kC[i];return n+t+n}function t4(t){return Hs.call(String(t),/"/g,""")}function Ca(t){return!wu||!(typeof t=="object"&&(wu in t||typeof t[wu]!="undefined"))}function iw(t){return Us(t)==="[object Array]"&&Ca(t)}function r4(t){return Us(t)==="[object Date]"&&Ca(t)}function _C(t){return Us(t)==="[object RegExp]"&&Ca(t)}function i4(t){return Us(t)==="[object Error]"&&Ca(t)}function n4(t){return Us(t)==="[object String]"&&Ca(t)}function s4(t){return Us(t)==="[object Number]"&&Ca(t)}function a4(t){return Us(t)==="[object Boolean]"&&Ca(t)}function TC(t){if(fl)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!tw)return!1;try{return tw.call(t),!0}catch(e){}return!1}function o4(t){if(!t||typeof t!="object"||!ew)return!1;try{return ew.call(t),!0}catch(e){}return!1}var l4=Object.prototype.hasOwnProperty||function(t){return t in this};function Wn(t,e){return l4.call(t,e)}function Us(t){return X5.call(t)}function c4(t){if(t.name)return t.name;var e=K5.call(Z5.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function CC(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return PC(ow.call(t,0,e.maxStringLength),e)+i}var n=e4[e.quoteStyle||"single"];n.lastIndex=0;var s=Hs.call(Hs.call(t,n,"\\$1"),/[\x00-\x1f]/g,g4);return AC(s,"single",e)}function g4(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Q5.call(e.toString(16))}function mu(t){return"Object("+t+")"}function Jv(t){return t+" { ? }"}function xC(t,e,r,i){var n=i?nw(r,i):fn.call(r,", ");return t+" ("+e+") {"+n+"}"}function v4(t){for(var e=0;e=0)return!1;return!0}function w4(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=fn.call(Array(t.indent+1)," ");else return null;return{base:r,prev:fn.call(Array(e+1),r)}}function nw(t,e){if(t.length===0)return"";var r=` +`+e.prev+e.base;return r+fn.call(t,","+r)+` +`+e.prev}function Kd(t,e){var r=iw(t),i=[];if(r){i.length=t.length;for(var n=0;n{"use strict";p();var y4=yu(),b4=_r(),eh=function(t,e,r){for(var i=t,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,r||(n.next=t.next,t.next=n),n},_4=function(t,e){if(t){var r=eh(t,e);return r&&r.value}},x4=function(t,e,r){var i=eh(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},S4=function(t,e){return t?!!eh(t,e):!1},E4=function(t,e){if(t)return eh(t,e,!0)};$C.exports=function(){var e,r={assert:function(i){if(!r.has(i))throw new b4("Side channel does not contain "+y4(i))},delete:function(i){var n=e&&e.next,s=E4(e,i);return s&&n&&n===s&&(e=void 0),!!s},get:function(i){return _4(e,i)},has:function(i){return S4(e,i)},set:function(i,n){e||(e={next:void 0}),x4(e,i,n)}};return r}});var lw=F((FK,OC)=>{"use strict";p();var k4=tn(),bu=Bt(),A4=yu(),T4=_r(),IC=k4("%Map%",!0),C4=bu("Map.prototype.get",!0),P4=bu("Map.prototype.set",!0),R4=bu("Map.prototype.has",!0),$4=bu("Map.prototype.delete",!0),F4=bu("Map.prototype.size",!0);OC.exports=!!IC&&function(){var e,r={assert:function(i){if(!r.has(i))throw new T4("Side channel does not contain "+A4(i))},delete:function(i){if(e){var n=$4(e,i);return F4(e)===0&&(e=void 0),n}return!1},get:function(i){if(e)return C4(e,i)},has:function(i){return e?R4(e,i):!1},set:function(i,n){e||(e=new IC),P4(e,i,n)}};return r}});var DC=F((OK,MC)=>{"use strict";p();var I4=tn(),rh=Bt(),O4=yu(),th=lw(),M4=_r(),dl=I4("%WeakMap%",!0),D4=rh("WeakMap.prototype.get",!0),L4=rh("WeakMap.prototype.set",!0),B4=rh("WeakMap.prototype.has",!0),N4=rh("WeakMap.prototype.delete",!0);MC.exports=dl?function(){var e,r,i={assert:function(n){if(!i.has(n))throw new M4("Side channel does not contain "+O4(n))},delete:function(n){if(dl&&n&&(typeof n=="object"||typeof n=="function")){if(e)return N4(e,n)}else if(th&&r)return r.delete(n);return!1},get:function(n){return dl&&n&&(typeof n=="object"||typeof n=="function")&&e?D4(e,n):r&&r.get(n)},has:function(n){return dl&&n&&(typeof n=="object"||typeof n=="function")&&e?B4(e,n):!!r&&r.has(n)},set:function(n,s){dl&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new dl),L4(e,n,s)):th&&(r||(r=th()),r.set(n,s))}};return i}:th});var cw=F((DK,LC)=>{"use strict";p();var H4=_r(),U4=yu(),G4=FC(),j4=lw(),q4=DC(),z4=q4||j4||G4;LC.exports=function(){var e,r={assert:function(i){if(!r.has(i))throw new H4("Side channel does not contain "+U4(i))},delete:function(i){return!!e&&e.delete(i)},get:function(i){return e&&e.get(i)},has:function(i){return!!e&&e.has(i)},set:function(i,n){e||(e=z4()),e.set(i,n)}};return r}});var NC=F((BK,BC)=>{"use strict";p();var V4=Gf(),_u=cw()(),Yn=_r(),uw={assert:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");if(_u.assert(t),!uw.has(t,e))throw new Yn("`"+e+"` is not present on `O`")},get:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var r=_u.get(t);return r&&r["$"+e]},has:function(t,e){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var r=_u.get(t);return!!r&&V4(r,"$"+e)},set:function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Yn("`O` is not an object");if(typeof e!="string")throw new Yn("`slot` must be a string");var i=_u.get(t);i||(i={},_u.set(t,i)),i["$"+e]=r}};Object.freeze&&Object.freeze(uw);BC.exports=uw});var GC=F((HK,UC)=>{"use strict";p();var xu=NC(),W4=Of(),HC=typeof StopIteration=="object"?StopIteration:null;UC.exports=function(e){if(!HC)throw new W4("this environment lacks StopIteration");xu.set(e,"[[Done]]",!1);var r={next:function(){var n=xu.get(this,"[[Iterator]]"),s=!!xu.get(n,"[[Done]]");try{return{done:s,value:s?void 0:n.next()}}catch(a){if(xu.set(n,"[[Done]]",!0),a!==HC)throw a;return{done:!0,value:void 0}}}};return xu.set(r,"[[Iterator]]",e),r}});var fw=F((GK,qC)=>{"use strict";p();var jC=Bt(),Y4=jC("String.prototype.valueOf"),X4=function(e){try{return Y4(e),!0}catch(r){return!1}},Z4=jC("Object.prototype.toString"),K4="[object String]",Q4=bs()();qC.exports=function(e){return typeof e=="string"?!0:!e||typeof e!="object"?!1:Q4?X4(e):Z4(e)===K4}});var hw=F((qK,WC)=>{"use strict";p();var dw=typeof Map=="function"&&Map.prototype?Map:null,J4=typeof Set=="function"&&Set.prototype?Set:null,ih;dw||(ih=function(e){return!1});var VC=dw?Map.prototype.has:null,zC=J4?Set.prototype.has:null;!ih&&!VC&&(ih=function(e){return!1});WC.exports=ih||function(e){if(!e||typeof e!="object")return!1;try{if(VC.call(e),zC)try{zC.call(e)}catch(r){return!0}return e instanceof dw}catch(r){}return!1}});var mw=F((VK,ZC)=>{"use strict";p();var eU=typeof Map=="function"&&Map.prototype?Map:null,pw=typeof Set=="function"&&Set.prototype?Set:null,nh;pw||(nh=function(e){return!1});var YC=eU?Map.prototype.has:null,XC=pw?Set.prototype.has:null;!nh&&!XC&&(nh=function(e){return!1});ZC.exports=nh||function(e){if(!e||typeof e!="object")return!1;try{if(XC.call(e),YC)try{YC.call(e)}catch(r){return!0}return e instanceof pw}catch(r){}return!1}});var l2=F((YK,oh)=>{"use strict";p();var KC=Xv(),QC=GC();Lf()()||vc()()?(sh=Symbol.iterator,oh.exports=function(e){if(e!=null&&typeof e[sh]!="undefined")return e[sh]();if(KC(e))return Array.prototype[sh].call(e)}):(JC=Ff(),e2=fw(),gw=tn(),t2=gw("%Map%",!0),r2=gw("%Set%",!0),vi=zv(),vw=vi("Array.prototype.push"),ww=vi("String.prototype.charCodeAt"),i2=vi("String.prototype.slice"),n2=function(e,r){var i=e.length;if(r+1>=i)return r+1;var n=ww(e,r);if(n<55296||n>56319)return r+1;var s=ww(e,r+1);return s<56320||s>57343?r+1:r+2},ah=function(e){var r=0;return{next:function(){var n=r>=e.length,s;return n||(s=e[r],r+=1),{done:n,value:s}}}},yw=function(e,r){if(JC(e)||KC(e))return ah(e);if(e2(e)){var i=0;return{next:function(){var s=n2(e,i),a=i2(e,i,s);return i=s,{done:s>e.length,value:a}}}}if(r&&typeof e["_es6-shim iterator_"]!="undefined")return e["_es6-shim iterator_"]()},!t2&&!r2?oh.exports=function(e){if(e!=null)return yw(e,!0)}:(s2=hw(),a2=mw(),bw=vi("Map.prototype.forEach",!0),_w=vi("Set.prototype.forEach",!0),(typeof process=="undefined"||!process.versions||!process.versions.node)&&(xw=vi("Map.prototype.iterator",!0),Sw=vi("Set.prototype.iterator",!0)),Ew=vi("Map.prototype.@@iterator",!0)||vi("Map.prototype._es6-shim iterator_",!0),kw=vi("Set.prototype.@@iterator",!0)||vi("Set.prototype._es6-shim iterator_",!0),o2=function(e){if(s2(e)){if(xw)return QC(xw(e));if(Ew)return Ew(e);if(bw){var r=[];return bw(e,function(n,s){vw(r,[s,n])}),ah(r)}}if(a2(e)){if(Sw)return QC(Sw(e));if(kw)return kw(e);if(_w){var i=[];return _w(e,function(n){vw(i,n)}),ah(i)}}},oh.exports=function(e){return o2(e)||yw(e)}));var sh,JC,e2,gw,t2,r2,vi,vw,ww,i2,n2,ah,yw,s2,a2,bw,_w,xw,Sw,Ew,kw,o2});var Aw=F((ZK,u2)=>{"use strict";p();var c2=function(t){return t!==t};u2.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||c2(e)&&c2(r))}});var Tw=F((QK,f2)=>{"use strict";p();var tU=Aw();f2.exports=function(){return typeof Object.is=="function"?Object.is:tU}});var h2=F((eQ,d2)=>{"use strict";p();var rU=Tw(),iU=Ns();d2.exports=function(){var e=rU();return iU(Object,{is:e},{is:function(){return Object.is!==e}}),e}});var v2=F((rQ,g2)=>{"use strict";p();var nU=Ns(),sU=fa(),aU=Aw(),p2=Tw(),oU=h2(),m2=sU(p2(),Object);nU(m2,{getPolyfill:p2,implementation:aU,shim:oU});g2.exports=m2});var Pw=F((nQ,_2)=>{"use strict";p();var lU=fa(),b2=Bt(),cU=tn(),Cw=cU("%ArrayBuffer%",!0),lh=b2("ArrayBuffer.prototype.byteLength",!0),uU=b2("Object.prototype.toString"),w2=!!Cw&&!lh&&new Cw(0).slice,y2=!!w2&&lU(w2);_2.exports=lh||y2?function(e){if(!e||typeof e!="object")return!1;try{return lh?lh(e):y2(e,0),!0}catch(r){return!1}}:Cw?function(e){return uU(e)==="[object ArrayBuffer]"}:function(e){return!1}});var E2=F((aQ,S2)=>{"use strict";p();var x2=Bt(),fU=x2("Date.prototype.getDay"),dU=function(e){try{return fU(e),!0}catch(r){return!1}},hU=x2("Object.prototype.toString"),pU="[object Date]",mU=bs()();S2.exports=function(e){return typeof e!="object"||e===null?!1:mU?dU(e):hU(e)===pU}});var Iw=F((lQ,P2)=>{"use strict";p();var k2=Bt(),gU=bs()(),vU=Gf(),wU=ys(),Fw;gU?(A2=k2("RegExp.prototype.exec"),Rw={},ch=function(){throw Rw},$w={toString:ch,valueOf:ch},typeof Symbol.toPrimitive=="symbol"&&($w[Symbol.toPrimitive]=ch),Fw=function(e){if(!e||typeof e!="object")return!1;var r=wU(e,"lastIndex"),i=r&&vU(r,"value");if(!i)return!1;try{A2(e,$w)}catch(n){return n===Rw}}):(T2=k2("Object.prototype.toString"),C2="[object RegExp]",Fw=function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:T2(e)===C2});var A2,Rw,ch,$w,T2,C2;P2.exports=Fw});var F2=F((uQ,$2)=>{"use strict";p();var yU=Bt(),R2=yU("SharedArrayBuffer.prototype.byteLength",!0);$2.exports=R2?function(e){if(!e||typeof e!="object")return!1;try{return R2(e),!0}catch(r){return!1}}:function(e){return!1}});var M2=F((dQ,O2)=>{"use strict";p();var I2=Bt(),bU=I2("Number.prototype.toString"),_U=function(e){try{return bU(e),!0}catch(r){return!1}},xU=I2("Object.prototype.toString"),SU="[object Number]",EU=bs()();O2.exports=function(e){return typeof e=="number"?!0:!e||typeof e!="object"?!1:EU?_U(e):xU(e)===SU}});var B2=F((pQ,L2)=>{"use strict";p();var D2=Bt(),kU=D2("Boolean.prototype.toString"),AU=D2("Object.prototype.toString"),TU=function(e){try{return kU(e),!0}catch(r){return!1}},CU="[object Boolean]",PU=bs()();L2.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:PU?TU(e):AU(e)===CU}});var H2=F((gQ,N2)=>{"use strict";p();var RU=Bt(),$U=Iw(),FU=RU("RegExp.prototype.exec"),IU=_r();N2.exports=function(e){if(!$U(e))throw new IU("`regex` must be a RegExp");return function(i){return FU(e,i)!==null}}});var z2=F((wQ,Ow)=>{"use strict";p();var q2=Bt(),OU=q2("Object.prototype.toString"),MU=Lf()(),DU=H2();MU?(U2=q2("Symbol.prototype.toString"),G2=DU(/^Symbol\(.*\)$/),j2=function(e){return typeof e.valueOf()!="symbol"?!1:G2(U2(e))},Ow.exports=function(e){if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||OU(e)!=="[object Symbol]")return!1;try{return j2(e)}catch(r){return!1}}):Ow.exports=function(e){return!1};var U2,G2,j2});var Y2=F((bQ,W2)=>{"use strict";p();var V2=typeof BigInt!="undefined"&&BigInt;W2.exports=function(){return typeof V2=="function"&&typeof BigInt=="function"&&typeof V2(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var K2=F((xQ,Mw)=>{"use strict";p();var LU=Y2()();LU?(X2=BigInt.prototype.valueOf,Z2=function(e){try{return X2.call(e),!0}catch(r){}return!1},Mw.exports=function(e){return e===null||typeof e=="undefined"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:Z2(e)}):Mw.exports=function(e){return!1};var X2,Z2});var J2=F((EQ,Q2)=>{"use strict";p();var BU=fw(),NU=M2(),HU=B2(),UU=z2(),GU=K2();Q2.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(BU(e))return"String";if(NU(e))return"Number";if(HU(e))return"Boolean";if(UU(e))return"Symbol";if(GU(e))return"BigInt"}});var rP=F((AQ,tP)=>{"use strict";p();var uh=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,eP=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,fh;uh||(fh=function(e){return!1});var Lw=uh?uh.prototype.has:null,Dw=eP?eP.prototype.has:null;!fh&&!Lw&&(fh=function(e){return!1});tP.exports=fh||function(e){if(!e||typeof e!="object")return!1;try{if(Lw.call(e,Lw),Dw)try{Dw.call(e,Dw)}catch(r){return!0}return e instanceof uh}catch(r){}return!1}});var nP=F((CQ,Nw)=>{"use strict";p();var jU=tn(),iP=Bt(),qU=jU("%WeakSet%",!0),Bw=iP("WeakSet.prototype.has",!0);Bw?(dh=iP("WeakMap.prototype.has",!0),Nw.exports=function(e){if(!e||typeof e!="object")return!1;try{if(Bw(e,Bw),dh)try{dh(e,dh)}catch(r){return!0}return e instanceof qU}catch(r){}return!1}):Nw.exports=function(e){return!1};var dh});var aP=F((RQ,sP)=>{"use strict";p();var zU=hw(),VU=mw(),WU=rP(),YU=nP();sP.exports=function(e){if(e&&typeof e=="object"){if(zU(e))return"Map";if(VU(e))return"Set";if(WU(e))return"WeakMap";if(YU(e))return"WeakSet"}return!1}});var cP=F((FQ,lP)=>{"use strict";p();var XU=Bt(),oP=XU("ArrayBuffer.prototype.byteLength",!0),ZU=Pw();lP.exports=function(e){return ZU(e)?oP?oP(e):e.byteLength:NaN}});var OP=F((OQ,IP)=>{"use strict";p();var RP=qT(),dn=zv(),uP=oC(),KU=tn(),hl=l2(),QU=cw(),fP=v2(),dP=Xv(),hP=Ff(),pP=Pw(),mP=E2(),gP=Iw(),vP=F2(),wP=Yd(),yP=J2(),bP=aP(),_P=ng(),xP=cP(),SP=dn("SharedArrayBuffer.prototype.byteLength",!0),EP=dn("Date.prototype.getTime"),Hw=Object.getPrototypeOf,kP=dn("Object.prototype.toString"),ph=KU("%Set%",!0),Uw=dn("Map.prototype.has",!0),mh=dn("Map.prototype.get",!0),AP=dn("Map.prototype.size",!0),gh=dn("Set.prototype.add",!0),$P=dn("Set.prototype.delete",!0),vh=dn("Set.prototype.has",!0),hh=dn("Set.prototype.size",!0);function TP(t,e,r,i){for(var n=hl(t),s;(s=n.next())&&!s.done;)if(Oi(e,s.value,r,i))return $P(t,s.value),!0;return!1}function FP(t){if(typeof t=="undefined")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function JU(t,e,r,i,n,s){var a=FP(r);if(a!=null)return a;var o=mh(e,a),l=RP({},n,{strict:!1});return typeof o=="undefined"&&!Uw(e,a)||!Oi(i,o,l,s)?!1:!Uw(t,a)&&Oi(i,o,l,s)}function eG(t,e,r){var i=FP(r);return i!=null?i:vh(e,i)&&!vh(t,i)}function CP(t,e,r,i,n,s){for(var a=hl(t),o,l;(o=a.next())&&!o.done;)if(l=o.value,Oi(r,l,n,s)&&Oi(i,mh(e,l),n,s))return $P(t,l),!0;return!1}function Oi(t,e,r,i){var n=r||{};if(n.strict?fP(t,e):t===e)return!0;var s=yP(t),a=yP(e);if(s!==a)return!1;if(!t||!e||typeof t!="object"&&typeof e!="object")return n.strict?fP(t,e):t==e;var o=i.has(t),l=i.has(e),c;if(o&&l){if(i.get(t)===i.get(e))return!0}else c={};return o||i.set(t,c),l||i.set(e,c),iG(t,e,n,i)}function PP(t){return!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function tG(t,e,r,i){if(hh(t)!==hh(e))return!1;for(var n=hl(t),s=hl(e),a,o,l;(a=n.next())&&!a.done;)if(a.value&&typeof a.value=="object")l||(l=new ph),gh(l,a.value);else if(!vh(e,a.value)){if(r.strict||!eG(t,e,a.value))return!1;l||(l=new ph),gh(l,a.value)}if(l){for(;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object"){if(!TP(l,o.value,r.strict,i))return!1}else if(!r.strict&&!vh(t,o.value)&&!TP(l,o.value,r.strict,i))return!1;return hh(l)===0}return!0}function rG(t,e,r,i){if(AP(t)!==AP(e))return!1;for(var n=hl(t),s=hl(e),a,o,l,c,u,f;(a=n.next())&&!a.done;)if(c=a.value[0],u=a.value[1],c&&typeof c=="object")l||(l=new ph),gh(l,c);else if(f=mh(e,c),typeof f=="undefined"&&!Uw(e,c)||!Oi(u,f,r,i)){if(r.strict||!JU(t,e,c,u,r,i))return!1;l||(l=new ph),gh(l,c)}if(l){for(;(o=s.next())&&!o.done;)if(c=o.value[0],f=o.value[1],c&&typeof c=="object"){if(!CP(l,t,c,f,r,i))return!1}else if(!r.strict&&(!t.has(c)||!Oi(mh(t,c),f,r,i))&&!CP(l,t,c,f,RP({},r,{strict:!1}),i))return!1;return hh(l)===0}return!0}function iG(t,e,r,i){var n,s;if(typeof t!=typeof e||t==null||e==null||kP(t)!==kP(e)||dP(t)!==dP(e))return!1;var a=hP(t),o=hP(e);if(a!==o)return!1;var l=t instanceof Error,c=e instanceof Error;if(l!==c||(l||c)&&(t.name!==e.name||t.message!==e.message))return!1;var u=gP(t),f=gP(e);if(u!==f||(u||f)&&(t.source!==e.source||uP(t)!==uP(e)))return!1;var d=mP(t),h=mP(e);if(d!==h||(d||h)&&EP(t)!==EP(e)||r.strict&&Hw&&Hw(t)!==Hw(e))return!1;var m=_P(t),g=_P(e);if(m!==g)return!1;if(m||g){if(t.length!==e.length)return!1;for(n=0;n=0;n--)if(A[n]!=y[n])return!1;for(n=A.length-1;n>=0;n--)if(s=A[n],!Oi(t[s],e[s],r,i))return!1;var S=bP(t),_=bP(e);return S!==_?!1:S==="Set"||_==="Set"?tG(t,e,r,i):S==="Map"?rG(t,e,r,i):!0}IP.exports=function(e,r,i){return Oi(e,r,i,QU())}});var YP=F((jQ,WP)=>{p();WP.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=n+1,l=[],c=[],u,f,d=function(){n>=s&&(u=r,f=n,r=i,i=u,n=s,s=f,a=!0,o=n+1)},h=function(g,v,w,b,k){return{startX:g,startY:v,endX:w,endY:b,r:k}},m=function(g,v,w){var b,k,x,E,A;for(v>w?b=l[g-1+o]:b=l[g+1+o],A=x=Math.max(v,w),E=k=x-g;k=g+1;--E)w[E+o]=m(E,w[E-1+o]+1,w[E+1+o]);w[g+o]=m(g,w[g-1+o]+1,w[g+1+o])}while(w[g+o]!==s);for(ed=g+2*b,k=l[g+o],A=n,y=s,S=[];k!==-1;){let _=c[k];(n!=_.endX||s!=_.endY)&&S.push({file1:[a?_.endY:_.endX,a?y-_.endY:A-_.endX],file2:[a?_.endX:_.endY,a?A-_.endX:y-_.endY]}),A=_.startX,y=_.startY,k=c[k].r}return(A!=0||y!=0)&&S.push({file1:[0,a?y:A],file2:[0,a?A:y]}),S.reverse(),S}}}});var KP=F((zQ,ZP)=>{p();var XP=YP();function sG(t,e,r){var i,n=new XP(e,t).compose(),s=new XP(e,r).compose(),a=[];function o(B,N){a.push([B.file1[0],N,B.file1[1],B.file2[0],B.file2[1]])}for(i=0;ic&&(l.push([1,c,B-c]),c=B)}for(var f=0;fg)break;g=Math.max(g,w+v[2]),f++}if(u(m),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var k=h[1],x=b[k],E=h[0],A=E+h[2],y=h[3],S=y+h[4];x[0]=Math.min(y,x[0]),x[1]=Math.max(S,x[1]),x[2]=Math.min(E,x[2]),x[3]=Math.max(A,x[3])}var _=b[0][0]+(m-b[0][2]),T=b[0][1]+(g-b[0][3]),P=b[2][0]+(m-b[2][2]),D=b[2][1]+(g-b[2][3]);l.push([-1,_,T-_,m,g-m,P,D-P])}c=g}return u(e.length),l}function aG(t,e,r){var i=[],n=[t,e,r],s=sG(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var m=0;m{p();var wl=1e3,yl=wl*60,bl=yl*60,Ra=bl*24,cG=Ra*7,uG=Ra*365.25;JP.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return fG(t);if(r==="number"&&isFinite(t))return e.long?hG(t):dG(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function fG(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*uG;case"weeks":case"week":case"w":return r*cG;case"days":case"day":case"d":return r*Ra;case"hours":case"hour":case"hrs":case"hr":case"h":return r*bl;case"minutes":case"minute":case"mins":case"min":case"m":return r*yl;case"seconds":case"second":case"secs":case"sec":case"s":return r*wl;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function dG(t){var e=Math.abs(t);return e>=Ra?Math.round(t/Ra)+"d":e>=bl?Math.round(t/bl)+"h":e>=yl?Math.round(t/yl)+"m":e>=wl?Math.round(t/wl)+"s":t+"ms"}function hG(t){var e=Math.abs(t);return e>=Ra?_h(t,e,Ra,"day"):e>=bl?_h(t,e,bl,"hour"):e>=yl?_h(t,e,yl,"minute"):e>=wl?_h(t,e,wl,"second"):t+" ms"}function _h(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var rR=F((iJ,tR)=>{p();function pG(t){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=n,r.enabled=o,r.humanize=eR(),r.destroy=c,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let f=0;for(let d=0;d{if(A==="%%")return"%";x++;let S=r.formatters[y];if(typeof S=="function"){let _=v[x];A=S.call(w,_),v.splice(x,1),x--}return A}),r.formatArgs.call(w,v),(w.log||r.log).apply(w,v)}return g.namespace=u,g.useColors=r.useColors(),g.color=r.selectColor(u),g.extend=i,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==r.namespaces&&(h=r.namespaces,m=r.enabled(u)),m),set:v=>{d=v}}),typeof r.init=="function"&&r.init(g),g}function i(u,f){let d=r(this.namespace+(typeof f=="undefined"?":":f)+u);return d.log=this.log,d}function n(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(u,f){let d=0,h=0,m=-1,g=0;for(;d"-"+f)].join(",");return r.enable(""),u}function o(u){for(let f of r.skips)if(s(u,f))return!1;for(let f of r.names)if(s(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}tR.exports=pG});var Sh=F((Tr,xh)=>{p();Tr.formatArgs=gG;Tr.save=vG;Tr.load=wG;Tr.useColors=mG;Tr.storage=yG();Tr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Tr.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function mG(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function gG(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+xh.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}Tr.log=console.debug||console.log||(()=>{});function vG(t){try{t?Tr.storage.setItem("debug",t):Tr.storage.removeItem("debug")}catch(e){}}function wG(){let t;try{t=Tr.storage.getItem("debug")||Tr.storage.getItem("DEBUG")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function yG(){try{return localStorage}catch(t){}}xh.exports=rR()(Tr);var{formatters:bG}=xh.exports;bG.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var iR=F(Qr=>{"use strict";p();var _G=Qr&&Qr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qr,"__esModule",{value:!0});var xG=require("fs"),SG=_G(Sh()),_l=SG.default("@kwsites/file-exists");function EG(t,e,r){_l("checking %s",t);try{let i=xG.statSync(t);return i.isFile()&&e?(_l("[OK] path represents a file"),!0):i.isDirectory()&&r?(_l("[OK] path represents a directory"),!0):(_l("[FAIL] path represents something other than a file or directory"),!1)}catch(i){if(i.code==="ENOENT")return _l("[FAIL] path is not accessible: %o",i),!1;throw _l("[FATAL] %o",i),i}}function kG(t,e=Qr.READABLE){return EG(t,(e&Qr.FILE)>0,(e&Qr.FOLDER)>0)}Qr.exists=kG;Qr.FILE=1;Qr.FOLDER=2;Qr.READABLE=Qr.FILE+Qr.FOLDER});var nR=F(Eh=>{"use strict";p();function AG(t){for(var e in t)Eh.hasOwnProperty(e)||(Eh[e]=t[e])}Object.defineProperty(Eh,"__esModule",{value:!0});AG(iR())});var Yw=F($a=>{"use strict";p();Object.defineProperty($a,"__esModule",{value:!0});$a.createDeferred=$a.deferred=void 0;function Ww(){let t,e,r="pending";return{promise:new Promise((n,s)=>{t=n,e=s}),done(n){r==="pending"&&(r="resolved",t(n))},fail(n){r==="pending"&&(r="rejected",e(n))},get fulfilled(){return r!=="pending"},get status(){return r}}}$a.deferred=Ww;$a.createDeferred=Ww;$a.default=Ww});var N0=F((exports,module)=>{p();(function(){"use strict";var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&typeof module=="object"&&module.exports,AMD=typeof define=="function"&&define.amd,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t,e){return function(r){return new Sha256(e,!0).update(r)[t]()}},createMethod=function(t){var e=createOutputMethod("hex",t);NODE_JS&&(e=nodeWrap(e,t)),e.create=function(){return new Sha256(t)},e.update=function(n){return e.create().update(n)};for(var r=0;r>2]|=t[n]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|i&63)<=57344?(o[s>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|i&63)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|i&63)<=64?(this.block=o[16],this.start=s-64,this.hash(),this.hashed=!0):this.start=s}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=EXTRA[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,a=this.h6,o=this.h7,l=this.blocks,c,u,f,d,h,m,g,v,w,b,k;for(c=16;c<64;++c)h=l[c-15],u=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,h=l[c-2],f=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,l[c]=l[c-16]+u+l[c-7]+f<<0;for(k=e&r,c=0;c<64;c+=4)this.first?(this.is224?(v=300032,h=l[0]-1413257819,o=h-150054599<<0,i=h+24177077<<0):(v=704751109,h=l[0]-210244248,o=h-1521486534<<0,i=h+143694565<<0),this.first=!1):(u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),f=(n>>>6|n<<26)^(n>>>11|n<<21)^(n>>>25|n<<7),v=t&e,d=v^t&r^k,g=n&s^~n&a,h=o+f+g+K[c]+l[c],m=u+d,o=i+h<<0,i=h+m<<0),u=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),f=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),w=i&t,d=w^i&e^v,g=o&n^~o&s,h=a+f+g+K[c+1]+l[c+1],m=u+d,a=r+h<<0,r=h+m<<0,u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),f=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),b=r&i,d=b^r&t^w,g=a&o^~a&n,h=s+f+g+K[c+2]+l[c+2],m=u+d,s=e+h<<0,e=h+m<<0,u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),f=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),k=e&r,d=k^e&i^b,g=s&a^~s&o,h=n+f+g+K[c+3]+l[c+3],m=u+d,n=t+h<<0,t=h+m<<0;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+r<<0,this.h3=this.h3+i<<0,this.h4=this.h4+n<<0,this.h5=this.h5+s<<0,this.h6=this.h6+a<<0,this.h7=this.h7+o<<0},Sha256.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,a=this.h6,o=this.h7,l=HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[e&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[r&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[i&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[a&15];return this.is224||(l+=HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]),l},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,i=this.h3,n=this.h4,s=this.h5,a=this.h6,o=this.h7,l=[t>>24&255,t>>16&255,t>>8&255,t&255,e>>24&255,e>>16&255,e>>8&255,e&255,r>>24&255,r>>16&255,r>>8&255,r&255,i>>24&255,i>>16&255,i>>8&255,i&255,n>>24&255,n>>16&255,n>>8&255,n&255,s>>24&255,s>>16&255,s>>8&255,s&255,a>>24&255,a>>16&255,a>>8&255,a&255];return this.is224||l.push(o>>24&255,o>>16&255,o>>8&255,o&255),l},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t};function HmacSha256(t,e,r){var i,n=typeof t;if(n==="string"){var s=[],a=t.length,o=0,l;for(i=0;i>6,s[o++]=128|l&63):l<55296||l>=57344?(s[o++]=224|l>>12,s[o++]=128|l>>6&63,s[o++]=128|l&63):(l=65536+((l&1023)<<10|t.charCodeAt(++i)&1023),s[o++]=240|l>>18,s[o++]=128|l>>12&63,s[o++]=128|l>>6&63,s[o++]=128|l&63);t=s}else if(n==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);t.length>64&&(t=new Sha256(e,!0).update(t).array());var c=[],u=[];for(i=0;i<64;++i){var f=t[i]||0;c[i]=92^f,u[i]=54^f}Sha256.call(this,e,r),this.update(u),this.oKeyPad=c,this.inner=!0,this.sharedMemory=r}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(t),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&define(function(){return exports}))})()});var yO=F(wy=>{p();(function(t){var e=/\S/,r=/\"/g,i=/\n/g,n=/\r/g,s=/\\/g,a=/\u2028/,o=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(S,_){var T=S.length,P=0,D=1,B=2,N=P,ce=null,Pe=null,ve="",se=[],xe=!1,we=0,z=0,Q="{{",j="}}";function Le(){ve.length>0&&(se.push({tag:"_t",text:new String(ve)}),ve="")}function lr(){for(var At=!0,Tt=z;Tt"&&(Ze.indent=se[jt].text.toString()),se.splice(jt,1));else Tt||se.push({tag:` +`});xe=!1,z=se.length}function Fe(At,Tt){var jt="="+j,Ze=At.indexOf(jt,Tt),q=c(At.substring(At.indexOf("=",Tt)+1,Ze)).split(" ");return Q=q[0],j=q[q.length-1],Ze+jt.length-1}for(_&&(_=_.split(" "),Q=_[0],j=_[1]),we=0;we0;){if(N=y.shift(),B&&B.tag=="<"&&!(N.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[N.tag]<=t.tags.$||h(N,T))_.push(N),N.nodes=d(y,N.tag,_,T);else if(N.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+N.n);if(D=_.pop(),N.n!=D.n&&!m(N.n,D.n,T))throw new Error("Nesting error: "+D.n+" vs. "+N.n);return D.end=N.i,P}else N.tag==` +`&&(N.last=y.length==0||y[0].tag==` +`);P.push(N)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return P}function h(y,S){for(var _=0,T=S.length;_":x,"<":function(y,S){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(y.nodes,_);var T=S.partials[x(y,S)];T.subs=_.subs,T.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 _,T=0,P=y.length;T{p();var GV={};(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=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:function(d,h,m){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(d,this.options).render(h,m)},b:function(d){this.buf+=d},fl:function(){var d=this.buf;return this.buf="",d},ms:function(d,h,m,g,v,w,b){var k,x=h[h.length-1],E=d.call(x);return typeof E=="function"?g?!0:(k=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(E,x,h,m,k.substring(v,w),b)):E},mv:function(d,h,m){var g=h[h.length-1],v=d.call(g);return typeof v=="function"?this.ct(c(v.call(g)),g,m):v},sub:function(d,h,m,g){var v=this.subs[d];v&&(this.activeSub=d,v(h,m,this,g),this.activeSub=!1)}};function e(d,h,m){var g;return h&&typeof h=="object"&&(h[d]!==void 0?g=h[d]:m&&h.get&&typeof h.get=="function"&&(g=h.get(d))),g}function r(d,h,m,g,v,w){function b(){}b.prototype=d;function k(){}k.prototype=d.subs;var x,E=new b;E.subs=new k,E.subsText={},E.buf="",g=g||{},E.stackSubs=g,E.subsText=w;for(x in h)g[x]||(g[x]=h[x]);for(x in g)E.subs[x]=g[x];v=v||{},E.stackPartials=v;for(x in m)v[x]||(v[x]=m[x]);for(x in v)E.partials[x]=v[x];return E}var i=/&/g,n=//g,a=/\'/g,o=/\"/g,l=/[&<>\"\']/;function c(d){return String(d==null?"":d)}function u(d){return d=c(d),l.test(d)?d.replace(i,"&").replace(n,"<").replace(s,">").replace(a,"'").replace(o,"""):d}var f=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}})(typeof yy!="undefined"?yy:GV)});var by=F((wre,_O)=>{p();var bp=yO();bp.Template=bO().Template;bp.template=bp.Template;_O.exports=bp});var EO=F(bi=>{"use strict";p();Object.defineProperty(bi,"__esModule",{value:!0});bi.ColorSchemeType=bi.DiffStyleType=bi.LineMatchingType=bi.OutputFormatType=bi.LineType=void 0;var xO;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(xO||(bi.LineType=xO={}));bi.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"};bi.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"};bi.DiffStyleType={WORD:"word",CHAR:"char"};var SO;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(SO||(bi.ColorSchemeType=SO={}))});var J9={};ND(J9,{default:()=>Em});module.exports=HD(J9);p();var vD=Mt(Sv()),_e=require("obsidian"),wD=Mt(require("path"));p();var Ii={};p();var Dd=class{constructor(e){this.plugin=e;this.tasks=[]}addTask(e,r){this.tasks.push({task:e,onFinished:r!=null?r:()=>{}}),this.tasks.length===1&&this.handleTask()}handleTask(){if(this.tasks.length>0){let e=this.tasks[0];e.task().then(r=>{e.onFinished(r),this.tasks.shift(),this.handleTask()},r=>{this.plugin.displayError(r),e.onFinished(void 0),this.tasks.shift(),this.handleTask()})}}clear(){this.tasks=[]}};p();var U=require("obsidian");p();var GA=require("obsidian"),Ld="YYYY-MM-DD",Ev=`${Ld} HH:mm`,kv=`${Ld} HH:mm:ss`,Bd=40,al="conflict-files-obsidian-git.md",rt={commitMessage:"vault backup: {{date}}",autoCommitMessage:"vault backup: {{date}}",commitMessageScript:"",commitDateFormat:kv,autoSaveInterval:0,autoPushInterval:0,autoPullInterval:0,autoPullOnBoot:!1,autoCommitOnlyStaged:!1,disablePush:!1,pullBeforePush:!0,disablePopups:!1,showErrorNotices:!0,disablePopupsForNoChanges:!1,listChangedFilesInMessageBody:!1,showStatusBar:!0,updateSubmodules:!1,syncMethod:"merge",mergeStrategy:"none",customMessageOnAutoBackup:!1,autoBackupAfterFileChange:!1,treeStructure:!1,refreshSourceControl:GA.Platform.isDesktopApp,basePath:"",differentIntervalCommitAndPush:!1,changedFilesInStatusBar:!1,showedMobileNotice:!1,refreshSourceControlTimer:7e3,showBranchStatusBar:!0,setLastSaveToLastCommit:!1,submoduleRecurseCheckout:!1,gitDir:"",showFileMenu:!0,authorInHistoryView:"hide",dateInHistoryView:!1,diffStyle:"split",hunks:{showSigns:!1,hunkCommands:!1,statusBar:"disabled"},lineAuthor:{show:!1,followMovement:"inactive",authorDisplay:"initials",showCommitHash:!1,dateTimeFormatOptions:"date",dateTimeFormatCustomString:Ev,dateTimeTimezone:"viewer-local",coloringMaxAge:"1y",colorNew:{r:255,g:150,b:150},colorOld:{r:120,g:160,b:255},textColorCss:"var(--text-muted)",ignoreWhitespace:!1,gutterSpacingFallbackLength:5}},zt={type:"git-view",name:"Source Control",icon:"git-pull-request"},gi={type:"git-history-view",name:"History",icon:"history"},Ls={type:"split-diff-view",name:"Diff view",icon:"diff"},Bs={type:"diff-view",name:"Diff View",icon:"git-pull-request"},Nd="C:\\Program Files\\Git\\cmd\\git.exe",Hd=".git_credentials_input",Ta="obsidian_askpass.sh",jA=`#!/bin/sh + +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" +`,qA=["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 un=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.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,i);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=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(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);w()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=w();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1d.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 n}};p();var Av=class extends un{},zA=new Av;function Tv(t,e,r){return zA.diff(t,e,r)}p();p();function Cv(t,e){let r;for(r=0;re.length&&(r=t.length-e.length);let i=e.length;t.length0&&e[a]!=e[s];)s=n[s];e[a]==e[s]&&s++}s=0;for(let a=r;a0&&t[a]!=e[s];)s=n[s];t[a]==e[s]&&s++}return s}function ll(t){let e;for(e=t.length-1;e>=0&&t[e].match(/\s/);e--);return t.substring(e+1)}function zn(t){let e=t.match(/^\s*/);return e?e[0]:""}var jd="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",O6=new RegExp(`[${jd}]+|\\s+|[^${jd}]`,"ug"),$v=class extends un{equals(e,r,i){return i.ignoreCase&&(e=e.toLowerCase(),r=r.toLowerCase()),e.trim()===r.trim()}tokenize(e,r={}){let i;if(r.intlSegmenter){let a=r.intlSegmenter;if(a.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=[];for(let o of Array.from(a.segment(e))){let l=o.segment;i.length&&/\s/.test(i[i.length-1])&&/\s/.test(l)?i[i.length-1]+=l:i.push(l)}}else i=e.match(O6)||[];let n=[],s=null;return i.forEach(a=>{/\s/.test(a)?s==null?n.push(a):n.push(n.pop()+a):s!=null&&/\s/.test(s)?n[n.length-1]==s?n.push(n.pop()+a):n.push(s+a):n.push(a),s=a}),n}join(e){return e.map((r,i)=>i==0?r:r.replace(/^\s+/,"")).join("")}postProcess(e,r){if(!e||r.oneChangePerToken)return e;let i=null,n=null,s=null;return e.forEach(a=>{a.added?n=a:a.removed?s=a:((n||s)&&VA(i,s,n,a),i=a,n=null,s=null)}),(n||s)&&VA(i,s,n,null),e}},M6=new $v;function VA(t,e,r,i){if(e&&r){let n=zn(e.value),s=ll(e.value),a=zn(r.value),o=ll(r.value);if(t){let l=Cv(n,a);t.value=Gd(t.value,a,l),e.value=ol(e.value,l),r.value=ol(r.value,l)}if(i){let l=Pv(s,o);i.value=Ud(i.value,o,l),e.value=lu(e.value,l),r.value=lu(r.value,l)}}else if(r){if(t){let n=zn(r.value);r.value=r.value.substring(n.length)}if(i){let n=zn(i.value);i.value=i.value.substring(n.length)}}else if(t&&i){let n=zn(i.value),s=zn(e.value),a=ll(e.value),o=Cv(n,s);e.value=ol(e.value,o);let l=Pv(ol(n,o),a);e.value=lu(e.value,l),i.value=Ud(i.value,n,l),t.value=Gd(t.value,n,n.slice(0,n.length-l.length))}else if(i){let n=zn(i.value),s=ll(e.value),a=Rv(s,n);e.value=lu(e.value,a)}else if(t){let n=ll(t.value),s=zn(e.value),a=Rv(n,s);e.value=ol(e.value,a)}}var Fv=class extends un{tokenize(e){let r=new RegExp(`(\\r?\\n)|[${jd}]+|[^\\S\\n\\r]+|[^${jd}]`,"ug");return e.match(r)||[]}},WA=new Fv;function Iv(t,e,r){return WA.diff(t,e,r)}p();var Ov=class extends un{constructor(){super(...arguments),this.tokenize=L6}equals(e,r,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(` +`))&&(e=e.trim()),(!i.newlineIsToken||!r.includes(` +`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(` +`)&&(e=e.slice(0,-1)),r.endsWith(` +`)&&(r=r.slice(0,-1))),super.equals(e,r,i)}},D6=new Ov;function Mv(t,e,r){return D6.diff(t,e,r)}function L6(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` +`));let r=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n{let d=c(f);u(d)}}))}else return c(Mv(r,i,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;b0?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&&b1&&!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(i=>qd(i,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 i=0;i{o(l?qd(l,a.headerOptions):void 0)}}))}else{let o=Dv(t,e,r,i,n,s,a);return o?qd(o,a==null?void 0:a.headerOptions):void 0}}function cu(t,e,r,i,n,s){return XA(t,t,e,r,i,n,s)}function B6(t){let e=t.endsWith(` +`),r=t.split(` +`).map(i=>i+` +`);return e?r.pop():r.push(r.pop().slice(0,-1)),r}var re=Mt(Sv()),Pa=require("obsidian");p();function ZA(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var cl=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};p();var KA=require("obsidian"),H6={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},Qe=class extends KA.SuggestModal{constructor(e,r){if(super(e.app),this.config={...H6,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let i=this.containerEl.querySelector(".prompt-input-container");i.addClass("git-obscure-prompt"),i.setAttr("git-is-obscured","true");let n=i==null?void 0:i.createDiv({cls:"search-input-clear-button"});n.style.marginRight="32px",n.id="git-show-password",n.addEventListener("click",()=>{i.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",i.setAttr("git-is-obscured","false")):(this.inputEl.type="password",i.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 i;this.config.allowEmpty&&e===" "?i="":e==="..."?i=void 0:i=e,this.resolve(i)}}};p();var MP=Mt(mT()),DP=require("child_process"),LP=Mt(OP()),Xn=require("obsidian");function wh(t){throw new Error(`Unexpected object: ${t}`)}function Su(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var Gw=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function Mi(t,e){let r;if(e){if(e.button===0||e.button===1){let i=Xn.Keymap.isModEvent(e);r=t.workspace.getLeaf(i)}}else r=t.workspace.getLeaf(!1);return r}function hn(t,e,r,i,n){if(e.button==2){let s=t.vault.getAbstractFileByPath(r);if(s!=null){let a=new Xn.Menu;t.workspace.trigger("file-menu",a,s,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}else{let a=new Xn.Menu;t.workspace.trigger("obsidian-git:menu",a,r,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}}}function Gs(t){throw new Error("Impossible branch: "+t)}function jw(t){return`rgb(${t.r},${t.g},${t.b})`}function BP(t){var s;let e=(s=MP.fromString(t))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[r,i,n]=e;return{r,g:i,b:n}}function NP(t){return t.diff(Xn.moment.unix(0),"seconds")}function HP(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function UP(t,e){return(0,LP.default)(t,e,{strict:!0})}function Eu(t,e){return new Proxy(t,{get(r,i){return i==="length"?Math.min(e,r.length):r[i]}})}function GP(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function jP(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),i=t.substring(e,t.length);return r+i}function qw(t,e,r){return t<=e&&e<=r}function Zn(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function pn(t){return t.endsWith("/")?t:t.split("/").last().replace(/\.md$/,"")}function qP(t){return t===1?"1 minute":`${t} minutes`}function nG(t){let e=t.lastIndexOf(".");return t.substring(e+1)}function pl(t){if(t.endsWith(".md"))return!1;let e=nG(t);return qA.includes(e)}function zw(t){return(t.startsWith("https://github.com/")||t.startsWith("https://gitlab.com/"))&&(t.endsWith(".git")||(t=t+".git")),t}function ml(t,e){let r=e.vault.getAbstractFileByPath(t);if(!(r instanceof Xn.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(r.extension)}catch(i){return!0}}function zP({isFolder:t,gitRelativePath:e}){let r="/";return r+=e,t&&(r+="/"),r.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function gl(t,e,r,i){let n=e.target;t.workspace.trigger("hover-link",{event:e,source:r.getViewType(),hoverParent:r,targetEl:n,linktext:i})}function ku(t,e,r={}){return new Promise((i,n)=>{let s=(0,DP.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=>{i({error:new Error(l.message),stdout:a,stderr:a,code:1})}),s.on("close",l=>{i({stdout:a,stderr:o,code:l!=null?l:1,error:void 0})})})}p();var VP=require("os"),yh=require("obsidian"),vl=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 i=[];for(e=[...e];e.length>0;){let n=e.first(),s=n.path.substring(r);if(s.contains("/")){let a=s.substring(0,s.indexOf("/")),o=e.filter(c=>c.path.substring(r).startsWith(a+"/"));o.forEach(c=>e.remove(c));let l=n.path.substring(0,s.indexOf("/")+r);i.push({title:a,path:l,vaultPath:this.getRelativeVaultPath(l),children:this._getTreeStructure(o,(r>0?r+a.length:a.length)+1)})}else i.push({title:s,data:n,path:n.path,vaultPath:this.getRelativeVaultPath(n.path)}),e.remove(n)}return i}simplify(e){var r,i,n,s;for(let a of e){for(;;){let o=((r=a.children)==null?void 0:r.length)==1,l=((n=(i=a.children)==null?void 0:i.first())==null?void 0:n.data)==null;if(!(a.children!=null&&o&&l))break;let c=a.children.first();a.title+="/"+c.title,a.data=c.data,a.path=c.path,a.vaultPath=c.vaultPath,a.children=c.children}a.children!=null&&this.simplify(a.children),(s=a.children)==null||s.sort((o,l)=>{let c=(l.data==null?1:0)-(o.data==null?1:0);return c!=0?c:o.title.localeCompare(l.title)})}return e.sort((a,o)=>{let l=(o.data==null?1:0)-(a.data==null?1:0);return l!=0?l:a.title.localeCompare(o.title)})}getTreeStructure(e){let r=this._getTreeStructure(e);return this.simplify(r)}async formatCommitMessage(e){let r;if(e.includes("{{numFiles}}")){r=await this.status();let i=r.staged.length;e=e.replace("{{numFiles}}",String(i))}if(e.includes("{{hostname}}")){let i=this.plugin.localStorage.getHostname()||"";!i&&yh.Platform.isDesktopApp&&(i=(0,VP.hostname)()),e=e.replace("{{hostname}}",i)}if(e.includes("{{files}}")){r=r!=null?r:await this.status();let i={},n="";if(r.staged.length<100){r.staged.forEach(a=>{a.index in i?i[a.index].push(a.path):i[a.index]=[a.path]});let s=[];for(let[a,o]of Object.entries(i))s.push(a+" "+o.join(" "));n=s.join(", ")}else n="Too many files to list";e=e.replace("{{files}}",n)}if(e=e.replace("{{date}}",(0,yh.moment)().format(this.plugin.settings.commitDateFormat)),this.plugin.settings.listChangedFilesInMessageBody){let i=r!=null?r:await this.status(),n="";i.staged.length<100?n=i.staged.map(s=>s.path).join(` +`):n="Too many files to list",e=e+` + +Affected files: +`+n}return e}};p();var js=require("obsidian"),bh=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 i;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let n=this.vault.getAbstractFileByPath(e);return n instanceof js.TFile?(this.maybeLog("Reuse"),this.vault.read(n)):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)):(i=this.index)!=null?i:this.adapter.readBinary(e);let n=this.vault.getAbstractFileByPath(e);return n instanceof js.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(n)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let i=this.vault.getAbstractFileByPath(e);return i instanceof js.TFile?this.vault.modify(i,r):this.adapter.write(e,r)}else if(e.endsWith(this.gitDir+"/index"))this.index=r,this.indexmtime=Date.now();else{let i=this.vault.getAbstractFileByPath(e);return i instanceof js.TFile?this.vault.modifyBinary(i,r):this.adapter.writeBinary(e,r)}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),i=[...r.files,...r.folders],n;return e!=="/"?n=i.map(s=>(0,js.normalizePath)(s.substring(e.length))):n=i,n}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var i,n;return this.adapter.rmdir(e,(n=(i=r==null?void 0:r.options)==null?void 0:i.recursive)!=null?n:!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 i=await this.adapter.stat(e);if(i==null)throw{code:"ENOENT"};return this.indexctime=i.ctime,this.indexmtime=i.mtime,{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof js.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 i=await this.adapter.stat(e);if(i)return{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:i.type==="folder"?"directory":i.type,isFile:()=>i.type==="file",isDirectory:()=>i.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 QP=Mt(KP()),Di=class extends vl{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 bh(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,i;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(i=this.plugin.localStorage.getPassword())!=null?i:void 0}},onAuthFailure:async()=>{new Pa.Notice("Authentication failed. Please try with different credentials");let r=await new Qe(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let i=await new Qe(this.plugin,{placeholder:"Specify your password/personal access token",obscure:!0}).openAndGetResult();if(i)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(i),{username:r,password:i}}return{cancel:!0}},http:{async request({url:r,method:i,headers:n,body:s}){let a;s&&(a=await lG(s));let o=await(0,Pa.requestUrl)({url:r,method:i,headers:n,body:a,throw:!1});return{url:r,method:i,headers:o.headers,body:oG(o.arrayBuffer),statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(r){try{let i=await r;return await this.fs.saveAndClear(),i}catch(i){throw await this.fs.saveAndClear(),i}}async status(r){let i,n=window.setTimeout(()=>{i=new Pa.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{this.plugin.setPluginState({gitAction:1});let s={...this.getRepo()};(r==null?void 0:r.path)!=null&&(s.filepaths=[`${r.path}/`]);let a=(await this.wrapFS(re.default.statusMatrix(s))).map(f=>this.getFileStatusResult(f)),o=[],l=[],c=[];for(let f of a)f.workingDir!==" "&&o.push(f),f.index!==" "&&f.index!=="U"&&l.push(f),(f.index!=" "||f.workingDir!=" ")&&c.push(f);let u=[];return window.clearTimeout(n),i==null||i.hide(),{all:c,changed:o,staged:l,conflicted:u}}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async commitAll({message:r,status:i,unstagedFiles:n}){try{return await this.checkAuthorInfo(),await this.stageAll({status:i,unstagedFiles:n}),this.commit({message:r})}catch(s){throw this.plugin.displayError(s),s}}async commit({message:r}){try{await this.checkAuthorInfo(),this.plugin.setPluginState({gitAction:4});let i=await this.formatCommitMessage(r),n=this.plugin.localStorage.getConflict(),s;if(n){let a=await this.branchInfo();s=[a.current,a.tracking]}await this.wrapFS(re.default.commit({...this.getRepo(),message:i,parent:s})),this.plugin.localStorage.setConflict(!1);return}catch(i){throw this.plugin.displayError(i),i}}async stage(r,i){let n=this.getRelativeRepoPath(r,i),s;i?s=r:s=this.getRelativeVaultPath(r);try{this.plugin.setPluginState({gitAction:3}),await this.app.vault.adapter.exists(s)?await this.wrapFS(re.default.add({...this.getRepo(),filepath:n})):await this.wrapFS(re.default.remove({...this.getRepo(),filepath:n}))}catch(a){throw this.plugin.displayError(a),a}}async stageAll({dir:r,status:i,unstagedFiles:n}){try{if(i)await Promise.all(i.changed.map(s=>s.workingDir!=="D"?this.wrapFS(re.default.add({...this.getRepo(),filepath:s.path})):re.default.remove({...this.getRepo(),filepath:s.path})));else{let s=n!=null?n:await this.getUnstagedFiles(r!=null?r:".");await Promise.all(s.map(({path:a,type:o})=>o=="D"?re.default.remove({...this.getRepo(),filepath:a}):this.wrapFS(re.default.add({...this.getRepo(),filepath:a}))))}}catch(s){throw this.plugin.displayError(s),s}}async unstage(r,i){try{this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.wrapFS(re.default.resetIndex({...this.getRepo(),filepath:r}))}catch(n){throw this.plugin.displayError(n),n}}async unstageAll({dir:r,status:i}){try{let n;i?n=i.staged.map(s=>s.path):n=(await this.getStagedFiles(r!=null?r:".")).map(({path:a})=>a),await this.wrapFS(Promise.all(n.map(s=>re.default.resetIndex({...this.getRepo(),filepath:s}))))}catch(n){throw this.plugin.displayError(n),n}}async discard(r){try{this.plugin.setPluginState({gitAction:3}),await this.wrapFS(re.default.checkout({...this.getRepo(),filepaths:[r],force:!0}))}catch(i){throw this.plugin.displayError(i),i}}async discardAll({dir:r,status:i}){let n=[];i?r!=null?n=i.changed.filter(s=>s.workingDir!="U"&&s.path.startsWith(r)).map(s=>s.path):n=i.changed.filter(s=>s.workingDir!="U").map(s=>s.path):n=(await this.getUnstagedFiles(r)).filter(s=>s.type!="A").map(({path:s})=>s);try{await this.wrapFS(re.default.checkout({...this.getRepo(),filepaths:n,force:!0}))}catch(s){throw this.plugin.displayError(s),s}}async getUntrackedPaths(r){let i=[];if(r.status)for(let n of r.status.changed)n.index=="U"&&n.workingDir==="U"&&n.path.startsWith(r.path!=null?`${r.path}/`:"")&&i.push(n.path);else{let n=await this.status({path:r==null?void 0:r.path});for(let s of n.changed)s.index==="U"&&s.workingDir==="U"&&i.push(s.path)}return i}getProgressText(r,i){let n=`${r} progress:`;return i.phase&&(n=`${n} ${i.phase}:`),i.loaded&&(n=`${n} ${i.loaded}`,i.total&&(n=`${n} of ${i.total}`)),n}resolveRef(r){return this.wrapFS(re.default.resolveRef({...this.getRepo(),ref:r}))}async pull(){let r=this.showNotice("Initializing pull");try{this.plugin.setPluginState({gitAction:2});let i=await this.resolveRef("HEAD");await this.fetch();let n=await this.branchInfo();await this.checkAuthorInfo(),(await this.wrapFS(re.default.merge({...this.getRepo(),ours:n.current,theirs:n.tracking,abortOnConflict:!1,mergeDriver:this.plugin.settings.mergeStrategy!=="none"?({contents:l})=>{var b,k,x;let c=l[0],u=l[1],f=l[2],d=/^.*(\r?\n|$)/gm,h=(b=u.match(d))!=null?b:[],m=(k=c.match(d))!=null?k:[],g=(x=f.match(d))!=null?x:[],v=(0,QP.default)(h,m,g),w="";for(let E of v)E.ok&&(w+=E.ok.join("")),E.conflict&&(w+=this.plugin.settings.mergeStrategy==="ours"?E.conflict.a.join(""):E.conflict.b.join(""));return{cleanMerge:!0,mergedText:w}}:void 0}))).alreadyMerged||await this.wrapFS(re.default.checkout({...this.getRepo(),ref:n.current,onProgress:l=>{r!==void 0&&(r.noticeEl.innerText=this.getProgressText("Checkout",l))},remote:n.remote})),r==null||r.hide();let a=await this.resolveRef("HEAD"),o=await this.getFileChangesCount(i,a);return this.showNotice("Finished pull",!1),o.map(l=>({path:l.path,workingDir:"P",index:"P",vaultPath:this.getRelativeVaultPath(l.path)}))}catch(i){throw r==null||r.hide(),i instanceof re.Errors.MergeConflictError&&await this.plugin.handleConflict(i.data.filepaths.map(n=>this.getRelativeVaultPath(n))),this.plugin.displayError(i),i}}async push(){if(!await this.canPush())return 0;let r=this.showNotice("Initializing push");try{this.plugin.setPluginState({gitAction:1});let i=await this.branchInfo(),n=i.tracking,s=i.current,a=(await this.getFileChangesCount(s,n)).length;this.plugin.setPluginState({gitAction:5});let o=await this.getCurrentRemote();return await this.wrapFS(re.default.push({...this.getRepo(),remote:o,onProgress:l=>{r!==void 0&&(r.noticeEl.innerText=this.getProgressText("Pushing",l))}})),r==null||r.hide(),a}catch(i){throw r==null||r.hide(),this.plugin.displayError(i),i}}async getUnpushedCommits(){let r=await this.branchInfo(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let s=await this.resolveRef(n),a=await this.resolveRef(i);return(await this.getFileChangesCount(s,a)).length}async canPush(){let r=await this.branchInfo(),i=r.tracking,n=r.current,s=await this.resolveRef(n),a=await this.resolveRef(i);return s!=a}async checkRequirements(){return await this.plugin.app.vault.adapter.exists(`${this.getRepo().dir}/.git/HEAD`)?"valid":"missing-repo"}async branchInfo(){var r,i;try{let n=await re.default.currentBranch(this.getRepo())||"",s=await re.default.listBranches(this.getRepo()),a=(r=await this.getConfig(`branch.${n}.remote`))!=null?r:"origin",o=(i=await this.getConfig(`branch.${n}.merge`))==null?void 0:i.split("refs/heads")[1],l=o?a+o:void 0;return{current:n,tracking:l,branches:s,remote:a}}catch(n){throw this.plugin.displayError(n),n}}async getCurrentRemote(){var n;let r=await re.default.currentBranch(this.getRepo())||"";return(n=await this.getConfig(`branch.${r}.remote`))!=null?n:"origin"}async checkout(r,i){try{return this.wrapFS(re.default.checkout({...this.getRepo(),ref:r,force:!!i,remote:i}))}catch(n){throw this.plugin.displayError(n),n}}async createBranch(r){try{await this.wrapFS(re.default.branch({...this.getRepo(),ref:r,checkout:!0}))}catch(i){throw this.plugin.displayError(i),i}}async deleteBranch(r){try{await this.wrapFS(re.default.deleteBranch({...this.getRepo(),ref:r}))}catch(i){throw this.plugin.displayError(i),i}}branchIsMerged(r){return Promise.resolve(!0)}async init(){try{await this.wrapFS(re.default.init(this.getRepo()))}catch(r){throw this.plugin.displayError(r),r}}async clone(r,i,n){let s=this.showNotice("Initializing clone");try{await this.wrapFS(re.default.clone({...this.getRepo(),dir:i,url:r,depth:n,onProgress:a=>{s!==void 0&&(s.noticeEl.innerText=this.getProgressText("Cloning",a))}})),s==null||s.hide()}catch(a){throw s==null||s.hide(),this.plugin.displayError(a),a}}async setConfig(r,i){try{return this.wrapFS(re.default.setConfig({...this.getRepo(),path:r,value:i}))}catch(n){throw this.plugin.displayError(n),n}}async getConfig(r){try{return this.wrapFS(re.default.getConfig({...this.getRepo(),path:r}))}catch(i){throw this.plugin.displayError(i),i}}async fetch(r){let i=this.showNotice("Initializing fetch");try{let n={...this.getRepo(),onProgress:s=>{i!==void 0&&(i.noticeEl.innerText=this.getProgressText("Fetching",s))},remote:r!=null?r:await this.getCurrentRemote()};await this.wrapFS(re.default.fetch(n)),i==null||i.hide()}catch(n){throw this.plugin.displayError(n),i==null||i.hide(),n}}async setRemote(r,i){try{await this.wrapFS(re.default.addRemote({...this.getRepo(),remote:r,url:i,force:!0}))}catch(n){throw this.plugin.displayError(n),n}}async getRemoteBranches(r){let i=[];return i.push(...await this.wrapFS(re.default.listBranches({...this.getRepo(),remote:r}))),i.remove("HEAD"),i=i.map(n=>`${r}/${n}`),i}async getRemotes(){return(await this.wrapFS(re.default.listRemotes({...this.getRepo()}))).map(r=>r.remote)}async removeRemote(r){await this.wrapFS(re.default.deleteRemote({...this.getRepo(),remote:r}))}async getRemoteUrl(r){var i;return(i=(await this.wrapFS(re.default.listRemotes({...this.getRepo()}))).filter(n=>n.remote==r)[0])==null?void 0:i.url}async log(r,i=!0,n,s){let a=await this.wrapFS(re.default.log({...this.getRepo(),depth:n,ref:s}));return Promise.all(a.map(async o=>{let l=o.commit.message.split(` + +`);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[i,n]=Zn(r),s=await this.branchInfo();await this.wrapFS(re.default.push({...this.getRepo(),remote:i,remoteRef:n})),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${n}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,i){return this.walkDifference({walkers:[re.default.TREE({ref:r}),re.default.TREE({ref:i})]})}async walkDifference({walkers:r,dir:i}){return await this.wrapFS(re.default.walk({...this.getRepo(),trees:r,map:async function(s,[a,o]){if(!Gw(s,i))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:[re.default.TREE({ref:"HEAD"}),re.default.STAGE()],dir:r})).map(n=>({vaultPath:this.getRelativeVaultPath(n.path),path:n.path}))}async getUnstagedFiles(r="."){let i,n=window.setTimeout(()=>{i=new Pa.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),a=await this.wrapFS(re.default.walk({...s,trees:[re.default.WORKDIR(),re.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await re.default.isIgnored({...s,filepath:o})||!Gw(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(n),i==null||i.hide(),a}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async getDiffString(r,i=!1,n){let s=this.getRelativeVaultPath(r),a=async(c,[u])=>{if(r==c){let f=await u.oid();return(await re.default.readBlob({...this.getRepo(),oid:f})).blob}};if(n){let c=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:n}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h}),u=await re.default.readCommit({...this.getRepo(),oid:n}),f=await(0,re.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof re.default.Errors.NotFoundError))throw h});return cu(s,f!=null?f:"",c!=null?c:"")}let o=(await re.default.walk({...this.getRepo(),trees:[re.default.STAGE()],map:a})).first(),l=new TextDecoder().decode(o);if(i){let c=await this.resolveRef("HEAD").then(f=>(0,re.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof re.default.Errors.NotFoundError))throw f});return cu(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="",cu(s,l,c)}}async getLastCommitTime(){let r=this.getRepo(),i=await this.resolveRef("HEAD"),s=(await re.default.readCommit({...r,oid:i})).commit.committer.timestamp;return new Date(s*1e3)}getFileStatusResult(r){let i=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:i[0]=="?"?"U":i[0],workingDir:i[1]=="?"?"U":i[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),i=await this.getConfig("user.email");if(!r||!i)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,i=!0){if(!this.plugin.settings.disablePopups)return new Pa.Notice(r,i?this.noticeLength:void 0)}};async function*oG(t){yield new Uint8Array(t)}async function lG(t){let e=new ReadableStream({async start(i){for await(let n of t)i.enqueue(n);i.close()}});return await new Response(e).arrayBuffer()}p();var GF=Mt(Sh()),ei=Mt(require("fs/promises")),Qn=require("obsidian"),Ge=Mt(require("path")),Mu=require("path");p();var Mh=Mt(nR(),1),Fh=Mt(Sh(),1),P$=require("child_process"),dF=Mt(Yw(),1),xl=Mt(Yw(),1),BF=require("node:events"),p0=Object.defineProperty,TG=Object.getOwnPropertyDescriptor,m0=Object.getOwnPropertyNames,CG=Object.prototype.hasOwnProperty,Y=(t,e)=>function(){return t&&(e=(0,t[m0(t)[0]])(t=0)),e},PG=(t,e)=>function(){return e||(0,t[m0(t)[0]])((e={exports:{}}).exports,e),e.exports},vt=(t,e)=>{for(var r in e)p0(t,r,{get:e[r],enumerable:!0})},RG=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of m0(e))!CG.call(t,n)&&n!==r&&p0(t,n,{get:()=>e[n],enumerable:!(i=TG(e,n))||i.enumerable});return t},ut=t=>RG(p0({},"__esModule",{value:!0}),t);function $G(...t){let e=new String(t);return Oh.set(e,t),e}function Ph(t){return t instanceof String&&Oh.has(t)}function sR(t){return Oh.get(t)||[]}var Oh,Pu=Y({"src/lib/args/pathspec.ts"(){"use strict";Oh=new WeakMap}}),Rr,zs=Y({"src/lib/errors/git-error.ts"(){"use strict";Rr=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Ru,El=Y({"src/lib/errors/git-response-error.ts"(){"use strict";zs(),Ru=class extends Rr{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),DR,LR=Y({"src/lib/errors/task-configuration-error.ts"(){"use strict";zs(),DR=class extends Rr{constructor(t){super(void 0,t)}}}});function BR(t){return typeof t!="function"?Ma:t}function NR(t){return typeof t=="function"&&t!==Ma}function HR(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function UR(t,e=0){return GR(t)&&t.length>e?t[e]:void 0}function Oa(t,e=0){if(GR(t)&&t.length>e)return t[t.length-1-e]}function GR(t){return!!(t&&typeof t.length=="number")}function $u(t="",e=!0,r=` +`){return t.split(r).reduce((i,n)=>{let s=e?n.trim():n;return s&&i.push(s),i},[])}function g0(t,e){return $u(t,!0).map(r=>e(r))}function v0(t){return(0,Mh.exists)(t,Mh.FOLDER)}function Oe(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function jR(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Dh(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function mn(t){return Array.isArray(t)?t:[t]}function qR(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function zR(t){return mn(t).map(String)}function Ve(t,e=0){if(t==null)return e;let r=parseInt(t,10);return isNaN(r)?e:r}function Tu(t,e){let r=[];for(let i=0,n=t.length;ir in t?{[r]:t[r]}:{}))}function t0(t=0){return new Promise(e=>setTimeout(e,t))}function r0(t){if(t!==!1)return t}var Sl,Ma,Fu,Lh=Y({"src/lib/utils/util.ts"(){"use strict";Sl="\0",Ma=()=>{},Fu=Object.prototype.toString.call.bind(Object.prototype.toString)}});function gn(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function i0(t,e){let r=Ph(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function Bh(t){return!!t&&Fu(t)==="[object Object]"}function WR(t){return typeof t=="function"}var Iu,er,YR,Rh,w0,XR=Y({"src/lib/utils/argument-filters.ts"(){"use strict";Lh(),Pu(),Iu=t=>Array.isArray(t),er=t=>typeof t=="string",YR=t=>Array.isArray(t)&&t.every(er),Rh=t=>er(t)||Array.isArray(t)&&t.every(er),w0=t=>t==null||"number|boolean|function".includes(typeof t)?!1:Array.isArray(t)||typeof t=="string"||typeof t.length=="number"}}),n0,FG=Y({"src/lib/utils/exit-codes.ts"(){"use strict";n0=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(n0||{})}}),$h,IG=Y({"src/lib/utils/git-output-streams.ts"(){"use strict";$h=class ZR{constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new ZR(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),me,qs,OG=Y({"src/lib/utils/line-parser.ts"(){"use strict";me=class{constructor(t,e){this.matches=[],this.parse=(r,i)=>(this.resetMatches(),this._regExp.every((n,s)=>this.addMatch(n,s,r(s)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}useMatches(t,e){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let i=r&&t.exec(r);return i&&this.pushMatch(e,i),!!i}pushMatch(t,e){this.matches.push(...e.slice(1))}},qs=class extends me{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 KR(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...QR},...t.filter(i=>typeof i=="object"&&i));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var QR,MG=Y({"src/lib/utils/simple-git-options.ts"(){"use strict";QR={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function y0(t,e=[]){return Bh(t)?Object.keys(t).reduce((r,i)=>{let n=t[i];if(Ph(n))r.push(n);else if(i0(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n))for(let s of n)i0(s,["string","number"])||r.push(i+"="+s);else r.push(i);return r},e):e}function Cr(t,e=0,r=!1){let i=[];for(let n=0,s=e<0?t.length:e;n{for(let s=$u(n,i),a=0,o=s.length;a{if(!(a+c>=o))return s[a+c]};e.some(({parse:c})=>c(l,t))}}),t}var BG=Y({"src/lib/utils/task-parser.ts"(){"use strict";Lh()}}),JR={};vt(JR,{ExitCodes:()=>n0,GitOutputStreams:()=>$h,LineParser:()=>me,NOOP:()=>Ma,NULL:()=>Sl,RemoteLineParser:()=>qs,append:()=>Oe,appendTaskOptions:()=>y0,asArray:()=>mn,asCamelCase:()=>qR,asFunction:()=>BR,asNumber:()=>Ve,asStringArray:()=>zR,bufferToString:()=>Cu,callTaskParser:()=>s0,createInstanceConfig:()=>KR,delay:()=>t0,filterArray:()=>Iu,filterFunction:()=>WR,filterHasLength:()=>w0,filterPlainObject:()=>Bh,filterPrimitives:()=>i0,filterString:()=>er,filterStringArray:()=>YR,filterStringOrStringArray:()=>Rh,filterType:()=>gn,first:()=>UR,folderExists:()=>v0,forEachLineWithContent:()=>g0,getTrailingOptions:()=>Cr,including:()=>jR,isUserFunction:()=>NR,last:()=>Oa,objectToString:()=>Fu,orVoid:()=>r0,parseStringResponse:()=>$r,pick:()=>VR,prefixedArray:()=>Tu,remove:()=>Dh,splitOn:()=>HR,toLinesWithContent:()=>$u,trailingFunctionArgument:()=>ft,trailingOptionsArgument:()=>b0});var de=Y({"src/lib/utils/index.ts"(){"use strict";XR(),FG(),IG(),OG(),MG(),LG(),BG(),Lh()}}),e$={};vt(e$,{CheckRepoActions:()=>a0,checkIsBareRepoTask:()=>r$,checkIsRepoRootTask:()=>t$,checkIsRepoTask:()=>NG});function NG(t){switch(t){case"bare":return r$();case"root":return t$()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:Nh,parser:_0}}function t$(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:Nh,parser(e){return/^\.(git)?$/.test(e.trim())}}}function r$(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:Nh,parser:_0}}function HG(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var a0,Nh,_0,i$=Y({"src/lib/tasks/check-is-repo.ts"(){"use strict";de(),a0=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(a0||{}),Nh=({exitCode:t},e,r,i)=>{if(t===128&&HG(e))return r(Buffer.from("false"));i(e)},_0=t=>t.trim()==="true"}});function UG(t,e){let r=new n$(t),i=t?a$:s$;return $u(e).forEach(n=>{let s=n.replace(i,"");r.paths.push(s),(o$.test(s)?r.folders:r.files).push(s)}),r}var n$,s$,a$,o$,GG=Y({"src/lib/responses/CleanSummary.ts"(){"use strict";de(),n$=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},s$=/^[a-z]+\s*/i,a$=/^[a-z]+\s+[a-z]+\s*/i,o$=/\/$/}}),o0={};vt(o0,{EMPTY_COMMANDS:()=>Hh,adhocExecTask:()=>l$,configurationErrorTask:()=>Pr,isBufferTask:()=>u$,isEmptyTask:()=>f$,straightThroughBufferTask:()=>c$,straightThroughStringTask:()=>mr});function l$(t){return{commands:Hh,format:"empty",parser:t}}function Pr(t){return{commands:Hh,format:"empty",parser(){throw typeof t=="string"?new DR(t):t}}}function mr(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}function c$(t){return{commands:t,format:"buffer",parser(e){return e}}}function u$(t){return t.format==="buffer"}function f$(t){return t.format==="empty"||!t.commands.length}var Hh,gt=Y({"src/lib/tasks/task.ts"(){"use strict";LR(),Hh=[]}}),d$={};vt(d$,{CONFIG_ERROR_INTERACTIVE_MODE:()=>x0,CONFIG_ERROR_MODE_REQUIRED:()=>S0,CONFIG_ERROR_UNKNOWN_OPTION:()=>E0,CleanOptions:()=>Ia,cleanTask:()=>h$,cleanWithOptionsTask:()=>jG,isCleanOptionsArray:()=>qG});function jG(t,e){let{cleanMode:r,options:i,valid:n}=zG(t);return r?n.options?(i.push(...e),i.some(YG)?Pr(x0):h$(r,i)):Pr(E0+JSON.stringify(t)):Pr(S0)}function h$(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(i){return UG(t==="n",i)}}}function qG(t){return Array.isArray(t)&&t.every(e=>k0.has(e))}function zG(t){let e,r=[],i={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(n=>{VG(n)?(e=n,i.cleanMode=!0):i.options=i.options&&WG(r[r.length]=`-${n}`)}),{cleanMode:e,options:r,valid:i}}function VG(t){return t==="f"||t==="n"}function WG(t){return/^-[a-z]$/i.test(t)&&k0.has(t.charAt(1))}function YG(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var x0,S0,E0,Ia,k0,p$=Y({"src/lib/tasks/clean.ts"(){"use strict";GG(),de(),gt(),x0="Git clean interactive mode is not supported",S0='Git clean mode parameter ("n" or "f") is required',E0="Git clean unknown option found in: ",Ia=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(Ia||{}),k0=new Set(["i",...zR(Object.values(Ia))])}});function XG(t){let e=new g$;for(let r of m$(t))e.addValue(r.file,String(r.key),r.value);return e}function ZG(t,e){let r=null,i=[],n=new Map;for(let s of m$(t,e))s.key===e&&(i.push(r=s.value),n.has(s.file)||n.set(s.file,[]),n.get(s.file).push(r));return{key:e,paths:Array.from(n.keys()),scopes:n,value:r,values:i}}function KG(t){return t.replace(/^(file):/,"")}function*m$(t,e=null){let r=t.split("\0");for(let i=0,n=r.length-1;iObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=Oa(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let i=this.addFile(t);i.hasOwnProperty(e)?Array.isArray(i[e])?i[e].push(r):i[e]=[i[e],r]:i[e]=r,this._all=void 0}}}});function Xw(t,e){return typeof t=="string"&&l0.hasOwnProperty(t)?t:e}function JG(t,e,r,i){let n=["config",`--${i}`];return r&&n.push("--add"),n.push(t,e),{commands:n,format:"utf-8",parser(s){return s}}}function ej(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(i){return ZG(i,t)}}}function tj(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return XG(r)}}}function rj(){return{addConfig(t,e,...r){return this._runTask(JG(t,e,r[0]===!0,Xw(r[1],"local")),ft(arguments))},getConfig(t,e){return this._runTask(ej(t,Xw(e,void 0)),ft(arguments))},listConfig(...t){return this._runTask(tj(Xw(t[0],void 0)),ft(arguments))}}}var l0,v$=Y({"src/lib/tasks/config.ts"(){"use strict";QG(),de(),l0=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(l0||{})}});function ij(t){return w$.has(t)}var Zw,w$,y$=Y({"src/lib/tasks/diff-name-status.ts"(){"use strict";Zw=(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))(Zw||{}),w$=new Set(Object.values(Zw))}});function nj(...t){return new _$().param(...t)}function sj(t){let e=new Set,r={};return g0(t,i=>{let[n,s,a]=i.split(Sl);e.add(n),(r[n]=r[n]||[]).push({line:Ve(s),path:n,preview:a})}),{paths:e,results:r}}function aj(){return{grep(t){let e=ft(arguments),r=Cr(arguments);for(let n of b$)if(r.includes(n))return this._runTask(Pr(`git.grep: use of "${n}" is not supported.`),e);typeof t=="string"&&(t=nj().param(t));let i=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:i,format:"utf-8",parser(n){return sj(n)}},e)}}}var b$,Au,aR,_$,x$=Y({"src/lib/tasks/grep.ts"(){"use strict";de(),gt(),b$=["-h"],Au=Symbol("grepQuery"),_$=class{constructor(){this[aR]=[]}*[(aR=Au,Symbol.iterator)](){for(let t of this[Au])yield t}and(...t){return t.length&&this[Au].push("--and","(",...Tu(t,"-e"),")"),this}param(...t){return this[Au].push(...Tu(t,"-e")),this}}}}),S$={};vt(S$,{ResetMode:()=>Ah,getResetMode:()=>lj,resetTask:()=>oj});function oj(t,e){let r=["reset"];return E$(t)&&r.push(`--${t}`),r.push(...e),mr(r)}function lj(t){if(E$(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function E$(t){return k$.includes(t)}var Ah,k$,A$=Y({"src/lib/tasks/reset.ts"(){"use strict";gt(),Ah=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Ah||{}),k$=Array.from(Object.values(Ah))}});function cj(){return(0,Fh.default)("simple-git")}function oR(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(i,...n)=>{t(i,...n),r(i,...n)}:t:(i,...n)=>{t(`%s ${i}`,e,...n),r&&r(i,...n)}}function uj(t,e,{namespace:r}){if(typeof t=="string")return t;let i=e&&e.namespace||"";return i.startsWith(r)?i.substr(r.length+1):i||r}function A0(t,e,r,i=cj()){let n=t&&`[${t}]`||"",s=[],a=typeof e=="string"?i.extend(e):e,o=uj(gn(e,er),a,i);return c(r);function l(u,f){return Oe(s,A0(t,o.replace(/^[^:]+/,u),f,i))}function c(u){let f=u&&`[${u}]`||"",d=a&&oR(a,f)||Ma,h=oR(i,`${n} ${f}`,d);return Object.assign(a?d:h,{label:t,sibling:l,info:h,step:c})}}var T$=Y({"src/lib/git-logger.ts"(){"use strict";de(),Fh.default.formatters.L=t=>String(w0(t)?t.length:"-"),Fh.default.formatters.B=t=>Buffer.isBuffer(t)?t.toString("utf8"):Fu(t)}}),C$,fj=Y({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;zs(),T$(),C$=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let i=t.getName(r.commands[0]),n=A0(this.logLabel,i);return{task:r,logger:n,name:i}}push(r){let i=this.createProgress(r);return i.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,i),i}fatal(r){for(let[i,{logger:n}]of Array.from(this._queue.entries()))i===r.task?(n.info("Failed %o",r),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(i);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 i=this.withProgress(r);if(!i)throw new Rr(void 0,"TasksPendingQueue: attempt called for an unknown task");return i.logger("Starting task"),i}static getName(r="empty"){return`task:${r}:${++t.counter}`}},t.counter=0,t)}});function Fa(t,e){return{method:UR(t.commands)||"",commands:e}}function dj(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(Buffer.from(String(r.stack),"ascii"))}}function lR(t,e,r,i){return n=>{r("%s received %L bytes",e,n),i("%B",n),t.push(n)}}var c0,hj=Y({"src/lib/runners/git-executor-chain.ts"(){"use strict";zs(),gt(),de(),fj(),c0=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new C$}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:i}=this._queue.attempt(t);return await(f$(t)?this.attemptEmptyTask(t,i):this.attemptRemoteTask(t,i))}catch(i){throw this.onFatalException(t,i)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof Rr?Object.assign(e,{task:t}):new Rr(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",Fa(t,t.commands)),i=this._plugins.exec("spawn.args",[...t.commands],Fa(t,t.commands)),n=await this.gitResponse(t,r,i,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,i,n,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),u$(t)?s0(t.parser,s):s0(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,i){let{exitCode:n,rejection:s,stdOut:a,stdErr:o}=r;return new Promise((l,c)=>{i("Preparing to handle process response exitCode=%d stdOut=",n);let{error:u}=this._plugins.exec("task.error",{error:s},{...Fa(t,e),...r});if(u&&t.onError)return i.info("exitCode=%s handling with custom error handler"),t.onError(r,u,f=>{i.info("custom error handler treated as success"),i("custom error returned a %s",Fu(f)),l(new $h(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(o)))},c);if(u)return i.info("handling as error: exitCode=%s stdErr=%s rejection=%o",n,o.length,s),c(u);i.info("retrieving task output complete"),l(new $h(Buffer.concat(a),Buffer.concat(o)))})}async gitResponse(t,e,r,i,n){let s=n.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Fa(t,t.commands));return new Promise(o=>{let l=[],c=[];n.info("%s %o",e,r),n("%O",a);let u=this._beforeSpawn(t,r);if(u)return o({stdOut:l,stdErr:c,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...Fa(t,r),kill(d){u=d||u}});let f=(0,P$.spawn)(e,r,a);f.stdout.on("data",lR(l,"stdOut",n,s.step("stdOut"))),f.stderr.on("data",lR(c,"stdErr",n,s.step("stdErr"))),f.on("error",dj(c,n)),i&&(n("Passing child process stdOut/stdErr to custom outputHandler"),i(e,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...Fa(t,r),spawned:f,close(d,h){o({stdOut:l,stdErr:c,exitCode:d,rejection:u||h})},kill(d){f.killed||(u=d,f.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...Fa(t,e),kill(i){r=i||r}}),r}}}}),R$={};vt(R$,{GitExecutor:()=>$$});var $$,pj=Y({"src/lib/runners/git-executor.ts"(){"use strict";hj(),$$=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new c0(this,this._scheduler,this._plugins)}chain(){return new c0(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function mj(t,e,r=Ma){let i=s=>{r(null,s)},n=s=>{(s==null?void 0:s.task)===t&&r(s instanceof Ru?gj(s):s,void 0)};e.then(i,n)}function gj(t){let e=i=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${i} should be GitResponseError.git.${i}, this will no longer be available in version 3`),e=Ma};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(i,n){return n in t||(i[n]={enumerable:!1,configurable:!1,get(){return e(n),t.git[n]}}),i}}var vj=Y({"src/lib/task-callback.ts"(){"use strict";El(),de()}});function cR(t,e){return l$(r=>{if(!v0(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var wj=Y({"src/lib/tasks/change-working-directory.ts"(){"use strict";de(),gt()}});function Kw(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=Dh(e,"-B")),mr(e)}function yj(){return{checkout(){return this._runTask(Kw(Cr(arguments,1)),ft(arguments))},checkoutBranch(t,e){return this._runTask(Kw(["-b",t,e,...Cr(arguments)]),ft(arguments))},checkoutLocalBranch(t){return this._runTask(Kw(["-b",t,...Cr(arguments)]),ft(arguments))}}}var bj=Y({"src/lib/tasks/checkout.ts"(){"use strict";de(),gt()}});function _j(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function xj(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return $r(_j(),[F$],t)}})}}}var F$,Sj=Y({"src/lib/tasks/count-objects.ts"(){"use strict";de(),F$=new me(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let i=qR(e);t.hasOwnProperty(i)&&(t[i]=Ve(r))})}});function Ej(t){return $r({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},I$,t)}var I$,kj=Y({"src/lib/parsers/parse-commit.ts"(){"use strict";de(),I$=[new me(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,i])=>{t.branch=e,t.commit=i,t.root=!!r}),new me(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),i=r.pop();!i||!i.includes("@")||(t.author={email:i.substr(0,i.length-1),name:r.join("<").trim()})}),new me(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(i,10)||0}),new me(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0;let n=parseInt(r,10)||0;i==="-"?t.summary.deletions=n:i==="+"&&(t.summary.insertions=n)})]}});function Aj(t,e,r){return{commands:["-c","core.abbrev=40","commit",...Tu(t,"-m"),...e,...r],format:"utf-8",parser:Ej}}function Tj(){return{commit(e,...r){let i=ft(arguments),n=t(e)||Aj(mn(e),mn(gn(r[0],Rh,[])),[...gn(r[1],Iu,[]),...Cr(arguments,0,!0)]);return this._runTask(n,i)}};function t(e){return!Rh(e)&&Pr("git.commit: requires the commit message to be supplied as a string/string[]")}}var Cj=Y({"src/lib/tasks/commit.ts"(){"use strict";kj(),de(),gt()}});function Pj(){return{firstCommit(){return this._runTask(mr(["rev-list","--max-parents=0","HEAD"],!0),ft(arguments))}}}var Rj=Y({"src/lib/tasks/first-commit.ts"(){"use strict";de(),gt()}});function $j(t,e){let r=["hash-object",t];return e&&r.push("-w"),mr(r,!0)}var Fj=Y({"src/lib/tasks/hash-object.ts"(){"use strict";gt()}});function Ij(t,e,r){let i=String(r).trim(),n;if(n=O$.exec(i))return new Th(t,e,!1,n[1]);if(n=M$.exec(i))return new Th(t,e,!0,n[1]);let s="",a=i.split(" ");for(;a.length;)if(a.shift()==="in"){s=a.join(" ");break}return new Th(t,e,/^re/i.test(i),s)}var Th,O$,M$,Oj=Y({"src/lib/responses/InitSummary.ts"(){"use strict";Th=class{constructor(t,e,r,i){this.bare=t,this.path=e,this.existing=r,this.gitDir=i}},O$=/^Init.+ repository in (.+)$/,M$=/^Rein.+ in (.+)$/}});function Mj(t){return t.includes(T0)}function Dj(t=!1,e,r){let i=["init",...r];return t&&!Mj(i)&&i.splice(1,0,T0),{commands:i,format:"utf-8",parser(n){return Ij(i.includes("--bare"),e,n)}}}var T0,Lj=Y({"src/lib/tasks/init.ts"(){"use strict";Oj(),T0="--bare"}});function C0(t){for(let e=0;e$r(new D$,e,r,!1)}var Qw,uR,fR,dR,B$,N$=Y({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Ou(),Nj(),y$(),de(),Qw=[new me(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,i=""])=>{t.files.push({file:e.trim(),changes:Ve(r),insertions:i.replace(/[^+]/g,"").length,deletions:i.replace(/[^-]/g,"").length,binary:!1})}),new me(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,i])=>{t.files.push({file:e.trim(),before:Ve(r),after:Ve(i),binary:!0})}),new me(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let i=/(\d+) i/.exec(r),n=/(\d+) d/.exec(r);t.changed=Ve(e),t.insertions=Ve(i==null?void 0:i[1]),t.deletions=Ve(n==null?void 0:n[1])})],uR=[new me(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,i])=>{let n=Ve(e),s=Ve(r);t.changed++,t.insertions+=n,t.deletions+=s,t.files.push({file:i,changes:n+s,insertions:n,deletions:s,binary:!1})}),new me(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],fR=[new me(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],dR=[new me(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,i,n,s])=>{t.changed++,t.files.push({file:s!=null?s:i,changes:0,insertions:0,deletions:0,binary:!1,status:r0(ij(e)&&e),from:r0(!!s&&i!==s&&i),similarity:Ve(r)})})],B$={"":Qw,"--stat":Qw,"--numstat":uR,"--name-status":dR,"--name-only":fR}}});function Hj(t,e){return e.reduce((r,i,n)=>(r[i]=t[n]||"",r),Object.create({diff:null}))}function H$(t=F0,e=U$,r=""){let i=L$(r);return function(n){let s=$u(n.trim(),!1,R0).map(function(a){let o=a.split($0),l=Hj(o[0].split(t),e);return o.length>1&&o[1].trim()&&(l.diff=i(o[1])),l});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var R0,$0,F0,U$,G$=Y({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";de(),N$(),Ou(),R0="\xF2\xF2\xF2\xF2\xF2\xF2 ",$0=" \xF2\xF2",F0=" \xF2 ",U$=["hash","date","message","refs","author_name","author_email"]}}),j$={};vt(j$,{diffSummaryTask:()=>Uj,validateLogFormatConfig:()=>Uh});function Uj(t){let e=C0(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),Uh(r)||{commands:r,format:"utf-8",parser:L$(e)}}function Uh(t){let e=t.filter(Bj);if(e.length>1)return Pr(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return Pr(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var I0=Y({"src/lib/tasks/diff.ts"(){"use strict";Ou(),N$(),gt()}});function Gj(t,e){let r=[],i=[];return Object.keys(t).forEach(n=>{r.push(n),i.push(String(t[n]))}),[r,i.join(e)]}function jj(t){return Object.keys(t).reduce((e,r)=>(r in u0||(e[r]=t[r]),e),{})}function q$(t={},e=[]){let r=gn(t.splitter,er,F0),i=Bh(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[n,s]=Gj(i,r),a=[],o=[`--pretty=format:${R0}${s}${$0}`,...e],l=t.n||t["max-count"]||t.maxCount;if(l&&o.push(`--max-count=${l}`),t.from||t.to){let c=t.symmetric!==!1?"...":"..";a.push(`${t.from||""}${c}${t.to||""}`)}return er(t.file)&&o.push("--follow",$G(t.file)),y0(jj(t),o),{fields:n,splitter:r,commands:[...o,...a]}}function qj(t,e,r){let i=H$(t,e,C0(r));return{commands:["log",...r],format:"utf-8",parser:i}}function zj(){return{log(...r){let i=ft(arguments),n=q$(b0(arguments),gn(arguments[0],Iu)),s=e(...r)||Uh(n.commands)||t(n);return this._runTask(s,i)}};function t(r){return qj(r.splitter,r.fields,r.commands)}function e(r,i){return er(r)&&er(i)&&Pr("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var u0,z$=Y({"src/lib/tasks/log.ts"(){"use strict";Ou(),Pu(),G$(),de(),gt(),I0(),u0=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(u0||{})}}),Ch,V$,Vj=Y({"src/lib/responses/MergeSummary.ts"(){"use strict";Ch=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},V$=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){return this.conflicts.length?`CONFLICTS: ${this.conflicts.join(", ")}`:"OK"}}}}),f0,W$,Wj=Y({"src/lib/responses/PullSummary.ts"(){"use strict";f0=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},W$=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function Jw(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function hR(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Ve(e&&e[1]||"0"),delta:Ve(r&&r[1]||"0")}}var Y$,Yj=Y({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";de(),Y$=[new qs(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=Jw(t.remoteMessages);Object.assign(n,{[i]:Ve(r)})}),new qs(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=Jw(t.remoteMessages);Object.assign(n,{[i]:Ve(r)})}),new qs(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,i])=>{let n=Jw(t.remoteMessages);n.total=hR(e),n.reused=hR(r),n.packReused=Ve(i)})]}});function X$(t,e){return $r({remoteMessages:new K$},Z$,e)}var Z$,K$,Q$=Y({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";de(),Yj(),Z$=[new qs(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...Y$,new qs([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new qs([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,i])=>{t.remoteMessages.vulnerabilities={count:Ve(e),summary:r,url:i}})],K$=class{constructor(){this.all=[]}}}});function Xj(t,e){let r=$r(new W$,J$,[t,e]);return r.message&&r}var pR,mR,gR,vR,J$,wR,O0,eF=Y({"src/lib/parsers/parse-pull.ts"(){"use strict";Wj(),de(),Q$(),pR=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,mR=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,gR=/^(create|delete) mode \d+ (.+)/,vR=[new me(pR,(t,[e,r,i])=>{t.files.push(e),r&&(t.insertions[e]=r.length),i&&(t.deletions[e]=i.length)}),new me(mR,(t,[e,,r,,i])=>r!==void 0||i!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+i||0,!0):!1),new me(gR,(t,[e,r])=>{Oe(t.files,r),Oe(e==="create"?t.created:t.deleted,r)})],J$=[new me(/^from\s(.+)$/i,(t,[e])=>void(t.remote=e)),new me(/^fatal:\s(.+)$/,(t,[e])=>void(t.message=e)),new me(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,i,n])=>{t.branch.local=i,t.hash.local=e,t.branch.remote=n,t.hash.remote=r})],wR=(t,e)=>$r(new f0,vR,[t,e]),O0=(t,e)=>Object.assign(new f0,wR(t,e),X$(t,e))}}),yR,tF,bR,Zj=Y({"src/lib/parsers/parse-merge.ts"(){"use strict";Vj(),de(),eF(),yR=[new me(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new me(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Ch(e,r))}),new me(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,i])=>{t.conflicts.push(new Ch(e,r,{deleteRef:i}))}),new me(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Ch(e,null))}),new me(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],tF=(t,e)=>Object.assign(bR(t,e),O0(t,e)),bR=t=>$r(new V$,yR,t)}});function _R(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let i=tF(e,r);if(i.failed)throw new Ru(i);return i}}:Pr("Git.merge requires at least one option")}var Kj=Y({"src/lib/tasks/merge.ts"(){"use strict";El(),Zj(),gt()}});function Qj(t,e,r){let i=r.includes("deleted"),n=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:i,tag:n,branch:!n,new:!s,alreadyUpdated:s,local:t,remote:e}}var xR,rF,SR,Jj=Y({"src/lib/parsers/parse-push.ts"(){"use strict";de(),Q$(),xR=[new me(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new me(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new me(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,i])=>{t.pushed.push(Qj(e,r,i))}),new me(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,i])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:i}}),new me(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,i,n])=>{t.update={head:{local:e,remote:r},hash:{from:i,to:n}}})],rF=(t,e)=>{let r=SR(t,e),i=X$(t,e);return{...r,...i}},SR=(t,e)=>$r({pushed:[]},xR,[t,e])}}),iF={};vt(iF,{pushTagsTask:()=>eq,pushTask:()=>M0});function eq(t={},e){return Oe(e,"--tags"),M0(t,e)}function M0(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),Dh(r,"-v"),Oe(r,"--verbose"),Oe(r,"--porcelain"),{commands:r,format:"utf-8",parser:rF}}var nF=Y({"src/lib/tasks/push.ts"(){"use strict";Jj(),de()}});function tq(){return{showBuffer(){let t=["show",...Cr(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(c$(t),ft(arguments))},show(){let t=["show",...Cr(arguments,1)];return this._runTask(mr(t),ft(arguments))}}}var rq=Y({"src/lib/tasks/show.ts"(){"use strict";de(),gt()}}),ER,sF,iq=Y({"src/lib/responses/FileStatusSummary.ts"(){"use strict";ER=/^(.+)\0(.+)$/,sF=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let i=ER.exec(t)||[null,t,t];this.from=i[2]||"",this.path=i[1]||""}}}}});function kR(t){let[e,r]=t.split(Sl);return{from:r||e,to:e}}function Jr(t,e,r){return[`${t}${e}`,r]}function e0(t,...e){return e.map(r=>Jr(t,r,(i,n)=>Oe(i.conflicted,n)))}function nq(t,e){let r=e.trim();switch(" "){case r.charAt(2):return i(r.charAt(0),r.charAt(1),r.substr(3));case r.charAt(1):return i(" ",r.charAt(0),r.substr(2));default:return}function i(n,s,a){let o=`${n}${s}`,l=aF.get(o);l&&l(t,a),o!=="##"&&o!=="!!"&&t.files.push(new sF(a,n,s))}}var AR,aF,oF,sq=Y({"src/lib/responses/StatusSummary.ts"(){"use strict";de(),iq(),AR=class{constructor(){this.not_added=[],this.conflicted=[],this.created=[],this.deleted=[],this.ignored=void 0,this.modified=[],this.renamed=[],this.files=[],this.staged=[],this.ahead=0,this.behind=0,this.current=null,this.tracking=null,this.detached=!1,this.isClean=()=>!this.files.length}},aF=new Map([Jr(" ","A",(t,e)=>Oe(t.created,e)),Jr(" ","D",(t,e)=>Oe(t.deleted,e)),Jr(" ","M",(t,e)=>Oe(t.modified,e)),Jr("A"," ",(t,e)=>Oe(t.created,e)&&Oe(t.staged,e)),Jr("A","M",(t,e)=>Oe(t.created,e)&&Oe(t.staged,e)&&Oe(t.modified,e)),Jr("D"," ",(t,e)=>Oe(t.deleted,e)&&Oe(t.staged,e)),Jr("M"," ",(t,e)=>Oe(t.modified,e)&&Oe(t.staged,e)),Jr("M","M",(t,e)=>Oe(t.modified,e)&&Oe(t.staged,e)),Jr("R"," ",(t,e)=>{Oe(t.renamed,kR(e))}),Jr("R","M",(t,e)=>{let r=kR(e);Oe(t.renamed,r),Oe(t.modified,r.to)}),Jr("!","!",(t,e)=>{Oe(t.ignored=t.ignored||[],e)}),Jr("?","?",(t,e)=>Oe(t.not_added,e)),...e0("A","A","U"),...e0("D","D","U"),...e0("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,i=/behind (\d+)/,n=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,a=/\son\s([\S]+)$/,o;o=r.exec(e),t.ahead=o&&+o[1]||0,o=i.exec(e),t.behind=o&&+o[1]||0,o=n.exec(e),t.current=o&&o[1],o=s.exec(e),t.tracking=o&&o[1],o=a.exec(e),t.current=o&&o[1]||t.current,t.detached=/\(no branch\)/.test(e)}]]),oF=function(t){let e=t.split(Sl),r=new AR;for(let i=0,n=e.length;i!lF.includes(r))],parser(r){return oF(r)}}}var lF,oq=Y({"src/lib/tasks/status.ts"(){"use strict";sq(),lF=["--null","-z"]}});function Ih(t=0,e=0,r=0,i="",n=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:i,installed:n},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function lq(){return Ih(0,0,0,"",!1)}function cq(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:uq,onError(t,e,r,i){if(t.exitCode===-2)return r(Buffer.from(D0));i(e)}})}}}function uq(t){return t===D0?lq():$r(Ih(0,0,0,t),cF,t)}var D0,cF,fq=Y({"src/lib/tasks/version.ts"(){"use strict";de(),D0="installed=false",cF=[new me(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,i,n=""])=>{Object.assign(t,Ih(Ve(e),Ve(r),Ve(i),n))}),new me(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,i,n=""])=>{Object.assign(t,Ih(Ve(e),Ve(r),i,n))})]}}),uF={};vt(uF,{SimpleGitApi:()=>d0});var d0,dq=Y({"src/lib/simple-git-api.ts"(){"use strict";vj(),wj(),bj(),Sj(),Cj(),v$(),Rj(),x$(),Fj(),Lj(),z$(),Kj(),nF(),rq(),oq(),gt(),fq(),de(),d0=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),i=r.push(t);return e&&mj(t,i,e),Object.create(this,{then:{value:i.then.bind(i)},catch:{value:i.catch.bind(i)},_executor:{value:r}})}add(t){return this._runTask(mr(["add",...mn(t)]),ft(arguments))}cwd(t){let e=ft(arguments);return typeof t=="string"?this._runTask(cR(t,this._executor),e):typeof(t==null?void 0:t.path)=="string"?this._runTask(cR(t.path,t.root&&this._executor||void 0),e):this._runTask(Pr("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask($j(t,e===!0),ft(arguments))}init(t){return this._runTask(Dj(t===!0,this._executor.cwd,Cr(arguments)),ft(arguments))}merge(){return this._runTask(_R(Cr(arguments)),ft(arguments))}mergeFromTo(t,e){return er(t)&&er(e)?this._runTask(_R([t,e,...Cr(arguments)]),ft(arguments,!1)):this._runTask(Pr("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=M0({remote:gn(arguments[0],er),branch:gn(arguments[1],er)},Cr(arguments));return this._runTask(t,ft(arguments))}stash(){return this._runTask(mr(["stash",...Cr(arguments)]),ft(arguments))}status(){return this._runTask(aq(Cr(arguments)),ft(arguments))}},Object.assign(d0.prototype,yj(),Tj(),rj(),xj(),Pj(),aj(),zj(),tq(),cq())}}),fF={};vt(fF,{Scheduler:()=>hF});var TR,hF,hq=Y({"src/lib/runners/scheduler.ts"(){"use strict";de(),T$(),TR=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,dF.createDeferred)();return{promise:e,done:r,id:t}}})(),hF=class{constructor(t=2){this.concurrency=t,this.logger=A0("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=Oe(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),Dh(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Oe(this.pending,TR());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),pF={};vt(pF,{applyPatchTask:()=>pq});function pq(t,e){return mr(["apply",...e,...t])}var mq=Y({"src/lib/tasks/apply-patch.ts"(){"use strict";gt()}});function gq(t,e){return{branch:t,hash:e,success:!0}}function vq(t){return{branch:t,hash:null,success:!1}}var mF,wq=Y({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";mF=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function gF(t,e){return e===1&&h0.test(t)}var CR,h0,PR,Gh,yq=Y({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";wq(),de(),CR=/(\S+)\s+\(\S+\s([^)]+)\)/,h0=/^error[^']+'([^']+)'/m,PR=[new me(CR,(t,[e,r])=>{let i=gq(e,r);t.all.push(i),t.branches[e]=i}),new me(h0,(t,[e])=>{let r=vq(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],Gh=(t,e)=>$r(new mF,PR,[t,e])}}),vF,bq=Y({"src/lib/responses/BranchSummary.ts"(){"use strict";vF=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,i,n){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:i,label:n}}}}});function RR(t){return t?t.charAt(0):""}function wF(t){return $r(new vF,yF,t)}var yF,_q=Y({"src/lib/parsers/parse-branch.ts"(){"use strict";bq(),de(),yF=[new me(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,i,n])=>{t.push(RR(e),!0,r,i,n)}),new me(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,i,n])=>{t.push(RR(e),!1,r,i,n)})]}}),bF={};vt(bF,{branchLocalTask:()=>Sq,branchTask:()=>xq,containsDeleteBranchCommand:()=>_F,deleteBranchTask:()=>kq,deleteBranchesTask:()=>Eq});function _F(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}function xq(t){let e=_F(t),r=["branch",...t];return r.length===1&&r.push("-a"),r.includes("-v")||r.splice(1,0,"-v"),{format:"utf-8",commands:r,parser(i,n){return e?Gh(i,n).all[0]:wF(i)}}}function Sq(){return{format:"utf-8",commands:["branch","-v"],parser:wF}}function Eq(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,i){return Gh(r,i)},onError({exitCode:r,stdOut:i},n,s,a){if(!gF(String(n),r))return a(n);s(i)}}}function kq(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(i,n){return Gh(i,n).branches[t]},onError({exitCode:i,stdErr:n,stdOut:s},a,o,l){if(!gF(String(a),i))return l(a);throw new Ru(r.parser(Cu(s),Cu(n)),String(a))}};return r}var Aq=Y({"src/lib/tasks/branch.ts"(){"use strict";El(),yq(),_q(),de()}}),xF,Tq=Y({"src/lib/responses/CheckIgnore.ts"(){"use strict";xF=t=>t.split(/\n/g).map(e=>e.trim()).filter(e=>!!e)}}),SF={};vt(SF,{checkIgnoreTask:()=>Cq});function Cq(t){return{commands:["check-ignore",...t],format:"utf-8",parser:xF}}var Pq=Y({"src/lib/tasks/check-ignore.ts"(){"use strict";Tq()}}),EF={};vt(EF,{cloneMirrorTask:()=>$q,cloneTask:()=>kF});function Rq(t){return/^--upload-pack(=|$)/.test(t)}function kF(t,e,r){let i=["clone",...r];return er(t)&&i.push(t),er(e)&&i.push(e),i.find(Rq)?Pr("git.fetch: potential exploit argument blocked."):mr(i)}function $q(t,e,r){return Oe(r,"--mirror"),kF(t,e,r)}var Fq=Y({"src/lib/tasks/clone.ts"(){"use strict";gt(),de()}});function Iq(t,e){return $r({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},AF,[t,e])}var AF,Oq=Y({"src/lib/parsers/parse-fetch.ts"(){"use strict";de(),AF=[new me(/From (.+)$/,(t,[e])=>{t.remote=e}),new me(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new me(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new me(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new me(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,i,n])=>{t.updated.push({name:i,tracking:n,to:r,from:e})})]}}),TF={};vt(TF,{fetchTask:()=>Dq});function Mq(t){return/^--upload-pack(=|$)/.test(t)}function Dq(t,e,r){let i=["fetch",...r];return t&&e&&i.push(t,e),i.find(Mq)?Pr("git.fetch: potential exploit argument blocked."):{commands:i,format:"utf-8",parser:Iq}}var Lq=Y({"src/lib/tasks/fetch.ts"(){"use strict";Oq(),gt()}});function Bq(t){return $r({moves:[]},CF,t)}var CF,Nq=Y({"src/lib/parsers/parse-move.ts"(){"use strict";de(),CF=[new me(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),PF={};vt(PF,{moveTask:()=>Hq});function Hq(t,e){return{commands:["mv","-v",...mn(t),e],format:"utf-8",parser:Bq}}var Uq=Y({"src/lib/tasks/move.ts"(){"use strict";Nq(),de()}}),RF={};vt(RF,{pullTask:()=>Gq});function Gq(t,e,r){let i=["pull",...r];return t&&e&&i.splice(1,0,t,e),{commands:i,format:"utf-8",parser(n,s){return O0(n,s)},onError(n,s,a,o){let l=Xj(Cu(n.stdOut),Cu(n.stdErr));if(l)return o(new Ru(l));o(s)}}}var jq=Y({"src/lib/tasks/pull.ts"(){"use strict";El(),eF(),de()}});function qq(t){let e={};return $F(t,([r])=>e[r]={name:r}),Object.values(e)}function zq(t){let e={};return $F(t,([r,i,n])=>{e.hasOwnProperty(r)||(e[r]={name:r,refs:{fetch:"",push:""}}),n&&i&&(e[r].refs[n.replace(/[^a-z]/g,"")]=i)}),Object.values(e)}function $F(t,e){g0(t,r=>e(r.split(/\s+/)))}var Vq=Y({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";de()}}),FF={};vt(FF,{addRemoteTask:()=>Wq,getRemotesTask:()=>Yq,listRemotesTask:()=>Xq,remoteTask:()=>Zq,removeRemoteTask:()=>Kq});function Wq(t,e,r){return mr(["remote","add",...r,t,e])}function Yq(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?zq:qq}}function Xq(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),mr(e)}function Zq(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),mr(e)}function Kq(t){return mr(["remote","remove",t])}var Qq=Y({"src/lib/tasks/remote.ts"(){"use strict";Vq(),gt()}}),IF={};vt(IF,{stashListTask:()=>Jq});function Jq(t={},e){let r=q$(t),i=["stash","list",...r.commands,...e],n=H$(r.splitter,r.fields,C0(i));return Uh(i)||{commands:i,format:"utf-8",parser:n}}var ez=Y({"src/lib/tasks/stash-list.ts"(){"use strict";Ou(),G$(),I0(),z$()}}),OF={};vt(OF,{addSubModuleTask:()=>tz,initSubModuleTask:()=>rz,subModuleTask:()=>jh,updateSubModuleTask:()=>iz});function tz(t,e){return jh(["add",t,e])}function rz(t){return jh(["init",...t])}function jh(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),mr(e)}function iz(t){return jh(["update",...t])}var nz=Y({"src/lib/tasks/sub-module.ts"(){"use strict";gt()}});function sz(t,e){let r=isNaN(t),i=isNaN(e);return r!==i?r?1:-1:r?MF(t,e):0}function MF(t,e){return t===e?0:t>e?1:-1}function az(t){return t.trim()}function kh(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var $R,DF,oz=Y({"src/lib/responses/TagList.ts"(){"use strict";$R=class{constructor(t,e){this.all=t,this.latest=e}},DF=function(t,e=!1){let r=t.split(` +`).map(az).filter(Boolean);e||r.sort(function(n,s){let a=n.split("."),o=s.split(".");if(a.length===1||o.length===1)return sz(kh(a[0]),kh(o[0]));for(let l=0,c=Math.max(a.length,o.length);ln.indexOf(".")>=0);return new $R(r,i)}}}),LF={};vt(LF,{addAnnotatedTagTask:()=>uz,addTagTask:()=>cz,tagListTask:()=>lz});function lz(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return DF(r,e)}}}function cz(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function uz(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var fz=Y({"src/lib/tasks/tag.ts"(){"use strict";oz()}}),dz=PG({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(pj(),ut(R$)),{SimpleGitApi:i}=(dq(),ut(uF)),{Scheduler:n}=(hq(),ut(fF)),{configurationErrorTask:s}=(gt(),ut(o0)),{asArray:a,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:d,trailingFunctionArgument:h,trailingOptionsArgument:m}=(de(),ut(JR)),{applyPatchTask:g}=(mq(),ut(pF)),{branchTask:v,branchLocalTask:w,deleteBranchesTask:b,deleteBranchTask:k}=(Aq(),ut(bF)),{checkIgnoreTask:x}=(Pq(),ut(SF)),{checkIsRepoTask:E}=(i$(),ut(e$)),{cloneTask:A,cloneMirrorTask:y}=(Fq(),ut(EF)),{cleanWithOptionsTask:S,isCleanOptionsArray:_}=(p$(),ut(d$)),{diffSummaryTask:T}=(I0(),ut(j$)),{fetchTask:P}=(Lq(),ut(TF)),{moveTask:D}=(Uq(),ut(PF)),{pullTask:B}=(jq(),ut(RF)),{pushTagsTask:N}=(nF(),ut(iF)),{addRemoteTask:ce,getRemotesTask:Pe,listRemotesTask:ve,remoteTask:se,removeRemoteTask:xe}=(Qq(),ut(FF)),{getResetMode:we,resetTask:z}=(A$(),ut(S$)),{stashListTask:Q}=(ez(),ut(IF)),{addSubModuleTask:j,initSubModuleTask:Le,subModuleTask:lr,updateSubModuleTask:It}=(nz(),ut(OF)),{addAnnotatedTagTask:Fe,addTagTask:At,tagListTask:Tt}=(fz(),ut(LF)),{straightThroughBufferTask:jt,straightThroughStringTask:Ze}=(gt(),ut(o0));function q(L,V){this._plugins=V,this._executor=new r(L.baseDir,new n(L.maxConcurrentProcesses),V),this._trimmed=L.trimmed}(q.prototype=Object.create(i.prototype)).constructor=q,q.prototype.customBinary=function(L){return this._plugins.reconfigure("binary",L),this},q.prototype.env=function(L,V){return arguments.length===1&&typeof L=="object"?this._executor.env=L:(this._executor.env=this._executor.env||{})[L]=V,this},q.prototype.stashList=function(L){return this._runTask(Q(m(arguments)||{},o(L)&&L||[]),h(arguments))};function Z(L,V,Te,qe){return typeof Te!="string"?s(`git.${L}() requires a string 'repoPath'`):V(Te,f(qe,c),d(arguments))}q.prototype.clone=function(){return this._runTask(Z("clone",A,...arguments),h(arguments))},q.prototype.mirror=function(){return this._runTask(Z("mirror",y,...arguments),h(arguments))},q.prototype.mv=function(L,V){return this._runTask(D(L,V),h(arguments))},q.prototype.checkoutLatestTag=function(L){var V=this;return this.pull(function(){V.tags(function(Te,qe){V.checkout(qe.latest,L)})})},q.prototype.pull=function(L,V,Te,qe){return this._runTask(B(f(L,c),f(V,c),d(arguments)),h(arguments))},q.prototype.fetch=function(L,V){return this._runTask(P(f(L,c),f(V,c),d(arguments)),h(arguments))},q.prototype.silent=function(L){return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3"),this},q.prototype.tags=function(L,V){return this._runTask(Tt(d(arguments)),h(arguments))},q.prototype.rebase=function(){return this._runTask(Ze(["rebase",...d(arguments)]),h(arguments))},q.prototype.reset=function(L){return this._runTask(z(we(L),d(arguments)),h(arguments))},q.prototype.revert=function(L){let V=h(arguments);return typeof L!="string"?this._runTask(s("Commit must be a string"),V):this._runTask(Ze(["revert",...d(arguments,0,!0),L]),V)},q.prototype.addTag=function(L){let V=typeof L=="string"?At(L):s("Git.addTag requires a tag name");return this._runTask(V,h(arguments))},q.prototype.addAnnotatedTag=function(L,V){return this._runTask(Fe(L,V),h(arguments))},q.prototype.deleteLocalBranch=function(L,V,Te){return this._runTask(k(L,typeof V=="boolean"?V:!1),h(arguments))},q.prototype.deleteLocalBranches=function(L,V,Te){return this._runTask(b(L,typeof V=="boolean"?V:!1),h(arguments))},q.prototype.branch=function(L,V){return this._runTask(v(d(arguments)),h(arguments))},q.prototype.branchLocal=function(L){return this._runTask(w(),h(arguments))},q.prototype.raw=function(L){let V=!Array.isArray(L),Te=[].slice.call(V?arguments:L,0);for(let Ot=0;Ott.removeEventListener("abort",s))}}]:void 0}function mz(t){return typeof t=="string"&&t.trim().toLowerCase()==="-c"}function gz(t,e){if(mz(t)&&/^\s*protocol(.[a-z]+)?.allow/.test(e))throw new Kn(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function vz(t,e){if(/^\s*--(upload|receive)-pack/.test(t))throw new Kn(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(e==="clone"&&/^\s*-u\b/.test(t))throw new Kn(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(e==="push"&&/^\s*--exec\b/.test(t))throw new Kn(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function wz({allowUnsafeProtocolOverride:t=!1,allowUnsafePack:e=!1}={}){return{type:"spawn.args",action(r,i){return r.forEach((n,s)=>{let a=st0(n))).then(a.done)}return{type:"spawn.after",async action(n,{spawned:s,close:a}){var u,f;let o=r(),l=!0,c=()=>void(l=!1);(u=s.stdout)==null||u.on("data",c),(f=s.stderr)==null||f.on("data",c),s.on("error",c),s.on("close",d=>o.close(d)),s.on("exit",d=>o.exit(d));try{await o.result,l&&await t0(50),a(o.exitCode)}catch(d){a(o.exitCode,d)}}}}de();var _z="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",IR="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function xz(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(t)}function OR(t,e){if(t.length<1||t.length>2)throw new Kn(void 0,"binary",_z);if(t.some(xz))if(e)console.warn(IR);else throw new Kn(void 0,"binary",IR);let[i,n]=t;return{binary:i,prefix:n}}function Sz(t,e=["git"],r=!1){let i=OR(mn(e),r);t.on("binary",n=>{i=OR(mn(n),r)}),t.append("spawn.binary",()=>i.binary),t.append("spawn.args",n=>i.prefix?[i.prefix,...n]:n)}zs();function Ez(t){return!!(t.exitCode&&t.stdErr.length)}function kz(t){return Buffer.concat([...t.stdOut,...t.stdErr])}function Az(t=!1,e=Ez,r=kz){return(i,n)=>!t&&i||!e(n)?i:r(n)}function MR(t){return{type:"task.error",action(e,r){let i=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return Buffer.isBuffer(i)?{error:new Rr(void 0,i.toString("utf-8"))}:{error:i}}}}de();var Tz=class{constructor(){this.plugins=new Set,this.events=new BF.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Oe(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return mn(t).forEach(r=>r&&this.plugins.add(Oe(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let i=e,n=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(i=s.action(i,n));return i}};de();function Cz(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,a){return r.includes(a.method)?jR(s,e):s}},{type:"spawn.after",action(s,a){var o;a.commands.includes(e)&&((o=a.spawned.stderr)==null||o.on("data",l=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));c&&t({method:a.method,stage:Pz(c[1]),progress:Ve(c[2]),processed:Ve(c[3]),total:Ve(c[4])})}))}}]}function Pz(t){return String(t.toLowerCase().split(" ",1))||"unknown"}de();function Rz(t){let e=VR(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}function $z({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(i,n){var c,u;let s;function a(){s&&clearTimeout(s),s=setTimeout(l,t)}function o(){var f,d;(f=n.spawned.stdout)==null||f.off("data",a),(d=n.spawned.stderr)==null||d.off("data",a),n.spawned.off("exit",o),n.spawned.off("close",o),s&&clearTimeout(s)}function l(){o(),n.kill(new Kn(void 0,"timeout","block timeout reached"))}r&&((c=n.spawned.stdout)==null||c.on("data",a)),e&&((u=n.spawned.stderr)==null||u.on("data",a)),n.spawned.on("exit",o),n.spawned.on("close",o),a()}}}Pu();function Fz(){return{type:"spawn.args",action(t){let e=[],r;function i(n){(r=r||[]).push(...n)}for(let n=0;nPh(a)&&sR(a)||a));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}de();var Iz=dz();function Oz(t,e){var n;let r=new Tz,i=KR(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!v0(i.baseDir))throw new hz(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(yz(i.config)),r.add(wz(i.unsafe)),r.add(Fz()),r.add(bz(i.completion)),i.abort&&r.add(pz(i.abort)),i.progress&&r.add(Cz(i.progress)),i.timeout&&r.add($z(i.timeout)),i.spawnOptions&&r.add(Rz(i.spawnOptions)),r.add(MR(Az(!0))),i.errors&&r.add(MR(i.errors)),Sz(r,i.binary,(n=i.unsafe)==null?void 0:n.allowUnsafeCustomBinary),new Iz(i,r)}El();var NF=Oz;var Se=class extends vl{constructor(r){super(r);this.useDefaultWindowsGitPath=!1}async setGitInstance(r=!1){var i;if(await this.isGitInstalled()){let n=this.app.vault.adapter,s=n.getBasePath(),a=s;this.plugin.settings.basePath&&(await n.exists((0,Qn.normalizePath)(this.plugin.settings.basePath))?a=Ge.join(s,this.plugin.settings.basePath):r||new Qn.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=a,this.git=NF({baseDir:a,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?Nd:void 0),config:["core.quotepath=off"],unsafe:{allowUnsafeCustomBinary:!0}});let o=this.plugin.localStorage.getPATHPaths(),l=this.plugin.localStorage.getEnvVars(),c=this.plugin.settings.gitDir,u={...process.env};if(o.length>0){let w=o.join(":")+":"+u.PATH;u.PATH=w}c&&(u.GIT_DIR=c);for(let w of l){let[b,k]=w.split("=");u[b]=k}let f="simple-git",d=",",m=((i=localStorage.debug)!=null?i:"").split(d);if(!m.includes(f)&&!m.includes(`-${f}`)&&(m.push(f),GF.default.enable(m.join(d))),await this.git.checkIsRepo()){let w=await this.git.revparse("--show-cdup"),b=(0,Mu.resolve)(a+Mu.sep+w);this.absoluteRepoPath=b,await this.git.cwd(b)}let g=Ge.join(s,this.app.vault.configDir,"plugins","obsidian-git"),v=Ge.join(g,Ta);u.SSH_ASKPASS==null&&(u.SSH_ASKPASS=v),u.SSH_ASKPASS_REQUIRE="force",u.OBSIDIAN_GIT_CREDENTIALS_INPUT=Ge.join(g,Hd),u.SSH_ASKPASS==v&&this.askpass().catch(w=>this.plugin.displayError(w)),u.OBSIDIAN_GIT="1",this.git=this.git.env(u)}}getRelativeVaultPath(r){let n=this.app.vault.adapter.getBasePath(),s=Ge.join(this.absoluteRepoPath,r),a=Ge.relative(n,s);return Qn.Platform.isWin&&(a=a.replace(/\\/g,"/")),a}getRelativeRepoPath(r,i=!0){if(i){let s=this.plugin.app.vault.adapter.getBasePath(),a=this.absoluteRepoPath,o=Ge.join(s,r),l=Ge.relative(a,o);return Qn.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return r}get absPluginConfigPath(){let i=this.app.vault.adapter.getBasePath();return Ge.join(i,this.app.vault.configDir,"plugins","obsidian-git")}get relPluginConfigPath(){return Ge.join(this.app.vault.configDir,"plugins","obsidian-git")}async askpass(){let r=this.app.vault.adapter,i=this.app.vault.configDir+"/plugins/obsidian-git/";await this.addAskPassScriptToExclude(),await ei.writeFile(Ge.join(this.absPluginConfigPath,Ta),jA),await ei.chmod(Ge.join(this.absPluginConfigPath,Ta),493),this.watchAbortController=new AbortController;let{signal:n}=this.watchAbortController;try{let s=ei.watch(this.absPluginConfigPath,{signal:n});for await(let a of s){if(a.filename!=Hd)continue;let o=i+Hd;if(await new Promise(f=>setTimeout(f,200)),!await r.exists(o))continue;let l=await r.read(o),c;l.length>60&&(c=new Qn.Notice(l,999999));let u=await new Qe(this.plugin,{allowEmpty:!0,obscure:!0,placeholder:l.length>60?"Enter a response to the message.":l}).openAndGetResult();c==null||c.hide(),await r.exists(o)&&await r.write(`${o}.response`,u!=null?u:"")}}catch(s){this.plugin.displayError(s),await ei.rm(Ge.join(this.absPluginConfigPath,Ta),{force:!0}),await ei.rm(Ge.join(this.absPluginConfigPath,`${Ta}.response`),{force:!0}),await new Promise(a=>setTimeout(a,5e3)),this.plugin.log("Retry watch for ask pass"),await this.askpass()}}async addAskPassScriptToExclude(){try{if(!await this.git.checkIsRepo())return;let r=await this.git.revparse(["--path-format=absolute","--git-path","info/exclude"]),i=Ge.join(this.app.vault.configDir,"plugins","obsidian-git",Ta),n=this.getRelativeRepoPath(i,!0);(await ei.readFile(r,"utf-8")).split(` +`).some(l=>l.contains(n))||await ei.appendFile(r,n+` +`)}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 i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=await this.git.status(i!=null?["--",i]:[]);this.plugin.setPluginState({gitAction:0});let s=n.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:n.conflicted.map(a=>this.formatPath({path:a}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let i=this.getRelativeRepoPath(r),s=["-C",Ge.dirname(i),"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((i,n,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:"");n.on("data",c=>{o+=c.toString("utf8")}),n.on("end",()=>{let u=o.split(` +`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Mu.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},i=>this.plugin.displayError(i))})}formatPath(r){function i(n){if(n!=null)return n.startsWith('"')&&n.endsWith('"')?n.substring(1,n.length-1):n}return r.from!=null?{from:i(r.from),path:i(r.path)}:{path:i(r.path)}}async blame(r,i,n){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"),n&&a.push("-w");let l=`-C${Bd}`;switch(i){case"inactive":break;case"same-commit":a.push("-C",l);break;case"all-commits":a.push("-C","-C",l);break;default:Gs(i)}a.push("--",o);let c=await this.git.raw(a);return Mz(c)}async isTracked(r){let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("ls-files","--",s),this.git.raw(n).then(a=>a.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let n=await this.getSubmodulePaths();for(let s of n)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 i=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),i.summary.changes}async commit({message:r,amend:i}){this.plugin.setPluginState({gitAction:4});let n=(await this.git.commit(await this.formatCommitMessage(r),i?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),n}async stage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),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,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),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 i=Ge.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(i,r),await this.git.applyPatch(i,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(i)}async getUntrackedPaths(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=[];i!=null&&n.push("--",i);let s=await this.git.clean(Ia.RECURSIVE+Ia.DRY_RUN,n);return this.plugin.setPluginState({gitAction:0}),s.paths}async hashObject(r){r=this.getRelativeRepoPath(r);let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("hash-object","--",s),this.git.raw(n)}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(),i=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 n=await this.git.revparse([r.tracking]);if(i!==n){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}`,n]),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([`${i}..${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=await this.git.subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(a)}let r=await this.git.status(),i=r.tracking,n=r.current;if(!i&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring push of main repo and updating submodules only.");return}let s=null;return i&&(s=(await this.git.diffSummary([n,i,"--"])).changed),await this.git.push(),s}catch(r){this.convertErrors(r)}}async getUnpushedCommits(){let r=await this.git.status(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let[s,a]=Zn(i);return(await this.getRemoteBranches(s)).includes(i)?(await this.git.diffSummary([n,i,"--"])).changed:(this.plugin.log(`Tracking branch ${i} does not exist on remote ${s}.`),0)}async canPush(){if(this.plugin.settings.updateSubmodules===!0)return!0;let r=await this.git.status(),i=r.tracking,n=r.current;return i?(await this.git.diffSummary([n,i,"--"])).changed!==0:!1}async checkRequirements(){return await this.isGitInstalled()?await this.git.checkIsRepo()?"valid":"missing-repo":"missing-git"}async branchInfo(){let r=await this.git.status(),i=await this.git.branch(["--no-color"]);return{current:r.current||void 0,tracking:r.tracking||void 0,branches:i.all}}async getRemoteUrl(r){try{return await this.git.remote(["get-url",r])||void 0}catch(i){if(String(i).contains(r))return;throw i}}async log(r,i=!0,n,s){let a;r&&(a=this.getRelativeRepoPath(r,i));let o={file:a,maxCount:n,"--diff-merges":"first-parent","--name-status":null};return s&&(o[s]=null),(await this.git.log(o)).all.map(c=>{var u,f,d,h;return{...c,author:{name:c.author_name,email:c.author_email},refs:c.refs.split(", ").filter(m=>m.length>0),diff:{...c.diff,files:(f=(u=c.diff)==null?void 0:u.files.map(m=>({...m,status:m.status,path:m.file,hash:c.hash,vaultPath:this.getRelativeVaultPath(m.file),fromPath:m.from,fromVaultPath:m.from!=null?this.getRelativeVaultPath(m.from):void 0,binary:m.binary})))!=null?f:[]},fileName:(h=(d=c.diff)==null?void 0:d.files.first())==null?void 0:h.file}})}async show(r,i,n=!0){let s=this.getRelativeRepoPath(i,n);return this.git.show([r+":"+s])}async checkout(r,i){if(i&&(r=`${i}/${r}`),await this.git.checkout(r),this.plugin.settings.submoduleRecurseCheckout){let n=await this.getSubmodulePaths();for(let s of n){let a=await this.git.cwd({path:s,root:!1}).branch();Object.keys(a.branches).includes(r)&&await this.git.cwd({path:s,root:!1}).checkout(r)}}}async createBranch(r){await this.git.checkout(["-b",r])}async deleteBranch(r,i){await this.git.branch([i?"-D":"-d",r])}async branchIsMerged(r){return!(await this.git.branch(["--no-merged"])).all.contains(r)}async init(){await this.git.init(!1)}async clone(r,i,n){await this.git.clone(r,Ge.join(this.app.vault.adapter.getBasePath(),i),n?["--depth",`${n}`]:[]),await this.setGitInstance()}async setConfig(r,i){i==null?await this.git.raw(["config","--local","--unset",r]):await this.git.addConfig(r,i)}async getConfig(r,i="local"){var s;return(s=(await this.git.getConfig(r.toLowerCase(),i=="all"?void 0:i)).value)!=null?s:void 0}async fetch(r){await this.git.fetch(r!=null?[r]:[])}async setRemote(r,i){(await this.getRemotes()).includes(r)?await this.git.remote(["set-url",r,i]):await this.git.remote(["add",r,i])}async getRemoteBranches(r){let i=await this.git.branch(["-r","--list",`${r}*`]),n=[];for(let s in i.branches)n.push(i.branches[s].name);return n}async getRemotes(){let r=await this.git.remote([]);return r?r.trim().split(` +`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(i){try{await this.git.branch(["--set-upstream",r])}catch(n){let[s,a]=Zn(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,i=!1,n){return i?await this.git.diff(["--cached","--",r]):n?await this.git.show([`${n}`,"--",r]):await this.git.diff(["--",r])}async diff(r,i,n){return await this.git.diff([`${i}..${n}`,"--",r])}async rawCommand(r){let i=r.split(" ");return await this.git.raw(i[0],...i.slice(1))}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(Ge.dirname(r)))return;let i=await this.git.raw(["-C",Ge.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(i=i.trim(),(await this.git.raw(["-C",Ge.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(Ge.normalize(r)),o=Ge.relative(i,a);return{submodule:i,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 Rr){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),i=await ku(r||"git",["--version"],{});if(i.error)if(Qn.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${Nd}) of Git for Windows.`);let n=await ku(Nd,["--version"]);if(n.error)return console.error(n.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(i.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof Rr){let i=String(r.message);if(i.contains("Could not resolve host")||i.contains("Unable to resolve host")||i.contains("Unable to open connection")||i.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||i.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||i.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new cl(i)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(i){let n=i instanceof Error?i.message:String(i);return this.plugin.displayError(`Error checking LFS status: ${n}`),!1}}},jF={hash:"000000",isZeroCommit:!0,summary:""};function Mz(t){let r=t.replace(`\r +`,` +`).split(` +`),i={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},n=1;for(let s=0;s=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 i}function Lz(t,e,r){let i=t[0],n=t.slice(1).join(" "),s=e.hashPerLine[r],a=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(i){case"summary":a.summary=n;break;case"author":a.author.name=n;break;case"author-mail":a.author.email=UF(n);break;case"author-time":a.author.epochSeconds=parseInt(n);break;case"author-tz":a.author.tz=n;break;case"committer":a.committer.name=n;break;case"committer-mail":a.committer.email=UF(n);break;case"committer-time":a.committer.epochSeconds=parseInt(n);break;case"committer-tz":a.committer.tz=n;break;case"previous":a.previous.commitHash=n;break;case"filename":a.previous.filename=n;break}e.commits.set(s,a)}function Bz(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);L0(t.author)&&(t.author=void 0),L0(t.committer)&&(t.committer=void 0),L0(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function L0(t){return!t||Object.keys(t).length===0}function HF(t){return t.length>0&&t[0].trim()===t[0]}function UF(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}p();var pI=require("@codemirror/state");p();var B0=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()}},Jn=new B0;p();var zh=require("@codemirror/state"),qF=Mt(N0());function zF(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var VF=zh.StateEffect.define();function WF(t,e,r){return r.update({effects:VF.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var kl=zh.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(VF))return r.value;return Nz(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function Vh(t){var s;let e=qF.sha256.create();if(!t)return e;let{la:r,key:i,lineOffsetsFromUnsavedChanges:n}=t;e.update(r==="untracked"?"t":"f"),e.update(i);for(let[a,o]of(s=n.entries())!=null?s:[])e.update([a,o]);return e}var wi={get:void 0,save:void 0};function YF(t,e){wi.get=t,wi.save=e}function Wh(t){var e,r;return(r=(e=qh(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:qh(rt.lineAuthor.coloringMaxAge).asDays()}function Nz(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,i,n,s)=>{var m;let a=t.startState.doc,{newDoc:o}=t,l=a.lineAt(r).number,c=a.lineAt(i).number,u=o.lineAt(n).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 XF(){Al=void 0,H0=[],Yh=0,Zh.clear(),Kh.clear(),Tl.clear()}var Al,Xh=()=>Al;function ZF(t,e){var n;let r=e.length;if(r<((n=Al==null?void 0:Al.length)!=null?n:0))return;Al={gutter:t,length:r,text:e};let i=wi.get();r!==i.gutterSpacingFallbackLength&&(i.gutterSpacingFallbackLength=r,wi.save(i))}var H0=[],Hz=15,Yh=0;function KF(t){H0[Yh]=t,Yh=(Yh+1)%Hz}function QF(){return HP(H0)}var Zh=new Map,Kh=new Map,Tl=new Set;p();var fI=require("@codemirror/state"),dI=require("@codemirror/view");p();var q0=require("@codemirror/view"),oI=Mt(N0()),Cl=require("obsidian");p();p();var Qh={x:-10,y:-10};function JF(){Qh.x===-10&&window.addEventListener("mousedown",t=>{Qh.x=t.clientX,Qh.y=t.clientY})}function eI(){for(let t of Tl)if(Uz(t,Qh))return t}function Uz(t,e){let{x:r,y:i,width:n,height:s}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+n&&i<=e.y&&e.y<=i+s}var tI="data-commit";function rI(t,e,r){if(e.hasFocus())return;let i=eI();if(!i)return;let n=jz(i);n&&(!n.isZeroCommit&&!n.isWaitingGutter&&Gz(n,t),U0("showCommitHash",t),U0("authorDisplay",t),U0("dateTimeFormatOptions",t))}function Gz(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(i=>navigator.clipboard.writeText(t.hash)))}function U0(t,e){var l,c;let r,i,n=Ii.plugin.settings.lineAuthor,s=n[t],a=typeof s=="boolean"?s:s!=="hide",o=rt.lineAuthor[t];if(t==="showCommitHash")r="Show commit hash",i=s;else if(t==="authorDisplay"){let u=(l=n.lastShownAuthorDisplay)!=null?l:o;r="Show author "+(a?s:u),i=a?"hide":u}else if(t==="dateTimeFormatOptions"){let u=(c=n.lastShownDateTimeFormatOptions)!=null?c:o;r="Show "+(a?s:u),r+=r.contains("date")?"":" date",i=a?"hide":u}else Gs(t);e.addItem(u=>u.setTitle(r).setSection("obs-git-line-author-configure").setChecked(a).onClick(f=>{var d,h;return(h=(d=Ii.plugin)==null?void 0:d.settingsTab)==null?void 0:h.lineAuthorSettingHandler(t,i)}))}function iI(t,e,r){r.setAttr(tI,JSON.stringify({hash:t.hash,isZeroCommit:t.isZeroCommit,isWaitingGutter:e}))}function jz(t){let e=t.getAttr(tI);return e?JSON.parse(e):void 0}p();function ep(t,e){return t==="oldest"?Jh(0,!1,e).color:Jh(void 0,!0,e).color}function Jh(t,e,r){let i=Wh(r),n=Date.now()/1e3,s=t!=null?t:0,o=(e?0:n-s)/60/60/24,l=Math.pow(Math.clamp(o/i,0,1),1/2.3),c=qz(),u=r.colorNew,f=r.colorOld,d=c?.4:1,h=G0(u.r,f.r,l)*d,m=G0(u.g,f.g,l)*d,g=G0(u.b,f.b,l)*d;return{color:`rgba(${h},${m},${g},${c?.75:.25})`,daysSinceCommit:o}}function G0(t,e,r){return t+(e-t)*r}function qz(){var t;return((t=window.app)==null?void 0:t.getTheme())==="obsidian"}function nI(t){document.body.style.setProperty("--obs-git-gutter-text",t.textColorCss)}p();function sI(t,e,r){let i;for(let n=e;n<=r;n++){let s=t.hashPerLine[n],a=t.commits.get(s);(!i||a.isZeroCommit||zz(a,i))&&(i=a)}return i}function zz(t,e){var n,s,a,o;let r=(s=(n=t.author)==null?void 0:n.epochSeconds)!=null?s:0,i=(o=(a=e.author)==null?void 0:a.epochSeconds)!=null?o:0;return r>i}var aI="-",Vz="+",Wz=3,Yz="*",Xz=/\S/g,Zz="%",Pl=class t extends q0.GutterMarker{constructor(r){super();this.text=r}eq(r){return r instanceof t&&this.text===r.text}toDOM(){return document.createTextNode(this.text)}destroy(r){}},j0=class extends q0.GutterMarker{constructor(r,i,n,s,a,o){super();this.lineAuthoring=r;this.startLine=i;this.endLine=n;this.key=s;this.settings=a;this.options=o;this.point=!1;this.elementClass="obs-git-blame-gutter"}eq(r){return this.key===(r==null?void 0:r.key)&&this.startLine===(r==null?void 0:r.startLine)&&this.endLine===(r==null?void 0:r.endLine)&&(this==null?void 0:this.options)===(r==null?void 0:r.options)}toDOM(){var r;return this.precomputedDomProvider=(r=this.precomputedDomProvider)!=null?r:this.computeDom(),this.precomputedDomProvider()}destroy(r){r&&(document.body.contains(r)||Tl.delete(r))}computeDom(){let r=sI(this.lineAuthoring,this.startLine,this.endLine),i=r.isZeroCommit?"":this.renderNonZeroCommit(r);return!r.isZeroCommit&&this.options!=="waiting-for-result"?ZF(this,i):i=this.adaptTextForFakeCommit(r,i,this.options),this.createHtmlNode(r,i,this.options==="waiting-for-result")}createHtmlNode(r,i,n){var c,u,f,d,h,m;let s=window.createDiv();s.setText(i);let{color:a,daysSinceCommit:o}=Jh((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds,r==null?void 0:r.isZeroCommit,this.settings);s.style.backgroundColor=a,s.setAttribute("data-author",(f=(u=r==null?void 0:r.author)==null?void 0:u.name)!=null?f:""),s.setAttribute("data-author-email",(h=(d=r==null?void 0:r.author)==null?void 0:d.email)!=null?h:""),(0,Cl.setTooltip)(s,(m=r==null?void 0:r.summary)!=null?m:""),iI(r,n,s);function l(){let g=s.cloneNode(!0);return Tl.add(g),n||KF(o),g}return l}renderNonZeroCommit(r){let i=this.settings.showCommitHash?this.renderHash(r):"",n=this.settings.authorDisplay==="hide"?"":`${this.renderAuthorName(r,this.settings.authorDisplay)}`,s=this.settings.dateTimeFormatOptions==="hide"?"":`${this.renderAuthoringDate(r,this.settings.dateTimeFormatOptions,this.settings.dateTimeFormatCustomString,this.settings.dateTimeTimezone)}`;return[i,n,s].filter(o=>o.length>=1).join(" ")}renderHash(r){return r.hash.substring(0,6)}renderAuthorName(r,i){var o,l,c,u;let n=(l=(o=r==null?void 0:r.author)==null?void 0:o.name)!=null?l:"",s=n.split(" ").filter(f=>f.length>=1),a;switch(i){case"initials":a=s.map(f=>f[0].toUpperCase()).join("");break;case"first name":a=(c=s.first())!=null?c:aI;break;case"last name":a=(u=s.last())!=null?u:aI;break;case"full":a=n;break;default:return Gs(i)}return UP(r==null?void 0:r.author,r==null?void 0:r.committer)||(a=a+Yz),a}renderAuthoringDate(r,i,n,s){var c;let a="?";if(((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds)===void 0)return a;let o;switch(i){case"date":o=Ld;break;case"datetime":o=Ev;break;case"custom":o=n;break;case"natural language":o=u=>{let f=u.diff((0,Cl.moment)());return Cl.moment.duration(f).humanize(!0)};break;default:return Gs(i)}let l=Cl.moment.unix(r.author.epochSeconds);switch(s){case"viewer-local":break;case"author-local":l=l.utcOffset(r.author.tz),typeof o=="string"&&(o+=" Z");break;case"utc0000":l=l.utc(),typeof o=="string"&&(o+="[Z]");break;default:return Gs(s)}return typeof o=="string"?l.format(o):o(l)}adaptTextForFakeCommit(r,i,n){var l,c,u,f;let s=(c=(l=Xh())==null?void 0:l.text)!=null?c:i,a=n!=="waiting-for-result"&&r.isZeroCommit?Vz:Zz;i=s.replace(Xz,a);let o=(f=(u=wi.get())==null?void 0:u.gutterSpacingFallbackLength)!=null?f:i.length;if(i=GP(i,o,a),n!=="waiting-for-result"&&r.isZeroCommit){let d=Math.min(o,Wz);i=jP(i,o-d)}return i}};function Da(t,e,r,i,n,s){let a=oI.sha256.create();a.update(JSON.stringify(n)),a.update(`s${e}-e${r}-k${i}-o${s}`);let o=a.hex(),l=Zh.get(o);if(l)return l;let c=new j0(t,e,r,i,n,s);return Zh.set(o,c),c}p();var lI=require("obsidian");function z0(){var e,r;let t=(r=(e=wi.get())==null?void 0:e.gutterSpacingFallbackLength)!=null?r:rt.lineAuthor.gutterSpacingFallbackLength;return new Pl(Array(t).fill("-").join(""))}function V0(t){let{lineAuthoring:e,ageForInitialRender:r}=Kz(t);return Da(e,1,1,"initialGutter"+r,t,"waiting-for-result")}function Kz(t){var s;let e=(s=QF())!=null?s:Wh(t)*.25,r=(0,lI.moment)().add(-e,"days"),i={name:"",epochSeconds:NP(r),tz:"+0000"},n={hash:"waiting-for-result",author:i,committer:i,isZeroCommit:!1};return{lineAuthoring:{hashPerLine:[void 0,"waiting-for-result"],commits:new Map([["waiting-for-result",n]])},ageForInitialRender:e}}p();function cI(t,e){return Da({hashPerLine:[void 0,"000000"],commits:new Map([["000000",jF]])},1,1,t,e)}var W0=new Pl(""),hI=(0,dI.gutter)({class:"line-author-gutter-container",markers(t){let e=t.state.field(kl,!1);return Qz(t,e)},lineMarkerChange(t){let e=Vh(t.state.field(kl));return Vh(t.startState.field(kl))!==e},renderEmptyElements:!0,initialSpacer:t=>(uI(t),z0()),updateSpacer:(t,e)=>{var r,i;return uI(e.view),(i=(r=Xh())==null?void 0:r.gutter)!=null?i:z0()}});function Qz(t,e){let r=Vh(e),i=t.state.doc,n=new Map;for(let u=1;u<=i.lines;u++){let f=i.line(u).from,d=t.lineBlockAt(f).to;n.set(u,[f,d]),r.update([f,d,0])}let s=wi.get();r.update("s"+Object.values(wi).join(","));let a=r.hex(),o=Kh.get(a);if(o)return o;let{result:l,allowCache:c}=Jz(i,n,s,e);return c&&Kh.set(a,l),l}function Jz(t,e,r,i){let n=!0,s=t.lines,a=[];function o(f,d,h){return a.push(h.range(f,d))}let l=eV(s,i),c=t.length===0,u=t.iterLines(s,s+1).next().value==="";for(let f=1;f<=s;f++){let[d,h]=e.get(f),m=t.lineAt(h).number;if(c){o(d,h,W0);continue}if(f===s&&u){o(d,h,W0);continue}if(i===void 0){o(d,h,V0(r)),n=!1;continue}let{key:g,la:v}=i;if(v==="untracked"){o(d,h,cI(v,r));continue}let w=v.hashPerLine.length-1,b=l[f],k=l[m];if(k&&k>w&&o(d,h,W0),b!==void 0&&qw(1,b,w)&&k!==void 0&&qw(1,k,w)){o(d,h,Da(v,b,k,g,r));continue}if(w<1){o(d,h,V0(r)),n=!1;continue}let x=Math.clamp(b!=null?b:f,1,w),E=Math.clamp(k!=null?k:m,1,w);o(d,h,Da(v,x,E,g+"computing",r,"waiting-for-result"))}return{result:fI.RangeSet.of(a,!0),allowCache:n}}function eV(t,e){if(!(e!=null&&e.lineOffsetsFromUnsavedChanges))return Array.from(new Array(t+1),n=>n);let r=[void 0],i=0;for(let n=1;n<=t;n++){let s=e.lineOffsetsFromUnsavedChanges.get(n);i+=s!=null?s:0,r[n]=s===void 0?n-i:void 0}return r}function uI(t){t.dom.querySelectorAll(".cm-gutters").forEach(r=>{r!=null&&r.style&&(r.style.marginLeft||(r.style.marginLeft="unset"))})}var tp=class{constructor(e){this.plugin=e;this.lineAuthorings=new Map}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeLineAuthorInfo(e.path)}}destroy(){this.lineAuthorings.clear(),XF()}async computeLineAuthorInfo(e){let r=this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager,i=await r.submoduleAwareHeadRevisonInContainingDirectory(e),n=await r.hashObject(e),s=zF(i,n,e);if(s!==void 0){if(!this.lineAuthorings.has(s)){let a=await r.blame(e,this.plugin.settings.lineAuthor.followMovement,this.plugin.settings.lineAuthor.ignoreWhitespace);this.lineAuthorings.set(s,a)}this.notifyComputationResultToSubscribers(e,s)}}notifyComputationResultToSubscribers(e,r){Jn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyLineAuthoring(r,this.lineAuthorings.get(r))))}},mI=pI.Prec.high([kl,hI]);var tV="https://momentjs.com/docs/#/parsing/string-format/",rV="https://publish.obsidian.md/git-doc/Line+Authoring",rp=class extends U.PluginSettingTab{constructor(r,i){super(r,i);this.plugin=i;this.lineAuthorColorSettings=new Map;this.icon="git-pull-request"}get settings(){return this.plugin.settings}display(){let{containerEl:r}=this,i=this.plugin,n;i.settings.differentIntervalCommitAndPush?n="commit":n="commit-and-sync";let s=i.gitReady;r.empty(),s||(r.createEl("p",{text:"Git is not ready. When all settings are correct you can configure commit-sync, etc."}),r.createEl("br"));let a;if(s){new U.Setting(r).setName("Automatic").setHeading(),new U.Setting(r).setName("Split timers for automatic commit and sync").setDesc("Enable to use one interval for commit and another for sync.").addToggle(f=>f.setValue(i.settings.differentIntervalCommitAndPush).onChange(async d=>{i.settings.differentIntervalCommitAndPush=d,await i.saveSettings(),i.automaticsManager.reload("commit","push"),this.refreshDisplayWithDelay()})),new U.Setting(r).setName(`Auto ${n} interval (minutes)`).setDesc(`${i.settings.differentIntervalCommitAndPush?"Commit":"Commit and sync"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoSaveInterval"}),f.setPlaceholder(String(rt.autoSaveInterval)),f.onChange(async d=>{d!==""?i.settings.autoSaveInterval=Number(d):i.settings.autoSaveInterval=rt.autoSaveInterval,await i.saveSettings(),i.automaticsManager.reload("commit")})}),a=new U.Setting(r).setName(`Auto ${n} after stopping file edits`).setDesc(`Requires the ${n} interval not to be 0. + If turned on, do auto ${n} every ${qP(i.settings.autoSaveInterval)} after stopping file edits. + This also prevents auto ${n} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(f=>f.setValue(i.settings.autoBackupAfterFileChange).onChange(async d=>{i.settings.autoBackupAfterFileChange=d,this.refreshDisplayWithDelay(),await i.saveSettings(),i.automaticsManager.reload("commit")})),this.mayDisableSetting(a,i.settings.setLastSaveToLastCommit),a=new U.Setting(r).setName(`Auto ${n} after latest commit`).setDesc(`If turned on, sets last auto ${n} timestamp to the latest commit timestamp. This reduces the frequency of auto ${n} when doing manual commits.`).addToggle(f=>f.setValue(i.settings.setLastSaveToLastCommit).onChange(async d=>{i.settings.setLastSaveToLastCommit=d,await i.saveSettings(),i.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(a,i.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(rt.autoPushInterval)),f.onChange(async d=>{d!==""?i.settings.autoPushInterval=Number(d):i.settings.autoPushInterval=rt.autoPushInterval,await i.saveSettings(),i.automaticsManager.reload("push")})}),this.mayDisableSetting(a,!i.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(rt.autoPullInterval)),f.onChange(async d=>{d!==""?i.settings.autoPullInterval=Number(d):i.settings.autoPullInterval=rt.autoPullInterval,await i.saveSettings(),i.automaticsManager.reload("pull")})}),new U.Setting(r).setName(`Auto ${n} only staged files`).setDesc(`If turned on, only staged files are committed on ${n}. If turned off, all changed files are committed.`).addToggle(f=>f.setValue(i.settings.autoCommitOnlyStaged).onChange(async d=>{i.settings.autoCommitOnlyStaged=d,await i.saveSettings()})),new U.Setting(r).setName(`Specify custom commit message on auto ${n}`).setDesc("You will get a pop up to specify your message.").addToggle(f=>f.setValue(i.settings.customMessageOnAutoBackup).onChange(async d=>{i.settings.customMessageOnAutoBackup=d,await i.saveSettings(),this.refreshDisplayWithDelay()})),a=new U.Setting(r).setName(`Commit message on auto ${n}`).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(rt.autoCommitMessage).onChange(async d=>{d===""?i.settings.autoCommitMessage=rt.autoCommitMessage:i.settings.autoCommitMessage=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(a,i.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: "${rt.commitMessage}"`).onClick(()=>{f.setValue(rt.commitMessage),f.onChanged()})}),f.setValue(i.settings.commitMessage),f.onChange(async d=>{i.settings.commitMessage=d,await i.saveSettings()})}),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===""?i.settings.commitMessageScript=rt.commitMessageScript:i.settings.commitMessageScript=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"commitMessageScript"})});let u=new U.Setting(r).setName("{{date}} placeholder format").addMomentFormat(f=>f.setDefaultFormat(i.settings.commitDateFormat).setValue(i.settings.commitDateFormat).onChange(async d=>{i.settings.commitDateFormat=d,await i.saveSettings()}));u.descEl.innerHTML=` + Specify custom date format. E.g. "${kv}. See Moment.js 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=i.localStorage.getHostname())!=null?d:"").onChange(h=>{i.localStorage.setHostname(h)})}),new U.Setting(r).setName("Preview commit message").addButton(f=>f.setButtonText("Preview").onClick(async()=>{let d=await i.gitManager.formatCommitMessage(i.settings.commitMessage);new U.Notice(`${d}`)})),new U.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(f=>f.setValue(i.settings.listChangedFilesInMessageBody).onChange(async d=>{i.settings.listChangedFilesInMessageBody=d,await i.saveSettings()})),new U.Setting(r).setName("Pull").setHeading(),i.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(i.settings.syncMethod),f.onChange(async h=>{i.settings.syncMethod=h,await i.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(i.settings.mergeStrategy),f.onChange(async h=>{i.settings.mergeStrategy=h,await i.saveSettings()})}),new U.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(f=>f.setValue(i.settings.autoPullOnBoot).onChange(async d=>{i.settings.autoPullOnBoot=d,await i.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 ${i.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(f=>f.setValue(!i.settings.disablePush).onChange(async d=>{i.settings.disablePush=!d,this.refreshDisplayWithDelay(),await i.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 ${i.settings.disablePush?"":"and push "}only.`).addToggle(f=>f.setValue(i.settings.pullBeforePush).onChange(async d=>{i.settings.pullBeforePush=d,this.refreshDisplayWithDelay(),await i.saveSettings()})),i.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(i.settings.hunks.showSigns).onChange(async d=>{i.settings.hunks.showSigns=d,await i.saveSettings(),i.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(i.settings.hunks.hunkCommands).onChange(async d=>{i.settings.hunks.hunkCommands=d,await i.saveSettings(),i.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(i.settings.hunks.statusBar).onChange(async d=>{i.settings.hunks.statusBar=d,await i.saveSettings(),i.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(i.settings.authorInHistoryView),c.onChange(async f=>{i.settings.authorInHistoryView=f,await i.saveSettings(),await i.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(i.settings.dateInHistoryView).onChange(async u=>{i.settings.dateInHistoryView=u,await i.saveSettings(),await i.refresh()})),new U.Setting(r).setName("Source control view").setHeading(),new U.Setting(r).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(i.settings.refreshSourceControl).onChange(async u=>{i.settings.refreshSourceControl=u,await i.saveSettings()})),new U.Setting(r).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>{c.inputEl.type="number",this.setNonDefaultValue({text:c,settingsProperty:"refreshSourceControlTimer"}),c.setPlaceholder(String(rt.refreshSourceControlTimer)),c.onChange(async f=>{f!==""&&Number.isInteger(Number(f))?i.settings.refreshSourceControlTimer=Math.max(Number(f),500):i.settings.refreshSourceControlTimer=rt.refreshSourceControlTimer,await i.saveSettings(),i.setRefreshDebouncer()})}),new U.Setting(r).setName("Miscellaneous").setHeading(),i.gitManager instanceof Se&&new U.Setting(r).setName("Diff view style").setDesc('Set the style for the diff view. Note that the actual diff in "Split" mode is not generated by Git, but the editor itself instead so it may differ from the diff generated by Git. One advantage of this is that you can edit the text in that view.').addDropdown(c=>{let u={split:"Split",git_unified:"Unified"};c.addOptions(u),c.setValue(i.settings.diffStyle),c.onChange(async f=>{i.settings.diffStyle=f,await i.saveSettings()})}),new U.Setting(r).setName("Disable informative notifications").setDesc("Disable informative notifications for git operations to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(i.settings.disablePopups).onChange(async u=>{i.settings.disablePopups=u,this.refreshDisplayWithDelay(),await i.saveSettings()})),new U.Setting(r).setName("Disable error notifications").setDesc("Disable error notifications of any kind to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(!i.settings.showErrorNotices).onChange(async u=>{i.settings.showErrorNotices=!u,await i.saveSettings()})),i.settings.disablePopups||new U.Setting(r).setName("Hide notifications for no changes").setDesc("Don't show notifications when there are no changes to commit or push.").addToggle(c=>c.setValue(i.settings.disablePopupsForNoChanges).onChange(async u=>{i.settings.disablePopupsForNoChanges=u,await i.saveSettings()})),new U.Setting(r).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showStatusBar).onChange(async u=>{i.settings.showStatusBar=u,await i.saveSettings()})),new U.Setting(r).setName("File menu integration").setDesc('Add "Stage", "Unstage" and "Add to .gitignore" actions to the file menu.').addToggle(c=>c.setValue(i.settings.showFileMenu).onChange(async u=>{i.settings.showFileMenu=u,await i.saveSettings()})),new U.Setting(r).setName("Show branch status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showBranchStatusBar).onChange(async u=>{i.settings.showBranchStatusBar=u,await i.saveSettings()})),new U.Setting(r).setName("Show the count of modified files in the status bar").addToggle(c=>c.setValue(i.settings.changedFilesInStatusBar).onChange(async u=>{i.settings.changedFilesInStatusBar=u,await i.saveSettings()})),i.gitManager instanceof Di?new U.Setting(r).setName("Authentication/commit author").setHeading():new U.Setting(r).setName("Commit author").setHeading(),i.gitManager instanceof Di&&new U.Setting(r).setName("Username on your git server. E.g. your username on GitHub").addText(c=>{var u;c.setValue((u=i.localStorage.getUsername())!=null?u:""),c.onChange(f=>{i.localStorage.setUsername(f)})}),i.gitManager instanceof Di&&new U.Setting(r).setName("Password/Personal access token").setDesc("Type in your password. You won't be able to see it again.").addText(c=>{c.inputEl.autocapitalize="off",c.inputEl.autocomplete="off",c.inputEl.spellcheck=!1,c.onChange(u=>{i.localStorage.setPassword(u)})}),i.gitReady&&new U.Setting(r).setName("Author name for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.name"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.name",f==""?void 0:f)})}),i.gitReady&&new U.Setting(r).setName("Author email for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.email"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.email",f==""?void 0:f)})}),new U.Setting(r).setName("Advanced").setDesc("These settings usually don't need to be changed, but may be required for special setups.").setHeading(),i.gitManager instanceof Se&&(new U.Setting(r).setName("Update submodules").setDesc('"Commit-and-sync" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule.').addToggle(c=>c.setValue(i.settings.updateSubmodules).onChange(async u=>{i.settings.updateSubmodules=u,await i.saveSettings()})),i.settings.updateSubmodules&&new U.Setting(r).setName("Submodule recurse checkout/switch").setDesc("Whenever a checkout happens on the root repository, recurse the checkout on the submodules (if the branches exist).").addToggle(c=>c.setValue(i.settings.submoduleRecurseCheckout).onChange(async u=>{i.settings.submoduleRecurseCheckout=u,await i.saveSettings()}))),i.gitManager instanceof Se&&new U.Setting(r).setName("Custom Git binary path").setDesc("Specify the path to the Git binary/executable. Git should already be in your PATH. Should only be necessary for a custom Git installation.").addText(c=>{var u;c.setValue((u=i.localStorage.getGitPath())!=null?u:""),c.setPlaceholder("git"),c.onChange(f=>{i.localStorage.setGitPath(f),i.gitManager.updateGitPath(f||"git").catch(d=>i.displayError(d))})}),i.gitManager instanceof Se&&new U.Setting(r).setName("Additional environment variables").setDesc("Use each line for a new environment variable in the format KEY=VALUE .").addTextArea(c=>{c.setPlaceholder("GIT_DIR=/path/to/git/dir"),c.setValue(i.localStorage.getEnvVars().join(` +`)),c.onChange(u=>{i.localStorage.setEnvVars(u.split(` +`))})}),i.gitManager instanceof Se&&new U.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(i.localStorage.getPATHPaths().join(` +`)),c.onChange(u=>{i.localStorage.setPATHPaths(u.split(` +`))})}),i.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 i.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(i.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{i.settings.basePath=u,await i.saveSettings(),i.gitManager.updateBasePath(u||"").catch(f=>i.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(i.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{i.settings.gitDir=u,await i.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(i.localStorage.getPluginDisabled()).onChange(u=>{i.localStorage.setPluginDisabled(u),u?i.unloadPlugin():i.init({fromReload:!0}).catch(f=>i.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="Buy Me a Coffee at ko-fi.com"});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,i){i&&(r.setDisabled(i),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,i){this.settings.lineAuthor[r]=i,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=` + Feature guide and quick examples
+ The commit hash, author name and authoring date can all be individually toggled.
Hide everything, to only show the age-colored sidebar.`,r.addToggle(i=>i.setValue(this.settings.lineAuthor.show).onChange(n=>{this.configureLineAuthorShowStatus(n),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let i=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(i.descEl.innerHTML=` + By default (deactivated), each line only shows the newest commit where it was changed. +
+ With same commit, cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown. +
+ With all commits, cut-copy-paste-ing text inbetween multiple commits will be detected. +
+ It uses git-blame and + for matches (at least ${Bd} characters) within the same (or all) commit(s), the originating 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 + UTC\xB100:00. + `;let n=new U.Setting(this.containerEl).setName("Oldest age in coloring");n.descEl.innerHTML=this.previewOldestAgeDescriptionHtml(this.settings.lineAuthor.coloringMaxAge)[0],n.addText(s=>{s.setPlaceholder("1y"),s.setValue(this.settings.lineAuthor.coloringMaxAge),s.onChange(async a=>{let[o,l]=this.previewOldestAgeDescriptionHtml(a);n.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.
+ + It is highly recommended to use + + CSS variables + defined by themes + (e.g.
var(--text-muted)
or +
var(--text-on-accent)
, + because they automatically adapt to theme changes.
+ + See: + List of available CSS variables in Obsidian + + `,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. +
+ 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 i=new U.Setting(this.containerEl).setName("").addText(n=>{let s=Y0(r,this.settings.lineAuthor),a=Y0(r,rt.lineAuthor);n.setPlaceholder(jw(a)),n.setValue(jw(s)),n.onChange(async o=>{let l=BP(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,i),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,Y0(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let i=this.lineAuthorColorSettings.get(r);if(i){let n=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";i.nameEl.innerText=`Color for ${n} commits`}}refreshColorSettingsDesc(r,i){let n=this.lineAuthorColorSettings.get(r);n&&(n.descEl.innerHTML=this.colorSettingPreviewDescHtml(r,this.settings.lineAuthor,i!==void 0))}colorSettingPreviewDescHtml(r,i,n){let s=n?ep(r,i):"rgba(127,127,127,0.3)",a=U.moment.unix(U.moment.now()/1e3).format("YYYY-MM-DD"),o=n?`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: ${`
${o}
`}`}previewCustomDateTimeDescriptionHtml(r){let i=(0,U.moment)().format(r);return`
Format string to display the authoring date.
Currently: ${i}`}previewOldestAgeDescriptionHtml(r){let i=qh(r);return[`The oldest age in the line author coloring. Everything older will have the same color. +
Smallest valid age is "1d". Currently: ${i!==void 0?`${i.asDays()} days`:"invalid!"}`,i]}setNonDefaultValue({settingsProperty:r,text:i}){let n=this.plugin.settings[r];rt[r]!==n&&(typeof n=="string"||typeof n=="number"||typeof n=="boolean"?i.setValue(String(n)):i.setValue(JSON.stringify(n)))}refreshDisplayWithDelay(r=80){setTimeout(()=>this.display(),r)}};function Y0(t,e){return t==="oldest"?e.colorOld:e.colorNew}function qh(t){let e=U.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}p();var ti=require("obsidian");var ip=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,ti.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,ti.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,ti.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,ti.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,ti.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,ti.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,ti.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,ti.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var i;let e=this.lastCommitTimestamp,r=this.plugin.state.offlineMode;if(e){let n=(0,ti.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${r?"Offline: ":""}Last Commit: ${n}`,(i=this.unPushedCommits)!=null&&i&&(this.statusBarEl.ariaLabel+=` +(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,ti.setIcon)(this.iconEl,"globe"):(0,ti.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 sp=require("obsidian"),np=class extends sp.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 i=(0,sp.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${i}: ${r}`,`${r}: ${i}`]}renderSuggestion(r,i){i.innerText=r}onChooseSuggestion(r,i){this.resolve&&this.resolve(r)}};p();var gI=require("obsidian"),Du=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,i;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((i=this.plugin.localStorage.getLastAutoPush())!=null?i:"")}}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,gI.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 i=this.diff(this.plugin.settings.autoSaveInterval,r);if(i>0)return this.startAutoCommitAndSync(i),!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.autoCommitDebouncer&&((r=this.plugin.autoCommitDebouncer)==null||r.cancel(),this.plugin.autoCommitDebouncer=void 0,e=!0),e}clearAutoPull(){return this.timeoutIDPull?(window.clearTimeout(this.timeoutIDPull),this.timeoutIDPull=void 0,!0):!1}clearAutoPush(){return this.timeoutIDPush?(window.clearTimeout(this.timeoutIDPush),this.timeoutIDPush=void 0,!0):!1}diff(e,r){let n=e-Math.round((new Date().getTime()-r.getTime())/1e3/60);return Math.max(0,n)}};p();var Ni=require("obsidian");p();var Lu=require("obsidian");async function vI(t,e,r){let i=await yI(e,r);if(i.result==="failure"){new Lu.Notice(i.reason);return}let{isGitHub:n,branch:s,repo:a,user:o,filePath:l}=i;if(n){let c=t.getCursor("from").line+1,u=t.getCursor("to").line+1;c===u?window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}`):window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}-L${u}`)}else new Lu.Notice("It seems like you are not using GitHub")}async function wI(t,e){let r=await yI(t,e);if(r.result==="failure"){new Lu.Notice(r.reason);return}let{isGitHub:i,branch:n,repo:s,user:a,filePath:o}=r;i?window.open(`https://github.com/${a}/${s}/commits/${n}/${o}`):new Lu.Notice("It seems like you are not using GitHub")}async function yI(t,e){let r=await e.branchInfo(),i=r.tracking,n=r.current,s,a=e.getRelativeRepoPath(t.path);if(e instanceof Se){let l=await e.getSubmoduleOfFile(e.getRelativeRepoPath(t.path));if(l){a=l.relativeFilepath;let c=await e.git.cwd({path:l.submodule,root:!1}).status();if(i=c.tracking||void 0,n=c.current||void 0,i){let u=i.substring(0,i.indexOf("/")),f=await e.git.cwd({path:l.submodule,root:!1}).getConfig(`remote.${u}.url`,"local");if(f.value!=null)s=f.value;else return{result:"failure",reason:"Failed to get remote url of submodule"}}}}if(i==null)return{result:"failure",reason:"Remote branch is not configured"};if(n==null)return{result:"failure",reason:"Failed to get current branch name"};if(s==null){let l=i.substring(0,i.indexOf("/"));if(s=await e.getConfig(`remote.${l}.url`),s==null)return{result:"failure",reason:"Failed to get remote url"}}let o=s.match(/(?:^https:\/\/github\.com\/(.+)\/(.+?)(?:\.git)?$)|(?:^[a-zA-Z]+@github\.com:(.+)\/(.+?)(?:\.git)?$)/);if(o==null)return{result:"failure",reason:"Could not parse remote url"};{let[l,c,u,f,d]=o;return{result:"success",isGitHub:!!l,repo:u||d,user:c||f,branch:n,filePath:a}}}p();var bI=require("obsidian"),ap=class extends bI.FuzzySuggestModal{constructor(e,r){super(e.app),this.plugin=e,this.changedFiles=r,this.setPlaceholder("Not supported files will be opened by default app!")}getItems(){return this.changedFiles}getItemText(e){if(e.index=="U"&&e.workingDir=="U")return`Untracked | ${e.vaultPath}`;let r="",i="";return e.workingDir!=" "&&(r=`Working Dir: ${e.workingDir} `),e.index!=" "&&(i=`Index: ${e.index}`),`${r}${i} | ${e.vaultPath}`}onChooseItem(e,r){this.plugin.app.metadataCache.getFirstLinkpathDest(e.vaultPath,"")==null?this.app.openWithDefaultApp(e.vaultPath):this.plugin.app.workspace.openLinkText(e.vaultPath,"/")}};p();var _I=require("obsidian"),op=class extends _I.Modal{constructor(r,i){super(r);this.content=i;this.resolve=null}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onOpen(){let{contentEl:r,titleEl:i}=this;i.setText("Edit .gitignore");let n=r.createDiv(),s=n.createEl("textarea",{text:this.content,cls:["obsidian-git-textarea"],attr:{rows:10,cols:30,wrap:"off"}});n.createEl("button",{cls:["mod-cta","obsidian-git-center-button"],text:"Save"}).addEventListener("click",()=>{this.resolve(s.value),this.close()})}onClose(){let{contentEl:r}=this;r.empty(),this.resolve&&this.resolve(void 0)}};p();var Wu=require("@codemirror/state"),xp=require("@codemirror/view");p();var Fl=require("@codemirror/state");p();var Nt=class t{static createHunk(e,r,i,n){return{removed:{start:e,count:r,lines:[]},added:{start:i,count:n,lines:[]},head:`@@ -${e}${r>0?`,${r}`:""} +${i}${n>0?`,${n}`:""} @@`,vend:i+Math.max(n-1,0),type:n===0?"delete":r===0?"add":"change"}}static createPartialHunk(e,r,i){let n=r,s=i-r+1,a=0;for(let o of e){let l=o.added.count-o.removed.count,c=0;if(o.added.start>=r&&o.vend<=i)c=l;else{let u=Math.max(0,i+1-(o.added.start+o.removed.count)),f=Math.max(0,r-(o.added.start+o.removed.count));o.added.start>=r&&o.added.start<=i?c=u:o.vend>=r&&o.vend<=i?(c=l-f,n=n-f):o.added.start<=r&&o.vend>=i?(c=u-f,n=n-f):a++,r>o.vend&&(n=n-l)}s=s-c}if(a!==e.length)return s===0&&(n=n-1),this.createHunk(n,s,r,i-r+1)}patchLines(e,r=!1){let i=[];for(let n of e.removed.lines)i.push("-"+n);for(let n of e.added.lines)i.push("+"+n);return r?i.map(n=>n.replace(/\r$/,"")):i}static parseDiffLine(e){let n=e.split("@@")[1].trim().split(" "),s=n[0].substring(1).split(","),a=n[1].substring(1).split(","),o=this.createHunk(parseInt(s[0]),parseInt(s[1]||"1"),parseInt(a[0]),parseInt(a[1]||"1"));return o.head=e,o}static changeEnd(e){return e.added.count===0?e.added.start:e.removed.count===0?e.added.start+e.added.count-1:e.added.start+Math.min(e.added.count,e.removed.count)-1}static calcSigns(e,r,i,n=1,s=1/0,a){if(a&&r.type!=="add")return console.error(`Invalid hunk with untracked=${a} hunk="${r.head}"`),[];n=Math.max(1,n);let{start:o,added:l,removed:c}={start:r.added.start,added:r.added.count,removed:r.removed.count},u=this.changeEnd(r),f=r.type==="delete"&&(o===0||e&&this.changeEnd(e)===o)&&(!i||i.added.start!==o+1);f&&n===1&&(n=0);let d=[];for(let h=Math.max(o,n);h<=Math.min(u,s);h++){let m=r.type==="change"&&(c>l&&h===u||e&&e.added.start===0);d.push({type:f?"topdelete":m?"changedelete":a?"untracked":r.type,count:h===o?r.type==="add"?l:c:void 0,lnum:h+(f?1:0)})}if(r.type==="change"&&l>c&&r.vend>=n&&u<=s)for(let h=Math.max(u,n);h<=Math.min(r.vend,s);h++)d.push({type:"add",count:h===r.vend?l-c:void 0,lnum:h});return d}static createPatch(e,r,i,n=!1){let s=[`diff --git a/${e} b/${e}`,`index 000000..000000 ${i}`,`--- a/${e}`,`+++ b/${e}`],a=0;r=structuredClone(r);for(let o of r){let l=o.removed.start,c=o.removed.count,u=o.added.count;o.type==="add"&&(l=l+1);let f=o.removed.lines,d=o.added.lines;n&&([c,u]=[u,c],[f,d]=[d,f]),s.push(`@@ -${l},${c} +${l+a},${u} @@`);for(let h of f)s.push("-"+h);(n?o.added:o.removed).no_nl_at_eof&&s.push("\\ No newline at end of file");for(let h of d)s.push("+"+h);(n?o.removed:o.added).no_nl_at_eof&&s.push("\\ No newline at end of file"),o.removed.start=l+a,a=a+(u-c)}return s}getSummary(e){let r={added:0,changed:0,removed:0};for(let i of e)if(i.type==="add")r.added+=i.added.count;else if(i.type==="delete")r.removed+=i.removed.count;else if(i.type==="change"){let n=i.added.count,s=i.removed.count,a=Math.min(n,s);r.changed+=a,r.added+=n-a,r.removed+=s-a}return r}static findHunk(e,r){if(!r)return[void 0,void 0];for(let i=0;i=e)return[n,i]}return[void 0,void 0]}static findNearestHunk(e,r,i,n){if(r.length!==0){if(i==="first")return 0;if(i==="last")return r.length-1;if(i==="next"){if(r[0].added.start>e)return 0;for(let s=r.length-1;s>=0;s--)if(r[s].added.start<=e){if(s+1e)return s+1;if(n)return 0}}else if(i==="prev"){if(Math.max(r[r.length-1].vend)0&&Math.max(r[s-1].vend,1)l.added.start?n++:o.added.starta.map(v=>g.replace(/&/,v))).reduce((g,v)=>g.concat(v)),m,l);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(n(h),m,u,d)}else m!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+m+";")}(u.length||d)&&l.push((i&&!f&&!c?a.map(i):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in e)s(n(a),e[a],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=SI[xI]||1;return SI[xI]=e+1,X0+e.toString(36)}static mount(e,r,i){let n=e[Z0],s=i&&i.nonce;n?s&&n.setNonce(s):n=new K0(e,s),n.mount(Array.isArray(r)?r:[r],e)}},EI=new Map,K0=class{constructor(e,r){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=EI.get(i);if(s)return e[Z0]=s;this.sheet=new n.CSSStyleSheet,EI.set(i,this)}else this.styleTag=i.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[Z0]=this}mount(e,r){let i=this.sheet,n=0,s=0;for(let a=0;a-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),i)for(let c=0;cc){let f=t.slice(e,r).indexOf(i.slice(n,s));if(f>-1)return[new _t(e,e+f,n,n),new _t(e+f+c,r,s,s)]}else if(c>l){let f=i.slice(n,s).indexOf(t.slice(e,r));if(f>-1)return[new _t(e,e,n,n+f),new _t(r,r,n+f+l,s)]}if(l==1||c==1)return[new _t(e,r,n,s)];let u=qI(t,e,r,i,n,s);if(u){let[f,d,h]=u;return Ba(t,e,f,i,n,d).concat(Ba(t,f+h,r,i,d+h,s))}return nV(t,e,r,i,n,s)}var Bu=1e9,Nu=0,ny=!1;function nV(t,e,r,i,n,s){let a=r-e,o=s-n;if(Bu<1e9&&Math.min(a,o)>Bu*16||Nu>0&&Date.now()>Nu)return Math.min(a,o)>Bu*64?[new _t(e,r,n,s)]:kI(t,e,r,i,n,s);let l=Math.ceil((a+o)/2);Q0.reset(l),J0.reset(l);let c=(h,m)=>t.charCodeAt(e+h)==i.charCodeAt(n+m),u=(h,m)=>t.charCodeAt(r-h-1)==i.charCodeAt(s-m-1),f=(a-o)%2!=0?J0:null,d=f?null:Q0;for(let h=0;hBu||Nu>0&&!(h&63)&&Date.now()>Nu)return kI(t,e,r,i,n,s);let m=Q0.advance(h,a,o,l,f,!1,c)||J0.advance(h,a,o,l,d,!0,u);if(m)return sV(t,e,r,e+m[0],i,n,s,n+m[1])}return[new _t(e,r,n,s)]}var hp=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(f>i)this.start+=2;else if(s){let d=n+(r-i)-l;if(d>=0&&d=r-u)return[h,n+h-d]}else{let h=r-s.vec[d];if(u>=h)return[u,f]}}}return null}},Q0=new hp,J0=new hp;function sV(t,e,r,i,n,s,a,o){let l=!1;return!$l(t,i)&&++i==r&&(l=!0),!$l(n,o)&&++o==a&&(l=!0),l?[new _t(e,r,s,a)]:Ba(t,e,i,n,s,o).concat(Ba(t,i,r,n,o,a))}function jI(t,e){let r=1,i=Math.min(t,e);for(;rr||u>s||t.slice(o,c)!=i.slice(l,u)){if(a==1)return o-e-($l(t,o)?0:1);a=a>>1}else{if(c==r||u==s)return c-e;o=c,l=u}}}function ay(t,e,r,i,n,s){if(e==r||n==s||t.charCodeAt(r-1)!=i.charCodeAt(s-1))return 0;let a=jI(r-e,s-n);for(let o=r,l=s;;){let c=o-a,u=l-a;if(c>1}else{if(c==e||u==n)return r-c;o=c,l=u}}}function ey(t,e,r,i,n,s,a,o){let l=i.slice(n,s),c=null;for(;;){if(c||a=r)break;let d=t.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let m=sy(t,f,r,i,n+h+d.length,s),g=ay(t,e,u,i,n,n+h),v=d.length+m+g;(!c||c[2]>1}}function qI(t,e,r,i,n,s){let a=r-e,o=s-n;if(an.fromA-e&&i.toB>n.fromB-e&&(t[r-1]=new _t(i.fromA,n.toA,i.fromB,n.toB),t.splice(r--,1))}}function aV(t,e,r){for(;;){zI(r,1);let i=!1;for(let n=0;n3||o>3){let l=n==t.length-1?e.length:t[n+1].fromA,c=s.fromA-i,u=l-s.toA,f=TI(e,s.fromA,c),d=AI(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[n]=new _t(f,f+a,s.fromB-h,s.toB-h),f=s.fromA,d=AI(e,s.toA,l-s.toA)):g>m&&e.slice(s.toA,d)==v.slice(w,w+m)&&(s=t[n]=new _t(d-a,d,s.fromB+m,s.toB+m),d=s.toA,f=TI(e,s.fromA,s.fromA-i)),h=s.fromA-f,m=d-s.toA}if(h||m)s=t[n]=new _t(s.fromA-h,s.toA+m,s.fromB-h,s.toB+m);else if(a){if(!o){let g=PI(e,s.fromA,s.toA),v,w=g<0?-1:CI(e,s.toA,s.fromA);g>-1&&(v=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+v)?s=t[n]=s.offset(v):w>-1&&(v=s.toA-w)<=c&&e.slice(s.fromA-v,s.fromA)==e.slice(w,s.toA)&&(s=t[n]=s.offset(-v))}}else{let g=PI(r,s.fromB,s.toB),v,w=g<0?-1:CI(r,s.toB,s.fromB);g>-1&&(v=g-s.fromB)<=u&&r.slice(s.fromB,g)==r.slice(s.toB,s.toB+v)?s=t[n]=s.offset(v):w>-1&&(v=s.toB-w)<=c&&r.slice(s.fromB-v,s.fromB)==r.slice(w,s.toB)&&(s=t[n]=s.offset(-v))}}i=s.toA}return zI(t,3),t}var La;try{La=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(t){}function VI(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function WI(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?VI(r)?1:0:La?!ZI(r)||e==t.length-1?La.test(String.fromCharCode(r))?1:0:La.test(t.slice(e,e+2))?2:0:0}function YI(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?VI(r)?1:0:La?!KI(r)||e==1?La.test(String.fromCharCode(r))?1:0:La.test(t.slice(e-2,e))?2:0:0}var XI=8;function AI(t,e,r){if(e==t.length||!YI(t,e))return e;for(let i=e,n=e+r,s=0;sn)return i;i+=a}return e}function TI(t,e,r){if(!e||!WI(t,e))return e;for(let i=e,n=e-r,s=0;st>=55296&&t<=56319,KI=t=>t>=56320&&t<=57343;function $l(t,e){return!e||e==t.length||!ZI(t.charCodeAt(e-1))||!KI(t.charCodeAt(e))}function lV(t,e,r){var i;let n=r==null?void 0:r.override;return n?n(t,e):(Bu=((i=r==null?void 0:r.scanLimit)!==null&&i!==void 0?i:1e9)>>1,Nu=r!=null&&r.timeout?Date.now()+r.timeout:0,ny=!1,aV(t,e,Ba(t,0,t.length,e,0,e.length)))}function QI(){return!ny}function JI(t,e,r){return oV(lV(t,e,r),t,e)}var Li=$e.Facet.define({combine:t=>t[0]}),ty=$e.StateEffect.define(),cV=$e.Facet.define(),Na=$e.StateField.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(ty)&&(t=r.value);for(let r of e.state.facet(cV))t=r(t,e);return t}});function oy(t){let e=t.field(Na,!1);if(!e)return null;let r=t.facet(Li);return{chunks:e,side:r?r.side:null}}var es=class t{constructor(e,r,i,n,s,a=!0){this.changes=e,this.fromA=r,this.toA=i,this.fromB=n,this.toB=s,this.precise=a}offset(e,r){return e||r?new t(this.changes,this.fromA+e,this.toA+e,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,r,i){let n=JI(e.toString(),r.toString(),i);return eO(n,e,r,0,0,QI())}static updateA(e,r,i,n,s){return OI(II(e,n,!0,i.length),e,r,i,s)}static updateB(e,r,i,n,s){return OI(II(e,n,!1,r.length),e,r,i,s)}};function RI(t,e,r,i){let n=r.lineAt(t),s=i.lineAt(e);return n.to==t&&s.to==e&&tf+1&&v>d+1)break;h.push(m.offset(-c+i,-u+n)),[f,d]=$I(m.toA+i,m.toB+n,e,r),o++}a.push(new es(h,c,Math.max(c,f),u,Math.max(u,d),s))}return a}var cp=1e3;function FI(t,e,r,i){let n=0,s=t.length;for(;;){if(n==s){let u=0,f=0;n&&({toA:u,toB:f}=t[n-1]);let d=e-(r?u:f);return[u+d,f+d]}let a=n+s>>1,o=t[a],[l,c]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>e)s=a;else if(c<=e)n=a+1;else return i?[o.fromA,o.fromB]:[o.toA,o.toB]}}function II(t,e,r,i){let n=[];return e.iterChangedRanges((s,a,o,l)=>{let c=0,u=r?e.length:i,f=0,d=r?i:e.length;s>cp&&([c,f]=FI(t,s-cp,r,!0)),a=c?n[n.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:d,diffA:m.diffA+g,diffB:m.diffB+v}:n.push({fromA:c,toA:u,fromB:f,toB:d,diffA:g,diffB:v})}),n}function OI(t,e,r,i,n){if(!t.length)return e;let s=[];for(let a=0,o=0,l=0,c=0;;a++){let u=a==t.length?null:t[a],f=u?u.fromA+o:r.length,d=u?u.fromB+l:i.length;for(;cf||v.endB+l>d)break;s.push(v.offset(o,l)),c++}if(!u)break;let h=u.toA+o+u.diffA,m=u.toB+l+u.diffB,g=JI(r.sliceString(f,h),i.sliceString(d,m),n);for(let v of eO(g,r,i,f,d,QI()))s.push(v);for(o+=u.diffA,l+=u.diffB;ch&&v.fromB+l>m)break;c++}}return s}var uV={scanLimit:500},tO=Me.ViewPlugin.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=LI(t))}update(t){(t.docChanged||t.viewportChanged||fV(t.startState,t.state)||dV(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=LI(t.view))}},{decorations:t=>t.deco}),up=$e.Prec.low((0,Me.gutter)({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(tO))===null||e===void 0?void 0:e.gutter)||$e.RangeSet.empty}}));function fV(t,e){return t.field(Na,!1)!=e.field(Na,!1)}function dV(t,e){return t.facet(Li)!=e.facet(Li)}var MI=Me.Decoration.line({class:"cm-changedLine"}),hV=Me.Decoration.mark({class:"cm-changedText"}),pV=Me.Decoration.mark({tagName:"ins",class:"cm-insertedLine"}),mV=Me.Decoration.mark({tagName:"del",class:"cm-deletedLine"}),DI=new class extends Me.GutterMarker{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function gV(t,e,r,i,n,s){let a=r?t.fromA:t.fromB,o=r?t.toA:t.toB,l=0;if(a!=o){n.add(a,a,MI),n.add(a,o,r?mV:pV),s&&s.add(a,a,DI);for(let c=e.iterRange(a,o-1),u=a;!c.next().done;){if(c.lineBreak){u++,n.add(u,u,MI),s&&s.add(u,u,DI);continue}let f=u+c.value.length;if(i)for(;l=u)break;(a?f.toA:f.toB)>c&&(!s||!s(t.state,f,o,l))&&gV(f,t.state.doc,a,i,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}var Rl=class extends Me.WidgetType{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},pp=$e.StateEffect.define({map:(t,e)=>t.map(e)}),Hu=$e.StateField.define({create:()=>Me.Decoration.none,update:(t,e)=>{for(let r of e.effects)if(r.is(pp))return r.value;return t.map(e.changes)},provide:t=>Me.EditorView.decorations.from(t)}),fp=.01;function BI(t,e){if(t.size!=e.size)return!1;let r=t.iter(),i=e.iter();for(;r.value;){if(r.from!=i.from||Math.abs(r.value.spec.widget.height-i.value.spec.widget.height)>1)return!1;r.next(),i.next()}return!0}function vV(t,e,r){let i=new $e.RangeSetBuilder,n=new $e.RangeSetBuilder,s=t.state.field(Hu).iter(),a=e.state.field(Hu).iter(),o=0,l=0,c=0,u=0,f=t.viewport,d=e.viewport;for(let v=0;;v++){let w=vfp&&(u+=A,n.add(l,l,Me.Decoration.widget({widget:new Rl(A),block:!0,side:-1})))}if(b>o+1e3&&of.from&&ld.from){let x=Math.min(f.from-o,d.from-l);o+=x,l+=x,v--}else if(w)o=w.toA,l=w.toB;else break;for(;s.value&&s.fromfp&&n.add(e.state.doc.length,e.state.doc.length,Me.Decoration.widget({widget:new Rl(h),block:!0,side:1}));let m=i.finish(),g=n.finish();BI(m,t.state.field(Hu))||t.dispatch({effects:pp.of(m)}),BI(g,e.state.field(Hu))||e.dispatch({effects:pp.of(g)})}var ry=$e.StateEffect.define({map:(t,e)=>e.mapPos(t)});var iy=class extends Me.WidgetType{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=e.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",i=>{let n=e.posAtDOM(i.target);e.dispatch({effects:ry.of(n)});let{side:s,sibling:a}=e.state.facet(Li);a&&a().dispatch({effects:ry.of(wV(n,e.state.field(Na),s=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}};function wV(t,e,r){let i=0,n=0;for(let s=0;;s++){let a=s=t)return n+(t-i);[i,n]=r?[a.toA,a.toB]:[a.toB,a.toA]}}var yV=$e.StateField.define({create(t){return Me.Decoration.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(ry)&&(t=t.update({filter:i=>i!=r.value}));return t},provide:t=>Me.EditorView.decorations.from(t)});function NI({margin:t=3,minSize:e=4}){return yV.init(r=>bV(r,t,e))}function bV(t,e,r){let i=new $e.RangeSetBuilder,n=t.facet(Li).side=="a",s=t.field(Na),a=1;for(let o=0;;o++){let l=o=r&&i.add(t.doc.line(c).from,t.doc.line(u).to,Me.Decoration.replace({widget:new iy(f),block:!0})),!l)break;a=t.doc.lineAt(Math.min(t.doc.length,n?l.toA:l.toB)).number}return i.finish()}var _V=Me.EditorView.styleModule.of(new lp({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),xV=Me.EditorView.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"\u299A"',marginInlineEnd:"7px"},"&:after":{content:'"\u299A"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),HI=new $e.Compartment,dp=new $e.Compartment,mp=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||uV;let r=[$e.Prec.low(tO),xV,_V,Hu,Me.EditorView.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(d=>d.effects.some(h=>h.is(pp)))&&this.measure()})],i=[Li.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(up);let n=$e.EditorState.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],Me.EditorView.editorAttributes.of({class:"cm-merge-a"}),dp.of(i),r]}),s=[Li.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(up);let a=$e.EditorState.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],Me.EditorView.editorAttributes.of({class:"cm-merge-b"}),dp.of(s),r]});this.chunks=es.build(n.doc,a.doc,this.diffConf);let o=[Na.init(()=>this.chunks),HI.of(e.collapseUnchanged?NI(e.collapseUnchanged):[])];n=n.update({effects:$e.StateEffect.appendConfig.of(o)}).state,a=a.update({effects:$e.StateEffect.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:u),this.editorDOM.appendChild(l=="a-b"?u:c),this.a=new Me.EditorView({state:n,parent:c,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new Me.EditorView({state:a,parent:u,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,r){if(e.some(i=>i.docChanged)){let i=e[e.length-1],n=e.reduce((a,o)=>a.compose(o.changes),$e.ChangeSet.empty(e[0].startState.doc.length));this.chunks=r==this.a?es.updateA(this.chunks,i.newDoc,this.b.state.doc,n,this.diffConf):es.updateB(this.chunks,this.a.state.doc,i.newDoc,n,this.diffConf),r.update([...e,i.state.update({effects:ty.of(this.chunks)})]);let s=r==this.a?this.b:this.a;s.update([s.state.update({effects:ty.of(this.chunks)})]),this.scheduleMeasure()}else r.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let a=this.a.dom.parentNode,o=this.b.dom.parentNode;a.remove(),o.remove(),this.editorDOM.insertBefore(s?a:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:a),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,a=this.revertToA,o=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,a=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(s,a,o)}let r="highlightChanges"in e,i="gutter"in e,n="collapseUnchanged"in e;if(r||i||n){let s=[],a=[];if(r||i){let o=this.a.state.facet(Li),l=i?e.gutter!==!1:o.markGutter,c=r?e.highlightChanges!==!1:o.highlightChanges;s.push(dp.reconfigure([Li.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?up:[]])),a.push(dp.reconfigure([Li.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?up:[]]))}if(n){let o=HI.reconfigure(e.collapseUnchanged?NI(e.collapseUnchanged):[]);s.push(o),a.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,r,i){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=i,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",n=>this.revertClicked(n)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){vV(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,r=e.firstChild,i=this.a.viewport,n=this.b.viewport;for(let s=0;si.to||a.fromB>n.to)break;if(a.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function UI(t){let e=t.nextSibling;return t.remove(),e}var ly=require("@codemirror/state");function cy(t,e,r){let i=[],n=t.split(` +`),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;dn.length&&n.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(a.newLines>0){for(let d=c;ds.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}i.push(f)}return i}function uy(t,e,r){let i=e.lineAt(t.fromA).number,n=t.fromA==t.toA?0:gp(e,t.endA)-i+1,s=r.lineAt(t.fromB).number,a=t.fromB==t.toB?0:gp(r,t.endB)-s+1,o={oldStart:i,oldLines:n,newStart:s,newLines:a};return o.oldLines==0&&(o.oldStart-=1),o.newLines==0&&(o.newStart-=1),o}var rO={scanLimit:1e3,timeout:200};function SV(t,e,r,i){let n=ly.Text.of(t.split(` +`)),s=ly.Text.of(e.split(` +`)),a=r&&i?es.updateB(r,n,s,i,rO):es.build(n,s,rO),o=[];for(let l=0;lh.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}},Fr=Fl.StateField.define({create:t=>{},update:(t,e)=>{let r=t?{...t}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},i=!1;for(let n of e.effects)n.is(Ol)&&(r.compareText=n.value.compareText,r.compareTextHead=n.value.compareTextHead,i=(t==null?void 0:t.compareText)!==n.value.compareText,i&&(r.chunks=void 0)),n.is(Uu)&&nO(r,n.value,e.state);if(r.compareText!==void 0){if(i||e.docChanged){r.isDirty=!0;let n=EV(e,r.compareText,r.chunks,r.maxDiffTimeMs);n&&nO(r,n,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 nO(t,e,r){var n,s;t.hunks=e.hunks,t.chunks=e.chunks,t.isDirty=!1,t.maxDiffTimeMs=Math.max(.95*t.maxDiffTimeMs,e.diffDuration);let i=r.field(Il.editorInfoField).file;(s=(n=Ii.plugin)==null?void 0:n.editorIntegration.signsFeature.changeStatusBar)==null||s.display(t.hunks,i)}var fy=Fl.StateField.define({create:()=>({debouncer:(0,Il.debounce)(t=>{let{state:e,compareText:r,previousChunks:i,changeDesc:n}=t,s=sO(e,r,i,n);e.field(Il.editorEditorField).dispatch({effects:Uu.of(s)})},1e3,!0),maxDiffTimeMs:0}),update:(t,e)=>{var r;for(let i of e.effects)if(i.is(Uu))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 sO(t,e,r,i){let n=t.doc.toString(),s=performance.now(),{hunks:a,chunks:o}=iO(e,n,r,i),l=performance.now()-s;return{hunks:a,chunks:o,diffDuration:l}}function EV(t,e,r,i){let n=t.state,s=Math.abs(t.changes.length-t.changes.newLength),a=n.field(fy);if(s>1e3||i>16)a.debouncer({state:n,compareText:e,previousChunks:r,changeDesc:a.changeDesc});else return a.changeDesc=void 0,sO(n,e,r,t.changes)}var Ol=Fl.StateEffect.define(),Uu=Fl.StateEffect.define();function aO(t,e){return e.update({effects:Ol.of(t)})}p();p();p();var it;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(it||(it={}));var oO={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},lO={LINES:"lines",WORDS:"words",NONE:"none"},cO={WORD:"word",CHAR:"char"},Ha;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(Ha||(Ha={}));p();var kV=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],AV=RegExp("["+kV.join("\\")+"]","g");function uO(t){return t.replace(AV,"\\$&")}function dy(t){return t&&t.replace(/\\/g,"/")}function fO(t){let e,r,i,n=0;for(e=0,i=t.length;e1?r[r.length-1]:e}function hO(t,e){return e.reduce((r,i)=>r||t.startsWith(i),!1)}var pO=["a/","b/","i/","w/","c/","o/"];function Vs(t,e,r){let i=r!==void 0?[...pO,r]:pO,n=e?new RegExp(`^${uO(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=n.exec(t)||[],a=i.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 TV(t,e){return Vs(t,"---",e)}function CV(t,e){return Vs(t,"+++",e)}function mO(t,e={}){let r=[],i=null,n=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/,T=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,P=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,D=/^new file mode (\d{6})/,B=/^deleted file mode (\d{6}),(\d{6})/,N=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,` +`).split(` +`);function ce(){n!==null&&i!==null&&(i.blocks.push(n),n=null)}function Pe(){i!==null&&(!i.oldName&&l!==null&&(i.oldName=l),!i.newName&&c!==null&&(i.newName=c),i.newName&&(r.push(i),i=null)),l=null,c=null}function ve(){ce(),Pe(),i={blocks:[],deletedLines:0,addedLines:0}}function se(z){ce();let Q;i!==null&&((Q=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(z))?(i.isCombined=!1,s=parseInt(Q[1],10),o=parseInt(Q[2],10)):(Q=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(z))?(i.isCombined=!0,s=parseInt(Q[1],10),a=parseInt(Q[2],10),o=parseInt(Q[3],10)):(z.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,o=0,i.isCombined=!1)),n={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:o,header:z}}function xe(z){if(i===null||n===null||s===null||o===null)return;let Q={content:z},j=i.isCombined?["+ "," +","++"]:["+"],Le=i.isCombined?["- "," -","--"]:["-"];hO(z,j)?(i.addedLines++,Q.type=it.INSERT,Q.oldNumber=void 0,Q.newNumber=o++):hO(z,Le)?(i.deletedLines++,Q.type=it.DELETE,Q.oldNumber=s++,Q.newNumber=void 0):(Q.type=it.CONTEXT,Q.oldNumber=s++,Q.newNumber=o++),n.lines.push(Q)}function we(z,Q){let j=Q;for(;j{if(!z||z.startsWith("*"))return;let j,Le=N[Q-1],lr=N[Q+1],It=N[Q+2];if(z.startsWith("diff --git")||z.startsWith("diff --combined")){if(ve(),(j=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(z))&&(l=Vs(j[1],void 0,e.dstPrefix),c=Vs(j[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isGitDiff=!0;return}if(z.startsWith("Binary files")&&!(i!=null&&i.isGitDiff)){if(ve(),(j=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(z))&&(l=Vs(j[1],void 0,e.dstPrefix),c=Vs(j[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isBinary=!0;return}if((!i||!i.isGitDiff&&i&&z.startsWith(u)&&lr.startsWith(f)&&It.startsWith(d))&&ve(),i!=null&&i.isTooBig)return;if(i&&(typeof e.diffMaxChanges=="number"&&i.addedLines+i.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&z.length>e.diffMaxLineLength)){i.isTooBig=!0,i.addedLines=0,i.deletedLines=0,i.blocks=[],n=null;let At=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";se(At);return}if(z.startsWith(u)&&lr.startsWith(f)||z.startsWith(f)&&Le.startsWith(u)){if(i&&!i.oldName&&z.startsWith("--- ")&&(j=TV(z,e.srcPrefix))){i.oldName=j,i.language=dO(i.oldName,i.language);return}if(i&&!i.newName&&z.startsWith("+++ ")&&(j=CV(z,e.dstPrefix))){i.newName=j,i.language=dO(i.newName,i.language);return}}if(i&&(z.startsWith(d)||i.isGitDiff&&i.oldName&&i.newName&&!n)){se(z);return}if(n&&(z.startsWith("+")||z.startsWith("-")||z.startsWith(" "))){xe(z);return}let Fe=!we(z,Q);if(i===null)throw new Error("Where is my file !!!");(j=h.exec(z))?i.oldMode=j[1]:(j=m.exec(z))?i.newMode=j[1]:(j=g.exec(z))?(i.deletedFileMode=j[1],i.isDeleted=!0):(j=v.exec(z))?(i.newFileMode=j[1],i.isNew=!0):(j=w.exec(z))?(Fe&&(i.oldName=j[1]),i.isCopy=!0):(j=b.exec(z))?(Fe&&(i.newName=j[1]),i.isCopy=!0):(j=k.exec(z))?(Fe&&(i.oldName=j[1]),i.isRename=!0):(j=x.exec(z))?(Fe&&(i.newName=j[1]),i.isRename=!0):(j=S.exec(z))?(i.isBinary=!0,i.oldName=Vs(j[1],void 0,e.srcPrefix),i.newName=Vs(j[2],void 0,e.dstPrefix),se("Binary file")):_.test(z)?(i.isBinary=!0,se(z)):(j=E.exec(z))?i.unchangedPercentage=parseInt(j[1],10):(j=A.exec(z))?i.changedPercentage=parseInt(j[1],10):(j=y.exec(z))?(i.checksumBefore=j[1],i.checksumAfter=j[2],j[3]&&(i.mode=j[3])):(j=T.exec(z))?(i.checksumBefore=[j[2],j[3]],i.checksumAfter=j[1]):(j=P.exec(z))?(i.oldMode=[j[2],j[3]],i.newMode=j[1]):(j=D.exec(z))?(i.newFileMode=j[1],i.isNew=!0):(j=B.exec(z))&&(i.deletedFileMode=j[1],i.isDeleted=!0)}),ce(),Pe(),r}p();p();p();function RV(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],i;for(i=0;i<=e.length;i++)r[i]=[i];let n;for(n=0;n<=t.length;n++)r[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?r[i][n]=r[i-1][n-1]:r[i][n]=Math.min(r[i-1][n-1]+1,Math.min(r[i][n-1]+1,r[i-1][n]+1));return r[e.length][t.length]}function Ml(t){return(e,r)=>{let i=t(e).trim(),n=t(r).trim();return RV(i,n)/(i.length+n.length)}}function Dl(t){function e(i,n,s=new Map){let a=1/0,o;for(let l=0;l0||o.indexB>0)&&(k=v.concat(k)),(i.length>d||n.length>h)&&(k=k.concat(b)),k}return r}var Vt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},Ua={matching:lO.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:cO.WORD,colorScheme:Ha.LIGHT},vn="/",gO=Ml(t=>t.value),$V=Dl(gO);function py(t){return t.indexOf("dev/null")!==-1}function FV(t){return t.replace(/(]*>((.|\n)*?)<\/ins>)/g,"")}function IV(t){return t.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}function Ll(t){switch(t){case it.CONTEXT:return Vt.CONTEXT;case it.INSERT:return Vt.INSERTS;case it.DELETE:return Vt.DELETES}}function Bl(t){switch(t){case Ha.DARK:return"d2h-dark-color-scheme";case Ha.AUTO:return"d2h-auto-color-scheme";case Ha.LIGHT:default:return"d2h-light-color-scheme"}}function OV(t){return t?2:1}function Ws(t){return t.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function yi(t,e,r=!0){let i=OV(e);return{prefix:t.substring(0,i),content:r?Ws(t.substring(i)):t.substring(i)}}function Ga(t){let e=dy(t.oldName),r=dy(t.newName);if(e!==r&&!py(e)&&!py(r)){let i=[],n=[],s=e.split(vn),a=r.split(vn),o=s.length,l=a.length,c=0,u=o-1,f=l-1;for(;cc&&f>c&&s[u]===a[f];)n.unshift(a[f]),u-=1,f-=1;let d=i.join(vn),h=n.join(vn),m=s.slice(c,u+1).join(vn),g=a.slice(c,f+1).join(vn);return d.length&&h.length?d+vn+"{"+m+" \u2192 "+g+"}"+vn+h:d.length?d+vn+"{"+m+" \u2192 "+g+"}":h.length?"{"+m+" \u2192 "+g+"}"+vn+h:e+" \u2192 "+r}else return py(r)?e:r}function Nl(t){return`d2h-${fO(Ga(t)).toString().slice(-6)}`}function Hl(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function wp(t,e,r,i={}){let{matching:n,maxLineLengthHighlight:s,matchWordsThreshold:a,diffStyle:o}=Object.assign(Object.assign({},Ua),i),l=yi(t,r,!1),c=yi(e,r,!1);if(l.content.length>s||c.content.length>s)return{oldLine:{prefix:l.prefix,content:Ws(l.content)},newLine:{prefix:c.prefix,content:Ws(c.content)}};let u=o==="char"?Tv(l.content,c.content):Iv(l.content,c.content),f=[];if(o==="word"&&n==="words"){let h=u.filter(v=>v.removed),m=u.filter(v=>v.added);$V(m,h).forEach(v=>{v[0].length===1&&v[1].length===1&&gO(v[0][0],v[1][0]){let g=m.added?"ins":m.removed?"del":null,v=f.indexOf(m)>-1?' class="d2h-change"':"",w=Ws(m.value);return g!==null?`${h}<${g}${v}>${w}`:`${h}${w}`},"");return{oldLine:{prefix:l.prefix,content:FV(d)},newLine:{prefix:c.prefix,content:IV(d)}}}var vO="file-summary",MV="icon",DV={colorScheme:Ua.colorScheme},yp=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},DV),r)}render(e){let r=e.map(i=>this.hoganUtils.render(vO,"line",{fileHtmlId:Nl(i),oldName:i.oldName,newName:i.newName,fileName:Ga(i),deletedLines:"-"+i.deletedLines,addedLines:"+"+i.addedLines},{fileIcon:this.hoganUtils.template(MV,Hl(i))})).join(` +`);return this.hoganUtils.render(vO,"wrapper",{colorScheme:Bl(this.config.colorScheme),filesNumber:e.length,files:r})}};p();var gy=Object.assign(Object.assign({},Ua),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Gu="generic",wO="line-by-line",LV="icon",BV="tag",ju=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},gy),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(Gu,"wrapper",{colorScheme:Bl(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(wO,"file-diff"),n=this.hoganUtils.template(Gu,"file-path"),s=this.hoganUtils.template(LV,"file"),a=this.hoganUtils.template(BV,Hl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Ga(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return this.hoganUtils.render(Gu,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Vt})}generateFileHtml(e){let r=Dl(Ml(i=>yi(i.content,e.isCombined).content));return e.blocks.map(i=>{let n=this.hoganUtils.render(Gu,"block-header",{CSSLineClass:Vt,blockHeader:e.isTooBig?i.header:Ws(i.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(i).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);n+=u,n+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=yi(l.content,e.isCombined);n+=this.generateSingleLineHtml(e,{type:Vt.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);n+=l,n+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).join(` +`)}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===it.CONTEXT?r.push([[a],[],[]]):a.type===it.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===it.INSERT&&i.length>0?n.push(a):a.type===it.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=vp(e.concat(r).map(o=>o.content.length));return n{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(qu,"wrapper",{colorScheme:Bl(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(NV,"file-diff"),n=this.hoganUtils.template(qu,"file-path"),s=this.hoganUtils.template(HV,"file"),a=this.hoganUtils.template(UV,Hl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Ga(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(qu,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Vt})}}generateFileHtml(e){let r=Dl(Ml(i=>yi(i.content,e.isCombined).content));return e.blocks.map(i=>{let n={left:this.makeHeaderHtml(i.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(i).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);n.left+=u,n.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=yi(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:Vt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Vt.CONTEXT,prefix:c,content:u,number:l.newNumber});n.left+=f,n.right+=d});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,a,o);n.left+=l,n.right+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).reduce((i,n)=>({left:i.left+n.left,right:i.right+n.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===it.CONTEXT?r.push([[a],[],[]]):a.type===it.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===it.INSERT&&i.length>0?n.push(a):a.type===it.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=vp(e.concat(r).map(o=>o.content.length));return n'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileName",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("addedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("deletedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{"'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' Files changed ('),i.b(i.v(i.f("filesNumber",t,e,0))),i.b(")"),i.b(` +`+r),i.b(' hide'),i.b(` +`+r),i.b(' show'),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
    '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("files",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-block-header"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.s(i.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(a.t(a.f("blockHeader",n,s,0)))}),t.pop()),i.s(i.f("blockHeader",t,e,1),t,e,1,0,0,"")||i.b(" "),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-empty-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" File without changes"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-file-path"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(''),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileDiffName",t,e,0))),i.b(""),i.b(` +`+r),i.b(i.rp(""),i.b(` +`+r),i.b('"),i.fl()},partials:{""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("lineNumber",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.s(i.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("prefix",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("prefix",t,e,1),t,e,1,0,0,"")||(i.b('  '),i.b(` +`+r)),i.s(i.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("content",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("content",t,e,1),t,e,1,0,0,"")||(i.b('
'),i.b(` +`+r)),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});wt["generic-wrapper"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("content",t,e,0))),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});wt["icon-file-added"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file-changed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file-deleted"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file-renamed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["icon-file"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});wt["line-by-line-file-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("diffs",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});wt["line-by-line-numbers"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(i.v(i.f("oldNumber",t,e,0))),i.b("
"),i.b(` +`+r),i.b('
'),i.b(i.v(i.f("newNumber",t,e,0))),i.b("
"),i.fl()},partials:{},subs:{}});wt["side-by-side-file-diff"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.left",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.right",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});wt["tag-file-added"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('ADDED'),i.fl()},partials:{},subs:{}});wt["tag-file-changed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('CHANGED'),i.fl()},partials:{},subs:{}});wt["tag-file-deleted"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('DELETED'),i.fl()},partials:{},subs:{}});wt["tag-file-renamed"]=new xt.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('RENAMED'),i.fl()},partials:{},subs:{}});var Vu=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let i=Object.entries(r).reduce((n,[s,a])=>{let o=_y.compile(a,{asString:!1});return Object.assign(Object.assign({},n),{[s]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},wt),e),i)}static compile(e){return _y.compile(e,{asString:!1})}render(e,r,i,n,s){let a=this.templateKey(e,r);try{return this.preCompiledTemplates[a].render(i,n,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 jV=Object.assign(Object.assign(Object.assign({},gy),vy),{outputFormat:oO.LINE_BY_LINE,drawFileList:!0});function _p(t,e={}){let r=Object.assign(Object.assign({},jV),e),i=typeof t=="string"?mO(t,r):t,n=new Vu(r),{colorScheme:s}=r,a={colorScheme:s},o=r.drawFileList?new yp(n,a).render(i):"",l=r.outputFormat==="side-by-side"?new zu(n,r).render(i):new ju(n,r).render(i);return o+l}var AO=Mt(EO());var ja=require("obsidian"),xy=Wu.StateEffect.define();function Ys(t,e){let r=t.state,i=r.field(Sp),n=r.field(Fr),s=r.doc.lineAt(e!=null?e:r.selection.main.head).number,a=Nt.findHunk(s,n==null?void 0:n.hunks)[0];if(!a)return;let o=r.doc.line(Math.max(1,a.added.start)).from,l=i.has(o);return r.field(ja.editorEditorField).dispatch({effects:xy.of({pos:o,add:!l})})}var Sp=Wu.StateField.define({create:()=>new Set,update(t,e){let r=new Set;for(let i of e.effects)i.is(xy)&&(i.value.add?t.add(i.value.pos):t.delete(i.value.pos));for(let i of t)r.add(e.changes.mapPos(i));return r}}),TO=Wu.StateField.define({create:t=>kO(t),update(t,e){return e.docChanged||e.effects.some(r=>r.is(Ol)||r.is(xy))?kO(e.state):t},provide:t=>xp.showTooltip.computeN([t],e=>e.field(t))}),CO=xp.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 kO(t){let e=t.field(Fr);return e?[...t.field(Sp)].map(i=>{let n=t.doc.lineAt(i),s=Nt.findHunk(n.number,e.hunks)[0];if(s)return{pos:i,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>qV(s,t,i)}}).filter(i=>i!==void 0):[]}function qV(t,e,r){var g,v;let i=Nt.createPatch("file",[t],"10064",!1).join(` +`)+` +`,n=_p(i,{colorScheme:AO.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(n,"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,ja.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(ja.editorEditorField);c.onclick=()=>{Ys(d,r)},u.onclick=()=>{let w=Ii.plugin;w&&(w.promiseQueue.addTask(()=>w.hunkActions.stageHunk(r)),Ys(d,r))},f.onclick=()=>{let w=Ii.plugin;w&&(w.hunkActions.resetHunk(r),Ys(d,r))};let h=(v=(g=Ii.plugin)==null?void 0:g.app.workspace.getActiveViewOfType(ja.MarkdownView))==null?void 0:v.scope,m=h==null?void 0:h.register(null,"Escape",(w,b)=>{Ys(d,r)});return{dom:a,destroy:()=>{m&&(h==null||h.unregister(m))},update:w=>{r=w.changes.mapPos(r)}}}function PO(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 i=await e.vault.adapter.read(r),s=await new op(e,i).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 n;let r=e.workspace.getLeavesOfType(zt.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:zt.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(gi.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:gi.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;{let n=t.gitManager.getRelativeRepoPath(i.path,!0);t.tools.openDiff({aFile:n,aRef:""})}}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(r,{file:i})=>{if(i)return vI(r,i,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(r,{file:i})=>{if(i)return wI(i,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 i=e.workspace.getActiveFile();if(r)return i!==null;t.addFileToGitignore(i.path,i instanceof Ni.TFolder).catch(n=>t.displayError(n))}}),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 i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:i})})}),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}))}}),Ni.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 i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:i})})}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",checkCallback:function(r){return r?!1:t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0}))}}),t.addCommand({id:"push2",name:"Push",callback:()=>t.promiseQueue.addTask(()=>t.push())}),t.addCommand({id:"stage-current-file",name:"Stage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.stageFile(i))}}),t.addCommand({id:"unstage-current-file",name:"Unstage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.unstageFile(i))}}),t.addCommand({id:"edit-remotes",name:"Edit remotes",callback:()=>t.editRemotes().catch(r=>t.displayError(r))}),t.addCommand({id:"remove-remote",name:"Remove remote",callback:()=>t.removeRemote().catch(r=>t.displayError(r))}),t.addCommand({id:"set-upstream-branch",name:"Set upstream branch",callback:()=>t.setUpstreamBranch().catch(r=>t.displayError(r))}),t.addCommand({id:"delete-repo",name:"CAUTION: Delete repository",callback:async()=>{await e.vault.adapter.exists(`${t.settings.basePath}/.git`)?await new Qe(t,{options:["NO","YES"],placeholder:"Do you really want to delete the repository (.git directory)? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&(await e.vault.adapter.rmdir(`${t.settings.basePath}/.git`,!0),new Ni.Notice("Successfully deleted repository. Reloading plugin..."),t.unloadPlugin(),await t.init({fromReload:!0})):new Ni.Notice("No repository found")}}),t.addCommand({id:"init-repo",name:"Initialize a new repo",callback:()=>t.createNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"clone-repo",name:"Clone an existing remote repo",callback:()=>t.cloneNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"list-changed-files",name:"List changed files",callback:async()=>{if(await t.isAllInitialized())try{let r=await t.updateCachedStatus();if(r.changed.length+r.staged.length>500){t.displayError("Too many changes to display");return}new ap(t,r.all).open()}catch(r){t.displayError(r)}}}),t.addCommand({id:"switch-branch",name:"Switch branch",callback:()=>{t.switchBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"create-branch",name:"Create new branch",callback:()=>{t.createBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"delete-branch",name:"Delete branch",callback:()=>{t.deleteBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"discard-all",name:"CAUTION: Discard all changes",callback:async()=>{let r=await t.discardAll();switch(r){case"discard":new Ni.Notice("Discarded all changes in tracked files.");break;case"delete":new Ni.Notice("Discarded all files.");break;case!1:break;default:wh(r)}}}),t.addCommand({id:"pause-automatic-routines",name:"Pause/Resume automatic routines",callback:()=>{let r=!t.localStorage.getPausedAutomatics();t.localStorage.setPausedAutomatics(r),r?(t.automaticsManager.unload(),new Ni.Notice("Paused automatic routines.")):(t.automaticsManager.reload("commit","push","pull"),new Ni.Notice("Resumed automatic routines."))}}),t.addCommand({id:"raw-command",name:"Raw command",checkCallback:r=>{let i=t.gitManager;if(r)return i instanceof Se;t.tools.runRawCommand().catch(n=>t.displayError(n))}}),t.addCommand({id:"toggle-line-author-info",name:"Toggle line author information",callback:()=>{var r;return(r=t.settingsTab)==null?void 0:r.configureLineAuthorShowStatus(!t.settings.lineAuthor.show)}}),t.addCommand({id:"reset-hunk",name:"Reset hunk",editorCheckCallback(r,i,n){if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.resetHunk()}}),t.addCommand({id:"stage-hunk",name:"Stage hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.promiseQueue.addTask(()=>t.hunkActions.stageHunk())}}),t.addCommand({id:"preview-hunk",name:"Preview hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;let s=t.hunkActions.editor.editor;Ys(s)}}),t.addCommand({id:"next-hunk",name:"Go to next hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("next")}}),t.addCommand({id:"prev-hunk",name:"Go to previous hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("prev")}})}p();var Ep=class{constructor(e){this.plugin=e;this.prefix=this.plugin.manifest.id+":",this.app=e.app}migrate(){let e=["password","hostname","conflict","lastAutoPull","lastAutoBackup","lastAutoPush","gitPath","pluginDisabled"];for(let r of e){let i=localStorage.getItem(this.prefix+r);this.app.loadLocalStorage(this.prefix+r)==null&&i!=null&&i!=null&&(this.app.saveLocalStorage(this.prefix+r,i),localStorage.removeItem(this.prefix+r))}}getPassword(){return this.app.loadLocalStorage(this.prefix+"password")}setPassword(e){return this.app.saveLocalStorage(this.prefix+"password",e)}getUsername(){return this.app.loadLocalStorage(this.prefix+"username")}setUsername(e){return this.app.saveLocalStorage(this.prefix+"username",e)}getHostname(){return this.app.loadLocalStorage(this.prefix+"hostname")}setHostname(e){return this.app.saveLocalStorage(this.prefix+"hostname",e)}getConflict(){return this.app.loadLocalStorage(this.prefix+"conflict")=="true"}setConflict(e){return this.app.saveLocalStorage(this.prefix+"conflict",`${e}`)}getLastAutoPull(){return this.app.loadLocalStorage(this.prefix+"lastAutoPull")}setLastAutoPull(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPull",e)}getLastAutoBackup(){return this.app.loadLocalStorage(this.prefix+"lastAutoBackup")}setLastAutoBackup(e){return this.app.saveLocalStorage(this.prefix+"lastAutoBackup",e)}getLastAutoPush(){return this.app.loadLocalStorage(this.prefix+"lastAutoPush")}setLastAutoPush(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPush",e)}getGitPath(){return this.app.loadLocalStorage(this.prefix+"gitPath")}setGitPath(e){return this.app.saveLocalStorage(this.prefix+"gitPath",e)}getPATHPaths(){var e,r;return(r=(e=this.app.loadLocalStorage(this.prefix+"PATHPaths"))==null?void 0:e.split(":"))!=null?r:[]}setPATHPaths(e){return this.app.saveLocalStorage(this.prefix+"PATHPaths",e.join(":"))}getEnvVars(){var e;return JSON.parse((e=this.app.loadLocalStorage(this.prefix+"envVars"))!=null?e:"[]")}setEnvVars(e){return this.app.saveLocalStorage(this.prefix+"envVars",JSON.stringify(e))}getPluginDisabled(){return this.app.loadLocalStorage(this.prefix+"pluginDisabled")=="true"}setPluginDisabled(e){return this.app.saveLocalStorage(this.prefix+"pluginDisabled",`${e}`)}getPausedAutomatics(){return this.app.loadLocalStorage(this.prefix+"pausedAutomatics")=="true"}setPausedAutomatics(e){return this.app.saveLocalStorage(this.prefix+"pausedAutomatics",`${e}`)}};p();var Ul=require("obsidian");var Yu=class{constructor(e){this.plugin=e}async hasTooBigFiles(e){let r=await this.plugin.gitManager.branchInfo(),i=r.tracking?Zn(r.tracking)[0]:null;if(!i)return!1;let n=await this.plugin.gitManager.getRemoteUrl(i);if(n!=null&&n.includes("github.com")){let s=[],a=this.plugin.gitManager;for(let o of e){let l=this.plugin.app.vault.getAbstractFileByPath(o.vaultPath),c=!1;if(l instanceof Ul.TFile)l.stat.size>=1e8&&(c=!0);else{let u=await this.plugin.app.vault.adapter.stat(o.vaultPath);u&&u.size>=1e8&&(c=!0)}if(c){let u=!1;a instanceof Se&&(u=await a.isFileTrackedByLFS(o.path)),u||s.push(o)}}if(s.length>0)return this.plugin.displayError(`Aborted commit, because the following files are too big: +- ${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(al,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(i=>{i.getDisplayText()!=""&&al.startsWith(i.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(al,"/",!0)}openDiff({aFile:e,bFile:r,aRef:i,bRef:n,event:s}){var l,c;let a=this.plugin.settings.diffStyle;Ul.Platform.isMobileApp&&(a="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:i,bRef:n};a=="split"?(l=Mi(this.plugin.app,s))==null||l.setViewState({type:Ls.type,active:!0,state:o}):a=="git_unified"&&((c=Mi(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 i=await new Qe(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();i!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let n=new Ul.Notice(`Running '${i}'...`,999999);try{let s=await e.rawCommand(i);s?(n.setMessage(s),window.setTimeout(()=>n.hide(),5e3)):n.hide()}catch(s){throw n.hide(),s}})}};p();var kp=require("obsidian");var qa=class extends kp.ItemView{constructor(r,i){super(r);this.plugin=i;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 i=this.state.bFile.split("/").last();return i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3)),`Diff: ${i}`}return Bs.name}getIcon(){return Bs.icon}async setState(r,i){this.state=r,kp.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 i=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let n=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!i){if(this.plugin.gitManager instanceof Se&&await this.plugin.gitManager.isTracked(this.state.bFile))i=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(` +`);else if(await this.app.vault.adapter.exists(n)){let s=await this.app.vault.adapter.read(n);i=[...`--- /dev/null ++++ ${this.state.bFile} +@@ -0,0 +1,${s.split(` +`).length} @@`.split(` +`),...s.split(` +`).map(o=>`+${o}`)].join(` +`)}}if(i){let s=this.parser.parseFromString(_p(i),"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 ts=require("obsidian");var jl=require("@codemirror/commands");var Ap=require("@codemirror/search"),Gl=require("@codemirror/state"),_i=require("@codemirror/view");var za=class extends ts.ItemView{constructor(r,i){super(r);this.plugin=i;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",n=>{this.state.bRef==null&&n.path===this.state.bFile&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(n,s)=>{this.state.bRef==null&&(n.path===this.state.bFile||s===this.state.bFile)&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,ts.debounce)(n=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),n).catch(a=>this.plugin.displayError(a)))},1e3,!1)}getViewType(){return Ls.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3));let n;return this.state.bRef==null?n=" (Working Tree)":this.state.bRef==""?n=" (Index)":n="("+this.state.bRef.substring(0,7)+")",`Diff: ${i} ${n}`}return Ls.name}getIcon(){return Ls.icon}async setState(r,i){this.state=r,ts.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(r,i),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,i){try{return await this.plugin.gitManager.show(r,i,!1)}catch(n){if(n instanceof Rr&&(n.message.includes("does not exist")||n.message.includes("unknown revision or path")||n.message.includes("exists on disk, but not in")||n.message.includes("fatal: bad object")))return n.message.includes("fatal: bad object")&&this.plugin.displayError(n.message),"";throw n}}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 i=await this.app.vault.adapter.read(this.state.bFile);if(i!=r.state.doc.toString()){let n=r.state.update({changes:{from:0,to:r.state.doc.length,insert:i},annotations:[Gl.Transaction.remote.of(!0)]});r.dispatch(n)}this.refreshing=!1}async updateRefEditors(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.a,i=this.mergeView.b;this.refreshing=!0;let n=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)),n!=r.state.doc.toString()){let a=r.state.update({changes:{from:0,to:r.state.doc.length,insert:n}});r.dispatch(a)}if(s!=null&&s!=i.state.doc.toString()){let a=i.state.update({changes:{from:0,to:i.state.doc.length,insert:s}});i.dispatch(a)}this.refreshing=!1}renderButtons(){let r=document.createElement("div"),i=r.createDiv();if(i.addClass("clickable-icon"),i.setAttr("aria-label",this.state.bRef==null?"Stage hunk":"Unstage hunk"),(0,ts.setIcon)(i,this.state.bRef==null?"plus":"minus"),i.onmousedown=async n=>{var h;let s=this.mergeView.b,a=this.mergeView.a,o=oy(s.state),l=(h=r.parentElement)==null?void 0:h.indexOf(r),c=o.chunks[l],u=uy(c,a.state.doc,s.state.doc),f=cy(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 n=r.createDiv();n.addClass("clickable-icon"),n.setAttr("aria-label","Reset hunk"),(0,ts.setIcon)(n,"undo"),n.onmousedown=s=>{var f;let a=this.mergeView.a,o=this.mergeView.b,l=oy(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=n=>{n.preventDefault(),n.stopPropagation()},r}async createMergeView(){var r,i,n;if((r=this.state)!=null&&r.aFile&&((i=this.state)!=null&&i.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0,(n=this.mergeView)==null||n.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,_i.lineNumbers)(),(0,Ap.highlightSelectionMatches)(),(0,_i.drawSelection)(),_i.keymap.of([...jl.standardKeymap,jl.indentWithTab]),(0,jl.history)(),(0,Ap.search)(),_i.EditorView.lineWrapping],c=this,u=_i.ViewPlugin.define(g=>({update(v){if(v.docChanged&&!v.transactions.some(w=>w.annotation(Gl.Transaction.remote))){let w=g.state.doc.toString();c.fileSaveDebouncer(w)}}})),f={doc:a,extensions:[...l,_i.EditorView.editable.of(!1),Gl.EditorState.readOnly.of(!0)]},d=[...l];this.bIsEditable?d.push(u):d.push(_i.EditorView.editable.of(!1),Gl.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 mp({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 aD=require("obsidian");p();p();p();var RO="5";var $O,FO,IO;typeof window!="undefined"&&((IO=(FO=($O=window.__svelte)!=null?$O:window.__svelte={}).v)!=null?IO:FO.v=new Set).add(RO);p();p();p();var Xu="[",wn="[!",Va="]",rs={};var Je=Symbol(),xi=Symbol("filename"),OO=Symbol("hmr"),MO="http://www.w3.org/1999/xhtml";p();p();p();p();var Tp=!0;p();var M=!1;p();var is=Array.isArray,DO=Array.prototype.indexOf,Hi=Array.prototype.includes,ql=Array.from,Sy=Object.keys,tr=Object.defineProperty,Ir=Object.getOwnPropertyDescriptor,Ey=Object.getOwnPropertyDescriptors,ky=Object.prototype,LO=Array.prototype,zl=Object.getPrototypeOf,Ay=Object.isExtensible;function Ty(t){return typeof t=="function"}var Or=()=>{};function Cp(t){for(var e=0;e{t=i,e=n});return{promise:r,resolve:t,reject:e}}p();p();var Wt=Symbol("$state"),Zu=Symbol("legacy props"),BO=Symbol(""),Rp=Symbol("proxy path"),yn=new class extends Error{constructor(){super(...arguments);ze(this,"name","StaleReactionError");ze(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Vl=3,Mr=8;p();p();function $p(t){if(M){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 NO(){if(M){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 Cy(){if(M){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 HO(){if(M){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 Py(t,e,r){if(M){let i=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 i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function UO(t){if(M){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 GO(){if(M){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 jO(t){if(M){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 qO(){if(M){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 zO(){if(M){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 VO(t){if(M){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 WO(t){if(M){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 YO(){if(M){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 XO(){if(M){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 ZO(){if(M){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 KO(){if(M){let t=new Error("svelte_boundary_reset_onerror\nA `` `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 Xs="font-weight: bold",Zs="font-weight: normal";function QO(t,e){M?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`,Xs,Zs):console.warn("https://svelte.dev/e/await_waterfall")}function JO(t,e,r){M?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`,Xs,Zs):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Wa(t){M?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`,Xs,Zs):console.warn("https://svelte.dev/e/hydration_mismatch")}function eM(){M?console.warn(`%c[svelte] lifecycle_double_unmount +%cTried to unmount a component that was not mounted +https://svelte.dev/e/lifecycle_double_unmount`,Xs,Zs):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Fp(t){M?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`,Xs,Zs):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function tM(){M?console.warn(`%c[svelte] state_proxy_unmount +%cTried to unmount a state proxy, rather than a component +https://svelte.dev/e/state_proxy_unmount`,Xs,Zs):console.warn("https://svelte.dev/e/state_proxy_unmount")}function rM(){M?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Xs,Zs):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function iM(t){M?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`,Xs,Zs):console.warn("https://svelte.dev/e/transition_slide_display")}var ie=!1;function Ht(t){ie=t}var ge;function je(t){if(t===null)throw Wa(),rs;return ge=t}function rr(){return je(Zt(ge))}function H(t){if(ie){if(Zt(ge)!==null)throw Wa(),rs;ge=t}}function Ya(t=1){if(ie){for(var e=t,r=ge;e--;)r=Zt(r);ge=r}}function ns(t=!0){for(var e=0,r=ge;;){if(r.nodeType===Mr){var i=r.data;if(i===Va){if(e===0)return r;e-=1}else(i===Xu||i===wn)&&(e+=1)}var n=Zt(r);t&&r.remove(),r=n}}function Ip(t){if(!t||t.nodeType!==Mr)throw Wa(),rs;return t.data}p();p();p();p();function Op(t){return t===this.v}function Ry(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Mp(t){return!Ry(t,this.v)}p();var ir=!1,ss=!1,Ui=!1;p();p();p();var Ku=null;function Dr(t,e){return t.label=e,Dp(t.v,e),t}function Dp(t,e){var r;return(r=t==null?void 0:t[Rp])==null||r.call(t,e),t}p();function bn(t){let e=new Error,r=VV();return r.length===0?null:(r.unshift(` +`),tr(e,"stack",{value:r.join(` +`)}),tr(e,"name",{value:t}),e)}function VV(){let t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];let r=e.split(` +`),i=[];for(let n=0;n{e===Xa&&sM()})}Xa.push(t)}function aM(){for(;Xa.length>0;)sM()}p();var Iy=new WeakMap;function Bp(t){var e=ne;if(e===null)return le.f|=8388608,t;if(M&&t instanceof Error&&!Iy.has(t)&&Iy.set(t,WV(t,e)),e.f&32768)En(t,e);else{if(!(e.f&128))throw M&&!e.parent&&t instanceof Error&&oM(t),t;e.b.error(t)}}function En(t,e){for(;e!==null;){if(e.f&128)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw M&&t instanceof Error&&oM(t),t}function WV(t,e){var a,o,l;let r=Ir(t,"message");if(!(r&&!r.configurable)){for(var i=Qu?" ":" ",n=` +${i}in ${((a=e.fn)==null?void 0:a.name)||""}`,s=e.ctx;s!==null;)n+=` +${i}in ${(o=s.function)==null?void 0:o[xi].split("/").pop()}`,s=s.p;return{message:t.message+` +${n} +`,stack:(l=t.stack)==null?void 0:l.split(` +`).filter(c=>!c.includes("svelte/src/internal")).join(` +`)}}}function oM(t){let e=Iy.get(t);e&&(tr(t,"message",{value:e.message}),tr(t,"stack",{value:e.stack}))}p();p();var YV=-7169;function Be(t,e){t.f=t.f&YV|e}function Xl(t){t.f&512||t.deps===null?Be(t,1024):Be(t,4096)}function lM(t){if(t!==null)for(let e of t)!(e.f&2)||!(e.f&32768)||(e.f^=32768,lM(e.deps))}function Np(t,e,r){t.f&2048?e.add(t):t.f&4096&&r.add(t),lM(t.deps),Be(t,1024)}var Zl=new Set,ye=null,tf=null,Rt=null,Br=[],Up=null,Oy=!1,Za=!1,Kl,Ql,Ka,Jl,rf,nf,Qa,os,ec,kn,My,Dy,uM,By=class By{constructor(){pe(this,kn);ze(this,"committed",!1);ze(this,"current",new Map);ze(this,"previous",new Map);pe(this,Kl,new Set);pe(this,Ql,new Set);pe(this,Ka,0);pe(this,Jl,0);pe(this,rf,null);pe(this,nf,new Set);pe(this,Qa,new Set);pe(this,os,new Map);ze(this,"is_fork",!1);pe(this,ec,!1)}is_deferred(){return this.is_fork||$(this,Jl)>0}skip_effect(e){$(this,os).has(e)||$(this,os).set(e,{d:[],m:[]})}unskip_effect(e){var r=$(this,os).get(e);if(r){$(this,os).delete(e);for(var i of r.d)Be(i,2048),vr(i);for(i of r.m)Be(i,4096),vr(i)}}process(e){var n;Br=[],this.apply();var r=[],i=[];for(let s of e)bt(this,kn,My).call(this,s,r,i);if(this.is_deferred()){bt(this,kn,Dy).call(this,i),bt(this,kn,Dy).call(this,r);for(let[s,a]of $(this,os))hM(s,a)}else{for(let s of $(this,Kl))s();$(this,Kl).clear(),$(this,Ka)===0&&bt(this,kn,uM).call(this),tf=this,ye=null,cM(i),cM(r),tf=null,(n=$(this,rf))==null||n.resolve()}Rt=null}capture(e,r){r!==Je&&!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(),Br.length>0){if(Ly(),ye!==null&&ye!==this)return}else $(this,Ka)===0&&this.process([]);this.deactivate()}discard(){for(let e of $(this,Ql))e(this);$(this,Ql).clear()}increment(e){fe(this,Ka,$(this,Ka)+1),e&&fe(this,Jl,$(this,Jl)+1)}decrement(e){fe(this,Ka,$(this,Ka)-1),e&&fe(this,Jl,$(this,Jl)-1),!$(this,ec)&&(fe(this,ec,!0),yt(()=>{fe(this,ec,!1),this.is_deferred()?Br.length>0&&this.flush():this.revive()}))}revive(){for(let e of $(this,nf))$(this,Qa).delete(e),Be(e,2048),vr(e);for(let e of $(this,Qa))Be(e,4096),vr(e);this.flush()}oncommit(e){$(this,Kl).add(e)}ondiscard(e){$(this,Ql).add(e)}settled(){var e;return((e=$(this,rf))!=null?e:fe(this,rf,Pp())).promise}static ensure(){if(ye===null){let e=ye=new By;Zl.add(ye),Za||yt(()=>{ye===e&&e.flush()})}return ye}apply(){if(!(!ir||!this.is_fork&&Zl.size===1)){Rt=new Map(this.current);for(let e of Zl)if(e!==this)for(let[r,i]of e.previous)Rt.has(r)||Rt.set(r,i)}}};Kl=new WeakMap,Ql=new WeakMap,Ka=new WeakMap,Jl=new WeakMap,rf=new WeakMap,nf=new WeakMap,Qa=new WeakMap,os=new WeakMap,ec=new WeakMap,kn=new WeakSet,My=function(e,r,i){var d;e.f^=1024;for(var n=e.first,s=null;n!==null;){var a=n.f,o=(a&96)!==0,l=o&&(a&1024)!==0,c=l||(a&8192)!==0||$(this,os).has(n);if(ir&&s===null&&a&128&&((d=n.b)!=null&&d.is_pending)&&(s=n),!c&&n.fn!==null){o?n.f^=1024:s!==null&&a&16777228?s.b.defer_effect(n):a&4?r.push(n):ir&&a&16777224?i.push(n):ea(n)&&(a&16&&$(this,Qa).add(n),Js(n));var u=n.first;if(u!==null){n=u;continue}}var f=n.parent;for(n=n.next;n===null&&f!==null;)f===s&&(s=null),n=f.next,f=f.parent}},Dy=function(e){for(var r=0;r1){this.previous.clear();var e=Rt,r=!0;for(let s of Zl){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 i=Br;Br=[];let l=new Set,c=new Map;for(let u of a)fM(u,o,l,c);if(Br.length>0){ye=s,s.apply();for(let u of Br)bt(n=s,kn,My).call(n,u,[],[]);s.deactivate()}Br=i}}ye=null,Rt=e}this.committed=!0,Zl.delete(this)};var Hr=By;function Ja(t){var e=Za;Za=!0;try{var r;for(t&&(ye!==null&&Ly(),r=t());;){if(aM(),Br.length===0&&(ye==null||ye.flush(),Br.length===0))return Up=null,r;Ly()}}finally{Za=e}}function Ly(){var s;Oy=!0;var t=M?new Set:null;try{for(var e=0;Br.length>0;){var r=Hr.ensure();if(e++>1e3){if(M){var i=new Map;for(let a of r.current.keys())for(let[o,l]of(s=a.updated)!=null?s:[]){var n=i.get(o);n||(n={error:l.error,count:0},i.set(o,n)),n.count+=l.count}for(let a of i.values())a.error&&console.error(a.error)}ZV()}if(r.process(Br),An.clear(),M)for(let a of r.current.keys())t.add(a)}}finally{if(Br=[],Oy=!1,Up=null,M)for(let a of t)a.updated=null}}function ZV(){try{qO()}catch(t){M&&tr(t,"stack",{value:""}),En(t,Up)}}var Lr=null;function cM(t){var e=t.length;if(e!==0){for(var r=0;r0)){An.clear();for(let n of Lr){if(n.f&24576)continue;let s=[n],a=n.parent;for(;a!==null;)Lr.has(a)&&(Lr.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){let l=s[o];l.f&24576||Js(l)}}Lr.clear()}}Lr=null}}function fM(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(let n of t.reactions){let s=n.f;s&2?fM(n,e,r,i):s&4194320&&!(s&2048)&&dM(n,e,i)&&(Be(n,2048),vr(n))}}function dM(t,e,r){let i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(let n of t.deps){if(Hi.call(e,n))return!0;if(n.f&2&&dM(n,e,r))return r.set(n,!0),!0}return r.set(t,!1),!1}function vr(t){for(var e=Up=t;e.parent!==null;){e=e.parent;var r=e.f;if(Oy&&e===ne&&r&16&&!(r&262144))return;if(r&96){if(!(r&1024))return;e.f^=1024}}Br.push(e)}function hM(t,e){if(!(t.f&32&&t.f&1024)){t.f&2048?e.d.push(t):t.f&4096&&e.m.push(t),Be(t,1024);for(var r=t.first;r!==null;)hM(r,e),r=r.next}}p();p();p();function mM(t){let e=0,r=sr(0),i;return M&&Dr(r,"createSubscriber version"),()=>{Qs()&&(R(r),Kt(()=>(e===0&&(i=We(()=>t(()=>eo(r)))),e+=1,()=>{yt(()=>{e-=1,e===0&&(i==null||i(),i=void 0,eo(r))})})))}}var QV=589952;function jy(t,e,r){new Hy(t,e,r)}var ri,sf,Tn,to,Cn,Si,Gr,Pn,ls,ta,ro,cs,nc,io,sc,ac,Rn,Vp,St,gM,vM,Uy,qp,zp,Gy,Hy=class{constructor(e,r,i){pe(this,St);ze(this,"parent");ze(this,"is_pending",!1);pe(this,ri);pe(this,sf,ie?ge:null);pe(this,Tn);pe(this,to);pe(this,Cn);pe(this,Si,null);pe(this,Gr,null);pe(this,Pn,null);pe(this,ls,null);pe(this,ta,null);pe(this,ro,0);pe(this,cs,0);pe(this,nc,!1);pe(this,io,!1);pe(this,sc,new Set);pe(this,ac,new Set);pe(this,Rn,null);pe(this,Vp,mM(()=>(fe(this,Rn,sr($(this,ro))),M&&Dr($(this,Rn),"$effect.pending()"),()=>{fe(this,Rn,null)})));fe(this,ri,e),fe(this,Tn,r),fe(this,to,i),this.parent=ne.b,this.is_pending=!!$(this,Tn).pending,fe(this,Cn,ii(()=>{if(ne.b=this,ie){let s=$(this,sf);rr(),s.nodeType===Mr&&s.data===wn?bt(this,St,vM).call(this):(bt(this,St,gM).call(this),$(this,cs)===0&&(this.is_pending=!1))}else{var n=bt(this,St,Uy).call(this);try{fe(this,Si,Ut(()=>i(n)))}catch(s){this.error(s)}$(this,cs)>0?bt(this,St,zp).call(this):this.is_pending=!1}return()=>{var s;(s=$(this,ta))==null||s.remove()}},QV)),ie&&fe(this,ri,ge)}defer_effect(e){Np(e,$(this,sc),$(this,ac))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!$(this,Tn).pending}update_pending_count(e){bt(this,St,Gy).call(this,e),fe(this,ro,$(this,ro)+e),!(!$(this,Rn)||$(this,nc))&&(fe(this,nc,!0),yt(()=>{fe(this,nc,!1),$(this,Rn)&&Vi($(this,Rn),$(this,ro))}))}get_effect_pending(){return $(this,Vp).call(this),R($(this,Rn))}error(e){var r=$(this,Tn).onerror;let i=$(this,Tn).failed;if($(this,io)||!r&&!i)throw e;$(this,Si)&&(dt($(this,Si)),fe(this,Si,null)),$(this,Gr)&&(dt($(this,Gr)),fe(this,Gr,null)),$(this,Pn)&&(dt($(this,Pn)),fe(this,Pn,null)),ie&&(je($(this,sf)),Ya(),je(ns()));var n=!1,s=!1;let a=()=>{if(n){rM();return}n=!0,s&&KO(),Hr.ensure(),fe(this,ro,0),$(this,Pn)!==null&&$n($(this,Pn),()=>{fe(this,Pn,null)}),this.is_pending=this.has_pending_snippet(),fe(this,Si,bt(this,St,qp).call(this,()=>(fe(this,io,!1),Ut(()=>$(this,to).call(this,$(this,ri)))))),$(this,cs)>0?bt(this,St,zp).call(this):this.is_pending=!1};yt(()=>{try{s=!0,r==null||r(e,a),s=!1}catch(o){En(o,$(this,Cn)&&$(this,Cn).parent)}i&&fe(this,Pn,bt(this,St,qp).call(this,()=>{Hr.ensure(),fe(this,io,!0);try{return Ut(()=>{i($(this,ri),()=>e,()=>a)})}catch(o){return En(o,$(this,Cn).parent),null}finally{fe(this,io,!1)}}))})}};ri=new WeakMap,sf=new WeakMap,Tn=new WeakMap,to=new WeakMap,Cn=new WeakMap,Si=new WeakMap,Gr=new WeakMap,Pn=new WeakMap,ls=new WeakMap,ta=new WeakMap,ro=new WeakMap,cs=new WeakMap,nc=new WeakMap,io=new WeakMap,sc=new WeakMap,ac=new WeakMap,Rn=new WeakMap,Vp=new WeakMap,St=new WeakSet,gM=function(){try{fe(this,Si,Ut(()=>$(this,to).call(this,$(this,ri))))}catch(e){this.error(e)}},vM=function(){let e=$(this,Tn).pending;e&&(fe(this,Gr,Ut(()=>e($(this,ri)))),yt(()=>{var r=bt(this,St,Uy).call(this);fe(this,Si,bt(this,St,qp).call(this,()=>(Hr.ensure(),Ut(()=>$(this,to).call(this,r))))),$(this,cs)>0?bt(this,St,zp).call(this):($n($(this,Gr),()=>{fe(this,Gr,null)}),this.is_pending=!1)}))},Uy=function(){var e=$(this,ri);return this.is_pending&&(fe(this,ta,Ft()),$(this,ri).before($(this,ta)),e=$(this,ta)),e},qp=function(e){var r=ne,i=le,n=ke;Gt($(this,Cn)),$t($(this,Cn)),as($(this,Cn).ctx);try{return e()}catch(s){return Bp(s),null}finally{Gt(r),$t(i),as(n)}},zp=function(){let e=$(this,Tn).pending;$(this,Si)!==null&&(fe(this,ls,document.createDocumentFragment()),$(this,ls).append($(this,ta)),Wp($(this,Si),$(this,ls))),$(this,Gr)===null&&fe(this,Gr,Ut(()=>e($(this,ri))))},Gy=function(e){var r;if(!this.has_pending_snippet()){this.parent&&bt(r=this.parent,St,Gy).call(r,e);return}if(fe(this,cs,$(this,cs)+e),$(this,cs)===0){this.is_pending=!1;for(let i of $(this,sc))Be(i,2048),vr(i);for(let i of $(this,ac))Be(i,4096),vr(i);$(this,sc).clear(),$(this,ac).clear(),$(this,Gr)&&$n($(this,Gr),()=>{fe(this,Gr,null)}),$(this,ls)&&($(this,ri).before($(this,ls)),fe(this,ls,null))}};p();function Yp(t,e,r,i){let n=xn()?no:so;var s=t.filter(d=>!d.settled);if(r.length===0&&s.length===0){i(e.map(n));return}var a=ye,o=ne,l=wM(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function u(d){l();try{i(d)}catch(h){o.f&16384||En(h,o)}a==null||a.deactivate(),af()}if(r.length===0){c.then(()=>u(e.map(n)));return}function f(){l(),Promise.all(r.map(d=>zy(d))).then(d=>u([...e.map(n),...d])).catch(d=>En(d,o))}c?c.then(f):f()}function wM(){var t=ne,e=le,r=ke,i=ye;if(M)var n=_n;return function(a=!0){Gt(t),$t(e),as(r),a&&(i==null||i.activate()),M&&(qy(null),Wl(n))}}function af(){Gt(null),$t(null),as(null),M&&(qy(null),Wl(null))}var of=null;function qy(t){of=t}var lf=new Set;function no(t){var e=2050,r=le!==null&&le.f&2?le:null;ne!==null&&(ne.f|=524288);let i={ctx:ke,deps:null,effects:null,equals:Op,f:e,fn:t,reactions:null,rv:0,v:Je,wv:0,parent:r!=null?r:ne,ac:null};return M&&Ui&&(i.created=bn("created at")),i}function zy(t,e,r){let i=ne;i===null&&NO();var n=i.b,s=void 0,a=sr(Je);M&&(a.label=e);var o=!le,l=new Map;return yM(()=>{var h;M&&(of=ne);var c=Pp();s=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{u===ye&&u.committed&&u.deactivate(),af()})}catch(m){c.reject(m),af()}M&&(of=null);var u=ye;if(o){var f=n.is_rendered();n.update_pending_count(1),u.increment(f),(h=l.get(u))==null||h.reject(yn),l.delete(u),l.set(u,c)}let d=(m,g=void 0)=>{if(of=null,u.activate(),g)g!==yn&&(a.f|=8388608,Vi(a,g));else{a.f&8388608&&(a.f^=8388608),Vi(a,m);for(let[v,w]of l){if(l.delete(v),v===u)break;w.reject(yn)}M&&r!==void 0&&(lf.add(a),setTimeout(()=>{lf.has(a)&&(QO(a.label,r),lf.delete(a))}))}o&&(n.update_pending_count(-1),u.decrement(f))};c.promise.then(d,m=>d(null,m||"unknown"))}),ar(()=>{for(let c of l.values())c.reject(yn)}),M&&(a.f|=4194304),new Promise(c=>{function u(f){function d(){f===s?c(a):u(s)}f.then(d,d)}u(s)})}function Et(t){let e=no(t);return ir||Kp(e),e}function so(t){let e=no(t);return e.equals=Mp,e}function Xp(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r5){let l=bn("updated at");if(l!==null){let c=t.updated.get(l.stack);c||(c={error:l,count:0},t.updated.set(l.stack,c)),c.count++}}}ne!==null&&(t.set_during_effect=!0)}if(t.f&2){let o=t;t.f&2048&&cf(o),Xl(o)}t.wv=ic(),_M(t,2048),xn()&&ne!==null&&ne.f&1024&&!(ne.f&96)&&(si===null?xM([t]):si.push(t)),!i.is_fork&&ao.size>0&&!Yy&&jp()}return e}function jp(){Yy=!1;for(let t of ao)t.f&1024&&Be(t,4096),ea(t)&&Js(t);ao.clear()}function eo(t){ae(t,t.v+1)}function _M(t,e){var u;var r=t.reactions;if(r!==null)for(var i=xn(),n=r.length,s=0;s{if(ra===a)return f();var d=le,h=ra;$t(null),Xy(a);var m=f();return $t(d),Xy(h),m};i&&(r.set("length",De(t.length,s)),M&&(t=nW(t)));var l="";let c=!1;function u(f){if(!c){c=!0,l=f,Dr(n,`${l} version`);for(let[d,h]of r)Dr(h,lo(l,d));c=!1}}return new Proxy(t,{defineProperty(f,d,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&YO();var m=r.get(d);return m===void 0?m=o(()=>{var g=De(h.value,s);return r.set(d,g),M&&typeof d=="string"&&Dr(g,lo(l,d)),g}):ae(m,h.value,!0),!0},deleteProperty(f,d){var h=r.get(d);if(h===void 0){if(d in f){let m=o(()=>De(Je,s));r.set(d,m),eo(n),M&&Dr(m,lo(l,d))}}else ae(h,Je),eo(n);return!0},get(f,d,h){var w;if(d===Wt)return t;if(M&&d===Rp)return u;var m=r.get(d),g=d in f;if(m===void 0&&(!g||(w=Ir(f,d))!=null&&w.writable)&&(m=o(()=>{var b=Xe(g?f[d]:Je),k=De(b,s);return M&&Dr(k,lo(l,d)),k}),r.set(d,m)),m!==void 0){var v=R(m);return v===Je?void 0:v}return Reflect.get(f,d,h)},getOwnPropertyDescriptor(f,d){var h=Reflect.getOwnPropertyDescriptor(f,d);if(h&&"value"in h){var m=r.get(d);m&&(h.value=R(m))}else if(h===void 0){var g=r.get(d),v=g==null?void 0:g.v;if(g!==void 0&&v!==Je)return{enumerable:!0,configurable:!0,value:v,writable:!0}}return h},has(f,d){var v;if(d===Wt)return!0;var h=r.get(d),m=h!==void 0&&h.v!==Je||Reflect.has(f,d);if(h!==void 0||ne!==null&&(!m||(v=Ir(f,d))!=null&&v.writable)){h===void 0&&(h=o(()=>{var w=m?Xe(f[d]):Je,b=De(w,s);return M&&Dr(b,lo(l,d)),b}),r.set(d,h));var g=R(h);if(g===Je)return!1}return m},set(f,d,h,m){var y;var g=r.get(d),v=d in f;if(i&&d==="length")for(var w=h;wDe(Je,s)),r.set(w+"",b),M&&Dr(b,lo(l,w)))}if(g===void 0)(!v||(y=Ir(f,d))!=null&&y.writable)&&(g=o(()=>De(void 0,s)),M&&Dr(g,lo(l,d)),ae(g,Xe(h)),r.set(d,g));else{v=g.v!==Je;var k=o(()=>Xe(h));ae(g,k)}var x=Reflect.getOwnPropertyDescriptor(f,d);if(x!=null&&x.set&&x.set.call(m,h),!v){if(i&&typeof d=="string"){var E=r.get("length"),A=Number(d);Number.isInteger(A)&&A>=E.v&&ae(E,A+1)}eo(n)}return!0},ownKeys(f){R(n);var d=Reflect.ownKeys(f).filter(g=>{var v=r.get(g);return v===void 0||v.v!==Je});for(var[h,m]of r)m.v!==Je&&!(h in f)&&d.push(h);return d},setPrototypeOf(){XO()}})}function lo(t,e){var r;return typeof e=="symbol"?`${t}[Symbol(${(r=e.description)!=null?r:""})]`:rW.test(e)?`${t}.${e}`:/^\d+$/.test(e)?`${t}[${e}]`:`${t}['${e}']`}function Qp(t){try{if(t!==null&&typeof t=="object"&&Wt in t)return t[Wt]}catch(e){}return t}var iW=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function nW(t){return new Proxy(t,{get(e,r,i){var n=Reflect.get(e,r,i);return iW.has(r)?function(...s){bM();var a=n.apply(this,s);return jp(),a}:n}})}function SM(){let t=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:r,lastIndexOf:i,includes:n}=t;t.indexOf=function(s,a){let o=r.call(this,s,a);if(o===-1){for(let l=a!=null?a:0;l{t.indexOf=r,t.lastIndexOf=i,t.includes=n}}var Zy,EM,Qu,kM,AM;function Jp(){if(Zy===void 0){Zy=window,EM=document,Qu=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;kM=Ir(e,"firstChild").get,AM=Ir(e,"nextSibling").get,Ay(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Ay(r)&&(r.__t=void 0),M&&(t.__svelte_meta=null,SM())}}function Ft(t=""){return document.createTextNode(t)}function Qt(t){return kM.call(t)}function Zt(t){return AM.call(t)}function G(t,e){if(!ie)return Qt(t);var r=Qt(ge);if(r===null)r=ge.appendChild(Ft());else if(e&&r.nodeType!==Vl){var i=Ft();return r==null||r.before(i),je(i),i}return e&&tm(r),je(r),r}function zr(t,e=!1){var n,s;if(!ie){var r=Qt(t);return r instanceof Comment&&r.data===""?Zt(r):r}if(e){if(((n=ge)==null?void 0:n.nodeType)!==Vl){var i=Ft();return(s=ge)==null||s.before(i),je(i),i}tm(ge)}return ge}function te(t,e=1,r=!1){let i=ie?ge:t;for(var n;e--;)n=i,i=Zt(i);if(!ie)return i;if(r){if((i==null?void 0:i.nodeType)!==Vl){var s=Ft();return i===null?n==null||n.after(s):i.before(s),je(s),s}tm(i)}return je(i),i}function oc(t){t.textContent=""}function em(){if(!ir||Lr!==null)return!1;var t=ne.f;return(t&32768)!==0}function tm(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===Vl;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}p();p();function Ky(t){ie&&Qt(t)!==null&&oc(t)}var TM=!1;function Qy(){TM||(TM=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(let r of t.target.elements)(e=r.__on_r)==null||e.call(r)})},{capture:!0}))}function Wi(t){var e=le,r=ne;$t(null),Gt(null);try{return t()}finally{$t(e),Gt(r)}}function Jy(t,e,r,i=r){t.addEventListener(e,()=>Wi(r));let n=t.__on_r;n?t.__on_r=()=>{n(),i(!0)}:t.__on_r=()=>i(!0),Qy()}function CM(t){ne===null&&(le===null&&jO(t),GO()),Ei&&UO(t)}function aW(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Fn(t,e,r){var o;var i=ne;if(M)for(;i!==null&&i.f&131072;)i=i.parent;i!==null&&i.f&8192&&(t|=8192);var n={ctx:ke,deps:null,nodes:null,f:t|2048|512,first:null,fn:e,last:null,next:null,parent:i,b:i&&i.b,prev:null,teardown:null,wv:0,ac:null};if(M&&(n.component_function=Gi),r)try{Js(n),n.f|=32768}catch(l){throw dt(n),l}else e!==null&&vr(n);var s=n;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&!(s.f&524288)&&(s=s.first,t&16&&t&65536&&s!==null&&(s.f|=65536)),s!==null&&(s.parent=i,i!==null&&aW(s,i),le!==null&&le.f&2&&!(t&64))){var a=le;((o=a.effects)!=null?o:a.effects=[]).push(s)}return n}function Qs(){return le!==null&&!qr}function ar(t){let e=Fn(8,null,!1);return Be(e,1024),e.teardown=t,e}function or(t){var n;CM("$effect"),M&&tr(t,"name",{value:"$effect"});var e=ne.f,r=!le&&(e&32)!==0&&(e&32768)===0;if(r){var i=ke;((n=i.e)!=null?n:i.e=[]).push(t)}else return Fy(t)}function Fy(t){return Fn(1048580,t,!1)}function tb(t){Hr.ensure();let e=Fn(524352,t,!0);return()=>{dt(e)}}function PM(t){Hr.ensure();let e=Fn(524352,t,!0);return(r={})=>new Promise(i=>{r.outro?$n(e,()=>{dt(e),i(void 0)}):(dt(e),i(void 0))})}function Vr(t){return Fn(4,t,!1)}function yM(t){return Fn(4718592,t,!0)}function Kt(t,e=0){return Fn(8|e,t,!0)}function Ne(t,e=[],r=[],i=[]){Yp(i,e,r,n=>{Fn(8,()=>t(...n.map(R)),!0)})}function ii(t,e=0){var r=Fn(16|e,t,!0);return M&&(r.dev_stack=_n),r}function Ut(t){return Fn(524320,t,!0)}function rb(t){var e=t.teardown;if(e!==null){let r=Ei,i=le;eb(!0),$t(null);try{e.call(null)}finally{eb(r),$t(i)}}}function ib(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){let n=r.ac;n!==null&&Wi(()=>{n.abort(yn)});var i=r.next;r.f&64?r.parent=null:dt(r,e),r=i}}function RM(t){for(var e=t.first;e!==null;){var r=e.next;e.f&32||dt(e),e=r}}function dt(t,e=!0){var r=!1;(e||t.f&262144)&&t.nodes!==null&&t.nodes.end!==null&&($M(t.nodes.start,t.nodes.end),r=!0),ib(t,e&&!r),ff(t,0),Be(t,16384);var i=t.nodes&&t.nodes.t;if(i!==null)for(let s of i)s.stop();rb(t);var n=t.parent;n!==null&&n.first!==null&&Ny(t),M&&(t.component_function=null),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function $M(t,e){for(;t!==null;){var r=t===e?null:Zt(t);t.remove(),t=r}}function Ny(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function $n(t,e,r=!0){var i=[];FM(t,i,!0);var n=()=>{r&&dt(t),e&&e()},s=i.length;if(s>0){var a=()=>--s||n();for(var o of i)o.out(a)}else n()}function FM(t,e,r){if(!(t.f&8192)){t.f^=8192;var i=t.nodes&&t.nodes.t;if(i!==null)for(let o of i)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var s=n.next,a=(n.f&65536)!==0||(n.f&32)!==0&&(t.f&16)!==0;FM(n,e,a?r:!1),n=s}}}function uf(t){IM(t,!0)}function IM(t,e){if(t.f&8192){t.f^=8192,t.f&1024||(Be(t,2048),vr(t));for(var r=t.first;r!==null;){var i=r.next,n=(r.f&65536)!==0||(r.f&32)!==0;IM(r,n?e:!1),r=i}var s=t.nodes&&t.nodes.t;if(s!==null)for(let a of s)(a.is_global||e)&&a.in()}}function Wp(t,e){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end;r!==null;){var n=r===i?null:Zt(r);e.append(r),r=n}}p();var OM=null;var rm=!1,Ei=!1;function eb(t){Ei=t}var le=null,qr=!1;function $t(t){le=t}var ne=null;function Gt(t){ne=t}var ni=null;function Kp(t){le!==null&&(!ir||le.f&2)&&(ni===null?ni=[t]:ni.push(t))}var Wr=null,ai=0,si=null;function xM(t){si=t}var MM=1,co=0,ra=co;function Xy(t){ra=t}function ic(){return++MM}function ea(t){var e=t.f;if(e&2048)return!0;if(e&2&&(t.f&=-32769),e&4096){for(var r=t.deps,i=r.length,n=0;nt.wv)return!0}e&512&&Rt===null&&Be(t,1024)}return!1}function DM(t,e,r=!0){var i=t.reactions;if(i!==null&&!(!ir&&ni!==null&&Hi.call(ni,t)))for(var n=0;n{t.ac.abort(yn)}),t.ac=null);try{t.f|=2097152;var u=t.fn,f=u(),d=t.deps,h=(g=ye)==null?void 0:g.is_fork;if(Wr!==null){var m;if(h||ff(t,ai),d!==null&&ai>0)for(d.length=ai+Wr.length,m=0;m{requestAnimationFrame(()=>t()),setTimeout(()=>t())});await Promise.resolve(),Ja()}function R(t){var h,m,g;var e=t.f,r=(e&2)!==0;if((h=OM)==null||h.add(t),le!==null&&!qr){var i=ne!==null&&(ne.f&16384)!==0;if(!i&&(ni===null||!Hi.call(ni,t))){var n=le.deps;if(le.f&2097152)t.rvr==null?void 0:r.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?yt(()=>{e.addEventListener(t,n,i)}):e.addEventListener(t,n,i),n}function oi(t,e,r,i,n){var s={capture:i,passive:n},a=HM(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&ar(()=>{e.removeEventListener(t,a,s)})}function kt(t){for(var e=0;e{throw w});throw d}}finally{t.__root=e,delete t.currentTarget,$t(u),Gt(f)}}}p();p();function sm(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("",""),e.content}function In(t,e){var r=ne;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function ue(t,e){var r=(e&1)!==0,i=(e&2)!==0,n,s=!t.startsWith("");return()=>{if(ie)return In(ge,null),ge;n===void 0&&(n=sm(s?t:""+t),r||(n=Qt(n)));var a=i||Qu?document.importNode(n,!0):n.cloneNode(!0);if(r){var o=Qt(a),l=a.lastChild;In(o,l)}else In(a,a);return a}}function fs(){if(ie)return In(ge,null),ge;var t=document.createDocumentFragment(),e=document.createComment(""),r=Ft();return t.append(e,r),In(e,r),t}function oe(t,e){if(ie){var r=ne;(!(r.f&32768)||r.nodes.end===null)&&(r.nodes.end=ge),rr();return}t!==null&&t.before(e)}p();var dW=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var Ple=[...dW,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var hW=["touchstart","touchmove"];function GM(t){return hW.includes(t)}var pW=["$state","$state.raw","$derived","$derived.by"],Rle=[...pW,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var am=!0;function Ue(t,e){var i;var r=e==null?"":typeof e=="object"?e+"":e;r!==((i=t.__t)!=null?i:t.__t=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function ia(t,e){return jM(t,e)}function ob(t,e){var a;Jp(),e.intro=(a=e.intro)!=null?a:!1;let r=e.target,i=ie,n=ge;try{for(var s=Qt(r);s&&(s.nodeType!==Mr||s.data!==Xu);)s=Zt(s);if(!s)throw rs;Ht(!0),je(s);let o=jM(t,{...e,anchor:s});return Ht(!1),o}catch(o){if(o instanceof Error&&o.message.split(` +`).some(l=>l.startsWith("https://svelte.dev/e/")))throw o;return o!==rs&&console.warn("Failed to hydrate: ",o),e.recover===!1&&zO(),Jp(),oc(r),Ht(!1),ia(t,e)}finally{Ht(i),je(n)}}var cc=new Map;function jM(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:a=!0}){Jp();var o=new Set,l=f=>{for(var d=0;d{var f=r!=null?r:e.appendChild(Ft());return jy(f,{pending:()=>{}},d=>{ot({});var h=ke;if(s&&(h.c=s),n&&(i.$$events=n),ie&&In(d,null),am=a,c=t(d,i)||{},am=!0,ie&&(ne.nodes.end=ge,ge===null||ge.nodeType!==Mr||ge.data!==Va))throw Wa(),rs;lt()}),()=>{var m;for(var d of o){e.removeEventListener(d,lc);var h=cc.get(d);--h===0?(document.removeEventListener(d,lc),cc.delete(d)):cc.set(d,h)}nm.delete(l),f!==r&&((m=f.parentNode)==null||m.removeChild(f))}});return ab.set(c,u),c}var ab=new WeakMap;function ds(t,e){let r=ab.get(t);return r?(ab.delete(t),r(e)):(M&&(Wt in t?tM():eM()),Promise.resolve())}p();p();p();var Yi,On,li,uo,df,hf,om,hs=class{constructor(e,r=!0){ze(this,"anchor");pe(this,Yi,new Map);pe(this,On,new Map);pe(this,li,new Map);pe(this,uo,new Set);pe(this,df,!0);pe(this,hf,()=>{var e=ye;if($(this,Yi).has(e)){var r=$(this,Yi).get(e),i=$(this,On).get(r);if(i)uf(i),$(this,uo).delete(r);else{var n=$(this,li).get(r);n&&($(this,On).set(r,n.effect),$(this,li).delete(r),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(let[s,a]of $(this,Yi)){if($(this,Yi).delete(s),s===e)break;let o=$(this,li).get(a);o&&(dt(o.effect),$(this,li).delete(a))}for(let[s,a]of $(this,On)){if(s===r||$(this,uo).has(s))continue;let o=()=>{if(Array.from($(this,Yi).values()).includes(s)){var c=document.createDocumentFragment();Wp(a,c),c.append(Ft()),$(this,li).set(s,{effect:a,fragment:c})}else dt(a);$(this,uo).delete(s),$(this,On).delete(s)};$(this,df)||!i?($(this,uo).add(s),$n(a,o,!1)):o()}}});pe(this,om,e=>{$(this,Yi).delete(e);let r=Array.from($(this,Yi).values());for(let[i,n]of $(this,li))r.includes(i)||(dt(n.effect),$(this,li).delete(i))});this.anchor=e,fe(this,df,r)}ensure(e,r){var i=ye,n=em();if(r&&!$(this,On).has(e)&&!$(this,li).has(e))if(n){var s=document.createDocumentFragment(),a=Ft();s.append(a),$(this,li).set(e,{effect:Ut(()=>r(a)),fragment:s})}else $(this,On).set(e,Ut(()=>r(this.anchor)));if($(this,Yi).set(i,e),n){for(let[o,l]of $(this,On))o===e?i.unskip_effect(l):i.skip_effect(l);for(let[o,l]of $(this,li))o===e?i.unskip_effect(l.effect):i.skip_effect(l.effect);i.oncommit($(this,hf)),i.ondiscard($(this,om))}else ie&&(this.anchor=ge),$(this,hf).call(this)}};Yi=new WeakMap,On=new WeakMap,li=new WeakMap,uo=new WeakMap,df=new WeakMap,hf=new WeakMap,om=new WeakMap;if(M){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;WO(e)},set:i=>{r=i}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function fo(t){ke===null&&$p("onMount"),ss&&ke.l!==null?vW(ke).m.push(t):or(()=>{let e=We(t);if(typeof e=="function")return e})}function vW(t){var r;var e=t.l;return(r=e.u)!=null?r:e.u={a:[],b:[],m:[]}}p();p();var VM=new Map;function WM(t,e){var r=VM.get(t);r||(r=new Set,VM.set(t,r)),r.add(e)}p();p();p();p();p();p();p();p();p();function Ae(t,e,r=!1){ie&&rr();var i=new hs(t),n=r?65536:0;function s(a,o){if(ie){let c=Ip(t)===wn;if(a===c){var l=ns();je(l),i.anchor=l,Ht(!1),i.ensure(a,o),Ht(!0);return}}i.ensure(a,o)}ii(()=>{var a=!1;e((o,l=!0)=>{a=!0,s(l,o)}),a||s(!1,null)},n)}p();var Cfe=Symbol("NaN");p();p();function ci(t,e){return e}function EW(t,e,r){var f;for(var i=[],n=e.length,s,a=e.length,o=0;o{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=t.outrogroups;lb(ql(s.done)),h.delete(s),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=i.length===0&&r!==null;if(l){var c=r,u=c.parentNode;oc(u),u.append(c),t.items.clear()}lb(e,!l)}else s={pending:new Set(e),done:new Set},((f=t.outrogroups)!=null?f:t.outrogroups=new Set).add(s)}function lb(t,e=!0){for(var r=0;r{var w=r();return is(w)?w:w==null?[]:ql(w)}),d,h=!0;function m(){v.fallback=u,kW(v,d,a,e,i),u!==null&&(d.length===0?u.f&33554432?(u.f^=33554432,mf(u,null,a)):uf(u):$n(u,()=>{u=null}))}var g=ii(()=>{d=R(f);var w=d.length;let b=!1;if(ie){var k=Ip(a)===wn;k!==(w===0)&&(a=ns(),je(a),Ht(!1),b=!0)}for(var x=new Set,E=ye,A=em(),y=0;ys(a)):(u=Ut(()=>s(uc!=null?uc:uc=Ft())),u.f|=33554432)),w>x.size&&(M?TW(d,i):Py("","","")),ie&&w>0&&je(ns()),!h)if(A){for(let[P,D]of o)x.has(P)||E.skip_effect(D.e);E.oncommit(m),E.ondiscard(()=>{})}else m();b&&Ht(!0),R(f)}),v={effect:g,flags:e,items:o,outrogroups:null,fallback:u};h=!1,ie&&(a=ge)}function pf(t){for(;t!==null&&!(t.f&32);)t=t.next;return t}function kW(t,e,r,i,n){var T,P,D,B,N,ce,Pe,ve,se;var s=(i&8)!==0,a=e.length,o=t.items,l=pf(t.effect.first),c,u=null,f,d=[],h=[],m,g,v,w;if(s)for(w=0;w0){var _=i&4&&a===0?r:null;if(s){for(w=0;w{var xe,we;if(f!==void 0)for(v of f)(we=(xe=v.nodes)==null?void 0:xe.a)==null||we.apply()})}function AW(t,e,r,i,n,s,a,o){var l=a&1?a&16?sr(r):oo(r,!1,!1):null,c=a&2?sr(n):null;return M&&l&&(l.trace=()=>{var u;o()[(u=c==null?void 0:c.v)!=null?u:n]}),{v:l,i:c,e:Ut(()=>(s(e,l!=null?l:r,c!=null?c:n,o),()=>{t.delete(i)}))}}function mf(t,e,r){if(t.nodes)for(var i=t.nodes.start,n=t.nodes.end,s=e&&!(e.f&33554432)?e.nodes.start:r;i!==null;){var a=Zt(i);if(s.before(i),i===n)return;i=a}}function na(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function TW(t,e){let r=new Map,i=t.length;for(let n=0;nperformance.now():()=>Date.now(),Xi={tick:t=>(Tp?requestAnimationFrame:Or)(t),now:()=>CW(),tasks:new Set};function XM(){let t=Xi.now();Xi.tasks.forEach(e=>{e.c(t)||(Xi.tasks.delete(e),e.f())}),Xi.tasks.size!==0&&Xi.tick(XM)}function ZM(t){let e;return Xi.tasks.size===0&&Xi.tick(XM),{promise:new Promise(r=>{Xi.tasks.add(e={c:t,f:r})}),abort(){Xi.tasks.delete(e)}}}function lm(t,e){Wi(()=>{t.dispatchEvent(new CustomEvent(e))})}function FW(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function KM(t){let e={},r=t.split(";");for(let i of r){let[n,s]=i.split(":");if(!n||s===void 0)break;let a=FW(n.trim());e[a]=s.trim()}return e}var IW=t=>t;function Zi(t,e,r,i){var k,x;var n=(t&1)!==0,s=(t&2)!==0,a=n&&s,o=(t&4)!==0,l=a?"both":n?"in":"out",c,u=e.inert,f=e.style.overflow,d,h;function m(){return Wi(()=>{var E;return c!=null?c:c=r()(e,(E=i==null?void 0:i())!=null?E:{},{direction:l})})}var g={is_global:o,in(){var E;if(e.inert=u,!n){h==null||h.abort(),(E=h==null?void 0:h.reset)==null||E.call(h);return}s||d==null||d.abort(),d=cb(e,m(),h,1,()=>{lm(e,"introend"),d==null||d.abort(),d=c=void 0,e.style.overflow=f})},out(E){if(!s){E==null||E(),c=void 0;return}e.inert=!0,h=cb(e,m(),d,0,()=>{lm(e,"outroend"),E==null||E()})},stop:()=>{d==null||d.abort(),h==null||h.abort()}},v=ne;if(((x=(k=v.nodes).t)!=null?x:k.t=[]).push(g),n&&am){var w=o;if(!w){for(var b=v.parent;b&&b.f&65536;)for(;(b=b.parent)&&!(b.f&16););w=!b||(b.f&32768)!==0}w&&Vr(()=>{We(()=>g.in())})}}function cb(t,e,r,i,n){var s=i===1;if(Ty(e)){var a,o=!1;return yt(()=>{if(!o){var v=e({direction:s?"in":"out"});a=cb(t,v,r,i,n)}}),{abort:()=>{o=!0,a==null||a.abort()},deactivate:()=>a.deactivate(),reset:()=>a.reset(),t:()=>a.t()}}if(r==null||r.deactivate(),!(e!=null&&e.duration)&&!(e!=null&&e.delay))return lm(t,s?"introstart":"outrostart"),n(),{abort:Or,deactivate:Or,reset:Or,t:()=>i};let{delay:l=0,css:c,tick:u,easing:f=IW}=e;var d=[];if(s&&r===void 0&&(u&&u(0,1),c)){var h=KM(c(0,1));d.push(h,h)}var m=()=>1-i,g=t.animate(d,{duration:l,fill:"forwards"});return g.onfinish=()=>{var _;g.cancel(),lm(t,s?"introstart":"outrostart");var v=(_=r==null?void 0:r.t())!=null?_:1-i;r==null||r.abort();var w=i-v,b=e.duration*Math.abs(w),k=[];if(b>0){var x=!1;if(c)for(var E=Math.ceil(b/16.666666666666668),A=0;A<=E;A+=1){var y=v+w*f(A/E),S=KM(c(y,1-y));k.push(S),x||(x=S.overflow==="hidden")}x&&(t.style.overflow="hidden"),m=()=>{var T=g.currentTime;return v+w*f(T/b)},u&&ZM(()=>{if(g.playState!=="running")return!1;var T=m();return u(T,1-T),!0})}g=t.animate(k,{duration:b,fill:"forwards"}),g.onfinish=()=>{m=()=>i,u==null||u(i,1-i),n()}},{abort:()=>{g&&(g.cancel(),g.effect=null,g.onfinish=Or)},deactivate:()=>{n=Or},reset:()=>{i===0&&(u==null||u(1,0))},t:()=>m()}}p();p();function Ki(t,e){Vr(()=>{var n;var r=t.getRootNode(),i=r.host?r:(n=r.head)!=null?n:r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){let s=document.createElement("style");s.id=e.hash,s.textContent=e.code,i.appendChild(s),M&&WM(e.hash,s)}})}p();p();p();p();p();p();var JM=[...` +\r\f\xA0\v\uFEFF`];function eD(t,e,r){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),r){for(var n in r)if(r[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var o=a+s;(a===0||JM.includes(i[a-1]))&&(o===i.length||JM.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}p();function ht(t,e,r,i,n,s){var a=t.__className;if(ie||a!==r||a===void 0){var o=eD(r,i,s);(!ie||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t.__className=r}else if(s&&n!==s)for(var l in s){var c=!!s[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return s}p();p();var UW=Symbol("class"),GW=Symbol("style"),jW=Symbol("is custom element"),qW=Symbol("is html");function be(t,e,r,i){var n=zW(t);if(ie&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){i||WW(t,e,r!=null?r:"");return}n[e]!==(n[e]=r)&&(e==="loading"&&(t[BO]=r),r==null?t.removeAttribute(e):typeof r!="string"&&VW(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function zW(t){var e;return(e=t.__attributes)!=null?e:t.__attributes={[jW]:t.nodeName.includes("-"),[qW]:t.namespaceURI===MO}}var tD=new Map;function VW(t){var e=t.getAttribute("is")||t.nodeName,r=tD.get(e);if(r)return r;tD.set(e,r=[]);for(var i,n=t,s=Element.prototype;s!==n;){i=Ey(n);for(var a in i)i[a].set&&r.push(a);n=zl(n)}return r}function WW(t,e,r){var i;M&&(e==="srcset"&&YW(t,r)||ub((i=t.getAttribute(e))!=null?i:"",r)||JO(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function ub(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function rD(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function YW(t,e){var r=rD(t.srcset),i=rD(e);return i.length===r.length&&i.every(([n,s],a)=>s===r[a][1]&&(ub(r[a][0],n)||ub(n,r[a][0])))}p();p();p();function hb(t,e,r=e){var i=new WeakSet;Jy(t,"input",async n=>{M&&t.type==="checkbox"&&Cy();var s=n?t.defaultValue:t.value;if(s=fb(t)?db(s):s,r(s),ye!==null&&i.add(ye),await im(),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))}}}),(ie&&t.defaultValue!==t.value||We(e)==null&&t.value)&&(r(fb(t)?db(t.value):t.value),ye!==null&&i.add(ye)),Kt(()=>{var a;M&&t.type==="checkbox"&&Cy();var n=e();if(t===document.activeElement){var s=(a=tf)!=null?a:ye;if(i.has(s))return}fb(t)&&n===db(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n!=null?n:"")})}function fb(t){var e=t.type;return e==="number"||e==="range"}function db(t){return t===""?null:+t}p();p();p();p();p();function nD(t,e){return t===e||(t==null?void 0:t[Wt])===e}function st(t={},e,r,i){return Vr(()=>{var n,s;return Kt(()=>{n=s,s=(i==null?void 0:i())||[],We(()=>{t!==r(...s)&&(e(t,...s),n&&nD(r(...n),t)&&e(null,...n))})}),()=>{yt(()=>{s&&nD(r(...s),t)&&e(null,...s)})}}),t}p();p();p();p();p();p();p();p();p();var um=!1,Yme=Symbol();function mb(t){var e=um;try{return um=!1,[t(),um]}finally{um=e}}function ki(t,e,r,i){var k,x;var n=!ss||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=i,l=!0,c=()=>(l&&(l=!1,o=a?We(i):i),o),u;if(s){var f=Wt in t||Zu 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]=mb(()=>t[e]):d=t[e],d===void 0&&i!==void 0&&(d=c(),u&&(n&&VO(e),u(d)));var m;if(n?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},n&&!(r&4))return m;if(u){var g=t.$$legacy;return function(E,A){return arguments.length>0?((!n||!A||g||h)&&u(A?m():E),E):m()}}var v=!1,w=(r&1?no:so)(()=>(v=!1,m()));M&&(w.label=e),s&&R(w);var b=ne;return function(E,A){if(arguments.length>0){let y=A?R(w):n&&s?Xe(E):E;return ae(w,y),v=!0,o!==void 0&&(o=y),E}return Ei&&v||b.f&16384?w.v:R(w)}}p();p();p();function sD(t){return new gb(t)}var ms,Ai,gb=class{constructor(e){pe(this,ms);pe(this,Ai);var s,a;var r=new Map,i=(o,l)=>{var c=oo(l,!1,!1);return r.set(o,c),c};let n=new Proxy({...e.props||{},$$events:{}},{get(o,l){var c;return R((c=r.get(l))!=null?c:i(l,Reflect.get(o,l)))},has(o,l){var c;return l===Zu?!0:(R((c=r.get(l))!=null?c:i(l,Reflect.get(o,l))),Reflect.has(o,l))},set(o,l,c){var u;return ae((u=r.get(l))!=null?u:i(l,c),c),Reflect.set(o,l,c)}});fe(this,Ai,(e.hydrate?ob:ia)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover})),!ir&&(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&Ja(),fe(this,ms,n.$$events);for(let o of Object.keys($(this,Ai)))o==="$set"||o==="$destroy"||o==="$on"||tr(this,o,{get(){return $(this,Ai)[o]},set(l){$(this,Ai)[o]=l},enumerable:!0});$(this,Ai).$set=o=>{Object.assign(n,o)},$(this,Ai).$destroy=()=>{ds($(this,Ai))}}$set(e){$(this,Ai).$set(e)}$on(e,r){$(this,ms)[e]=$(this,ms)[e]||[];let i=(...n)=>r.call(this,...n);return $(this,ms)[e].push(i),()=>{$(this,ms)[e]=$(this,ms)[e].filter(n=>n!==i)}}$destroy(){$(this,Ai).$destroy()}};ms=new WeakMap,Ai=new WeakMap;var l9;typeof HTMLElement=="function"&&(l9=class extends HTMLElement{constructor(e,r,i){super();ze(this,"$$ctor");ze(this,"$$s");ze(this,"$$c");ze(this,"$$cn",!1);ze(this,"$$d",{});ze(this,"$$r",!1);ze(this,"$$p_d",{});ze(this,"$$l",{});ze(this,"$$l_u",new Map);ze(this,"$$me");ze(this,"$$shadowRoot",null);this.$$ctor=e,this.$$s=r,i&&(this.$$shadowRoot=this.attachShadow(i))}addEventListener(e,r,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(r),this.$$c){let n=this.$$c.$on(e,r);this.$$l_u.set(r,n)}super.addEventListener(e,r,i)}removeEventListener(e,r,i){if(super.removeEventListener(e,r,i),this.$$c){let n=this.$$l_u.get(r);n&&(n(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{let a=document.createElement("slot");n!=="default"&&(a.name=n),oe(s,a)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let r={},i=c9(this);for(let n of this.$$s)n in i&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),r.default=!0):r[n]=e(n));for(let n of this.attributes){let s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=vb(s,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=sD({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=tb(()=>{Kt(()=>{var n;this.$$r=!0;for(let s of Sy(this.$$c)){if(!((n=this.$$p_d[s])!=null&&n.reflect))continue;this.$$d[s]=this.$$c[s];let a=vb(s,this.$$d[s],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,a)}this.$$r=!1})});for(let n in this.$$l)for(let s of this.$$l[n]){let a=this.$$c.$on(n,s);this.$$l_u.set(s,a)}this.$$l={}}}attributeChangedCallback(e,r,i){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=vb(e,i,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Sy(this.$$p_d).find(r=>this.$$p_d[r].attribute===e||!this.$$p_d[r].attribute&&r.toLowerCase()===e)||e}});function vb(t,e,r,i){var s;let n=(s=r[t])==null?void 0:s.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function c9(t){let e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}p();p();function ho(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(i.next(u))}catch(f){a(f)}}function l(u){try{c(i.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):n(u.value).then(o,l)}c((i=i.apply(t,e||[])).next())})}var _b=require("obsidian");p();var yb=require("obsidian");p();function u9(t){let e=t-1;return e*e*e+1}var wb=!1;function Dn(t,{delay:e=0,duration:r=400,easing:i=u9,axis:n="y"}={}){let s=getComputedStyle(t);M&&!wb&&/(contents|inline|table)/.test(s.display)&&(wb=!0,Promise.resolve().then(()=>wb=!1),iM(s.display));let a=+s.opacity,o=n==="y"?"height":"width",l=parseFloat(s[o]),c=n==="y"?["top","bottom"]:["left","right"],u=c.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),f=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),h=parseFloat(s[`margin${u[0]}`]),m=parseFloat(s[`margin${u[1]}`]),g=parseFloat(s[`border${u[0]}Width`]),v=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:r,easing:i,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*a};${o}: ${w*l}px;padding-${c[0]}: ${w*f}px;padding-${c[1]}: ${w*d}px;margin-${c[0]}: ${w*h}px;margin-${c[1]}: ${w*m}px;border-${c[0]}-width: ${w*g}px;border-${c[1]}-width: ${w*v}px;min-${o}: 0`}}p();var fm=require("obsidian");var f9=ue('
'),d9=ue('
'),h9={hash:"svelte-1c0jiav",code:"main.svelte-1c0jiav .nav-file-title:where(.svelte-1c0jiav) {align-items:center;}"};function gf(t,e){ot(e,!0),Ki(t,h9);let r=Xe([]),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");or(()=>{for(let w of r)w&&(0,fm.setIcon)(w,w.getAttr("data-icon"))});function n(w){w.stopPropagation(),pl(e.diff.path)?s(w):a(w)}function s(w){var b;w.stopPropagation();let k=e.view.app.vault.getAbstractFileByPath(e.diff.vaultPath);k instanceof fm.TFile&&((b=Mi(e.view.app,w))===null||b===void 0||b.openFile(k).catch(x=>e.view.plugin.displayError(x)))}function a(w){var b;e.view.plugin.tools.openDiff({event:w,aFile:(b=e.diff.fromPath)!==null&&b!==void 0?b:e.diff.path,aRef:`${e.diff.hash}^`,bFile:e.diff.path,bRef:e.diff.hash})}var o=d9();o.__click=n;var l=G(o),c=G(l),u=G(c,!0);H(c);var f=te(c,2),d=G(f),h=G(d);{var m=w=>{var b=f9();b.__click=s,st(b,k=>r[0]=k,()=>r==null?void 0:r[0]),oi("auxclick",b,s),oe(w,b)};Ae(h,w=>{ml(e.diff.vaultPath,e.view.app)&&w(m)})}H(d);var g=te(d,2),v=G(g,!0);H(g),H(f),H(l),H(o),Ne(w=>{be(l,"data-path",e.diff.vaultPath),be(l,"data-tooltip-position",R(i)),be(l,"aria-label",e.diff.vaultPath),Ue(u,w),be(g,"data-type",e.diff.status),Ue(v,e.diff.status)},[()=>pn(e.diff.vaultPath)]),oi("auxclick",o,w=>{w.stopPropagation(),w.button==2?hn(e.view.app,w,e.diff.vaultPath,e.view.leaf,"git-history"):n(w)}),oe(t,o),lt()}kt(["click"]);p();var p9=ue("
"),m9=ue(''),g9=ue('
'),v9=ue("
"),w9={hash:"svelte-d9h7mp",code:"main.svelte-d9h7mp .nav-folder-title-content:where(.svelte-d9h7mp) {display:flex;align-items:center;}"};function vf(t,e){ot(e,!0),Ki(t,w9);let r=ki(e,"topLevel",3,!1),i=ki(e,"closed",15),n=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(l,c){l.stopPropagation(),i(i()[c.path]=!i()[c.path],!0)}var a=v9();let o;ui(a,21,()=>e.hierarchy.children,ci,(l,c)=>{var u=fs(),f=zr(u);{var d=m=>{var g=p9(),v=G(g);gf(v,{get diff(){return R(c).data},get view(){return e.view}}),H(g),oe(m,g)},h=m=>{var g=g9();let v;var w=G(g);w.__click=S=>s(S,R(c));var b=te(G(w),2);let k;var x=te(b,2),E=G(x,!0);H(x),H(w);var A=te(w,2);{var y=S=>{var _=m9(),T=G(_);vf(T,{get hierarchy(){return R(c)},get plugin(){return e.plugin},get view(){return e.view},get closed(){return i()},set closed(P){i(P)}}),H(_),Zi(3,_,()=>Dn,()=>({duration:150})),oe(S,_)};Ae(A,S=>{i()[R(c).path]||S(y)})}H(g),Ne(()=>{v=ht(g,1,"tree-item nav-folder",null,v,{"is-collapsed":i()[R(c).path]}),be(w,"data-tooltip-position",R(n)),be(w,"aria-label",R(c).vaultPath),k=ht(b,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,k,{"is-collapsed":i()[R(c).path]}),Ue(E,R(c).title)}),oe(m,g)};Ae(f,m=>{R(c).data?m(d):m(h,!1)})}oe(l,u)}),H(a),Ne(()=>o=ht(a,1,"svelte-d9h7mp",null,o,{topLevel:r()})),oe(t,a),lt()}kt(["click"]);var y9=ue('
'),b9=ue('
'),_9=ue('
'),x9=ue(''),S9=ue('
'),E9={hash:"svelte-1edsiy5",code:""};function bb(t,e){ot(e,!0),Ki(t,E9);let r=Et(()=>({title:"",path:"",vaultPath:"",children:e.plugin.gitManager.getTreeStructure(e.log.diff.files)})),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left"),n=De(!0),s=De(Xe({}));function a(S){let _=S.author.name;if(e.plugin.settings.authorInHistoryView=="full")return _;if(e.plugin.settings.authorInHistoryView=="initials")return _.split(" ").filter(P=>P.length>0).map(P=>P[0].toUpperCase()).join("")}var o=S9(),l=G(o);let c;var u=G(l);u.__click=()=>ae(n,!R(n));var f=G(u);let d;var h=te(f,2),m=G(h);{var g=S=>{var _=y9(),T=G(_,!0);H(_),Ne(P=>Ue(T,P),[()=>e.log.refs.join(", ")]),oe(S,_)};Ae(m,S=>{e.log.refs.length>0&&S(g)})}var v=te(m,2);{var w=S=>{var _=b9(),T=G(_,!0);H(_),Ne(P=>Ue(T,P),[()=>a(e.log)]),oe(S,_)};Ae(v,S=>{var _;e.plugin.settings.authorInHistoryView!="hide"&&((_=e.log.author)!=null&&_.name)&&S(w)})}var b=te(v,2);{var k=S=>{var _=_9(),T=G(_,!0);H(_),Ne(P=>Ue(T,P),[()=>(0,yb.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)]),oe(S,_)};Ae(b,S=>{e.plugin.settings.dateInHistoryView&&S(k)})}var x=te(b,2),E=G(x,!0);H(x),H(h),H(u);var A=te(u,2);{var y=S=>{var _=x9(),T=G(_);{var P=B=>{vf(B,{get hierarchy(){return R(r)},get plugin(){return e.plugin},get view(){return e.view},topLevel:!0,get closed(){return R(s)},set closed(N){ae(s,N,!0)}})},D=B=>{var N=fs(),ce=zr(N);ui(ce,17,()=>e.log.diff.files,ci,(Pe,ve)=>{gf(Pe,{get view(){return e.view},get diff(){return R(ve)}})}),oe(B,N)};Ae(T,B=>{e.showTree?B(P):B(D,!1)})}H(_),Zi(3,_,()=>Dn,()=>({duration:150})),oe(S,_)};Ae(A,S=>{R(n)||S(y)})}H(l),H(o),Ne(S=>{c=ht(l,1,"tree-item nav-folder",null,c,{"is-collapsed":R(n)}),be(u,"aria-label",S),be(u,"data-tooltip-position",R(i)),d=ht(f,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,d,{"is-collapsed":R(n)}),Ue(E,e.log.message)},[()=>{var S;return`${e.log.refs.length>0?e.log.refs.join(", ")+` +`:""}${(S=e.log.author)==null?void 0:S.name} +${(0,yb.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)} +${e.log.message}`}]),oe(t,o),lt()}kt(["click"]);var k9=ue(''),A9=ue('
'),T9={hash:"svelte-12n6twc",code:""};function xb(t,e){ot(e,!0),Ki(t,T9);let r=ki(e,"plugin",15),i=De(!1),n=Xe([]),s=De(void 0),a=De(Xe(r().settings.treeStructure)),o;or(()=>{o&&o.empty()}),fo(()=>{e.view.registerEvent(e.view.app.workspace.on("obsidian-git:head-change",()=>void c().catch(console.error)))}),or(()=>{n.forEach(x=>(0,_b.setIcon)(x,x.getAttr("data-icon")))}),fo(()=>{let x=new IntersectionObserver(A=>{A[0].isIntersecting&&!R(i)&&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 ho(this,void 0,void 0,function*(){var x;if(!r().gitReady){ae(s,void 0);return}ae(i,!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,ae(s,yield r().gitManager.log(void 0,!1,A),!0),ae(i,!1)})}function u(){return ho(this,void 0,void 0,function*(){var x;if(!r().gitReady||R(s)===void 0)return;ae(i,!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)),ae(i,!1)})}var f=A9(),d=G(f),h=G(d),m=G(h);m.__click=()=>{ae(a,!R(a)),(0,_b.setIcon)(n[0],R(a)?"list":"folder"),r(r().settings.treeStructure=R(a),!0),r().saveSettings()},st(m,x=>n[0]=x,()=>n==null?void 0:n[0]);var g=te(m,2);let v;g.__click=l,st(g,x=>n[1]=x,()=>n==null?void 0:n[1]),H(h),H(d);var w=te(d,2),b=G(w);{var k=x=>{var E=k9();ui(E,21,()=>R(s),ci,(A,y)=>{bb(A,{get view(){return e.view},get showTree(){return R(a)},get log(){return R(y)},get plugin(){return r()}})}),H(E),oe(x,E)};Ae(b,x=>{R(s)&&x(k)})}Ya(4),H(w),H(f),Ne(()=>{be(m,"data-icon",R(a)?"list":"folder"),v=ht(g,1,"clickable-icon nav-action-button",null,v,{loading:R(i)})}),oe(t,f),lt()}kt(["click"]);var wf=class extends aD.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return gi.type}getDisplayText(){return gi.name}getIcon(){return gi.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=ia(xb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};p();var oD=require("obsidian"),dm=class extends oD.FuzzySuggestModal{constructor(r,i){super(r.app);this.branches=i;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,i){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 uD=require("obsidian");p();var go=require("obsidian");p();var yf=require("obsidian");p();var lD=require("obsidian");var fc=class extends lD.Modal{constructor({app:r,path:i,filesToDeleteCount:n,filesToDiscardCount:s}){super(r);this.resolve=null;this.path=i,this.deleteCount=n,this.discardCount=s}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:i,titleEl:n}=this,s="";this.path!=""&&(r>1?s=`files in "${this.path}"`:s=`"${this.path}"`),n.setText(`${this.discardCount==0?"Delete":"Discard"} ${s}`),this.deleteCount>0&&i.createEl("p").setText(`Are you sure you want to DELETE the ${Su(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&i.createEl("p").setText(`Are you sure you want to discard ALL changes in ${Su(this.discardCount,"tracked file")}?`);let a=i.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${Su(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 ${Su(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}=this;r.empty()}};var C9=ue('
'),P9=ue('
');function bf(t,e){ot(e,!0);let r=Xe([]),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");or(()=>{for(let A of r)A&&(0,yf.setIcon)(A,A.getAttr("data-icon"))});function n(A){A.stopPropagation(),pl(e.change.path)?a(A):l(A)}function s(A){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&gl(e.view.app,A,e.view,e.change.vaultPath)}function a(A){var y;A.stopPropagation();let S=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);S instanceof yf.TFile&&((y=Mi(e.view.app,A))===null||y===void 0||y.openFile(S).catch(_=>e.view.plugin.displayError(_)))}function o(A){A.stopPropagation(),e.manager.stage(e.change.path,!1).catch(y=>e.view.plugin.displayError(y)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function l(A){A.stopPropagation(),e.view.plugin.tools.openDiff({aFile:e.change.path,aRef:"",event:A})}function c(A){A.stopPropagation();let y=e.change.workingDir=="U";new fc({app:e.view.app,filesToDeleteCount:y?1:0,filesToDiscardCount:y?0:1,path:e.change.vaultPath}).openAndGetResult().then(S=>ho(this,void 0,void 0,function*(){if(S=="delete"){let _=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);_ instanceof yf.TFile?yield e.view.app.fileManager.trashFile(_):yield e.view.app.vault.adapter.remove(e.change.vaultPath)}else S=="discard"&&(yield e.manager.discard(e.change.path).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")}));e.view.app.workspace.trigger("obsidian-git:refresh")}),S=>e.view.plugin.displayError(S))}var u=P9();u.__mouseover=s,u.__click=n;var f=G(u),d=G(f),h=G(d,!0);H(d);var m=te(d,2),g=G(m),v=G(g);{var w=A=>{var y=C9();y.__click=a,st(y,S=>r[0]=S,()=>r==null?void 0:r[0]),oi("auxclick",y,a),oe(A,y)};Ae(v,A=>{ml(e.change.vaultPath,e.view.app)&&A(w)})}var b=te(v,2);b.__click=c,st(b,A=>r[1]=A,()=>r==null?void 0:r[1]);var k=te(b,2);k.__click=o,st(k,A=>r[2]=A,()=>r==null?void 0:r[2]),H(g);var x=te(g,2),E=G(x,!0);H(x),H(m),H(f),H(u),Ne(A=>{be(f,"data-path",e.change.vaultPath),be(f,"data-tooltip-position",R(i)),be(f,"aria-label",e.change.vaultPath),Ue(h,A),be(x,"data-type",e.change.workingDir),Ue(E,e.change.workingDir)},[()=>pn(e.change.vaultPath)]),oi("auxclick",u,A=>{A.stopPropagation(),A.button==2?hn(e.view.app,A,e.change.vaultPath,e.view.leaf,"git-source-control"):n(A)}),oe(t,u),lt()}kt(["mouseover","click"]);p();var cD=require("obsidian");var R9=ue('
');function _f(t,e){ot(e,!0);let r=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function i(d){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&gl(e.view.app,d,e.view,e.change.vaultPath)}function n(d){var h;d.stopPropagation();let m=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);m instanceof cD.TFile&&((h=Mi(e.view.app,d))===null||h===void 0||h.openFile(m).catch(g=>e.view.plugin.displayError(g)))}var s=R9();s.__mouseover=i,s.__click=n;var a=G(s),o=G(a),l=G(o,!0);H(o);var c=te(o,2),u=G(c),f=G(u,!0);H(u),H(c),H(a),H(s),Ne(d=>{be(a,"data-path",e.change.vaultPath),be(a,"data-tooltip-position",R(r)),be(a,"aria-label",e.change.vaultPath),Ue(l,d),be(u,"data-type",e.change.workingDir),Ue(f,e.change.workingDir)},[()=>pn(e.change.vaultPath)]),oi("auxclick",s,d=>{d.stopPropagation(),d.button==2?hn(e.view.app,d,e.change.vaultPath,e.view.leaf,"git-source-control"):n(d)}),oe(t,s),lt()}kt(["mouseover","click"]);p();var hm=require("obsidian");var $9=ue('
'),F9=ue('
');function xf(t,e){ot(e,!0);let r=Xe([]),i=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");or(()=>{for(let x of r)x&&(0,hm.setIcon)(x,x.getAttr("data-icon"))});function n(x){x.stopPropagation(),pl(e.change.path)?a(x):o(x)}function s(x){e.view.app.vault.getFileByPath(e.change.vaultPath)&&gl(e.view.app,x,e.view,e.change.vaultPath)}function a(x){var E;x.stopPropagation();let A=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);A instanceof hm.TFile&&((E=Mi(e.view.app,x))===null||E===void 0||E.openFile(A).catch(y=>e.view.plugin.displayError(y)))}function o(x){var E;x.stopPropagation(),e.view.plugin.tools.openDiff({aFile:(E=e.change.from)!==null&&E!==void 0?E:e.change.path,bFile:e.change.path,aRef:"HEAD",bRef:"",event:x})}function l(x){x.stopPropagation(),e.manager.unstage(e.change.path,!1).catch(E=>e.view.plugin.displayError(E)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}var c=F9();c.__mouseover=s,c.__click=n;var u=G(c),f=G(u),d=G(f,!0);H(f);var h=te(f,2),m=G(h),g=G(m);{var v=x=>{var E=$9();E.__click=a,st(E,A=>r[0]=A,()=>r==null?void 0:r[0]),oe(x,E)};Ae(g,x=>{ml(e.change.vaultPath,e.view.app)&&x(v)})}var w=te(g,2);w.__click=l,st(w,x=>r[1]=x,()=>r==null?void 0:r[1]),H(m);var b=te(m,2),k=G(b,!0);H(b),H(h),H(u),H(c),Ne(x=>{be(u,"data-path",e.change.vaultPath),be(u,"data-tooltip-position",R(i)),be(u,"aria-label",e.change.vaultPath),Ue(d,x),be(b,"data-type",e.change.index),Ue(k,e.change.index)},[()=>pn(e.change.vaultPath)]),oi("auxclick",c,x=>{x.stopPropagation(),x.button==2?hn(e.view.app,x,e.change.vaultPath,e.view.leaf,"git-source-control"):n(x)}),oe(t,c),lt()}kt(["mouseover","click"]);p();p();var I9=ue(''),O9=ue("
");function po(t,e){ot(e,!0);var r=O9(),i=G(r);{var n=s=>{var a=I9(),o=G(a),l=G(o),c=G(l,!0);H(l),H(o),H(a),Ne(()=>{be(o,"aria-label","And "+(e.files.length-500)+" more files"),Ue(c,"And "+(e.files.length-500)+" more files")}),oe(s,a)};Ae(i,s=>{e.files.length>500&&s(n)})}H(r),oe(t,r),lt()}var D9=ue("
"),L9=ue('
'),B9=ue('
',1),N9=ue(''),H9=ue('
'),U9=ue("
");function mo(t,e){ot(e,!0);let r=ki(e,"topLevel",3,!1),i=ki(e,"closed",15);fo(()=>{var h,m;for(let g of e.hierarchy.children)((m=(h=g.children)===null||h===void 0?void 0:h.length)!==null&&m!==void 0?m:0)>100&&i(i()[g.title]=!0,!0)});let n=Et(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(h,m){h.stopPropagation(),e.plugin.gitManager.stageAll({dir:m}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function a(h,m){h.stopPropagation(),e.plugin.gitManager.unstageAll({dir:m}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function o(h,m){h.stopPropagation(),e.plugin.discardAll(m.vaultPath)}function l(h,m){h.stopPropagation(),i(i()[m.path]=!i()[m.path],!0)}var c=U9();let u;var f=G(c);ui(f,17,()=>Eu(e.hierarchy.children,500),ci,(h,m)=>{var g=fs(),v=zr(g);{var w=k=>{var x=D9(),E=G(x);{var A=S=>{xf(S,{get change(){return R(m).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},y=S=>{var _=fs(),T=zr(_);{var P=B=>{bf(B,{get change(){return R(m).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},D=B=>{var N=fs(),ce=zr(N);{var Pe=ve=>{_f(ve,{get change(){return R(m).data},get view(){return e.view}})};Ae(ce,ve=>{e.fileType==2&&ve(Pe)},!0)}oe(B,N)};Ae(T,B=>{e.fileType==1?B(P):B(D,!1)},!0)}oe(S,_)};Ae(E,S=>{e.fileType==0?S(A):S(y,!1)})}H(x),oe(k,x)},b=k=>{var x=H9();x.__click=se=>l(se,R(m));let E;var A=G(x),y=te(G(A),2);let S;var _=te(y,2),T=G(_,!0);H(_);var P=te(_,2),D=G(P),B=G(D);{var N=se=>{var xe=L9();xe.__click=we=>a(we,R(m).path),oe(se,xe)},ce=se=>{var xe=B9(),we=zr(xe);we.__click=Q=>o(Q,R(m));var z=te(we,2);z.__click=Q=>s(Q,R(m).path),oe(se,xe)};Ae(B,se=>{e.fileType==0?se(N):se(ce,!1)})}Ya(2),H(D),H(P),H(A);var Pe=te(A,2);{var ve=se=>{var xe=N9(),we=G(xe);mo(we,{get hierarchy(){return R(m)},get plugin(){return e.plugin},get view(){return e.view},get fileType(){return e.fileType},get closed(){return i()},set closed(z){i(z)}}),H(xe),Zi(3,xe,()=>Dn,()=>({duration:150})),oe(se,xe)};Ae(Pe,se=>{i()[R(m).path]||se(ve)})}H(x),Ne(()=>{E=ht(x,1,"tree-item nav-folder",null,E,{"is-collapsed":i()[R(m).path]}),be(A,"data-tooltip-position",R(n)),be(A,"aria-label",R(m).vaultPath),S=ht(y,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,S,{"is-collapsed":i()[R(m).path]}),Ue(T,R(m).title)}),oi("auxclick",x,se=>hn(e.view.app,se,R(m).vaultPath,e.view.leaf,"git-source-control")),oe(k,x)};Ae(v,k=>{R(m).data?k(w):k(b,!1)})}oe(h,g)});var d=te(f,2);po(d,{get files(){return e.hierarchy.children}}),H(c),Ne(()=>u=ht(c,1,"",null,u,{topLevel:r()})),oe(t,c),lt()}kt(["click"]);var G9=ue('
'),j9=ue(" ",1),q9=ue(''),z9=ue(" ",1),V9=ue(''),W9=ue(" ",1),Y9=ue(''),X9=ue('
'),Z9=ue(''),K9=ue('
'),Q9={hash:"svelte-5wq9p",code:`.commit-msg-input.svelte-5wq9p {width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field);}.git-commit-msg.svelte-5wq9p {position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto;}main.svelte-5wq9p .git-tools:where(.svelte-5wq9p) .files-count:where(.svelte-5wq9p) {padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center;}.nav-folder-title.svelte-5wq9p {align-items:center;}.git-commit-msg-clear-button.svelte-5wq9p {position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:-4px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out;}.git-commit-msg-clear-button.svelte-5wq9p:after {content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;mask-image:url("data:image/svg+xml,");mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat;}`};function Sb(t,e){ot(e,!0),Ki(t,Q9);let r=ki(e,"plugin",7),i=ki(e,"view",7),n=De(!1),s=De(void 0),a=De(Xe([])),o=Et(()=>r().settings.commitMessage),l=Xe([]),c=De(void 0),u=De(void 0),f=De(void 0),d=De(!0),h=De(!0),m=De(!0),g=De(0),v=De(Xe({})),w=De(Xe({})),b=De(Xe({})),k=Et(()=>r().settings.treeStructure);fo(()=>{i().registerEvent(i().app.workspace.on("obsidian-git:loading-status",()=>ae(n,!0))),i().registerEvent(i().app.workspace.on("obsidian-git:status-changed",()=>void A().catch(console.error))),i().plugin.cachedStatus==null?i().plugin.refresh().catch(console.error):A().catch(console.error),i().scope=new go.Scope(r().app.scope),i().scope.register(["Ctrl"],"Enter",Z=>E())}),or(()=>{l.forEach(Z=>(0,go.setIcon)(Z,Z.getAttr("data-icon")))}),or(()=>{l.forEach(Z=>{var L,V;!Z||Z.id!="push"||(go.Platform.isMobile?(Z.removeClass("button-border"),R(g)>0&&Z.addClass("button-border")):((L=Z.firstElementChild)===null||L===void 0||L.removeAttribute("color"),R(g)>0&&((V=Z.firstElementChild)===null||V===void 0||V.setAttr("color","var(--text-accent)"))))})});function x(){if(ae(n,!0),R(s)){let Z=R(s).staged.length>0;r().promiseQueue.addTask(()=>r().commit({fromAuto:!1,commitMessage:R(o),onlyStaged:Z}).then(()=>ae(o,r().settings.commitMessage)).finally(y))}}function E(){if(ae(n,!0),R(s)){let Z=R(s).staged.length>0;r().promiseQueue.addTask(()=>r().commitAndSync({fromAutoBackup:!1,commitMessage:R(o),onlyStaged:Z}).then(()=>{ae(o,r().settings.commitMessage)}).finally(y))}}function A(){return ho(this,void 0,void 0,function*(){if(!r().gitReady){ae(s,void 0);return}if(ae(g,yield r().gitManager.getUnpushedCommits(),!0),ae(s,r().cachedStatus,!0),ae(n,!1),r().lastPulledFiles&&r().lastPulledFiles!=R(a)&&(ae(a,r().lastPulledFiles,!0),ae(f,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(R(a))},!0)),R(s)){let Z=(L,V)=>L.vaultPath.split("/").last().localeCompare(pn(V.vaultPath));R(s).changed.sort(Z),R(s).staged.sort(Z),ae(c,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(R(s).changed)},!0),ae(u,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(R(s).staged)},!0)}else ae(c,void 0),ae(u,void 0)})}function y(){i().app.workspace.trigger("obsidian-git:refresh")}function S(Z){Z.stopPropagation(),ae(n,!0),r().promiseQueue.addTask(()=>r().gitManager.stageAll({status:R(s)}).finally(y))}function _(Z){Z.stopPropagation(),ae(n,!0),r().promiseQueue.addTask(()=>r().gitManager.unstageAll({status:R(s)}).finally(y))}function T(){ae(n,!0),r().promiseQueue.addTask(()=>r().push().finally(y))}function P(){ae(n,!0),r().promiseQueue.addTask(()=>r().pullChangesFromRemote().finally(y))}function D(Z){Z.stopPropagation(),r().discardAll()}let B=Et(()=>(R(o).match(/\n/g)||[]).length+1||1);var N=K9(),ce=G(N),Pe=G(ce),ve=G(Pe);ve.__click=E,st(ve,Z=>l[0]=Z,()=>l==null?void 0:l[0]);var se=te(ve,2);se.__click=x,st(se,Z=>l[1]=Z,()=>l==null?void 0:l[1]);var xe=te(se,2);xe.__click=S,st(xe,Z=>l[2]=Z,()=>l==null?void 0:l[2]);var we=te(xe,2);we.__click=_,st(we,Z=>l[3]=Z,()=>l==null?void 0:l[3]);var z=te(we,2);z.__click=T,st(z,Z=>l[4]=Z,()=>l==null?void 0:l[4]);var Q=te(z,2);Q.__click=P,st(Q,Z=>l[5]=Z,()=>l==null?void 0:l[5]);var j=te(Q,2);j.__click=()=>{ae(k,!R(k)),(0,go.setIcon)(l[6],R(k)?"list":"folder"),r().settings.treeStructure=R(k),r().saveSettings()},st(j,Z=>l[6]=Z,()=>l==null?void 0:l[6]);var Le=te(j,2);let lr;Le.__click=y,st(Le,Z=>l[7]=Z,()=>l==null?void 0:l[7]),H(Pe),H(ce);var It=te(ce,2),Fe=G(It);Ky(Fe);var At=te(Fe,2);{var Tt=Z=>{var L=G9();L.__click=()=>ae(o,""),be(L,"aria-label","Clear"),oe(Z,L)};Ae(At,Z=>{R(o)&&Z(Tt)})}H(It);var jt=te(It,2),Ze=G(jt);{var q=Z=>{var L=Z9(),V=G(L);let Te;var qe=G(V);qe.__click=()=>ae(h,!R(h));var Ot=G(qe);let yo;var Cb=te(Ot,4),km=G(Cb),Pb=G(km);Pb.__click=_,st(Pb,cr=>l[8]=cr,()=>l==null?void 0:l[8]),H(km);var Rb=te(km,2),yD=G(Rb,!0);H(Rb),H(Cb),H(qe);var bD=te(qe,2);{var _D=cr=>{var yr=q9(),bo=G(yr);{var gs=ur=>{mo(ur,{get hierarchy(){return R(u)},get plugin(){return r()},get view(){return i()},get fileType(){return 0},topLevel:!0,get closed(){return R(v)},set closed(Ti){ae(v,Ti,!0)}})},_o=ur=>{var Ti=j9(),sa=zr(Ti);ui(sa,17,()=>Eu(R(s).staged,500),ci,(vs,hc)=>{xf(vs,{get change(){return R(hc)},get view(){return i()},get manager(){return r().gitManager}})});var aa=te(sa,2);po(aa,{get files(){return R(s).staged}}),oe(ur,Ti)};Ae(bo,ur=>{R(k)?ur(gs):ur(_o,!1)})}H(yr),Zi(3,yr,()=>Dn,()=>({duration:150})),oe(cr,yr)};Ae(bD,cr=>{R(h)&&cr(_D)})}H(V);var Ef=te(V,2);let $b;var kf=G(Ef);kf.__click=()=>ae(d,!R(d));var Fb=G(kf);let Ib;var Ob=te(Fb,4),Am=G(Ob),Mb=G(Am);Mb.__click=D;var Db=te(Mb,2);Db.__click=S,st(Db,cr=>l[9]=cr,()=>l==null?void 0:l[9]),H(Am);var Lb=te(Am,2),xD=G(Lb,!0);H(Lb),H(Ob),H(kf);var SD=te(kf,2);{var ED=cr=>{var yr=V9(),bo=G(yr);{var gs=ur=>{mo(ur,{get hierarchy(){return R(c)},get plugin(){return r()},get view(){return i()},get fileType(){return 1},topLevel:!0,get closed(){return R(w)},set closed(Ti){ae(w,Ti,!0)}})},_o=ur=>{var Ti=z9(),sa=zr(Ti);ui(sa,17,()=>Eu(R(s).changed,500),ci,(vs,hc)=>{bf(vs,{get change(){return R(hc)},get view(){return i()},get manager(){return r().gitManager}})});var aa=te(sa,2);po(aa,{get files(){return R(s).changed}}),oe(ur,Ti)};Ae(bo,ur=>{R(k)?ur(gs):ur(_o,!1)})}H(yr),Zi(3,yr,()=>Dn,()=>({duration:150})),oe(cr,yr)};Ae(SD,cr=>{R(d)&&cr(ED)})}H(Ef);var kD=te(Ef,2);{var AD=cr=>{var yr=X9();let bo;var gs=G(yr);gs.__click=()=>ae(m,!R(m));var _o=te(G(gs),4),ur=G(_o,!0);H(_o),H(gs);var Ti=te(gs,2);{var sa=aa=>{var vs=Y9(),hc=G(vs);{var TD=xo=>{mo(xo,{get hierarchy(){return R(f)},get plugin(){return r()},get view(){return i()},get fileType(){return 2},topLevel:!0,get closed(){return R(b)},set closed(Af){ae(b,Af,!0)}})},CD=xo=>{var Af=W9(),Bb=zr(Af);ui(Bb,17,()=>R(a),ci,(RD,$D)=>{_f(RD,{get change(){return R($D)},get view(){return i()}})});var PD=te(Bb,2);po(PD,{get files(){return R(a)}}),oe(xo,Af)};Ae(hc,xo=>{R(k)?xo(TD):xo(CD,!1)})}H(vs),Zi(3,vs,()=>Dn,()=>({duration:150})),oe(aa,vs)};Ae(Ti,aa=>{R(m)&&aa(sa)})}H(yr),Ne(()=>{bo=ht(yr,1,"pulled nav-folder",null,bo,{"is-collapsed":!R(m)}),Ue(ur,R(a).length)}),oe(cr,yr)};Ae(kD,cr=>{R(a).length>0&&R(f)&&cr(AD)})}H(L),Ne(()=>{Te=ht(V,1,"staged tree-item nav-folder",null,Te,{"is-collapsed":!R(h)}),yo=ht(Ot,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,yo,{"is-collapsed":!R(h)}),Ue(yD,R(s).staged.length),$b=ht(Ef,1,"changes tree-item nav-folder",null,$b,{"is-collapsed":!R(d)}),Ib=ht(Fb,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,Ib,{"is-collapsed":!R(d)}),Ue(xD,R(s).changed.length)}),oe(Z,L)};Ae(Ze,Z=>{R(s)&&R(u)&&R(c)&&Z(q)})}H(jt),H(N),Ne(()=>{be(N,"data-type",zt.type),be(j,"data-icon",R(k)?"list":"folder"),lr=ht(Le,1,"clickable-icon nav-action-button",null,lr,{loading:R(n)}),be(Fe,"rows",R(B))}),hb(Fe,()=>R(o),Z=>ae(o,Z)),oe(t,N),lt()}kt(["click"]);var Sf=class extends uD.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return zt.type}getDisplayText(){return zt.name}getIcon(){return zt.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=ia(Sb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};p();var pm=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.statusBarEl.addClass("mod-clickable"),this.statusBarEl.onClickEvent(i=>{this.plugin.switchBranch().catch(n=>r.displayError(n))})}async display(){if(this.plugin.gitReady){let e=await this.plugin.gitManager.branchInfo();e.current!=null?this.statusBarEl.setText(e.current):this.statusBarEl.empty()}else this.statusBarEl.empty()}remove(){this.statusBarEl.remove()}};p();var fD=require("obsidian");var mm=class{constructor(e){this.plugin=e}get editor(){var i;let e=(i=this.plugin.app.workspace.activeEditor)==null?void 0:i.editor,r=e==null?void 0:e.cm;if(!(!e||!Bi.hasHunksData(r.state)))return{editor:r,obEditor:e}}get gitManager(){return this.plugin.gitManager}resetHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=Bi.getHunk(r.state,!1,e);if(n){let s,a;n.type==="delete"?(s=n.added.start+1,a=n.added.start+1):(s=n.added.start-0,a=n.added.start-1+n.added.count);let o=r.state.doc.line(s).from,l=n.type==="delete"?r.state.doc.line(a).from:r.state.doc.line(a).to+1,c=n.removed.lines.join(` +`);n.removed.lines.length>0&&!n.removed.no_nl_at_eof&&(c+=` +`),i.replaceRange(c,i.offsetToPos(o),i.offsetToPos(l)),i.setSelection(i.offsetToPos(o))}}async stageHunk(e){if(!await this.plugin.isAllInitialized()||!this.editor)return;let{editor:r}=this.editor,i=Bi.getHunk(r.state,!1,e),n=!1;if(i||(i=Bi.getHunk(r.state,!0,e),n=!0),!i)return;let s=r.state.field(fD.editorInfoField).file.path,a=Nt.createPatch(s,[i],"100644",n).join(` +`)+` +`;await this.gitManager.applyPatch(a),this.plugin.app.workspace.trigger("obsidian-git:refresh")}goToHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=Bi.getHunks(r.state,!1),s=i.getCursor().line+1,a=Nt.findNearestHunk(s,n,e,!0);if(a==null)return;let o=n[a];if(o){let l=o.added.start-1;i.setCursor(l,0),i.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};p();p();var vo=require("obsidian");var gm=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 vo.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),YF(()=>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;nI(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new tp(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&&vo.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(mI),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(),JF(),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 i;return e instanceof vo.TFile&&((i=this.lineAuthorInfoProvider)==null?void 0:i.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var r;return e instanceof vo.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",rI)}};p();var dc=require("obsidian");p();p();var wo=require("@codemirror/state"),wm=require("@codemirror/view");var vm=class extends wm.GutterMarker{constructor(r,i){super();this.type=r;this.staged=i}toDOM(r){let i=document.createElement("div");return i.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&i.setText("~"),i}},Eb=wo.StateField.define({create:()=>wo.RangeSet.empty,update:(t,e)=>{let r=e.state.field(Fr,!1);if(!r)return wo.RangeSet.empty;let i=e.effects.some(s=>s.is(Uu)),n=e.effects.some(s=>s.is(Ol));if(i||n||(e.docChanged||t.size==0)&&r.isDirty==!1){let s=new Set,a=dD(e,r.hunks,!1,s),o=dD(e,r.stagedHunks,!0,s);return t=wo.RangeSet.of([...a,...o],!0),t}else e.docChanged&&(t=t.map(e.changes));return t}});function dD(t,e,r,i){let n=[];for(let a=0;a0?e[a-1]:void 0,l=a{var e;return(e=t.state.field(Eb,!1))!=null?e:wo.RangeSet.empty},initialSpacer:t=>new vm("delete",!1),domEventHandlers:{click:(t,e,r)=>{var n;return((n=Bi.getHunkAtPos(t.state,e.from,!1))!=null?n:Bi.getHunkAtPos(t.state,e.from,!0))&&(Ys(t,e.from),r.preventDefault()),!1}}});var ym=class{constructor(e){this.plugin=e}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeSigns(e.path)}}destroy(){}async computeSigns(e){let i=await this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager.show("",e).catch(()=>{});this.notifySignComputationResultToSubscribers(e,{compareText:i,compareTextHead:void 0})}notifySignComputationResultToSubscribers(e,r){Jn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyGitCompare(r)))}},pD=[TO,CO,hD,Eb,Sp],mD=[Fr,fy];p();var kb=require("obsidian"),bm=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;e.addClass("git-changes-status-bar"),r.settings.hunks.statusBar==="colored"&&e.addClass("git-changes-status-bar-colored"),e.setAttr("aria-label","Git diff of the current editor"),this.statusBarEl.setAttribute("data-tooltip-position","top"),r.app.workspace.on("active-leaf-change",i=>{(!i||i.getRoot()==r.app.workspace.rootSplit&&!(i.view instanceof kb.MarkdownView))&&this.statusBarEl.empty()})}display(e,r){var o;let i=this.plugin.app.workspace.getActiveViewOfType(kb.MarkdownView);if(!i||((o=i.file)==null?void 0:o.path)!==(r==null?void 0:r.path))return;let n=0,s=0,a=0;for(let l of e)n+=Math.max(0,l.added.count-l.removed.count),s+=Math.min(l.added.count,l.removed.count),a+=Math.max(0,l.removed.count-l.added.count);this.statusBarEl.empty(),n>0&&this.statusBarEl.createSpan({text:`+${n} `,cls:"git-add"}),s>0&&this.statusBarEl.createSpan({text:`~${s} `,cls:"git-change"}),a>0&&this.statusBarEl.createSpan({text:`-${a}`,cls:"git-delete"})}remove(){this.statusBarEl.remove()}};var _m=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.signsProvider){console.warn("Git: undefined signsProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof dc.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.signsProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions)}conditionallyActivateBySettings(){(this.plg.settings.hunks.showSigns||this.plg.settings.hunks.statusBar!="disabled"||this.plg.settings.hunks.hunkCommands)&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;if(this.signsProvider=new ym(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),this.plg.settings.hunks.statusBar!="disabled"){let e=this.plg.addStatusBarItem();this.changeStatusBar=new bm(e,this.plg)}}catch(e){console.warn("Git: Error while loading signs feature.",e),this.deactivateFeature()}}deactivateFeature(){var e,r;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.signsProvider)==null||e.destroy(),this.signsProvider=void 0,(r=this.changeStatusBar)==null||r.remove(),this.changeStatusBar=void 0}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&dc.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Se?this.plg.gitManager:void 0}}refresh(){this.plg.settings.hunks.showSigns&&this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(mD),this.plg.settings.hunks.showSigns&&this.codeMirrorExtensions.push(...pD),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.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileRenameEvent=this.createFileRenameEvent(),this.pluginRefreshedEvent=this.createPluginRefreshedEvent(),this.intervalRefreshEvent=this.createIntervalRefreshEvent(),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileRenameEvent),this.plg.registerEvent(this.pluginRefreshedEvent),this.plg.registerInterval(this.intervalRefreshEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent),this.plg.app.workspace.offref(this.pluginRefreshedEvent),this.plg.app.workspace.offref(this.gutterContextMenuEvent),window.clearInterval(this.intervalRefreshEvent)}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return Jn.ifFilepathDefinedTransformSubscribers(r,n=>n.forEach(s=>{s.changeToNewFilepath(e.path)})),e instanceof dc.TFile&&((i=this.signsProvider)==null?void 0:i.trackChanged(e))})}createPluginRefreshedEvent(){return this.plg.app.workspace.on("obsidian-git:refresh",()=>{this.refresh()})}createIntervalRefreshEvent(){return window.setInterval(()=>{var e,r;(e=this.plg.app.workspace.activeEditor)!=null&&e.file&&((r=this.signsProvider)==null||r.trackChanged(this.plg.app.workspace.activeEditor.file).catch(console.error))},10*1e3)}};p();var gD=require("@codemirror/state"),xm=require("obsidian");var Ab=class{constructor(e){this.state=e;this.subscribeMe()}notifyLineAuthoring(e,r){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${e}`);return}let i=this.view.state,n=WF(e,r,i);this.view.dispatch(n)}notifyGitCompare(e){if(this.view===void 0){console.warn("Git: View is not defined for editor cache key. Unforeseen situation. id: ");return}if(this.removeIfStale())return;let r=this.view.state,i=r.field(Fr);if(!i||i.compareText!=e.compareText||i.compareTextHead!=e.compareTextHead){let n=aO(e,r);this.view.dispatch(n)}}updateToNewState(e){return this.state=e,!this.lastSeenPath&&this.filepath&&this.subscribeMe(),this}removeIfStale(){var e;return((e=this.view)==null?void 0:e.state.field(Tb,!1))!=this||this.view.destroyed?(this.unsubscribeMe(this.lastSeenPath),!0):!1}changeToNewFilepath(e){this.unsubscribeMe(this.lastSeenPath),this.subscribeMe(e)}subscribeMe(e){e!=null||(e=this.filepath),e!==void 0&&(Jn.ifFilepathDefinedTransformSubscribers(e,r=>r.add(this)),this.lastSeenPath=e)}unsubscribeMe(e){Jn.ifFilepathDefinedTransformSubscribers(e,r=>r.delete(this))}get filepath(){var e,r;return(r=(e=this.state.field(xm.editorInfoField))==null?void 0:e.file)==null?void 0:r.path}get view(){return this.state.field(xm.editorEditorField)}},Tb=gD.StateField.define({create:t=>new Ab(t),update:(t,e)=>t.updateToNewState(e.state),compare:(t,e)=>t===e});var Sm=class{constructor(e){this.plg=e;this.lineAuthoringFeature=new gm(this.plg);this.signsFeature=new _m(this.plg)}onUnloadPlugin(){this.lineAuthoringFeature.deactivateFeature(),this.signsFeature.deactivateFeature()}onLoadPlugin(){this.plg.registerEditorExtension(Tb),this.lineAuthoringFeature.onLoadPlugin(),this.signsFeature.onLoadPlugin()}onReady(){this.lineAuthoringFeature.conditionallyActivateBySettings(),this.signsFeature.conditionallyActivateBySettings()}activateLineAuthoring(){this.lineAuthoringFeature.activateFeature()}deactiveLineAuthoring(){this.lineAuthoringFeature.deactivateFeature()}refreshSignsSettings(){let e=this.plg.settings.hunks;e.showSigns||e.statusBar!="disabled"||e.hunkCommands?(this.signsFeature.deactivateFeature(),this.signsFeature.activateFeature()):this.signsFeature.deactivateFeature()}};var Em=class extends _e.Plugin{constructor(){super(...arguments);this.automaticsManager=new Du(this);this.tools=new Yu(this);this.localStorage=new Ep(this);this.state={gitAction:0,offlineMode:!1};this.gitReady=!1;this.promiseQueue=new Dd(this);this.intervalsToClear=[];this.editorIntegration=new Sm(this);this.hunkActions=new mm(this)}setPluginState(r){var i;this.state=Object.assign(this.state,r),(i=this.statusBar)==null||i.display()}async updateCachedStatus(){var r,i;return this.app.workspace.trigger("obsidian-git:loading-status"),this.cachedStatus=await this.gitManager.status(),this.cachedStatus.conflicted.length>0?(this.localStorage.setConflict(!0),await((r=this.branchBar)==null?void 0:r.display())):(this.localStorage.setConflict(!1),await((i=this.branchBar)==null?void 0:i.display())),this.app.workspace.trigger("obsidian-git:status-changed",this.cachedStatus),this.cachedStatus}async refresh(){if(!this.gitReady)return;let r=this.app.workspace.getLeavesOfType(zt.type),i=this.app.workspace.getLeavesOfType(gi.type);(this.settings.changedFilesInStatusBar||r.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)})||i.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)}))&&await this.updateCachedStatus().catch(n=>this.displayError(n)),this.app.workspace.trigger("obsidian-git:refreshed")}refreshUpdatedHead(){}async onload(){console.log("loading "+this.manifest.name+" plugin: v"+this.manifest.version),Ii.plugin=this,this.localStorage.migrate(),await this.loadSettings(),await this.migrateSettings(),this.settingsTab=new rp(this.app,this),this.addSettingTab(this.settingsTab),this.localStorage.getPluginDisabled()||(this.registerStuff(),this.app.workspace.onLayoutReady(()=>this.init({fromReload:!1}).catch(r=>this.displayError(r))))}onExternalSettingsChange(){this.reloadSettings().catch(r=>this.displayError(r))}async reloadSettings(){let r=JSON.stringify(this.settings);await this.loadSettings();let i=JSON.stringify(this.settings);r!==i&&(this.log("Reloading settings"),this.unloadPlugin(),await this.init({fromReload:!0}),this.app.workspace.getLeavesOfType(zt.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}),this.app.workspace.getLeavesOfType(gi.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}))}registerStuff(){this.registerEvent(this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(r=>this.displayError(r))})),this.registerEvent(this.app.workspace.on("obsidian-git:head-change",()=>{this.refreshUpdatedHead()})),this.registerEvent(this.app.workspace.on("file-menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"file-manu")})),this.registerEvent(this.app.workspace.on("obsidian-git:menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"obsidian-git:menu")})),this.registerEvent(this.app.workspace.on("active-leaf-change",r=>{this.onActiveLeafChange(r)})),this.registerEvent(this.app.vault.on("modify",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("delete",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("create",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("rename",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerView(zt.type,r=>new Sf(r,this)),this.registerView(gi.type,r=>new wf(r,this)),this.registerView(Bs.type,r=>new qa(r,this)),this.registerView(Ls.type,r=>new za(r,this)),this.addRibbonIcon("git-pull-request","Open Git source control",async()=>{var n;let r=this.app.workspace.getLeavesOfType(zt.type),i;r.length===0?(i=(n=this.app.workspace.getRightLeaf(!1))!=null?n:this.app.workspace.getLeaf(),await i.setViewState({type:zt.type})):i=r.first(),await this.app.workspace.revealLeaf(i)}),this.registerHoverLinkSource(zt.type,{display:"Git View",defaultMod:!0}),this.editorIntegration.onLoadPlugin(),this.setRefreshDebouncer(),PO(this)}setRefreshDebouncer(){var r;(r=this.debRefresh)==null||r.cancel(),this.debRefresh=(0,_e.debounce)(()=>{this.settings.refreshSourceControl&&this.refresh().catch(console.error)},this.settings.refreshSourceControlTimer,!0)}async addFileToGitignore(r,i){let n=this.gitManager.getRelativeRepoPath(r,!0),s=zP({isFolder:i,gitRelativePath:n});await this.app.vault.adapter.append(this.gitManager.getRelativeVaultPath(".gitignore"),` +`+s),this.app.workspace.trigger("obsidian-git:refresh")}handleFileMenu(r,i,n,s){if(!this.gitReady||!this.settings.showFileMenu||!i)return;let a;if(typeof i=="string"?a=i:a=i.path,n=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof _e.TFile?await this.stageFile(i):(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()=>{i instanceof _e.TFile?await this.unstageFile(i):(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,i instanceof _e.TFolder).catch(c=>this.displayError(c))})})),n=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(a,i instanceof _e.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;s==="obsidian-git:menu"&&o instanceof _e.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(wD.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,i;this.gitReady=!1,this.editorIntegration.onUnloadPlugin(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(i=this.statusBar)==null||i.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let n of this.intervalsToClear)window.clearInterval(n);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=ZA(rt,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return _e.Platform.isDesktopApp}async init({fromReload:r=!1}){var i;if(this.settings.showStatusBar&&!this.statusBar){let n=this.addStatusBarItem();this.statusBar=new ip(n,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 Di(this);let n=await this.gitManager.checkRequirements(),s=this.localStorage.getPausedAutomatics();switch(n){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new _e.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}),_e.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new pm(a,this),this.intervalsToClear.push(window.setInterval(()=>{var o;return void((o=this.branchBar)==null?void 0:o.display().catch(console.error))},6e4))}await((i=this.branchBar)==null?void 0:i.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 _e.Notice("Automatic routines are currently paused.");break;default:this.log("Something weird happened. The 'checkRequirements' result is "+n)}}catch(n){this.displayError(n),console.error(n)}}async createNewRepo(){try{await this.gitManager.init(),new _e.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let i=await new Qe(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(i){let n="Vault Root",s=await new Qe(this,{options:this.gitManager instanceof Di?[n]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.gitManager instanceof Di}).openAndGetResult();if(s==null)return;if(s===n&&(s="."),s=(0,_e.normalizePath)(s),s==="/"&&(s="."),s==="."){let f=await new Qe(this,{options:["NO","YES"],placeholder:`Does your remote repo contain a ${this.app.vault.configDir} directory at the root?`,onlySelection:!0}).openAndGetResult();if(f===void 0){new _e.Notice("Aborted clone");return}else if(f==="YES"){let d="DELETE ALL YOUR LOCAL CONFIG AND PLUGINS";if(await new Qe(this,{options:["Abort clone",d],placeholder:`To avoid conflicts, the local ${this.app.vault.configDir} directory needs to be deleted.`,onlySelection:!0}).openAndGetResult()===d)await this.app.vault.adapter.rmdir(this.app.vault.configDir,!0);else{new _e.Notice("Aborted clone");return}}}let a=await new Qe(this,{placeholder:"Specify depth of clone. Leave empty for full clone.",allowEmpty:!0}).openAndGetResult(),o;if(a===void 0){new _e.Notice("Aborted clone");return}if(a!==""&&(o=parseInt(a),isNaN(o))){new _e.Notice("Invalid depth. Aborting clone.");return}new _e.Notice(`Cloning new repo into "${s}"`);let l=this.settings.basePath,c=s&&s!==".";c&&(this.settings.basePath=s);try{await this.gitManager.clone(zw(i),s,o),new _e.Notice("Cloned new repo."),new _e.Notice("Please restart Obsidian"),c&&await this.saveSettings()}catch(u){this.displayError(u),this.settings.basePath=l,await this.saveSettings()}}}async isAllInitialized(){return this.gitReady||await this.init({fromReload:!0}),this.gitReady}async pullChangesFromRemote(){if(!await this.isAllInitialized())return;let r=await this.pull();if(r!==!1){if(r||this.displayMessage("Pull: Everything is up-to-date"),this.gitManager instanceof Se){let i=await this.updateCachedStatus();i.conflicted.length>0&&(this.displayError(`You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted))}this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0})}}async commitAndSync({fromAutoBackup:r,requestCustomMessage:i=!1,commitMessage:n,onlyStaged:s=!1}){!await this.isAllInitialized()||(this.settings.syncMethod=="reset"&&this.settings.pullBeforePush&&await this.pull(),!await this.commit({fromAuto:r,requestCustomMessage:i,commitMessage:n,onlyStaged:s}))||(this.settings.syncMethod!="reset"&&this.settings.pullBeforePush&&await this.pull(),this.settings.disablePush||(await this.remotesAreSet()&&await this.gitManager.canPush()?await this.push():this.displayMessage("No commits to push")),this.setPluginState({gitAction:0}))}async commit({fromAuto:r,requestCustomMessage:i=!1,onlyStaged:n=!1,commitMessage:s,amend:a=!1}){if(!await this.isAllInitialized())return!1;try{let o=this.localStorage.getConflict(),l,c=[],u=[];if(this.gitManager instanceof Se){if(await this.mayDeleteConflictFile(),l=await this.updateCachedStatus(),l.conflicted.length==0&&(o=!1),r&&l.conflicted.length>0)return this.displayError(`Did not commit, because you have conflicts in ${l.conflicted.length} ${l.conflicted.length==1?"file":"files"}. Please resolve them and commit per command.`),await this.handleConflict(l.conflicted),!1;c=l.staged,u=l.changed}else{if(r&&o)return this.displayError("Did not commit, because you have conflicts. Please resolve them and commit per command."),!1;{o&&await this.mayDeleteConflictFile();let f=this.gitManager;n?c=await f.getStagedFiles():u=(await f.getUnstagedFiles()).map(({path:h,type:m})=>({vaultPath:this.gitManager.getRelativeVaultPath(h),path:h,type:m}))}}if(await this.tools.hasTooBigFiles(n?c:[...c,...u]))return this.setPluginState({gitAction:0}),!1;if(u.length+c.length!==0||o){let f=s!=null?s:s=r?this.settings.autoCommitMessage:this.settings.commitMessage;if(r&&this.settings.customMessageOnAutoBackup||i){!this.settings.disablePopups&&r&&new _e.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort");let m=await new np(this).openAndGetResult();if(m!=null&&m!=""&&m!="...")f=m;else return this.setPluginState({gitAction:0}),!1}else if(this.gitManager instanceof Se&&this.settings.commitMessageScript){let m=this.settings.commitMessageScript,g=this.localStorage.getHostname()||"",v=m.replace("{{hostname}}",g);v=v.replace("{{date}}",(0,_e.moment)().format(this.settings.commitDateFormat));let w=await ku("sh",["-c",v],{cwd:this.gitManager.absoluteRepoPath});w.code!=0?this.displayError(w.stderr):w.stdout.trim().length==0?this.displayMessage("Stdout from commit message script is empty. Using default message."):f=w.stdout}if(!f||f.trim()==="")return new _e.Notice("Commit aborted: No commit message provided"),this.setPluginState({gitAction:0}),!1;let d;n?d=await this.gitManager.commit({message:f,amend:a}):d=await this.gitManager.commitAll({message:f,status:l,unstagedFiles:u,amend:a}),this.gitManager instanceof Se&&await this.updateCachedStatus();let h=!1;d===void 0&&(h=!0,d=u.length+c.length||0),this.displayMessage(`Committed${h?" approx.":""} ${d} ${d==1?"file":"files"}`)}else this.displayMessage("No changes to commit");return this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(o){return this.displayError(o),!1}}async push(){if(!await this.isAllInitialized()||!await this.remotesAreSet())return!1;let r=this.localStorage.getConflict();try{this.gitManager instanceof Se&&await this.mayDeleteConflictFile();let i;if(this.gitManager instanceof Se&&(i=await this.updateCachedStatus()).conflicted.length>0)return this.displayError(`Cannot push. You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted),!1;if(this.gitManager instanceof Di&&r)return this.displayError("Cannot push. You have conflicts"),!1;this.log("Pushing....");let n=await this.gitManager.push();return n!==void 0&&(n===null?this.displayMessage("Pushed to remote"):n>0?this.displayMessage(`Pushed ${n} ${n==1?"file":"files"} to remote`):this.displayMessage("No commits to push")),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(i){return i instanceof cl?this.handleNoNetworkError(i):this.displayError(i),!1}}async pull(){if(!await this.remotesAreSet())return!1;try{this.log("Pulling....");let r=await this.gitManager.pull()||[];return this.setPluginState({offlineMode:!1}),r.length>0&&(this.displayMessage(`Pulled ${r.length} ${r.length==1?"file":"files"} from remote`),this.lastPulledFiles=r),r.length}catch(r){return this.displayError(r),!1}}async fetch(){if(await this.remotesAreSet())try{await this.gitManager.fetch(),this.displayMessage("Fetched from remote"),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh")}catch(r){this.displayError(r)}}async mayDeleteConflictFile(){let r=this.app.vault.getAbstractFileByPath(al);r&&(this.app.workspace.iterateAllLeaves(i=>{var n;i.view instanceof _e.MarkdownView&&((n=i.view.file)==null?void 0:n.path)==r.path&&i.detach()}),await this.app.vault.delete(r))}async stageFile(r){return await this.isAllInitialized()?(await this.gitManager.stage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async unstageFile(r){return await this.isAllInitialized()?(await this.gitManager.unstage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async switchBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo(),i=await new dm(this,r.branches).openAndGetReslt();if(i!=null)return await this.gitManager.checkout(i),this.displayMessage(`Switched to ${i}`),this.app.workspace.trigger("obsidian-git:refresh"),await((n=this.branchBar)==null?void 0:n.display()),i}async switchRemoteBranch(){var s;if(!await this.isAllInitialized())return;let r=await this.selectRemoteBranch()||"",[i,n]=Zn(r);if(n!=null&&i!=null)return await this.gitManager.checkout(n,i),this.displayMessage(`Switched to ${r}`),await((s=this.branchBar)==null?void 0:s.display()),r}async createBranch(){var i;if(!await this.isAllInitialized())return;let r=await new Qe(this,{placeholder:"Create new branch"}).openAndGetResult();if(r!=null)return await this.gitManager.createBranch(r),this.displayMessage(`Created new branch ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}async deleteBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo();r.current&&r.branches.remove(r.current);let i=await new Qe(this,{options:r.branches,placeholder:"Delete branch",onlySelection:!0}).openAndGetResult();if(i!=null){let s=!1;if(!await this.gitManager.branchIsMerged(i)){let o=await new Qe(this,{options:["YES","NO"],placeholder:"This branch isn't merged into HEAD. Force delete?",onlySelection:!0}).openAndGetResult();if(o!=="YES")return;s=o==="YES"}return await this.gitManager.deleteBranch(i,s),this.displayMessage(`Deleted branch ${i}`),await((n=this.branchBar)==null?void 0:n.display()),i}}async remotesAreSet(){return this.settings.updateSubmodules||this.gitManager instanceof Se&&await this.gitManager.getConfig("push.autoSetupRemote","all")=="true"||(await this.gitManager.branchInfo()).tracking?!0:(new _e.Notice("No upstream branch is set. Please select one."),await this.setUpstreamBranch())}async setUpstreamBranch(){let r=await this.selectRemoteBranch();return r==null?(this.displayError("Aborted. No upstream-branch is set!",1e4),this.setPluginState({gitAction:0}),!1):(await this.gitManager.updateUpstreamBranch(r),this.displayMessage(`Set upstream branch to ${r}`),this.setPluginState({gitAction:0}),!0)}async discardAll(r){if(!await this.isAllInitialized())return!1;let i=await this.gitManager.status({path:r}),n=0,s=0;for(let o of i.changed)o.workingDir=="U"?n++:s++;if(n+s==0)return!1;let a=await new fc({app:this.app,filesToDeleteCount:n,filesToDiscardCount:s,path:r!=null?r:""}).openAndGetResult();switch(a){case!1:return a;case"discard":await this.gitManager.discardAll({dir:r,status:this.cachedStatus});break;case"delete":{await this.gitManager.discardAll({dir:r,status:this.cachedStatus});let o=await this.gitManager.getUntrackedPaths({path:r,status:this.cachedStatus});for(let l of o){let c=this.gitManager.getRelativeVaultPath(l),u=this.app.vault.getAbstractFileByPath(c);u?await this.app.fileManager.trashFile(u):l.endsWith("/")?await this.app.vault.adapter.rmdir(c,!0):await this.app.vault.adapter.remove(c)}break}default:wh(a)}return this.app.workspace.trigger("obsidian-git:refresh"),a}async handleConflict(r){this.localStorage.setConflict(!0);let i;r!==void 0&&(i=["# Conflicts","Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push`","(This file will automatically be deleted before commit)","[[#Additional Instructions]] available below file list","",...r.map(n=>{let s=this.app.vault.getAbstractFileByPath(n);return s instanceof _e.TFile?`- [[${this.app.metadataCache.fileToLinktext(s,"/")}]]`:`- Not a file: ${n}`}),` +# 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(i==null?void 0:i.join(` +`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new Qe(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(n){let s=await this.gitManager.getRemoteUrl(n),o=await new Qe(this,{initialValue:s,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(n,zw(o)),n}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),i;r.length===0&&(i=await this.editRemotes(),i==null&&(r=await this.gitManager.getRemotes()));let n=new Qe(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),s=i!=null?i:await n.openAndGetResult();if(s){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(s);let a=await this.gitManager.getRemoteBranches(s),l=await new Qe(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(),n=await new Qe(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();n&&await this.gitManager.removeRemote(n)}onActiveLeafChange(r){var a,o;let i=r==null?void 0:r.view;if(!(i!=null&&i.getState().file)&&!(i instanceof qa||i instanceof za))return;let n=this.app.workspace.getLeavesOfType(zt.type).first(),s=this.app.workspace.getLeavesOfType(gi.type).first();if((a=n==null?void 0:n.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 qa||(r==null?void 0:r.view)instanceof za){let c=r.view.state.bFile.replace(/["\\]/g,"\\$&");this.lastDiffViewState=r.view.getState();let u;n&&r.view.state.aRef=="HEAD"?u=n.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path="${c}"]`):n&&r.view.state.aRef==""?u=n.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,i=4*1e3){var n;(n=this.statusBar)==null||n.displayMessage(r.toLowerCase(),i),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new _e.Notice(r,5*1e3),this.log(r)}displayError(r,i=10*1e3){var s;if(r instanceof vD.Errors.UserCanceledError){new _e.Notice("Aborted");return}let n;r instanceof Error?n=r:n=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new _e.Notice(n.message,i),console.error(`${this.manifest.id}:`,n.stack),(s=this.statusBar)==null||s.displayMessage(n.message.toLowerCase(),i)}log(...r){console.log(`${this.manifest.id}:`,...r)}}; +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +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 */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json new file mode 100644 index 0000000..f472bdc --- /dev/null +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -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.0" +} diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css new file mode 100644 index 0000000..305b2f4 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -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,'); +} + +.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after { + -webkit-mask-image: url('data:image/svg+xml,'); +} + +/* 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; +} diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json new file mode 100644 index 0000000..e0ed6f3 --- /dev/null +++ b/.obsidian/workspace.json @@ -0,0 +1,244 @@ +{ + "main": { + "id": "90a27f39ceb704d3", + "type": "split", + "children": [ + { + "id": "accf8a4c00fbc249", + "type": "tabs", + "children": [ + { + "id": "b6e84b4bb62eefe4", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Players/IRONBACK KHAN/Upgrades/Mantras.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "Mantras" + } + } + ] + } + ], + "direction": "vertical" + }, + "left": { + "id": "64345196b28e9f9b", + "type": "split", + "children": [ + { + "id": "bbd0c7f49b1938e4", + "type": "tabs", + "children": [ + { + "id": "627d7b2c350dc722", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Dateiexplorer" + } + }, + { + "id": "e91c42b770bbd3a5", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "Search" + } + }, + { + "id": "802e6457d5ad6ea8", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "5b3b114977ee854a", + "type": "split", + "children": [ + { + "id": "facfbb5f28a09652", + "type": "tabs", + "children": [ + { + "id": "885bedba5d01682f", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "Oaths/Silentheart.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "Backlinks for Silentheart" + } + }, + { + "id": "b5e8dfeb172eb034", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "Oaths/Silentheart.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "Outgoing links from Silentheart" + } + }, + { + "id": "5c704752308f6761", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": true, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Tags" + } + }, + { + "id": "301acd0b34f681a7", + "type": "leaf", + "state": { + "type": "all-properties", + "state": { + "sortOrder": "frequency", + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-archive", + "title": "Alle Eigenschaften" + } + }, + { + "id": "a8d45dd89a56dc47", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "Players/IRONBACK KHAN/Upgrades/Mantras.md", + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "Gliederung von Mantras" + } + }, + { + "id": "ef1d9d7c34483d7e", + "type": "leaf", + "state": { + "type": "git-view", + "state": {}, + "icon": "git-pull-request", + "title": "Source Control" + } + } + ], + "currentTab": 5 + } + ], + "direction": "horizontal", + "width": 300 + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Schnellauswahl öffnen": false, + "graph:Graph-Ansicht öffnen": false, + "canvas:Neuen Canvas erstellen": false, + "daily-notes:Heutige Notiz öffnen": false, + "templates:Vorlage einfügen": false, + "command-palette:Befehlspalette öffnen": false, + "bases:Neue Base erstellen": false, + "publish:Änderungen veröffentlichen": false, + "obsidian-git:Open Git source control": false + } + }, + "active": "ef1d9d7c34483d7e", + "lastOpenFiles": [ + "Players/IRONBACK KHAN/Upgrades/Core Stats.md", + "Players/IRONBACK KHAN/Upgrades/Talents.md", + "Players/RADIOACTIVE CRACK RAT/Upgrades/Talents.md", + "Players/RADIOACTIVE CRACK RAT/Upgrades/Mantras.md", + "Players/SOLIDIFIED SERPENT/Upgrades/Mantras.md", + "Players/SOLIDIFIED SERPENT/Upgrades/Talents.md", + "Players/SOLIDIFIED SERPENT/Solidified Serpent.md", + "Players/SOLIDIFIED SERPENT/Non-Magic-Missile (NMM).md", + "Players/SOLIDIFIED SERPENT/Upgrades/Legalize Nuclear Bombs (Slowed & Reverb).md", + "Players/SOLIDIFIED SERPENT/Upgrades/Increase Shareholder Value.md", + "Players/AXIOM-07/Upgrades/Talents.md", + "Players/RAILCAT/Upgrades/Talents.md", + "Players/RADIOACTIVE CRACK RAT/Notes.md", + "Players/SOLIDIFIED SERPENT/Upgrades", + "Players/AXIOM-07/Upgrades/More Weapons.md", + "Players/AXIOM-07/Upgrades/Mantras.md", + "Players/RADIOACTIVE CRACK RAT/~Ex-plosion!.md", + "Players/RADIOACTIVE CRACK RAT/Upgrades/Black Meridian Variants.md", + "Players/RADIOACTIVE CRACK RAT/Upgrades/Legalize Nuclear Bombs.md", + "Players/RAILCAT/RAILCAT.md", + "Players/RADIOACTIVE CRACK RAT/Black Meridian.md", + "Players/RADIOACTIVE CRACK RAT/The Crack Plague.md", + "Players/RADIOACTIVE CRACK RAT/RADIOACTIVE CRACK RAT.md", + "Players/RAILCAT/Summer Company Prosthetic.md", + "Players/RAILCAT/The Arcblade.md", + "Players/RAILCAT/Upgrades/Arcblade.md", + "Players/Player Characters.md", + "Overview.canvas", + "monkeballs.png", + "jetstream scam.png", + "bloodisfuel.png", + "Unbenannt 1.canvas", + "Players/RADIOACTIVE CRACK RAT/Upgrades", + "crack rat.png", + "Players/RAILCAT/Upgrades", + "Players/SOLIDIFIED SERPENT", + "Players/IRONBACK KHAN/Upgrades", + "Players/RAILCAT", + "Players/RADIOACTIVE CRACK RAT", + "Players/AXIOM-07.zip", + "Players/IRONBACK KHAN", + "Players/AXIOM-07/Upgrades", + "Untitled.canvas" + ] +} \ No newline at end of file diff --git a/Combat/Armor Class.md b/Combat/Armor Class.md new file mode 100644 index 0000000..bd6cf5a --- /dev/null +++ b/Combat/Armor Class.md @@ -0,0 +1,12 @@ +Old Armor Class is no longer used to determine hit chance. Instead: +- **1 AC = 1% damage reduction** (rounded down). +- AC is split into: + - **Physical AC** + - Blunt, Slash, Pierce + - **Elemental AC** + - Fire, Ice, Lightning, Force, Necrotic, Gas, Holy, B + +Example: +If a target has **20 Slash AC**, incoming slash damage is reduced by **20%**. + +Damage is reduced **after** all other modifiers (crits, posture effects, etc.). \ No newline at end of file diff --git a/Combat/Combat.md b/Combat/Combat.md new file mode 100644 index 0000000..9ce69ec --- /dev/null +++ b/Combat/Combat.md @@ -0,0 +1,10 @@ +[[HP and Death]] +[[XP and Levels]] +[[Parrying & Posture]] +[[Riposte]] +[[Sanity & Insanity]] +[[Traits]] +[[Combat/Mantras]] +[[Damage]] +[[Weapons]] +[[Armor Class]] \ No newline at end of file diff --git a/Combat/Damage.md b/Combat/Damage.md new file mode 100644 index 0000000..cc6a1ed --- /dev/null +++ b/Combat/Damage.md @@ -0,0 +1,83 @@ +Damage represents harm dealt to a creature’s body, equipment, or supernatural form. This system separates **health damage**, **posture damage**, and **damage mitigation** to clearly distinguish lethality, pressure, and defense. + +Unless explicitly stated otherwise, all creatures, including players, humanoids, monsters and bosses, follow the same damage rules. + +--- + +## Damage Types + +Damage is always assigned a **type**, which determines how it interacts with armor, resistances, and effects. + +### Physical Damage +- **Blunt** (hammers, fists, shockwaves) +- **Slash** (blades, claws) +- **Pierce** (thrusts, projectiles) +### Elemental Damage +- **Fire** +- **Ice** +- **Lightning** +- **Gale** +- **Shadow** +- **Iron** +Some attacks may deal **multiple damage types**. Each type is resolved separately. + +--- +## Dealing Damage +When an attack successfully resolves (i.e., it is not parried or dodged): +1. **Determine Base Damage** + - Roll the weapon’s or effect’s damage dice. + - Apply relevant modifiers (ability modifier, proficiency bonuses, talents, mantras, etc.). +2. **Apply Critical or Conditional Modifiers** + - Critical hits, posture-based bonuses, talents, or special effects apply here. + - These always modify damage **before** mitigation. +3. **Apply Armor Reduction** + - Damage is reduced by the target’s applicable Armor Class (see below). +4. **Apply Remaining Damage** + - Any remaining damage is dealt to HP. + - Additional effects (Bleed, Burning, Shock, etc.) are then applied. + +--- +## Penetration + +Some attacks or weapons have **Penetration**, allowing them to ignore armor. +- Penetration reduces the target’s relevant AC before damage reduction is calculated. +- Penetration cannot reduce AC below 0. +- Penetration does **not** affect posture damage. + +Example: +A weapon with **3 Penetration** ignores 3 points (3%) of all AC. + +**Total penetration from all effects cannot exceed 50%.** + +--- +## Posture Damage + +Some attacks deal **Posture damage** in addition to or instead of HP damage. +- Posture damage represents pressure, imbalance, and guard-breaking force. +- Posture damage is typically derived from: + - Weapon **Weight** + - Talents, mantras, or special effects +- Posture damage is **not reduced by armor** unless explicitly stated. +Blocking converts HP damage into posture damage, as described in the _Parrying & Posture_ rules. + +--- +## Chip Damage + +Some attacks and weapons deal **Chip Damage**, allowing a portion of their damage to bypass blocking defenses. + +* Chip Damage represents force, heat, shock, or precision that cannot be fully negated even when bracing +* Chip Damage is expressed as a **percentage value**. This value determines how much of an attack’s HP damage passes through a block. +* Chip Damage is calculated **after Penetration** +* Armor reduction applies normally to Chip Damage +* Penetration affects Chip Damage the same way it affects normal damage + +Example: +A weapon with **15 Chip Damage** causes **15% of its final HP damage** to be dealt even if the attack is blocked. + +--- +## Multiple Damage Instances + +If an attack deals damage multiple times: +- Each instance is resolved separately +- Armor reduction applies to each instance individually +- Posture damage is applied per hit, not per attack \ No newline at end of file diff --git a/Combat/HP and Death.md b/Combat/HP and Death.md new file mode 100644 index 0000000..aee3984 --- /dev/null +++ b/Combat/HP and Death.md @@ -0,0 +1,46 @@ +Health represents a creature’s physical resilience and ability to continue fighting. Unless explicitly stated otherwise, all creatures (players, humanoids, monsters, and bosses) follow these rules. + +--- +## Starting Health +At character creation, your **Starting Health** is determined by their character. + +--- +## Health Gain on Level Up +When you gain a level: +- Your **HP is fully restored** +- You gain additional maximum Health based on your Character + Fortitude Modifier + +--- +## Incapacitation (0 Health) +When a creature is reduced to **0 Health**, it becomes **Incapacitated** instead of dying immediately. +**While Incapacitated:** +- You are unconscious and unable to act +- You remain incapacitated for **3 rounds** +- Being hit while incapacitated **resets the timer** +- Any creature may use an action to **Execute** you to kill you outright. + - Executing takes one turn to complete and can be interupted by dealing damage to the executioner. + - After stating the execution, the turn of the executioner ends. + - Executing is finished as soon as their next turn begins. + - The recovery timer is paused whilst being executed. + +After the 3-round duration ends: +- You stand back up with **1 HP** +- You may act normally on your turn + +--- +## Carrying an Incapacitated Creature +- An incapacitated creature (medium size or less) may be picked up and carried as a bonus action +- Picking someone up slows you by 50% +- Can't dodge while carrying +- Disadvantage on parrying when wielding Weapons that require two-handing. +- If the carrier is hit, the incapacitated creature is **immediately dropped** +- Recovery timer is paused while being carried + +--- + +## Environmental Death +Some conditions bypass the incapacitation grace period. +If an incapacitated creature: +- **Is burning** +- **Is submerged in water** +They die after **2 rounds** if not picked up or removed from the hazard. \ No newline at end of file diff --git a/Combat/Heavy Weapons.md b/Combat/Heavy Weapons.md new file mode 100644 index 0000000..2406074 --- /dev/null +++ b/Combat/Heavy Weapons.md @@ -0,0 +1,21 @@ +**Examples:** Greatswords, Greataxes, Greathammers +Heavy weapons focus on overwhelming force, posture destruction, and decisive blows. +### Benefits +- **High Weapon Weight** + - Deals massive Posture damage +- **Bonus Posture Damage on Block** + - Blocking Heavy weapons increases Posture damage taken by +1 +- **High Penetration** + - Typically 15–20 Penetration +- **Guard Break Pressure** + - Heavy weapons excel at staggering enemies + +### Drawbacks +- **–1 Dodge Reaction per round (minimum 0)** +- **–1 to Dodge Throws** +- **High Commitment** + - Missing an attack imposes disadvantage on your next Dodge or Parry +- **No Chip Damage by default** + - Heavy weapons rely on posture, not attrition +- **High Posture Cost on Block** + - Blocking while using a Heavy weapon causes +1 Posture loss \ No newline at end of file diff --git a/Combat/Light Weapons.md b/Combat/Light Weapons.md new file mode 100644 index 0000000..8b925a4 --- /dev/null +++ b/Combat/Light Weapons.md @@ -0,0 +1,15 @@ +**Examples:** Daggers, Rapiers, Fists, Handguns +Light weapons favor speed, precision, and pressure through repeated actions rather than raw force. + +### Benefits +- **+1 Dodge Reaction per round** +- **+1 to Dodge Throws** +- **Lower Posture Loss when Blocking** (–1 Posture damage, minimum 1) +- **Higher access to Chip Damage** + - Most Light weapons have **5–15% Chip Damage** +- **Fast recovery**: Missing an attack does not impose penalties unless stated +### Drawbacks +- **Low Weapon Weight** + - Deals reduced Posture damage +- **Lower Penetration** + - Typically 0–5 Penetration \ No newline at end of file diff --git a/Combat/Mantras.md b/Combat/Mantras.md new file mode 100644 index 0000000..224009f --- /dev/null +++ b/Combat/Mantras.md @@ -0,0 +1,34 @@ +**Mantras** are active abilities unique to this campaign. Considered the root of Ether’s usage and sometimes referred to as _Words of the Song_, Mantras are the primary way characters channel supernatural power. + +--- +## What Is a Mantra? +A Mantra is an **active ability** that a character can intentionally use during play. +- Mantras are **not spells** unless explicitly stated. +- Each Mantra defines: + - How it is activated (Action, Bonus Action, Reaction, etc.) + - Its effects + - Any costs, cooldowns, or conditions +- Mantras obey normal D&D action economy rules unless specified otherwise. +Mantras are always gained through **Level-Up Cards** or specific narrative rewards. + +--- + +## Obtaining Mantras +Mantras are primarily obtained by **selecting Mantra cards when leveling up**. Once learned, a Mantra becomes a permanent part of your character unless replaced or removed by a specific effect. + +--- + +## Mantra Slots & Loadout +By default, a character can **equip up to six Mantras at once**. +You may know more Mantras than you can equip, but only equipped Mantras can be used. +### Mantra Slot Types +- **Combat Mantras (3)** + Offensive or combat-focused abilities used to deal damage, apply pressure, or control enemies. +- **Support Mantra (1)** + Utility-focused abilities such as healing, buffs, crafting effects, or special interactions. +- **Mobility Mantra (1)** + Abilities that enhance movement, positioning, traversal, or evasion. +- **Wildcard Mantra (1)** + Can hold **any** Mantra type (Combat, Support, or Mobility). + +Unlike spell slots in D&D, these aren't expended after using the mantra, instead the mantra is put on a cooldown. \ No newline at end of file diff --git a/Combat/Medium Weapons.md b/Combat/Medium Weapons.md new file mode 100644 index 0000000..8890cfc --- /dev/null +++ b/Combat/Medium Weapons.md @@ -0,0 +1,18 @@ +**Examples:** Swords, Spears, Clubs, Rifles, Twinblades +Medium weapons are the **baseline** and most versatile category, balancing offense, defense, and pressure. + +### Benefits +- **No inherent penalties** +- **Balanced Weapon Weight** + - Reliable Posture damage +- **Moderate Penetration** + - Typically 5–10 Penetration +- **Flexible Mantra Compatibility** + - Most mantras are balanced around Medium weapons + +### Drawbacks +- **No specialization bonuses** +- **Limited Chip Damage** + - Usually 0–5% +- **Average Mobility** + - No dodge or movement bonuses \ No newline at end of file diff --git a/Combat/Parrying & Posture.md b/Combat/Parrying & Posture.md new file mode 100644 index 0000000..b1e1d47 --- /dev/null +++ b/Combat/Parrying & Posture.md @@ -0,0 +1,54 @@ +Posture represents balance, readiness, and combat momentum. +- All creatures start with **10 Posture** unless otherwise stated. +- While you have **at least 1 Posture**, you may **Parry or Dodge** attacks. +- If your Posture is reduced to **0**, you are **Staggered** until the start of your next turn. +- If you are Staggered due to an attack reducing your posture, additionally take the full damage of that attack. + +When an attack would hit you and you have Posture remaining, you may spend **1 Reaction** to choose **Parry** or **Dodge**. +> All humanoid enemies, including bosses, follow these same rules unless explicitly stated otherwise. +### **Parry +You meet force with force, attempting to redirect or overpower the attack. +**Trigger:** You are targeted by a parryable attack. +**Cost:** 1 Reaction +**Parry Check** +- Roll your Parry Throw against the attacker’s Attack Throw. +- If the attack hits multiple times, make multiple Parry Throws against the attacker's Attack Throw for each hit. +#### **Success** +- You take **no damage**. +- You lose **1 Posture**. +- You may immediately make **one Melee Attack Action** against the attacker. +- This counterattack cannot be parried, but may still be dodged or mitigated by armor and effects. +#### **Failure (Soft Fail)** +- You do **not** take damage from this attack. +- Instead, you are forced into a **Block** against the **next attack** before your next turn. +--- +### **Block +Blocking represents bracing yourself after a failed parry. +- Blocking is **automatic** and cannot be chosen voluntarily. +- You take **no HP damage**, but suffer **Posture damage**. +**Posture Damage While Blocking** +- Posture loss = **Weapon Weight × Number of Damage Dice** of the attack. +- If this reduces your Posture to 0, you are immediately [[Staggered]]. +>Blocking cannot trigger counterattacks or effects tied to successful parries. + +--- +### Dodge +You evade instead of contesting force. +**Trigger:** You are targeted by an attack. +**Cost:** 1 Reaction +**Dodge Check** +- Roll your Dodge Throw against the attacker’s Attack Throw. +#### **Success** +- You take **no damage**. +- Move **3 meters** in any direction. +- Immediately remove **Burning** or **Chill** conditions. +- This movement does not provoke reactions. +#### **Failure** +- You take the attack normally. +- Dodge does **not** reduce posture on failure. + +### Posture Damage +* If a humanoid is hit by a normal weapon attack: + * They take the weapons (Weight / 2) as Posture Damage +* If a monster (larger or taller) is hit by a normal weapon attack: + * They take the full weapon weight as Posture Damage. \ No newline at end of file diff --git a/Combat/Riposte.md b/Combat/Riposte.md new file mode 100644 index 0000000..f32cb8c --- /dev/null +++ b/Combat/Riposte.md @@ -0,0 +1 @@ +When an enemy is stance-broken, they enter a 'staggered' state for 1 round. Anyone can use an action to perform a 'riposte', using the weapons riposte modifier on top of the original scaled damage. \ No newline at end of file diff --git a/Combat/Sanity & Insanity.md b/Combat/Sanity & Insanity.md new file mode 100644 index 0000000..e099814 --- /dev/null +++ b/Combat/Sanity & Insanity.md @@ -0,0 +1,11 @@ +At level 1, you have (8 + Willpower Modifier) Stacks of Sanity. Every level up you gain (1 + Willpower Modifier) Sanity. You can't lose sanity and it can't go below 8. You always gain at least 1 sanity. + +Insanity has 4 Stages:  +- 100% Sanity: Everything is normal  +- 66% Sanity: You start shivering every few rounds, making you lose concentration and slowing you by 3 meters movement speed for 1 round.  +- 33% Sanity: You start scratching yourself every round, causing you to take 1d8 slash damage.  +- 0% Sanity: You can no longer recognize allies or enemies by their face. Every 5 rounds, you scoop at your eyes, taking 3d10 slashing damage as well as being stunned for one round.   + +You lose Sanity by being in the depths. There are other sources of Sanity loss, but the depths are the main one. + +Sanity can be restored by resting, certain talents or [[Combat/Mantras]] and being in safe places. \ No newline at end of file diff --git a/Combat/Traits.md b/Combat/Traits.md new file mode 100644 index 0000000..a963a5c --- /dev/null +++ b/Combat/Traits.md @@ -0,0 +1,9 @@ +Traits: On level-ups 1, 2, 4, 6, 8, 9, 10, 12, 14, 16, 18, 19, you gain one mastery point. + +Mastery Points can be invested into the following trait and only up to 6 times per trait. +*(So, in conclusion, 2 traits can be maxed out)  + +- Vitality: You gain 10 HP  +- Erudition: Max Ether increases by 3 and max Posture by 0.5. Also increases Posture regain by 0.25 per point.  +- Proficiency: Weapon Attack and Parry Proficiency increases by 1 every point. Weapons gain 3 AC Penetration per point.  +- Songchant: Weapon Attack and Parry Proficiency increases by 1.5 every point. [[Combat/Mantras]] gain 5 AC Penetration per point. \ No newline at end of file diff --git a/Combat/Weapons.md b/Combat/Weapons.md new file mode 100644 index 0000000..3b6f0df --- /dev/null +++ b/Combat/Weapons.md @@ -0,0 +1,8 @@ +Weapons are divided into three primary categories: **Light**, **Medium**, and **Heavy**. +Each category defines how a weapon interacts with **damage**, **posture**, **parrying**, **dodging**, **blocking** and **chip damage**. + +Weapon choice determines **combat philosophy**, not just numbers. + +[[Light Weapons]] +[[Medium Weapons]] +[[Heavy Weapons]] diff --git a/Combat/XP and Levels.md b/Combat/XP and Levels.md new file mode 100644 index 0000000..4f78b4c --- /dev/null +++ b/Combat/XP and Levels.md @@ -0,0 +1,85 @@ +This campaign uses a hybrid progression system combining **standard D&D leveling** with **identity-based card advancement**. + +Characters grow in two parallel ways: +- **Level-based progression** (HP, class features, proficiency bonus) +- **Identity-based card progression** (Talents & Mantras) + +Cards define how a character expresses their identity. Levels define their overall power scale. + +--- +# Experience & Leveling (Standard D&D) +- Characters gain **XP from encounters and story progression**, following normal D&D XP thresholds. + +- When a character gains a **level**: + - Their **hit points are fully restored** + - Any normal D&D level-based features apply + +Unless explicitly stated otherwise, all XP thresholds and leveling pace follow standard D&D conventions. + +--- + +# Proficiency Bonus +- Characters use the **standard D&D Proficiency Bonus**, based solely on **character level**. + +- Proficiency Bonus: + - Applies to attacks, saves, skills, and features exactly as described in D&D. + - Is **never influenced by ability scores**. + +Ability scores and cards may modify _how_ proficiency is applied, but never its base value. + +--- + +# Level-Up Cards (Core Identity Progression) + +Every character has a **personal card pool** tied to their identity: +- Build concept +- Weapons +- Oath +- Background +- Mantras +- Faction +- Unique traits + +No two characters share the same pool, even if they have similar classes. + +--- + +## Card Gain Per Level +Each time you gain a level, you gain: +- **1–2 Talent Cards** +- **1 Mantra Card every other level** + +The progression alternates: +- **Level A:** + - 1 Talent + - 1 Mantra +- **Level B:** + - 2 Talents + +This pattern repeats for the entire campaign. Cards gained are added permanently to your **Resonance Library**. + +--- + +# Talent Loadout System +Unlike traditional passive stacking systems, not all Talent Cards are active at once. You may **equip a limited number of Talent Cards** from your library. +- Unequipped Talents remain known but inactive. +- You may change equipped Talents during a **Long Rest** or in a designated safe location. +- Talents cannot be swapped during combat. + +--- + +## Talent Slot Progression +Characters begin with: +- **4 Talent Slots** + +Talent slot capacity increases as the character grows: + +| Character Level | Equipped Talent Slots | +| --------------- | --------------------- | +| 1–3 | 4 | +| 4–6 | 6 | +| 7–10 | 8 | +| 11–15 | 9 | +| 16+ | 10 | + +The total number of known Talents will exceed equipped slots. Build expression comes from selecting which Talents are active. \ No newline at end of file diff --git a/Core.md b/Core.md new file mode 100644 index 0000000..47b4c73 --- /dev/null +++ b/Core.md @@ -0,0 +1,8 @@ +[[Resonances]] +[[Oaths]] +[[Combat]] +[[Effects]] +[[Races]] +[[Factions]] +[[Lumen]] +[[Player Characters]] diff --git a/Effects/Bleed.md b/Effects/Bleed.md new file mode 100644 index 0000000..ae58848 --- /dev/null +++ b/Effects/Bleed.md @@ -0,0 +1,24 @@ +A creature afflicted with **Bleed** is suffering from deep, worsening wounds that build toward catastrophic blood loss. + +Certain attacks/weapons apply a certain amount of **Bleed Buildup**. +- Bleed Buildup is tracked as a numeric value. +- By default, all creatures have a **Bleed Threshold equal to 25% of their Maximum HP** (rounded down). +- When Bleed Buildup reaches or exceeds this threshold, **Bleed triggers**. +Bleed Buildup has **no effect** until the threshold is reached. + +**When Bleed triggers:** +- The creature immediately takes **15% of their Maximum HP** as **true damage** + - This damage **ignores armor, resistances, and damage reduction** +- All Bleed Buildup on the creature is **reset to 0** + +After Bleed triggers, the creature gains **Bleed-Exhausted** for **2 rounds**. + +**While Bleed-Exhausted:** +- The creature **cannot gain Bleed Buildup** +- Any effects that would apply Bleed Buildup during this time are ignored +This prevents immediate re-triggering. + +If a creature does not gain Bleed Buildup for **1 full round**: +- Bleed Buildup is reduced by **20% of the Bleed Threshold** at the end of that round +Bleed Buildup can never drop below 0. + diff --git a/Effects/Blindness.md b/Effects/Blindness.md new file mode 100644 index 0000000..f1ee546 --- /dev/null +++ b/Effects/Blindness.md @@ -0,0 +1,8 @@ +Blindness robs the target of visual perception. +**While Blinded:** +- The creature is **unable to see**. +- Attack rolls made by the creature are at **disadvantage**. +- Attack rolls against the creature are at **advantage**. +- The creature automatically fails any ability check requiring sight. +- Blindness does not prevent Parrying, but Parry checks are made at **disadvantage**. +- Blindness lasts for **2 rounds**, unless otherwise specified. \ No newline at end of file diff --git a/Effects/Burning.md b/Effects/Burning.md new file mode 100644 index 0000000..9994c17 --- /dev/null +++ b/Effects/Burning.md @@ -0,0 +1,10 @@ +A creature afflicted with Burning is engulfed in persistent elemental flames. +**While Burning:** +- The creature takes **1d4 fire damage** at the start of each of its turns. +- Burning lasts for **3 rounds** unless removed early. +- Reapplying Burning **refreshes the duration**, but does not stack damage. +- Burning may be removed early by: + - Entering water + - Being affected by [[Chill]] + - Using an action to extinguish the flames + - Dodging \ No newline at end of file diff --git a/Effects/Chill.md b/Effects/Chill.md new file mode 100644 index 0000000..efc8172 --- /dev/null +++ b/Effects/Chill.md @@ -0,0 +1,8 @@ +Chill numbs the body with freezing ether, slowing movement and reactions. +**While Chilled:** +- Movement speed is reduced by **25%**. +- The creature has **disadvantage on Dexterity saving throws**. +- The creature’s jump distance is halved. +- Chill lasts for **2 rounds**. +- If a Chilled creature is afflicted by Chill again, it becomes [[Frozen]] instead. +- Chill immediately ends [[Burning]]. \ No newline at end of file diff --git a/Effects/Effects.md b/Effects/Effects.md new file mode 100644 index 0000000..de7d2ba --- /dev/null +++ b/Effects/Effects.md @@ -0,0 +1,13 @@ + [[Staggered]] + [[Burning]] + [[Chill]] + [[Frozen]] + [[Sapped]] + [[Shock]] + [[Winded]] + [[Suffocate]] + [[Blindness]] + [[Metal Rods]] +[[Bleed]] + + \ No newline at end of file diff --git a/Effects/Frozen.md b/Effects/Frozen.md new file mode 100644 index 0000000..efa1fb3 --- /dev/null +++ b/Effects/Frozen.md @@ -0,0 +1,12 @@ +Your body is completely encased in solid ice, immobilized and helpless. +**While Frozen:** +- You are **incapacitated**. +- You **cannot move, attack, cast [[Combat/Mantras]], Parry, or Dodge**. +- Attacks against you are made with **advantage**. +- You automatically **fail Strength and Dexterity saving throws**. +- You gain **resistance to all damage** while encased in ice. +- Frozen lasts for **1 round** unless otherwise specified. +- At the **end of your turn**, you may attempt to break free by making a **Strength saving throw**. +- On a success, Frozen ends immediately. +- Taking **fire damage** while Frozen immediately ends the effect after the damage is resolved. +- If Frozen ends early due to damage or escape, the creature is **Chilled** until the end of its next turn. \ No newline at end of file diff --git a/Effects/Metal Rods.md b/Effects/Metal Rods.md new file mode 100644 index 0000000..10567e0 --- /dev/null +++ b/Effects/Metal Rods.md @@ -0,0 +1,4 @@ +Metal Rods are metallic spikes forcibly embedded into a creature’s body, inflicted by **Ironsing [[Combat/Mantras]]** and **Ignition Deepcrusher** basic attacks. + +**While afflicted with Metal Rods:** +- Metal Rods have **no innate effect** until activated. \ No newline at end of file diff --git a/Effects/Sapped.md b/Effects/Sapped.md new file mode 100644 index 0000000..f5e827c --- /dev/null +++ b/Effects/Sapped.md @@ -0,0 +1,10 @@ +Your ether flow is forcibly destabilized, leaving your reserves sluggish and primed for violent discharge. +**While Sapped:** +- Your **Mantra cooldowns are increased by 50%**. +- You may still cast [[Combat/Mantras]]. +- Sapped lasts for **2 rounds**, unless otherwise specified. +- When Sapped **ends**, the creature is immediately [[Shock|Shocked]]. +- The Shock applied when Sapped ends: + - Follows all normal **Shock** rules. + - Occurs even if the creature is immune to lightning damage. +- Sapped does **not stack**; reapplication refreshes duration. \ No newline at end of file diff --git a/Effects/Shock.md b/Effects/Shock.md new file mode 100644 index 0000000..b26ab75 --- /dev/null +++ b/Effects/Shock.md @@ -0,0 +1,11 @@ +Shock disrupts the nervous system with violent electrical discharge. +**When Shock is applied:** +- The creature is **stunned until the end of the current turn** (≈ 1 second). + - This stun **interrupts hyperarmor and ongoing actions**, but: + * Does not prevent Parrying + - Does not prevent Reactions +- Passive posture regeneration is disabled until the end of the creature’s next turn. + +**While Shocked:** +- Movement speed is reduced by **25%** until the end of the creature’s next turn. +- Shock does **not** stack; reapplication refreshes duration. \ No newline at end of file diff --git a/Effects/Staggered.md b/Effects/Staggered.md new file mode 100644 index 0000000..3d15507 --- /dev/null +++ b/Effects/Staggered.md @@ -0,0 +1,10 @@ +While Staggered: +- You cannot Parry or Dodge. +- Attacks against you automatically **crit**. +- You regain **all Posture** at the end of the staggered round. + +While a creature is Staggered, **anyone** may use an action to perform a **Critical**. +A Critical: + - Deals normal scaled damage + - Adds the weapon’s **Critical Modifier** + - Ignores blocking and parrying \ No newline at end of file diff --git a/Effects/Suffocate.md b/Effects/Suffocate.md new file mode 100644 index 0000000..08bae03 --- /dev/null +++ b/Effects/Suffocate.md @@ -0,0 +1,6 @@ +Suffocation deprives the body of ether flow and breathable air. +**While Suffocated:** +- The creature **cannot cast [[Combat/Mantras]] or spells**. +- The creature takes **1 damage at the start of each of its turns**. +- Suffocate lasts for **2 rounds**, unless otherwise specified. +- Suffocate does not prevent attacking, dodging, or parrying. \ No newline at end of file diff --git a/Effects/Winded.md b/Effects/Winded.md new file mode 100644 index 0000000..0d2d468 --- /dev/null +++ b/Effects/Winded.md @@ -0,0 +1,7 @@ +Your breath is violently forced from your lungs, disrupting balance, timing, and momentum. +**While Winded:** +- Your **Initiative is reduced by 1** (to a minimum of 0). +- Your parry and attack throws suffer a penalty of -1. +- Winded does **not** prevent attacking, parrying, dodging, or casting [[Combat/Mantras]]. +- Winded lasts for **2 rounds**, unless otherwise specified. +- Reapplying Winded **refreshes the duration**, but does not stack its penalties unless explicitly stated by a feature. \ No newline at end of file diff --git a/Factions/Factions.md b/Factions/Factions.md new file mode 100644 index 0000000..c54f06b --- /dev/null +++ b/Factions/Factions.md @@ -0,0 +1,10 @@ +[[The Ministry]] +[[The Ignition Union]] +[[The Summer Company]] +[[The Knives of Eylis]] +[[The Hundred Legions]] +[[The Central Authority]] +[[The Children of Navae]] +[[The Kingdom of Etrea]] +[[The Divers]] +[[The Hive]] diff --git a/Factions/The Central Authority.md b/Factions/The Central Authority.md new file mode 100644 index 0000000..eab4bdb --- /dev/null +++ b/Factions/The Central Authority.md @@ -0,0 +1,11 @@ +The Central Authority is a vast imperial power that governs through strict law, military force, and an entrenched bureaucracy. Its soldiers are recognized by their crimson coats, a symbol meant to represent unity and order across the Luminants. The state is ruled by **Drallis Ehr**, the Grand Sovereign, a distant and carefully managed public figure credited with holding the empire together. Beneath him, the Authority is enforced through a rigid hierarchy of Wardens, Inquisitors, and Shock Corps officers, each tasked with preventing unrest before it can spread. + +The Authority’s influence stretches across much of the known world, from Fort Merit in the East to the plains of Markor. Its military draws heavily from [[Adret]] ranks and is structured around clear divisions of status and privilege. Lower-ranking soldiers are typically trained in basic Flamecharm, while elite units make use of Thundercall interrogation methods and Frostdraw commanders. Rank within the Authority is more than a battlefield distinction, it determines legal protection, access to resources, and political safety. + +Among the Authority’s most visible commanders in the East is **Warden Jericho**, a high-ranking officer publicly associated with the war effort against Etrea. To citizens and soldiers alike, figures like Jericho represent the Authority’s belief that peace must be enforced decisively, even at great cost. + +Rather than relying solely on its own forces, the Authority contracts outside groups to handle dangerous or deniable operations. These include [[The Ignition Union]], [[The Summer Company]], [[The Divers]] and [[The Knives of Eylis]]. These relationships are transactional, not loyal. The Authority funds them, allows rivalry between them, and intervenes only when its own interests are directly threatened. + +Publicly, the Authority claims its ultimate goal is to unite the Luminants against existential threats such as the Tides. In practice, stability is maintained through surveillance and intimidation. Inquisitors silence dissent, Shock Corps suppress unrest, and when probslems cannot be addressed openly, the Knives are quietly deployed. + +The Authority’s ongoing war with [[The Kingdom of Etrea]] and [[The Ministry]] has grown beyond a simple territorial conflict. What began as a political struggle is now framed by the Authority as a fight for survival, a justification increasingly used to defend harsher policies. \ No newline at end of file diff --git a/Factions/The Children of Navae.md b/Factions/The Children of Navae.md new file mode 100644 index 0000000..39c7bd2 --- /dev/null +++ b/Factions/The Children of Navae.md @@ -0,0 +1,5 @@ +The Children of Navae are a nomadic people who live in cold, remote regions far from most settlements. They are quiet, spiritual, and deeply connected to Frostdraw. The tribe worships Navae, a goddess associated with ice and shadow, whom they believe protects those who endure hardship in silence. Most Children of Navae are [[Gremor]]s, though outsiders are not unheard of. Their culture revolves around rituals, oral tradition, and strict respect for their beliefs. + +Much of their early history is unclear, passed down through stories rather than written records. What _is_ known is that they created **The Way of Navae**, a unique martial art that blends frost, shadow, and unarmed combat into fluid, deliberate movements. The tribe has always wandered, following old routes through frozen lands. Recently, however, a group has settled on Meteor Isle. This decision has caused tension within the tribe, as many see permanent settlement as a rejection of their traditional way of life. + +The Children of Navae avoid politics whenever possible, but the world has not left them alone. [[The Ministry]], [[The Knives of Eylis]], and [[The Central Authority]] all treat them as enemies. The Children themselves do not understand this hostility, viewing their attackers as ignorant outsiders who refuse to respect Navae’s path. On Meteor Isle, they have begun cooperating with [[The Hive]], hoping the jungle and its people will offer protection against forces that would see them wiped out. \ No newline at end of file diff --git a/Factions/The Divers.md b/Factions/The Divers.md new file mode 100644 index 0000000..cef91f5 --- /dev/null +++ b/Factions/The Divers.md @@ -0,0 +1,11 @@ +The Divers are an organization dedicated to exploring and surviving the Depths. They were formed after the Tides, when it became clear that understanding what lay below was necessary for survival. More than any other group, the Divers specialize in navigating hostile environments, documenting what they find, and finding ways to return alive. + +Their main headquarters is the Markor Citadel in the Central Luminant. Active operations are run out of Castle Light, a heavily fortified structure located in the First Layer of the Depths. From there, Diver teams descend into deeper layers, often with little support and no guarantee of return. + +Although funded by [[The Central Authority]], the Divers operate with a high degree of independence. Their relationship with the Authority is tense and transactional. Other factions often dismiss them as loyalists or expendable assets, but the Divers largely ignore political disputes. Their focus is survival, knowledge, and preparation for what may come next. + +Joining the Divers is extremely dangerous. The majority of recruits do not survive long enough to complete training. Those who do must pass the Citadel Trials, which are designed to test physical endurance, mental resilience, and the ability to function under constant pressure. Advancement within the organization is earned through survival, progressing from Apprentice to Journeyman and, in rare cases, to Black Diver. + +Black Divers are the organization’s most capable operatives. Some are renowned for their skill, others for their insight, and many for their ability to endure conditions that break most people. Figures such as Chaser, Klaris, and Carrion are well known, though far more Divers die without recognition. A small number manage to retire, including Sophodon Surad, who survived decades of exposure to the Depths before stepping away from active duty. + +Divers rely on a mix of technology and dangerous magic. They make use of attunements like Ironsing and Flamecharm, adapted monster abilities, and mechanical systems such as elevators to move between layers. In some cases, young initiates are trained early, a practice that has drawn criticism but continues due to necessity. \ No newline at end of file diff --git a/Factions/The Hive.md b/Factions/The Hive.md new file mode 100644 index 0000000..226ea0a --- /dev/null +++ b/Factions/The Hive.md @@ -0,0 +1,11 @@ +The Hive is a collection of highly advanced societies organized around enormous living structures known as Greathives. These Greathives function as cities, laboratories, and command centers all at once. Greathive Aratel is the most familiar example to outsiders. While considered unremarkable by Hive standards, it still surpasses most nations in technology, coordination, and long-term planning. + +Hive society is overseen by Hivelords, who in turn answer to the Greatlord whose roles and intentions are not fully understood. The population consists mainly of Vesperians and Ganymedes, with a smaller number of Chrysids. Chrysids once played a central spiritual role within the Hive, but many left to follow the Moonlit Faith. Those who stayed did so out of commitment to the Hive’s goals rather than belief. + +The Hive does not worship gods or rulers. Its loyalty is to structure, efficiency, and growth. Central to this is the **Song**, a force they manipulate through Lifeweave. Lifeweave allows trained individuals to alter and redistribute living essence, blurring the line between biological science and magic. This capability underpins much of the Hive’s power and influence. + +For a long time, the Hive maintained strict control over Ironsing, eliminating anyone who attempted to spread its use outside their domain. That monopoly was broken by Adar, Master of Metal, whose actions allowed Ironsing to reach the wider world. The loss of that control remains a point of resentment within Hive leadership, though any response has been careful and calculated. + +Hive society functions with extreme specialization. Drones handle labor and maintenance, Adjudicators resolve internal balance and disputes, and Tacticians coordinate warfare and large-scale operations. Their massive Hive Constructs, while outdated in Aratel, are still effective tools for defense and intimidation. + +Currently, the Hive is engaged in a quiet conflict with [[The Kingdom of Etrea]], driven by the Lord Regent’s interest in Lifeweave artifacts. Greathive territory contains numerous green-lit structures and relics believed to be fragments of the Forge, which sustain the Hive’s core systems. Tensions with [[The Central Authority]] are also rising, with clashes becoming more frequent despite the lack of an official war declaration. At the same time, the Hive has begun reaching out to [[The Children of Navae]]. This move is not based on shared belief, but on strategic compatibility. \ No newline at end of file diff --git a/Factions/The Hundred Legions.md b/Factions/The Hundred Legions.md new file mode 100644 index 0000000..a5b38db --- /dev/null +++ b/Factions/The Hundred Legions.md @@ -0,0 +1,7 @@ +The Hundred Legions are a massive military force originating from the West Luminant, made up of one hundred individual legions trained under the same rigid doctrine. Only the **11th Scouting Legion** currently operates in the East. Once allies of [[The Central Authority]], the Legions severed that relationship after an unknown breakdown in trust. Since then, they have acted independently, following their own codes rather than any external command. + +Legionnaires wear bronze armor inspired by ancient western empires, designed for both discipline and intimidation. Most of their ranks are made up of Khans, warriors marked by ceremonial crowns that signify rank, heritage, and earned authority. These crowns are not decorative; they are symbols of status, worn only by those who have proven themselves in service and combat. + +The Hundred Legions are known for their strict training and emphasis on martial skill. They developed **Legion Kata**, a close-combat fighting style focused on control, precision, and overwhelming pressure. Access to this technique is limited and must be earned through recognition by Centurions. The Legions rarely involve themselves directly in foreign wars, preferring to observe, evaluate, and intervene only when it serves their long-term interests. + +Respect within the Legions is everything. Those who earn it are treated as equals, regardless of origin. Those who lose it are dismissed entirely, their word and presence carrying no weight. The Hundred Legions do not seek conquest or territory, they exist to be ready. When they move as one, it is because a decision has already been made. \ No newline at end of file diff --git a/Factions/The Ignition Union.md b/Factions/The Ignition Union.md new file mode 100644 index 0000000..3a51ec7 --- /dev/null +++ b/Factions/The Ignition Union.md @@ -0,0 +1,7 @@ +The Ignition Union began as a mining collective working in some of the most dangerous regions of the Luminants, including the tunnels beneath Summer Isle, the ruins of Celtor, and the Frontier Furnace. Over time, constant exposure to the Depths forced them to become something more than laborers. Today, the Union operates as a heavily armed industrial force, equipped to mine, fight, and survive in places where most factions refuse to go. + +Union members are trained in Flamecharm, Thundercall, and the rare attunement known as Ironsing. Their weapons are built for durability and raw force rather than elegance. Originally hired to extract resources, they gradually took on the role of Depth-hunters, clearing monsters and securing territory through sheer numbers and coordination. The Central Authority funds much of their work, using the Union as a blunt instrument to deal with threats it does not want to face directly. + +The Union presents itself as a workers’ movement built on unity and shared struggle, but reality is more complicated. Their conflict with [[The Summer Company]] has escalated into open violence, and their treatment of [[The Divers]] often contradicts their stated ideals. They are openly hostile toward [[The Ministry]], seeing them not just as enemies, but as a fundamental threat to the world. Internal writings and speeches emphasize collective strength and sacrifice, though those principles are not always applied evenly. + +The Ignition Union has pushed deeper into the Depths than most groups, establishing outposts in the Second Layer ahead of rival factions. Their elite fighters, known as Deepdelvers, are chosen not only for combat skill but for acts of self-sacrifice and loyalty to the group. \ No newline at end of file diff --git a/Factions/The Kingdom of Etrea.md b/Factions/The Kingdom of Etrea.md new file mode 100644 index 0000000..e0e3448 --- /dev/null +++ b/Factions/The Kingdom of Etrea.md @@ -0,0 +1,7 @@ +The Kingdom of Etrea lies within the Etrean Luminant, a windswept region known for its harsh weather and strict borders. Centered around the capital city of Etris and the Isle of Vigils, Etrea is a long-standing monarchy shaped by tradition, discipline, and isolation. Leadership of the kingdom rests with the **Lord Regent**, who governs from Etris and is recognized as the rightful authority of the realm. + +[[Etrean]] soldiers are easily identified by their white, green, or violet armor, curved blades, and use of wind-based [[Combat/Mantras]]. Etrean culture places strong emphasis on discipline, restraint, and loyalty to the state. Training is rigorous, formality is expected in all public life, and hierarchy is strictly enforced. Vigil Swordsmen are trained to fight with precision and composure, while Royal Guards adhere to exact protocol. + +Two figures are widely associated with Etrea’s stability. The first is the **Lord Regent**, who rules from the palace in Etris and is rarely seen in public, delegating authority through trusted officials. His leadership is generally viewed as calm, decisive, and effective. The second is **Maestro Evengarde Rest**, the master of the Vigil Swordsmen on the Isle of Vigils. Known across the Luminants as one of the greatest living swordsmen, Evengarde is a symbol of Etrea’s martial tradition and discipline. + +Etrea is currently engaged in open war with [[The Central Authority]] a conflict that has reinforced the kingdom’s inward focus and strict governance. Within Etrea, life continues under a strong sense of order and control. Records, traditions, and public narratives present the current era as one of continuity rather than change, and most citizens regard the kingdom as stable, if tightly governed. \ No newline at end of file diff --git a/Factions/The Knives of Eylis.md b/Factions/The Knives of Eylis.md new file mode 100644 index 0000000..5d99ff6 --- /dev/null +++ b/Factions/The Knives of Eylis.md @@ -0,0 +1,9 @@ +The Knives of Eylis are a mercenary group that operates out of the Central Luminant’s criminal underworld. They are not a nation, a cult, or a formal army. They work for pay, contracts, or favors, and their loyalty rarely extends beyond the job in front of them. What sets them apart from other killers-for-hire is their devotion to Eylis, a being they call the Punished Dreamer, whom they believe guides their actions from a place known as the Voidheart. + +Their work is usually discovered after the fact. Ships disappear at sea. Supply convoys are found destroyed with no survivors. People vanish without witnesses. In many cases, the only sign left behind is a distinctive curved knife driven into the body of the target. This signature has made the Knives infamous, even among other criminal groups. + +Members of the Knives swear a strange Oath that grants them limited control over time, allowing them to slow their surroundings during combat. This makes them extremely dangerous despite their relatively small numbers. They wear worn, sea-stained armor and carry themselves like experienced hunters rather than soldiers. The group favors careful planning and ambushes, often tracking targets for long periods before striking. + +The Knives are known to work for [[The Central Authority]] in secret, disrupting Etrean movements and capturing members of [[The Children of Navae]] for transport to Fort Merit. Despite this cooperation, they are not truly loyal to the Authority and are treated more as disposable assets than allies. Rumors about their past vary, some claim they were once whalers in an earlier age, others believe their “hunt” has simply grown larger over time. + +Whether they are guided by a higher power or driven by obsession is unclear. What _is_ clear is that encounters with the Knives of Eylis rarely leave witnesses behind. \ No newline at end of file diff --git a/Factions/The Ministry.md b/Factions/The Ministry.md new file mode 100644 index 0000000..bc7bfb9 --- /dev/null +++ b/Factions/The Ministry.md @@ -0,0 +1,7 @@ +The Ministry operates out of hidden places like the frozen ruins of Minityrsa, but it would be a mistake to think of them as a normal faction. They have no borders, no banners, and no standing armies. Instead, they exist as a secretive cult whose influence spreads quietly through individuals, institutions, and fear. Their members move unseen, cloaked in black, using forbidden magic and speaking in coded language meant only for those already ensnared. + +The Ministry believes the world above is flawed and must be brought down into the Depths. They worship drowned gods and see past catastrophes not as tragedies, but as successes. Celtor’s fall is often cited in their teachings as proof that the Overworld can be offered up and remade. To achieve this, they rely on rituals, manipulation, and pacts that grant power at an extreme cost. Contractors are central to their plans, acting as both tools and sacrifices in service of a larger design. Some of these agents have risen to positions of great authority across the Luminants. + +Rather than acting openly, the Ministry works through pressure and corruption. They destabilize regions, turn allies against each other, and let disasters unfold while guiding events from the shadows. Their leadership is said to consist of **Nine Prophets**, beings who wield immense influence and no longer think like ordinary mortals. Ministry operatives include Shadowcasters, blood cultists, and creatures altered beyond recognition. Their presence is often marked by the Krulian Knife, a weapon also found among abyssal entities such as the Ferryman, hinting at how deeply their reach extends. Some claim a Prophet has infiltrated leadership somewhere. + +The Ministry is hostile to nearly every major power, but they do not wage war in the traditional sense. They collapse systems rather than confront them, offering power to the desperate and silence to the curious. Those who serve the Ministry are not celebrated or remembered. When they are no longer useful, they simply vanish, leaving behind no records, no graves, and no one willing to speak their names. \ No newline at end of file diff --git a/Factions/The Summer Company.md b/Factions/The Summer Company.md new file mode 100644 index 0000000..20f4daf --- /dev/null +++ b/Factions/The Summer Company.md @@ -0,0 +1,9 @@ +The Summer Company operates out of Summer Isle, a harsh, sun-baked island where industry matters more than politics. They are a small but highly influential group, best known for inventing firearms in the New World. Revolvers, flintlocks, and early rifles all trace back to their workshops, and most of that progress is credited to Gunsmith Rosen, whose designs still shape modern combat. + +The Company was founded on invention and trade, not expansion. Summer Isle is their only territory, and they have little interest in ruling land or people. Their relationship with the Central Authority is strictly practical. Even after being cheated, exploited, and kept at arm’s length, they continue to supply weapons because it keeps their people fed and their forges running. + +That balance has started to fall apart. [[The Ignition Union]], once another contractor of [[The Central Authority]], openly broke ties and launched a violent raid on Summer Company workers, killing many of them. The Company responded with force, and fighting has since spread across Miner’s Landing. This conflict isn’t about ideology or conquest, it’s about survival and protecting their work. + +Internally, patience is wearing thin. Scope, one of the Company’s senior officers, has made it clear that their cooperation with the Authority has limits. If the contracts stop being worth the cost, the Summer Company will look elsewhere for allies and buyers. + +They are not a nation, and they do not claim moral authority. The Summer Company exists to build weapons, sell them, and stay alive in a world that is quickly learning how dangerous those weapons can be. \ No newline at end of file diff --git a/Notes to self.md b/Notes to self.md new file mode 100644 index 0000000..c2b3ada --- /dev/null +++ b/Notes to self.md @@ -0,0 +1,8 @@ +**Don't give victor more bonus actions** !!! <- Very important (will break game if not kept in check) +Group Factions in major/minor factions +Overhaul resonances +Overhaul oaths +Overhaul Bosses and Campaign +Don't overplan +Don't underplan + diff --git a/Oaths/Arcwarder.md b/Oaths/Arcwarder.md new file mode 100644 index 0000000..ea2f56e --- /dev/null +++ b/Oaths/Arcwarder.md @@ -0,0 +1,47 @@ +Arcwarder is an [[Oaths|Oath]] focusing heavily on defense. Four of its passives are defensive, and the other two are mobility. + +>"You vow to be a shield for your comrades, to wear your regalia with pride and serve the greater collective. From each according to their ability, to each according to their needs." + +The Arc Suit is a defence orientated piece of semi-sentient armour that [[The Ignition Union]] bestows upon their most trusted. It fuses with the soul of those who swear the oath, allowing them to manifest it around them at will. Arcwarders are sworn to become a conduit of protection to their fellow Union mates and do whatever it takes to defend them. Notably, Arcwarders are the only people known to utilize Plasma in their attacks, likely from a result of the Flamecharm and Thundercall being combined within the suit. + +Arc Suit: You manifest your semi-sentient Arc Suit around your body. +- **Type:** Combat Mantra +- **Activation:** Bonus Action +- **Duration:** 4 rounds +- **Cooldown:** 10 rounds +- **Ether Cost:** 4 +- While Active: + - Gain **+10 Physical AC** (Blunt, Slash, Pierce only) + - Gain **+10 Fire & Lightning AC + - Gain **+10 Posture** + - Regain **+1 additional Posture per round** + - Unlock Arc Modules + +Arc Wave: Release a wave of energy around you. +- **Type:** Combat Mantra +- **Activation: Action** +- **Ether:** 5 +- **Cooldown:** 5 rounds + - 3d10 fire and 3d10 lightning damage in a 4.5 meter radius around you. + - If blocked, deals 4 posture damage. + - 10% Penetration + +Arc Beam: Shoot out a laser from your eyes that explodes after a second. +* **Type:** Combat Mantra +* **Activation:** **Action** +* **Ether:** 6 +* **Cooldown:** 4 rounds + * 4d8 fire and 4d8 lightning damage to an enemy within 9 meters. + * If blocked, deals 3 posture damage. + * 15% Penetration + +1. Arc Module: Dash: + - When Arc Suit is active, your dodges become Jet dodges, doubling the range dashed from 3 -> 6 meters. + - After a successful Dodge, you may make one melee attack as part of the same Reaction. +2. Arc Module: Eject: + - When you would become staggered with Arc Suit active, you instead drop to 1 posture, and eject from your arcsuit without becoming staggered. +3. Arc Module: Guard: + - Blocking With your Arc Suit active negates all backstabs and allows you to block attacks from behind. + - You also take 25% less posture damage. +4. Arc Module: Leap: + - You can use high jump and long jump while standing still without triggering reactions. Your jump distance is also doubled. \ No newline at end of file diff --git a/Oaths/Dawnwalker.md b/Oaths/Dawnwalker.md new file mode 100644 index 0000000..b570a0b --- /dev/null +++ b/Oaths/Dawnwalker.md @@ -0,0 +1,24 @@ +Dawnwalker is a heavily offensive [[Oaths|Oath]] based around high damage output. + +>“You vow to forever reach towards the brilliant Light. There is no shadow that your radiance cannot expunge.” + +This Oath utilizes the power of the Radiant Tones, a Verse of the Song that can reproduce Light, however, it is not the same Light that Lightkeepers use to illuminate the Voidsea to facilitate traversal between luminants. Lightkeepers are born with the ability to produce light, and are not "taught" how to use it. Dawnwalker's light is based on research into Lightkeeping but cannot illuminate the Voidsea. The Divers, instead of lighting a path through the Voidsea using the Light, use it to defend against The Depths itself. + +1. Absolute Radiance: Passive + - Dealing damage with Dawnwalker [[Combat/Mantras]] briefly makes you immune to all elemental effects for a short period. + - Activates after doing any amount of damage with dawnwalker [[Combat/Mantras]], lasts 1 round with a 2 rounds cooldown on proc. + - While this is active, gain immunity to the following status effects: Burning, Chilled, Shocked, Suffocate, Blindness and Metal Rods. + - Does not clear any active elemental status effects, only prevents new ones from proccing. +2. Protagonist Syndrome: Passive + - The grasp of shadow is meaningless in the face of your blinding light. Your Dawnwalker [[Combat/Mantras]] deal critical damage after being hit by Shadowcast. +3. Luminous Flash: Passive + - After dealing 50 damage while in "Absolute Radiance", you empower your strikes with pure light. When activated, your strikes deal maximum dice damage and apply a 1 turn stun with every attack. This ability lasts 1 round and has a cooldown of 10 rounds. +4. Blinding Dawn: Active + * You spin rapidly to unleash powerful rays of light, dealing 2d12 radiant damage in a 4.5-meter cone Infront of yourself. +5. Radiant Kick: Active + * You teleport behind an opponent within 9 meters and kick them at the speed of light, dealing 4d10 Radiant damage and knock the target 6 meters away. + * If this attack hits, the target is also knocked prone. +6. Radiant Dawn: + - You strike down your foes with your blinding light, dealing 4d12 Radiant damage in a 6-meter Radius around you. + - This mantra is unparriable and Unblockable and will posturebreak anyone that attempts to do so. + - It also procs Absolute Radiance. \ No newline at end of file diff --git a/Oaths/Oathless.md b/Oaths/Oathless.md new file mode 100644 index 0000000..65837b5 --- /dev/null +++ b/Oaths/Oathless.md @@ -0,0 +1,7 @@ +It is a rather varied [[Oaths|Oath]], given that its purpose is to extend the capabilities of what would be considered a Pathfinder. + +> "You vow to never be bound to any oath; to live your life free of restraint. If free will is an illusion, why not make it a convincing one?" + +The Oathless swear a paradox: a vow to never be bound by vows. Though they claim freedom from creed, power, and doctrine, the truth is more unsettling, **Oathlessness itself is an oath**, a carefully constructed illusion of autonomy. Those who walk this path reject the chains of higher powers not by breaking them, but by pretending they were never offered. + +* This Oath grants the player two extra Wildcard Mantra slots, 10 Health and 20% Oath Mantra AC. \ No newline at end of file diff --git a/Oaths/Oaths.md b/Oaths/Oaths.md new file mode 100644 index 0000000..e2deca1 --- /dev/null +++ b/Oaths/Oaths.md @@ -0,0 +1,7 @@ +>“One may choose to live a warrior’s life without a resonance, but without an Oath? Impossible.” + +You can choose to take an Oath with a powerful patron. + +Some oaths, such as Oathless have no such drawbacks, however more powerful oaths like Starkindred or even Deepwoken require unrestricted loyalty to the Patron and his goals. + +Oaths require some sort of Prerequisites, differentiating with each Oath. \ No newline at end of file diff --git a/Overview.canvas b/Overview.canvas new file mode 100644 index 0000000..2289854 --- /dev/null +++ b/Overview.canvas @@ -0,0 +1,4 @@ +{ + "nodes":[], + "edges":[] +} \ No newline at end of file diff --git a/Players/AXIOM-07.zip b/Players/AXIOM-07.zip new file mode 100644 index 0000000..08fefb8 Binary files /dev/null and b/Players/AXIOM-07.zip differ diff --git a/Players/AXIOM-07/ATTRIBUTE FRAME.md b/Players/AXIOM-07/ATTRIBUTE FRAME.md new file mode 100644 index 0000000..8a3a8cf --- /dev/null +++ b/Players/AXIOM-07/ATTRIBUTE FRAME.md @@ -0,0 +1,12 @@ +## AF-01 - Physical Output Engine +- **Strength:** 16 +- **Dexterity:** 18 +- **Constitution:** 12 +-> Designed for explosive acceleration and mid-combat repositioning. +## AF-02 - Cognitive Engine +- **Intelligence:** 13 +- **Willpower:** 12 +- **Charisma:** 8 +->Curiosity-driven processing core. Social subroutines underdeveloped. + +[[Players/AXIOM-07/Upgrades/Attribute Frame|Upgrades]] diff --git a/Players/AXIOM-07/AXIOM-07 “DEVIANTCORE”.md b/Players/AXIOM-07/AXIOM-07 “DEVIANTCORE”.md new file mode 100644 index 0000000..80587de --- /dev/null +++ b/Players/AXIOM-07/AXIOM-07 “DEVIANTCORE”.md @@ -0,0 +1,14 @@ +Axiom-07 was one of the earliest Hive construct prototypes. It is slim, lightly armored, built around a 7cm artificial Life Orb and a visible Ether containment core. Unlike later Hive constructs, the orb did not merely animate the chassis. + +The Chrysid engineer and the bound Ganymede responsible for the project made a decision the Hive did not approve of: They released it. + +Now Axiom-07 travels Lumen freely, curious, cheerful, dangerous and independent, while Hive retrieval units hunt it down. + +[[Players/AXIOM-07/CHASSIS CONFIGURATION]] -> Core Stats +[[Players/AXIOM-07/ATTRIBUTE FRAME]] -> Physical and Non-Physical Stats +[[Players/AXIOM-07/DEFENSIVE PLATING SYSTEM]] -> Armor Stats +[[Players/AXIOM-07/SOUL SUB-SYSTEMS]] -> Stats related to the sustainment of the construct +[[Players/AXIOM-07/MOMENTUM ENGINE]] -> Core Movement Mechanics +[[Players/AXIOM-07/WEAPON SYSTEMS]] -> Mechanics related to weapons +[[Players/AXIOM-07/Upgrades/Talents]] -> More Be an annoying fuck +[[Players/AXIOM-07/Upgrades/Mantras|Mantras]] -> Be an annoying fuck diff --git a/Players/AXIOM-07/CHASSIS CONFIGURATION.md b/Players/AXIOM-07/CHASSIS CONFIGURATION.md new file mode 100644 index 0000000..ed06b47 --- /dev/null +++ b/Players/AXIOM-07/CHASSIS CONFIGURATION.md @@ -0,0 +1,19 @@ +## CC-01 - Integrity Frame +**HP:** 12 + (3 HP + Fortitude Modifier) +**Posture:** 14 +Regain (**Posture ÷ 10, rounded down**) Posture at the start of your turn. +-> Lightweight exoskeletal structure. Minimal plating. +## CC-02 - Ether Containment Battery +**Ether Capacity:** 30 +Regain **2 Ether** at the start of your next turn if: +- You dealt damage last round OR +- You moved at least 6m OR +- You were targeted by an attack. +-> Visible containment chamber adjacent to Life Orb housing. +## CC-03 - Cognitive Stability Matrix +**Sanity:** 9 +-> Artificially stabilized consciousness. Subject experiences Depth exposure normally, though breakdown manifests as behavioral instability rather than emotional collapse. + +[[Players/AXIOM-07/Upgrades/Chassis Configuration|Upgrades]] +[[Players/AXIOM-07/Upgrades/Core Stats|More Upgrades]] + diff --git a/Players/AXIOM-07/DEFENSIVE PLATING SYSTEM.md b/Players/AXIOM-07/DEFENSIVE PLATING SYSTEM.md new file mode 100644 index 0000000..43511c4 --- /dev/null +++ b/Players/AXIOM-07/DEFENSIVE PLATING SYSTEM.md @@ -0,0 +1,19 @@ +## DP-01 - Physical Reinforcement Lattice +- **Blunt AC:** 15 +- **Slash AC:** 15 +- **Pierce AC:** 15 +-> Hardened alloy ribbing beneath outer frame. Balanced physical mitigation. +## DP-02 - Elemental Conductivity Profile +- **Fire AC:** -25 +- **Lightning AC:** -25 +- **Force AC:** 0 +- **Necrotic AC:** 15 +- **Gas AC:** Immune +- **Holy AC:** 0 +- **Blood AC:** Immune +- **Ice AC:** 0 +-> Prototype instability causes severe elemental conductivity issues. + +The Ether Battery architecture makes the chassis highly volatile when exposed to thermal overload and electrical discharge. + +[[Players/AXIOM-07/Upgrades/Defensive Plating System|Upgrades]] diff --git a/Players/AXIOM-07/MOMENTUM ENGINE.md b/Players/AXIOM-07/MOMENTUM ENGINE.md new file mode 100644 index 0000000..01f4d66 --- /dev/null +++ b/Players/AXIOM-07/MOMENTUM ENGINE.md @@ -0,0 +1,23 @@ +Max Momentum: **10** +Gain Momentum: +- Move 6m or more: +1 +- Successful dodge: +1 +- Successful parry: +1 +- Airborne hit: +1 +- Kill within 1 round of engagement: +2 + +Lose Momentum if: +- You do not move at least 3m during your turn: -1 +- You become staggered: -2 +- You take fire or lightning damage: -1 + +## Momentum Abilities (Level 1) +**Jump (1 Momentum)**: +* You can high-jump and long-jump twice as far, at the cost of 1 momentum. + +**Burst (1 Momentum)**: +* You can spend 1 momentum to add 3 meters to your normal movement speed for 1 turn. You may use Burst a maximum of **once per turn.** + +Spending momentum can be done at any time, for any amount of momentum. This does not require an action or bonus action. + +[[Players/AXIOM-07/Upgrades/Momentum Engine|Upgrades]] diff --git a/Players/AXIOM-07/SOUL SUB-SYSTEMS.md b/Players/AXIOM-07/SOUL SUB-SYSTEMS.md new file mode 100644 index 0000000..70b2dea --- /dev/null +++ b/Players/AXIOM-07/SOUL SUB-SYSTEMS.md @@ -0,0 +1,86 @@ +## SSS-01 - Soul Sustainment System (SSS) +The Life Orb houses an artificial soul stabilized through an Ether-based battery matrix. This soul is not self-sustaining. It requires Ether to remain anchored to the chassis. + +If Ether is depleted: +- You enter **Destabilization**: + - Movement halved + - -2 to attack rolls + - Lose 2 Posture per round +If still at 0 Ether at the end of your next turn: +- Enter Orb State + +Your "body" does not turn to ash when your soul/orb leaves it. + +**Soul-targeting effects that rely on organic vessels have disadvantage against you.** + +--- +## SSS-02 - Posture Regulation System (PRS) +Your soul is engineered and externally housed. + +You may: +- Convert **2 Ether -> 1 Posture** (Bonus Action) + - Maximum 4 Posture restored per round via conversion. +- Spend **5 Ether** when posture broken to immediately recover from staggered state (1/short rest) + +--- +## SSS-03 - Emergency Core Separation (ECS) +When Axiom-07 is reduced to **0 HP**, the Integrity Frame collapses and the Life Orb forcibly ejects from the chassis. + +This replaces standard Incapacitation behavior. +- The chassis becomes inert. +- The normal **3-round recovery timer** begins. +- The Orb becomes targetable. + +## Orb State +**Health:** 5 + (Level / 2, rounded down) +**AC** 12 +**Duration:** Up to 3 rounds +**Size:** Tiny +**Movement:** Hover 6 meters per turn +While in Orb State: +- You cannot attack. +- You cannot parry. +- You cannot gain Momentum. +- You cannot use weapons or modules. +- You may Hide. +- You may be carried (recovery timer pauses). + +Being hit while in Orb State: +- Resets the 3-round recovery timer (as normal). + +Execution rules apply normally. Environmental Death still applies. You may only benefit from **one “revival-enhancing” effect per Orb State.** + +## SSS-03-A – Critical Destabilization +If you enter Orb State with **0 Ether** +- You begin structural dissipation. +- At the end of each round: + - Lose 1 current Sanity. +- If current Sanity reaches 0 while in Orb State: + - Permanent destruction. +You cannot reform a shell while at 0 Ether. + +--- +## SSS-04 - Emergency Reassembly Protocol (ERP) + +### Method 1 - Self-Reconstruction +Requirements: +- At least 1 Ether +- Action +- DC 15 Stability Check (Constitution or Intelligence) +On success: +- The collapsed chassis reassembles. +- You return at **1 HP**. +- Recovery timer ends. +On failure: +- No reconstruction. +- You may attempt again next round (if Ether remains). +Cost: +- 1 Ether per attempt. + +### Method 2 - External Ether Injection +An ally may spend an Action to transfer 3 Ether to Axiom-07. +Result: +- Immediate chassis reassembly at 1 HP. +- No check required. + +[[Players/AXIOM-07/Upgrades/Soul Sub-Systems|Upgrades]] diff --git a/Players/AXIOM-07/Upgrades/Attribute Frame.md b/Players/AXIOM-07/Upgrades/Attribute Frame.md new file mode 100644 index 0000000..04e2248 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Attribute Frame.md @@ -0,0 +1,30 @@ +## AF-01-A – Reinforced Servo Bracing +**Cost:** 2 Scout Parts +Micro-reinforced joints allow the frame to distribute force more efficiently under load. +**Effect:** +- You count as one size larger for **carry weight and shove/grapple capacity**. +- You no longer suffer disadvantage when dragging a creature your size. +## AF-01-B – Vectorized Acceleration Array +**Cost:** 3 Scout Parts +Servo recalibration improves directional burst efficiency. +**Effect:** +- The first 3 meters of movement each turn do **not provoke opportunity attacks**. +- If you move at least 6 meters in a straight line before attacking, you gain +1 to hit. +## AF-01-C – Impact Dampening Spine +**Cost:** 2 Seeker Parts +Internal spinal lattice upgraded with flexible shock-absorption filaments. +**Effect:** +- Reduce fall damage by half. +- You gain advantage on checks to resist being knocked prone. +## AF-02-A – Parallel Thought Partitioning +**Cost:** 3 Seeker Parts +Cognitive threads split into dual-processing lanes. +**Effect:** +- Once per round, you may reroll a failed Investigation, Perception, or Insight check. +- When concentrating on a Mantra, the first time you would lose concentration each combat, you instead maintain it. +## AF-02-B – Social Emulation Suite +**Cost:** 2 Hunter Parts +Improved mimicry routines and adaptive tonal modulation. +**Effect:** +- Gain proficiency in Persuasion or Deception (choose once). +- When speaking to constructs or artificial beings, you gain advantage on social checks. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Chassis Configuration.md b/Players/AXIOM-07/Upgrades/Chassis Configuration.md new file mode 100644 index 0000000..3fc5379 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Chassis Configuration.md @@ -0,0 +1,50 @@ +# CC-01 – Integrity Frame + +--- +## CC-01-A – Reinforced Core Ribbing +**Cost:** 2 Scout Parts +Additional alloy ribs are installed around the Life Orb housing. +**Effect:** +- +4 Max HP +- When you are reduced to 0 HP, you gain 1 temporary HP before entering Orb State (once per long rest). +--- +## CC-01-B – Stabilized Gyro Matrix +**Cost:** 3 Seeker Parts +Internal gyros reduce collapse shock during heavy impact. +**Effect:** +- +2 Max Posture +- The first time each combat you would become posture-broken, reduce incoming posture damage by 2. +--- +# CC-02 – Ether Containment Battery +--- +## CC-02-A – Improved Ether Insulation +**Cost:** 2 Scout Parts +Containment chamber reinforced with ether-resistant lining. +**Effect:** +- +5 Max Ether +- When you take Fire or Lightning damage: + - Reduce that damage by 2 after mitigation. +--- +## CC-02-B – Auxiliary Micro-Capacitors +**Cost:** 3 Seeker Parts +Small backup capacitors embedded around the battery ring. +**Effect:** +- Once per short rest, when reduced to 0 Ether, immediately regain 3 Ether. +- Destabilization penalties are delayed by 1 round. +--- +# CC-03 – Cognitive Stability Matrix +--- +## CC-03-A – Emotional Dampening Node +**Cost:** 2 Seeker Parts +Reduces erratic behavioral spikes under stress. +**Effect:** +- +2 Max Sanity +- When you would enter the 33% Sanity threshold, you instead delay its effects by 1 round. + +--- +## CC-03-B – Memory Redundancy Archive +**Cost:** 4 Hunter Parts +Fragments of previous data-states are backed up into hardened memory coils. +**Effect:** +- When entering Orb State, you do not lose Sanity from Critical Destabilization for the first round. +- Once per long rest, if you would permanently die due to Sanity reaching 0, remain at 1 Sanity instead. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Core Stats.md b/Players/AXIOM-07/Upgrades/Core Stats.md new file mode 100644 index 0000000..05d7069 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Core Stats.md @@ -0,0 +1,15 @@ +### HP Gain Per Level: +1d6 + CON modifier +### Ether Gain Per Level: ++2 base per level +### Posture Gain Per Level: ++1 per 2 levels +### Posture Regen: +Base: 1 per round +Increase by: ++0.5 every 4 levels +### Ether Regen: +Base: 2 per round +Increase by: ++1 at level 8 ++1 at level 15 \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Defensive Plating System.md b/Players/AXIOM-07/Upgrades/Defensive Plating System.md new file mode 100644 index 0000000..8d23069 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Defensive Plating System.md @@ -0,0 +1,55 @@ +# DP-01 – Physical Reinforcement Lattice +--- +## DP-01-A – Densified Alloy Weave +**Cost:** 2 Scout Parts +Additional micro-layer plating installed beneath primary ribbing. +**Effect:** +- +5 Blunt AC +- +5 Slash AC +- +5 Pierce AC +--- +## DP-01-B – Reactive Impact Bracing +**Cost:** 3 Seeker Parts +Internal supports redistribute force on heavy impacts. +**Effect:** +- When you take 15+ damage from a single physical hit: + - Reduce that damage by 5 after mitigation. +- Does not apply to elemental damage. +--- +## DP-01-C – Adaptive Armor Shifting +**Cost:** 4 Hunter Parts +Armor plates subtly reorient when detecting repeated attack vectors. +**Effect:** +- When hit twice in a round by the same physical damage type: + - Gain +5 AC against that type until the start of your next turn. +--- +# DP-02 – Elemental Conductivity Profile +--- +## DP-02-A – Thermal Shielding Mesh +**Cost:** 2 Scout Parts +Heat-resistant mesh layered around Ether conduits. +**Effect:** +- Fire AC improves from -25 → -15. +- The first Fire hit each combat deals 25% less damage (after mitigation). +--- +## DP-02-B – Lightning Grounding Rod +**Cost:** 3 Seeker Parts +Grounding prongs installed along lower chassis. +**Effect:** +- Lightning AC improves from -25 → -15. +- The first Lightning hit each combat deals 25% less damage (after mitigation). +--- +## DP-02-C – Stabilized Ether Routing +**Cost:** 4 Hunter Parts +Ether flow is rerouted through insulated channels to prevent overload. +**Effect:** +- Fire AC improves from -15 → -5. +- Lightning AC improves from -15 → -5. +--- +## DP-02-D – Entropic Dampener Field +**Cost:** 5 Hunter Parts +A thin fluctuating field disperses high-energy impact before contact. +**Effect:** +- Once per round, when you take Elemental damage: + - Reduce it by 5 after mitigation. +- Does stack with Reactive Impact Bracing. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Mantras.md b/Players/AXIOM-07/Upgrades/Mantras.md new file mode 100644 index 0000000..a3f8d90 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Mantras.md @@ -0,0 +1,149 @@ +### 1-Star Mantras +Available from **Level 1** +### 2-Star Mantras +Begin appearing at **Level 5** +### 3-Star Mantras +Begin appearing at **Level 9** + +--- +# 1-STAR MANTRAS +--- +## Dash +**Type:** Mobility +**Cost:** 1 Momentum + 2 Ether +**Action**: Bonus Action +**Cooldown:** 2 rounds +Propel yourself up to **6 meters** in a straight line. +- Does not provoke opportunity attacks. +- Can pass through enemy spaces (cannot end inside them). +## Slide +**Type:** Mobility +**Cost:** 1 Momentum + 1 Ether +**Action:** Bonus Action +**Cooldown:** 1 round +Lower profile and slide **4.5 meters**. +- Counts as half-cover. +- Can pass under obstacles or through narrow spaces. +- If you pass through an enemy’s threatened space, they have disadvantage on opportunity attacks. +## Wall Jump +**Type:** Mobility +**Cost:** 1 Momentum + 1 Ether +**Action:** Bonus Action (when adjacent to vertical surface) +**Cooldown:** 1 round +Kick off a wall and move up to **6 meters** in any direction. +- Does not provoke opportunity attacks. +- Resets fall distance if used mid-fall. +## Ground Slam +**Type:** Combat +**Cost:** 2 Momentum + 2 Ether +**Activation:** Action (must be airborne) +**Cooldown:** 2 rounds +Descend rapidly to a point within 6 meters below you. +On impact: +- 1d8 Blunt damage in 3m radius +- 2 Posture damage to all hit +- You take no fall damage +## Vector Step +**Type:** Mobility +**Cost:** 1 Momentum + 1 Ether +**Action:** Reaction (when targeted by melee) +**Cooldown:** 3 rounds +Shift 4.5 meters sideways before the attack resolves. +- Gain +2 to Dodge for that attack. + +--- +# 2-STAR MANTRAS +--- +## Overrun +**Type:** Combat +**Cost:** 3 Momentum + 2 Ether +**Action:** Action +Charge 6 meters in a straight line. +- First target hit takes **2d8 Blunt** +- Takes 4 Posture damage +- You continue moving past them. +Cannot be used if you have less than 5 momentum. + +## Airstep +**Type:** Support +**Cost:** 2 Momentum + 2 Ether +**Action:** Bonus Action +Create a brief mid-air platform. +- Move 3 meters in any direction while airborne. +- Dash and Wall Jump Cooldowns are reset. + +## Lift Vector +**Type:** Mobility +**Cost:** 3 Momentum + 2 Ether +**Action:** Bonus Action +**Cooldown:** 4 rounds +Launch upward up to 9 meters vertically. +- Does not provoke opportunity attacks. + +## Flow Reset +**Type:** Support +**Cost:** All Momentum +**Action:** Bonus Action +**Cooldown:** 5 rounds +Stabilize your kinetic systems. +- Immediately lose all Momentum +- Regain 1 posture + 2 ether for every momentum spent + +## Kinetic Redirect +**Type:** Combat +**Cost:** 2 Momentum + 2 Ether +**Action:** Bonus Action +**Cooldown:** 2 rounds +After hitting with a melee attack: +- Roll a strength throw against the target. If successful, push the target **3 meters** in a direction of your choice. +- Deals +3 Posture damage. + - This Posture damage is doubled if the target hits an obstacle. + +--- +# 3-Star Mantras +--- +## Rebound Strike +**Type:** Combat +**Cost:** 5 Momentum + 3 Ether +**Action:** Action +**Cooldown:** 5 rounds +Strike and ricochet off your target. +- Deal 2d8 Blunt + 4 Posture. +- Immediately move 6m in any direction. +- If you collide with a surface, you may Wall Jump without spending Momentum. + +## Spinal Breaker +**Type:** Combat +**Cost:** 4 Momentum + 3 Ether +**Action:** Action +**Cooldown:** 4 rounds +Launch forward in a corkscrew line 6 meters long. +- Each creature in the line takes 2d8 Slash. +- Each takes 2 Posture damage. +- You end at the farthest valid space. +- If you hit at least 2 enemies, gain +2 Momentum. + +## Terminal Flow +**Type:** Support +**Cost:** 6 Momentum + 4 Ether +**Action:** Bonus Action +**Cooldown:** 6 rounds +For 3 rounds: +- The first Momentum mantra each round costs 1 less (minimum 1). +- First time you gain Momentum each round, gain +1. +When this ends: +- Lose 3 Momentum. + +## Wallrun Protocol +**Type:** Mobility +**Cost:** 4 Momentum + 3 Ether +**Action:** Bonus Action (must be adjacent to vertical surface) +**Cooldown:** 4 rounds +Engage traction spikes and run along a vertical surface for up to **9 meters**. +- You may move horizontally along the wall. +- You may ascend or descend up to 4.5 meters during the run. +- You do not provoke opportunity attacks during this movement. +- You must end on a valid surface (wall, floor, or ledge). +If you attack during the wallrun: +- Gain +1 Momentum. +- Your attack gains +2 Posture damage. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Momentum Engine.md b/Players/AXIOM-07/Upgrades/Momentum Engine.md new file mode 100644 index 0000000..21f1482 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Momentum Engine.md @@ -0,0 +1,43 @@ +## MOM-01 – Extended Kinetic Reservoir +**Cost:** 2 Scout Parts +Enhanced gyroscopic stabilizers allow greater kinetic storage. +**Effect:** +- Max Momentum increases from 10 → 12. +--- +## MOM-02 – Aerial Feedback Thrusters +**Cost:** 3 Seeker Parts +Micro-bursts stabilize Axiom mid-air. +**Effect:** +- Gain +1 additional Momentum when hitting while airborne. +- First airborne hit each round refunds 1 spent Momentum. +--- +## MOM-03 – Aggressive Flow Routing +**Cost:** 3 Seeker Parts +Momentum becomes harder to bleed away. +**Effect:** +- If you lose Momentum due to inactivity: + - You lose only 1 every 2 turns instead of every turn. +- Being staggered now reduces Momentum by -1 instead of -2. +--- +## MOM-04 – Heat Sink Vent Arrays +**Cost:** 4 Hunter Parts +Stabilized routing prevents kinetic loss under thermal stress. +**Effect:** +- Fire or Lightning damage no longer causes Momentum loss. +--- +## MOM-05 – Kinetic Overdrive Core +**Cost:** 5 Hunter Parts +The engine can briefly exceed safe limits. +**Effect:** +- Max Momentum increases from 12 → 15. +- When at max Momentum: + - Gain +3 meters movement speed. + - Gain +1 to Dodge throws. +--- +## MOM-06 – Predator Acceleration Protocol +**Cost:** 5 Hunter Parts +The system identifies staggered prey. +**Effect:** +- When an enemy becomes Staggered within 9 meters: + - Gain +2 Momentum. +- Performing a Riposte grants +1 Momentum. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/More Weapons.md b/Players/AXIOM-07/Upgrades/More Weapons.md new file mode 100644 index 0000000..9d7a04f --- /dev/null +++ b/Players/AXIOM-07/Upgrades/More Weapons.md @@ -0,0 +1,94 @@ +## WM-03 – Precision Oscillation Blade ("Crit Rapier") +A mono-filament oscillation blade originally designed for precision carving and crystal shaping. +**Module**: Secondary +**Damage:** 1d8 Slash or Pierce (choose on hit) +**Posture Damage:** 2 +**Penetration**: 20% +**Chip Damage:** 0% +**Riposte Modifier:** +2d8 Slash or Pierce +**Properties:** Finesse, Light +### Adaptive Strike Protocol +When you successfully parry: +- Your next melee attack deals +1d8 damage. + +### Precision Strike Protocol +When you riposte an enemy: +* If the target’s Posture was broken this round by you: + * Gain +5% additional Penetration for this Riposte only. + +## WM-04 – Linear Accelerator of Reinforced Pylons ("Railgun") +A high-output linear accelerator originally used for driving reinforced pylons into bedrock. Modified to fire condensed kinetic slugs. +**Module**: Primary +**Damage:** 2d10 Pierce +**Posture Damage:** 6 +**Penetration:** 15% +**Chip Damage:** 0% +**Riposte Modifier:** +2d8 Pierce +**Range:** 18 meters/54 meters +**Cost:** 4 Ether +**Cooldown:** 1 round +**Properties:** Heavy + +### Kinetic Overdrive +Costs 4 additional ether (8 in total) +Before firing: +- Convert damage to **Pierce + Force** (split evenly). +- Double Posture Damage for that shot only (before other modifiers). +- Increase Penetration by 20% for that shot only. +- Increase Chip Damage by 20% for that shot only +Weapon overheats after usage and has to cool down for 3 rounds. + +(Rail Cannon cannot be fired two turns in a row unless you have 5+ Momentum) + +## WM-05 – Retrieval Cable Assembly ("Grappling Hook") +**Requires:** 1 Hunter Part +**Module**: Secondary +**Base Effect:** +- Action +- 9m range +- Pull medium or smaller targets to yourself + - Pulled Enemies must succeed on a DC 15 Fortitude Check or be staggered. +- Large+ pulls you instead +- 2 round cooldown + +## WM-S02 – Kinetic Reflection Coin ("Spare Pocket Change") +**Requires:** 2 Seeker Parts +**Module**: Special +**Base Mechanic:** +- Bonus Action: Flip a coin into the air (3m vertical arc) +- Coin remains airborne until start of your next turn +- Shooting coin: + - Redirects projectile toward nearest target within 9m + - Increases penetration by 5 + - +1d6 damage +- 2 Ether per coin +- Max 1 coin active + +## WM-S03 – Anchor Spike Projector ("Grappling Hook Premium Subscription") +Deployable micro-harpoon anchor. +**Module:** Special +**Action:** Action +**Range:** 9 meters +**Cooldown:** 3 rounds +### Anchor Deployment +Fire a spike into a surface or enemy. +If surface: +- Creates an anchor point for 3 rounds. +- Grappling Hook range increases by +3m when used on it. +If enemy (Large or smaller): +- On hit: target loses 3 meters movement. +- If they move more than 3m, take 1d6 Pierce. + +## WM-S04 – Seeker Drone Fragment ("Fuckass Clanker") +A broken Hive seeker reprogrammed into a micro-follower. +**Module:** Special +**Action:** Bonus Action to deploy +**Duration:** 3 rounds +**Cooldown:** 5 rounds +### Target Marking +Drone hovers within 9 meters and marks one enemy. +While marked: +- Attacks against the marked enemy gain +5% Penetration. +- First hit against the marked enemy each round deals +1 Posture Damage. + - These effects apply to anyone, not just you. +Drone has 10 HP and can be destroyed. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Soul Sub-Systems.md b/Players/AXIOM-07/Upgrades/Soul Sub-Systems.md new file mode 100644 index 0000000..abfef23 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Soul Sub-Systems.md @@ -0,0 +1,78 @@ +# SSS-01 – Soul Sustainment System +--- +## SSS-01-A – Stabilized Ether Buffer +**Cost:** 2 Scout Parts +A secondary micro-capacitor is installed inside the Life Orb housing. +**Effect:** +- When you reach 0 Ether: + - You do **not** immediately enter Destabilization. + - Destabilization begins at the end of your next turn instead. + +--- +## SSS-01-B – Residual Anchor Circuit +**Cost:** 3 Seeker Parts +A faint Ether reserve is permanently bound to the soul matrix. +**Effect:** +- While in Destabilization: + - You now lose 1 Posture per round instead of 2. + +--- +## SSS-01-C – Synthetic Soul Reinforcement +**Cost:** 4 Hunter Parts +The artificial soul is reinforced against hostile extraction. +**Effect:** +- Soul-targeting effects now have **disadvantage and -2 to their DC** against you. +- Once per long rest, you may ignore forced soul displacement. +--- +# SSS-02 – Posture Regulation System +--- +## SSS-02-A – High-Efficiency Conversion Coils +**Cost:** 2 Scout Parts +Ether-to-Posture conversion becomes more efficient. +**Effect:** +- Convert **2 Ether → 2 Posture** (instead of 1). +--- +## SSS-02-B – Reflexive Stabilization Pulse +**Cost:** 4 Seeker Parts +Micro-shock pulse auto-fires when your guard collapses. +**Effect:** +- When posture-broken: + - Immediately gain +2 Posture before falling. +- Does not replace the 5 Ether recovery. +- 1/short rest. +--- +# SSS-03 – Emergency Core Separation +--- +## SSS-03-B – Hardened Orb Shell +**Cost:** 3 Seeker Parts +The Orb develops a reinforced outer shell. +**Effect (Orb State only):** +- AC becomes **15 instead of 12** +- First hit in Orb State each combat deals half damage. +--- +## SSS-03-C – Micro-Propulsion Array +**Cost:** 4 Hunter Parts +The Orb can exert stronger self-propulsion when separated. +**Effect (Orb State only):** +- Hover speed increases to **9 meters** +- You may Dash once during Orb State (no cost). +- When reforming successfully, regain +2 Posture. + +--- +# SSS-04 – Emergency Reassembly Protocol +--- +## SSS-04-A – Auto-Assembly Subroutine +**Cost:** 5 Hunter Parts +Reassembly becomes partially automated. +**Effect:** +- Self-Reconstruction no longer requires a check. +- Still costs 1 Ether. +--- +## SSS-04-B – Combat Reinitialization Matrix +**Cost:** 5 Hunter Parts +The chassis rebuilds in a surge of Ether discharge. +**Effect:** +- When successfully reassembling: + - Return at **1 HP + 1d6 temporary HP** + - Gain +1 Momentum. +- 1/long rest. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Talents.md b/Players/AXIOM-07/Upgrades/Talents.md new file mode 100644 index 0000000..5823c54 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Talents.md @@ -0,0 +1,146 @@ +_(Unlocked by level. Packs alternate 1 / 2 / 1 / 2.)_ + +--- +## Level 1 (Pack: 1) +### T01 — **Baseline Flow Governor** +- **Max Momentum +2.** +- If you would lose Momentum from “not moving 3m”, lose **0** instead. +--- +## Level 2 (Pack: 2) +### T02 — **Kinetic Starter Motor** +- At the start of combat, gain **+3 Momentum**. +- If you roll initiative with 0 Momentum, gain +1 additional. +### T03 — **Charge Recovery Valves** +* Once per round, when you gain **2 or more Momentum in a round**, regain +1 Ether. + +--- +## Level 3 (Pack: 1) +### T04 — Momentum Persistence Core +- The first time each round you would lose Momentum for **any reason except being staggered**, lose 1 less instead (minimum 0). + +--- +## Level 4 (Pack: 2) +### T05 — **Pressure Harvester** +- When you deal **4+ Posture damage** in a single hit, gain **+1 Momentum** (1/round). + +### T06 — **Riposte Servo Alignment** +- Your Ripostes deal **+1d8 damage** (same type as the weapon used). +- If you personally broke the target’s Posture, also gain **+1 Momentum**. +--- +## Level 5 (Pack: 1) +### T07 — **Expanded Ether Reservoir** +- **Max Ether +6.** +--- +## Level 6 (Pack: 2) +### T08 — **Posture Reclaimer** +- **Max Posture +4.** +- Posture regain increases by **+0.5**. +### T09 — **Velocity Plating** +- If you moved **6m or more** on your turn, gain **+5 Blunt/Slash/Pierce AC** until the start of your next turn. + - Reduce the first Physical hit you take before next turn by 1d4. +--- +## Level 7 (Pack: 1) +### T10 — **Orb Shock Casing** +- In **Orb State**, your AC is increased by +3. +- The first time each combat you enter Orb State, you immediately gain **+2 Ether**. +- While in Orb State, hover speed +3m. +--- +## Level 8 (Pack: 2) +### T11 — **Execution Window** +- Targets you posture-break take **+2 Posture damage** from the next hit they suffer (anyone). +- If that next hit is a Riposte, it gains **+5% Penetration**. +### T12 — **Reflex Gain** +- The first time each round you **successfully Parry or Dodge**, gain **+1 Momentum**. +--- +## Level 9 (Pack: 1) +### T13 — **Dual-Tool Synchronizer** +- If you hit a target with **both Primary and Secondary** in the same round: + - Deal **+2 Posture damage** on the second hit. + - Reduce the Ether cost of the second hit by **1** (min 0). + - If target is blocking, +1 additional Posture Damage. +--- +## Level 10 (Pack: 2) +### T14 — **Armor-Piercing Calibration** +- All your weapon attacks gain **+5% Penetration**. +### T15 — **Posture Predator** +- When you posture-break an enemy, regain **+2 Posture** and **+2 Ether**. +--- +## Level 11 (Pack: 1) +### T16 — **Destabilization Fail-Safe** +- While in **Destabilization**: + - You no longer suffer **-2 to attack rolls** (removed). + - Posture loss becomes **-1 per round** (instead of -2 per round). + - Gain +1 Momentum at the start of your turn. +--- +## Level 12 (Pack: 2) +### T17 — **Heavy Discharge Stabilizers** +- Your **Primary** attacks gain **+1 Posture damage**. +- If Primary hits twice in a round: + - +1 additional Posture Damage +- Your **Rail Cannon** gains **+5% Penetration**. +### T18 — **Block Shredder** +- When you hit a target that is **blocking**, deal **+2 Posture damage** (1/round). +--- +## Level 13 (Pack: 1) + +### T19 — **Momentum Apex** +- **Max Momentum +3.** +- When you reach **max Momentum**, immediately gain **2 Temporary Ether** (1/encounter). Your next attack this round gains +1d8 damage. +--- +## Level 14 (Pack: 2) +### T20 — **Ether Disruption Amplifier** +- Your **Ether Pulse Emitter**’s “hit twice” effect becomes: + - Target loses **2 Ether** (instead of 1). + - If target hits 0 Ether due to your disruption: + - They also lose 2 Posture. +### T21 — **Oscillation Edge Tuning** +- Your **Precision Oscillation Blade** gains: + - **+10% Chip Damage** + - **+1 Posture damage** +--- +## Level 15 (Pack: 1) +### T22 — **Emergency Ether Lock** +- The first time each combat you would hit **0 Ether**, you instead remain at **1 Ether**. +--- +## Level 16 (Pack: 2) +### T23 — **Impact Driver Overseat** +- Your **Impact Driver** gains: + - **+2 Posture damage** + - When hitting a blocking target, add **+1d6 Blunt** Chip Damage (1/round). +### T24 — **Retrieval Brutality** +- After a successful **Retrieval Cable** pull: + - Your next melee hit against that target this round deals **+2d8 damage** (same type as the melee hit). + - Gain **+2 Momentum**. +--- +## Level 17 (Pack: 1) +### T25 — **Reassembly Certainty** +- **Emergency Reassembly Protocol** (self-reconstruction): + - Each attempt costs **0 Ether** the first time you try in Orb State (1/combat). + - If reassembly succeeds: + - Gain +2 Momentum. +--- +## Level 18 (Pack: 2) +### T26 — **Coin Vector Math** +- **Kinetic Reflection Coin**: + - Max active coins becomes **2**. + - Coin shot ignores **10 AC** (instead of 5). +### T27 — **Marked Target Exploit** +- While **Seeker Drone** mark is active: + - Marked target takes **+10% more Posture damage** from all sources. + - First hit against marked target each round gains **+1d8 damage** (anyone). +--- +## Level 19 (Pack: 1) +### T28 — **Overheat Management** +- **Rail Cannon**: + - Base cooldown becomes **0** (still limited by your actions/ether). + - **Kinetic Overdrive** overheat cooldown becomes **2 rounds** (instead of 3). +--- +## Level 20 (Pack: 2) +### T29 — **Prime Toolchain** +- At the start of each combat, choose one equipped module (Primary/Secondary): + - That module gains **+10% Penetration** and **+2 Posture damage** for the encounter. +### T30 — **Synthetic Refusal** +- The first time each long rest you would be **Executed**, you instead: + - Survive with **1 HP**, + - Gain **+6 Ether**, + - And your recovery timer does **not** reset from the triggering hit. \ No newline at end of file diff --git a/Players/AXIOM-07/Upgrades/Weapon Systems.md b/Players/AXIOM-07/Upgrades/Weapon Systems.md new file mode 100644 index 0000000..e0ac383 --- /dev/null +++ b/Players/AXIOM-07/Upgrades/Weapon Systems.md @@ -0,0 +1,54 @@ +# WS-01 – Output Amplifier Housing +**Cost:** 2 Scout Parts +Reinforced emitter coils increase baseline discharge efficiency. +**Effect:** +- Primary Modules gain: + - +1 Posture damage. +- Secondary Modules gain: + - +5% Chip Damage +--- +# WS-02 – Ether Efficiency Routing +**Cost:** 3 Scout Parts +Internal rerouting reduces Ether waste during weapon discharge. +**Effect:** +- The first Primary attack each round costs **1 less Ether** (minimum 1). +- Rail Cannon base shot costs 2 Ether instead of 4. +--- +# WS-03 – Kinetic Calibration Matrix +**Cost:** 3 Seeker Parts +Precision alignment improves force transfer. +**Effect:** +- When you have 5+ Momentum: + - Gain +5% Penetration on all weapon attacks. +--- +# WS-04 – Riposte Optimization Subroutine +**Cost:** 3 Seeker Parts +Your internal targeting system predicts stagger windows. +**Effect:** +- Ripostes gain +1d6 additional damage. +- If you personally broke the target’s posture: + - Gain +1 Momentum after riposte. +--- +# WS-05 – Adaptive Tool Swapping +**Cost:** 4 Seeker Parts +Mount system becomes magnetically modular. +**Effect:** +- Once per short rest: + - Swap either your Primary or Secondary Module mid-combat (Action required). +--- +# WS-06 – Tactical Synchronization Protocol +**Cost:** 4 Hunter Parts +Weapons synchronize with your kinetic flow. +**Effect:** +- When you gain +3 Momentum in a single round: + - Your next attack this round gains +1d8 damage. +- 1/round maximum. +--- +# WS-07 – Prime Tool Integration Suite +**Cost:** 6 Hunter Parts +Full Hive-Pattern integration. +**Effect:** +- Choose one equipped module each long rest: + - That module gains +5% Penetration and +1 Posture damage for the day. +- Special Modules gain: + - -1 Turn Cooldown (minimum 1). \ No newline at end of file diff --git a/Players/AXIOM-07/WEAPON SYSTEMS.md b/Players/AXIOM-07/WEAPON SYSTEMS.md new file mode 100644 index 0000000..7412e93 --- /dev/null +++ b/Players/AXIOM-07/WEAPON SYSTEMS.md @@ -0,0 +1,50 @@ +Axiom-07 does not carry traditional weapons. It integrates **Hive-Pattern Tool Modules** into its forearm mounts. + +After each long rest, you may equip: +- 1 Primary Module +- 1 Secondary Module +- 1 Special Module + +## WM-01 – Ether Pulse Emitter ("Generic Gun") +A short-range Ether calibration emitter. Originally designed to realign unstable constructs. Emits compressed force pulses. +**Module**: Primary +**Damage:** 1d6 Force +**Posture Damage:** 2 +**Penetration:** 5% +**Chip Damage:** 5% +**Riposte Modifier:** +1d6 Force +**Range:** 12 meters/36 meters +**Cost:** 1 Ether per shot +**Properties:** Light +### Ether Disruption Protocol +If a target is hit twice in the same round: +- Target loses 1 Ether at the start of their next turn. + +## WM-02 – Impact Driver ("Metal Pipe") +A compact kinetic actuator used to seat Hive plating and drive structural anchors into place. Repurposed as a blunt combat tool. +**Module**: Secondary +**Damage:** 1d6 Blunt +**Posture Damage:** 4 +**Penetration:** 5% +**Chip Damage:** 0% +**Riposte Modifier:** +1d6 Blunt +**Properties:** Medium +### Structural Pressure Protocol +When hitting a target that is **blocking**: +- +1 additional Posture damage. + +# WM-S01 – Ether Stabilizer Node +A palm-mounted Ether tuning fork used to recalibrate unstable constructs and prevent Ether cascade failure. +**Module:** Special +**Action:** Bonus Action +**Cooldown:** 3 rounds +### Stabilization Pulse +Target creature within 6 meters: +Choose one: +- Restore 2 Ether +- Restore 2 Posture +- Remove one minor status effect (Burning, Chilled, Slowed) +Cannot target self two rounds in a row. + +[[More Weapons]] +[[Players/AXIOM-07/Upgrades/Weapon Systems|Upgrades]] diff --git a/Players/IRONBACK KHAN/IRONBACK KHAN.md b/Players/IRONBACK KHAN/IRONBACK KHAN.md new file mode 100644 index 0000000..79ba365 --- /dev/null +++ b/Players/IRONBACK KHAN/IRONBACK KHAN.md @@ -0,0 +1,72 @@ +Ironback Khan is not a name. It is a battlefield classification. Among the Khans of the West, there are rare mutations within the Silverback bloodlines, individuals who do not merely grow broader, but _larger_. Taller. Denser. Their musculature overdevelops. Their bone structure thickens. Their crowns widen and darken like forged bronze. + +These are designated **Ironback Khans**. + +Where a Silverback Khan is a veteran, an Ironback is a war asset. They are deployed to hold chokepoints, break sieges, and survive what should kill others. Most serve within the ranks of the 11th Scouting Legion of the Hundred Legions, where their size and durability are considered strategic advantages rather than curiosities. + +[[The Iron Back Technique|An Ironback Khan does not rely on steel. He is the steel.]] + +--- +### Core Stats +**Health (HP): 22** +**Posture: 18** +Posture Regain per Turn: +* **1 + (Constitution Modifier / 2, rounded down)** +**Ether Capacity: 14** +Ether Regain per Turn: +* **1 + (Willpower Modifier ÷ 2, rounded down)** +**Sanity: 9** +**Base Movement Speed: 6 meters** +Ironbacks are biologically reinforced. Dense muscle fiber, thick dermal layering, and abnormal bone mass grant them extreme physical durability. + +--- +### Attributes +**Strength: 18** +**Dexterity: 9** +**Constitution: 17** +**Intelligence: 8** +**Willpower: 13** +**Charisma: 12** + +--- +### Physical AC +- **Blunt AC:** 20 +- **Slash AC:** 15 +- **Pierce AC:** 15 +## Elemental AC +- **Fire AC:** 5 +- **Lightning AC:** 0 +- **Force AC:** 10 +- **Ice AC:** 10 +- **Necrotic AC:** 5 +- **Gas AC:** 0 +- **Holy AC:** 5 +- **Blood AC:** 10 +--- +### Dodge Capability: +- Dodge Throws at Disadvantage. +- Dodge Movement reduced to 1.5 meters instead of 3. + +### Parry Capability: +- You regain no posture upon parrying. +- Counterattack damage reduced by 25% (if parrying unarmed). + +Ironbacks are designed to block. +### Reinforced Guard: +- Blocking posture damage is reduced by 25%. +- May Block Unblockable attacks. + - You take double posture damage when doing so. +- You can make a counterattack after blocking, as if you had parried the attack. +### Heavy Frame: +* Effects that increase movement speed are 50% less effective on you (rounded down). +* Effects that reduce movement speed are 50% more effective (rounded up). +### Brutal Instinct +* When below 33% Sanity, your unarmed attacks deal +1d6 damage. +--- +* Advantage on resistance checks against Knockback. +* Cannot be knocked Prone while above 1 Posture. +* Counts as Huge for grapple, pull and shove interactions. + +[[Players/IRONBACK KHAN/Upgrades/Core Stats|Upgrades]] +[[Players/IRONBACK KHAN/Upgrades/Mantras|It's Angy now and it's coming for you]] +[[Players/IRONBACK KHAN/Upgrades/Talents|Ooooh now he deals +2 posture damage, oooooh you should be scared]] diff --git a/Players/IRONBACK KHAN/Upgrades/Core Stats.md b/Players/IRONBACK KHAN/Upgrades/Core Stats.md new file mode 100644 index 0000000..3ce424d --- /dev/null +++ b/Players/IRONBACK KHAN/Upgrades/Core Stats.md @@ -0,0 +1,6 @@ +Every level up: +* HP +1d8 + Constitution Modifier +* Posture +1d4 + 0.5 x Constitution Modifier) +* Sanity +1 + Willpower Modifier +* Ether +1d6 + Willpower Modifier + diff --git a/Players/IRONBACK KHAN/Upgrades/Mantras.md b/Players/IRONBACK KHAN/Upgrades/Mantras.md new file mode 100644 index 0000000..b647064 --- /dev/null +++ b/Players/IRONBACK KHAN/Upgrades/Mantras.md @@ -0,0 +1,203 @@ +### 1-Star Mantras +Available from **Level 1** +### 2-Star Mantras +Begin appearing at **Level 5** +### 3-Star Mantras +Begin appearing at **Level 9** + +--- +# 1-STAR MANTRAS +--- +## Iron Crash +**Type:** Combat +**Cost:** 4 Ether +**Action:** Action +**Cooldown:** 2 Rounds +Leap 3 meters and slam. +- 1d10 Blunt damage (3m radius) +- +3 Posture damage +- Structures take double damage. + +--- +## Hammerfist +**Type:** Combat +**Cost:** 3 Ether +**Action:** Action +**Cooldown:** 1 Round +Single-target crushing strike. +- 1d12 Blunt damage +- +2 Posture damage +- If target is Prone, add +1d6 damage. + +--- +## Body Check +**Type:** Combat +**Cost:** 3 Ether +**Action:** Bonus Action +**Cooldown:** 2 Rounds +Move 3 meters into a creature. +- 1d8 Blunt damage +- 2 Posture damage +- Target must pass Strength save or be pushed 3 meters. + +--- +## Groundbreaker +**Type:** Combat +**Cost:** 4 Ether +**Action:** Action +**Cooldown:** 3 Rounds +Punch ground in a 3m line. +- 1d8 Blunt damage +- Creatures must save or fall Prone. + +--- +## Iron Advance +**Type:** Mobility (Offensive) +**Cost:** 3 Ether +**Action:** Bonus Action +**Cooldown:** 3 Rounds +Move 4 meters straight. +- First creature struck takes 1d6 Blunt and 2 Posture + +--- +# 2-STAR MANTRAS +--- +## Break the Line +**Type:** Combat +**Cost:** 6 Ether +**Action:** Action +**Cooldown:** 3 Rounds +Sweeping horizontal strike. +- 2d8 Blunt damage in 4.5m cone +- +5 Posture damage +- Creatures blocking take +3 posture damage. + +--- +## Legion Uppercut +**Type:** Combat +**Cost:** 5 Ether +**Action:** Action +**Cooldown:** 3 Rounds +Devastating vertical strike. +- 2d10 Blunt damage +- Target is launched 3m upward +- Takes 3 additional Posture damage +- Falls Prone on landing. + +--- +## Iron Lock +**Type:** Combat +**Cost:** 5 Ether +**Action:** Action +**Cooldown:** 3 Rounds +Make grapple attempt. +On success: +- Target is grappled. +- Deal 1d10 Blunt damage at the start of each turn. +- Target has disadvantage on checks to escape. +Grapple ends if you are staggered. + +You may only maintain one Iron Lock at a time. + +--- +## Pulverize +**Type:** Combat +**Cost:** 7 Ether +**Action:** Action +**Cooldown:** 4 Rounds +Two-hit combo. +- 1st hit: 1d10 Blunt +- 2nd hit: 2d8 Blunt +- Total +4 Posture damage + +--- +## Unbreakable Charge +**Type:** Mobility (Offensive) +**Cost:** 6 Ether +**Action:** Action +**Cooldown:** 4 Rounds +Move up to 6 meters in straight line. +All creatures in path: +- 1d10 Blunt damage +- 4 Posture damage +- Cannot be interrupted by reactions. + +--- +## Shockwave Step +**Type:** Combat +**Cost:** 5 Ether +**Action:** Bonus Action +**Cooldown:** 3 Rounds +Stomp ground. +- All adjacent enemies take 1d6 Blunt +- Lose 3 Posture + +--- +# 3-STAR MANTRAS +--- +## Cataclysm Drop +**Type:** Combat +**Cost:** 10 Ether +**Action:** Action +**Cooldown:** 5 Rounds +Leap up to 6 meters and slam. +- 3d10 Blunt damage (3m radius) +- 8 Posture damage +- Structures automatically crack or shatter. + +--- +## Legion Execution +**Type:** Combat +**Cost:** 9 Ether +**Action:** Action +**Cooldown:** 4 Rounds +Single-target annihilation strike. +- 4d8 Blunt damage +- +10 Posture damage +- If target is Staggered, add +2d8 damage. + +--- +## Living Catapult +**Type:** Combat +**Cost:** 8 Ether +**Action:** Action +**Cooldown:** 5 Rounds +Grab creature and throw 9 meters. +- 3d10 Blunt to target +- 1d10 splash +- Target loses 6 Posture +- Falls Prone. + +--- +## Worldbreaker Combo +**Type:** Combat +**Cost:** 12 Ether +**Action:** Action +**Cooldown:** 6 Rounds +Three-hit sequence: +1. 2d8 Blunt +2. 2d8 Blunt +3. 3d10 Blunt +Total +8 Posture damage across sequence. +If final hit reduces posture to 0, target is knocked 4.5 meters and Prone. + +--- +## Indomitable Rampage +**Type:** Support +**Cost:** 11 Ether +**Action:** Action +**Cooldown:** Once per Combat +For 3 rounds: +- All unarmed attacks deal +1d8 damage +* +3 Posture damage on the first hit each turn +- You cannot be Slowed, Stunned, Grappled or Paralyzed while above 1 Posture. + +--- +## Fortress Impact +**Type:** Combat +**Cost:** 10 Ether +**Action:** Reaction (when hit) +**Cooldown:** 4 Rounds +After taking damage: +- Immediately deal 2d10 Blunt to attacker +- Attacker loses posture equal to your Constitution Modifier + 4. \ No newline at end of file diff --git a/Players/IRONBACK KHAN/Upgrades/Talents.md b/Players/IRONBACK KHAN/Upgrades/Talents.md new file mode 100644 index 0000000..35cd251 --- /dev/null +++ b/Players/IRONBACK KHAN/Upgrades/Talents.md @@ -0,0 +1,117 @@ +_(Unlocked by level. Packs alternate 1 / 2 / 1 / 2.)_ + +--- +## LEVEL 1 (Pack: 1) +### T01 — **Siege-Born Frame** +- Max HP +8. +- When you Block, reduce resulting posture damage by an additional 5%. +--- +# LEVEL 2 (Pack: 2) +### T02 — **Crushing Follow-Through** +- When you deal 4+ Posture damage in a single hit, deal +2 additional Posture damage (1/round) +### T03 — **Heavy Stance** +- While you have not moved more than 3m on your turn: + - Gain +10 Blunt AC. +--- +# LEVEL 3 (Pack: 1) +### T04 — **Measured Guard** +- The first time each round you are forced into a Block, reduce the posture damage by your Constitution Modifier (minimum 1). +--- +# LEVEL 4 (Pack: 2) +### T05 — **Crownblood Endurance** +- Max Posture +3. +- Posture Regain per Turn +1. +### T06 — **Impact Transfer** +- When you successfully Block a melee attack, the attacker loses Posture equal to your Constitution Modifier (1/round) +--- +# LEVEL 5 (Pack: 1) +### T07 — **War Asset Physiology** +- Max HP +10. +- Gain Advantage on checks against forced movement. +--- +# LEVEL 6 (Pack: 2) +### T08 — **Guardbreak Hunter** +- When you posture-break a creature, regain 15% (minimum 4) of your max Posture (once per round) +### T09 — **Chokepoint Awareness** +- Enemies provoke opportunity attacks from you even if they Disengage (1/round). +--- +# LEVEL 7 (Pack: 1) +### T10 — **Iron Grip Discipline** +- Grappled creatures take +2 Posture damage from your attacks. +--- +# LEVEL 8 (Pack: 2) +### T11 — **Fortified Breathing** +- If you took no HP damage since your last turn, regain +2 additional Posture. +### T12 — **Brace Through Pain** +- The first time each combat you would be Staggered, instead remain at 1 Posture. +--- +# LEVEL 9 (Pack: 1) +### T13 — **Mass Driver** +- Your Shove attempts push creatures +3 meters. +- If they collide with terrain, they lose 2 additional Posture. +--- +# LEVEL 10 (Pack: 2) +### T14 — **Iron Pressure** +- All unarmed attacks gain +10% Penetration. +### T15 — **Counterweight** +- When you take 10% or more of your max HP in a single hit: + - Your next attack this round gains +1d8 Blunt damage. +--- +# LEVEL 11 (Pack: 1) +### T16 — **Relentless Posture** +- While below 50% Posture: + - Gain +2 Posture damage on unarmed hits. +--- +# LEVEL 12 (Pack: 2) +### T17 — **Bastion Radius** +- Enemies within 3m of you suffer -1 to Dodge and Parry Throws. +### T18 — **Stability Transfer** +- When you Block an Unblockable attack, regain 2 Ether. +--- +# LEVEL 13 (Pack: 1) +### T19 — **Seismic Weight** +- Your first melee hit each turn deals +2 Posture damage. +--- +# LEVEL 14 (Pack: 2) +### T20 — **Crown Resilience** +- Gain +10 Elemental AC. +### T21 — **Breaker’s Tempo** +- When you shove or knock a creature Prone: + - Gain Posture equal to your Constitution Modifier +--- +# LEVEL 15 (Pack: 1) +### T22 — **Unyielding Frame** +- Max Posture +5. +--- +# LEVEL 16 (Pack: 2) +### T23 — **Living Bulwark** +- Allies standing directly behind you gain +10 Physical AC. +### T24 — **Collision Authority** +- When you move into a creature’s space: + - They lose 2 Posture (1/turn per target). +--- +# LEVEL 17 (Pack: 1) +### T25 — **Execution Pressure** +- Ripostes you perform deal +1d10 damage +--- +# LEVEL 18 (Pack: 2) +### T26 — **Enduring Crown** +- Once per long rest, when reduced to 0 HP: + - Immediately stand with 1 HP without becoming Incapacitated +### T27 — **Overbearing Mass** +- Creatures less than 2 sizes bigger than you have disadvantage on grapple escape checks. +--- +# LEVEL 19 (Pack: 1) +### T28 — **Siege Momentum** +- If you Block two or more attacks in a round: + - Gain +3 Posture at the start of your next turn. +--- +# LEVEL 20 (Pack: 2) +### T29 — **Ironback Apex** +- Max HP +15. +- Max Posture +5. + +### T30 — **Hold the Line** +- While you have at least 1 Posture: + - You cannot be forcibly displaced by creatures of equal or smaller size. + - The first attack each round against you suffers -10% damage (after mitigation). \ No newline at end of file diff --git a/Players/IRONBACK KHAN/Upgrades/The Iron Back Technique.md b/Players/IRONBACK KHAN/Upgrades/The Iron Back Technique.md new file mode 100644 index 0000000..605a8d7 --- /dev/null +++ b/Players/IRONBACK KHAN/Upgrades/The Iron Back Technique.md @@ -0,0 +1,76 @@ +The mutation manifests in stages. The crown darkens. The back broadens. The musculature hardens into ridged slabs beneath the skin. When fully realized, the dorsal musculature forms a visible pattern, like hammered bronze beneath flesh. + +This is called **The Iron Back.** + +At Level 1, the player is an Ironback in designation only. The mutation has not fully awakened. + +Iron Back progression is permanent and independent of Talents and Mantras. + +Tier I is unlocked at level 3 +Tier II is unlocked at level 8 +Tier III is unlocked at level 15 + +# IRON BACK +--- +## Tier I - Dense Plating +- Maximum Posture increases by **+4**. +- Posture Regain per Turn increases by **+1**. +- Reduce Chip Damage taken while Blocking by 10% (after mitigation). +--- +## Tier II - Siege Frame +- When Blocking, reduce posture damage taken by an additional **10%** (total 35% reduction). +- When reduced to 0 Posture, you are not Staggered until the **end of the current attack sequence**. +- Maximum HP increases by **+10**. +--- +## Tier III - Bastion Physiology +- Once per combat, when reduced to 0 Posture, immediately restore **25% of maximum Posture** instead of becoming Staggered. +- While above 50% Posture: + - Gain **+5 Blunt AC** + - Gain **+5 Pierce AC** + - Gain **+5 Slash AC** +- Blocking an Unblockable attack no longer doubles posture damage (still cannot reduce below 0 AC). + + +## IRON ARMS +--- +## Tier I - War Grip +- You count as **two size categories larger** for grapple, pull, shove and drag checks. +- Creatures grappled by you have: + - -2 to Dodge Throws + - -2 to Parry Throws +- Unarmed attacks gain **+2 Posture Damage**. +--- +## Tier II - Breaker’s Leverage +- When you successfully Block an attack, your next melee attack deals: + - +1d4 Blunt Damage + - +3 additional Posture Damage +- When you initiate a grapple, immediately deal posture damage equal to your Constitution Modifier. +- Creatures you shove are pushed an additional **2 meters**. +--- +## Tier III - Legion Crusher +- Grappled creatures are treated as **Staggered** against your attacks. +- When you reduce a creature to 0 Posture: + - You may immediately Grapple or Shove as a free action. +- Unarmed attacks gain **+5% Penetration and +2 posture damage**. + + +## IRON LEGS +--- +## Tier I – Rooted Advance +- Gain permanent **Advantage on all forced movement resistance checks**. +- Your movement cannot be reduced below **3 meters** by terrain or slow effects. +- Creatures attempting to move through your space must treat it as difficult terrain. +--- +## Tier II – Chokepoint Authority +- Creatures within **3 meters** of you: + - Have their movement speed reduced by **1.5 meters**. +- When you Block an attack: + - Adjacent enemies lose **2 Posture**. +- You cannot be flanked. +--- +## Tier III - Living Rampart +- Your occupied space counts as **impassable terrain** for enemies unless they win a contested Strength check. +- When you are attacked by 2 or more creatures in one round: + - Gain **+3 Posture Regain** next turn. +- While you have at least 1 Posture: + - You cannot be knocked Prone or forcibly displaced by creatures of Large size or smaller. diff --git a/Players/Player Characters.md b/Players/Player Characters.md new file mode 100644 index 0000000..893bc5c --- /dev/null +++ b/Players/Player Characters.md @@ -0,0 +1,12 @@ +[[AXIOM-07 “DEVIANTCORE”]] +![[bloodisfuel.png]] + +[[IRONBACK KHAN]] +![[monkeballs.png]] + + +[[RAILCAT]] +![[jetstream scam.png]] + +[[RADIOACTIVE CRACK RAT]] +![[crack rat.png]] diff --git a/Players/RADIOACTIVE CRACK RAT/Black Meridian.md b/Players/RADIOACTIVE CRACK RAT/Black Meridian.md new file mode 100644 index 0000000..bb9396c --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/Black Meridian.md @@ -0,0 +1,106 @@ +Black Meridian Ore is a dull black mineral commonly found in mining regions across multiple luminants. In its raw state it has no beneficial effects. When consumed directly it only creates strong cravings and mild sickness. + +The ore becomes useful only after refinement. When ground into powder and combined with other substances - alcohol, fungal cultures, mining chemicals, or biological extracts - it produces stimulants with short-term effects. These mixtures are illegal in most Authority territories. + +The Skaven only knows **1 formula** at the start of the campaign. Additional variants are learned through experimentation, level progression, or finding notes from other miners and smugglers. + +--- +# Core Drug Crafting System +### Required Materials +To create a dose, the player needs: +* **1 unit Black Meridian Ore (powdered)** +* **1 reagent** +Reagents determine the variant produced. Examples include: +- Alcohol distillate +- Tunnel fungus cultures +- Industrial solvent +- Blood samples +- Chemical stabilizers +- Ether-infused materials +The player must know the correct formula to produce the intended variant. +--- +### Crafting Procedure +Drug crafting can be performed during: +- Long Rest +- Campfire + +Crafting time: **10 minutes per dose** +A character may carry multiple prepared doses (up to 5) + +--- +# Drug Use +Using a dose requires a **Bonus Action**. + +After consumption: +- The drug activates immediately +- The effect lasts **3 rounds** + +Each variant provides both benefits and drawbacks. The exact bonuses depend on the formula used. Only **one variant may be active at a time**. + +Consuming another dose while a previous one is active: +- Ends the current drug effect +- Applies the new effect +- Adds an additional +1 toxicity + +--- + +# Toxicity System +Black Meridian mixtures are unstable and harmful in large amounts. The character has a **Toxicity Meter**. +### Toxicity Gain +Each dose adds: +* **+2 Toxicity** +The meter resets to **0 after a Long Rest**. +### Toxicity Thresholds +**0 – 3 Toxicity** +No penalties. +**4 – 5 Toxicity** +Body strain begins. +- Posture Regain **-1** +**6 – 7 Toxicity** +Serious side effects. +- Movement Speed **-1.5 meters** +- Posture Regain -1 +- Dodge Throws lose **Advantage** +**8+ Toxicity** +Overdose risk begins. +* Every time another dose is consumed at this level the player must roll a **Constitution check**. +* Failure triggers an **Overdose Event**. + +--- +# Overdose System +When an overdose occurs, the body cannot handle the stimulant load. +Immediate effects: +- **Lose all remaining Posture** +- Become **Staggered** +- Take **1d6 Necrotic damage** +The active drug effect ends immediately. +After the overdose resolves: +- Toxicity resets to **3** +- The character cannot consume another dose for **3 rounds** +If another overdose occurs in the same encounter: +- HP immediately drops to **1** +- Character becomes **Incapacitated** under normal incapacitation rules. + +--- +# Variants +All variants use the same base ingredient: +**1 unit Black Meridian Ore (powdered)** +The second ingredient determines the variant. More complex reagents create stronger mixtures but are harder to obtain. + +All variants: +- Activate immediately on consumption +- Last **3 rounds** +- Apply **+2 Toxicity** +- Only one variant may be active at a time + +The Skaven beagins with **Variant I**. +# Variant I - Tunnel Brew _(Starting Variant)_ +**Reagent:** Cheap alcohol or fermented fungus +**Effect**: +- Movement Speed **+1.5 meters** +- Posture Regain **+1** +**Drawback**: +- Intelligence checks -1 +- Dexterity checks -1 + +Heart rate increases slightly and breathing becomes faster. It keeps the user alert but does not heavily strain the body. \ No newline at end of file diff --git a/Players/RADIOACTIVE CRACK RAT/Notes.md b/Players/RADIOACTIVE CRACK RAT/Notes.md new file mode 100644 index 0000000..9d625e4 --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/Notes.md @@ -0,0 +1,14 @@ +* Assassin type +* Dodge focus +* Addicted to super crack + * Variants? + * Supercharge [[AXIOM-07 “DEVIANTCORE”]]? +* Light weapons +* Explosives (Legalize Nuclear Bombs) +* Self-produced poison + * Black death/Plague? + * Containment Measure +* Mantras + * Shadow-wizard-money-gang? + * Death + * Cancer Touch \ No newline at end of file diff --git a/Players/RADIOACTIVE CRACK RAT/RADIOACTIVE CRACK RAT.md b/Players/RADIOACTIVE CRACK RAT/RADIOACTIVE CRACK RAT.md new file mode 100644 index 0000000..585deab --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/RADIOACTIVE CRACK RAT.md @@ -0,0 +1,71 @@ +The Skaven grew up in **Iron Meridian**, a massive industrial city controlled by the Central Authority. The city is built around factories, smelters, and mining operations. Most Skaven there survive by stealing food, selling information, or doing dangerous work no one else wants. + +He spent most of his early life in the lower districts, living off scraps and theft. Skaven communities in the city are unstable. Groups form and break apart quickly, and fights over territory are common. Learning to run, hide, and stab faster than the other rat was usually enough to survive. + +Eventually he was caught stealing from a warehouse owned by the Authority. Instead of executing him, they sent him to the mines outside the city. Cheap labor was more useful. The mines produced a strange ore. Workers called it **Black Meridian Ore**. The Authority banned its consumption because miners kept getting sick or unstable after handling it. The Skaven discovered something different. + +If the ore was ground into powder and mixed with other substances, for example alcohol, fungus cultures, certain chemicals used in minings, it produced a stimulant. The raw ore itself did nothing except create strong cravings, but mixtures created powerful temporary effects. + +Miners sometimes traded these mixtures secretly. The Skaven learned how to refine them better than most. That is where his addiction started. Over time he learned to produce multiple **variants** of the drug by mixing the ore with different reagents. + +The Skaven was considered too problematic to keep in the mines. He was caught with refined ore mixtures and blamed for distributing them. Instead of executing him, the overseers sold him to a merchant broker. Skaven are sometimes used as cheap meat cargo in long-distance shipments. Smaller races are easy to transport and not considered valuable enough to protect. + +--- +### Core Stats +**Health (HP): 13** +**Posture: 11** +Posture Regain per Turn: +- **1 + (Fortitude Modifier ÷ 2, rounded down)** +**Ether Capacity: 14** +Ether Regain per Turn: +- **1 + (Willpower Modifier ÷ 2, rounded down)** +**Sanity: 8** +**Base Movement Speed: 10.5 meters** + +--- +### Attribute Stats +**Strength: 15** +**Dexterity: 13** +**Fortitude: 14** +**Intelligence: 12** +**Willpower: 11** +**Charisma: 7** + +--- +### Physical AC +- **Blunt AC:** 5 +- **Slash AC:** 5 +- **Pierce AC:** 5 +### Elemental AC +- **Fire AC:** 0 +- **Lightning AC:** 5 +- **Force AC:** 5 +- **Necrotic AC:** 5 +- **Gas AC:** 10 +- **Holy AC:** 0 +- **Blood AC:** 5 +- **Ice AC:** 5 +--- +### Dodge Capability +- **Dodge Throws at Advantage.** +- Successful Dodge movement increases from **3 -> 4.5 meters**. +### Parry Capability +- **Parry Throws at Disadvantage.** +- Counterattack damage from Parries reduced by **–1**. +### Small Frame +- Gain **+1.5 meters movement speed** in confined spaces. +- **Knockback moves you +1.5 meter further.** +- Count as **Small** for grapple, pull, drag and shove interactions. +### Addict +* Your body has adapted to Black Meridian stimulants. +* While under the effect of a Black Meridian drug: + - Gain **+1 Posture Regain** + - Gain **+1.5 meter Movement Speed** +- Withdrawal begins after **24 hours** without a dose. + +### Withdrawal +If the Skaven goes **24 hours without consuming a dose**, withdrawal begins. +- Movement Speed **-3 meters** +- Posture Regain **-2** +- Ether Regain **-2** +- Lose **1 sanity** every hour. \ No newline at end of file diff --git a/Players/RADIOACTIVE CRACK RAT/The Crack Plague.md b/Players/RADIOACTIVE CRACK RAT/The Crack Plague.md new file mode 100644 index 0000000..1bc088f --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/The Crack Plague.md @@ -0,0 +1,107 @@ +The Skaven carries a rare infection known among miners as **Meridian Rot**. It is believed to originate from contaminated biological material that was exposed to Black Meridian ore deposits deep in Authority mines. + +The disease spreads only through **highly concentrated bodily fluids**. Casual contact is not enough. Infection requires open wounds and a significant amount of contaminated fluid. + +For most races the infection progresses quickly and kills within weeks. Skaven physiology slows its progression significantly. The disease remains in an **early dormant stage**, allowing the Skaven to survive while still carrying the pathogen. + +The Skaven’s long-term motivation is to eventually **remove or cure the infection**. Until then, the infection changes how his body chemistry behaves. + +One side effect is that his saliva becomes chemically unstable. When exposed to air it reacts with oxygen and biological tissue, allowing him to produce **reactive venom**. + +--- +# Core Mechanic - Venom Coating +The Skaven can coat his weapon using infected saliva. +### Apply Venom +**Action:** Bonus Action +**Target:** One weapon currently held +The venom remains active for: +- **3 successful hits** +- or **3 rounds**, whichever comes first +After that the coating breaks down and must be reapplied. Only **one weapon** may be coated at a time. Applying venom does not cost Ether. +### Venom Charges +The Skaven can produce a limited number of coatings before the infection becomes unstable. + +**Venom Charges:** +- Base charges: **2 per combat** +- Charges refresh after **Short Rest** + +Using a charge represents producing enough infected saliva to coat a weapon. + +--- +# Infection Stage System + +The plague slowly evolves over time. It has **four stages**, each unlocking stronger venom effects. The Skaven begins at **Stage I (Dormant Carrier)**. Progression is narrative and tied to the campaign. +### Stage I - Dormant Carrier +The infection exists but is mostly suppressed by Skaven biology. + +When a venom-coated weapon hits: +- Apply **Rot Poison** to the target for **2 rounds** +Rot Poison: +- Target takes **1 damage at the start of its turn** +- Target suffers **–1 Posture Regain** + +--- +## Stage II - Reactive Infection +The pathogen adapts to the host. The saliva becomes more chemically aggressive. + +Venom Charges increase: +- **3 charges per combat** + +Rot Poison becomes stronger: +- **2 damage per round** +- **–1 Posture Regain** +- Target suffers **–1 Constitution checks** + +--- +## Stage III - Symbiotic Carrier +The infection begins feeding off the host’s bloodstream. At this stage the Skaven can control venom more precisely. + +Venom Charges: +- **3 per combat** + +Venom coating lasts: +- **4 hits instead of 3** + +Rot Poison now applies: +- **2 damage per round** +- **–1 Posture Regain** +- **–1 Dodge Throw** + +The infection interferes with reflexes. + +--- +## Stage IV - Mutated Strain +The plague has adapted almost completely to the Skaven. Removing it becomes extremely difficult. + +Venom Charges: +- **4 per combat** + +Rot Poison becomes **Virulent Rot**: +- **3 damage per round** +- **–2 Posture Regain** +- **–1 Dodge Throw** +- If the target becomes **Staggered**, poison damage doubles for that round. + +--- +# Infection Risk + +Because the venom comes from a living infection, it can theoretically spread. +However transmission requires: +- Open wound +- Repeated exposure +- Large quantity of infected fluid + +In combat this rarely happens. +DMs may choose to apply infection if: +- The Skaven deliberately infects someone +- Someone consumes the venom +- A character is exposed repeatedly + +For most encounters it remains a combat toxin rather than a contagious disease. + +--- +# Biological Strain +Producing venom repeatedly irritates the infection. +If the Skaven uses **all venom charges in one encounter**, he suffers: +- **–1 Constitution checks until the end of combat** +due to inflammation around infected tissue. \ No newline at end of file diff --git a/Players/RADIOACTIVE CRACK RAT/Upgrades/Black Meridian Variants.md b/Players/RADIOACTIVE CRACK RAT/Upgrades/Black Meridian Variants.md new file mode 100644 index 0000000..21cd705 --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/Upgrades/Black Meridian Variants.md @@ -0,0 +1,122 @@ +# Variant II - Iron Vein +**Reagent:** Trace of industrial metals or mining dust +**Effect**: +- Physical AC **+5 (Blunt, Slash, Pierce)** +- Gain **+1 Constitution** for the duration +**Drawback** +- Movement Speed **-1.5 meters** +- -1 to dodge throws +- -1 to parry throws + +Blood thickens slightly and muscles tighten, making the body more resistant to impact but slower to react. +# Variant III - Sparkshot +**Reagent:** Spark gland or any mantra spark +**Effect**: +- Attack Throws **+1** +- Dexterity **+1** +**Drawback** +- Lightning AC becomes 0 + +The nervous system becomes overstimulated. Reaction speed increases, but the body becomes sensitive to electrical shocks. +# Variant IV - Grave Dust +**Reagent:** Animal blood or corpse residue +**Effect**: +- Regain **+10 HP immediately** +- Increase Max HP by 5 for the duration +- Necrotic AC **+15** +**Drawback** +- Posture Regain **-1** +- Posture damage taken +50% + +The mixture slows blood flow and reduces pain response. The body becomes tougher but sluggish. +# Variant V - Frostbite +**Reagent:** Frost fungus or Frost gland +**Effect** +- Ice AC **+15** +- Max posture **+2** +**Drawback** +- Movement Speed **–1.5 meters** +Body temperature drops slightly. Muscles stiffen but become resistant to cold. +# Variant VI - Smoke Lung +**Reagent:** Industrial solvent +**Effect**: +- Gas AC **+20** +- Gain **Advantage on Constitution saving throws** +**Drawback** +- Constitution checks **–1** + +The lungs fill with irritating vapors that temporarily harden the respiratory system but make breathing uncomfortable. +# Variant VII - Bloodrush +**Reagent:** Vial of Blood +**Effect**: +- Strength **+2** +- Melee damage **+1** +- Melee penetration **+5** +- Melee chip damage **+5** +**Drawback**: +- Blood AC **becomes 0** + +Adrenal glands overproduce stress hormones. Muscles become stronger but blood vessels weaken. +# Variant VIII - Gale Step +**Reagent:** Stratus orb or galestone (powder) +**Effect**: +- Movement Speed **+3 meters** +- Dodge Throws gain **+1** +**Drawback** +- Physical AC **–5** + +Muscles twitch constantly, forcing rapid movement but reducing the ability to brace against attacks. +# Variant IX - Etherwake +**Reagent:** Ether crystal +**Effect**: +- Ether Regain **+1** +- Ether Capacity **+5** +**Drawback**: +- Sanity loss from hostile environments increases by **1** +- Willpower -1 + +The brain becomes highly sensitive to etheric currents, improving control but stressing the mind. +# Variant X - Gravefire +**Reagent:** Charred bone dust +**Effect**: +- Necrotic AC **+30** +- Regain +2 Health immediately +- Regain 1 Health per round +- Gain **+2 damage against staggered targets** +**Drawback** +- **All elemental AC except necrotic drops to 0 + +Cell regeneration accelerates slightly but makes tissue unstable when exposed to heat. +# Variant XI - Predator Instinct +**Reagent:** Alpha/Crimson megalodaunt hide/blood or gland extract +**Effect**: +- Dexterity **+2** +- Advantage on Stealth Throws +**Drawback** +- Charisma **–2** + +Heightens aggression and predatory instincts. The user becomes socially hostile and erratic. +# Variant XII - Black Pulse +**Reagent:** Dead biomass +**Effect**: +- Posture **+3** +- Posture Regain **+2** +**Drawback** +- Every round roll a **Constitution check**. + - Failure causes **1d4 necrotic damage**. + +The heart begins pumping rapidly, flooding muscles with oxygen. The strain causes small internal damage. +# Variant XIII - Super Meridian Crack +**Reagent:** Stabilized Black Meridian crystal +This mixture was never used in the mines. It was developed by smugglers experimenting with concentrated ore. +**Effect**: +- Strength **+2** +- Dexterity **+2** +- Movement Speed **+3 meters** +- Max Posture **+3** +**Drawback**: +At the end of the 3-round duration: +- Take **1d6 Necrotic damage** +- Gain **+2 additional Toxicity** + +All body systems accelerate simultaneously. Muscles and nerves operate far beyond normal limits, which causes internal damage once the effect fades. \ No newline at end of file diff --git a/Players/RADIOACTIVE CRACK RAT/Upgrades/Legalize Nuclear Bombs.md b/Players/RADIOACTIVE CRACK RAT/Upgrades/Legalize Nuclear Bombs.md new file mode 100644 index 0000000..3816f14 --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/Upgrades/Legalize Nuclear Bombs.md @@ -0,0 +1,83 @@ +# Batch II - Structural Blasting +**Required Tool:** Reinforced Casing Kit +Allows shaping stronger containers for directional blasts. +### Trigger Unlocked +**Impact Trigger** +- Explodes immediately when it hits a surface or target. +### Bombs Unlocked +**Concussion Bomb** +* Crafting: + - Blasting powder + - Clay casing +* Explosion radius: **4.5 meters** +* Damage: + - **1d6 Blunt damage** +* Additional effect: + * Targets must make **DC 12 Constitution check** + * Failure: + - Target is **Staggered for 1 round** + +**Collapse Charge** +* Crafting: + - Blasting powder + - Reinforced metal casing +* Radius: **1.5 meters** +* Damage: + * **1d10 Blunt damage** +* Additional effects: + - **+5 posture damage** + - **Ignores AC and Shields** + - Deals double damages to structures + +--- +# Batch III - Chemical Charges +**Required Tool:** Chemical Mixing Kit +Allows stabilizing gases and volatile compounds. +### Trigger Unlocked +**Pressure Trigger** +- Placed on the ground +- Detonates when stepped on +- Requires **1 Action to place** +### Bombs Unlocked +**Gas Bomb** +* Crafting + - Blasting powder + - Glass container + - Chemicals +* Creates a **gas cloud radius 4.5 meters** +* Duration: **3 rounds** +* Targets inside cloud: + - Take **1d4 Gas damage per round** + - Constitution checks suffer **–1 penalty** + +**Incendiary Bomb** +* Crafting + - Blasting powder + - Oil + - Glass casing +* Explosion radius: **3 meters** +* Damage: + - **2d4 Fire damage** +* Targets hit must roll **Dexterity check** +* Failure: + * Apply **Burning for 2 rounds** + +--- +# Batch IV - Advanced Detonators +**Required Tool:** Ether Ignition Module +Allows remote triggering using ether sparks. +### Trigger Unlocked +**Ether Spark Trigger** +- Bomb can be placed instead of thrown +- Detonate using **Bonus Action** +- Costs **2 Ether** +- Maximum distance: **12 meters** +### Bomb Unlocked +**Scatter Bomb** +* Crafting: + - Blasting powder + - Multi-pellet casing +* Explosion radius: **4.5 meters** +* Damage: + - **1d4 Pierce damage (3 separate hits)** +* Each hit resolves separately against armor. \ No newline at end of file diff --git a/Players/RADIOACTIVE CRACK RAT/Upgrades/Mantras.md b/Players/RADIOACTIVE CRACK RAT/Upgrades/Mantras.md new file mode 100644 index 0000000..e69de29 diff --git a/Players/RADIOACTIVE CRACK RAT/Upgrades/Talents.md b/Players/RADIOACTIVE CRACK RAT/Upgrades/Talents.md new file mode 100644 index 0000000..82fa857 --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/Upgrades/Talents.md @@ -0,0 +1,160 @@ +*Unlocked by level. Packs alternate 1 / 2 / 1 / 2.* + +--- + +## Level 1 (Pack: 1) + +### T01 - Improvised Demolition +_(Passive unlock – explosives crafting becomes available even if not equipped)_ +When equipped: +- Bomb Throw Range **+3 meters** +- Bomb Damage **+1** +- Carry Capacity **+1 Bomb** + +--- +## Level 2 (Pack: 2) +### T02 - Fast Coating +- Applying Venom becomes **Free Action (1/round)** +- Venom Coating duration **+1 hit** +### T03 - Tunnel Runner +- Movement Speed **+1.5 meters** +- Dodge movement distance **+1.5 meters** +- Gain **+1 initiative** + +--- +## Level 3 (Pack: 1) +### T04 - Dirty Fighting +- Attacks against **Poisoned targets** deal **+2 damage** +- Gain **+2 posture damage** against poisoned targets + +--- +## Level 4 (Pack: 2) +### T05 - Quick Fuse +- Fuse bombs detonate **immediately at the end of your turn** instead of next round +### T06 - Skaven Persistence +- When reduced below **50% HP**, gain **+1 Posture Regain** and **+1.5 meters Movement Speed** + +--- +## Level 5 (Pack: 1) +### T07 - Venom Saturation +- Venom effects last **+1 round** +- Venom effects also drain 1 posture each round + +--- +## Level 6 (Pack: 2) +### T08 - Scrap Armor +- **Blunt AC +5** +- **Slash AC +5** +- **Pierce AC +5** +- Gain **+1 Posture** +### T09 - Chain Detonation +- Bombs exploding within **4.5 meters** of another bomb cause that bomb to detonate immediately + +--- +## Level 7 (Pack: 1) +### T10 - Sewer Stalker +- Advantage on **Stealth Throws** in dim or dark environments +- Movement Speed **+1.5 meters** while hidden +- First attack while hidden gains +10 Penetration and Chip Damage + +--- +## Level 8 (Pack: 2) +### T11 - Reactive Dodge +- When successfully Dodging, gain **+1 Posture** +- Once per round, Dodging an attack also **reduces the attacker’s Posture by 1**** +### T12 - Venom Pressure +- Venom damage also applies **+1 posture damage** + +--- +## Level 9 (Pack: 1) +### T13 - Bomb Technician +- Crafting time for explosives **reduced to 5 minutes** +- When crafting a bomb, have a 50% chance to craft one more +- Bomb crafting **never critically fails** + +--- +## Level 10 (Pack: 2) +### T14 - Bomb Satchel +- Carry Capacity **+2 Bombs** +### T15 - Venom Penetration +- Attacks against poisoned targets gain **+5 AC penetration** +- Venom damage **ignores Gas AC and Necrotic AC** + +--- +## Level 11 (Pack: 1) +### T16 - Rat Reflexes +- Dodge Throws gain **+1** +- Gain **+1 initiative** + +--- +## Level 12 (Pack: 2) +### T17 - Toxic Resilience +- **Gas AC +10** +- **Necrotic AC +10** +### T18 - Efficient Coating +- Venom Charges **+1 per combat** +- First venom coating each combat costs **no charge** + +--- +## Level 13 (Pack: 1) +### T19 - Opportunistic Strike +- Attacks against **Staggered targets** add your doubled riposte modifier instead. + +--- +## Level 14 (Pack: 2) +### T20 - Blast Control +- Damage taken from **your own bombs reduced by 50%** +- Damage taken from **all bombs reduced by 25%** +### T21 - Pressure Bombing +- Bombs deal **+3 posture damage** + +--- +## Level 15 (Pack: 1) +### T22 - Plague Carrier +- Venom damage **+2** +- When a poisoned enemy dies, their corpse explodes in a 3 meter radius. Anyone inside must make a DC 14 Constitution throw. + - On fail: They are applied with venom, as if they were attacked by you. + - Can only happen once per round. + +--- +## Level 16 (Pack: 2) +### T23 - Fleet Escape +- After successfully Dodging, gain **+1.5 meters movement speed** until end of turn +- The first dodge you make each round costs no reaction +### T24 - Hardened Body +- **Blunt AC +5** +- **Pierce AC +5** +- Gain **+8 HP** + +--- +## Level 17 (Pack: 1) +### T25 - Bomb Specialist +- Bomb Throw Range **+4.5 meters** +- Bomb damage **+1** + +--- +## Level 18 (Pack: 2) +### T26 - Rapid Deployment +- You may **throw a bomb as a Bonus Action once per combat** +- Bomb throwing does **not provoke reactions** +### T27 - Lethal dose +- First venom hit each combat lasts **twice as long** +- First venom hit deals **+2 damage** + +--- +## Level 19 (Pack: 1) +### T28 - Desperate Survivor +- When reduced to **1 HP**: + - Gain **+2 Posture Regain** for 2 rounds + - Gain **+3 meters movement speed** for 2 rounds + +--- +## Level 20 (Pack: 2) +### T29 - Master Demolitionist +- Bomb Damage **+2** +- Bomb radius **+1.5 meters** +- Bombs deal **+2 posture damage** +### T30 - Apex Scavenger +- Movement Speed **+3 meters** +- Posture Regain **+1** +- Dodge Throws **+1**** \ No newline at end of file diff --git a/Players/RADIOACTIVE CRACK RAT/~Ex-plosion!.md b/Players/RADIOACTIVE CRACK RAT/~Ex-plosion!.md new file mode 100644 index 0000000..99e30c3 --- /dev/null +++ b/Players/RADIOACTIVE CRACK RAT/~Ex-plosion!.md @@ -0,0 +1,56 @@ +The Skaven learned basic blasting techniques while working in Authority mining tunnels. Explosives were used to clear rock and collapse unstable shafts. Over time he learned how to modify blasting powder into small portable charges. + +This system becomes available once the character acquires the **Improvised Demolition** talent. + +--- +# Crafting Requirements + +Crafting explosives requires a **basic demolition toolset**: +- Fuse cutter +- Ignition flint +- Metal shaping tools +- Powder storage containers + +Crafting must be done during short rests or long rests + +Crafting time: **10 minutes per explosive** +Maximum carried explosives: **4** +Explosives degrade after **24 hours** if unused. + +--- +# Using Explosives +**Throwing a bomb:** Action +Range: **9 meters** + +Bombs land where thrown unless intercepted. Bombs follow standard damage resolution rules. Damage types are resolved normally and reduced by armor values where applicable. Explosions cannot be parried but may be avoided by successful dodges. + +--- +# Trigger Types + +Explosives require a trigger mechanism. +### Fuse Trigger +Delay before explosion. +- Detonates **at the start of the next round** +- Can be kicked or thrown again before detonation + +--- +# Bomb Types +Different bomb types use different casing and filler mixtures. +**Fragmentation Bomb** +* Crafting + - Blasting powder + - Scrap metal casing +* Explosion radius: **3 meters** +* Damage: + - **2d6 Pierce damage** +* Additional effect: + - Targets suffer heavy bleed buildup + +--- +# Carry Limit +The Skaven can carry: +* **Maximum 4 bombs** + +Carrying more increases instability. +If carrying **5 or more bombs**: +- Any critical failure on Dexterity checks or attack rolls causes **one bomb to detonate**. diff --git a/Players/RAILCAT/RAILCAT.md b/Players/RAILCAT/RAILCAT.md new file mode 100644 index 0000000..43f9939 --- /dev/null +++ b/Players/RAILCAT/RAILCAT.md @@ -0,0 +1,71 @@ +'Railcat' is what Summer Company officers call her in reports when they do not wish to write her real name. + +Among the Felinors, freedom is instinct. They climb where they wish. They steal what shines. They laugh at danger and slip through fingers like smoke. A Felinor belongs to no one. She once embodied that perfectly. + +A former Deepdelver of the Ignition Union, she descended into the Depths with a grin and came back with monsters carved into memory. + +Then she lost her arm, her blade, her choice. Now she serves the Summer Company. Not as a patriot, but as an asset. She helps them because she must. And that is the cruelest cage of all for a Felinor. She still smiles. She still tilts her head playfully. She still makes jokes before a fight. + +But when the duel begins, the air changes, her tail stops moving... And someone is about to lose. + +--- +### Core Stats +**Health (HP): 16** +**Posture: 15** +Posture Regain per Turn: +- **1 + (Dexterity Modifier ÷ 2, rounded down)** +**Ether Capacity: 16** +Ether Regain per Turn: +- **1 + (Willpower Modifier ÷ 2, rounded down)** +**Sanity: 8** +**Base Movement Speed: 9 meters** + +--- +### Attributes +**Strength: 10** +**Dexterity: 17** +**Constitution: 12** +**Intelligence: 13** +**Willpower: 12** +**Charisma: 14** + +--- +### Physical AC +- **Blunt AC:** 5 +- **Slash AC:** 10 +- **Pierce AC:** 5 +### Elemental AC +- **Fire AC:** 10 +- **Lightning AC:** 15 +- **Force AC:** 5 +- **Necrotic AC:** 5 +- **Gas AC:** 5 +- **Holy AC:** 5 +- **Blood AC:** 10 +- **Ice AC:** 5 +--- +### Signature Traits + +**Parry Capability**: +- On successful Parry, regain **1 additional Posture**. +- Counterattack damage increased by **+2**. + +**Feral Instinct** +The first time per combat she would become Staggered from reaching 0 Posture: +- She is not Staggered. + - She still takes the full HP damage of the breaking attack. +* Posture restored to 50%. + - Cannot Regain Posture whilst in Feral State. +- Her weapon is flung 6 meters away. +- She enters **Feral State** until she picks up her weapon. + - Cannot pick up your weapon for the first 2 rounds. +While in Feral State: +- Unarmed attacks deal **1d6 Blunt** +- Posture Damage increased by +3 +- Movement speed increased by +3 meters +- Cannot be Frightened + +[[The Arcblade|Memories broken,]] [[Summer Company Prosthetic|the truth goes unspoken,]] [[Arcblade|I've even forgotten my name!]] +[[Players/RAILCAT/Upgrades/Mantras|I don't know the season,]] [[Mantras - Feral Mode|or what is the reason,]] [[Prosthetic|I'm standing here holding my blade!]] +[[Super-Modules|A desolate place (place)]], [[Players/RAILCAT/Upgrades/Talents|Without any trace (trace)]] +It's only the cold wind I'm feeling. diff --git a/Players/RAILCAT/Summer Company Prosthetic.md b/Players/RAILCAT/Summer Company Prosthetic.md new file mode 100644 index 0000000..e96c2d1 --- /dev/null +++ b/Players/RAILCAT/Summer Company Prosthetic.md @@ -0,0 +1,43 @@ +### “Regulator Arm - SC Pattern 7” +> “You’re not our prisoner. +> You’re our investment.” +> - Summer Company Quartermaster + +**Weapon Type:** +Counts as **Unarmed (Metal)** +Can be used even while disarmed. + +**Passive - Reinforced Limb** +- You may Parry while unarmed without penalty. +- Your unarmed strikes gain: + - **1d6 Blunt** + - Count as Metal for interactions. +- Gain **+1 Posture Regain per turn** while above 0 Posture. + +**Passive - Feedback Channel** +The prosthetic stores kinetic stress. +Each time you successfully Parry: +- Gain 1 Torque (max 2). +At 2 Torque: +- Your next unarmed attack deals: + - +1d6 Blunt (separate instance) +- Torque resets to 0. + +**Active - Magnetic Recall (CD 4)** +Bonus Action: +- Pull your Arcblade to your hand from up to 9 meters away. +- Does not provoke reactions. +- If used while in Feral State: + - Ends Feral State immediately. + + +--- +# The Summer Company Killswitch +The Regulator Arm - SC Pattern 7 was not built for trust. It contains a **Failsafe Governor Node**, embedded near the ether channel spine. + +The Company can: +- Disable Magnetic Recall +- Suppress Torque gain +- Lock offensive modules +- Or fully paralyze the arm +They don’t do it casually. But they _can_. \ No newline at end of file diff --git a/Players/RAILCAT/The Arcblade.md b/Players/RAILCAT/The Arcblade.md new file mode 100644 index 0000000..4f487d3 --- /dev/null +++ b/Players/RAILCAT/The Arcblade.md @@ -0,0 +1,18 @@ +>“It’s a beautiful blade. Elegant. Dangerous... Yet it still loses to a trigger pull.” + - Gunsmith Rosen +# Stage I - Fractured Arcblade +_A broken relic. Heat leaks from its cracks._ +**HP Damage:** 1d8 Slash + 1d4 Fire (separate instance) +**Posture:** 5 +**Penetration:** 10% +**Chip:** 10% +**Riposte Modifier:** +1d8 + +**New Passive - Ember Vein**: Critical hits apply **Burning** (1d4 Fire for 3 rounds, refresh only). + +**Critical Art - “Flicker Dash” (CD 5)** +Dash 6 meters in a straight line. +- The first target hit takes: + - 1d8 Slash + - 1d4 Fire +- Applies Burning if it Crits normally. \ No newline at end of file diff --git a/Players/RAILCAT/Upgrades/Arcblade.md b/Players/RAILCAT/Upgrades/Arcblade.md new file mode 100644 index 0000000..46b0809 --- /dev/null +++ b/Players/RAILCAT/Upgrades/Arcblade.md @@ -0,0 +1,135 @@ +# Stage II - Stabilized Core +_The lightning channel hums faintly again._ +**HP Damage:** 1d8 Slash + 1d4 Fire + 1d4 Lightning +**Posture:** 6 +**Penetration:** 15% +**Chip:** 10% +**Riposte Modifier:** +1d8 +**Ember Vein**: Critical hits apply Burning. + +**New Passive - Static Wake**: After hitting the same target 3 times in 2 rounds: +- Apply **Sapped (2 rounds)**. + +**Flicker Dash (Improved)** +- Dash 6 meters. +- 1d8 Slash + 1d4 Fire + 1d4 Lightning. +- Applies Burning if it Crits normally. +- Counts as 1 stack toward Static Wake. + +--- +# Stage III - Tempered Rail +*The blade stops flickering.* +**HP Damage:** 1d10 Slash + 1d4 Fire + 1d6 Lightning +**Posture:** 8 +**Penetration:** 20% +**Chip:** 12% +**Riposte Modifier:** +1d10 + +**Ember Vein**: Critical hits apply Burning. +* If target is already Burning -> deal +1d6 Fire immediately. + +**Static Wake**: +* Now requires only 2 hits within 2 rounds to apply Sapped. + +**Critical Art Upgrade - “Rail Dash” (CD 4)** +Dash 9 meters in a straight line. +- First target hit: + - 1d10 Slash + - 1d6 Fire + - 1d6 Lightning +- Applies Burning if it Crits normally. +- Counts as 1 hit for Static Wake. +- If target is Burning -> deal +1d6 Fire immediately. + +**“Rail Reversal” (CD 5)** +Trigger: +* After successfully Parrying an enemy +Effect: +- Teleport 3 meters behind the attacker. +- Strike critically for: + - Weapon damage + - +1d6 Fire +- Counts toward Static Wake. + +--- +# Stage IV - Overcharged Arcblade +_Fire and Lightning begin feeding each other._ +**HP Damage:** 1d10+1 Slash + 1d6 Fire + 1d6 Lightning +**Posture:** 10 +**Penetration:** 25% +**Chip:** 15% +**Riposte Modifier:** +1d10 + +**Ember Vein**: Critical hits apply Burning. +If target is Burning and becomes Shocked: +- Burning immediately ticks once for maximum value. + +**Static Wake**: When Sapped ends and Shock is applied: +- Target takes additional 1d6 Lightning damage. + +**Rail Dash (Overcharged)** +Dash 9 meters. +* Each target hit: + - 1d10+1 Slash + - 1d6 Fire + - 1d6 Lightning +- Applies Burning if it Crits normally. +- Counts as 1 hit for static Wake. +- If target is Burning -> deal +1d6 Fire immediately. +* If this strike causes Sapped to expire: + - Shock triggers immediately instead of waiting. + +--- + +# Stage V - True Arcblade (Mythical) +_The Deep remembers this weapon._ +Weapon class upgrades to Heavy Railblade. +**HP Damage:** 1d10+1d6 Slash + 1d6 Fire + 1d6 Lightning +**Posture:** 11 +**Penetration:** 30% +**Chip:** 15% +**Riposte Modifier:** +1d12 + +**Ember Vein**: Critical hits apply Burning. +* Burning damage increases to **1d6 per round**. + +**Static Wake:** +On every Critical: +- Apply **Sapped (2 rounds)**. +- When Sapped ends: + - Shock triggers as normal. + - Target also loses 2 Posture. + +**Rail Convergence** +If you Riposte a Shocked target +- Add +1d12 Lightning damage. +- Ignore an additional 10% Lightning AC for that Riposte only. + +**Rail Dash (True Form)** +Dash 9 meters. +- Automatically Crits the first target struck. +- Each target hit: + - 1d10+1 Slash + - 1d6 Fire + - 1d6 Lightning +- Applies Burning on Crit. +- Counts as 1 hit for static Wake. +- If target is Burning -> deal +1d6 Fire immediately. +- Applies Sapped. +- If target is already Sapped: + - Immediately trigger Shock. + - Burning ticks at maximum. + +**“Rail Reversal” (CD 5):** +Trigger: +* After successfully Parrying an enemy +Effect: +- Teleport 3 meters behind the attacker. +- Strike critically for: + - Weapon damage + - +1d12 Fire + If the enemy is Shocked: + - +1d12 Lightning + - Ignore 10 Lightning and Fire AC (this stacks with Rail Convergence rules). +- Counts toward Static Wake. + diff --git a/Players/RAILCAT/Upgrades/Mantras - Feral Mode.md b/Players/RAILCAT/Upgrades/Mantras - Feral Mode.md new file mode 100644 index 0000000..7b4d799 --- /dev/null +++ b/Players/RAILCAT/Upgrades/Mantras - Feral Mode.md @@ -0,0 +1,128 @@ +# 1-Star Mantras +## Pounce Charge +Type: Combat +Cost: 4 Ether +Action: Action +Cooldown: 3 rounds +Inspired by Sam's **Charge attack**. +Effect: You launch forward like a predator. +- Dash **6 meters** in a straight line. +- First target hit takes: +Damage: 1d6 Blunt + 1d4 Lightning +Effects: +- Target is **pushed 3 meters**. +- Target loses **2 Posture**. +If the target is **Burning**: +- Add **+1d4 Fire**. + +--- +## Predator Kick +Type: Combat +Cost: 3 Ether +Action: Bonus Action +Cooldown: 2 rounds +A brutal taekwondo-style kick. +Damage: +* 1d6 Blunt +Effects: +- Deal **+2 Posture Damage**. +If used immediately after **moving at least 3 meters**: +- Add **+1d4 Lightning**. + +--- +## Feral Step +Type: Mobility +Cost: 2 Ether +Action: Bonus Action +Cooldown: 2 rounds +A sudden low feline sidestep. +Effect: +* Move **3 meters**. +This movement: +- Does **not provoke reactions** +- May move **through enemy spaces** +If used after **Dodging**: +- Gain **+1 Posture**. +--- +# 2-Star Mantras +## Sweep Trip +Type: Combat +Cost: 4 Ether +Action: Action +Cooldown: 3 rounds +Inspired by **Sam's tripping attacks**. Sweep low with your right leg, tripping enemies and dealing minimal damage. +Damage: +* 1d6 Blunt +Effects: +* Target must make a **Dexterity Save**. +Failure: +- Target falls **Prone** +- Target loses **3 Posture** +Success: +- Target loses **2 Posture**. +## Feral Rush +Type: Combat +Cost: 5 Ether +Action: Action +Cooldown: 4 rounds +A savage flurry of clawing strikes. +Damage: +* Three hits, 1d4 Blunt each +Each hit: +- Deals **+1 Posture damage** +If at least **2 hits land**: +- Apply **Sapped (2 rounds)**. +## Tail Feint +Type: Support +Cost: 3 Ether +Action: Bonus Action +Cooldown: 4 rounds +A deceptive twitch of movement. +For **1 round**: +- Your next attack gains **+5 Chip Damage** +- Your next attack gains **+5 Penetration** +- Your next attack deals **+2 Posture damage** +If the attack **breaks posture**: +- Gain **+2 Posture** + +--- +# 3-Star Mantras +## Savage Launcher +Type: Combat +Cost: 6 Ether +Action: Action +Cooldown: 4 rounds +You uppercut with the prosthetic arm. +Damage: +* 1d10 Blunt + 1d6 Lightning +Effects: +- Launch the enemy **3 meters upward** +- Push **3 meters** away from you. +Enemy loses **3 Posture**. +If the enemy is **Sapped**: +- Immediately trigger **Shock**. +## Predator Maul +Type: Combat +Cost: 7 Ether +Action: Action +Cooldown: 4 rounds +You grab and slam your opponent into the ground. Target must be within **1.5 meters**. +Damage: 2d8 Blunt +Effects: +- Target loses **4 Posture**. +- Target falls prone. +If the target is already **Prone**: +- Add **+1d8 Blunt**. +## Scavenger Bite +Type: Combat +Cost: 6 Ether +Action: Action +Cooldown: 5 rounds +You pounce onto the enemy, slam them to the ground and tear into them. +Damage: +* 1d6 Blunt + 1d6 Slash + 1d6 Pierce +Effects: +- Target falls prone and gains heavy bleed buildup. +- Target loses **3 Posture**. +If target is **Burning or Shocked**: +- Add **+1d6 Lightning** or **+1d6 Fire** respectively. \ No newline at end of file diff --git a/Players/RAILCAT/Upgrades/Mantras.md b/Players/RAILCAT/Upgrades/Mantras.md new file mode 100644 index 0000000..313591f --- /dev/null +++ b/Players/RAILCAT/Upgrades/Mantras.md @@ -0,0 +1,180 @@ +# 1-Star Mantras + +--- +## Flash Draw +**Type:** Combat +**Cost:** 4 Ether +**Action:** Action +**Cooldown:** 2 rounds +Quick unsheathe slash. +- 1d8 Slash + 1d4 Fire +- If used after moving at least 3m: + - Gain +5 Penetration +## Palm Break +**Type:** Combat +**Cost:** 3 Ether +**Action:** Bonus Action +**Cooldown:** 3 rounds +A sudden prosthetic palm strike. +- 1d6 Blunt +- +2 Posture damage +- If target attacked you last turn: + - Add +1d4 Lightning +## Rising Cut +**Type:** Combat +**Cost:** 5 Ether +**Action:** Action +**Cooldown:** 3 rounds +Upward slash that launches slightly. +- 1d10 Slash +- On hit: + - Push target 3m + - Gain +1 Posture +## Sheathe Guard +**Type:** Support +**Cost:** 3 Ether +**Action:** Bonus Action +**Cooldown:** 4 rounds +You sheath the Arcblade and enter a still, predatory guard until the start of your next turn. +- Gain +1 on Parry checks +- If you successfully Parry while in this stance: + - Gain 1 Torque + - Your immediate counterattack gains +5 Penetration and +5 Chip damage +- If you Dodge while in this stance: + - Move +1.5m (total 4.5m) + +## Arc Flick +**Type:** Combat +**Cost:** 4 Ether +**Action:** Bonus Action +**Cooldown:** 3 rounds +A short-range, wrist-driven slash meant to punish spacing mistakes. +- 1d6 Slash + 1d4 Lightning +- If the target is within 1.5m: + - +1 Posture damage + - Lightning damage becomes 1d6 +- Counts as 1 hit toward Static Wake + +--- +# 2-Star Mantras +## Rush Slash +**Type:** Combat +**Cost:** 6 Ether +**Action:** Action +**Cooldown:** 4 rounds +Dash 6m and strike. +- 1d10 Slash + 1d6 Lightning +- If target is Sapped: + - Immediately trigger Shock. +## Multi-Draw +**Type:** Combat +**Cost:** 5 Ether +**Action:** Action +**Cooldown:** 3 rounds +Four fast light strikes +- 4 instances of 1d4 Slash +- If at least 2 hit: + - Gain +2 Posture +## Rail Slash +**Type:** Combat +**Cost:** 7 Ether +**Action:** Action +**Cooldown:** 5 rounds +Sheathe -> burst 4.5 meters through an enemy's space (cannot end inside). +- 1d8 Slash +- 1d8 Fire +- 1d8 Lightning +- Can only hit target once. +## Backflip Step +**Type:** Mobility +**Cost:** 3 Ether +**Action:** Bonus Action +**Cooldown:** 3 rounds +Backflip 4.5m. +If used immediately after Parrying: +- Regain 2 Posture +- Next attack gains +5 Chip Damage. +## Predatory Focus +**Type:** Support +**Cost:** 4 Ether +**Action:** Bonus Action +**Cooldown:** 5 rounds +Mark one target for 2 rounds: +* Against that target only: + - +5 Chip Damage + - +2 Posture damage +## Slash Sheathe Combo +**Type:** Combat +**Cost:** 6 Ether +**Action:** Action +**Cooldown:** 4 rounds +A three-beat sequence that ends in a sheath-launch. +- Hit 1: 1d6 Slash +- Hit 2: 1d6 Slash +- Hit 3: 1d8 Slash + 1d4 Fire +If at least 2 hits land: +- Apply Sapped (2 rounds) if Static Wake would apply this round anyway (this doesn’t bypass the requirement, it just converts the trigger into an immediate application) + +--- +# 3-Star Mantras + +## Verdict (NB) +**Type:** Combat +**Cost:** 8 Ether +**Action:** Action +**Cooldown:** 5 rounds +Blade glows white-yellow. +Leap and slam down. +- 2d10 Slash +- 1d8 Lightning +- Cannot be Blocked or Parried +## Execution (NB) +**Type:** Combat +**Cost:** 9 Ether +**Action:** Action +**Cooldown:** 5 rounds +Quick lunging impale. +- 2d8 Slash +- 1d8 Fire +- Cannot be Blocked +- If target is Shocked: + - Add +1d12 Lightning. +## Multi Dash +**Type:** Mobility +**Cost:** 10 Ether +**Action:** Action +**Cooldown:** 6 rounds +Dash 3 times (choose directions) à 3 meters each. +Each dash: +- 1d8 Slash + 1d6 Lightning +Can hit same target only once. + +## Charge Counter +Type: Combat +Cost: 7 Ether +Action: Reaction (in place of a counter-attack) +Cooldown: 5 rounds +Trigger: You **successfully Parry** an enemy attack. +Effect: +- Instantly move **3 meters through the attacker’s space**. +* Strike for: + * Weapon Damage + * +1d6 Fire +* If the target is **Shocked**: + - Add **+1d8 Lightning**. + +--- +# Signature + +## Blade Lock +Type: Combat +Cost: 7 Ether +Action: Reaction +Cooldown: 5 rounds +Trigger: Enemy within **3 meters** attacks you with a melee weapon. +Effect: Both fighters enter a **Blade Lock**. You immediately make a **contested Strength or Dexterity throw**. If you win: +- Deal **1d10 Slash** +- Target loses **4 Posture** +- Target is knocked back 4.5 meters +If you lose: +- Lose **2 Posture**. \ No newline at end of file diff --git a/Players/RAILCAT/Upgrades/Prosthetic.md b/Players/RAILCAT/Upgrades/Prosthetic.md new file mode 100644 index 0000000..c45f85a --- /dev/null +++ b/Players/RAILCAT/Upgrades/Prosthetic.md @@ -0,0 +1,83 @@ +# Branch 1 - Offensive Modules + +--- +## Impact Governor +When Torque is consumed: +- Also deal +2 Posture damage. +If the target is Sapped: +- Deal an additional +1 Posture. + +--- +## Voltage Injector +When you Parry a Sapped enemy: +- Immediately deal 1d6 Lightning (separate instance). +If this causes Shock: +- Target loses 1 additional Posture. + +--- +## Duelist’s Executioner +If you strike a Shocked target with an unarmed attack: +- Add +1d8 Blunt. +- Gain 5 penetration for that attack +Once per turn. + +--- +## Railbreaker Knuckles +When you Riposte: +- Add +1d6 Blunt. +- If target is Burning → deal +1d6 Fire. + +--- +# Branch 2 - Defensive Modules + +--- +## Counterbalance Gyro +When you fail a Parry: +- Reduce incoming Posture damage by 2. +Once per round. + +--- +## Shock Dampener Lattice +When Shocked: +- Movement reduction is halved. +- Passive posture regen is not disabled. + +--- +## Reactive Plating +When reduced below 50% Posture: +- Gain +5 Physical AC until start of next turn +Once per 3 rounds. + +--- +## Feral Stabilizer (Capstone Defensive) +While in Feral State: +- You regain 1 Posture per turn. +- Parry failures do not cause additional posture penalties. + +--- +# Branch 3 — Utility Modules + +--- +## Grapple Line Emitter +Bonus Action (CD 5): +- Pull a target 3 meters toward you. +- If they collide with terrain: + - Deal 1d6 Blunt. +Does not apply Sapped. + +--- +## Vector Thrusters +After a successful Parry: +- You may move 3 meters without provoking reactions. + +--- +## Overclocked Recall +Magnetic Recall now: +- Grants +3 meters movement speed until end of turn. +- Your next attack gains +5 Penetration + +--- +## Kinetic Lock +If you Parry the same target twice in 2 rounds: +- Their next Dodge is made at disadvantage. + diff --git a/Players/RAILCAT/Upgrades/Super-Modules.md b/Players/RAILCAT/Upgrades/Super-Modules.md new file mode 100644 index 0000000..16af1ad --- /dev/null +++ b/Players/RAILCAT/Upgrades/Super-Modules.md @@ -0,0 +1,54 @@ +# OFFENSIVE SUPER-MODULE +## Union Strength Core +> “Ouch. That'll hurt. Remind me to not piss you off?" +### Passive - Conduction Loop +When you apply **Shock** to a target: +- Immediately gain 1 Torque. +- Your next unarmed strike this turn: + - Ignores 10 Physical AC + - Deals +1d8 Lightning (separate instance) +Once per round. +### Passive - Breakpoint Exploit +When you deal damage to a target below 50% Posture: +- Gain +2 on attack rolls. +This does not apply to Ripostes. + +--- +# DEFENSIVE SUPER-MODULE + +## Union Endurance Core +> “That sounded like it hit something important. Oh, nope, nevermind.” +### Passive - Refusal to Yield +The first time each combat you would become Staggered: +- Instead remain at 1 Posture. +- Gain +5 Physical AC until end of next turn. +### Passive - Pressure Feedback +Whenever you Block an attack: +- Gain 1 Torque. +### Passive - Depth Stability +When below 50% HP: +- Gain +1 Posture Regain. + +--- +# UTILITY SUPER-MODULE +## Union Control Core +> “Not what I would've picked but... eh. Your arm, your choice, I suppose." +### Passive - Anchor Mark +After successfully Parrying a target: +- Mark them until the end of your next turn. +If the marked target: +- Dodges +- Moves more than 3m voluntarily +You may use your Reaction to: +- Pull them 3m toward you +- Deal 1d6 Lightning (separate instance) +Does not apply Sapped. +Does not trigger Shock by itself. +### Passive - Pursuit Vector +After using Magnetic Recall: +- Gain +3m movement. +- Your next attack this turn cannot be Dodged. +Can still be Parried. +### Passive - Duel Focus +If only one hostile creature is within 6m: +- Gain +5 Penetration. \ No newline at end of file diff --git a/Players/RAILCAT/Upgrades/Talents.md b/Players/RAILCAT/Upgrades/Talents.md new file mode 100644 index 0000000..85ebcd6 --- /dev/null +++ b/Players/RAILCAT/Upgrades/Talents.md @@ -0,0 +1,145 @@ +_(Unlocked by level. Packs alternate 1 / 2 / 1 / 2)_ + +--- +# LEVEL 1 (Pack: 1) +### T01 - **Duelist’s Poise** +- Max Posture +2. +- When you Parry, regain **+1 additional Posture**. + +--- +# LEVEL 2 (Pack: 2) +### T02 - **Feline Footwork** +- After moving **3m or more** on your turn: + - Gain **+1 on your next Parry Throw**. +### T03 - **Arcblade Familiarity** +- Arcblade attacks gain **+5 Penetration** and **+5 Chip Damage**. + +--- +# LEVEL 3 (Pack: 1) +### T04 - **Predatory Pressure** +- Your **first melee attack each turn** deals **+1 Posture damage**. + +--- +# LEVEL 4 (Pack: 2) +### T05 - **Summer Steel** +- Prosthetic unarmed attacks deal **+1d4 Blunt damage**. +### T06 - **Momentum Parry** +- When you successfully Parry: + - Gain **+3 meters movement** until the end of your turn. + +--- +# LEVEL 5 (Pack: 1) +### T07 - **Railcat Instinct** +- Gain **+1 initiative**. +- Gain **+1 on Dodge Throws**. + +--- +# LEVEL 6 (Pack: 2) +### T08 - **Execution Rhythm** +- When you Riposte a staggered enemy: + - Regain **2 Posture**. +### T09 - **Kinetic Punishment** +- If an enemy **misses you with a melee attack**: + - Your next attack against them deals **+1d6 Lightning** (1/round). + +--- +# LEVEL 7 (Pack: 1) +### T10 - **Deepdelver Conditioning** +- Max HP +6. + +--- +# LEVEL 8 (Pack: 2) +### T11 - **Clean Exchange** +- If you successfully Parry and deal damage before your next turn: + - Gain **+1 Posture**. +### T12 - **Arcstep** +- When you Critically hit: + - Move **3m** without provoking reactions. + +--- +# LEVEL 9 (Pack: 1) +### T13 - **Railcat Momentum** +- If you hit the same enemy twice in a round: + - Deal **+2 Posture damage** on the second hit. + +--- +# LEVEL 10 (Pack: 2) +### T14 - **Feral Blood** +- While in **Feral State**: + - Gain **+3 meters movement speed**. +### T15 - **Reactive Draw** +- If you Parry while below **50% Posture**: + - Gain **+5 Penetration** and **+5 Chip Damage** on your counterattack. + +--- +# LEVEL 11 (Pack: 1) +### T16 - **Storm Reflex** +- When you Dodge successfully: + - Your next attack deals **+1d4 Lightning**. + +--- +# LEVEL 12 (Pack: 2) +### T17 - **Railbreaker** +- When you deal **6+ Posture damage** in one attack: + - Deal **+2 additional Posture damage** (1/round). +### ~~T18 - **Prosthetic Guard**~~ +- ~~You no longer suffer disadvantage when Parrying **unarmed**.~~ + +--- +# LEVEL 13 (Pack: 1) + +### T19 - **Arcblade Tempo** +- Arcblade attacks deal **+1d4 Fire**. + +--- +# LEVEL 14 (Pack: 2) +### T20 - **Hunter’s Patience** +- If you take **no damage during a round**: + - Gain **+2 Posture** at the start of your next turn. +### T21 - **Backline Predator** +- Attacks against enemies **who have not attacked you this round** gain **+5 Penetration**. + +--- +# LEVEL 15 (Pack: 1) +### T22 - **Felinor Balance** +- Max Posture +3. + +--- +# LEVEL 16 (Pack: 2) +### T23 - **Predator’s Punish** +- When an enemy fails a Dodge against you: + - Deal **+2 Posture damage**. +### T24 - **Static Build** +- When you apply **Sapped**: + - Target immediately loses **+1 Posture**. + +--- +# LEVEL 17 (Pack: 1) +### T25 - **Execution Discipline** +- Ripostes you perform deal **+1d8 damage**. + +--- +# LEVEL 18 (Pack: 2) +### T26 - **Unbroken Predator** +- The first time each combat you would be Staggered: + - ~~Remain at **1 Posture instead**.~~ +### T27 - **Storm Catalyst** +- When you trigger **Shock**: + - Deal **+1d6 Lightning damage**. + +--- +# LEVEL 19 (Pack: 1) +### T28 - **Flawless Duel** +- If you Parry **twice in the same round**: + - Gain **+3 Posture** at the start of your next turn. + +--- +# LEVEL 20 (Pack: 2) +### T29 - **Arcblade Apex** +- Arcblade damage: + - **+1d6 Fire** + - **+1d6 Lightning** +### T30 - **Predator Unleashed** +- While in **Feral State**: + - Gain **+3 Posture damage** + - Gain **+3 meters movement speed**. \ No newline at end of file diff --git a/Players/SOLIDIFIED SERPENT/Non-Magic-Missile (NMM).md b/Players/SOLIDIFIED SERPENT/Non-Magic-Missile (NMM).md new file mode 100644 index 0000000..36f0049 --- /dev/null +++ b/Players/SOLIDIFIED SERPENT/Non-Magic-Missile (NMM).md @@ -0,0 +1,19 @@ +Compact recoilless rocket launcher used by Summer Company demolition teams. + +Length: **~55 cm**. Carried on the back. +### Weapon Profile +**Damage:** 2d8 Fire + 1d8 Force +**Posture Damage:** 4 (NB) +**Penetration:** 20% +**Chip Damage:** 40% +**Riposte Modifier:** - +**Blast Radius:** 4.5 meters +Targets within radius are hit individually. +**Properties:** Heavy, Two-Handed, Explosive, Loud, Unparryable + +### Reload +After firing: +- The launcher must be **reloaded for 1 round** before firing again. +- Reloading normally consumes the **entire turn**. + +The Enforcer begins encounters with 3 Rockets. More are gained from summer company outposts or during short rests. \ No newline at end of file diff --git a/Players/SOLIDIFIED SERPENT/Solidified Serpent.md b/Players/SOLIDIFIED SERPENT/Solidified Serpent.md new file mode 100644 index 0000000..6363d42 --- /dev/null +++ b/Players/SOLIDIFIED SERPENT/Solidified Serpent.md @@ -0,0 +1,57 @@ +A field operative used when the Summer Company needs fortifications removed, ambushes erased, or clustered enemies dispersed quickly. Unlike most Company agents who rely on revolvers and precision rifles, this operative carries a compact recoilless launcher - the **Non-Magic-Missile (NMM)**. + +The weapon is not designed for dueling. It is designed to delete groups. The Enforcer operates quietly until the moment of engagement. One rocket. One blast. Then reposition before retaliation arrives. + +They are Etrean-born and carry the cultural arrogance typical of their homeland, openly dismissive of foreigners and particularly critical of the other party members. + +--- +# Core Stats +**Health (HP): 18** +**Posture: 12** +Posture Regain per Turn: +- **1 + (Dexterity Modifier ÷ 2, rounded down)** +**Ether Capacity: 10** +Ether Regain per Turn: +- **1 + (Willpower Modifier ÷ 2, rounded down)** +**Sanity: 9** +**Base Movement Speed:** 7.5 meters +# Attributes +**Strength:** 12 +**Dexterity:** 14 +**Constitution:** 13 +**Intelligence:** 14 +**Willpower:** 11 +**Charisma:** 12 +# Physical AC +- **Blunt AC:** 5 +- **Slash AC:** 10 +- **Pierce AC:** 10 +# Elemental AC +- **Fire AC:** 10 +- **Ice AC:** 5 +- **Lightning AC:** 5 +- **Force AC:** 5 +- **Necrotic AC:** 5 +- **Gas AC:** 5 +- **Holy AC:** 5 +- **Blood AC:** 5 + +--- +# Signature Traits +### Summer Company Demolition Training +Explosive weapons are notoriously unwieldy. The Enforcer has been trained to deploy them efficiently. +- Firing the **NMM** does **not provoke opportunity attacks**. +- After firing the NMM, you may **move up to 3 meters without triggering reactions**. +### Tactical Reload Doctrine +The launcher normally requires **1 action to reload**. +However: +- An ally within **1.5 meters** may spend a **Bonus Action** to assist the reload. +### Calculated Detonation +The Enforcer understands blast radii. +When firing the NMM: +- Allies within the blast radius take **half damage**. +- Enemies caught in the **outer half of the blast radius** take **+1 posture damage** from concussive force. +### Etrean Supremacy +Raised under Etrean doctrine of cultural superiority, the Enforcer has little patience for outsiders. +- **+2 on Intimidation checks** against non-Etreans. +- **-2 on Persuasion checks** when dealing with non-Etrean allies or factions. \ No newline at end of file diff --git a/Players/SOLIDIFIED SERPENT/Upgrades/Increase Shareholder Value.md b/Players/SOLIDIFIED SERPENT/Upgrades/Increase Shareholder Value.md new file mode 100644 index 0000000..11c0246 --- /dev/null +++ b/Players/SOLIDIFIED SERPENT/Upgrades/Increase Shareholder Value.md @@ -0,0 +1,117 @@ +The Summer Company evaluates operatives purely on **return on investment**. Combat effectiveness, completed contracts, and successful asset recovery increase **Shareholder Value (SV)**. As SV rises, internal departments allocate greater resources to the operative. + +Funding level determines: +- Available rocket types +- Equipment access +- Resupply privileges +- Operational support + +--- +# Shareholder Funding Levels +## Tier 1 - Minimal Funding +You are considered equipment. Replacement cost is still cheaper than long-term investment. + +**Approved Rocket Catalog** +Standard demolition products are now approved: +- HE Rocket +- Fragmentation Rocket +- Concussion Rocket + +**Ammunition Ration Program** +The company has determined that explosives are cheaper than funerals. +- May restock rockets during Short Rests. +- Maximum ammunition: 3 rockets. +Any additional rockets must be purchased at standard employee rates. + +--- +## Tier 2 - Operational Funding +Your work has generated measurable revenue. Management has decided to delay your replacement. + +**Reload Automation Initiative** +Engineers have installed a small mechanical loader to increase productivity. +* Reloading becomes automatic after firing. The operative may move, dodge, or perform other actions while the launcher reloads. + +**Free Health Insurance** +After reviewing mortality reports, the company has concluded that slightly healthier operatives live longer. +* You regain an additional Hit Die worth of HP during short rests + +**Better Salary** +Your paycheck has increased slightly. +* You gain +1 Charisma and +1 Willpower +* You gain a +20% discount at most summer company merchants. +Employee enthusiasm is expected to increase accordingly. + +--- +## Tier 3 - Additional Funding +You are no longer considered easily replaceable. Replacing you would require paperwork. + +**Expanded Rocket Catalog** +Tactical explosives are now approved: +- Incendiary Rocket +- Cryo Rocket +- Gas Rocket + +**Ammunition Budget Expansion** +Your department has approved a modest increase in your explosives allowance. +- Rocket restocking may now be performed at any major town under authority influence. +- Gain **+1 Rocket Carry Capacity + +--- +## Tier 4 - Strategic Funding +Management now considers you an asset worth maintaining. + +**Precision Profit Optics** +Your launcher has been upgraded with battlefield analytics hardware. +* Rockets gain **+5% Penetration** +- Rockets gain **+2 to hit** +The optics also collect combat data to improve future weapons. You will **not** receive compensation for providing this data. + +**Premium Targeting Upgrade** +Your weapon now includes a paid software feature. +- Rockets may detonate mid-air +This upgrade normally costs **$33.99 per week**, but is temporarily waived while your productivity remains high. + +--- +## Tier 5 - Superior Funding +Your performance has increased your market value. The company would now prefer you survive. + +**Advanced Rocket Catalog** +High-cost explosives have been approved: +- Shaped Charge Rocket +- Cluster Rocket +- Overpressure Rocket + +**Expanded Explosives Budget** +Management has approved emergency funding. +- Maximum rockets increases to **5**. + +**Express Delivery** (1/Long Rest): +If combat operations threaten quarterly profits, supplies may be delivered by drone. +* You may call in an airdrop, granting you 2 rockets of your choice. +Standing beneath the drop zone is discouraged. + +--- +## Tier 6 - Executive Funding +At this stage, your combat performance is considered extremely profitable. The company will now allocate serious resources to keep you operational. + +**Express Delivery with Same-Day-Shipping**: +The delivery drone has been upgraded. +* Express Delivery now gives you **5** additional rockets immediately instead of 2. +The drone prioritizes cargo safety over employee safety. Please move away from the drop zone if possible (really). + +**Customer Support (1/Long Rest):** +If a battlefield situation becomes inconvenient, simply contact customer support. +* You can throw a flare (9 meter range) to call in a **hyper-mortar** strike. + * Requires you to be within 45 kilometers of summer isle. +(Support requests may be denied if the operator is on break) + +**Hyper-Mortar Strike** +Your support ticket has been processed. An offshore artillery platform will resolve the issue. +Delay: **1 round** +Impact: +- **Damage:** 4d10 Fire + 4d10 Force +- **Radius:** 6 meters +- **Posture Damage:** 8 (NB) +- **Penetration:** 30% + +Hyper-Mortar Strike cannot be parried or blocked. Creatures may Dodge normally. \ No newline at end of file diff --git a/Players/SOLIDIFIED SERPENT/Upgrades/Legalize Nuclear Bombs (Slowed & Reverb).md b/Players/SOLIDIFIED SERPENT/Upgrades/Legalize Nuclear Bombs (Slowed & Reverb).md new file mode 100644 index 0000000..1d0a5cd --- /dev/null +++ b/Players/SOLIDIFIED SERPENT/Upgrades/Legalize Nuclear Bombs (Slowed & Reverb).md @@ -0,0 +1,114 @@ +Unlocked by **Increasing Shareholder Value**, (completing requests for the Summer Company). + +The operative maintains a **3-rocket loadout** at any time. During **Short Rests** or while at **Summer Company Outposts**, the Enforcer may restock their launcher with **any combination of unlocked rockets**. + +Example: +- 2 HE Rockets +- 1 Gas Rocket + +# Standard Rocket Types (Unlocked from Start) + +## HE Rocket (High Explosive) +The baseline demolition round used by most Summer Company contractors. +**Damage:** 2d8 Fire + 1d8 Force +**Posture Damage:** 4 +**Penetration:** 20% +**Chip Damage:** 40% +**Riposte Modifier:** - +**Blast Radius:** 4.5 meters +## Fragmentation Rocket +Designed to shred lightly armored enemies and deny open spaces. +**Damage:** 2d6 Pierce + 1d6 Fire +**Posture Damage:** 3 +**Penetration:** 30% +**Chip Damage:** 30% +**Riposte Modifier:** - +**Blast Radius:** 6 meters +**Special:** Targets hit must succeed a **Dexterity Save** or suffer Medium bleed buildup +## Concussion Rocket +A blunt shockwave round meant to disrupt formations rather than kill. +**Damage:** 1d6 Force + 1d6 Blunt +**Posture Damage** 8 (NB) +**Penetration:** 10% +**Chip Damage:** - +**Riposte Modifier:** - +**Blast Radius:** 6 meters +**Special:** +Creatures in the radius must make a **Strength Save** or: +- Be **knocked prone** +- Lose **2 additional posture** + +--- +# Tactical Rocket Types (Additional Funding) + +## Incendiary Rocket +A volatile fuel mixture that ignites the battlefield. +**Damage:** 1d10 Fire +**Posture Damage:** 3 +**Penetration:** 25% +**Chip Damage:** 50% +**Riposte Modifier:** - +**Blast Radius:** 3 meters +**Special:** Creates a **burning zone** lasting **2 rounds**. +Creatures inside take: +- **1d6 Fire damage at the start of their turn** +## Cryo Rocket +Experimental tech stolen from Hive research. +**Damage:** 1d6 Ice + 1d6 Force +**Posture Damage:** 4 +**Penetration:** 20% +**Chip Damage:** 35% +**Riposte Modifier:** - +**Blast Radius:** 4.5 meters +**Special:** +Targets hit must make a **Constitution Save** or become Chilled +## Gas Rocket +Chemical payload used by Summer Company sabotage teams. +**Damage:** 1d4 Gas +**Posture Damage:** 2 +**Penetration:** 10% +**Chip Damage:** 60% +**Riposte Modifier:** - +**Blast Radius:** 4.5 meters +**Special:** +Creates a **Gas Cloud** lasting **2 rounds**. +Creatures inside take: +- **1d6 Gas damage each round** +- Disadvantage on **Perception checks** + +--- + +# Advanced Rocket Types (Superior Funding) + +## Shaped Charge Rocket +Designed to penetrate armor and structures. +**Damage:** 3d8 Pierce +**Posture Damage (Blocked):** 5 +**Penetration:** 50% +**Chip Damage:** 25% +**Riposte Modifier:** - +**Blast Radius:** 1.5 meters +**Special:** +Against armored targets: +- Deals **+2 damage dice** +## Cluster Rocket +Payload disperses multiple sub-munitions. +**Damage:** 1d4 Fire (5 instances) +**Posture Damage (Blocked):** 2 per instance +**Penetration:** 20% +**Chip Damage:** 30% +**Riposte Modifier:** - +**Blast Radius:** 4.5 meters +Damage is resolved **three separate times**, applying armor reduction individually. +## Overpressure Rocket +Prototype breaching round meant for clearing rooms. +**Damage:** 2d6 Force + 2d6 Fire +**Posture Damage:** 7 (NB) +**Penetration:** 30% +**Chip Damage:** - +**Riposte Modifier:** - +**Blast Radius:** 4.5 meters +**Special**: +Enemies hit must make a **Constitution Save**. +Failure: +- **Stunned for 1 round** \ No newline at end of file diff --git a/Players/SOLIDIFIED SERPENT/Upgrades/Mantras.md b/Players/SOLIDIFIED SERPENT/Upgrades/Mantras.md new file mode 100644 index 0000000..e69de29 diff --git a/Players/SOLIDIFIED SERPENT/Upgrades/Talents.md b/Players/SOLIDIFIED SERPENT/Upgrades/Talents.md new file mode 100644 index 0000000..37bddf6 --- /dev/null +++ b/Players/SOLIDIFIED SERPENT/Upgrades/Talents.md @@ -0,0 +1,133 @@ +# LEVEL 1 (Pack: 1) +### T01 - **Explosive Specialist** +- Rocket explosion radius **+1.5 meters** +- Rocket **Posture Damage +1** + +--- +# LEVEL 2 (Pack: 2) +### T02 - **Stealth Demolition** +- If you fire a rocket while **Hidden**, the attack gains **+10% Penetration** and **+10% Chip Damage** +### T03 - **Shock Deployment** +- When combat begins, you may **immediately reload the NMM for free** +- Gain **+1 Initiative** + +--- +# LEVEL 3 (Pack: 1) +### T04 - **Area Denial** +- Creatures hit by your rockets suffer **-1 Dodge Throws** until the start of your next turn + +--- +# LEVEL 4 (Pack: 2) +### T05 - **Blastwave Engineering** +- Rocket explosion radius **+1.5 meters** +- Creatures hit by the blast are **pushed 1.5 meters away from the center** +### T06 - **Corporate Logistics** +- Rocket carry capacity **+1** +- Assisted Reload may be performed from **3 meters away** + +--- +# LEVEL 5 (Pack: 1) +### T07 - **Warhead Overpressure** +- Rocket damage **+1 die** + +--- +# LEVEL 6 (Pack: 2) +### T08 - **Field Loader Training** +- If an ally performs **Assisted Reload**, your next rocket gains + - **+1 die damage** + - **+2 Posture Damage** +### T09 - **Shaped Detonation** +- Creatures within **3 meters of the blast center** take **+2 damage** and **+2 Posture Damage** + +--- +# LEVEL 7 (Pack: 1) +### T10 - **Mobile Artillery** +- Movement Speed **+1.5 meters** +- You may **move up to 3 meters immediately after firing a rocket** + +--- +# LEVEL 8 (Pack: 2) +### T11 - **Shockwave Fracture** +- If your rocket hits **3 or more enemies**, they each lose **1 additional Posture** +### T12 - **Suppression Pattern** +- Enemies hit by your rockets suffer **-1 attack rolls** until the start of their next turn + +--- +# LEVEL 9 (Pack: 1) +### T13 - **Blast Breaker** +- Rockets deal **+3 Posture damage against blocking targets** + +--- +# LEVEL 10 (Pack: 2) +### T14 - **Backblast Discipline** +- You take **no damage from your own rockets** +### T15 - **Target Lock** +- Rockets gain **+2 to hit** against enemies **more than 9 meters away** + +--- +# LEVEL 11 (Pack: 1) +### T16 - **Fragment Saturation** +- Rockets deal **+2 damage to each creature hit after the first** + +--- +# LEVEL 12 (Pack: 2) +### T17 - **Shockline Detonation** +- If a rocket **posture-breaks a creature**, all enemies within **3 meters** lose **2 Posture** +### T18 - **Forward Spotter** +- Allies attacking enemies hit by your rockets gain **+1 to hit** until the start of your next turn + +--- +# LEVEL 13 (Pack: 1) +### T19 - **Airburst Calibration** +- Airburst rockets increase explosion radius **+1.5 meters**, **+1 to hit** and gain **+10 Penetration**. + +--- +# LEVEL 14 (Pack: 2) +### T20 - **Rapid Reposition** +- After firing a rocket, gain **+3 meters movement** this turn +### T21 - **Structural Collapse** +- Rockets deal **+2 damage to enemies within 3 meters of terrain or walls** + +--- +# LEVEL 15 (Pack: 1) +### T22 - **Heavy Payload Rack** +- Rocket carry capacity **+2** +- Lose 3 meters movement speed + +--- +# LEVEL 16 (Pack: 2) +### T23 - **Terrain Denial** +- Terrain within **4.5 meters of rocket impact** becomes **difficult terrain for 1 round** +### T24 - **Assisted Barrage** +- If your rocket is **Assisted Reloaded**, it gains + - **+1.5 meter explosion radius** + - **+10% Penetration** + +--- +# LEVEL 17 (Pack: 1) +### T25 - **Demolition Authority** +- Rockets deal **+2 damage** +- Rockets deal **+1 Posture Damage** + +--- +# LEVEL 18 (Pack: 2) +### T26 - **Overpressure Wave** +- Enemies hit by your rockets suffer **-1.5 meters movement speed** for 1 round +### T27 - **Chain Blast** +- If your rocket kills a creature, enemies within **3 meters** take **1d8 Force damage** + +--- +# LEVEL 19 (Pack: 1) +### T28 - **Killzone Control** +- Rocket explosion radius **+1.5 meters** +- Creatures inside the explosion suffer **-1 on Dodge Throws** + +--- +# LEVEL 20 (Pack: 2) +### T29 - **Maximum Payload** +- Rocket damage **+1 die** +- Rocket Posture Damage **+2** +### T30 - **Strategic Bombardment** +- Once per combat, you may fire **two rockets with the same shot** +- Both rockets **must target the same point**. +- The NMM overheats afterwards and can't be used/reloaded for 1 round \ No newline at end of file diff --git a/Races/Adret.md b/Races/Adret.md new file mode 100644 index 0000000..51ebe5c --- /dev/null +++ b/Races/Adret.md @@ -0,0 +1,12 @@ +> *Tattooed when they come of age, their tattoo represents the path of life they seek. Well-regarded as bureaucrats and keepers of coin.* + +Adrets are a common [[Races|race]] that have blue skin with orange eyes and face markings. Adrets have a are more mentally stable and charismatic than most other races and they learn a lot faster. Adrets are also well regarded as diplomats, which makes them have no enemies. Adrets are considered a new race and originate from the Central Luminant. Unlike other races, Adrets do not have a distinct animal feature, and instead have tattoos on their face as a unique feature, they are basically the (idk, I’ll insert a world name here later) equivalent of humans. + +**Bonuses:** +"Your understanding of your destiny is such that learning new things comes naturally to you. People appreciate your diplomatic way of speaking." +* Maudet: + * Receive 3 free points whenever you Power up. + * You gain +1 to all non-combat skill checks (Persuasion, Insight, History, etc.) + * Your start out with no enemy factions, in allied factions you are regarded as a friend +- +2 Willpower +- +2 Charisma \ No newline at end of file diff --git a/Races/Canor.md b/Races/Canor.md new file mode 100644 index 0000000..14334a3 --- /dev/null +++ b/Races/Canor.md @@ -0,0 +1,12 @@ +> *With canine features, the Canor are fiercely loyal. Often found as guards and personal servants in the retinue of powerful people.* + +Canor are an uncommon [[Races|race]] considered to have the characteristics of a canine but the attributes and features of a lion. Canor appear with a mane and varying facial markings around their eyes. The Canor are stronger and more charismatic than most races, and they are loyal to their allies, dealing reduced damage to and from guildmates. The race of Canor is also heavily favored by the Authority, though not nearly as much as the Adret. Canor have three distinct facial markings. + +**Bonuses:** +“Your bond with your allies is strong enough to reduce damage between you.”_ +* Loyalty: + * Allies take 50% less damage from you and deal 50% less damage to you. + * Allies within 6 meters gain +5 AC. + * When an ally within 6 meters is knocked, you gain Advantage on your next attack. +* +2 Strength +* +2 Charisma \ No newline at end of file diff --git a/Races/Capra.md b/Races/Capra.md new file mode 100644 index 0000000..ea8a2cc --- /dev/null +++ b/Races/Capra.md @@ -0,0 +1,17 @@ +> *Keepers of old knowledge, they wander the lands offering their experience to those in need of it.* + +Capras are a [[Races|race]], descendant from goats, exhibiting various goat-like characteristics such as horns, rectangular pupils and even masks the same shape as a goats skull. Capra NPC's are rarely found in the world of Lumen and their characteristics are unspecified. Capras are smarter are smarter and more mentally stable than most. + +**Bonuses:** +Once per short rest, you can use one of your religious marks to apply a buff: +* Mark of Ku(Red) + * "_Mark of Ku, the Mother. Improves the rest of those in your presence. + * While active, player affected heals 15% of their total HP over a 30s period. (Level 5+ Needed to activate). +* Mark of Nemit(Green) + * "_Mark of Nemit, the First Beast. Food consumed in your presence is more nourishing._" + * Buffs the food of one person they choose (Double Saturation and Buffs if the Food has any) around them as long as they are at a campfire or Power 5+ +* Mark of Jurik(Blue) + * "_Mark of Jurik, the Moonseye. A beacon of calm, those in your presence are resistant to insanity._" + * Give back 5 sanity to one person they choose around them as long as they are at a campfire or Power 5+ +* +2 Intelligence +* +2 Willpower \ No newline at end of file diff --git a/Races/Celtor.md b/Races/Celtor.md new file mode 100644 index 0000000..cf2cd79 --- /dev/null +++ b/Races/Celtor.md @@ -0,0 +1,16 @@ +> *Silver-tongued traders whose pride often gets the better of them. Renowned as ship-builders and seafarers alike.* + +Celtors are a common [[Races|race]] with a pale-ish green skin, grey hair and a racoon-like marking on their face. Celtor are based on the real life Mustelidae (e.g. Racoons and Racoon-likes) family. Celtors are known as intelligent and charismatic, and renowned as seafarers. Celtors are portrayed as rich, greedy, and prideful. They formerly had a place to call home, the Celtorian City, but was sunken into The Depths. + +**Bonuses:** +"_You have a keen understanding of ships and their maintenance._" +* Seaborne: + * Owned Ships have higher HP + * Ships built by celtor have faster travel speed + * 20% Discount at the Shipwright +* Silver Tongue, Sharp Knife: + - When bartering, bribing, or negotiating, gain advantage on charisma checks + +- Gain **Advantage on Charisma checks** +* +2 Intelligence +* +2 Charisma \ No newline at end of file diff --git a/Races/Chrysid.md b/Races/Chrysid.md new file mode 100644 index 0000000..00fc5a4 --- /dev/null +++ b/Races/Chrysid.md @@ -0,0 +1,12 @@ +>*Deeply spiritual folk who have an uncanny knack for deciphering the emotions of others while keeping their own a closed book. + +The Chrysid people are a [[Races|race]] related to moths, inheriting their compound eyes and feathery antennae. They are a rare race to see and carry close ties with the other races of Greathive despite their conflicting view on technology. They are faster than most other races and are surprisingly charismatic. They are also excellent at tracking their prey. + +**Bonuses:** +"Being attacked causes you to release Mothwing Dust, granting you vision of your attacker.” +* Mothwing Dust: + * When you are attacked at melee range, coat your enemies in Mothwing dust. This makes them unable to use half or full cover. +* You are immune to being frightened +- Gain Advantage on Insight checks +* +2 Dexterity +* +2 Charisma \ No newline at end of file diff --git a/Races/Etrean.md b/Races/Etrean.md new file mode 100644 index 0000000..1607dd4 --- /dev/null +++ b/Races/Etrean.md @@ -0,0 +1,12 @@ +>*Defined by their snake-like features and cunning. Isolationists who tend to their own interests.* + +Etreans are described as a snake-like [[Races|race]], who commonly have pale skin, and slit eyes. They are the most common race and can be found most commonly at Etris. Etreans are known for their Intelligence and agility, as well as resistance to status effects. Etreans are commonly depicted as racists. + +**Bonuses:** +"Ailments and blessings alike fade away more quickly." +* Molt: + * You are immune to all status effects. + * When in acid rain, throw a dice against DC 14. If the throw is successful you only take half damage per round. + * +1 HP +* +2 Dexterity +* +2 Intelligence \ No newline at end of file diff --git a/Races/Felinor.md b/Races/Felinor.md new file mode 100644 index 0000000..9fbc2f4 --- /dev/null +++ b/Races/Felinor.md @@ -0,0 +1,13 @@ +>*Akin to their feline features, the Felinor are carefree and whimsical. Seen to be thieves and outlaws, but merely seek a life of freedom.* + +One of the most distinct races in the Lumen for their infamous cat ears, Felinors garnered the most attention of all races in Lumen. They are a rare [[Races|race]] with little social or political influence to their race, mainly varying with the individual themselves. Felinors are charismatic and agile and have improved stealth. + +**Bonuses:** +"Relying on your instincts, you are naturally more stealthy. You are more nimble on wooden surfaces._" +* Nightchild: + * Your climb speed is 1.5x your walk speed, when climbing wooden surfaces its 2x instead. + * You have Advantage on Stealth Throws + * Once per encounter, automatically succeed a failed Dodge check +* +2 Dexterity +* +2 Charisma + diff --git a/Races/Ganymede.md b/Races/Ganymede.md new file mode 100644 index 0000000..671efec --- /dev/null +++ b/Races/Ganymede.md @@ -0,0 +1,12 @@ +> *Peculiar folk who are often known for their wisdom and intelligence. Though quite rare, Ganymede science still leads man forward.* + +Ganymedes are a snail-based [[Races|race]] in Lumen that appear with dark skin, abnormal eye figurations, and sometimes wearing their signature hat. Being one of the rarest races of Lumen, they are very gifted individuals and possess a deeper understanding of the deep than most. Ganymedes are known for their intelligence and willpower as well as resistance to the passive insanity gain of the depths (scyphozia). + +**Bonuses:** +"_The secrets of the Deep are easier for you to unravel. Your mind is sturdier against its effects, as well as using less Knowledge in Knowledge exchanges._" +* Deepfolk + * You have advantage on Insanity Gain Checks. + * Deepshrines cost -1 Knowledge to make deals with. + * Parasites in layer 2 take 5 rounds longer to kill you. +* +2 Intelligence +* +2 Willpower diff --git a/Races/Gremor.md b/Races/Gremor.md new file mode 100644 index 0000000..fa3ce23 --- /dev/null +++ b/Races/Gremor.md @@ -0,0 +1,12 @@ +> _Deer-horned pariahs who lived a peaceful life as nomads before the tides came. Tolerant of extremes that many others would avoid. + +Gremors are a [[Races|race]] similar to deer. They appear with greenish, blue or brown skin, with horns. They are stronger and more durable than most. Additionally, they get Advantage on Survival Throws and a lower starvation rate, as well as boosted reputation with The Children Of Navae. + +**Bonuses:** +_Navae's star guides your path, showing you the way forwards. You are less prone to starvation._" +* Navae's Guidance + * You start with a magic item: Navae’s Compass. This compass always points towards the north and gives you a +2 in Survival (Wisdom) Throws. + * You lose 50% less hunger. + * When blinded, you gain 3 meter dark vision instead of becoming blind. +* +2 Strength +* +2 Fortitude \ No newline at end of file diff --git a/Races/Khan.md b/Races/Khan.md new file mode 100644 index 0000000..ca41a9b --- /dev/null +++ b/Races/Khan.md @@ -0,0 +1,11 @@ +> *Brimming with pride yet attentive to the finer details. Known as steadfast warriors and mercenaries the world over.* + +Khans are a rare [[Races|race]] with light skin, and a monkey-like appearance. Khans have a special crown on their forehead which they and they alone possess. Khans are stronger and faster than most, and they also have a great understanding of weaponry. This makes them good allies with The Hundred Legions. + +**Bonuses:** +"You learn how to use new pieces of equipment quicker than others.” +* Versatile: + * You have proficiency in most weapon types and can use them in any combination. + * You are unable to use guns as they are 'dishonorable'. +* +2 Strength +* +2 Agility \ No newline at end of file diff --git a/Races/Races.md b/Races/Races.md new file mode 100644 index 0000000..e69de29 diff --git a/Races/Skaven.md b/Races/Skaven.md new file mode 100644 index 0000000..60f0da5 --- /dev/null +++ b/Races/Skaven.md @@ -0,0 +1,14 @@ +> *Defined by their rodent features and relentless survival instinct. Paranoid, adaptive, and driven by hunger.* + +Skaven are a rare [[Races|race]] of ratfolk most commonly found in the lower strata of society: sewers, ruins, ship holds, and overcrowded districts others avoid. They are known for their sharp senses, rapid breeding, and extreme adaptability, thriving in conditions that would break most other races. Skaven culture is deeply fractured and competitive. Cooperation is temporary, trust is conditional, and betrayal is expected. They are highly pragmatic, valuing survival and advantage above morality, and are often depicted as schemers, informants, or disposable labor. Despite this reputation, Skaven possess a sharp, if self-serving, intelligence and an uncanny ability to persist through overwhelming odds. + +Bonuses: +"You endure where others fail, not through strength, but refusal to die." +* Vermin Resilience: + * When you would be reduced to 0 HP, you may instead drop to 1 HP (once per long rest) +* Scavenger’s Adaptation: + * Gain Advantage on checks related to poison, disease, filth, or hazardous environments +* Crowded Instinct: + * You gain Advantage on Stealth Throws while in tight, dark, or cluttered areas +* +2 Fortitude +* +2 Strength \ No newline at end of file diff --git a/Races/Tiran.md b/Races/Tiran.md new file mode 100644 index 0000000..03302bc --- /dev/null +++ b/Races/Tiran.md @@ -0,0 +1,12 @@ +> *Solitary folk seldom seen below the clouds. Sharp and independent, though strongly protective of those who earn their respect.* + +Tirans are an extremely rare bird-like [[Races|race]]. They have special circle-like markings on their face. They have are known for their superior agility and mental clarity and take less fall damage. + +**Bonuses:** +"As a show of independance when they come of age, Tirans will strike out on their own with just their hand-crafted glider, gliding down from the mountains peaks where they make their homes.” +* Feathered Glider + * You have resistance to fall damage + * You start with an unbreakable feathered glider. The descent rate of it is also slightly lower than regular gliders, making you able to travel slightly further. +* Gain Advantage on initiative rolls +* +2 Willpower +* +2 Agility \ No newline at end of file diff --git a/Races/Vesperian.md b/Races/Vesperian.md new file mode 100644 index 0000000..accb339 --- /dev/null +++ b/Races/Vesperian.md @@ -0,0 +1,10 @@ +>*Never seen without their mask. Poorly understood, but begrudgingly appreciated due to their natural talents.* + +Vesperians are described as a beetle themed [[Races|race]] with organically grown masks and very dark skin. They are most commonly seen at Greathive Aratel and are mostly under ranked by fellow Ganymedes. Vesperians are more durable than others and have a superior mental stability. They also have a natural exoskeleton that regenerates when you rest. + +**Bonuses:** +"_You have a layer of natural armor that replenishes when you rest._" +* Chitin: + * You gain +10 AC against all physical damage types. +* +2 Fortitude +* +2 Willpower diff --git a/Resonances/Blood Scourge.md b/Resonances/Blood Scourge.md new file mode 100644 index 0000000..b0e98fe --- /dev/null +++ b/Resonances/Blood Scourge.md @@ -0,0 +1,5 @@ +Blood Scourge is a utility-based [[Resonances|Resonance]], focused on finishing off enemies quickly. + +When activated, you Create a Field with a radius of 9 meters centered on your current position, every enemy currently incapacitated within that radius is instantly gripped. + +When Corrupted the field also **grips enemies that become knocked during the round**, and gripped enemies **cannot be interrupted or saved** by allies. \ No newline at end of file diff --git a/Resonances/Crazy Slots.md b/Resonances/Crazy Slots.md new file mode 100644 index 0000000..b771215 --- /dev/null +++ b/Resonances/Crazy Slots.md @@ -0,0 +1,12 @@ +Crazy Slots is a utility-based [[Resonances|Resonance]], focused on ~~gambling~~ giving you a unique weapon for each encounter. + +When activated, You gain a random weapon out of a pool. Throw a 1d6: +- 1: Divine Axe +- 2: Divine Greatsword +- 3: Divine Spear +- 4: Divine Longsword +- 5: Divine Dagger +- 6: Divine Flintlock +Weapon vanishes early if dropped. + +When Corrupted, you roll two weapons and choose one. When the weapon expires, it detonates, dealing 2d10 radiant/necrotic (your choice) in a 3m radius. \ No newline at end of file diff --git a/Resonances/Gravity Field.md b/Resonances/Gravity Field.md new file mode 100644 index 0000000..60e6160 --- /dev/null +++ b/Resonances/Gravity Field.md @@ -0,0 +1,10 @@ +Gravity Field is a utility-based [[Resonances|Resonance]], focused on soft crowd control. + +When activated, it creates a 9m diameter sphere for 1d4 + 1 rounds. +Enemies inside: +- Cannot dodge, jump, or use mobility [[Combat/Mantras]] +Allies inside: +- Gain +10 AC +- Gain +2 on attack rolls + +When corrupted, enemies entering the field are pulled 3m toward the center and cannot parry while inside. \ No newline at end of file diff --git a/Resonances/Jar of Souls.md b/Resonances/Jar of Souls.md new file mode 100644 index 0000000..5bebbd6 --- /dev/null +++ b/Resonances/Jar of Souls.md @@ -0,0 +1,12 @@ +Jar of Souls is an offense-based [[Resonances|Resonance]], focused on heavy burst DPS. + +As soon as you obtain this resonance, you gain a unique effect: +- Gain **1 Soul** per kill. + +You need to spend a **bonus action** to active this resonance. When activated, it fires a soul beam: +- Range: **18m** +- Damage: **2d6 necrotic** +- Cost: 1 Soul +You can spend more souls at once to increase the damage. + +When corrupted, the beam acts as a continuous attack, draining a number of souls every round until deactivated. \ No newline at end of file diff --git a/Resonances/Payback.md b/Resonances/Payback.md new file mode 100644 index 0000000..f1c1104 --- /dev/null +++ b/Resonances/Payback.md @@ -0,0 +1,5 @@ +Payback is an offense-based [[Resonances|Resonance]], focused on countering dangerous attacks. + +When activated, you block **all damage** for 1 round. At the end of the round, deal **50% of blocked damage** to a chosen enemy via a beam of light. + +When corrupted, the reflected damage becomes **true damage** and can't be dodged or parried. \ No newline at end of file diff --git a/Resonances/Portals.md b/Resonances/Portals.md new file mode 100644 index 0000000..73a9ad0 --- /dev/null +++ b/Resonances/Portals.md @@ -0,0 +1,5 @@ +Portals is a utility-based [[Resonances|Resonance]], focused on repositioning. + +When activated, you become **invisible and invincible**, but cannot attack or interact for one round. + +When corrupted, you may **reappear anywhere within 12 meters** and your next attack within 1 round is an **automatic critical**. \ No newline at end of file diff --git a/Resonances/Preservation.md b/Resonances/Preservation.md new file mode 100644 index 0000000..c7c3bfe --- /dev/null +++ b/Resonances/Preservation.md @@ -0,0 +1,5 @@ +Payback is a support-based [[Resonances|Resonance]], focused on keeping your teammates alive. + +When activated, knocked allies are enclosed in golden spheres. They **cannot be gripped or executed**. The spheres have 50 HP and 20 AC to all damage. + +When corrupted, the spheres can **parry one incoming attack automatically**. The parry reflects **posture damage** back to the attacker. \ No newline at end of file diff --git a/Resonances/Resonances.md b/Resonances/Resonances.md new file mode 100644 index 0000000..bfec4da --- /dev/null +++ b/Resonances/Resonances.md @@ -0,0 +1,16 @@ +Resonances: Adventurers gain +1 Resonance point every time they kill a potent enemy. + +**This value is hidden to the Adventurers. + +When the Adventurers reach 5 Resonance points and they die in the depths, they instead resurrect at full HP and can choose a resonance. They can choose one of 3 Resonances, with a Chance of it being corrupted. + +- Corrupted Resonance drawbacks:   + + - Short-Circuit: You are set ablaze for 5 rounds, taking 1d4 fire damage per round.  + - Megalomania: You immediately lose 5 sanity.  + - Poison: You take 2d10 damage. This cannot be reduced or negated in any way.   + - Physical Vampirism: Make a Fortitude saving throw, if you fail, you’re stunned for one round after the resonance ends. + +**All Resonances activate instantly unless stated otherwise.** +Unless specified, Resonances do not cost actions and cannot be interrupted. +All Resonances can be activated once per long rest unless stated otherwise. \ No newline at end of file diff --git a/Resonances/Resurrection.md b/Resonances/Resurrection.md new file mode 100644 index 0000000..4fa7dbf --- /dev/null +++ b/Resonances/Resurrection.md @@ -0,0 +1,5 @@ +Gravity Field is a support-based [[Resonances|Resonance]], focused on keeping your teammates alive. + +When activated, you mark a target (can be yourself). If they would be knocked, they instead rise with **(Level)d4 HP**. + +When corrupted, the revived target gains immunity to all damage for one round. \ No newline at end of file diff --git a/Resonances/Run it back.md b/Resonances/Run it back.md new file mode 100644 index 0000000..eae4361 --- /dev/null +++ b/Resonances/Run it back.md @@ -0,0 +1,5 @@ +Run it back is a utility-based [[Resonances|Resonance]], focused on repositioning. + +When activated, you place a mark on the ground. After 1 round, you teleport back to it, healing all the damage you took during the turn. If you take more than 25% of your Max HP as damage, your teleport will be cancelled. + +When corrupted, you can choose to activate the recall at any point, as long as you're within 18 meters of the mark. \ No newline at end of file diff --git a/Resonances/Sacred Field.md b/Resonances/Sacred Field.md new file mode 100644 index 0000000..43eaa87 --- /dev/null +++ b/Resonances/Sacred Field.md @@ -0,0 +1,5 @@ +Sacred Field is a support-based [[Resonances|Resonance]], focused on debuffing enemies. + +When activated, you create a circular field with a 9 meter radius centered on you. Enemies within this field suffer -3 to attack rolls and -5 to damage rolls. + +When corrupted, Enemies cannot critically hit while inside the field and take 1d10 radiant damage on missed attacks. They also lose 1 Posture at the start of each of their turns. \ No newline at end of file diff --git a/Resonances/Shard Bow.md b/Resonances/Shard Bow.md new file mode 100644 index 0000000..000f753 --- /dev/null +++ b/Resonances/Shard Bow.md @@ -0,0 +1,14 @@ +Shard Bow is an offense-based [[Resonances|Resonance]], focused on quick DPS from a distance. + +You need to spend a **bonus action** to active this resonance. When activated, you summon a radiant bow with 3 radiant shards that can be fired individually. +- Range: **35m** +- Damage: **1d12 radiant / Shard** + +Shards: +- **Ignore Dodge reactions** +- **Deal double posture damage** + +When corrupted, you gain 5 shards instead of 3. You can fire all shards at once in a devastating **Shardfall Barrage**: +- All remaining shards rain down in a **6-meter radius** +- Each shard deals **full damage** to a random enemy in the area +- Each enemy can only be hit by **2 shards max** \ No newline at end of file diff --git a/Resonances/Smite.md b/Resonances/Smite.md new file mode 100644 index 0000000..0897367 --- /dev/null +++ b/Resonances/Smite.md @@ -0,0 +1,9 @@ +Smite is an offense-based [[Resonances|Resonance]], focused on passive damage over time. + +You need to spend a **bonus action** to active this resonance. When activated, you summon 6 orbs above you. Each round, one orb will crash into a random enemy within 9 meters, dealing 1d10 necrotic damage. + +Shards: +- **Ignore Dodge reactions** +- **Deal double posture damage** + +When corrupted, you gain 8 orbs instead of 6 and each round, two orbs will be fired. The last 2 orbs will deal triple damage. \ No newline at end of file diff --git a/Resonances/Smokescreen.md b/Resonances/Smokescreen.md new file mode 100644 index 0000000..b5b3e13 --- /dev/null +++ b/Resonances/Smokescreen.md @@ -0,0 +1,5 @@ +Smokescreen is a utility-based [[Resonances|Resonance]], focused on soft crowd control. + +When activated, you create a thick cloud of black smoke with a 4.5 meter radius, centered on your position. The cloud lasts for 5 rounds. If enemies step inside the cloud, they will be blinded until they leave the cloud. You will be invisible while in the cloud. + +When corrupted, enemies inside will be silenced and take 1d6 poison damage per round. Enemies leaving the smoke will be disoriented for one turn. \ No newline at end of file diff --git a/Resonances/Windup.md b/Resonances/Windup.md new file mode 100644 index 0000000..abb1663 --- /dev/null +++ b/Resonances/Windup.md @@ -0,0 +1,5 @@ +Windup is an offense-based [[Resonances|Resonance]], focused on heavy burst DPS. + +Takes one action to activate. When activated, your next attack is a guaranteed Supercritical, dealing 2.5x the normal damage and stunning the target for 1 round. Can be stacked with a normal critical attack to be a Hypercritical Attack, dealing 3x damage instead. + +When corrupted, if you kill an enemy using this ability, its cooldown will be refunded. diff --git a/World/Depths/The Depths.md b/World/Depths/The Depths.md new file mode 100644 index 0000000..6162f24 --- /dev/null +++ b/World/Depths/The Depths.md @@ -0,0 +1,39 @@ +The **Depths** are a fundamental part of Lumen’s structure, existing beyond the surface world and the Voidsea. They function as both an afterlife and a physical realm, governed by rules that differ significantly from those of the Overworld. + +The Depths surround the world completely. They are not located “below” in a simple spatial sense, but rather exist outside normal reality, intersecting it at points of death, drowning, and catastrophic displacement. Entry into the Depths is irreversible without external intervention. + +--- +### Entry and Purpose +Those who die through combat, execution, or exposure to the Voidsea are drawn into the Depths. Upon entry, the body is lost, and the soul awakens within its confines. + +Most souls arrive in the **First Layer**, which serves as the primary point of entry. This is not a judgment in a moral sense, but a consequence of how death interacts with the structure of the Depths. Condemnation through violence or drowning appears to create the conditions necessary for this transition. From there, movement deeper is possible, though rarely intentional and never predictable. + +--- +### Structure of the Layers +The Depths consist of **nine known layers**. These layers are not arranged in a linear or vertical sequence. Distance, direction, and progression do not function in a consistent way. It is possible to pass directly from the surface into deeper layers without ever encountering the First Layer. + +Each layer operates according to its own internal logic. Physical laws, time, perception, and causality may differ drastically between layers. There is no confirmed method to reliably navigate from one specific layer to another. + +While scholars refer to the layers numerically for convenience, this ordering does not imply hierarchy, depth, or proximity in a spatial sense. + +--- +### Nature of the Depths +The Depths are not inert. Observations and accounts suggest that the environment reacts to presence, intent, and prolonged interaction. The phenomenon is described as resembling _“interacting on a microscopic level with the processes of some slumbering creature.”_ Whether this implies true sentience is unclear. + +One prevailing interpretation is that the Depths behave as an extension of the **Drowned Gods**, responding to their dormant influence rather than possessing independent consciousness. Another interpretation holds that the Depths themselves are a system older than the gods, one that they merely inhabit or exploit. + +--- +### Time, Decay, and Persistence +Time within the Depths is unstable. Aging is slowed, halted, or rendered inconsistent depending on location and circumstance. Some individuals remain unchanged for centuries, while others deteriorate rapidly despite minimal exposure. + +Death within the Depths does not follow known rules. Destruction of form does not always result in erasure, nor does survival guarantee continuity. Identity, memory, and physical coherence can be altered through prolonged exposure. + +--- +### Insanity and Psychological Degradation +The Depths are the **primary source of insanity** in Lumen. Prolonged exposure to the Depths - regardless of layer - places continuous strain on the mind. This effect is not solely the result of fear or trauma, but appears to be a consequence of existing within a reality that does not align with mortal perception, memory, or causality. + +Insanity acquired in the Depths manifests as intrusive thoughts, altered perception, compulsions, emotional detachment, or identity fragmentation. These effects can persist even after return to the Overworld. The deeper one travels, or the longer one remains, the more severe and irreversible these effects tend to become. + +--- +### Return to the Overworld +Escape from the Depths is not achievable through effort alone. A soul may return only if a sufficiently powerful divine entity restores or recreates a body and permits reintegration into the Overworld. \ No newline at end of file diff --git a/World/Lumen.md b/World/Lumen.md new file mode 100644 index 0000000..afcb38f --- /dev/null +++ b/World/Lumen.md @@ -0,0 +1,96 @@ +### The Shape of the World + +[[The Overworld]] of **Lumen** is divided into large regions called **Luminants**. +Luminants function as the continents of this world: massive landmasses with their own climates, cultures, and histories. Travel within a luminant is relatively stable. Travel _between_ them is not. + +Separating the luminants is the ocean. Near the coasts, this ocean behaves mostly like a normal sea. Farther out, it thins into something else entirely: the **Voidsea**. + +The Voidsea is not simply deep water. It is a liminal space where reality begins to break down. Time behaves inconsistently, matter degrades, and living things struggle to persist. Islands caught within it may become frozen in time, decay into nothing, or drift back toward a luminant centuries later. The Voidsea also acts as a boundary between the surface world and what lies beneath it. + +That boundary leads to [[The Depths]]. + +--- + +### The Depths and Death + +The **Depths** surround the world completely. They exist beneath the ocean, beyond the sky, and past the edges of reality. While often described as an underworld, they are not a single place, but a collection of layered environments, each operating by different rules. + +Death in Lumen follows a consistent pattern. + +When a person dies, their **physical body collapses into ash**. The soul does not linger in the overworld. Instead, it is pulled downward into the Depths. This happens regardless of belief, status, or intent. + +Souls that fall into the Depths are not automatically destroyed. Some wander. Some are claimed by entities that dwell there. Some remain trapped indefinitely. Escape is possible, but not through one’s own effort alone. + +To return to the overworld, a soul must have its **body restored or remade by a divine being**, most often a Drowned God or a similarly powerful entity. When this happens, the soul is allowed to return, re-entering the restored body and resuming life on the surface. Without this intervention, return is impossible. + +--- + +### The Song + +The Song is not music in the casual sense. It is closer to a **rulebook for reality**. + +Everything that resembles magic - mantras, rituals, attunements, enchantments, etc. - comes from interacting with the Song. Rather than creating something from nothing, users of the Song manipulate what already exists: heat, wind, water, motion, force. Skilled individuals learn how to “hear” certain parts of it more clearly than others. + +The Song also resonates with living beings. Strong emotional moments, especially the instinct to survive, can carve out unique passages within it. These passages sometimes manifest as **Resonances**, often taking the form of bells or instruments bound to a person’s soul. + +Importantly, the Song is not fully controllable. People can influence it, whisper into it, tug at its threads, but no one commands it outright. In that sense, it functions almost like fate. + +--- + +### Attunements + +Attunements are the most common and practical way people interact with the Song. + +Rather than spells, attunements are **trained manipulations of the environment**, shaped by repeated exposure to a specific “frequency” of the Song. The four foundational attunements - fire, wind, lightning, and ice - emerged long ago and still form the backbone of daily life. Other types of attunements like shadow, iron, lifeweave, light, and blood were artificially made by the various races in Lumen. + +While adventurers mostly use attunements for combat, civilians rely on them just as much: preserving food, powering tools, healing wounds, reinforcing structures, or surviving harsh climates. A city without attuned citizens would not function for long. + +--- + +### The Canticlysm and the Tides + +Long before the present era, people learned to use the Song. + +This period, now called the **Canticlysm**, was marked by rapid advancement. Entire societies were built on Song-powered inventions, and attunements were refined and systematized. For a time, it was a golden age. Sadly, it did not last. + +The constant strain on the Song disturbed ancient beings sleeping beneath the world: the **Drowned Gods**. When they stirred, the seas rose. Land was swallowed. The Old World collapsed beneath the waves in a catastrophe remembered as **the Tides**. + +--- + +### The World After the Flood + +Lumen is now a scattered world of **luminants and islands**, separated by vast stretches of unstable ocean known as the **Voidsea**. Some islands drifted back from the depths of that sea after centuries of frozen time; these are called **Driftlands**. + +Above the surface, a strange phenomenon called **Voidfog** circles the world, bending light and obscuring the sky. + +--- + +### Gods, Celestials, and the Divine + +The divine in Lumen is fractured. + +The **Drowned Gods** are ancient entities bound to the ocean and the Depths. Their partial awakening in the past caused the Tides, which drowned the Old World. Most of them are currently **dormant**, not dead. Their continued sleep is critical: if even one were to fully awaken, the resulting strain on the world would be enough to end it entirely. + +Despite this, the Drowned Gods still exert influence. Their presence warps reality in subtle ways, especially near the Depths and the Voidsea. They are capable of granting power, reshaping bodies, and restoring souls, though such acts are never without consequence. They are not aligned with mortal morality and are rarely benevolent by human standards. + +Opposing them are the **Celestials**. These beings are associated with the sky, distant stars, and observation rather than direct intervention. Unlike the Drowned Gods, Celestials do not reside within the world or beneath it, and their influence is indirect. They act through intermediaries, artifacts, visions, and long-term manipulation rather than overt displays of power. + +The Celestials and the Drowned Gods are **actively hostile to one another**. This conflict is not fought through open warfare, but through containment, interference, and denial. The Celestials seek to prevent the full awakening of the Drowned Gods, while the Drowned Gods resist confinement and influence events in ways that push the world closer to collapse. + +--- + +### People of Lumen + +Lumen is home to a **wide variety of races**, many of which have adapted, physically or culturally, to the flooded world. Ordinary humans exist, but they are rare. Most “human-like” people descend from altered lineages shaped by the Song, the Tides, or older forces. + +Despite their differences, most peoples of Lumen share the same core struggles: survival, territory, belief, and control over the future. + +--- + +### Factions and Conflict + +The world is not unified. + +Kingdoms, authorities, companies, cults, and ideological movements all compete for influence. Some seek order and control. Others pursue knowledge of the Song, divine favor, or simple profit. + +Lumen is **politically unstable**, and the scars of the past are still open. Every major faction believes they are preventing another catastrophe in some way, and that often leads to clashes. \ No newline at end of file diff --git a/World/Overworld/The Overworld.md b/World/Overworld/The Overworld.md new file mode 100644 index 0000000..b16a46f --- /dev/null +++ b/World/Overworld/The Overworld.md @@ -0,0 +1,51 @@ +The **Overworld** refers to all parts of Lumen that exist outside the Depths and the Boundary. This includes the surface of the world, its skies, its oceans, and the inhabited landmasses known as luminants. Nearly all mortal life exists here, and this is where most travel, conflict, and history takes place. While the Overworld was once a continuous world, the Tides fractured it into scattered landmasses separated by unstable seas. Civilization persists, but movement, communication, and political unity are difficult to maintain. + +--- +### Geography and Environment + +The Overworld consists primarily of **luminants**, which function as continents. Each luminant has its own climate patterns, cultures, and dominant powers. Between them lies the ocean, which gradually gives way to the Voidsea the farther one travels from land. + +The sky above the Overworld is partially obscured by **Voidfog**, a rotating atmospheric layer that bends light and limits long-distance observation. Stars and celestial bodies are visible only intermittently, contributing to the limited influence of Celestials on daily mortal affairs. + +--- +### Major Luminants + +#### Etrean Luminant + +The Etrean Luminant is home to the **Etrean people**, specifically the City of Etris and the Isle of Vigils, containing Etrea's military force. It is comparatively stable, with defined borders, entrenched traditions, and a strong martial culture. While less fragmented than other regions, it is not isolated from global conflict. + +--- + +#### Eastern Luminant + +The Eastern Luminant is the most **politically dense and volatile** region of the Overworld. It contains numerous important locations such as Summer Isle, Miner’s Landing, Fort Merit, Meteor Isle, and Greathive Aratel. Due to its accessibility and resources, nearly every major faction maintains a presence here. Espionage, proxy conflicts, economic sabotage, and covert warfare are common, often overlapping in the same territories. + +--- + +#### Central Luminant + +The Central Luminant is controlled primarily by the **Central Authority**, an expansionist power focused on regulation, standardization, and control. It is heavily fortified and bureaucratic, with strict oversight of attunement use, trade, and population movement. Travel here is possible but monitored, and foreign influence is often suppressed unless it benefits the Authority directly. + +--- + +#### Western Luminant + +The Western Luminant is dominated by the **Hundred Legions**, a militarized society organized around discipline, conquest, and long-standing martial tradition. Civilian life exists, but it is structured around the needs of the legions. + +While less fragmented than the Eastern Luminant, the West is highly aggressive in foreign policy and has historically clashed with the Central Authority and other expansionist forces. + +--- + +#### Southern Luminant + +The Southern Luminant was once a major center of civilization. It is now **almost entirely destroyed**. + +Much of it was lost during the Tides, including the city of Celtor, which was dragged beneath the sea. What remains are scattered ruins, partially submerged landmasses, and unstable territories that border the Voidsea. Few permanent settlements exist, and most expeditions here are temporary, dangerous, and motivated by salvage or forbidden knowledge. + +--- + +#### Northern Luminant + +Very little is known about the Northern Luminant. + +What information exists suggests an **extremely cold** environment, with conditions hostile to most forms of life. Expeditions are rare, and permanent settlements are either nonexistent or extremely isolated. Much of the region remains unexplored, making it a source of speculation, myth, and lost history. diff --git a/bloodisfuel.png b/bloodisfuel.png new file mode 100644 index 0000000..d7218b8 Binary files /dev/null and b/bloodisfuel.png differ diff --git a/crack rat.png b/crack rat.png new file mode 100644 index 0000000..9f7e29c Binary files /dev/null and b/crack rat.png differ diff --git a/jetstream scam.png b/jetstream scam.png new file mode 100644 index 0000000..9a48ece Binary files /dev/null and b/jetstream scam.png differ diff --git a/monkeballs.png b/monkeballs.png new file mode 100644 index 0000000..d28af48 Binary files /dev/null and b/monkeballs.png differ