From dcf2f6909f5cb1ca78f1de43e78799a8dbbdbd28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=99=E5=90=9B=E5=BE=A1?= Date: Thu, 26 Dec 2024 14:13:43 +0800 Subject: [PATCH] vault backup: 2024-12-26 14:13:43 --- .obsidian/app.json | 3 + .obsidian/appearance.json | 3 + .obsidian/community-plugins.json | 4 + .obsidian/core-plugins.json | 30 + .obsidian/graph.json | 22 + .obsidian/plugins/obsidian-git/data.json | 58 + .obsidian/plugins/obsidian-git/main.js | 383 + .obsidian/plugins/obsidian-git/manifest.json | 10 + .../plugins/obsidian-git/obsidian_askpass.sh | 23 + .obsidian/plugins/obsidian-git/styles.css | 566 + .obsidian/plugins/obsidian-kanban/main.js | 153 + .../plugins/obsidian-kanban/manifest.json | 11 + .obsidian/plugins/obsidian-kanban/styles.css | 1 + .obsidian/themes/Border/manifest.json | 7 + .obsidian/themes/Border/theme.css | 9214 +++++++++++++++++ .obsidian/workspace.json | 197 + 4. 存档/PARA 组织法.md | 51 + 主页.canvas | 4 + 任务.md | 23 + 19 files changed, 10763 insertions(+) create mode 100644 .obsidian/app.json create mode 100644 .obsidian/appearance.json create mode 100644 .obsidian/community-plugins.json create mode 100644 .obsidian/core-plugins.json create mode 100644 .obsidian/graph.json create mode 100644 .obsidian/plugins/obsidian-git/data.json create mode 100644 .obsidian/plugins/obsidian-git/main.js create mode 100644 .obsidian/plugins/obsidian-git/manifest.json create mode 100644 .obsidian/plugins/obsidian-git/obsidian_askpass.sh create mode 100644 .obsidian/plugins/obsidian-git/styles.css create mode 100644 .obsidian/plugins/obsidian-kanban/main.js create mode 100644 .obsidian/plugins/obsidian-kanban/manifest.json create mode 100644 .obsidian/plugins/obsidian-kanban/styles.css create mode 100644 .obsidian/themes/Border/manifest.json create mode 100644 .obsidian/themes/Border/theme.css create mode 100644 .obsidian/workspace.json create mode 100644 4. 存档/PARA 组织法.md create mode 100644 主页.canvas create mode 100644 任务.md diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..e609a07 --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,3 @@ +{ + "promptDelete": false +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..0a58caf --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,3 @@ +{ + "cssTheme": "Border" +} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json new file mode 100644 index 0000000..ea344c7 --- /dev/null +++ b/.obsidian/community-plugins.json @@ -0,0 +1,4 @@ +[ + "obsidian-kanban", + "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..436f43c --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,30 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": false +} \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json new file mode 100644 index 0000000..42a46ec --- /dev/null +++ b/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 1, + "close": true +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/data.json b/.obsidian/plugins/obsidian-git/data.json new file mode 100644 index 0000000..f2cab91 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/data.json @@ -0,0 +1,58 @@ +{ + "commitMessage": "vault backup: {{date}}", + "commitDateFormat": "YYYY-MM-DD HH:mm:ss", + "autoSaveInterval": 0, + "autoPushInterval": 0, + "autoPullInterval": 0, + "autoPullOnBoot": false, + "disablePush": false, + "pullBeforePush": true, + "disablePopups": false, + "disablePopupsForNoChanges": false, + "listChangedFilesInMessageBody": false, + "showStatusBar": true, + "updateSubmodules": false, + "syncMethod": "merge", + "customMessageOnAutoBackup": false, + "autoBackupAfterFileChange": false, + "treeStructure": true, + "refreshSourceControl": true, + "basePath": "", + "differentIntervalCommitAndPush": false, + "changedFilesInStatusBar": false, + "showedMobileNotice": true, + "refreshSourceControlTimer": 7000, + "showBranchStatusBar": true, + "setLastSaveToLastCommit": false, + "submoduleRecurseCheckout": false, + "gitDir": "", + "showFileMenu": true, + "authorInHistoryView": "hide", + "dateInHistoryView": false, + "lineAuthor": { + "show": false, + "followMovement": "inactive", + "authorDisplay": "initials", + "showCommitHash": false, + "dateTimeFormatOptions": "date", + "dateTimeFormatCustomString": "YYYY-MM-DD HH:mm", + "dateTimeTimezone": "viewer-local", + "coloringMaxAge": "1y", + "colorNew": { + "r": 255, + "g": 150, + "b": 150 + }, + "colorOld": { + "r": 120, + "g": 160, + "b": 255 + }, + "textColorCss": "var(--text-muted)", + "ignoreWhitespace": false, + "gutterSpacingFallbackLength": 5, + "lastShownAuthorDisplay": "initials", + "lastShownDateTimeFormatOptions": "date" + }, + "autoCommitMessage": "vault backup: {{date}}" +} \ 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..fa660f9 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/main.js @@ -0,0 +1,383 @@ +/* +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 rk=Object.create;var Pa=Object.defineProperty;var ik=Object.getOwnPropertyDescriptor;var ak=Object.getOwnPropertyNames;var sk=Object.getPrototypeOf,ok=Object.prototype.hasOwnProperty;var lk=(e,t,n)=>t in e?Pa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ck=(e,t)=>()=>(e&&(t=e(e=0)),t);var R=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),uk=(e,t)=>{for(var n in t)Pa(e,n,{get:t[n],enumerable:!0})},hm=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ak(t))!ok.call(e,i)&&i!==n&&Pa(e,i,{get:()=>t[i],enumerable:!(r=ik(t,i))||r.enumerable});return e};var Xe=(e,t,n)=>(n=e!=null?rk(sk(e)):{},hm(t||!e||!e.__esModule?Pa(n,"default",{value:e,enumerable:!0}):n,e)),fk=e=>hm(Pa({},"__esModule",{value:!0}),e);var ut=(e,t,n)=>lk(e,typeof t!="symbol"?t+"":t,n);var mm=R(fo=>{"use strict";v();fo.byteLength=dk;fo.toByteArray=mk;fo.fromByteArray=vk;var vn=[],Zt=[],hk=typeof Uint8Array!="undefined"?Uint8Array:Array,vu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Fr=0,dm=vu.length;Fr0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function dk(e){var t=pm(e),n=t[0],r=t[1];return(n+r)*3/4-r}function pk(e,t,n){return(t+n)*3/4-n}function mk(e){var t,n=pm(e),r=n[0],i=n[1],a=new hk(pk(e,r,i)),s=0,o=i>0?r-4:r,l;for(l=0;l>16&255,a[s++]=t>>8&255,a[s++]=t&255;return i===2&&(t=Zt[e.charCodeAt(l)]<<2|Zt[e.charCodeAt(l+1)]>>4,a[s++]=t&255),i===1&&(t=Zt[e.charCodeAt(l)]<<10|Zt[e.charCodeAt(l+1)]<<4|Zt[e.charCodeAt(l+2)]>>2,a[s++]=t>>8&255,a[s++]=t&255),a}function gk(e){return vn[e>>18&63]+vn[e>>12&63]+vn[e>>6&63]+vn[e&63]}function yk(e,t,n){for(var r,i=[],a=t;ao?o:s+a));return r===1?(t=e[n-1],i.push(vn[t>>2]+vn[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(vn[t>>10]+vn[t>>4&63]+vn[t<<2&63]+"=")),i.join("")}});var gm=R(wu=>{v();wu.read=function(e,t,n,r,i){var a,s,o=i*8-r-1,l=(1<>1,u=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=o;u>0;a=a*256+e[t+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=r;u>0;s=s*256+e[t+f],f+=h,u-=8);if(a===0)a=1-c;else{if(a===l)return s?NaN:(d?-1:1)*(1/0);s=s+Math.pow(2,r),a=a-c}return(d?-1:1)*s*Math.pow(2,a-r)};wu.write=function(e,t,n,r,i,a){var s,o,l,c=a*8-i-1,u=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:a-1,p=r?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?t+=h/l:t+=h*Math.pow(2,1-f),t*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(t*l-1)*Math.pow(2,i),s=s+f):(o=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=o&255,d+=p,o/=256,i-=8);for(s=s<0;e[n+d]=s&255,d+=p,s/=256,c-=8);e[n+d-p]|=g*128}});var Cu=R(fi=>{"use strict";v();var bu=mm(),ci=gm(),ym=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;fi.Buffer=O;fi.SlowBuffer=Ek;fi.INSPECT_MAX_BYTES=50;var ho=2147483647;fi.kMaxLength=ho;O.TYPED_ARRAY_SUPPORT=wk();!O.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 wk(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch(e){return!1}}Object.defineProperty(O.prototype,"parent",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.buffer}});Object.defineProperty(O.prototype,"offset",{enumerable:!0,get:function(){if(O.isBuffer(this))return this.byteOffset}});function Ln(e){if(e>ho)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,O.prototype),t}function O(e,t,n){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Eu(e)}return xm(e,t,n)}O.poolSize=8192;function xm(e,t,n){if(typeof e=="string")return xk(e,t);if(ArrayBuffer.isView(e))return _k(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(wn(e,ArrayBuffer)||e&&wn(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(wn(e,SharedArrayBuffer)||e&&wn(e.buffer,SharedArrayBuffer)))return _u(e,t,n);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return O.from(r,t,n);let i=Sk(e);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return O.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}O.from=function(e,t,n){return xm(e,t,n)};Object.setPrototypeOf(O.prototype,Uint8Array.prototype);Object.setPrototypeOf(O,Uint8Array);function _m(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function bk(e,t,n){return _m(e),e<=0?Ln(e):t!==void 0?typeof n=="string"?Ln(e).fill(t,n):Ln(e).fill(t):Ln(e)}O.alloc=function(e,t,n){return bk(e,t,n)};function Eu(e){return _m(e),Ln(e<0?0:Au(e)|0)}O.allocUnsafe=function(e){return Eu(e)};O.allocUnsafeSlow=function(e){return Eu(e)};function xk(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!O.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let n=Sm(e,t)|0,r=Ln(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function xu(e){let t=e.length<0?0:Au(e.length)|0,n=Ln(t);for(let r=0;r=ho)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ho.toString(16)+" bytes");return e|0}function Ek(e){return+e!=e&&(e=0),O.alloc(+e)}O.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==O.prototype};O.compare=function(t,n){if(wn(t,Uint8Array)&&(t=O.from(t,t.offset,t.byteLength)),wn(n,Uint8Array)&&(n=O.from(n,n.offset,n.byteLength)),!O.isBuffer(t)||!O.isBuffer(n))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===n)return 0;let r=t.length,i=n.length;for(let a=0,s=Math.min(r,i);ai.length?(O.isBuffer(s)||(s=O.from(s)),s.copy(i,a)):Uint8Array.prototype.set.call(i,s,a);else if(O.isBuffer(s))s.copy(i,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=s.length}return i};function Sm(e,t){if(O.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||wn(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Su(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return Om(e).length;default:if(i)return r?-1:Su(e).length;t=(""+t).toLowerCase(),i=!0}}O.byteLength=Sm;function Ak(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Lk(this,t,n);case"utf8":case"utf-8":return Am(this,t,n);case"ascii":return Ik(this,t,n);case"latin1":case"binary":return Rk(this,t,n);case"base64":return Mk(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jk(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}O.prototype._isBuffer=!0;function Pr(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}O.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let n=0;nn&&(t+=" ... "),""};ym&&(O.prototype[ym]=O.prototype.inspect);O.prototype.compare=function(t,n,r,i,a){if(wn(t,Uint8Array)&&(t=O.from(t,t.offset,t.byteLength)),!O.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(n===void 0&&(n=0),r===void 0&&(r=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),n<0||r>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&n>=r)return 0;if(i>=a)return-1;if(n>=r)return 1;if(n>>>=0,r>>>=0,i>>>=0,a>>>=0,this===t)return 0;let s=a-i,o=r-n,l=Math.min(s,o),c=this.slice(i,a),u=t.slice(n,r);for(let f=0;f2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Tu(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t=="string"&&(t=O.from(t,r)),O.isBuffer(t))return t.length===0?-1:vm(e,t,n,r,i);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):vm(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function vm(e,t,n,r,i){let a=1,s=e.length,o=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,s/=2,o/=2,n/=2}function l(u,f){return a===1?u[f]:u.readUInt16BE(f*a)}let c;if(i){let u=-1;for(c=n;cs&&(n=s-o),c=n;c>=0;c--){let u=!0;for(let f=0;fi&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let s;for(s=0;s>>0,isFinite(r)?(r=r>>>0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-n;if((r===void 0||r>a)&&(r=a),t.length>0&&(r<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return kk(this,t,n,r);case"utf8":case"utf-8":return Tk(this,t,n,r);case"ascii":case"latin1":case"binary":return Ck(this,t,n,r);case"base64":return Fk(this,t,n,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pk(this,t,n,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}};O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Mk(e,t,n){return t===0&&n===e.length?bu.fromByteArray(e):bu.fromByteArray(e.slice(t,n))}function Am(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i239?4:a>223?3:a>191?2:1;if(i+o<=n){let l,c,u,f;switch(o){case 1:a<128&&(s=a);break;case 2:l=e[i+1],(l&192)===128&&(f=(a&31)<<6|l&63,f>127&&(s=f));break;case 3:l=e[i+1],c=e[i+2],(l&192)===128&&(c&192)===128&&(f=(a&15)<<12|(l&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(s=f));break;case 4:l=e[i+1],c=e[i+2],u=e[i+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(f=(a&15)<<18|(l&63)<<12|(c&63)<<6|u&63,f>65535&&f<1114112&&(s=f))}}s===null?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|s&1023),r.push(s),i+=o}return Ok(r)}var wm=4096;function Ok(e){let t=e.length;if(t<=wm)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr)&&(n=r);let i="";for(let a=t;ar&&(t=r),n<0?(n+=r,n<0&&(n=0)):n>r&&(n=r),nn)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(t,n,r){t=t>>>0,n=n>>>0,r||ft(t,n,this.length);let i=this[t],a=1,s=0;for(;++s>>0,n=n>>>0,r||ft(t,n,this.length);let i=this[t+--n],a=1;for(;n>0&&(a*=256);)i+=this[t+--n]*a;return i};O.prototype.readUint8=O.prototype.readUInt8=function(t,n){return t=t>>>0,n||ft(t,1,this.length),this[t]};O.prototype.readUint16LE=O.prototype.readUInt16LE=function(t,n){return t=t>>>0,n||ft(t,2,this.length),this[t]|this[t+1]<<8};O.prototype.readUint16BE=O.prototype.readUInt16BE=function(t,n){return t=t>>>0,n||ft(t,2,this.length),this[t]<<8|this[t+1]};O.prototype.readUint32LE=O.prototype.readUInt32LE=function(t,n){return t=t>>>0,n||ft(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};O.prototype.readUint32BE=O.prototype.readUInt32BE=function(t,n){return t=t>>>0,n||ft(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};O.prototype.readBigUInt64LE=Qn(function(t){t=t>>>0,ui(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&Ma(t,this.length-8);let i=n+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,a=this[++t]+this[++t]*2**8+this[++t]*2**16+r*2**24;return BigInt(i)+(BigInt(a)<>>0,ui(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&Ma(t,this.length-8);let i=n*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],a=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+r;return(BigInt(i)<>>0,n=n>>>0,r||ft(t,n,this.length);let i=this[t],a=1,s=0;for(;++s=a&&(i-=Math.pow(2,8*n)),i};O.prototype.readIntBE=function(t,n,r){t=t>>>0,n=n>>>0,r||ft(t,n,this.length);let i=n,a=1,s=this[t+--i];for(;i>0&&(a*=256);)s+=this[t+--i]*a;return a*=128,s>=a&&(s-=Math.pow(2,8*n)),s};O.prototype.readInt8=function(t,n){return t=t>>>0,n||ft(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};O.prototype.readInt16LE=function(t,n){t=t>>>0,n||ft(t,2,this.length);let r=this[t]|this[t+1]<<8;return r&32768?r|4294901760:r};O.prototype.readInt16BE=function(t,n){t=t>>>0,n||ft(t,2,this.length);let r=this[t+1]|this[t]<<8;return r&32768?r|4294901760:r};O.prototype.readInt32LE=function(t,n){return t=t>>>0,n||ft(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};O.prototype.readInt32BE=function(t,n){return t=t>>>0,n||ft(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};O.prototype.readBigInt64LE=Qn(function(t){t=t>>>0,ui(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&Ma(t,this.length-8);let i=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(r<<24);return(BigInt(i)<>>0,ui(t,"offset");let n=this[t],r=this[t+7];(n===void 0||r===void 0)&&Ma(t,this.length-8);let i=(n<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(i)<>>0,n||ft(t,4,this.length),ci.read(this,t,!0,23,4)};O.prototype.readFloatBE=function(t,n){return t=t>>>0,n||ft(t,4,this.length),ci.read(this,t,!1,23,4)};O.prototype.readDoubleLE=function(t,n){return t=t>>>0,n||ft(t,8,this.length),ci.read(this,t,!0,52,8)};O.prototype.readDoubleBE=function(t,n){return t=t>>>0,n||ft(t,8,this.length),ci.read(this,t,!1,52,8)};function Pt(e,t,n,r,i,a){if(!O.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(t,n,r,i){if(t=+t,n=n>>>0,r=r>>>0,!i){let o=Math.pow(2,8*r)-1;Pt(this,t,n,r,o,0)}let a=1,s=0;for(this[n]=t&255;++s>>0,r=r>>>0,!i){let o=Math.pow(2,8*r)-1;Pt(this,t,n,r,o,0)}let a=r-1,s=1;for(this[n+a]=t&255;--a>=0&&(s*=256);)this[n+a]=t/s&255;return n+r};O.prototype.writeUint8=O.prototype.writeUInt8=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,1,255,0),this[n]=t&255,n+1};O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,2,65535,0),this[n]=t&255,this[n+1]=t>>>8,n+2};O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,2,65535,0),this[n]=t>>>8,this[n+1]=t&255,n+2};O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,4,4294967295,0),this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255,n+4};O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,4,4294967295,0),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};function km(e,t,n,r,i){Mm(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a=a>>8,e[n++]=a,a=a>>8,e[n++]=a,a=a>>8,e[n++]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=s,s=s>>8,e[n++]=s,s=s>>8,e[n++]=s,s=s>>8,e[n++]=s,n}function Tm(e,t,n,r,i){Mm(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a=a>>8,e[n+6]=a,a=a>>8,e[n+5]=a,a=a>>8,e[n+4]=a;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=s,s=s>>8,e[n+2]=s,s=s>>8,e[n+1]=s,s=s>>8,e[n]=s,n+8}O.prototype.writeBigUInt64LE=Qn(function(t,n=0){return km(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeBigUInt64BE=Qn(function(t,n=0){return Tm(this,t,n,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeIntLE=function(t,n,r,i){if(t=+t,n=n>>>0,!i){let l=Math.pow(2,8*r-1);Pt(this,t,n,r,l-1,-l)}let a=0,s=1,o=0;for(this[n]=t&255;++a>0)-o&255;return n+r};O.prototype.writeIntBE=function(t,n,r,i){if(t=+t,n=n>>>0,!i){let l=Math.pow(2,8*r-1);Pt(this,t,n,r,l-1,-l)}let a=r-1,s=1,o=0;for(this[n+a]=t&255;--a>=0&&(s*=256);)t<0&&o===0&&this[n+a+1]!==0&&(o=1),this[n+a]=(t/s>>0)-o&255;return n+r};O.prototype.writeInt8=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,1,127,-128),t<0&&(t=255+t+1),this[n]=t&255,n+1};O.prototype.writeInt16LE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,2,32767,-32768),this[n]=t&255,this[n+1]=t>>>8,n+2};O.prototype.writeInt16BE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,2,32767,-32768),this[n]=t>>>8,this[n+1]=t&255,n+2};O.prototype.writeInt32LE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,4,2147483647,-2147483648),this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24,n+4};O.prototype.writeInt32BE=function(t,n,r){return t=+t,n=n>>>0,r||Pt(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255,n+4};O.prototype.writeBigInt64LE=Qn(function(t,n=0){return km(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});O.prototype.writeBigInt64BE=Qn(function(t,n=0){return Tm(this,t,n,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Cm(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Fm(e,t,n,r,i){return t=+t,n=n>>>0,i||Cm(e,t,n,4,34028234663852886e22,-34028234663852886e22),ci.write(e,t,n,r,23,4),n+4}O.prototype.writeFloatLE=function(t,n,r){return Fm(this,t,n,!0,r)};O.prototype.writeFloatBE=function(t,n,r){return Fm(this,t,n,!1,r)};function Pm(e,t,n,r,i){return t=+t,n=n>>>0,i||Cm(e,t,n,8,17976931348623157e292,-17976931348623157e292),ci.write(e,t,n,r,52,8),n+8}O.prototype.writeDoubleLE=function(t,n,r){return Pm(this,t,n,!0,r)};O.prototype.writeDoubleBE=function(t,n,r){return Pm(this,t,n,!1,r)};O.prototype.copy=function(t,n,r,i){if(!O.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),!i&&i!==0&&(i=this.length),n>=t.length&&(n=t.length),n||(n=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-n>>0,r=r===void 0?this.length:r>>>0,t||(t=0);let a;if(typeof t=="number")for(a=n;a2**32?i=bm(String(n)):typeof n=="bigint"&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=bm(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r},RangeError);function bm(e){let t="",n=e.length,r=e[0]==="-"?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function Dk(e,t,n){ui(t,"offset"),(e[t]===void 0||e[t+n]===void 0)&&Ma(t,e.length-(n+1))}function Mm(e,t,n,r,i,a){if(e>n||e3?t===0||t===BigInt(0)?o=`>= 0${s} and < 2${s} ** ${(a+1)*8}${s}`:o=`>= -(2${s} ** ${(a+1)*8-1}${s}) and < 2 ** ${(a+1)*8-1}${s}`:o=`>= ${t}${s} and <= ${n}${s}`,new li.ERR_OUT_OF_RANGE("value",o,e)}Dk(r,i,a)}function ui(e,t){if(typeof e!="number")throw new li.ERR_INVALID_ARG_TYPE(t,"number",e)}function Ma(e,t,n){throw Math.floor(e)!==e?(ui(e,n),new li.ERR_OUT_OF_RANGE(n||"offset","an integer",e)):t<0?new li.ERR_BUFFER_OUT_OF_BOUNDS:new li.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}var Bk=/[^+/0-9A-Za-z-_]/g;function Nk(e){if(e=e.split("=")[0],e=e.trim().replace(Bk,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function Su(e,t){t=t||1/0;let n,r=e.length,i=null,a=[];for(let s=0;s55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return a}function $k(e){let t=[];for(let n=0;n>8,i=n%256,a.push(i),a.push(r);return a}function Om(e){return bu.toByteArray(Nk(e))}function po(e,t,n,r){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function wn(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function Tu(e){return e!==e}var Uk=function(){let e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Qn(e){return typeof BigInt=="undefined"?Gk:e}function Gk(){throw new Error("BigInt not supported")}});var Im,Fu,Buffer,v=ck(()=>{Im=require("obsidian");Im.Platform.isMobileApp?Fu=Cu().Buffer:Fu=global.Buffer;Buffer=Fu});var Lm=R((wD,Rm)=>{"use strict";v();var $t=function(e){if(e=e||{},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.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=e.timeout||$t.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||$t.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||$t.DEFAULT_MAX_EXECUTION_TIME,e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?this.maxPending=e.maxPending:this.maxPending=$t.DEFAULT_MAX_PENDING};$t.DEFAULT_TIMEOUT=0;$t.DEFAULT_MAX_OCCUPATION_TIME=0;$t.DEFAULT_MAX_EXECUTION_TIME=0;$t.DEFAULT_MAX_PENDING=1e3;$t.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!="function")throw new Error("You must pass a function to execute");var i=null,a=null,s=null;typeof n!="function"&&(r=n,n=null,s=new this.Promise(function(b,S){i=b,a=S})),r=r||{};var o=!1,l=null,c=null,u=null,f=this,h=function(b,S,A){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(f.queues[e]&&f.queues[e].length===0&&delete f.queues[e],f.domainReentrant&&delete f.domains[e]),o||(s?S?a(S):i(A):typeof n=="function"&&n(S,A),o=!0),b&&f.queues[e]&&f.queues[e].length>0&&f.queues[e].shift()()},d=function(b){if(o)return h(b);l&&(clearTimeout(l),l=null),f.domainReentrant&&b&&(f.domains[e]=process.domain);var S=r.maxExecutionTime||f.maxExecutionTime;if(S&&(u=setTimeout(function(){f.queues[e]&&h(b,new Error("Maximum execution time is exceeded "+e))},S)),t.length===1){var A=!1;try{t(function(x,k){A||(A=!0,h(b,x,k))})}catch(x){A||(A=!0,h(b,x))}}else f._promiseTry(function(){return t()}).then(function(x){h(b,void 0,x)},function(x){h(b,x)})};f.domainReentrant&&process.domain&&(d=process.domain.bind(d));var p=r.maxPending||f.maxPending;if(!f.queues[e])f.queues[e]=[],d(!0);else if(f.domainReentrant&&process.domain&&process.domain===f.domains[e])d(!1);else if(f.queues[e].length>=p)h(!1,new Error("Too many pending tasks in queue "+e));else{var g=function(){d(!0)};r.skipQueue?f.queues[e].unshift(g):f.queues[e].push(g);var m=r.timeout||f.timeout;m&&(l=setTimeout(function(){l=null,h(!1,new Error("async-lock timed out in queue "+e))},m))}var w=r.maxOccupationTime||f.maxOccupationTime;if(w&&(c=setTimeout(function(){f.queues[e]&&h(!1,new Error("Maximum occupation time is exceeded in queue "+e))},w)),s)return s};$t.prototype._acquireBatch=function(e,t,n,r){typeof n!="function"&&(r=n,n=null);var i=this,a=function(o,l){return function(c){i.acquire(o,l,c,r)}},s=e.reduceRight(function(o,l){return a(l,o)},t);if(typeof n=="function")s(n);else return new this.Promise(function(o,l){s.length===1?s(function(c,u){c?l(c):o(u)}):o(s())})};$t.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0};$t.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(t){return this.Promise.reject(t)}};Rm.exports=$t});var Dm=R((xD,jm)=>{"use strict";v();jm.exports=Lm()});var Bm=R((SD,Pu)=>{v();typeof Object.create=="function"?Pu.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Pu.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}}});var Ou=R((Mu,$m)=>{v();var mo=Cu(),bn=mo.Buffer;function Nm(e,t){for(var n in e)t[n]=e[n]}bn.from&&bn.alloc&&bn.allocUnsafe&&bn.allocUnsafeSlow?$m.exports=mo:(Nm(mo,Mu),Mu.Buffer=Mr);function Mr(e,t,n){return bn(e,t,n)}Mr.prototype=Object.create(bn.prototype);Nm(bn,Mr);Mr.from=function(e,t,n){if(typeof e=="number")throw new TypeError("Argument must not be a number");return bn(e,t,n)};Mr.alloc=function(e,t,n){if(typeof e!="number")throw new TypeError("Argument must be a number");var r=bn(e);return t!==void 0?typeof n=="string"?r.fill(t,n):r.fill(t):r.fill(0),r};Mr.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return bn(e)};Mr.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return mo.SlowBuffer(e)}});var Gm=R((kD,Um)=>{v();var Hm=Ou().Buffer;function go(e,t){this._block=Hm.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}go.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Hm.from(e,t));for(var n=this._block,r=this._blockSize,i=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=this._len*8;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(n&4294967295)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a};go.prototype._update=function(){throw new Error("_update must be implemented by subclass")};Um.exports=go});var Wm=R((CD,Vm)=>{v();var zk=Bm(),zm=Gm(),Vk=Ou().Buffer,Wk=[1518500249,1859775393,-1894007588,-899497514],qk=new Array(80);function Oa(){this.init(),this._w=qk,zm.call(this,64,56)}zk(Oa,zm);Oa.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Xk(e){return e<<1|e>>>31}function Yk(e){return e<<5|e>>>27}function Zk(e){return e<<30|e>>>2}function Kk(e,t,n,r){return e===0?t&n|~t&r:e===2?t&n|t&r|n&r:t^n^r}Oa.prototype._update=function(e){for(var t=this._w,n=this._a|0,r=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)t[o]=e.readInt32BE(o*4);for(;o<80;++o)t[o]=Xk(t[o-3]^t[o-8]^t[o-14]^t[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=Yk(n)+Kk(c,r,i,a)+s+t[l]+Wk[c]|0;s=a,a=i,i=Zk(r),r=n,n=u}this._a=n+this._a|0,this._b=r+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};Oa.prototype._hash=function(){var e=Vk.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};Vm.exports=Oa});var Xm=R(Iu=>{v();var qm;(function(e){typeof DO_NOT_EXPORT_CRC=="undefined"?typeof Iu=="object"?e(Iu):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(qm={}):e(qm={})})(function(e){e.version="1.2.2";function t(){for(var y=0,E=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,E[_]=y;return typeof Int32Array!="undefined"?new Int32Array(E):E}var n=t();function r(y){var E=0,_=0,C=0,P=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(C=0;C!=256;++C)P[C]=y[C];for(C=0;C!=256;++C)for(_=y[C],E=256+C;E<4096;E+=256)_=P[E]=_>>>8^y[_&255];var L=[];for(C=1;C!=16;++C)L[C-1]=typeof Int32Array!="undefined"?P.subarray(C*256,C*256+256):P.slice(C*256,C*256+256);return L}var i=r(n),a=i[0],s=i[1],o=i[2],l=i[3],c=i[4],u=i[5],f=i[6],h=i[7],d=i[8],p=i[9],g=i[10],m=i[11],w=i[12],b=i[13],S=i[14];function A(y,E){for(var _=E^-1,C=0,P=y.length;C>>8^n[(_^y.charCodeAt(C++))&255];return~_}function x(y,E){for(var _=E^-1,C=y.length-15,P=0;P>8&255]^w[y[P++]^_>>16&255]^m[y[P++]^_>>>24]^g[y[P++]]^p[y[P++]]^d[y[P++]]^h[y[P++]]^f[y[P++]]^u[y[P++]]^c[y[P++]]^l[y[P++]]^o[y[P++]]^s[y[P++]]^a[y[P++]]^n[y[P++]];for(C+=15;P>>8^n[(_^y[P++])&255];return~_}function k(y,E){for(var _=E^-1,C=0,P=y.length,L=0,N=0;C>>8^n[(_^L)&255]:L<2048?(_=_>>>8^n[(_^(192|L>>6&31))&255],_=_>>>8^n[(_^(128|L&63))&255]):L>=55296&&L<57344?(L=(L&1023)+64,N=y.charCodeAt(C++)&1023,_=_>>>8^n[(_^(240|L>>8&7))&255],_=_>>>8^n[(_^(128|L>>2&63))&255],_=_>>>8^n[(_^(128|N>>6&15|(L&3)<<4))&255],_=_>>>8^n[(_^(128|N&63))&255]):(_=_>>>8^n[(_^(224|L>>12&15))&255],_=_>>>8^n[(_^(128|L>>6&63))&255],_=_>>>8^n[(_^(128|L&63))&255]);return~_}e.table=n,e.bstr=A,e.buf=x,e.str=k})});var jn=R(St=>{"use strict";v();var Jk=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function Qk(e,t){return Object.prototype.hasOwnProperty.call(e,t)}St.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(var r in n)Qk(n,r)&&(e[r]=n[r])}}return e};St.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var e3={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a{"use strict";v();var n3=jn(),r3=4,Ym=0,Zm=1,i3=2;function di(e){for(var t=e.length;--t>=0;)e[t]=0}var a3=0,ng=1,s3=2,o3=3,l3=258,$u=29,Ba=256,Ra=Ba+1+$u,hi=30,Hu=19,rg=2*Ra+1,Or=15,Ru=16,c3=7,Uu=256,ig=16,ag=17,sg=18,Bu=[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],yo=[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],u3=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],og=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f3=512,Dn=new Array((Ra+2)*2);di(Dn);var Ia=new Array(hi*2);di(Ia);var La=new Array(f3);di(La);var ja=new Array(l3-o3+1);di(ja);var Gu=new Array($u);di(Gu);var vo=new Array(hi);di(vo);function Lu(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var lg,cg,ug;function ju(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function fg(e){return e<256?La[e]:La[256+(e>>>7)]}function Da(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Mt(e,t,n){e.bi_valid>Ru-n?(e.bi_buf|=t<>Ru-e.bi_valid,e.bi_valid+=n-Ru):(e.bi_buf|=t<>>=1,n<<=1;while(--t>0);return n>>>1}function h3(e){e.bi_valid===16?(Da(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function d3(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,l=t.stat_desc.max_length,c,u,f,h,d,p,g=0;for(h=0;h<=Or;h++)e.bl_count[h]=0;for(n[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;cl&&(h=l,g++),n[u*2+1]=h,!(u>r)&&(e.bl_count[h]++,d=0,u>=o&&(d=s[u-o]),p=n[u*2],e.opt_len+=p*(h+d),a&&(e.static_len+=p*(i[u*2+1]+d)));if(g!==0){do{for(h=l-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[l]--,g-=2}while(g>0);for(h=l;h!==0;h--)for(u=e.bl_count[h];u!==0;)f=e.heap[--c],!(f>r)&&(n[f*2+1]!==h&&(e.opt_len+=(h-n[f*2+1])*n[f*2],n[f*2+1]=h),u--)}}function dg(e,t,n){var r=new Array(Or+1),i=0,a,s;for(a=1;a<=Or;a++)r[a]=i=i+n[a-1]<<1;for(s=0;s<=t;s++){var o=e[s*2+1];o!==0&&(e[s*2]=hg(r[o]++,o))}}function p3(){var e,t,n,r,i,a=new Array(Or+1);for(n=0,r=0;r<$u-1;r++)for(Gu[r]=n,e=0;e<1<>=7;r8?Da(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function m3(e,t,n,r){mg(e),r&&(Da(e,n),Da(e,~n)),n3.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}function Km(e,t,n,r){var i=t*2,a=n*2;return e[i]>1;s>=1;s--)Du(e,n,s);c=a;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Du(e,n,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,n[c*2]=n[s*2]+n[o*2],e.depth[c]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,n[s*2+1]=n[o*2+1]=c,e.heap[1]=c++,Du(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],d3(e,t),dg(n,l,e.bl_count)}function Qm(e,t,n){var r,i=-1,a,s=t[0*2+1],o=0,l=7,c=4;for(s===0&&(l=138,c=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=s,s=t[(r+1)*2+1],!(++o=3&&e.bl_tree[og[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function y3(e,t,n,r){var i;for(Mt(e,t-257,5),Mt(e,n-1,5),Mt(e,r-4,4),i=0;i>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Ym;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Zm;for(n=32;n0?(e.strm.data_type===i3&&(e.strm.data_type=v3(e)),Nu(e,e.l_desc),Nu(e,e.d_desc),s=g3(e),i=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=i&&(i=a)):i=a=n+5,n+4<=i&&t!==-1?gg(e,t,n,r):e.strategy===r3||a===i?(Mt(e,(ng<<1)+(r?1:0),3),Jm(e,Dn,Ia)):(Mt(e,(s3<<1)+(r?1:0),3),y3(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Jm(e,e.dyn_ltree,e.dyn_dtree)),pg(e),r&&mg(e)}function _3(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(ja[n]+Ba+1)*2]++,e.dyn_dtree[fg(t)*2]++),e.last_lit===e.lit_bufsize-1}pi._tr_init=w3;pi._tr_stored_block=gg;pi._tr_flush_block=x3;pi._tr_tally=_3;pi._tr_align=b3});var zu=R((jD,vg)=>{"use strict";v();function S3(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,s=0;n!==0;){s=n>2e3?2e3:n,n-=s;do i=i+t[r++]|0,a=a+i|0;while(--s);i%=65521,a%=65521}return i|a<<16|0}vg.exports=S3});var Vu=R((BD,wg)=>{"use strict";v();function E3(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var A3=E3();function k3(e,t,n,r){var i=A3,a=r+n;e^=-1;for(var s=r;s>>8^i[(e^t[s])&255];return e^-1}wg.exports=k3});var wo=R(($D,bg)=>{"use strict";v();bg.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 Fg=R(En=>{"use strict";v();var Et=jn(),Kt=yg(),Eg=zu(),er=Vu(),T3=wo(),jr=0,C3=1,F3=3,ar=4,xg=5,Sn=0,_g=1,Jt=-2,P3=-3,Wu=-5,M3=-1,O3=1,bo=2,I3=3,R3=4,L3=0,j3=2,Eo=8,D3=9,B3=15,N3=8,$3=29,H3=256,Xu=H3+1+$3,U3=30,G3=19,z3=2*Xu+1,V3=15,me=3,rr=258,cn=rr+me+1,W3=32,Ao=42,Yu=69,xo=73,_o=91,So=103,Ir=113,$a=666,lt=1,Ha=2,Rr=3,yi=4,q3=3;function ir(e,t){return e.msg=T3[t],t}function Sg(e){return(e<<1)-(e>4?9:0)}function nr(e){for(var t=e.length;--t>=0;)e[t]=0}function tr(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(Et.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function dt(e,t){Kt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,tr(e.strm)}function ve(e,t){e.pending_buf[e.pending++]=t}function Na(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function X3(e,t,n,r){var i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,Et.arraySet(t,e.input,e.next_in,i,n),e.state.wrap===1?e.adler=Eg(e.adler,t,i,n):e.state.wrap===2&&(e.adler=er(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)}function Ag(e,t){var n=e.max_chain_length,r=e.strstart,i,a,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-cn?e.strstart-(e.w_size-cn):0,c=e.window,u=e.w_mask,f=e.prev,h=e.strstart+rr,d=c[r+s-1],p=c[r+s];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(i=t,!(c[i+s]!==p||c[i+s-1]!==d||c[i]!==c[r]||c[++i]!==c[r+1])){r+=2,i++;do;while(c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&c[++r]===c[++i]&&rs){if(e.match_start=t,s=a,a>=o)break;d=c[r+s-1],p=c[r+s]}}while((t=f[t&u])>l&&--n!==0);return s<=e.lookahead?s:e.lookahead}function Lr(e){var t=e.w_size,n,r,i,a,s;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-cn)){Et.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,r=e.hash_size,n=r;do i=e.head[--n],e.head[n]=i>=t?i-t:0;while(--r);r=t,n=r;do i=e.prev[--n],e.prev[n]=i>=t?i-t:0;while(--r);a+=t}if(e.strm.avail_in===0)break;if(r=X3(e.strm,e.window,e.strstart+e.lookahead,a),e.lookahead+=r,e.lookahead+e.insert>=me)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Lr(e),e.lookahead===0&&t===jr)return lt;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,dt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-cn&&(dt(e,!1),e.strm.avail_out===0))return lt}return e.insert=0,t===ar?(dt(e,!0),e.strm.avail_out===0?Rr:yi):(e.strstart>e.block_start&&(dt(e,!1),e.strm.avail_out===0),lt)}function qu(e,t){for(var n,r;;){if(e.lookahead=me&&(e.ins_h=(e.ins_h<=me)if(r=Kt._tr_tally(e,e.strstart-e.match_start,e.match_length-me),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=me){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=me&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=me-1)),e.prev_length>=me&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-me,r=Kt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-me),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=(e.ins_h<=me&&e.strstart>0&&(i=e.strstart-1,r=s[i],r===s[++i]&&r===s[++i]&&r===s[++i])){a=e.strstart+rr;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=me?(n=Kt._tr_tally(e,1,e.match_length-me),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Kt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(dt(e,!1),e.strm.avail_out===0))return lt}return e.insert=0,t===ar?(dt(e,!0),e.strm.avail_out===0?Rr:yi):e.last_lit&&(dt(e,!1),e.strm.avail_out===0)?lt:Ha}function K3(e,t){for(var n;;){if(e.lookahead===0&&(Lr(e),e.lookahead===0)){if(t===jr)return lt;break}if(e.match_length=0,n=Kt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(dt(e,!1),e.strm.avail_out===0))return lt}return e.insert=0,t===ar?(dt(e,!0),e.strm.avail_out===0?Rr:yi):e.last_lit&&(dt(e,!1),e.strm.avail_out===0)?lt:Ha}function _n(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var gi;gi=[new _n(0,0,0,0,Y3),new _n(4,4,8,4,qu),new _n(4,5,16,8,qu),new _n(4,6,32,32,qu),new _n(4,4,16,16,mi),new _n(8,16,32,32,mi),new _n(8,16,128,128,mi),new _n(8,32,128,256,mi),new _n(32,128,258,1024,mi),new _n(32,258,258,4096,mi)];function J3(e){e.window_size=2*e.w_size,nr(e.head),e.max_lazy_match=gi[e.level].max_lazy,e.good_match=gi[e.level].good_length,e.nice_match=gi[e.level].nice_length,e.max_chain_length=gi[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=me-1,e.match_available=0,e.ins_h=0}function Q3(){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=Eo,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 Et.Buf16(z3*2),this.dyn_dtree=new Et.Buf16((2*U3+1)*2),this.bl_tree=new Et.Buf16((2*G3+1)*2),nr(this.dyn_ltree),nr(this.dyn_dtree),nr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Et.Buf16(V3+1),this.heap=new Et.Buf16(2*Xu+1),nr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Et.Buf16(2*Xu+1),nr(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 kg(e){var t;return!e||!e.state?ir(e,Jt):(e.total_in=e.total_out=0,e.data_type=j3,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Ao:Ir,e.adler=t.wrap===2?0:1,t.last_flush=jr,Kt._tr_init(t),Sn)}function Tg(e){var t=kg(e);return t===Sn&&J3(e.state),t}function eT(e,t){return!e||!e.state||e.state.wrap!==2?Jt:(e.state.gzhead=t,Sn)}function Cg(e,t,n,r,i,a){if(!e)return Jt;var s=1;if(t===M3&&(t=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),i<1||i>D3||n!==Eo||r<8||r>15||t<0||t>9||a<0||a>R3)return ir(e,Jt);r===8&&(r=9);var o=new Q3;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=r,o.w_size=1<xg||t<0)return e?ir(e,Jt):Jt;if(r=e.state,!e.output||!e.input&&e.avail_in!==0||r.status===$a&&t!==ar)return ir(e,e.avail_out===0?Wu:Jt);if(r.strm=e,n=r.last_flush,r.last_flush=t,r.status===Ao)if(r.wrap===2)e.adler=0,ve(r,31),ve(r,139),ve(r,8),r.gzhead?(ve(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ve(r,r.gzhead.time&255),ve(r,r.gzhead.time>>8&255),ve(r,r.gzhead.time>>16&255),ve(r,r.gzhead.time>>24&255),ve(r,r.level===9?2:r.strategy>=bo||r.level<2?4:0),ve(r,r.gzhead.os&255),r.gzhead.extra&&r.gzhead.extra.length&&(ve(r,r.gzhead.extra.length&255),ve(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=er(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Yu):(ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,0),ve(r,r.level===9?2:r.strategy>=bo||r.level<2?4:0),ve(r,q3),r.status=Ir);else{var s=Eo+(r.w_bits-8<<4)<<8,o=-1;r.strategy>=bo||r.level<2?o=0:r.level<6?o=1:r.level===6?o=2:o=3,s|=o<<6,r.strstart!==0&&(s|=W3),s+=31-s%31,r.status=Ir,Na(r,s),r.strstart!==0&&(Na(r,e.adler>>>16),Na(r,e.adler&65535)),e.adler=1}if(r.status===Yu)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(r.gzhead.extra.length&65535)&&!(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=er(e.adler,r.pending_buf,r.pending-i,i)),tr(e),i=r.pending,r.pending===r.pending_buf_size));)ve(r,r.gzhead.extra[r.gzindex]&255),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=er(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=xo)}else r.status=xo;if(r.status===xo)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=er(e.adler,r.pending_buf,r.pending-i,i)),tr(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindexi&&(e.adler=er(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.gzindex=0,r.status=_o)}else r.status=_o;if(r.status===_o)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=er(e.adler,r.pending_buf,r.pending-i,i)),tr(e),i=r.pending,r.pending===r.pending_buf_size)){a=1;break}r.gzindexi&&(e.adler=er(e.adler,r.pending_buf,r.pending-i,i)),a===0&&(r.status=So)}else r.status=So;if(r.status===So&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&tr(e),r.pending+2<=r.pending_buf_size&&(ve(r,e.adler&255),ve(r,e.adler>>8&255),e.adler=0,r.status=Ir)):r.status=Ir),r.pending!==0){if(tr(e),e.avail_out===0)return r.last_flush=-1,Sn}else if(e.avail_in===0&&Sg(t)<=Sg(n)&&t!==ar)return ir(e,Wu);if(r.status===$a&&e.avail_in!==0)return ir(e,Wu);if(e.avail_in!==0||r.lookahead!==0||t!==jr&&r.status!==$a){var l=r.strategy===bo?K3(r,t):r.strategy===I3?Z3(r,t):gi[r.level].func(r,t);if((l===Rr||l===yi)&&(r.status=$a),l===lt||l===Rr)return e.avail_out===0&&(r.last_flush=-1),Sn;if(l===Ha&&(t===C3?Kt._tr_align(r):t!==xg&&(Kt._tr_stored_block(r,0,0,!1),t===F3&&(nr(r.head),r.lookahead===0&&(r.strstart=0,r.block_start=0,r.insert=0))),tr(e),e.avail_out===0))return r.last_flush=-1,Sn}return t!==ar?Sn:r.wrap<=0?_g:(r.wrap===2?(ve(r,e.adler&255),ve(r,e.adler>>8&255),ve(r,e.adler>>16&255),ve(r,e.adler>>24&255),ve(r,e.total_in&255),ve(r,e.total_in>>8&255),ve(r,e.total_in>>16&255),ve(r,e.total_in>>24&255)):(Na(r,e.adler>>>16),Na(r,e.adler&65535)),tr(e),r.wrap>0&&(r.wrap=-r.wrap),r.pending!==0?Sn:_g)}function rT(e){var t;return!e||!e.state?Jt:(t=e.state.status,t!==Ao&&t!==Yu&&t!==xo&&t!==_o&&t!==So&&t!==Ir&&t!==$a?ir(e,Jt):(e.state=null,t===Ir?ir(e,P3):Sn))}function iT(e,t){var n=t.length,r,i,a,s,o,l,c,u;if(!e||!e.state||(r=e.state,s=r.wrap,s===2||s===1&&r.status!==Ao||r.lookahead))return Jt;for(s===1&&(e.adler=Eg(e.adler,t,n,0)),r.wrap=0,n>=r.w_size&&(s===0&&(nr(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new Et.Buf8(r.w_size),Et.arraySet(u,t,n-r.w_size,r.w_size,0),t=u,n=r.w_size),o=e.avail_in,l=e.next_in,c=e.input,e.avail_in=n,e.next_in=0,e.input=t,Lr(r);r.lookahead>=me;){i=r.strstart,a=r.lookahead-(me-1);do r.ins_h=(r.ins_h<{"use strict";v();var ko=jn(),Pg=!0,Mg=!0;try{String.fromCharCode.apply(null,[0])}catch(e){Pg=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Mg=!1}var Ua=new ko.Buf8(256);for(Bn=0;Bn<256;Bn++)Ua[Bn]=Bn>=252?6:Bn>=248?5:Bn>=240?4:Bn>=224?3:Bn>=192?2:1;var Bn;Ua[254]=Ua[254]=1;vi.string2buf=function(e){var t,n,r,i,a,s=e.length,o=0;for(i=0;i>>6,t[a++]=128|n&63):n<65536?(t[a++]=224|n>>>12,t[a++]=128|n>>>6&63,t[a++]=128|n&63):(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63,t[a++]=128|n>>>6&63,t[a++]=128|n&63);return t};function Og(e,t){if(t<65534&&(e.subarray&&Mg||!e.subarray&&Pg))return String.fromCharCode.apply(null,ko.shrinkBuf(e,t));for(var n="",r=0;r4){o[r++]=65533,n+=a-1;continue}for(i&=a===2?31:a===3?15:7;a>1&&n1){o[r++]=65533;continue}i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|i&1023)}return Og(o,r)};vi.utf8border=function(e,t){var n;for(t=t||e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Ua[e[n]]>t?n:t}});var Ku=R((WD,Ig)=>{"use strict";v();function aT(){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}Ig.exports=aT});var Dg=R(Va=>{"use strict";v();var Ga=Fg(),za=jn(),Qu=Zu(),ef=wo(),sT=Ku(),jg=Object.prototype.toString,oT=0,Ju=4,wi=0,Rg=1,Lg=2,lT=-1,cT=0,uT=8;function Dr(e){if(!(this instanceof Dr))return new Dr(e);this.options=za.assign({level:lT,method:uT,chunkSize:16384,windowBits:15,memLevel:8,strategy:cT,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new sT,this.strm.avail_out=0;var n=Ga.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==wi)throw new Error(ef[n]);if(t.header&&Ga.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(typeof t.dictionary=="string"?r=Qu.string2buf(t.dictionary):jg.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Ga.deflateSetDictionary(this.strm,r),n!==wi)throw new Error(ef[n]);this._dict_set=!0}}Dr.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,i,a;if(this.ended)return!1;a=t===~~t?t:t===!0?Ju:oT,typeof e=="string"?n.input=Qu.string2buf(e):jg.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new za.Buf8(r),n.next_out=0,n.avail_out=r),i=Ga.deflate(n,a),i!==Rg&&i!==wi)return this.onEnd(i),this.ended=!0,!1;(n.avail_out===0||n.avail_in===0&&(a===Ju||a===Lg))&&(this.options.to==="string"?this.onData(Qu.buf2binstring(za.shrinkBuf(n.output,n.next_out))):this.onData(za.shrinkBuf(n.output,n.next_out)))}while((n.avail_in>0||n.avail_out===0)&&i!==Rg);return a===Ju?(i=Ga.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===wi):(a===Lg&&(this.onEnd(wi),n.avail_out=0),!0)};Dr.prototype.onData=function(e){this.chunks.push(e)};Dr.prototype.onEnd=function(e){e===wi&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=za.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function tf(e,t){var n=new Dr(t);if(n.push(e,!0),n.err)throw n.msg||ef[n.err];return n.result}function fT(e,t){return t=t||{},t.raw=!0,tf(e,t)}function hT(e,t){return t=t||{},t.gzip=!0,tf(e,t)}Va.Deflate=Dr;Va.deflate=tf;Va.deflateRaw=fT;Va.gzip=hT});var Ng=R((ZD,Bg)=>{"use strict";v();var To=30,dT=12;Bg.exports=function(t,n){var r,i,a,s,o,l,c,u,f,h,d,p,g,m,w,b,S,A,x,k,y,E,_,C,P;r=t.state,i=t.next_in,C=t.input,a=i+(t.avail_in-5),s=t.next_out,P=t.output,o=s-(n-t.avail_out),l=s+(t.avail_out-257),c=r.dmax,u=r.wsize,f=r.whave,h=r.wnext,d=r.window,p=r.hold,g=r.bits,m=r.lencode,w=r.distcode,b=(1<>>24,p>>>=x,g-=x,x=A>>>16&255,x===0)P[s++]=A&65535;else if(x&16){k=A&65535,x&=15,x&&(g>>=x,g-=x),g<15&&(p+=C[i++]<>>24,p>>>=x,g-=x,x=A>>>16&255,x&16){if(y=A&65535,x&=15,gc){t.msg="invalid distance too far back",r.mode=To;break e}if(p>>>=x,g-=x,x=s-o,y>x){if(x=y-x,x>f&&r.sane){t.msg="invalid distance too far back",r.mode=To;break e}if(E=0,_=d,h===0){if(E+=u-x,x2;)P[s++]=_[E++],P[s++]=_[E++],P[s++]=_[E++],k-=3;k&&(P[s++]=_[E++],k>1&&(P[s++]=_[E++]))}else{E=s-y;do P[s++]=P[E++],P[s++]=P[E++],P[s++]=P[E++],k-=3;while(k>2);k&&(P[s++]=P[E++],k>1&&(P[s++]=P[E++]))}}else if(x&64){t.msg="invalid distance code",r.mode=To;break e}else{A=w[(A&65535)+(p&(1<>3,i-=k,g-=k<<3,p&=(1<{"use strict";v();var $g=jn(),bi=15,Hg=852,Ug=592,Gg=0,nf=1,zg=2,pT=[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],mT=[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],gT=[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],yT=[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];Vg.exports=function(t,n,r,i,a,s,o,l){var c=l.bits,u=0,f=0,h=0,d=0,p=0,g=0,m=0,w=0,b=0,S=0,A,x,k,y,E,_=null,C=0,P,L=new $g.Buf16(bi+1),N=new $g.Buf16(bi+1),j=null,Y=0,le,he,ae;for(u=0;u<=bi;u++)L[u]=0;for(f=0;f=1&&L[d]===0;d--);if(p>d&&(p=d),d===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,l.bits=1,0;for(h=1;h0&&(t===Gg||d!==1))return-1;for(N[1]=0,u=1;uHg||t===zg&&b>Ug)return 1;for(;;){le=u-m,o[f]P?(he=j[Y+o[f]],ae=_[C+o[f]]):(he=96,ae=0),A=1<>m)+x]=le<<24|he<<16|ae|0;while(x!==0);for(A=1<>=1;if(A!==0?(S&=A-1,S+=A):S=0,f++,--L[u]===0){if(u===d)break;u=n[r+o[f]]}if(u>p&&(S&y)!==k){for(m===0&&(m=p),E+=h,g=u-m,w=1<Hg||t===zg&&b>Ug)return 1;k=S&y,a[k]=p<<24|g<<16|E-s|0}}return S!==0&&(a[E+S]=u-m<<24|64<<16|0),l.bits=p,0}});var T0=R(un=>{"use strict";v();var Ht=jn(),cf=zu(),An=Vu(),vT=Ng(),Wa=Wg(),wT=0,v0=1,w0=2,qg=4,bT=5,Co=6,Br=0,xT=1,_T=2,Qt=-2,b0=-3,uf=-4,ST=-5,Xg=8,x0=1,Yg=2,Zg=3,Kg=4,Jg=5,Qg=6,e0=7,t0=8,n0=9,r0=10,Mo=11,Nn=12,rf=13,i0=14,af=15,a0=16,s0=17,o0=18,l0=19,Fo=20,Po=21,c0=22,u0=23,f0=24,h0=25,d0=26,sf=27,p0=28,m0=29,Ne=30,ff=31,ET=32,AT=852,kT=592,TT=15,CT=TT;function g0(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function FT(){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 Ht.Buf16(320),this.work=new Ht.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _0(e){var t;return!e||!e.state?Qt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=x0,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Ht.Buf32(AT),t.distcode=t.distdyn=new Ht.Buf32(kT),t.sane=1,t.back=-1,Br)}function S0(e){var t;return!e||!e.state?Qt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,_0(e))}function E0(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Qt:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,S0(e))}function A0(e,t){var n,r;return e?(r=new FT,e.state=r,r.window=null,n=E0(e,t),n!==Br&&(e.state=null),n):Qt}function PT(e){return A0(e,CT)}var y0=!0,of,lf;function MT(e){if(y0){var t;for(of=new Ht.Buf32(512),lf=new Ht.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Wa(v0,e.lens,0,288,of,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Wa(w0,e.lens,0,32,lf,0,e.work,{bits:5}),y0=!1}e.lencode=of,e.lenbits=9,e.distcode=lf,e.distbits=5}function k0(e,t,n,r){var i,a=e.state;return a.window===null&&(a.wsize=1<=a.wsize?(Ht.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>r&&(i=r),Ht.arraySet(a.window,t,n-r,i,a.wnext),r-=i,r?(Ht.arraySet(a.window,t,n-r,r,0),a.wnext=r,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,n.check=An(n.check,_,2,0),c=0,u=0,n.mode=Yg;break}if(n.flags=0,n.head&&(n.head.done=!1),!(n.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=Ne;break}if((c&15)!==Xg){e.msg="unknown compression method",n.mode=Ne;break}if(c>>>=4,u-=4,y=(c&15)+8,n.wbits===0)n.wbits=y;else if(y>n.wbits){e.msg="invalid window size",n.mode=Ne;break}n.dmax=1<>8&1),n.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,n.check=An(n.check,_,2,0)),c=0,u=0,n.mode=Zg;case Zg:for(;u<32;){if(o===0)break e;o--,c+=r[a++]<>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,n.check=An(n.check,_,4,0)),c=0,u=0,n.mode=Kg;case Kg:for(;u<16;){if(o===0)break e;o--,c+=r[a++]<>8),n.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,n.check=An(n.check,_,2,0)),c=0,u=0,n.mode=Jg;case Jg:if(n.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=r[a++]<>>8&255,n.check=An(n.check,_,2,0)),c=0,u=0}else n.head&&(n.head.extra=null);n.mode=Qg;case Qg:if(n.flags&1024&&(d=n.length,d>o&&(d=o),d&&(n.head&&(y=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Ht.arraySet(n.head.extra,r,a,d,y)),n.flags&512&&(n.check=An(n.check,r,d,a)),o-=d,a+=d,n.length-=d),n.length))break e;n.length=0,n.mode=e0;case e0:if(n.flags&2048){if(o===0)break e;d=0;do y=r[a+d++],n.head&&y&&n.length<65536&&(n.head.name+=String.fromCharCode(y));while(y&&d>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Nn;break;case r0:for(;u<32;){if(o===0)break e;o--,c+=r[a++]<>>=u&7,u-=u&7,n.mode=sf;break}for(;u<3;){if(o===0)break e;o--,c+=r[a++]<>>=1,u-=1,c&3){case 0:n.mode=i0;break;case 1:if(MT(n),n.mode=Fo,t===Co){c>>>=2,u-=2;break e}break;case 2:n.mode=s0;break;case 3:e.msg="invalid block type",n.mode=Ne}c>>>=2,u-=2;break;case i0:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=r[a++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=Ne;break}if(n.length=c&65535,c=0,u=0,n.mode=af,t===Co)break e;case af:n.mode=a0;case a0:if(d=n.length,d){if(d>o&&(d=o),d>l&&(d=l),d===0)break e;Ht.arraySet(i,r,a,d,s),o-=d,a+=d,l-=d,s+=d,n.length-=d;break}n.mode=Nn;break;case s0:for(;u<14;){if(o===0)break e;o--,c+=r[a++]<>>=5,u-=5,n.ndist=(c&31)+1,c>>>=5,u-=5,n.ncode=(c&15)+4,c>>>=4,u-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Ne;break}n.have=0,n.mode=o0;case o0:for(;n.have>>=3,u-=3}for(;n.have<19;)n.lens[L[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,C={bits:n.lenbits},E=Wa(wT,n.lens,0,19,n.lencode,0,n.work,C),n.lenbits=C.bits,E){e.msg="invalid code lengths set",n.mode=Ne;break}n.have=0,n.mode=l0;case l0:for(;n.have>>24,b=m>>>16&255,S=m&65535,!(w<=u);){if(o===0)break e;o--,c+=r[a++]<>>=w,u-=w,n.lens[n.have++]=S;else{if(S===16){for(P=w+2;u>>=w,u-=w,n.have===0){e.msg="invalid bit length repeat",n.mode=Ne;break}y=n.lens[n.have-1],d=3+(c&3),c>>>=2,u-=2}else if(S===17){for(P=w+3;u>>=w,u-=w,y=0,d=3+(c&7),c>>>=3,u-=3}else{for(P=w+7;u>>=w,u-=w,y=0,d=11+(c&127),c>>>=7,u-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Ne;break}for(;d--;)n.lens[n.have++]=y}}if(n.mode===Ne)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Ne;break}if(n.lenbits=9,C={bits:n.lenbits},E=Wa(v0,n.lens,0,n.nlen,n.lencode,0,n.work,C),n.lenbits=C.bits,E){e.msg="invalid literal/lengths set",n.mode=Ne;break}if(n.distbits=6,n.distcode=n.distdyn,C={bits:n.distbits},E=Wa(w0,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,C),n.distbits=C.bits,E){e.msg="invalid distances set",n.mode=Ne;break}if(n.mode=Fo,t===Co)break e;case Fo:n.mode=Po;case Po:if(o>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=a,e.avail_in=o,n.hold=c,n.bits=u,vT(e,h),s=e.next_out,i=e.output,l=e.avail_out,a=e.next_in,r=e.input,o=e.avail_in,c=n.hold,u=n.bits,n.mode===Nn&&(n.back=-1);break}for(n.back=0;m=n.lencode[c&(1<>>24,b=m>>>16&255,S=m&65535,!(w<=u);){if(o===0)break e;o--,c+=r[a++]<>A)],w=m>>>24,b=m>>>16&255,S=m&65535,!(A+w<=u);){if(o===0)break e;o--,c+=r[a++]<>>=A,u-=A,n.back+=A}if(c>>>=w,u-=w,n.back+=w,n.length=S,b===0){n.mode=d0;break}if(b&32){n.back=-1,n.mode=Nn;break}if(b&64){e.msg="invalid literal/length code",n.mode=Ne;break}n.extra=b&15,n.mode=c0;case c0:if(n.extra){for(P=n.extra;u>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=u0;case u0:for(;m=n.distcode[c&(1<>>24,b=m>>>16&255,S=m&65535,!(w<=u);){if(o===0)break e;o--,c+=r[a++]<>A)],w=m>>>24,b=m>>>16&255,S=m&65535,!(A+w<=u);){if(o===0)break e;o--,c+=r[a++]<>>=A,u-=A,n.back+=A}if(c>>>=w,u-=w,n.back+=w,b&64){e.msg="invalid distance code",n.mode=Ne;break}n.offset=S,n.extra=b&15,n.mode=f0;case f0:if(n.extra){for(P=n.extra;u>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Ne;break}n.mode=h0;case h0:if(l===0)break e;if(d=h-l,n.offset>d){if(d=n.offset-d,d>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Ne;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),g=n.window}else g=i,p=s-n.offset,d=n.length;d>l&&(d=l),l-=d,n.length-=d;do i[s++]=g[p++];while(--d);n.length===0&&(n.mode=Po);break;case d0:if(l===0)break e;i[s++]=n.length,l--,n.mode=Po;break;case sf:if(n.wrap){for(;u<32;){if(o===0)break e;o--,c|=r[a++]<{"use strict";v();C0.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 P0=R((i7,F0)=>{"use strict";v();function jT(){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}F0.exports=jT});var O0=R(Xa=>{"use strict";v();var xi=T0(),qa=jn(),Oo=Zu(),Je=hf(),df=wo(),DT=Ku(),BT=P0(),M0=Object.prototype.toString;function Nr(e){if(!(this instanceof Nr))return new Nr(e);this.options=qa.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new DT,this.strm.avail_out=0;var n=xi.inflateInit2(this.strm,t.windowBits);if(n!==Je.Z_OK)throw new Error(df[n]);if(this.header=new BT,xi.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Oo.string2buf(t.dictionary):M0.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=xi.inflateSetDictionary(this.strm,t.dictionary),n!==Je.Z_OK)))throw new Error(df[n])}Nr.prototype.push=function(e,t){var n=this.strm,r=this.options.chunkSize,i=this.options.dictionary,a,s,o,l,c,u=!1;if(this.ended)return!1;s=t===~~t?t:t===!0?Je.Z_FINISH:Je.Z_NO_FLUSH,typeof e=="string"?n.input=Oo.binstring2buf(e):M0.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;do{if(n.avail_out===0&&(n.output=new qa.Buf8(r),n.next_out=0,n.avail_out=r),a=xi.inflate(n,Je.Z_NO_FLUSH),a===Je.Z_NEED_DICT&&i&&(a=xi.inflateSetDictionary(this.strm,i)),a===Je.Z_BUF_ERROR&&u===!0&&(a=Je.Z_OK,u=!1),a!==Je.Z_STREAM_END&&a!==Je.Z_OK)return this.onEnd(a),this.ended=!0,!1;n.next_out&&(n.avail_out===0||a===Je.Z_STREAM_END||n.avail_in===0&&(s===Je.Z_FINISH||s===Je.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=Oo.utf8border(n.output,n.next_out),l=n.next_out-o,c=Oo.buf2string(n.output,o),n.next_out=l,n.avail_out=r-l,l&&qa.arraySet(n.output,n.output,o,l,0),this.onData(c)):this.onData(qa.shrinkBuf(n.output,n.next_out))),n.avail_in===0&&n.avail_out===0&&(u=!0)}while((n.avail_in>0||n.avail_out===0)&&a!==Je.Z_STREAM_END);return a===Je.Z_STREAM_END&&(s=Je.Z_FINISH),s===Je.Z_FINISH?(a=xi.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Je.Z_OK):(s===Je.Z_SYNC_FLUSH&&(this.onEnd(Je.Z_OK),n.avail_out=0),!0)};Nr.prototype.onData=function(e){this.chunks.push(e)};Nr.prototype.onEnd=function(e){e===Je.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=qa.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function pf(e,t){var n=new Nr(t);if(n.push(e,!0),n.err)throw n.msg||df[n.err];return n.result}function NT(e,t){return t=t||{},t.raw=!0,pf(e,t)}Xa.Inflate=Nr;Xa.inflate=pf;Xa.inflateRaw=NT;Xa.ungzip=pf});var L0=R((l7,R0)=>{"use strict";v();var $T=jn().assign,HT=Dg(),UT=O0(),GT=hf(),I0={};$T(I0,HT,UT,GT);R0.exports=I0});var B0=R((u7,D0)=>{"use strict";v();var j0=(e,t)=>function(...n){let r=t.promiseModule;return new r((i,a)=>{t.multiArgs?n.push((...s)=>{t.errorFirst?s[0]?a(s):(s.shift(),i(s)):i(s)}):t.errorFirst?n.push((s,o)=>{s?a(s):i(o)}):n.push(i),e.apply(this,n)})};D0.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);let r=a=>{let s=o=>typeof o=="string"?a===o:o.test(a);return t.include?t.include.some(s):!t.exclude.some(s)},i;n==="function"?i=function(...a){return t.excludeMain?e(...a):j0(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(let a in e){let s=e[a];i[a]=typeof s=="function"&&r(a)?j0(s,t):s}return i}});var q0=R((h7,W0)=>{v();function N0(e){return Array.isArray(e)?e:[e]}var yf="",$0=" ",mf="\\",zT=/^\s+$/,VT=/(?:[^\\]|^)\\$/,WT=/^\\!/,qT=/^\\#/,XT=/\r?\n/g,YT=/^\.*\/|^\.+$/,gf="/",G0="node-ignore";typeof Symbol!="undefined"&&(G0=Symbol.for("node-ignore"));var H0=G0,ZT=(e,t,n)=>Object.defineProperty(e,t,{value:n}),KT=/([0-z])-([0-z])/g,z0=()=>!1,JT=e=>e.replace(KT,(t,n,r)=>n.charCodeAt(0)<=r.charCodeAt(0)?t:yf),QT=e=>{let{length:t}=e;return e.slice(0,t-t%2)},e5=[[/^\uFEFF/,()=>yf],[/((?:\\\\)*?)(\\?\s+)$/,(e,t,n)=>t+(n.indexOf("\\")===0?$0:yf)],[/(\\+?)\s/g,(e,t)=>{let{length:n}=t;return t.slice(0,n-n%2)+$0}],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6{let r=n.replace(/\\\*/g,"[^\\/]*");return t+r}],[/\\\\\\(?=[$.|*+(){^])/g,()=>mf],[/\\\\/g,()=>mf],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===mf?`\\[${n}${QT(r)}${i}`:i==="]"&&r.length%2===0?`[${JT(n)}${r}]`:"[]"],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:"[^/]*"}(?=$|\\/$)`]],U0=Object.create(null),t5=(e,t)=>{let n=U0[e];return n||(n=e5.reduce((r,[i,a])=>r.replace(i,a.bind(e)),e),U0[e]=n),t?new RegExp(n,"i"):new RegExp(n)},bf=e=>typeof e=="string",n5=e=>e&&bf(e)&&!zT.test(e)&&!VT.test(e)&&e.indexOf("#")!==0,r5=e=>e.split(XT),vf=class{constructor(t,n,r,i){this.origin=t,this.pattern=n,this.negative=r,this.regex=i}},i5=(e,t)=>{let n=e,r=!1;e.indexOf("!")===0&&(r=!0,e=e.substr(1)),e=e.replace(WT,"!").replace(qT,"#");let i=t5(e,t);return new vf(n,e,r,i)},a5=(e,t)=>{throw new t(e)},$n=(e,t,n)=>bf(e)?e?$n.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n("path must not be empty",TypeError):n(`path must be a string, but got \`${t}\``,TypeError),V0=e=>YT.test(e);$n.isNotRelative=V0;$n.convert=e=>e;var wf=class{constructor({ignorecase:t=!0,ignoreCase:n=t,allowRelativePaths:r=!1}={}){ZT(this,H0,!0),this._rules=[],this._ignoreCase=n,this._allowRelativePaths=r,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(t){if(t&&t[H0]){this._rules=this._rules.concat(t._rules),this._added=!0;return}if(n5(t)){let n=i5(t,this._ignoreCase);this._added=!0,this._rules.push(n)}}add(t){return this._added=!1,N0(bf(t)?r5(t):t).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(t){return this.add(t)}_testOne(t,n){let r=!1,i=!1;return this._rules.forEach(a=>{let{negative:s}=a;if(i===s&&r!==i||s&&!r&&!i&&!n)return;a.regex.test(t)&&(r=!s,i=s)}),{ignored:r,unignored:i}}_test(t,n,r,i){let a=t&&$n.convert(t);return $n(a,t,this._allowRelativePaths?z0:a5),this._t(a,n,r,i)}_t(t,n,r,i){if(t in n)return n[t];if(i||(i=t.split(gf)),i.pop(),!i.length)return n[t]=this._testOne(t,r);let a=this._t(i.join(gf)+gf,n,r,i);return n[t]=a.ignored?a:this._testOne(t,r)}ignores(t){return this._test(t,this._ignoreCache,!1).ignored}createFilter(){return t=>!this.ignores(t)}filter(t){return N0(t).filter(this.createFilter())}test(t){return this._test(t,this._testCache,!0)}},Io=e=>new wf(e),s5=e=>$n(e&&$n.convert(e),e,z0);Io.isPathValid=s5;Io.default=Io;W0.exports=Io;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let e=n=>/^\\\\\?\\/.test(n)||/["<>|\u0000-\u001F]+/u.test(n)?n:n.replace(/\\/g,"/");$n.convert=e;let t=/^[a-z]:\//i;$n.isNotRelative=n=>t.test(n)||V0(n)}});var Y0=R((p7,X0)=>{"use strict";v();function o5(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kn(e,t,n){return t=t instanceof RegExp?t:new RegExp(o5(t),"g"),e.replace(t,n)}var l5={clean:function(t){if(typeof t!="string")throw new Error("Expected a string, received: "+t);return t=kn(t,"./","/"),t=kn(t,"..","."),t=kn(t," ","-"),t=kn(t,/^[~^:?*\\\-]/g,""),t=kn(t,/[~^:?*\\]/g,"-"),t=kn(t,/[~^:?*\\\-]$/g,""),t=kn(t,"@{","-"),t=kn(t,/\.$/g,""),t=kn(t,/\/$/g,""),t=kn(t,/\.lock$/g,""),t}};X0.exports=l5});var K0=R((g7,Z0)=>{v();Z0.exports=function(e,t){var n=e,r=t,i=n.length,a=r.length,s=!1,o=null,l=i+1,c=[],u=[],f=[],h="",d=-1,p=0,g=1,m,w,b=function(){i>=a&&(m=n,w=i,n=r,r=m,i=a,a=w,s=!0,l=i+1)},S=function(y,E,_){return{x:y,y:E,k:_}},A=function(y,E){return{elem:y,t:E}},x=function(y,E,_){var C,P,L;for(E>_?C=c[y-1+l]:C=c[y+1+l],L=Math.max(E,_),P=L-y;P=0;--L)for(;CP-C?(s?f[f.length]=new A(r[P],d):f[f.length]=new A(r[P],g),++_,++P):y[L].y-y[L].x=y+1;--j)_[j+l]=x(j,_[j-1+l]+1,_[j+1+l]);_[y+l]=x(y,_[y-1+l]+1,_[y+1+l])}while(_[y+l]!==a);for(o=y+2*C,P=c[y+l],L=[];P!==-1;)L[L.length]=new S(u[P].x,u[P].y,null),P=u[P].k;k(L)}}}});var e1=R((v7,Q0)=>{v();var c5=K0();function u5(e,t){var n=new c5(e,t);n.compose();for(var r=n.getses(),i,a,s=e.length-1,o=t.length-1,l=r.length-1;l>=0;--l)r[l].t===n.SES_COMMON?(a?(a.chain={file1index:s,file2index:o,chain:null},a=a.chain):(i={file1index:s,file2index:o,chain:null},a=i),s--,o--):r[l].t===n.SES_DELETE?s--:r[l].t===n.SES_ADD&&o--;var c={file1index:-1,file2index:-1,chain:null};return a?(a.chain=c,i):c}function J0(e,t){for(var n=[],r=e.length,i=t.length,a=u5(e,t);a!==null;a=a.chain){var s=r-a.file1index-1,o=i-a.file2index-1;r=a.file1index,i=a.file2index,(s||o)&&n.push({file1:[r+1,s],file2:[i+1,o]})}return n.reverse(),n}function f5(e,t,n){var r,i=J0(t,e),a=J0(t,n),s=[];function o(N,j){s.push([N.file1[0],j,N.file1[1],N.file2[0],N.file2[1]])}for(r=0;rc&&(l.push([1,c,N-c]),c=N)}for(var f=0;fg)break;g=Math.max(g,w+m[2]),f++}if(u(p),h==f)d[4]>0&&l.push([d[1],d[3],d[4]]);else{var b={0:[e.length,-1,t.length,-1],2:[n.length,-1,t.length,-1]};for(r=h;r<=f;r++){d=s[r];var S=d[1],A=b[S],x=d[0],k=x+d[2],y=d[3],E=y+d[4];A[0]=Math.min(y,A[0]),A[1]=Math.max(E,A[1]),A[2]=Math.min(x,A[2]),A[3]=Math.max(k,A[3])}var _=b[0][0]+(p-b[0][2]),C=b[0][1]+(g-b[0][3]),P=b[2][0]+(p-b[2][2]),L=b[2][1]+(g-b[2][3]);l.push([-1,_,C-_,p,g-p,P,L-P])}c=g}return u(t.length),l}function h5(e,t,n){var r=[],i=[e,t,n],a=f5(e,t,n),s=[];function o(){s.length&&r.push({ok:s}),s=[]}function l(d){for(var p=0;p{v();var Ni=1e3,$i=Ni*60,Hi=$i*60,Wr=Hi*24,m6=Wr*7,g6=Wr*365.25;ry.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return y6(e);if(n==="number"&&isFinite(e))return t.long?w6(e):v6(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function y6(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*g6;case"weeks":case"week":case"w":return n*m6;case"days":case"day":case"d":return n*Wr;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Hi;case"minutes":case"minute":case"mins":case"min":case"m":return n*$i;case"seconds":case"second":case"secs":case"sec":case"s":return n*Ni;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function v6(e){var t=Math.abs(e);return t>=Wr?Math.round(e/Wr)+"d":t>=Hi?Math.round(e/Hi)+"h":t>=$i?Math.round(e/$i)+"m":t>=Ni?Math.round(e/Ni)+"s":e+"ms"}function w6(e){var t=Math.abs(e);return t>=Wr?el(e,t,Wr,"day"):t>=Hi?el(e,t,Hi,"hour"):t>=$i?el(e,t,$i,"minute"):t>=Ni?el(e,t,Ni,"second"):e+" ms"}function el(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}});var sy=R((T7,ay)=>{v();function b6(e){n.debug=n,n.default=n,n.coerce=l,n.disable=a,n.enable=i,n.enabled=s,n.humanize=iy(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let f=0;for(let h=0;h{if(k==="%%")return"%";A++;let E=n.formatters[y];if(typeof E=="function"){let _=m[A];k=E.call(w,_),m.splice(A,1),A--}return k}),n.formatArgs.call(w,m),(w.log||n.log).apply(w,m)}return g.namespace=u,g.useColors=n.useColors(),g.color=n.selectColor(u),g.extend=r,g.destroy=n.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(d!==n.namespaces&&(d=n.namespaces,p=n.enabled(u)),p),set:m=>{h=m}}),typeof n.init=="function"&&n.init(g),g}function r(u,f){let h=n(this.namespace+(typeof f=="undefined"?":":f)+u);return h.log=this.log,h}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let f,h=(typeof u=="string"?u:"").split(/[\s,]+/),d=h.length;for(f=0;f"-"+f)].join(",");return n.enable(""),u}function s(u){if(u[u.length-1]==="*")return!0;let f,h;for(f=0,h=n.skips.length;f{v();zt.formatArgs=_6;zt.save=S6;zt.load=E6;zt.useColors=x6;zt.storage=A6();zt.destroy=(()=>{let e=!1;return()=>{e||(e=!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`."))}})();zt.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 x6(){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 e;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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function _6(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+tl.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(n++,i==="%c"&&(r=n))}),e.splice(r,0,t)}zt.log=console.debug||console.log||(()=>{});function S6(e){try{e?zt.storage.setItem("debug",e):zt.storage.removeItem("debug")}catch(t){}}function E6(){let e;try{e=zt.storage.getItem("debug")}catch(t){}return!e&&typeof process!="undefined"&&"env"in process&&(e=process.env.DEBUG),e}function A6(){try{return localStorage}catch(e){}}tl.exports=sy()(zt);var{formatters:k6}=tl.exports;k6.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var oy=R(Vt=>{"use strict";v();var T6=Vt&&Vt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vt,"__esModule",{value:!0});var C6=require("fs"),F6=T6(nl()),Ui=F6.default("@kwsites/file-exists");function P6(e,t,n){Ui("checking %s",e);try{let r=C6.statSync(e);return r.isFile()&&t?(Ui("[OK] path represents a file"),!0):r.isDirectory()&&n?(Ui("[OK] path represents a directory"),!0):(Ui("[FAIL] path represents something other than a file or directory"),!1)}catch(r){if(r.code==="ENOENT")return Ui("[FAIL] path is not accessible: %o",r),!1;throw Ui("[FATAL] %o",r),r}}function M6(e,t=Vt.READABLE){return P6(e,(t&Vt.FILE)>0,(t&Vt.FOLDER)>0)}Vt.exists=M6;Vt.FILE=1;Vt.FOLDER=2;Vt.READABLE=Vt.FILE+Vt.FOLDER});var ly=R(rl=>{"use strict";v();function O6(e){for(var t in e)rl.hasOwnProperty(t)||(rl[t]=e[t])}Object.defineProperty(rl,"__esModule",{value:!0});O6(oy())});var Zf=R(qr=>{"use strict";v();Object.defineProperty(qr,"__esModule",{value:!0});qr.createDeferred=qr.deferred=void 0;function Yf(){let e,t,n="pending";return{promise:new Promise((i,a)=>{e=i,t=a}),done(i){n==="pending"&&(n="resolved",e(i))},fail(i){n==="pending"&&(n="rejected",t(i))},get fulfilled(){return n!=="pending"},get status(){return n}}}qr.deferred=Yf;qr.createDeferred=Yf;qr.default=Yf});var Zw=R((w9,Yw)=>{"use strict";v();Yw.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 Jw=R((x9,Kw)=>{v();var Uh={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}};Kw.exports=function(e,t,n,r){if(!Uh.hasOwnProperty(n))throw new Error("Cannot convert to "+n);if(!Uh[n].hasOwnProperty(t))throw new Error("Cannot convert from "+t+" to "+n);var i=Uh[n][t]*e;return r!==!1?(r=Math.pow(10,parseInt(r)||5),Math.round(i*r)/r):i}});var h2=R(Vn=>{"use strict";v();Object.defineProperty(Vn,"__esModule",{value:!0});Vn.fromRgba=Yi;Vn.fromRgb=Gh;Vn.fromHsla=Cl;Vn.fromHsl=u2;Vn.fromString=f2;Vn.default=void 0;var Qw=n2(Zw()),zP=n2(Jw());function n2(e){return e&&e.__esModule?e:{default:e}}function VP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e2(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1}function KP(e,t,n){var r=e/255,i=t/255,a=n/255,s=Math.max(r,i,a),o=Math.min(r,i,a),l=s-o,c=(s+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=function(){switch(s){case r:return(i-a)/l%6;case i:return(a-r)/l+2;default:return(r-i)/l+4}}();return[f*60,u*100,c*100]}function JP(e,t,n){var r=e/60,i=t/100,a=n/100,s=(1-Math.abs(2*a-1))*i,o=s*(1-Math.abs(r%2-1)),l=a-s/2,c=function(){return r<1?[s,o,0]:r<2?[o,s,0]:r<3?[0,s,o]:r<4?[0,o,s]:r<5?[o,0,s]:[s,0,o]}(),u=Ft(c,3),f=u[0],h=u[1],d=u[2];return[(f+l)*255,(h+l)*255,(d+l)*255]}var QP=function(){function e(t){var n=Ft(t,4),r=n[0],i=n[1],a=n[2],s=n[3];VP(this,e),this.values=[Math.max(Math.min(parseInt(r,10),255),0),Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(a,10),255),0),s==null?1:Math.max(Math.min(parseFloat(s),255),0)]}return WP(e,[{key:"toRgbString",value:function(){var n=Ft(this.values,4),r=n[0],i=n[1],a=n[2],s=n[3];return s===1?"rgb(".concat(r,", ").concat(i,", ").concat(a,")"):"rgba(".concat(r,", ").concat(i,", ").concat(a,", ").concat(s,")")}},{key:"toHslString",value:function(){var n=this.toHslaArray(),r=Ft(n,4),i=r[0],a=r[1],s=r[2],o=r[3];return o===1?"hsl(".concat(i,", ").concat(a,"%, ").concat(s,"%)"):"hsla(".concat(i,", ").concat(a,"%, ").concat(s,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var n=Ft(this.values,4),r=n[0],i=n[1],a=n[2],s=n[3];return r=Number(r).toString(16).padStart(2,"0"),i=Number(i).toString(16).padStart(2,"0"),a=Number(a).toString(16).padStart(2,"0"),s=s<1?parseInt(s*255,10).toString(16).padStart(2,"0"):"","#".concat(r).concat(i).concat(a).concat(s)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var n=Ft(this.values,4),r=n[0],i=n[1],a=n[2],s=n[3],o=KP(r,i,a),l=Ft(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,s]}}]),e}();function Yi(e){var t=Ft(e,4),n=t[0],r=t[1],i=t[2],a=t[3];return new QP([n,r,i,a])}function Gh(e){var t=Ft(e,3),n=t[0],r=t[1],i=t[2];return Yi([n,r,i,1])}function Cl(e){var t=Ft(e,4),n=t[0],r=t[1],i=t[2],a=t[3],s=JP(n,r,i),o=Ft(s,3),l=o[0],c=o[1],u=o[2];return Yi([l,c,u,a])}function u2(e){var t=Ft(e,3),n=t[0],r=t[1],i=t[2];return Cl([n,r,i,1])}function eM(e){var t=r2.exec(e)||i2.exec(e),n=Ft(t,5),r=n[1],i=n[2],a=n[3],s=n[4];return r=parseInt(r.length<2?r.repeat(2):r,16),i=parseInt(i.length<2?i.repeat(2):i,16),a=parseInt(a.length<2?a.repeat(2):a,16),s=s&&(parseInt(s.length<2?s.repeat(2):s,16)/255).toPrecision(1)||1,Yi([r,i,a,s])}function tM(e){var t=a2.exec(e)||o2.exec(e)||s2.exec(e)||l2.exec(e),n=Ft(t,5),r=n[1],i=n[2],a=n[3],s=n[4];return r=Ps(r,"%")?parseInt(r,10)*255/100:parseInt(r,10),i=Ps(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),a=Ps(a,"%")>0?parseInt(a,10)*255/100:parseInt(a,10),s=s===void 0?1:parseFloat(s)/(Ps(s,"%")?100:1),Yi([r,i,a,s])}function nM(e){var t=c2.exec(e),n=Ft(t,6),r=n[1],i=n[2],a=n[3],s=n[4],o=n[5];return i=i||"deg",r=(0,zP.default)(parseFloat(r),i,"deg"),a=parseFloat(a),s=parseFloat(s),o=o===void 0?1:parseFloat(o)/(Ps(o,"%")?100:1),Cl([r,a,s,o])}function f2(e){return Qw.default[e]?Gh(Qw.default[e]):r2.test(e)||i2.test(e)?eM(e):a2.test(e)||o2.test(e)||s2.test(e)||l2.test(e)?tM(e):c2.test(e)?nM(e):null}var rM={fromString:f2,fromRgb:Gh,fromRgba:Yi,fromHsl:u2,fromHsla:Cl};Vn.default=rM});var zh=R((A9,p2)=>{"use strict";v();var d2=Object.prototype.toString;p2.exports=function(t){var n=d2.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&d2.call(t.callee)==="[object Function]"),r}});var S2=R((T9,_2)=>{"use strict";v();var x2;Object.keys||(Ms=Object.prototype.hasOwnProperty,Vh=Object.prototype.toString,m2=zh(),Wh=Object.prototype.propertyIsEnumerable,g2=!Wh.call({toString:null},"toString"),y2=Wh.call(function(){},"prototype"),Os=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Fl=function(e){var t=e.constructor;return t&&t.prototype===e},v2={$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},w2=function(){if(typeof window=="undefined")return!1;for(var e in window)try{if(!v2["$"+e]&&Ms.call(window,e)&&window[e]!==null&&typeof window[e]=="object")try{Fl(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),b2=function(e){if(typeof window=="undefined"||!w2)return Fl(e);try{return Fl(e)}catch(t){return!1}},x2=function(t){var n=t!==null&&typeof t=="object",r=Vh.call(t)==="[object Function]",i=m2(t),a=n&&Vh.call(t)==="[object String]",s=[];if(!n&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var o=y2&&r;if(a&&t.length>0&&!Ms.call(t,0))for(var l=0;l0)for(var c=0;c{"use strict";v();var iM=Array.prototype.slice,aM=zh(),E2=Object.keys,Pl=E2?function(t){return E2(t)}:S2(),A2=Object.keys;Pl.shim=function(){if(Object.keys){var t=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);t||(Object.keys=function(r){return aM(r)?A2(iM.call(r)):A2(r)})}else Object.keys=Pl;return Object.keys||Pl};k2.exports=Pl});var C2=R((M9,T2)=>{"use strict";v();T2.exports=Error});var P2=R((I9,F2)=>{"use strict";v();F2.exports=EvalError});var O2=R((L9,M2)=>{"use strict";v();M2.exports=RangeError});var R2=R((D9,I2)=>{"use strict";v();I2.exports=ReferenceError});var qh=R((N9,L2)=>{"use strict";v();L2.exports=SyntaxError});var Wn=R((H9,j2)=>{"use strict";v();j2.exports=TypeError});var B2=R((G9,D2)=>{"use strict";v();D2.exports=URIError});var Is=R((V9,N2)=>{"use strict";v();N2.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,n);if(s.value!==i||s.enumerable!==!0)return!1}return!0}});var Ol=R((q9,H2)=>{"use strict";v();var $2=typeof Symbol!="undefined"&&Symbol,sM=Is();H2.exports=function(){return typeof $2!="function"||typeof Symbol!="function"||typeof $2("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sM()}});var G2=R((Y9,U2)=>{"use strict";v();var Xh={__proto__:null,foo:{}},oM=Object;U2.exports=function(){return{__proto__:Xh}.foo===Xh.foo&&!(Xh instanceof oM)}});var W2=R((K9,V2)=>{"use strict";v();var lM="Function.prototype.bind called on incompatible ",cM=Object.prototype.toString,uM=Math.max,fM="[object Function]",z2=function(t,n){for(var r=[],i=0;i{"use strict";v();var pM=W2();q2.exports=Function.prototype.bind||pM});var Yh=R((tB,X2)=>{"use strict";v();var mM=Function.prototype.call,gM=Object.prototype.hasOwnProperty,yM=Il();X2.exports=yM.call(mM,gM)});var pn=R((rB,Q2)=>{"use strict";v();var pe,vM=C2(),wM=P2(),bM=O2(),xM=R2(),Qi=qh(),Ji=Wn(),_M=B2(),J2=Function,Zh=function(e){try{return J2('"use strict"; return ('+e+").constructor;")()}catch(t){}},Kr=Object.getOwnPropertyDescriptor;if(Kr)try{Kr({},"")}catch(e){Kr=null}var Kh=function(){throw new Ji},SM=Kr?function(){try{return arguments.callee,Kh}catch(e){try{return Kr(arguments,"callee").get}catch(t){return Kh}}}():Kh,Zi=Ol()(),EM=G2()(),ht=Object.getPrototypeOf||(EM?function(e){return e.__proto__}:null),Ki={},AM=typeof Uint8Array=="undefined"||!ht?pe:ht(Uint8Array),Jr={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":Zi&&ht?ht([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":Ki,"%AsyncGenerator%":Ki,"%AsyncGeneratorFunction%":Ki,"%AsyncIteratorPrototype%":Ki,"%Atomics%":typeof Atomics=="undefined"?pe:Atomics,"%BigInt%":typeof BigInt=="undefined"?pe:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?pe:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?pe:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vM,"%eval%":eval,"%EvalError%":wM,"%Float32Array%":typeof Float32Array=="undefined"?pe:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?pe:FinalizationRegistry,"%Function%":J2,"%GeneratorFunction%":Ki,"%Int8Array%":typeof Int8Array=="undefined"?pe:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?pe:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Zi&&ht?ht(ht([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map=="undefined"?pe:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Zi||!ht?pe:ht(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?pe:Promise,"%Proxy%":typeof Proxy=="undefined"?pe:Proxy,"%RangeError%":bM,"%ReferenceError%":xM,"%Reflect%":typeof Reflect=="undefined"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?pe:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Zi||!ht?pe:ht(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Zi&&ht?ht(""[Symbol.iterator]()):pe,"%Symbol%":Zi?Symbol:pe,"%SyntaxError%":Qi,"%ThrowTypeError%":SM,"%TypedArray%":AM,"%TypeError%":Ji,"%Uint8Array%":typeof Uint8Array=="undefined"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?pe:Uint32Array,"%URIError%":_M,"%WeakMap%":typeof WeakMap=="undefined"?pe:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?pe:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?pe:WeakSet};if(ht)try{null.error}catch(e){Y2=ht(ht(e)),Jr["%Error.prototype%"]=Y2}var Y2,kM=function e(t){var n;if(t==="%AsyncFunction%")n=Zh("async function () {}");else if(t==="%GeneratorFunction%")n=Zh("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=Zh("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ht&&(n=ht(i.prototype))}return Jr[t]=n,n},Z2={__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"]},Rs=Il(),Rl=Yh(),TM=Rs.call(Function.call,Array.prototype.concat),CM=Rs.call(Function.apply,Array.prototype.splice),K2=Rs.call(Function.call,String.prototype.replace),Ll=Rs.call(Function.call,String.prototype.slice),FM=Rs.call(Function.call,RegExp.prototype.exec),PM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,MM=/\\(\\)?/g,OM=function(t){var n=Ll(t,0,1),r=Ll(t,-1);if(n==="%"&&r!=="%")throw new Qi("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Qi("invalid intrinsic syntax, expected opening `%`");var i=[];return K2(t,PM,function(a,s,o,l){i[i.length]=o?K2(l,MM,"$1"):s||a}),i},IM=function(t,n){var r=t,i;if(Rl(Z2,r)&&(i=Z2[r],r="%"+i[0]+"%"),Rl(Jr,r)){var a=Jr[r];if(a===Ki&&(a=kM(r)),typeof a=="undefined"&&!n)throw new Ji("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:a}}throw new Qi("intrinsic "+t+" does not exist!")};Q2.exports=function(t,n){if(typeof t!="string"||t.length===0)throw new Ji("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Ji('"allowMissing" argument must be a boolean');if(FM(/^%?[^%]*%?$/,t)===null)throw new Qi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=OM(t),i=r.length>0?r[0]:"",a=IM("%"+i+"%",n),s=a.name,o=a.value,l=!1,c=a.alias;c&&(i=c[0],CM(r,TM([0,1],c)));for(var u=1,f=!0;u=r.length){var g=Kr(o,h);f=!!g,f&&"get"in g&&!("originalValue"in g.get)?o=g.get:o=o[h]}else f=Rl(o,h),o=o[h];f&&!l&&(Jr[s]=o)}}return o}});var Dl=R((aB,eb)=>{"use strict";v();var RM=pn(),jl=RM("%Object.defineProperty%",!0)||!1;if(jl)try{jl({},"a",{value:1})}catch(e){jl=!1}eb.exports=jl});var Nl=R((oB,tb)=>{"use strict";v();var LM=pn(),Bl=LM("%Object.getOwnPropertyDescriptor%",!0);if(Bl)try{Bl([],"length")}catch(e){Bl=null}tb.exports=Bl});var $l=R((cB,ib)=>{"use strict";v();var nb=Dl(),jM=qh(),ea=Wn(),rb=Nl();ib.exports=function(t,n,r){if(!t||typeof t!="object"&&typeof t!="function")throw new ea("`obj` must be an object or a function`");if(typeof n!="string"&&typeof n!="symbol")throw new ea("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ea("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ea("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ea("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ea("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,l=!!rb&&rb(t,n);if(nb)nb(t,n,{configurable:s===null&&l?l.configurable:!s,enumerable:i===null&&l?l.enumerable:!i,value:r,writable:a===null&&l?l.writable:!a});else if(o||!i&&!a&&!s)t[n]=r;else throw new jM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Hl=R((fB,sb)=>{"use strict";v();var Jh=Dl(),ab=function(){return!!Jh};ab.hasArrayLengthDefineBug=function(){if(!Jh)return null;try{return Jh([],"length",{value:1}).length!==1}catch(t){return!0}};sb.exports=ab});var pr=R((dB,ub)=>{"use strict";v();var DM=Ml(),BM=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",NM=Object.prototype.toString,$M=Array.prototype.concat,ob=$l(),HM=function(e){return typeof e=="function"&&NM.call(e)==="[object Function]"},lb=Hl()(),UM=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!HM(r)||!r())return}lb?ob(e,t,n,!0):ob(e,t,n)},cb=function(e,t){var n=arguments.length>2?arguments[2]:{},r=DM(t);BM&&(r=$M.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i{"use strict";v();var GM=pn(),fb=$l(),zM=Hl()(),hb=Nl(),db=Wn(),VM=GM("%Math.floor%");pb.exports=function(t,n){if(typeof t!="function")throw new db("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||VM(n)!==n)throw new db("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,a=!0;if("length"in t&&hb){var s=hb(t,"length");s&&!s.configurable&&(i=!1),s&&!s.writable&&(a=!1)}return(i||a||!r)&&(zM?fb(t,"length",n,!0,!0):fb(t,"length",n)),t}});var Qr=R((yB,Ul)=>{"use strict";v();var Qh=Il(),Gl=pn(),WM=mb(),qM=Wn(),vb=Gl("%Function.prototype.apply%"),wb=Gl("%Function.prototype.call%"),bb=Gl("%Reflect.apply%",!0)||Qh.call(wb,vb),gb=Dl(),XM=Gl("%Math.max%");Ul.exports=function(t){if(typeof t!="function")throw new qM("a function is required");var n=bb(Qh,wb,arguments);return WM(n,1+XM(0,t.length-(arguments.length-1)),!0)};var yb=function(){return bb(Qh,vb,arguments)};gb?gb(Ul.exports,"apply",{value:yb}):Ul.exports.apply=yb});var qt=R((wB,Sb)=>{"use strict";v();var xb=pn(),_b=Qr(),YM=_b(xb("String.prototype.indexOf"));Sb.exports=function(t,n){var r=xb(t,!!n);return typeof r=="function"&&YM(t,".prototype.")>-1?_b(r):r}});var ed=R((xB,Cb)=>{"use strict";v();var ZM=Ml(),kb=Is()(),Tb=qt(),Eb=Object,KM=Tb("Array.prototype.push"),Ab=Tb("Object.prototype.propertyIsEnumerable"),JM=kb?Object.getOwnPropertySymbols:null;Cb.exports=function(t,n){if(t==null)throw new TypeError("target must be an object");var r=Eb(t);if(arguments.length===1)return r;for(var i=1;i{"use strict";v();var td=ed(),QM=function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),n={},r=0;r{"use strict";v();var tO=pr(),nO=nd();Pb.exports=function(){var t=nO();return tO(Object,{assign:t},{assign:function(){return Object.assign!==t}}),t}});var Lb=R((TB,Rb)=>{"use strict";v();var rO=pr(),iO=Qr(),aO=ed(),Ob=nd(),sO=Mb(),oO=iO.apply(Ob()),Ib=function(t,n){return oO(Object,arguments)};rO(Ib,{getPolyfill:Ob,implementation:aO,shim:sO});Rb.exports=Ib});var Db=R((FB,jb)=>{"use strict";v();var js=function(){return typeof function(){}.name=="string"},Ls=Object.getOwnPropertyDescriptor;if(Ls)try{Ls([],"length")}catch(e){Ls=null}js.functionsHaveConfigurableNames=function(){if(!js()||!Ls)return!1;var t=Ls(function(){},"name");return!!t&&!!t.configurable};var lO=Function.prototype.bind;js.boundFunctionsHaveNames=function(){return js()&&typeof lO=="function"&&function(){}.bind().name!==""};jb.exports=js});var $b=R((MB,Nb)=>{"use strict";v();var Bb=$l(),cO=Hl()(),uO=Db().functionsHaveConfigurableNames(),fO=Wn();Nb.exports=function(t,n){if(typeof t!="function")throw new fO("`fn` is not a function");var r=arguments.length>2&&!!arguments[2];return(!r||uO)&&(cO?Bb(t,"name",n,!0,!0):Bb(t,"name",n)),t}});var rd=R((IB,Hb)=>{"use strict";v();var hO=$b(),dO=Wn(),pO=Object;Hb.exports=hO(function(){if(this==null||this!==pO(this))throw new dO("RegExp.prototype.flags getter called on non-object");var t="";return this.hasIndices&&(t+="d"),this.global&&(t+="g"),this.ignoreCase&&(t+="i"),this.multiline&&(t+="m"),this.dotAll&&(t+="s"),this.unicode&&(t+="u"),this.unicodeSets&&(t+="v"),this.sticky&&(t+="y"),t},"get flags",!0)});var id=R((LB,Ub)=>{"use strict";v();var mO=rd(),gO=pr().supportsDescriptors,yO=Object.getOwnPropertyDescriptor;Ub.exports=function(){if(gO&&/a/mig.flags==="gim"){var t=yO(RegExp.prototype,"flags");if(t&&typeof t.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var n="",r={};if(Object.defineProperty(r,"hasIndices",{get:function(){n+="d"}}),Object.defineProperty(r,"sticky",{get:function(){n+="y"}}),t.get.call(r),n==="dy")return t.get}}return mO}});var Vb=R((DB,zb)=>{"use strict";v();var vO=pr().supportsDescriptors,wO=id(),bO=Object.getOwnPropertyDescriptor,xO=Object.defineProperty,_O=TypeError,Gb=Object.getPrototypeOf,SO=/a/;zb.exports=function(){if(!vO||!Gb)throw new _O("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var t=wO(),n=Gb(SO),r=bO(n,"flags");return(!r||r.get!==t)&&xO(n,"flags",{configurable:!0,enumerable:!1,get:t}),t}});var Yb=R((NB,Xb)=>{"use strict";v();var EO=pr(),AO=Qr(),kO=rd(),Wb=id(),TO=Vb(),qb=AO(Wb());EO(qb,{getPolyfill:Wb,implementation:kO,shim:TO});Xb.exports=qb});var mr=R((HB,Zb)=>{"use strict";v();var CO=Is();Zb.exports=function(){return CO()&&!!Symbol.toStringTag}});var sd=R((GB,Jb)=>{"use strict";v();var FO=mr()(),PO=qt(),ad=PO("Object.prototype.toString"),zl=function(t){return FO&&t&&typeof t=="object"&&Symbol.toStringTag in t?!1:ad(t)==="[object Arguments]"},Kb=function(t){return zl(t)?!0:t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&ad(t)!=="[object Array]"&&ad(t.callee)==="[object Function]"},MO=function(){return zl(arguments)}();zl.isLegacyArguments=Kb;Jb.exports=MO?zl:Kb});var Qb=R(()=>{v()});var wx=R((XB,vx)=>{v();var gd=typeof Map=="function"&&Map.prototype,od=Object.getOwnPropertyDescriptor&&gd?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Wl=gd&&od&&typeof od.get=="function"?od.get:null,ex=gd&&Map.prototype.forEach,yd=typeof Set=="function"&&Set.prototype,ld=Object.getOwnPropertyDescriptor&&yd?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ql=yd&&ld&&typeof ld.get=="function"?ld.get:null,tx=yd&&Set.prototype.forEach,OO=typeof WeakMap=="function"&&WeakMap.prototype,Bs=OO?WeakMap.prototype.has:null,IO=typeof WeakSet=="function"&&WeakSet.prototype,Ns=IO?WeakSet.prototype.has:null,RO=typeof WeakRef=="function"&&WeakRef.prototype,nx=RO?WeakRef.prototype.deref:null,LO=Boolean.prototype.valueOf,jO=Object.prototype.toString,DO=Function.prototype.toString,BO=String.prototype.match,vd=String.prototype.slice,yr=String.prototype.replace,NO=String.prototype.toUpperCase,rx=String.prototype.toLowerCase,hx=RegExp.prototype.test,ix=Array.prototype.concat,Mn=Array.prototype.join,$O=Array.prototype.slice,ax=Math.floor,fd=typeof BigInt=="function"?BigInt.prototype.valueOf:null,cd=Object.getOwnPropertySymbols,hd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ta=typeof Symbol=="function"&&typeof Symbol.iterator=="object",vt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ta||!0)?Symbol.toStringTag:null,dx=Object.prototype.propertyIsEnumerable,sx=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function ox(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||hx.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-ax(-e):ax(e);if(r!==e){var i=String(r),a=vd.call(t,i.length+1);return yr.call(i,n,"$&_")+"."+yr.call(yr.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(t,n,"$&_")}var dd=Qb(),lx=dd.custom,cx=mx(lx)?lx:null;vx.exports=function e(t,n,r,i){var a=n||{};if(gr(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(gr(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=gr(a,"customInspect")?a.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(gr(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(gr(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=a.numericSeparator;if(typeof t=="undefined")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return yx(t,a);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var l=String(t);return o?ox(t,l):l}if(typeof t=="bigint"){var c=String(t)+"n";return o?ox(t,c):c}var u=typeof a.depth=="undefined"?5:a.depth;if(typeof r=="undefined"&&(r=0),r>=u&&u>0&&typeof t=="object")return pd(t)?"[Array]":"[Object]";var f=iI(a,r);if(typeof i=="undefined")i=[];else if(gx(i,t)>=0)return"[Circular]";function h(N,j,Y){if(j&&(i=$O.call(i),i.push(j)),Y){var le={depth:a.depth};return gr(a,"quoteStyle")&&(le.quoteStyle=a.quoteStyle),e(N,le,r+1,i)}return e(N,a,r+1,i)}if(typeof t=="function"&&!ux(t)){var d=YO(t),p=Vl(t,h);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+Mn.call(p,", ")+" }":"")}if(mx(t)){var g=ta?yr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):hd.call(t);return typeof t=="object"&&!ta?Ds(g):g}if(tI(t)){for(var m="<"+rx.call(String(t.nodeName)),w=t.attributes||[],b=0;b",m}if(pd(t)){if(t.length===0)return"[]";var S=Vl(t,h);return f&&!rI(S)?"["+md(S,f)+"]":"[ "+Mn.call(S,", ")+" ]"}if(GO(t)){var A=Vl(t,h);return!("cause"in Error.prototype)&&"cause"in t&&!dx.call(t,"cause")?"{ ["+String(t)+"] "+Mn.call(ix.call("[cause]: "+h(t.cause),A),", ")+" }":A.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Mn.call(A,", ")+" }"}if(typeof t=="object"&&s){if(cx&&typeof t[cx]=="function"&&dd)return dd(t,{depth:u-r});if(s!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(ZO(t)){var x=[];return ex&&ex.call(t,function(N,j){x.push(h(j,t,!0)+" => "+h(N,t))}),fx("Map",Wl.call(t),x,f)}if(QO(t)){var k=[];return tx&&tx.call(t,function(N){k.push(h(N,t))}),fx("Set",ql.call(t),k,f)}if(KO(t))return ud("WeakMap");if(eI(t))return ud("WeakSet");if(JO(t))return ud("WeakRef");if(VO(t))return Ds(h(Number(t)));if(qO(t))return Ds(h(fd.call(t)));if(WO(t))return Ds(LO.call(t));if(zO(t))return Ds(h(String(t)));if(typeof window!="undefined"&&t===window)return"{ [object Window] }";if(typeof globalThis!="undefined"&&t===globalThis||typeof global!="undefined"&&t===global)return"{ [object globalThis] }";if(!UO(t)&&!ux(t)){var y=Vl(t,h),E=sx?sx(t)===Object.prototype:t instanceof Object||t.constructor===Object,_=t instanceof Object?"":"null prototype",C=!E&&vt&&Object(t)===t&&vt in t?vd.call(vr(t),8,-1):_?"Object":"",P=E||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",L=P+(C||_?"["+Mn.call(ix.call([],C||[],_||[]),": ")+"] ":"");return y.length===0?L+"{}":f?L+"{"+md(y,f)+"}":L+"{ "+Mn.call(y,", ")+" }"}return String(t)};function px(e,t,n){var r=(n.quoteStyle||t)==="double"?'"':"'";return r+e+r}function HO(e){return yr.call(String(e),/"/g,""")}function pd(e){return vr(e)==="[object Array]"&&(!vt||!(typeof e=="object"&&vt in e))}function UO(e){return vr(e)==="[object Date]"&&(!vt||!(typeof e=="object"&&vt in e))}function ux(e){return vr(e)==="[object RegExp]"&&(!vt||!(typeof e=="object"&&vt in e))}function GO(e){return vr(e)==="[object Error]"&&(!vt||!(typeof e=="object"&&vt in e))}function zO(e){return vr(e)==="[object String]"&&(!vt||!(typeof e=="object"&&vt in e))}function VO(e){return vr(e)==="[object Number]"&&(!vt||!(typeof e=="object"&&vt in e))}function WO(e){return vr(e)==="[object Boolean]"&&(!vt||!(typeof e=="object"&&vt in e))}function mx(e){if(ta)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!hd)return!1;try{return hd.call(e),!0}catch(t){}return!1}function qO(e){if(!e||typeof e!="object"||!fd)return!1;try{return fd.call(e),!0}catch(t){}return!1}var XO=Object.prototype.hasOwnProperty||function(e){return e in this};function gr(e,t){return XO.call(e,t)}function vr(e){return jO.call(e)}function YO(e){if(e.name)return e.name;var t=BO.call(DO.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function gx(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;nt.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return yx(vd.call(e,0,t.maxStringLength),t)+r}var i=yr.call(yr.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,nI);return px(i,"single",t)}function nI(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+NO.call(t.toString(16))}function Ds(e){return"Object("+e+")"}function ud(e){return e+" { ? }"}function fx(e,t,n,r){var i=r?md(n,r):Mn.call(n,", ");return e+" ("+t+") {"+i+"}"}function rI(e){for(var t=0;t=0)return!1;return!0}function iI(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Mn.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Mn.call(Array(t+1),n)}}function md(e,t){if(e.length===0)return"";var n=` +`+t.prev+t.base;return n+Mn.call(e,","+n)+` +`+t.prev}function Vl(e,t){var n=pd(e),r=[];if(n){r.length=e.length;for(var i=0;i{"use strict";v();var bx=pn(),na=qt(),aI=wx(),sI=Wn(),Xl=bx("%WeakMap%",!0),Yl=bx("%Map%",!0),oI=na("WeakMap.prototype.get",!0),lI=na("WeakMap.prototype.set",!0),cI=na("WeakMap.prototype.has",!0),uI=na("Map.prototype.get",!0),fI=na("Map.prototype.set",!0),hI=na("Map.prototype.has",!0),wd=function(e,t){for(var n=e,r;(r=n.next)!==null;n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},dI=function(e,t){var n=wd(e,t);return n&&n.value},pI=function(e,t,n){var r=wd(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},mI=function(e,t){return!!wd(e,t)};xx.exports=function(){var t,n,r,i={assert:function(a){if(!i.has(a))throw new sI("Side channel does not contain "+aI(a))},get:function(a){if(Xl&&a&&(typeof a=="object"||typeof a=="function")){if(t)return oI(t,a)}else if(Yl){if(n)return uI(n,a)}else if(r)return dI(r,a)},has:function(a){if(Xl&&a&&(typeof a=="object"||typeof a=="function")){if(t)return cI(t,a)}else if(Yl){if(n)return hI(n,a)}else if(r)return mI(r,a);return!1},set:function(a,s){Xl&&a&&(typeof a=="object"||typeof a=="function")?(t||(t=new Xl),lI(t,a,s)):Yl?(n||(n=new Yl),fI(n,a,s)):(r||(r={key:{},next:null}),pI(r,a,s))}};return i}});var Sx=R((JB,_x)=>{"use strict";v();var gI=Yh(),$s=bd()(),qn=Wn(),xd={assert:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new qn("`O` is not an object");if(typeof t!="string")throw new qn("`slot` must be a string");if($s.assert(e),!xd.has(e,t))throw new qn("`"+t+"` is not present on `O`")},get:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new qn("`O` is not an object");if(typeof t!="string")throw new qn("`slot` must be a string");var n=$s.get(e);return n&&n["$"+t]},has:function(e,t){if(!e||typeof e!="object"&&typeof e!="function")throw new qn("`O` is not an object");if(typeof t!="string")throw new qn("`slot` must be a string");var n=$s.get(e);return!!n&&gI(n,"$"+t)},set:function(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new qn("`O` is not an object");if(typeof t!="string")throw new qn("`slot` must be a string");var r=$s.get(e);r||(r={},$s.set(e,r)),r["$"+t]=n}};Object.freeze&&Object.freeze(xd);_x.exports=xd});var kx=R((eN,Ax)=>{"use strict";v();var Hs=Sx(),yI=SyntaxError,Ex=typeof StopIteration=="object"?StopIteration:null;Ax.exports=function(t){if(!Ex)throw new yI("this environment lacks StopIteration");Hs.set(t,"[[Done]]",!1);var n={next:function(){var i=Hs.get(this,"[[Iterator]]"),a=Hs.get(i,"[[Done]]");try{return{done:a,value:a?void 0:i.next()}}catch(s){if(Hs.set(i,"[[Done]]",!0),s!==Ex)throw s;return{done:!0,value:void 0}}}};return Hs.set(n,"[[Iterator]]",t),n}});var _d=R((nN,Tx)=>{v();var vI={}.toString;Tx.exports=Array.isArray||function(e){return vI.call(e)=="[object Array]"}});var Sd=R((iN,Cx)=>{"use strict";v();var wI=String.prototype.valueOf,bI=function(t){try{return wI.call(t),!0}catch(n){return!1}},xI=Object.prototype.toString,_I="[object String]",SI=mr()();Cx.exports=function(t){return typeof t=="string"?!0:typeof t!="object"?!1:SI?bI(t):xI.call(t)===_I}});var Ad=R((sN,Mx)=>{"use strict";v();var Ed=typeof Map=="function"&&Map.prototype?Map:null,EI=typeof Set=="function"&&Set.prototype?Set:null,Zl;Ed||(Zl=function(t){return!1});var Px=Ed?Map.prototype.has:null,Fx=EI?Set.prototype.has:null;!Zl&&!Px&&(Zl=function(t){return!1});Mx.exports=Zl||function(t){if(!t||typeof t!="object")return!1;try{if(Px.call(t),Fx)try{Fx.call(t)}catch(n){return!0}return t instanceof Ed}catch(n){}return!1}});var Td=R((lN,Rx)=>{"use strict";v();var AI=typeof Map=="function"&&Map.prototype?Map:null,kd=typeof Set=="function"&&Set.prototype?Set:null,Kl;kd||(Kl=function(t){return!1});var Ox=AI?Map.prototype.has:null,Ix=kd?Set.prototype.has:null;!Kl&&!Ix&&(Kl=function(t){return!1});Rx.exports=Kl||function(t){if(!t||typeof t!="object")return!1;try{if(Ix.call(t),Ox)try{Ox.call(t)}catch(n){return!0}return t instanceof kd}catch(n){}return!1}});var Wx=R((uN,ec)=>{"use strict";v();var Lx=sd(),jx=kx();Ol()()||Is()()?(Jl=Symbol.iterator,ec.exports=function(t){if(t!=null&&typeof t[Jl]!="undefined")return t[Jl]();if(Lx(t))return Array.prototype[Jl].call(t)}):(Dx=_d(),Bx=Sd(),Cd=pn(),Nx=Cd("%Map%",!0),$x=Cd("%Set%",!0),rn=qt(),Fd=rn("Array.prototype.push"),Pd=rn("String.prototype.charCodeAt"),Hx=rn("String.prototype.slice"),Ux=function(t,n){var r=t.length;if(n+1>=r)return n+1;var i=Pd(t,n);if(i<55296||i>56319)return n+1;var a=Pd(t,n+1);return a<56320||a>57343?n+1:n+2},Ql=function(t){var n=0;return{next:function(){var i=n>=t.length,a;return i||(a=t[n],n+=1),{done:i,value:a}}}},Md=function(t,n){if(Dx(t)||Lx(t))return Ql(t);if(Bx(t)){var r=0;return{next:function(){var a=Ux(t,r),s=Hx(t,r,a);return r=a,{done:a>t.length,value:s}}}}if(n&&typeof t["_es6-shim iterator_"]!="undefined")return t["_es6-shim iterator_"]()},!Nx&&!$x?ec.exports=function(t){if(t!=null)return Md(t,!0)}:(Gx=Ad(),zx=Td(),Od=rn("Map.prototype.forEach",!0),Id=rn("Set.prototype.forEach",!0),(typeof process=="undefined"||!process.versions||!process.versions.node)&&(Rd=rn("Map.prototype.iterator",!0),Ld=rn("Set.prototype.iterator",!0)),jd=rn("Map.prototype.@@iterator",!0)||rn("Map.prototype._es6-shim iterator_",!0),Dd=rn("Set.prototype.@@iterator",!0)||rn("Set.prototype._es6-shim iterator_",!0),Vx=function(t){if(Gx(t)){if(Rd)return jx(Rd(t));if(jd)return jd(t);if(Od){var n=[];return Od(t,function(i,a){Fd(n,[a,i])}),Ql(n)}}if(zx(t)){if(Ld)return jx(Ld(t));if(Dd)return Dd(t);if(Id){var r=[];return Id(t,function(i){Fd(r,i)}),Ql(r)}}},ec.exports=function(t){return Vx(t)||Md(t)}));var Jl,Dx,Bx,Cd,Nx,$x,rn,Fd,Pd,Hx,Ux,Ql,Md,Gx,zx,Od,Id,Rd,Ld,jd,Dd,Vx});var Bd=R((hN,Xx)=>{"use strict";v();var qx=function(e){return e!==e};Xx.exports=function(t,n){return t===0&&n===0?1/t===1/n:!!(t===n||qx(t)&&qx(n))}});var Nd=R((pN,Yx)=>{"use strict";v();var kI=Bd();Yx.exports=function(){return typeof Object.is=="function"?Object.is:kI}});var Kx=R((gN,Zx)=>{"use strict";v();var TI=Nd(),CI=pr();Zx.exports=function(){var t=TI();return CI(Object,{is:t},{is:function(){return Object.is!==t}}),t}});var t_=R((vN,e_)=>{"use strict";v();var FI=pr(),PI=Qr(),MI=Bd(),Jx=Nd(),OI=Kx(),Qx=PI(Jx(),Object);FI(Qx,{getPolyfill:Jx,implementation:MI,shim:OI});e_.exports=Qx});var Hd=R((bN,a_)=>{"use strict";v();var II=Qr(),i_=qt(),RI=pn(),$d=RI("%ArrayBuffer%",!0),tc=i_("ArrayBuffer.prototype.byteLength",!0),LI=i_("Object.prototype.toString"),n_=!!$d&&!tc&&new $d(0).slice,r_=!!n_&&II(n_);a_.exports=tc||r_?function(t){if(!t||typeof t!="object")return!1;try{return tc?tc(t):r_(t,0),!0}catch(n){return!1}}:$d?function(t){return LI(t)==="[object ArrayBuffer]"}:function(t){return!1}});var o_=R((_N,s_)=>{"use strict";v();var jI=Date.prototype.getDay,DI=function(t){try{return jI.call(t),!0}catch(n){return!1}},BI=Object.prototype.toString,NI="[object Date]",$I=mr()();s_.exports=function(t){return typeof t!="object"||t===null?!1:$I?DI(t):BI.call(t)===NI}});var h_=R((EN,f_)=>{"use strict";v();var Ud=qt(),l_=mr()(),c_,u_,Gd,zd;l_&&(c_=Ud("Object.prototype.hasOwnProperty"),u_=Ud("RegExp.prototype.exec"),Gd={},nc=function(){throw Gd},zd={toString:nc,valueOf:nc},typeof Symbol.toPrimitive=="symbol"&&(zd[Symbol.toPrimitive]=nc));var nc,HI=Ud("Object.prototype.toString"),UI=Object.getOwnPropertyDescriptor,GI="[object RegExp]";f_.exports=l_?function(t){if(!t||typeof t!="object")return!1;var n=UI(t,"lastIndex"),r=n&&c_(n,"value");if(!r)return!1;try{u_(t,zd)}catch(i){return i===Gd}}:function(t){return!t||typeof t!="object"&&typeof t!="function"?!1:HI(t)===GI}});var m_=R((kN,p_)=>{"use strict";v();var zI=qt(),d_=zI("SharedArrayBuffer.prototype.byteLength",!0);p_.exports=d_?function(t){if(!t||typeof t!="object")return!1;try{return d_(t),!0}catch(n){return!1}}:function(t){return!1}});var y_=R((CN,g_)=>{"use strict";v();var VI=Number.prototype.toString,WI=function(t){try{return VI.call(t),!0}catch(n){return!1}},qI=Object.prototype.toString,XI="[object Number]",YI=mr()();g_.exports=function(t){return typeof t=="number"?!0:typeof t!="object"?!1:YI?WI(t):qI.call(t)===XI}});var b_=R((PN,w_)=>{"use strict";v();var v_=qt(),ZI=v_("Boolean.prototype.toString"),KI=v_("Object.prototype.toString"),JI=function(t){try{return ZI(t),!0}catch(n){return!1}},QI="[object Boolean]",eR=mr()();w_.exports=function(t){return typeof t=="boolean"?!0:t===null||typeof t!="object"?!1:eR&&Symbol.toStringTag in t?JI(t):KI(t)===QI}});var E_=R((ON,Vd)=>{"use strict";v();var tR=Object.prototype.toString,nR=Ol()();nR?(x_=Symbol.prototype.toString,__=/^Symbol\(.*\)$/,S_=function(t){return typeof t.valueOf()!="symbol"?!1:__.test(x_.call(t))},Vd.exports=function(t){if(typeof t=="symbol")return!0;if(tR.call(t)!=="[object Symbol]")return!1;try{return S_(t)}catch(n){return!1}}):Vd.exports=function(t){return!1};var x_,__,S_});var T_=R((RN,k_)=>{"use strict";v();var A_=typeof BigInt!="undefined"&&BigInt;k_.exports=function(){return typeof A_=="function"&&typeof BigInt=="function"&&typeof A_(42)=="bigint"&&typeof BigInt(42)=="bigint"}});var P_=R((jN,Wd)=>{"use strict";v();var rR=T_()();rR?(C_=BigInt.prototype.valueOf,F_=function(t){try{return C_.call(t),!0}catch(n){}return!1},Wd.exports=function(t){return t===null||typeof t=="undefined"||typeof t=="boolean"||typeof t=="string"||typeof t=="number"||typeof t=="symbol"||typeof t=="function"?!1:typeof t=="bigint"?!0:F_(t)}):Wd.exports=function(t){return!1};var C_,F_});var O_=R((BN,M_)=>{"use strict";v();var iR=Sd(),aR=y_(),sR=b_(),oR=E_(),lR=P_();M_.exports=function(t){if(t==null||typeof t!="object"&&typeof t!="function")return null;if(iR(t))return"String";if(aR(t))return"Number";if(sR(t))return"Boolean";if(oR(t))return"Symbol";if(lR(t))return"BigInt"}});var L_=R(($N,R_)=>{"use strict";v();var rc=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,I_=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,ic;rc||(ic=function(t){return!1});var Xd=rc?rc.prototype.has:null,qd=I_?I_.prototype.has:null;!ic&&!Xd&&(ic=function(t){return!1});R_.exports=ic||function(t){if(!t||typeof t!="object")return!1;try{if(Xd.call(t,Xd),qd)try{qd.call(t,qd)}catch(n){return!0}return t instanceof rc}catch(n){}return!1}});var D_=R((UN,Zd)=>{"use strict";v();var cR=pn(),j_=qt(),uR=cR("%WeakSet%",!0),Yd=j_("WeakSet.prototype.has",!0);Yd?(ac=j_("WeakMap.prototype.has",!0),Zd.exports=function(t){if(!t||typeof t!="object")return!1;try{if(Yd(t,Yd),ac)try{ac(t,ac)}catch(n){return!0}return t instanceof uR}catch(n){}return!1}):Zd.exports=function(t){return!1};var ac});var N_=R((zN,B_)=>{"use strict";v();var fR=Ad(),hR=Td(),dR=L_(),pR=D_();B_.exports=function(t){if(t&&typeof t=="object"){if(fR(t))return"Map";if(hR(t))return"Set";if(dR(t))return"WeakMap";if(pR(t))return"WeakSet"}return!1}});var G_=R((WN,U_)=>{"use strict";v();var H_=Function.prototype.toString,ra=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Jd,sc;if(typeof ra=="function"&&typeof Object.defineProperty=="function")try{Jd=Object.defineProperty({},"length",{get:function(){throw sc}}),sc={},ra(function(){throw 42},null,Jd)}catch(e){e!==sc&&(ra=null)}else ra=null;var mR=/^\s*class\b/,Qd=function(t){try{var n=H_.call(t);return mR.test(n)}catch(r){return!1}},Kd=function(t){try{return Qd(t)?!1:(H_.call(t),!0)}catch(n){return!1}},oc=Object.prototype.toString,gR="[object Object]",yR="[object Function]",vR="[object GeneratorFunction]",wR="[object HTMLAllCollection]",bR="[object HTML document.all class]",xR="[object HTMLCollection]",_R=typeof Symbol=="function"&&!!Symbol.toStringTag,SR=!(0 in[,]),ep=function(){return!1};typeof document=="object"&&($_=document.all,oc.call($_)===oc.call(document.all)&&(ep=function(t){if((SR||!t)&&(typeof t=="undefined"||typeof t=="object"))try{var n=oc.call(t);return(n===wR||n===bR||n===xR||n===gR)&&t("")==null}catch(r){}return!1}));var $_;U_.exports=ra?function(t){if(ep(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{ra(t,null,Jd)}catch(n){if(n!==sc)return!1}return!Qd(t)&&Kd(t)}:function(t){if(ep(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(_R)return Kd(t);if(Qd(t))return!1;var n=oc.call(t);return n!==yR&&n!==vR&&!/^\[object HTML/.test(n)?!1:Kd(t)}});var W_=R((XN,V_)=>{"use strict";v();var ER=G_(),AR=Object.prototype.toString,z_=Object.prototype.hasOwnProperty,kR=function(t,n,r){for(var i=0,a=t.length;i=3&&(i=r),AR.call(t)==="[object Array]"?kR(t,n,i):typeof t=="string"?TR(t,n,i):CR(t,n,i)};V_.exports=FR});var X_=R((ZN,q_)=>{"use strict";v();q_.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var Z_=R((JN,Y_)=>{"use strict";v();var tp=X_(),PR=typeof globalThis=="undefined"?global:globalThis;Y_.exports=function(){for(var t=[],n=0;n{"use strict";v();var cc=W_(),MR=Z_(),K_=Qr(),ip=qt(),lc=Nl(),OR=ip("Object.prototype.toString"),Q_=mr()(),J_=typeof globalThis=="undefined"?global:globalThis,rp=MR(),ap=ip("String.prototype.slice"),np=Object.getPrototypeOf,IR=ip("Array.prototype.indexOf",!0)||function(t,n){for(var r=0;r-1?n:n!=="Object"?!1:LR(t)}return lc?RR(t):null}});var iS=R((n$,rS)=>{"use strict";v();var jR=qt(),nS=jR("ArrayBuffer.prototype.byteLength",!0),DR=Hd();rS.exports=function(t){return DR(t)?nS?nS(t):t.byteLength:NaN}});var FS=R((i$,CS)=>{"use strict";v();var AS=Lb(),On=qt(),aS=Yb(),BR=pn(),ia=Wx(),NR=bd(),sS=t_(),oS=sd(),lS=_d(),cS=Hd(),uS=o_(),fS=h_(),hS=m_(),dS=Ml(),pS=O_(),mS=N_(),gS=tS(),yS=iS(),vS=On("SharedArrayBuffer.prototype.byteLength",!0),wS=On("Date.prototype.getTime"),sp=Object.getPrototypeOf,bS=On("Object.prototype.toString"),hc=BR("%Set%",!0),op=On("Map.prototype.has",!0),dc=On("Map.prototype.get",!0),xS=On("Map.prototype.size",!0),pc=On("Set.prototype.add",!0),kS=On("Set.prototype.delete",!0),mc=On("Set.prototype.has",!0),fc=On("Set.prototype.size",!0);function _S(e,t,n,r){for(var i=ia(e),a;(a=i.next())&&!a.done;)if(mn(t,a.value,n,r))return kS(e,a.value),!0;return!1}function TS(e){if(typeof e=="undefined")return null;if(typeof e!="object")return typeof e=="symbol"?!1:typeof e=="string"||typeof e=="number"?+e==+e:!0}function $R(e,t,n,r,i,a){var s=TS(n);if(s!=null)return s;var o=dc(t,s),l=AS({},i,{strict:!1});return typeof o=="undefined"&&!op(t,s)||!mn(r,o,l,a)?!1:!op(e,s)&&mn(r,o,l,a)}function HR(e,t,n){var r=TS(n);return r!=null?r:mc(t,r)&&!mc(e,r)}function SS(e,t,n,r,i,a){for(var s=ia(e),o,l;(o=s.next())&&!o.done;)if(l=o.value,mn(n,l,i,a)&&mn(r,dc(t,l),i,a))return kS(e,l),!0;return!1}function mn(e,t,n,r){var i=n||{};if(i.strict?sS(e,t):e===t)return!0;var a=pS(e),s=pS(t);if(a!==s)return!1;if(!e||!t||typeof e!="object"&&typeof t!="object")return i.strict?sS(e,t):e==t;var o=r.has(e),l=r.has(t),c;if(o&&l){if(r.get(e)===r.get(t))return!0}else c={};return o||r.set(e,c),l||r.set(t,c),zR(e,t,i,r)}function ES(e){return!e||typeof e!="object"||typeof e.length!="number"||typeof e.copy!="function"||typeof e.slice!="function"||e.length>0&&typeof e[0]!="number"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function UR(e,t,n,r){if(fc(e)!==fc(t))return!1;for(var i=ia(e),a=ia(t),s,o,l;(s=i.next())&&!s.done;)if(s.value&&typeof s.value=="object")l||(l=new hc),pc(l,s.value);else if(!mc(t,s.value)){if(n.strict||!HR(e,t,s.value))return!1;l||(l=new hc),pc(l,s.value)}if(l){for(;(o=a.next())&&!o.done;)if(o.value&&typeof o.value=="object"){if(!_S(l,o.value,n.strict,r))return!1}else if(!n.strict&&!mc(e,o.value)&&!_S(l,o.value,n.strict,r))return!1;return fc(l)===0}return!0}function GR(e,t,n,r){if(xS(e)!==xS(t))return!1;for(var i=ia(e),a=ia(t),s,o,l,c,u,f;(s=i.next())&&!s.done;)if(c=s.value[0],u=s.value[1],c&&typeof c=="object")l||(l=new hc),pc(l,c);else if(f=dc(t,c),typeof f=="undefined"&&!op(t,c)||!mn(u,f,n,r)){if(n.strict||!$R(e,t,c,u,n,r))return!1;l||(l=new hc),pc(l,c)}if(l){for(;(o=a.next())&&!o.done;)if(c=o.value[0],f=o.value[1],c&&typeof c=="object"){if(!SS(l,e,c,f,n,r))return!1}else if(!n.strict&&(!e.has(c)||!mn(dc(e,c),f,n,r))&&!SS(l,e,c,f,AS({},n,{strict:!1}),r))return!1;return fc(l)===0}return!0}function zR(e,t,n,r){var i,a;if(typeof e!=typeof t||e==null||t==null||bS(e)!==bS(t)||oS(e)!==oS(t))return!1;var s=lS(e),o=lS(t);if(s!==o)return!1;var l=e instanceof Error,c=t instanceof Error;if(l!==c||(l||c)&&(e.name!==t.name||e.message!==t.message))return!1;var u=fS(e),f=fS(t);if(u!==f||(u||f)&&(e.source!==t.source||aS(e)!==aS(t)))return!1;var h=uS(e),d=uS(t);if(h!==d||(h||d)&&wS(e)!==wS(t)||n.strict&&sp&&sp(e)!==sp(t))return!1;var p=gS(e),g=gS(t);if(p!==g)return!1;if(p||g){if(e.length!==t.length)return!1;for(i=0;i=0;i--)if(k[i]!=y[i])return!1;for(i=k.length-1;i>=0;i--)if(a=k[i],!mn(e[a],t[a],n,r))return!1;var E=mS(e),_=mS(t);return E!==_?!1:E==="Set"||_==="Set"?UR(e,t,n,r):E==="Map"?GR(e,t,n,r):!0}CS.exports=function(t,n,r){return mn(t,n,r,NR())}});var pp=R((exports,module)=>{v();(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(e){return Object.prototype.toString.call(e)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return typeof e=="object"&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(n){return new Sha256(t,!0).update(n)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(i){return t.create().update(i)};for(var n=0;n>2]|=e[i]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|r&63)<=57344?(o[a>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|r&63)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|r&63)<=64?(this.block=o[16],this.start=a-64,this.hash(),this.hashed=!0):this.start=a}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 e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[t&3],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,l=this.blocks,c,u,f,h,d,p,g,m,w,b,S;for(c=16;c<64;++c)d=l[c-15],u=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,d=l[c-2],f=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,l[c]=l[c-16]+u+l[c-7]+f<<0;for(S=t&n,c=0;c<64;c+=4)this.first?(this.is224?(m=300032,d=l[0]-1413257819,o=d-150054599<<0,r=d+24177077<<0):(m=704751109,d=l[0]-210244248,o=d-1521486534<<0,r=d+143694565<<0),this.first=!1):(u=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),f=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),m=e&t,h=m^e&n^S,g=i&a^~i&s,d=o+f+g+K[c]+l[c],p=u+h,o=r+d<<0,r=d+p<<0),u=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),f=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),w=r&e,h=w^r&t^m,g=o&i^~o&a,d=s+f+g+K[c+1]+l[c+1],p=u+h,s=n+d<<0,n=d+p<<0,u=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),f=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),b=n&r,h=b^n&e^w,g=s&o^~s&i,d=a+f+g+K[c+2]+l[c+2],p=u+h,a=t+d<<0,t=d+p<<0,u=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),f=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),S=t&n,h=S^t&r^b,g=a&s^~a&o,d=i+f+g+K[c+3]+l[c+3],p=u+h,i=e+d<<0,e=d+p<<0;this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+r<<0,this.h4=this.h4+i<<0,this.h5=this.h5+a<<0,this.h6=this.h6+s<<0,this.h7=this.h7+o<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,l=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[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[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[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[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]+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];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 e=this.h0,t=this.h1,n=this.h2,r=this.h3,i=this.h4,a=this.h5,s=this.h6,o=this.h7,l=[e>>24&255,e>>16&255,e>>8&255,e&255,t>>24&255,t>>16&255,t>>8&255,t&255,n>>24&255,n>>16&255,n>>8&255,n&255,r>>24&255,r>>16&255,r>>8&255,r&255,i>>24&255,i>>16&255,i>>8&255,i&255,a>>24&255,a>>16&255,a>>8&255,a&255,s>>24&255,s>>16&255,s>>8&255,s&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 e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e};function HmacSha256(e,t,n){var r,i=typeof e;if(i==="string"){var a=[],s=e.length,o=0,l;for(r=0;r>6,a[o++]=128|l&63):l<55296||l>=57344?(a[o++]=224|l>>12,a[o++]=128|l>>6&63,a[o++]=128|l&63):(l=65536+((l&1023)<<10|e.charCodeAt(++r)&1023),a[o++]=240|l>>18,a[o++]=128|l>>12&63,a[o++]=128|l>>6&63,a[o++]=128|l&63);e=a}else if(i==="object"){if(e===null)throw new Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw new Error(ERROR)}else throw new Error(ERROR);e.length>64&&(e=new Sha256(t,!0).update(e).array());var c=[],u=[];for(r=0;r<64;++r){var f=e[r]||0;c[r]=92^f,u[r]=54^f}Sha256.call(this,t,n),this.update(u),this.oKeyPad=c,this.inner=!0,this.sharedMemory=n}HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),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 YE=R(Gp=>{v();(function(e){var t=/\S/,n=/\"/g,r=/\n/g,i=/\r/g,a=/\\/g,s=/\u2028/,o=/\u2029/;e.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},e.scan=function(E,_){var C=E.length,P=0,L=1,N=2,j=P,Y=null,le=null,he="",ae=[],Pe=!1,de=0,$=0,z="{{",D="}}";function se(){he.length>0&&(ae.push({tag:"_t",text:new String(he)}),he="")}function Se(){for(var ot=!0,ee=$;ee"&&(Ee.indent=ae[Ie].text.toString()),ae.splice(Ie,1));else ee||ae.push({tag:` +`});Pe=!1,$=ae.length}function be(ot,ee){var Ie="="+D,Ee=ot.indexOf(Ie,ee),G=c(ot.substring(ot.indexOf("=",ee)+1,Ee)).split(" ");return z=G[0],D=G[G.length-1],Ee+Ie.length-1}for(_&&(_=_.split(" "),z=_[0],D=_[1]),de=0;de0;){if(j=y.shift(),N&&N.tag=="<"&&!(j.tag in f))throw new Error("Illegal content in < super tag.");if(e.tags[j.tag]<=e.tags.$||d(j,C))_.push(j),j.nodes=h(y,j.tag,_,C);else if(j.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+j.n);if(L=_.pop(),j.n!=L.n&&!p(j.n,L.n,C))throw new Error("Nesting error: "+L.n+" vs. "+j.n);return L.end=j.i,P}else j.tag==` +`&&(j.last=y.length==0||y[0].tag==` +`);P.push(j)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return P}function d(y,E){for(var _=0,C=E.length;_":A,"<":function(y,E){var _={partials:{},code:"",subs:{},inPartial:!0};e.walk(y.nodes,_);var C=E.partials[A(y,E)];C.subs=_.subs,C.partials=_.partials},$:function(y,E){var _={subs:{},code:"",partials:E.partials,prefix:y.n};e.walk(y.nodes,_),E.subs[y.n]=_.code,E.inPartial||(E.code+='t.sub("'+b(y.n)+'",c,p,i);')},"\n":function(y,E){E.code+=k('"\\n"'+(y.last?"":" + i"))},_v:function(y,E){E.code+="t.b(t.v(t."+S(y.n)+'("'+b(y.n)+'",c,p,0)));'},_t:function(y,E){E.code+=k('"'+b(y.text)+'"')},"{":x,"&":x};function x(y,E){E.code+="t.b(t.t(t."+S(y.n)+'("'+b(y.n)+'",c,p,0)));'}function k(y){return"t.b("+y+");"}e.walk=function(y,E){for(var _,C=0,P=y.length;C{v();var nj={};(function(e){e.Template=function(h,d,p,g){h=h||{},this.r=h.code||this.r,this.c=p,this.options=g||{},this.text=d||"",this.partials=h.partials||{},this.subs=h.subs||{},this.buf=""},e.Template.prototype={r:function(h,d,p){return""},v:u,t:c,render:function(d,p,g){return this.ri([d],p||{},g)},ri:function(h,d,p){return this.r(h,d,p)},ep:function(h,d){var p=this.partials[h],g=d[p.name];if(p.instance&&p.base==g)return p.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[h].base=g,p.subs){d.stackText||(d.stackText={});for(key in p.subs)d.stackText[key]||(d.stackText[key]=this.activeSub!==void 0&&d.stackText[this.activeSub]?d.stackText[this.activeSub]:this.text);g=n(g,p.subs,p.partials,this.stackSubs,this.stackPartials,d.stackText)}return this.partials[h].instance=g,g},rp:function(h,d,p,g){var m=this.ep(h,p);return m?m.ri(d,p,g):""},rs:function(h,d,p){var g=h[h.length-1];if(!f(g)){p(h,d,this);return}for(var m=0;m=0;A--)if(w=d[A],m=t(h,w,S),m!==void 0){b=!0;break}return b?(!g&&typeof m=="function"&&(m=this.mv(m,d,p)),m):g?!1:""},ls:function(h,d,p,g,m){var w=this.options.delimiters;return this.options.delimiters=m,this.b(this.ct(c(h.call(d,g)),d,p)),this.options.delimiters=w,!1},ct:function(h,d,p){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(h,this.options).render(d,p)},b:function(h){this.buf+=h},fl:function(){var h=this.buf;return this.buf="",h},ms:function(h,d,p,g,m,w,b){var S,A=d[d.length-1],x=h.call(A);return typeof x=="function"?g?!0:(S=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(x,A,p,S.substring(m,w),b)):x},mv:function(h,d,p){var g=d[d.length-1],m=h.call(g);return typeof m=="function"?this.ct(c(m.call(g)),g,p):m},sub:function(h,d,p,g){var m=this.subs[h];m&&(this.activeSub=h,m(d,p,this,g),this.activeSub=!1)}};function t(h,d,p){var g;return d&&typeof d=="object"&&(d[h]!==void 0?g=d[h]:p&&d.get&&typeof d.get=="function"&&(g=d.get(h))),g}function n(h,d,p,g,m,w){function b(){}b.prototype=h;function S(){}S.prototype=h.subs;var A,x=new b;x.subs=new S,x.subsText={},x.buf="",g=g||{},x.stackSubs=g,x.subsText=w;for(A in d)g[A]||(g[A]=d[A]);for(A in g)x.subs[A]=g[A];m=m||{},x.stackPartials=m;for(A in p)m[A]||(m[A]=p[A]);for(A in m)x.partials[A]=m[A];return x}var r=/&/g,i=//g,s=/\'/g,o=/\"/g,l=/[&<>\"\']/;function c(h){return String(h==null?"":h)}function u(h){return h=c(h),l.test(h)?h.replace(r,"&").replace(i,"<").replace(a,">").replace(s,"'").replace(o,"""):h}var f=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"}})(typeof zp!="undefined"?zp:nj)});var Vp=R((aG,KE)=>{v();var Yc=YE();Yc.Template=ZE().Template;Yc.template=Yc.Template;KE.exports=Yc});var RA=R((lo,sm)=>{v();(function(t,n){typeof lo=="object"&&typeof sm=="object"?sm.exports=n():typeof define=="function"&&define.amd?define([],n):typeof lo=="object"?lo.feather=n():t.feather=n()})(typeof self!="undefined"?self:lo,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(r,i,a){n.o(r,i)||Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:a})},n.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},n.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(i,"a",i),i},n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},n.p="",n(n.s=0)}({"./dist/icons.json":function(e){e.exports={activity:'',airplay:'',"alert-circle":'',"alert-octagon":'',"alert-triangle":'',"align-center":'',"align-justify":'',"align-left":'',"align-right":'',anchor:'',aperture:'',archive:'',"arrow-down-circle":'',"arrow-down-left":'',"arrow-down-right":'',"arrow-down":'',"arrow-left-circle":'',"arrow-left":'',"arrow-right-circle":'',"arrow-right":'',"arrow-up-circle":'',"arrow-up-left":'',"arrow-up-right":'',"arrow-up":'',"at-sign":'',award:'',"bar-chart-2":'',"bar-chart":'',"battery-charging":'',battery:'',"bell-off":'',bell:'',bluetooth:'',bold:'',"book-open":'',book:'',bookmark:'',box:'',briefcase:'',calendar:'',"camera-off":'',camera:'',cast:'',"check-circle":'',"check-square":'',check:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',"chevrons-down":'',"chevrons-left":'',"chevrons-right":'',"chevrons-up":'',chrome:'',circle:'',clipboard:'',clock:'',"cloud-drizzle":'',"cloud-lightning":'',"cloud-off":'',"cloud-rain":'',"cloud-snow":'',cloud:'',code:'',codepen:'',codesandbox:'',coffee:'',columns:'',command:'',compass:'',copy:'',"corner-down-left":'',"corner-down-right":'',"corner-left-down":'',"corner-left-up":'',"corner-right-down":'',"corner-right-up":'',"corner-up-left":'',"corner-up-right":'',cpu:'',"credit-card":'',crop:'',crosshair:'',database:'',delete:'',disc:'',"divide-circle":'',"divide-square":'',divide:'',"dollar-sign":'',"download-cloud":'',download:'',dribbble:'',droplet:'',"edit-2":'',"edit-3":'',edit:'',"external-link":'',"eye-off":'',eye:'',facebook:'',"fast-forward":'',feather:'',figma:'',"file-minus":'',"file-plus":'',"file-text":'',file:'',film:'',filter:'',flag:'',"folder-minus":'',"folder-plus":'',folder:'',framer:'',frown:'',gift:'',"git-branch":'',"git-commit":'',"git-merge":'',"git-pull-request":'',github:'',gitlab:'',globe:'',grid:'',"hard-drive":'',hash:'',headphones:'',heart:'',"help-circle":'',hexagon:'',home:'',image:'',inbox:'',info:'',instagram:'',italic:'',key:'',layers:'',layout:'',"life-buoy":'',"link-2":'',link:'',linkedin:'',list:'',loader:'',lock:'',"log-in":'',"log-out":'',mail:'',"map-pin":'',map:'',"maximize-2":'',maximize:'',meh:'',menu:'',"message-circle":'',"message-square":'',"mic-off":'',mic:'',"minimize-2":'',minimize:'',"minus-circle":'',"minus-square":'',minus:'',monitor:'',moon:'',"more-horizontal":'',"more-vertical":'',"mouse-pointer":'',move:'',music:'',"navigation-2":'',navigation:'',octagon:'',package:'',paperclip:'',"pause-circle":'',pause:'',"pen-tool":'',percent:'',"phone-call":'',"phone-forwarded":'',"phone-incoming":'',"phone-missed":'',"phone-off":'',"phone-outgoing":'',phone:'',"pie-chart":'',"play-circle":'',play:'',"plus-circle":'',"plus-square":'',plus:'',pocket:'',power:'',printer:'',radio:'',"refresh-ccw":'',"refresh-cw":'',repeat:'',rewind:'',"rotate-ccw":'',"rotate-cw":'',rss:'',save:'',scissors:'',search:'',send:'',server:'',settings:'',"share-2":'',share:'',"shield-off":'',shield:'',"shopping-bag":'',"shopping-cart":'',shuffle:'',sidebar:'',"skip-back":'',"skip-forward":'',slack:'',slash:'',sliders:'',smartphone:'',smile:'',speaker:'',square:'',star:'',"stop-circle":'',sun:'',sunrise:'',sunset:'',table:'',tablet:'',tag:'',target:'',terminal:'',thermometer:'',"thumbs-down":'',"thumbs-up":'',"toggle-left":'',"toggle-right":'',tool:'',"trash-2":'',trash:'',trello:'',"trending-down":'',"trending-up":'',triangle:'',truck:'',tv:'',twitch:'',twitter:'',type:'',umbrella:'',underline:'',unlock:'',"upload-cloud":'',upload:'',"user-check":'',"user-minus":'',"user-plus":'',"user-x":'',user:'',users:'',"video-off":'',video:'',voicemail:'',"volume-1":'',"volume-2":'',"volume-x":'',volume:'',watch:'',"wifi-off":'',wifi:'',wind:'',"x-circle":'',"x-octagon":'',"x-square":'',x:'',youtube:'',"zap-off":'',zap:'',"zoom-in":'',"zoom-out":''}},"./node_modules/classnames/dedupe.js":function(e,t,n){var r,i;(function(){"use strict";var a=function(){function s(){}s.prototype=Object.create(null);function o(g,m){for(var w=m.length,b=0;b1?arguments[1]:void 0,m=g!==void 0,w=0,b=c(h),S,A,x,k;if(m&&(g=r(g,p>2?arguments[2]:void 0,2)),b!=null&&!(d==Array&&s(b)))for(k=b.call(h),A=new d;!(x=k.next()).done;w++)l(A,w,m?a(k,g,[x.value,w],!0):x.value);else for(S=o(h.length),A=new d(S);S>w;w++)l(A,w,m?g(h[w],w):h[w]);return A.length=w,A}},"./node_modules/core-js/internals/array-includes.js":function(e,t,n){var r=n("./node_modules/core-js/internals/to-indexed-object.js"),i=n("./node_modules/core-js/internals/to-length.js"),a=n("./node_modules/core-js/internals/to-absolute-index.js");e.exports=function(s){return function(o,l,c){var u=r(o),f=i(u.length),h=a(c,f),d;if(s&&l!=l){for(;f>h;)if(d=u[h++],d!=d)return!0}else for(;f>h;h++)if((s||h in u)&&u[h]===l)return s||h||0;return!s&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(e,t,n){var r=n("./node_modules/core-js/internals/a-function.js");e.exports=function(i,a,s){if(r(i),a===void 0)return i;switch(s){case 0:return function(){return i.call(a)};case 1:return function(o){return i.call(a,o)};case 2:return function(o,l){return i.call(a,o,l)};case 3:return function(o,l,c){return i.call(a,o,l,c)}}return function(){return i.apply(a,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(e,t,n){var r=n("./node_modules/core-js/internals/an-object.js");e.exports=function(i,a,s,o){try{return o?a(r(s)[0],s[1]):a(s)}catch(c){var l=i.return;throw l!==void 0&&r(l.call(i)),c}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(e,t,n){var r=n("./node_modules/core-js/internals/well-known-symbol.js"),i=r("iterator"),a=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){a=!0}};o[i]=function(){return this},Array.from(o,function(){throw 2})}catch(l){}e.exports=function(l,c){if(!c&&!a)return!1;var u=!1;try{var f={};f[i]=function(){return{next:function(){return{done:u=!0}}}},l(f)}catch(h){}return u}},"./node_modules/core-js/internals/classof-raw.js":function(e,t){var n={}.toString;e.exports=function(r){return n.call(r).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(e,t,n){var r=n("./node_modules/core-js/internals/classof-raw.js"),i=n("./node_modules/core-js/internals/well-known-symbol.js"),a=i("toStringTag"),s=r(function(){return arguments}())=="Arguments",o=function(l,c){try{return l[c]}catch(u){}};e.exports=function(l){var c,u,f;return l===void 0?"Undefined":l===null?"Null":typeof(u=o(c=Object(l),a))=="string"?u:s?r(c):(f=r(c))=="Object"&&typeof c.callee=="function"?"Arguments":f}},"./node_modules/core-js/internals/copy-constructor-properties.js":function(e,t,n){var r=n("./node_modules/core-js/internals/has.js"),i=n("./node_modules/core-js/internals/own-keys.js"),a=n("./node_modules/core-js/internals/object-get-own-property-descriptor.js"),s=n("./node_modules/core-js/internals/object-define-property.js");e.exports=function(o,l){for(var c=i(l),u=s.f,f=a.f,h=0;h",S="java"+w+":",A;for(p.style.display="none",o.appendChild(p),p.src=String(S),A=p.contentWindow.document,A.open(),A.write(m+w+b+"document.F=Object"+m+"/"+w+b),A.close(),d=A.F;g--;)delete d[f][a[g]];return d()};e.exports=Object.create||function(g,m){var w;return g!==null?(h[f]=r(g),w=new h,h[f]=null,w[u]=g):w=d(),m===void 0?w:i(w,m)},s[u]=!0},"./node_modules/core-js/internals/object-define-properties.js":function(e,t,n){var r=n("./node_modules/core-js/internals/descriptors.js"),i=n("./node_modules/core-js/internals/object-define-property.js"),a=n("./node_modules/core-js/internals/an-object.js"),s=n("./node_modules/core-js/internals/object-keys.js");e.exports=r?Object.defineProperties:function(l,c){a(l);for(var u=s(c),f=u.length,h=0,d;f>h;)i.f(l,d=u[h++],c[d]);return l}},"./node_modules/core-js/internals/object-define-property.js":function(e,t,n){var r=n("./node_modules/core-js/internals/descriptors.js"),i=n("./node_modules/core-js/internals/ie8-dom-define.js"),a=n("./node_modules/core-js/internals/an-object.js"),s=n("./node_modules/core-js/internals/to-primitive.js"),o=Object.defineProperty;t.f=r?o:function(c,u,f){if(a(c),u=s(u,!0),a(f),i)try{return o(c,u,f)}catch(h){}if("get"in f||"set"in f)throw TypeError("Accessors not supported");return"value"in f&&(c[u]=f.value),c}},"./node_modules/core-js/internals/object-get-own-property-descriptor.js":function(e,t,n){var r=n("./node_modules/core-js/internals/descriptors.js"),i=n("./node_modules/core-js/internals/object-property-is-enumerable.js"),a=n("./node_modules/core-js/internals/create-property-descriptor.js"),s=n("./node_modules/core-js/internals/to-indexed-object.js"),o=n("./node_modules/core-js/internals/to-primitive.js"),l=n("./node_modules/core-js/internals/has.js"),c=n("./node_modules/core-js/internals/ie8-dom-define.js"),u=Object.getOwnPropertyDescriptor;t.f=r?u:function(h,d){if(h=s(h),d=o(d,!0),c)try{return u(h,d)}catch(p){}if(l(h,d))return a(!i.f.call(h,d),h[d])}},"./node_modules/core-js/internals/object-get-own-property-names.js":function(e,t,n){var r=n("./node_modules/core-js/internals/object-keys-internal.js"),i=n("./node_modules/core-js/internals/enum-bug-keys.js"),a=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(o){return r(o,a)}},"./node_modules/core-js/internals/object-get-own-property-symbols.js":function(e,t){t.f=Object.getOwnPropertySymbols},"./node_modules/core-js/internals/object-get-prototype-of.js":function(e,t,n){var r=n("./node_modules/core-js/internals/has.js"),i=n("./node_modules/core-js/internals/to-object.js"),a=n("./node_modules/core-js/internals/shared-key.js"),s=n("./node_modules/core-js/internals/correct-prototype-getter.js"),o=a("IE_PROTO"),l=Object.prototype;e.exports=s?Object.getPrototypeOf:function(c){return c=i(c),r(c,o)?c[o]:typeof c.constructor=="function"&&c instanceof c.constructor?c.constructor.prototype:c instanceof Object?l:null}},"./node_modules/core-js/internals/object-keys-internal.js":function(e,t,n){var r=n("./node_modules/core-js/internals/has.js"),i=n("./node_modules/core-js/internals/to-indexed-object.js"),a=n("./node_modules/core-js/internals/array-includes.js"),s=n("./node_modules/core-js/internals/hidden-keys.js"),o=a(!1);e.exports=function(l,c){var u=i(l),f=0,h=[],d;for(d in u)!r(s,d)&&r(u,d)&&h.push(d);for(;c.length>f;)r(u,d=c[f++])&&(~o(h,d)||h.push(d));return h}},"./node_modules/core-js/internals/object-keys.js":function(e,t,n){var r=n("./node_modules/core-js/internals/object-keys-internal.js"),i=n("./node_modules/core-js/internals/enum-bug-keys.js");e.exports=Object.keys||function(s){return r(s,i)}},"./node_modules/core-js/internals/object-property-is-enumerable.js":function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!r.call({1:2},1);t.f=a?function(o){var l=i(this,o);return!!l&&l.enumerable}:r},"./node_modules/core-js/internals/object-set-prototype-of.js":function(e,t,n){var r=n("./node_modules/core-js/internals/validate-set-prototype-of-arguments.js");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var i=!1,a={},s;try{s=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,s.call(a,[]),i=a instanceof Array}catch(o){}return function(l,c){return r(l,c),i?s.call(l,c):l.__proto__=c,l}}():void 0)},"./node_modules/core-js/internals/own-keys.js":function(e,t,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/object-get-own-property-names.js"),a=n("./node_modules/core-js/internals/object-get-own-property-symbols.js"),s=n("./node_modules/core-js/internals/an-object.js"),o=r.Reflect;e.exports=o&&o.ownKeys||function(c){var u=i.f(s(c)),f=a.f;return f?u.concat(f(c)):u}},"./node_modules/core-js/internals/path.js":function(e,t,n){e.exports=n("./node_modules/core-js/internals/global.js")},"./node_modules/core-js/internals/redefine.js":function(e,t,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/shared.js"),a=n("./node_modules/core-js/internals/hide.js"),s=n("./node_modules/core-js/internals/has.js"),o=n("./node_modules/core-js/internals/set-global.js"),l=n("./node_modules/core-js/internals/function-to-string.js"),c=n("./node_modules/core-js/internals/internal-state.js"),u=c.get,f=c.enforce,h=String(l).split("toString");i("inspectSource",function(d){return l.call(d)}),(e.exports=function(d,p,g,m){var w=m?!!m.unsafe:!1,b=m?!!m.enumerable:!1,S=m?!!m.noTargetGet:!1;if(typeof g=="function"&&(typeof p=="string"&&!s(g,"name")&&a(g,"name",p),f(g).source=h.join(typeof p=="string"?p:"")),d===r){b?d[p]=g:o(p,g);return}else w?!S&&d[p]&&(b=!0):delete d[p];b?d[p]=g:a(d,p,g)})(Function.prototype,"toString",function(){return typeof this=="function"&&u(this).source||l.call(this)})},"./node_modules/core-js/internals/require-object-coercible.js":function(e,t){e.exports=function(n){if(n==null)throw TypeError("Can't call method on "+n);return n}},"./node_modules/core-js/internals/set-global.js":function(e,t,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/hide.js");e.exports=function(a,s){try{i(r,a,s)}catch(o){r[a]=s}return s}},"./node_modules/core-js/internals/set-to-string-tag.js":function(e,t,n){var r=n("./node_modules/core-js/internals/object-define-property.js").f,i=n("./node_modules/core-js/internals/has.js"),a=n("./node_modules/core-js/internals/well-known-symbol.js"),s=a("toStringTag");e.exports=function(o,l,c){o&&!i(o=c?o:o.prototype,s)&&r(o,s,{configurable:!0,value:l})}},"./node_modules/core-js/internals/shared-key.js":function(e,t,n){var r=n("./node_modules/core-js/internals/shared.js"),i=n("./node_modules/core-js/internals/uid.js"),a=r("keys");e.exports=function(s){return a[s]||(a[s]=i(s))}},"./node_modules/core-js/internals/shared.js":function(e,t,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/set-global.js"),a=n("./node_modules/core-js/internals/is-pure.js"),s="__core-js_shared__",o=r[s]||i(s,{});(e.exports=function(l,c){return o[l]||(o[l]=c!==void 0?c:{})})("versions",[]).push({version:"3.1.3",mode:a?"pure":"global",copyright:"\xA9 2019 Denis Pushkarev (zloirock.ru)"})},"./node_modules/core-js/internals/string-at.js":function(e,t,n){var r=n("./node_modules/core-js/internals/to-integer.js"),i=n("./node_modules/core-js/internals/require-object-coercible.js");e.exports=function(a,s,o){var l=String(i(a)),c=r(s),u=l.length,f,h;return c<0||c>=u?o?"":void 0:(f=l.charCodeAt(c),f<55296||f>56319||c+1===u||(h=l.charCodeAt(c+1))<56320||h>57343?o?l.charAt(c):f:o?l.slice(c,c+2):(f-55296<<10)+(h-56320)+65536)}},"./node_modules/core-js/internals/to-absolute-index.js":function(e,t,n){var r=n("./node_modules/core-js/internals/to-integer.js"),i=Math.max,a=Math.min;e.exports=function(s,o){var l=r(s);return l<0?i(l+o,0):a(l,o)}},"./node_modules/core-js/internals/to-indexed-object.js":function(e,t,n){var r=n("./node_modules/core-js/internals/indexed-object.js"),i=n("./node_modules/core-js/internals/require-object-coercible.js");e.exports=function(a){return r(i(a))}},"./node_modules/core-js/internals/to-integer.js":function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(i){return isNaN(i=+i)?0:(i>0?r:n)(i)}},"./node_modules/core-js/internals/to-length.js":function(e,t,n){var r=n("./node_modules/core-js/internals/to-integer.js"),i=Math.min;e.exports=function(a){return a>0?i(r(a),9007199254740991):0}},"./node_modules/core-js/internals/to-object.js":function(e,t,n){var r=n("./node_modules/core-js/internals/require-object-coercible.js");e.exports=function(i){return Object(r(i))}},"./node_modules/core-js/internals/to-primitive.js":function(e,t,n){var r=n("./node_modules/core-js/internals/is-object.js");e.exports=function(i,a){if(!r(i))return i;var s,o;if(a&&typeof(s=i.toString)=="function"&&!r(o=s.call(i))||typeof(s=i.valueOf)=="function"&&!r(o=s.call(i))||!a&&typeof(s=i.toString)=="function"&&!r(o=s.call(i)))return o;throw TypeError("Can't convert object to primitive value")}},"./node_modules/core-js/internals/uid.js":function(e,t){var n=0,r=Math.random();e.exports=function(i){return"Symbol(".concat(i===void 0?"":i,")_",(++n+r).toString(36))}},"./node_modules/core-js/internals/validate-set-prototype-of-arguments.js":function(e,t,n){var r=n("./node_modules/core-js/internals/is-object.js"),i=n("./node_modules/core-js/internals/an-object.js");e.exports=function(a,s){if(i(a),!r(s)&&s!==null)throw TypeError("Can't set "+String(s)+" as a prototype")}},"./node_modules/core-js/internals/well-known-symbol.js":function(e,t,n){var r=n("./node_modules/core-js/internals/global.js"),i=n("./node_modules/core-js/internals/shared.js"),a=n("./node_modules/core-js/internals/uid.js"),s=n("./node_modules/core-js/internals/native-symbol.js"),o=r.Symbol,l=i("wks");e.exports=function(c){return l[c]||(l[c]=s&&o[c]||(s?o:a)("Symbol."+c))}},"./node_modules/core-js/modules/es.array.from.js":function(e,t,n){var r=n("./node_modules/core-js/internals/export.js"),i=n("./node_modules/core-js/internals/array-from.js"),a=n("./node_modules/core-js/internals/check-correctness-of-iteration.js"),s=!a(function(o){Array.from(o)});r({target:"Array",stat:!0,forced:s},{from:i})},"./node_modules/core-js/modules/es.string.iterator.js":function(e,t,n){"use strict";var r=n("./node_modules/core-js/internals/string-at.js"),i=n("./node_modules/core-js/internals/internal-state.js"),a=n("./node_modules/core-js/internals/define-iterator.js"),s="String Iterator",o=i.set,l=i.getterFor(s);a(String,"String",function(c){o(this,{type:s,string:String(c),index:0})},function(){var u=l(this),f=u.string,h=u.index,d;return h>=f.length?{value:void 0,done:!0}:(d=r(f,h,!0),u.index+=d.length,{value:d,done:!1})})},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(r){typeof window=="object"&&(n=window)}e.exports=n},"./src/default-attrs.json":function(e){e.exports={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}},"./src/icon.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(d){for(var p=1;p2&&arguments[2]!==void 0?arguments[2]:[];u(this,d),this.name=p,this.contents=g,this.tags=m,this.attrs=r({},l.default,{class:"feather feather-"+p})}return i(d,[{key:"toSvg",value:function(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},m=r({},this.attrs,g,{class:(0,s.default)(this.attrs.class,g.class)});return""+this.contents+""}},{key:"toString",value:function(){return this.contents}}]),d}();function h(d){return Object.keys(d).map(function(p){return p+'="'+d[p]+'"'}).join(" ")}t.default=f},"./src/icons.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("./src/icon.js"),i=c(r),a=n("./dist/icons.json"),s=c(a),o=n("./src/tags.json"),l=c(o);function c(u){return u&&u.__esModule?u:{default:u}}t.default=Object.keys(s.default).map(function(u){return new i.default(u,s.default[u],l.default[u])}).reduce(function(u,f){return u[f.name]=f,u},{})},"./src/index.js":function(e,t,n){"use strict";var r=n("./src/icons.js"),i=c(r),a=n("./src/to-svg.js"),s=c(a),o=n("./src/replace.js"),l=c(o);function c(u){return u&&u.__esModule?u:{default:u}}e.exports={icons:i.default,toSvg:s.default,replace:l.default}},"./src/replace.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(h){for(var d=1;d0&&arguments[0]!==void 0?arguments[0]:{};if(typeof document=="undefined")throw new Error("`feather.replace()` only works in a browser environment.");var d=document.querySelectorAll("[data-feather]");Array.from(d).forEach(function(p){return u(p,h)})}function u(h){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=f(h),g=p["data-feather"];if(delete p["data-feather"],o.default[g]===void 0){console.warn("feather: '"+g+"' is not a valid icon");return}var m=o.default[g].toSvg(r({},d,p,{class:(0,a.default)(d.class,p.class)})),w=new DOMParser().parseFromString(m,"image/svg+xml"),b=w.querySelector("svg");h.parentNode.replaceChild(b,h)}function f(h){return Array.from(h.attributes).reduce(function(d,p){return d[p.name]=p.value,d},{})}t.default=c},"./src/tags.json":function(e){e.exports={activity:["pulse","health","action","motion"],airplay:["stream","cast","mirroring"],"alert-circle":["warning","alert","danger"],"alert-octagon":["warning","alert","danger"],"alert-triangle":["warning","alert","danger"],"align-center":["text alignment","center"],"align-justify":["text alignment","justified"],"align-left":["text alignment","left"],"align-right":["text alignment","right"],anchor:[],archive:["index","box"],"at-sign":["mention","at","email","message"],award:["achievement","badge"],aperture:["camera","photo"],"bar-chart":["statistics","diagram","graph"],"bar-chart-2":["statistics","diagram","graph"],battery:["power","electricity"],"battery-charging":["power","electricity"],bell:["alarm","notification","sound"],"bell-off":["alarm","notification","silent"],bluetooth:["wireless"],"book-open":["read","library"],book:["read","dictionary","booklet","magazine","library"],bookmark:["read","clip","marker","tag"],box:["cube"],briefcase:["work","bag","baggage","folder"],calendar:["date"],camera:["photo"],cast:["chromecast","airplay"],"chevron-down":["expand"],"chevron-up":["collapse"],circle:["off","zero","record"],clipboard:["copy"],clock:["time","watch","alarm"],"cloud-drizzle":["weather","shower"],"cloud-lightning":["weather","bolt"],"cloud-rain":["weather"],"cloud-snow":["weather","blizzard"],cloud:["weather"],codepen:["logo"],codesandbox:["logo"],code:["source","programming"],coffee:["drink","cup","mug","tea","cafe","hot","beverage"],columns:["layout"],command:["keyboard","cmd","terminal","prompt"],compass:["navigation","safari","travel","direction"],copy:["clone","duplicate"],"corner-down-left":["arrow","return"],"corner-down-right":["arrow"],"corner-left-down":["arrow"],"corner-left-up":["arrow"],"corner-right-down":["arrow"],"corner-right-up":["arrow"],"corner-up-left":["arrow"],"corner-up-right":["arrow"],cpu:["processor","technology"],"credit-card":["purchase","payment","cc"],crop:["photo","image"],crosshair:["aim","target"],database:["storage","memory"],delete:["remove"],disc:["album","cd","dvd","music"],"dollar-sign":["currency","money","payment"],droplet:["water"],edit:["pencil","change"],"edit-2":["pencil","change"],"edit-3":["pencil","change"],eye:["view","watch"],"eye-off":["view","watch","hide","hidden"],"external-link":["outbound"],facebook:["logo","social"],"fast-forward":["music"],figma:["logo","design","tool"],"file-minus":["delete","remove","erase"],"file-plus":["add","create","new"],"file-text":["data","txt","pdf"],film:["movie","video"],filter:["funnel","hopper"],flag:["report"],"folder-minus":["directory"],"folder-plus":["directory"],folder:["directory"],framer:["logo","design","tool"],frown:["emoji","face","bad","sad","emotion"],gift:["present","box","birthday","party"],"git-branch":["code","version control"],"git-commit":["code","version control"],"git-merge":["code","version control"],"git-pull-request":["code","version control"],github:["logo","version control"],gitlab:["logo","version control"],globe:["world","browser","language","translate"],"hard-drive":["computer","server","memory","data"],hash:["hashtag","number","pound"],headphones:["music","audio","sound"],heart:["like","love","emotion"],"help-circle":["question mark"],hexagon:["shape","node.js","logo"],home:["house","living"],image:["picture"],inbox:["email"],instagram:["logo","camera"],key:["password","login","authentication","secure"],layers:["stack"],layout:["window","webpage"],"life-buoy":["help","life ring","support"],link:["chain","url"],"link-2":["chain","url"],linkedin:["logo","social media"],list:["options"],lock:["security","password","secure"],"log-in":["sign in","arrow","enter"],"log-out":["sign out","arrow","exit"],mail:["email","message"],"map-pin":["location","navigation","travel","marker"],map:["location","navigation","travel"],maximize:["fullscreen"],"maximize-2":["fullscreen","arrows","expand"],meh:["emoji","face","neutral","emotion"],menu:["bars","navigation","hamburger"],"message-circle":["comment","chat"],"message-square":["comment","chat"],"mic-off":["record","sound","mute"],mic:["record","sound","listen"],minimize:["exit fullscreen","close"],"minimize-2":["exit fullscreen","arrows","close"],minus:["subtract"],monitor:["tv","screen","display"],moon:["dark","night"],"more-horizontal":["ellipsis"],"more-vertical":["ellipsis"],"mouse-pointer":["arrow","cursor"],move:["arrows"],music:["note"],navigation:["location","travel"],"navigation-2":["location","travel"],octagon:["stop"],package:["box","container"],paperclip:["attachment"],pause:["music","stop"],"pause-circle":["music","audio","stop"],"pen-tool":["vector","drawing"],percent:["discount"],"phone-call":["ring"],"phone-forwarded":["call"],"phone-incoming":["call"],"phone-missed":["call"],"phone-off":["call","mute"],"phone-outgoing":["call"],phone:["call"],play:["music","start"],"pie-chart":["statistics","diagram"],"play-circle":["music","start"],plus:["add","new"],"plus-circle":["add","new"],"plus-square":["add","new"],pocket:["logo","save"],power:["on","off"],printer:["fax","office","device"],radio:["signal"],"refresh-cw":["synchronise","arrows"],"refresh-ccw":["arrows"],repeat:["loop","arrows"],rewind:["music"],"rotate-ccw":["arrow"],"rotate-cw":["arrow"],rss:["feed","subscribe"],save:["floppy disk"],scissors:["cut"],search:["find","magnifier","magnifying glass"],send:["message","mail","email","paper airplane","paper aeroplane"],settings:["cog","edit","gear","preferences"],"share-2":["network","connections"],shield:["security","secure"],"shield-off":["security","insecure"],"shopping-bag":["ecommerce","cart","purchase","store"],"shopping-cart":["ecommerce","cart","purchase","store"],shuffle:["music"],"skip-back":["music"],"skip-forward":["music"],slack:["logo"],slash:["ban","no"],sliders:["settings","controls"],smartphone:["cellphone","device"],smile:["emoji","face","happy","good","emotion"],speaker:["audio","music"],star:["bookmark","favorite","like"],"stop-circle":["media","music"],sun:["brightness","weather","light"],sunrise:["weather","time","morning","day"],sunset:["weather","time","evening","night"],tablet:["device"],tag:["label"],target:["logo","bullseye"],terminal:["code","command line","prompt"],thermometer:["temperature","celsius","fahrenheit","weather"],"thumbs-down":["dislike","bad","emotion"],"thumbs-up":["like","good","emotion"],"toggle-left":["on","off","switch"],"toggle-right":["on","off","switch"],tool:["settings","spanner"],trash:["garbage","delete","remove","bin"],"trash-2":["garbage","delete","remove","bin"],triangle:["delta"],truck:["delivery","van","shipping","transport","lorry"],tv:["television","stream"],twitch:["logo"],twitter:["logo","social"],type:["text"],umbrella:["rain","weather"],unlock:["security"],"user-check":["followed","subscribed"],"user-minus":["delete","remove","unfollow","unsubscribe"],"user-plus":["new","add","create","follow","subscribe"],"user-x":["delete","remove","unfollow","unsubscribe","unavailable"],user:["person","account"],users:["group"],"video-off":["camera","movie","film"],video:["camera","movie","film"],voicemail:["phone"],volume:["music","sound","mute"],"volume-1":["music","sound"],"volume-2":["music","sound"],"volume-x":["music","sound","mute"],watch:["clock","time"],"wifi-off":["disabled"],wifi:["connection","signal","wireless"],wind:["weather","air"],"x-circle":["cancel","close","delete","remove","times","clear"],"x-octagon":["delete","stop","alert","warning","times","clear"],"x-square":["cancel","close","delete","remove","times","clear"],x:["cancel","close","delete","remove","times","clear"],youtube:["logo","video","play"],"zap-off":["flash","camera","lightning"],zap:["flash","camera","lightning"],"zoom-in":["magnifying glass"],"zoom-out":["magnifying glass"]}},"./src/to-svg.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n("./src/icons.js"),i=a(r);function a(o){return o&&o.__esModule?o:{default:o}}function s(o){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(console.warn("feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead."),!o)throw new Error("The required `key` (icon name) parameter is missing.");if(!i.default[o])throw new Error("No icon matching '"+o+"'. See the complete list of icons at https://feathericons.com");return i.default[o].toSvg(l)}t.default=s},0:function(e,t,n){n("./node_modules/core-js/es/array/from.js"),e.exports=n("./src/index.js")}})})});var cD={};uk(cD,{default:()=>gu});module.exports=fk(cD);v();v();var Za=Xe(Dm(),1),Gf=Xe(Wm(),1),S1=Xe(Xm(),1),qo=Xe(L0(),1),jo=Xe(B0(),1),E1=Xe(q0(),1),fn=Xe(Y0(),1),A1=Xe(e1(),1),ge=class e extends Error{constructor(t){super(t),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(t){let n=new e(t.message);return n.code=t.code,n.data=t.data,n.caller=t.caller,n.stack=t.stack,n}get isIsomorphicGitError(){return!0}},Ka=class e extends ge{constructor(t){super(`Modifying the index is not possible because you have unmerged files: ${t.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=e.code,this.data={filepaths:t}}};Ka.code="UnmergedPathsError";var ue=class e extends ge{constructor(t){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${t}`),this.code=this.name=e.code,this.data={message:t}}};ue.code="InternalError";var Ei=class e extends ge{constructor(t){super(`The filepath "${t}" contains unsafe character sequences`),this.code=this.name=e.code,this.data={filepath:t}}};Ei.code="UnsafeFilepathError";var en=class{constructor(t){this.buffer=t,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(t){this._start=t}slice(t){let n=this.buffer.slice(this._start,this._start+t);return this._start+=t,n}toString(t,n){let r=this.buffer.toString(t,this._start,this._start+n);return this._start+=n,r}write(t,n,r){let i=this.buffer.write(t,this._start,n,r);return this._start+=n,i}copy(t,n,r){let i=t.copy(this.buffer,this._start,n,r);return this._start+=i,i}readUInt8(){let t=this.buffer.readUInt8(this._start);return this._start+=1,t}writeUInt8(t){let n=this.buffer.writeUInt8(t,this._start);return this._start+=1,n}readUInt16BE(){let t=this.buffer.readUInt16BE(this._start);return this._start+=2,t}writeUInt16BE(t){let n=this.buffer.writeUInt16BE(t,this._start);return this._start+=2,n}readUInt32BE(){let t=this.buffer.readUInt32BE(this._start);return this._start+=4,t}writeUInt32BE(t){let n=this.buffer.writeUInt32BE(t,this._start);return this._start+=4,n}};function Xo(e,t){return-(et)}function k1(e,t){return Xo(e.path,t.path)}function T1(e){let t=e>0?e>>12:0;t!==4&&t!==8&&t!==10&&t!==14&&(t=8);let n=e&511;return n&73?n=493:n=420,t!==8&&(n=0),(t<<12)+n}var Tn=2**32;function t1(e,t,n,r){if(e!==void 0&&t!==void 0)return[e,t];n===void 0&&(n=r.valueOf());let i=Math.floor(n/1e3),a=(n-i*1e3)*1e6;return[i,a]}function Ai(e){let[t,n]=t1(e.ctimeSeconds,e.ctimeNanoseconds,e.ctimeMs,e.ctime),[r,i]=t1(e.mtimeSeconds,e.mtimeNanoseconds,e.mtimeMs,e.mtime);return{ctimeSeconds:t%Tn,ctimeNanoseconds:n%Tn,mtimeSeconds:r%Tn,mtimeNanoseconds:i%Tn,dev:e.dev%Tn,ino:e.ino%Tn,mode:T1(e.mode%Tn),uid:e.uid%Tn,gid:e.gid%Tn,size:e.size>-1?e.size%Tn:0}}function d5(e){let t="";for(let n of new Uint8Array(e))n<16&&(t+="0"),t+=n.toString(16);return t}var xf=null;async function Un(e){return xf===null&&(xf=await m5()),xf?C1(e):p5(e)}function p5(e){return new Gf.default().update(e).digest("hex")}async function C1(e){let t=await crypto.subtle.digest("SHA-1",e);return d5(t)}async function m5(){try{if(await C1(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709")return!0}catch(e){}return!1}function g5(e){return{assumeValid:!!(e&32768),extended:!!(e&16384),stage:(e&12288)>>12,nameLength:e&4095}}function y5(e){let t=e.flags;return t.extended=!1,t.nameLength=Math.min(Buffer.from(e.path).length,4095),(t.assumeValid?32768:0)+(t.extended?16384:0)+((t.stage&3)<<12)+(t.nameLength&4095)}var Mf=class e{constructor(t,n){this._dirty=!1,this._unmergedPaths=n||new Set,this._entries=t||new Map}_addEntry(t){if(t.flags.stage===0)t.stages=[t],this._entries.set(t.path,t),this._unmergedPaths.delete(t.path);else{let n=this._entries.get(t.path);n||(this._entries.set(t.path,t),n=t),n.stages[t.flags.stage]=t,this._unmergedPaths.add(t.path)}}static async from(t){if(Buffer.isBuffer(t))return e.fromBuffer(t);if(t===null)return new e(null);throw new ue("invalid type passed to GitIndex.from")}static async fromBuffer(t){if(t.length===0)throw new ue("Index file is empty (.git/index)");let n=new e,r=new en(t),i=r.toString("utf8",4);if(i!=="DIRC")throw new ue(`Invalid dircache magic file number: ${i}`);let a=await Un(t.slice(0,-20)),s=t.slice(-20).toString("hex");if(s!==a)throw new ue(`Invalid checksum in GitIndex buffer: expected ${s} but saw ${a}`);let o=r.readUInt32BE();if(o!==2)throw new ue(`Unsupported dircache version: ${o}`);let l=r.readUInt32BE(),c=0;for(;!r.eof()&&ct.stages.length>1?t.stages.filter(n=>n):t)}*[Symbol.iterator](){for(let t of this.entries)yield t}insert({filepath:t,stats:n,oid:r,stage:i=0}){n||(n={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),n=Ai(n);let a=Buffer.from(t),s={ctimeSeconds:n.ctimeSeconds,ctimeNanoseconds:n.ctimeNanoseconds,mtimeSeconds:n.mtimeSeconds,mtimeNanoseconds:n.mtimeNanoseconds,dev:n.dev,ino:n.ino,mode:n.mode||33188,uid:n.uid,gid:n.gid,size:n.size,path:t,oid:r,flags:{assumeValid:!1,extended:!1,stage:i,nameLength:a.length<4095?a.length:4095},stages:[]};this._addEntry(s),this._dirty=!0}delete({filepath:t}){if(this._entries.has(t))this._entries.delete(t);else for(let n of this._entries.keys())n.startsWith(t+"/")&&this._entries.delete(n);this._unmergedPaths.has(t)&&this._unmergedPaths.delete(t),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:t}){return this._entries.has(t)}render(){return this.entries.map(t=>`${t.mode.toString(8)} ${t.oid} ${t.path}`).join(` +`)}static async _entryToBuffer(t){let n=Buffer.from(t.path),r=Math.ceil((62+n.length+1)/8)*8,i=Buffer.alloc(r),a=new en(i),s=Ai(t);return a.writeUInt32BE(s.ctimeSeconds),a.writeUInt32BE(s.ctimeNanoseconds),a.writeUInt32BE(s.mtimeSeconds),a.writeUInt32BE(s.mtimeNanoseconds),a.writeUInt32BE(s.dev),a.writeUInt32BE(s.ino),a.writeUInt32BE(s.mode),a.writeUInt32BE(s.uid),a.writeUInt32BE(s.gid),a.writeUInt32BE(s.size),a.write(t.oid,20,"hex"),a.writeUInt16BE(y5(t)),a.write(t.path,n.length,"utf8"),i}async toObject(){let t=Buffer.alloc(12),n=new en(t);n.write("DIRC",4,"utf8"),n.writeUInt32BE(2),n.writeUInt32BE(this.entriesFlat.length);let r=[];for(let o of this.entries)if(r.push(e._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&r.push(e._entryToBuffer(l));r=await Promise.all(r);let i=Buffer.concat(r),a=Buffer.concat([t,i]),s=await Un(a);return Buffer.concat([a,Buffer.from(s,"hex")])}};function Do(e,t,n=!0,r=!0){let i=Ai(e),a=Ai(t);return n&&i.mode!==a.mode||i.mtimeSeconds!==a.mtimeSeconds||i.ctimeSeconds!==a.ctimeSeconds||i.uid!==a.uid||i.gid!==a.gid||r&&i.ino!==a.ino||i.size!==a.size}var _f=null,_i=Symbol("IndexCache");function v5(){return{map:new Map,stats:new Map}}async function w5(e,t,n){let r=await e.lstat(t),i=await e.read(t),a=await Mf.from(i);n.map.set(t,a),n.stats.set(t,r)}async function b5(e,t,n){let r=n.stats.get(t);if(r===void 0)return!0;let i=await e.lstat(t);return r===null||i===null?!1:Do(r,i)}var ct=class{static async acquire({fs:t,gitdir:n,cache:r,allowUnmerged:i=!0},a){r[_i]||(r[_i]=v5());let s=`${n}/index`;_f===null&&(_f=new Za.default({maxPending:1/0}));let o,l=[];return await _f.acquire(s,async()=>{await b5(t,s,r[_i])&&await w5(t,s,r[_i]);let c=r[_i].map.get(s);if(l=c.unmergedPaths,l.length&&!i)throw new Ka(l);if(o=await a(c),c._dirty){let u=await c.toObject();await t.write(s,u),r[_i].stats.set(s,await t.lstat(s)),c._dirty=!1}}),o}};function Bo(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>-1&&(e=e.slice(t+1)),e}function ki(e){let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?".":t===0?"/":e.slice(0,t)}function F1(e){let t=new Map,n=function(i){if(!t.has(i)){let a={type:"tree",fullpath:i,basename:Bo(i),metadata:{},children:[]};t.set(i,a),a.parent=n(ki(i)),a.parent&&a.parent!==a&&a.parent.children.push(a)}return t.get(i)},r=function(i,a){if(!t.has(i)){let s={type:"blob",fullpath:i,basename:Bo(i),metadata:a,parent:n(ki(i)),children:[]};s.parent&&s.parent.children.push(s),t.set(i,s)}return t.get(i)};n(".");for(let i of e)r(i.path,i);return t}function x5(e){switch(e){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new ue(`Unexpected GitTree entry mode: ${e.toString(8)}`)}var Of=class{constructor({fs:t,gitdir:n,cache:r}){this.treePromise=ct.acquire({fs:t,gitdir:n,cache:r},async function(a){return F1(a.entries)});let i=this;this.ConstructEntry=class{constructor(s){this._fullpath=s,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return i.type(this)}async mode(){return i.mode(this)}async stat(){return i.stat(this)}async content(){return i.content(this)}async oid(){return i.oid(this)}}}async readdir(t){let n=t._fullpath,i=(await this.treePromise).get(n);if(!i||i.type==="blob")return null;if(i.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${n}'`);let a=i.children.map(s=>s.fullpath);return a.sort(Xo),a}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){let r=(await this.treePromise).get(t._fullpath);if(!r)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let i=r.type==="tree"?{}:Ai(r.metadata);t._type=r.type==="tree"?"tree":x5(i.mode),t._mode=i.mode,r.type==="tree"?t._stat=void 0:t._stat=i}return t._stat}async content(t){}async oid(t){if(t._oid===!1){let r=(await this.treePromise).get(t._fullpath);t._oid=r.metadata.oid}return t._oid}},Yo=Symbol("GitWalkSymbol");function Zo(){let e=Object.create(null);return Object.defineProperty(e,Yo,{value:function({fs:t,gitdir:n,cache:r}){return new Of({fs:t,gitdir:n,cache:r})}}),Object.freeze(e),e}var Re=class e extends ge{constructor(t){super(`Could not find ${t}.`),this.code=this.name=e.code,this.data={what:t}}};Re.code="NotFoundError";var At=class e extends ge{constructor(t,n,r,i){super(`Object ${t} ${i?`at ${i}`:""}was anticipated to be a ${r} but it is a ${n}.`),this.code=this.name=e.code,this.data={oid:t,actual:n,expected:r,filepath:i}}};At.code="ObjectTypeError";var cr=class e extends ge{constructor(t){super(`Expected a 40-char hex object id but saw "${t}".`),this.code=this.name=e.code,this.data={value:t}}};cr.code="InvalidOidError";var Ja=class e extends ge{constructor(t){super(`Could not find a fetch refspec for remote "${t}". Make sure the config file has an entry like the following: +[remote "${t}"] + fetch = +refs/heads/*:refs/remotes/origin/* +`),this.code=this.name=e.code,this.data={remote:t}}};Ja.code="NoRefspecError";var No=class e{constructor(t){if(this.refs=new Map,this.parsedConfig=[],t){let n=null;this.parsedConfig=t.trim().split(` +`).map(r=>{if(/^\s*#/.test(r))return{line:r,comment:!0};let i=r.indexOf(" ");if(r.startsWith("^")){let a=r.slice(1);return this.refs.set(n+"^{}",a),{line:r,ref:n,peeled:a}}else{let a=r.slice(0,i);return n=r.slice(i+1),this.refs.set(n,a),{line:r,ref:n,oid:a}}})}return this}static from(t){return new e(t)}delete(t){this.parsedConfig=this.parsedConfig.filter(n=>n.ref!==t),this.refs.delete(t)}toString(){return this.parsedConfig.map(({line:t})=>t).join(` +`)+` +`}},$o=class e{constructor({remotePath:t,localPath:n,force:r,matchPrefix:i}){Object.assign(this,{remotePath:t,localPath:n,force:r,matchPrefix:i})}static from(t){let[n,r,i,a,s]=t.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=n==="+",l=i==="*";if(l!==(s==="*"))throw new ue("Invalid refspec");return new e({remotePath:r,localPath:a,force:o,matchPrefix:l})}translate(t){if(this.matchPrefix){if(t.startsWith(this.remotePath))return this.localPath+t.replace(this.remotePath,"")}else if(t===this.remotePath)return this.localPath;return null}reverseTranslate(t){if(this.matchPrefix){if(t.startsWith(this.localPath))return this.remotePath+t.replace(this.localPath,"")}else if(t===this.localPath)return this.remotePath;return null}},If=class e{constructor(t=[]){this.rules=t}static from(t){let n=[];for(let r of t)n.push($o.from(r));return new e(n)}add(t){let n=$o.from(t);this.rules.push(n)}translate(t){let n=[];for(let r of this.rules)for(let i of t){let a=r.translate(i);a&&n.push([i,a])}return n}translateOne(t){let n=null;for(let r of this.rules){let i=r.translate(t);i&&(n=i)}return n}localNamespaces(){return this.rules.filter(t=>t.matchPrefix).map(t=>t.localPath.replace(/\/$/,""))}};function _5(e,t){let n=e.replace(/\^\{\}$/,""),r=t.replace(/\^\{\}$/,""),i=-(nr);return i===0?e.endsWith("^{}")?1:-1:i}var n1=new Map;function r1(e){let t=n1.get(e);return t||(t=S5(e),n1.set(e,t)),t}function S5(e){return e=e.split("/./").join("/").replace(/\/{2,}/g,"/"),e==="/."?"/":e==="./"||(e.startsWith("./")&&(e=e.slice(2)),e.endsWith("/.")&&(e=e.slice(0,-2)),e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e==="")?".":e}function B(...e){return r1(e.map(r1).join("/"))}var E5=e=>{e=e.toLowerCase();let t=parseInt(e);return e.endsWith("k")&&(t*=1024),e.endsWith("m")&&(t*=1024*1024),e.endsWith("g")&&(t*=1024*1024*1024),t},Ya=e=>{if(e=e.trim().toLowerCase(),e==="true"||e==="yes"||e==="on")return!0;if(e==="false"||e==="no"||e==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${e}`)},i1={core:{filemode:Ya,bare:Ya,logallrefupdates:Ya,symlinks:Ya,ignorecase:Ya,bigFileThreshold:E5}},A5=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,k5=/^[A-Za-z0-9-.]+$/,T5=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,C5=/^[A-Za-z][A-Za-z-]*$/,F5=/^(.*?)( *[#;].*)$/,P5=e=>{let t=A5.exec(e);if(t!=null){let[n,r]=t.slice(1);return[n,r]}return null},M5=e=>{let t=T5.exec(e);if(t!=null){let[n,r="true"]=t.slice(1),i=O5(r),a=I5(i);return[n,a]}return null},O5=e=>{let t=F5.exec(e);if(t==null)return e;let[n,r]=t.slice(1);return a1(n)&&a1(r)?`${n}${r}`:n},a1=e=>(e.match(/(?:^|[^\\])"/g)||[]).length%2!==0,I5=e=>e.split("").reduce((t,n,r,i)=>{let a=n==='"'&&i[r-1]!=="\\",s=n==="\\"&&i[r+1]==='"';return a||s?t:t+n},""),s1=e=>e!=null?e.toLowerCase():null,Rf=(e,t,n)=>[s1(e),t,s1(n)].filter(r=>r!=null).join("."),o1=e=>{let t=e.split("."),n=t.shift(),r=t.pop(),i=t.length?t.join("."):void 0;return{section:n,subsection:i,name:r,path:Rf(n,i,r),sectionPath:Rf(n,i,null)}},R5=(e,t)=>e.reduce((n,r,i)=>t(r)?i:n,-1),Lf=class e{constructor(t){let n=null,r=null;this.parsedConfig=t?t.split(` +`).map(i=>{let a=null,s=null,o=i.trim(),l=P5(o),c=l!=null;if(c)[n,r]=l;else{let f=M5(o);f!=null&&([a,s]=f)}let u=Rf(n,r,a);return{line:i,isSection:c,section:n,subsection:r,name:a,value:s,path:u}}):[]}static from(t){return new e(t)}async get(t,n=!1){let r=o1(t).path,i=this.parsedConfig.filter(a=>a.path===r).map(({section:a,name:s,value:o})=>{let l=i1[a]&&i1[a][s];return l?l(o):o});return n?i:i.pop()}async getall(t){return this.get(t,!0)}async getSubsections(t){return this.parsedConfig.filter(n=>n.section===t&&n.isSection).map(n=>n.subsection)}async deleteSection(t,n){this.parsedConfig=this.parsedConfig.filter(r=>!(r.section===t&&r.subsection===n))}async append(t,n){return this.set(t,n,!0)}async set(t,n,r=!1){let{section:i,subsection:a,name:s,path:o,sectionPath:l}=o1(t),c=R5(this.parsedConfig,u=>u.path===o);if(n==null)c!==-1&&this.parsedConfig.splice(c,1);else if(c!==-1){let u=this.parsedConfig[c],f=Object.assign({},u,{name:s,value:n,modified:!0});r?this.parsedConfig.splice(c+1,0,f):this.parsedConfig[c]=f}else{let u=this.parsedConfig.findIndex(h=>h.path===l),f={section:i,subsection:a,name:s,value:n,modified:!0,path:o};if(k5.test(i)&&C5.test(s))if(u>=0)this.parsedConfig.splice(u+1,0,f);else{let h={section:i,subsection:a,modified:!0,path:l};this.parsedConfig.push(h,f)}}}toString(){return this.parsedConfig.map(({line:t,section:n,subsection:r,name:i,value:a,modified:s=!1})=>s?i!=null&&a!=null?typeof a=="string"&&/[#;]/.test(a)?` ${i} = "${a}"`:` ${i} = ${a}`:r!=null?`[${n} "${r}"]`:`[${n}]`:t).join(` +`)}},Ve=class{static async get({fs:t,gitdir:n}){let r=await t.read(`${n}/config`,{encoding:"utf8"});return Lf.from(r)}static async save({fs:t,gitdir:n,config:r}){await t.write(`${n}/config`,r.toString(),{encoding:"utf8"})}},Ro=e=>[`${e}`,`refs/${e}`,`refs/tags/${e}`,`refs/heads/${e}`,`refs/remotes/${e}`,`refs/remotes/${e}/HEAD`],L5=["config","description","index","shallow","commondir"],Sf;async function sr(e,t){return Sf===void 0&&(Sf=new Za.default),Sf.acquire(e,t)}var q=class e{static async updateRemoteRefs({fs:t,gitdir:n,remote:r,refs:i,symrefs:a,tags:s,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let m of i.values())if(!m.match(/[0-9a-f]{40}/))throw new cr(m);let u=await Ve.get({fs:t,gitdir:n});if(!o){if(o=await u.getall(`remote.${r}.fetch`),o.length===0)throw new Ja(r);o.unshift(`+HEAD:refs/remotes/${r}/HEAD`)}let f=If.from(o),h=new Map;if(c){let m=await e.listRefs({fs:t,gitdir:n,filepath:"refs/tags"});await e.deleteRefs({fs:t,gitdir:n,refs:m.map(w=>`refs/tags/${w}`)})}if(s){for(let m of i.keys())if(m.startsWith("refs/tags")&&!m.endsWith("^{}")&&!await e.exists({fs:t,gitdir:n,ref:m})){let w=i.get(m);h.set(m,w)}}let d=f.translate([...i.keys()]);for(let[m,w]of d){let b=i.get(m);h.set(w,b)}let p=f.translate([...a.keys()]);for(let[m,w]of p){let b=a.get(m),S=f.translateOne(b);S&&h.set(w,`ref: ${S}`)}let g=[];if(l){for(let m of f.localNamespaces()){let w=(await e.listRefs({fs:t,gitdir:n,filepath:m})).map(b=>`${m}/${b}`);for(let b of w)h.has(b)||g.push(b)}g.length>0&&await e.deleteRefs({fs:t,gitdir:n,refs:g})}for(let[m,w]of h)await sr(m,async()=>t.write(B(n,m),`${w.trim()} +`,"utf8"));return{pruned:g}}static async writeRef({fs:t,gitdir:n,ref:r,value:i}){if(!i.match(/[0-9a-f]{40}/))throw new cr(i);await sr(r,async()=>t.write(B(n,r),`${i.trim()} +`,"utf8"))}static async writeSymbolicRef({fs:t,gitdir:n,ref:r,value:i}){await sr(r,async()=>t.write(B(n,r),`ref: ${i.trim()} +`,"utf8"))}static async deleteRef({fs:t,gitdir:n,ref:r}){return e.deleteRefs({fs:t,gitdir:n,refs:[r]})}static async deleteRefs({fs:t,gitdir:n,refs:r}){await Promise.all(r.map(o=>t.rm(B(n,o))));let i=await sr("packed-refs",async()=>t.read(`${n}/packed-refs`,{encoding:"utf8"})),a=No.from(i),s=a.refs.size;for(let o of r)a.refs.has(o)&&a.delete(o);a.refs.sizet.write(`${n}/packed-refs`,i,{encoding:"utf8"})))}static async resolve({fs:t,gitdir:n,ref:r,depth:i=void 0}){if(i!==void 0&&(i--,i===-1))return r;if(r.startsWith("ref: "))return r=r.slice(5),e.resolve({fs:t,gitdir:n,ref:r,depth:i});if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let a=await e.packedRefs({fs:t,gitdir:n}),s=Ro(r).filter(o=>!L5.includes(o));for(let o of s){let l=await sr(o,async()=>await t.read(`${n}/${o}`,{encoding:"utf8"})||a.get(o));if(l)return e.resolve({fs:t,gitdir:n,ref:l.trim(),depth:i})}throw new Re(r)}static async exists({fs:t,gitdir:n,ref:r}){try{return await e.expand({fs:t,gitdir:n,ref:r}),!0}catch(i){return!1}}static async expand({fs:t,gitdir:n,ref:r}){if(r.length===40&&/[0-9a-f]{40}/.test(r))return r;let i=await e.packedRefs({fs:t,gitdir:n}),a=Ro(r);for(let s of a)if(await sr(s,async()=>t.exists(`${n}/${s}`))||i.has(s))return s;throw new Re(r)}static async expandAgainstMap({ref:t,map:n}){let r=Ro(t);for(let i of r)if(await n.has(i))return i;throw new Re(t)}static resolveAgainstMap({ref:t,fullref:n=t,depth:r=void 0,map:i}){if(r!==void 0&&(r--,r===-1))return{fullref:n,oid:t};if(t.startsWith("ref: "))return t=t.slice(5),e.resolveAgainstMap({ref:t,fullref:n,depth:r,map:i});if(t.length===40&&/[0-9a-f]{40}/.test(t))return{fullref:n,oid:t};let a=Ro(t);for(let s of a){let o=i.get(s);if(o)return e.resolveAgainstMap({ref:o.trim(),fullref:s,depth:r,map:i})}throw new Re(t)}static async packedRefs({fs:t,gitdir:n}){let r=await sr("packed-refs",async()=>t.read(`${n}/packed-refs`,{encoding:"utf8"}));return No.from(r).refs}static async listRefs({fs:t,gitdir:n,filepath:r}){let i=e.packedRefs({fs:t,gitdir:n}),a=null;try{a=await t.readdirDeep(`${n}/${r}`),a=a.map(s=>s.replace(`${n}/${r}/`,""))}catch(s){a=[]}for(let s of(await i).keys())s.startsWith(r)&&(s=s.replace(r+"/",""),a.includes(s)||a.push(s));return a.sort(_5),a}static async listBranches({fs:t,gitdir:n,remote:r}){return r?e.listRefs({fs:t,gitdir:n,filepath:`refs/remotes/${r}`}):e.listRefs({fs:t,gitdir:n,filepath:"refs/heads"})}static async listTags({fs:t,gitdir:n}){return(await e.listRefs({fs:t,gitdir:n,filepath:"refs/tags"})).filter(i=>!i.endsWith("^{}"))}};function j5(e,t){return Xo(l1(e),l1(t))}function l1(e){return e.mode==="040000"?e.path+"/":e.path}function P1(e){switch(e){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new ue(`Unexpected GitTree entry mode: ${e}`)}function D5(e){let t=[],n=0;for(;n`${t.mode} ${t.type} ${t.oid} ${t.path}`).join(` +`)}toObject(){let t=[...this._entries];return t.sort(j5),Buffer.concat(t.map(n=>{let r=Buffer.from(n.mode.replace(/^0/,"")),i=Buffer.from(" "),a=Buffer.from(n.path,"utf8"),s=Buffer.from([0]),o=Buffer.from(n.oid,"hex");return Buffer.concat([r,i,a,s,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let t of this._entries)yield t}},ur=class{static wrap({type:t,object:n}){return Buffer.concat([Buffer.from(`${t} ${n.byteLength.toString()}\0`),Buffer.from(n)])}static unwrap(t){let n=t.indexOf(32),r=t.indexOf(0),i=t.slice(0,n).toString("utf8"),a=t.slice(n+1,r).toString("utf8"),s=t.length-(r+1);if(parseInt(a)!==s)throw new ue(`Length mismatch: expected ${a} bytes but got ${s} instead.`);return{type:i,object:Buffer.from(t.slice(r+1))}}};async function $5({fs:e,gitdir:t,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`,i=await e.read(`${t}/${r}`);return i?{object:i,format:"deflated",source:r}:null}function H5(e,t){let n=new en(e),r=c1(n);if(r!==t.byteLength)throw new ue(`applyDelta expected source buffer to be ${r} bytes but the provided buffer was ${t.length} bytes`);let i=c1(n),a,s=f1(n,t);if(s.byteLength===i)a=s;else{a=Buffer.alloc(i);let o=new en(a);for(o.copy(s);!n.eof();)o.copy(f1(n,t));let l=o.tell();if(i!==l)throw new ue(`applyDelta expected target buffer to be ${i} bytes but the resulting buffer was ${l} bytes`)}return a}function c1(e){let t=0,n=0,r=null;do r=e.readUInt8(),t|=(r&127)<>=1,i+=8;return r}function f1(e,t){let n=e.readUInt8(),r=128,i=15,a=112;if(n&r){let s=u1(e,n&i,4),o=u1(e,(n&a)>>4,3);return o===0&&(o=65536),t.slice(s,s+o)}else return e.slice(n)}function U5(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function M1(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:U5(e)}var Ho=class{constructor(t){if(typeof Buffer=="undefined")throw new Error("Missing Buffer dependency");this.stream=M1(t),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(t){if(!this.eof())return this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t),this.buffer.slice(this.undoCursor,this.cursor)}async skip(t){this.eof()||(this.started||await this._init(),this.cursor+t>this.buffer.length&&(this._trim(),await this._accumulate(t)),this._moveCursor(t))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:t,value:n}=await this.stream.next();return t&&(this._ended=!0,!n)?Buffer.alloc(0):(n&&(n=Buffer.from(n)),n)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(t){this.undoCursor=this.cursor,this.cursor+=t,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(t){if(this._ended)return;let n=[this.buffer];for(;this.cursor+t>G5(n);){let r=await this._next();if(this._ended)break;n.push(r)}this.buffer=Buffer.concat(n)}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 G5(e){return e.reduce((t,n)=>t+n.length,0)}async function z5(e,t){let n=new Ho(e),r=await n.read(4);if(r=r.toString("utf8"),r!=="PACK")throw new ue(`Invalid PACK header '${r}'`);let i=await n.read(4);if(i=i.readUInt32BE(0),i!==2)throw new ue(`Invalid packfile version: ${i}`);let a=await n.read(4);if(a=a.readUInt32BE(0),!(a<1))for(;!n.eof()&&a--;){let s=n.tell(),{type:o,length:l,ofs:c,reference:u}=await V5(n),f=new qo.default.Inflate;for(;!f.result;){let h=await n.chunk();if(!h)break;if(f.push(h,!1),f.err)throw new ue(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new ue("Inflated object size is different from that stated in packfile.");await n.undo(),await n.read(h.length-f.strm.avail_in);let d=n.tell();await t({data:f.result,type:o,num:a,offset:s,end:d,reference:u,ofs:c})}}}}async function V5(e){let t=await e.byte(),n=t>>4&7,r=t&15;if(t&128){let s=4;do t=await e.byte(),r|=(t&127)<i+1<<7|a,-1)}function Y5(e,t){let n=t,r=4,i=null;do i=e.readUInt8(),n|=(i&127)<2048*1024*1024)throw new ue("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");r.seek(r.tell()+4*255);let s=r.readUInt32BE(),o=[];for(let u=0;u{u===null&&(u=A);let x=Math.floor((u-A)*100/u);x!==f&&r&&await r({phase:"Receiving objects",loaded:u-A,total:u}),f=x,w=i[w],["commit","tree","blob","tag"].includes(w)?a[S]={type:w,offset:S}:w==="ofs-delta"?a[S]={type:w,offset:S}:w==="ref-delta"&&(a[S]={type:w,offset:S})});let h=Object.keys(a).map(Number);for(let[m,w]of h.entries()){let b=m+1===h.length?t.byteLength-20:h[m+1],S=a[w],A=S1.default.buf(t.slice(w,b))>>>0;S.end=b,S.crc=A}let d=new e({pack:Promise.resolve(t),packfileSha:s,crcs:l,hashes:o,offsets:c,getExternalRefDelta:n});f=null;let p=0,g=[0,0,0,0,0,0,0,0,0,0,0,0];for(let m in a){m=Number(m);let w=Math.floor(p*100/u);w!==f&&r&&await r({phase:"Resolving deltas",loaded:p,total:u}),p++,f=w;let b=a[m];if(!b.oid)try{d.readDepth=0,d.externalReadDepth=0;let{type:S,object:A}=await d.readSlice({start:m});g[d.readDepth]+=1;let x=await Un(ur.wrap({type:S,object:A}));b.oid=x,o.push(x),c.set(x,m),l[x]=b.crc}catch(S){continue}}return o.sort(),d}async toBuffer(){let t=[],n=(c,u)=>{t.push(Buffer.from(c,u))};n("ff744f63","hex"),n("00000002","hex");let r=new en(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++;r.writeUInt32BE(u)}t.push(r.buffer);for(let c of this.hashes)n(c,"hex");let i=new en(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)i.writeUInt32BE(this.crcs[c]);t.push(i.buffer);let a=new en(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)a.writeUInt32BE(this.offsets.get(c));t.push(a.buffer),n(this.packfileSha,"hex");let s=Buffer.concat(t),o=await Un(s),l=Buffer.alloc(20);return l.write(o,"hex"),Buffer.concat([s,l])}async load({pack:t}){this.pack=t}async unload(){this.pack=null}async read({oid:t}){if(!this.offsets.get(t)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(t);throw new ue(`Could not read object ${t} from packfile`)}let n=this.offsets.get(t);return this.readSlice({start:n})}async readSlice({start:t}){if(this.offsetCache[t])return Object.assign({},this.offsetCache[t]);this.readDepth++;let n={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new ue("Tried to read from a GitPackIndex with no packfile loaded into memory");let r=(await this.pack).slice(t),i=new en(r),a=i.readUInt8(),s=a&112,o=n[s];if(o===void 0)throw new ue("Unrecognized type: 0b"+s.toString(2));let l=a&15,c=l;a&128&&(c=Y5(i,l));let f=null,h=null;if(o==="ofs_delta"){let p=X5(i),g=t-p;({object:f,type:o}=await this.readSlice({start:g}))}if(o==="ref_delta"){let p=i.slice(20).toString("hex");({object:f,type:o}=await this.read({oid:p}))}let d=r.slice(i.tell());if(h=Buffer.from(await O1(d)),h.byteLength!==c)throw new ue(`Packfile told us object would have length ${c} but it had length ${h.byteLength}`);return f&&(h=Buffer.from(H5(h,f))),this.readDepth>3&&(this.offsetCache[t]={type:o,object:h}),{type:o,format:"content",object:h}}},Lo=Symbol("PackfileCache");async function Z5({fs:e,filename:t,getExternalRefDelta:n,emitter:r,emitterPrefix:i}){let a=await e.read(t);return Qa.fromIdx({idx:a,getExternalRefDelta:n})}function zf({fs:e,cache:t,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}){t[Lo]||(t[Lo]=new Map);let s=t[Lo].get(n);return s||(s=Z5({fs:e,filename:n,getExternalRefDelta:r,emitter:i,emitterPrefix:a}),t[Lo].set(n,s)),s}async function K5({fs:e,cache:t,gitdir:n,oid:r,format:i="content",getExternalRefDelta:a}){let s=await e.readdir(B(n,"objects/pack"));s=s.filter(o=>o.endsWith(".idx"));for(let o of s){let l=`${n}/objects/pack/${o}`,c=await zf({fs:e,cache:t,filename:l,getExternalRefDelta:a});if(c.error)throw new ue(c.error);if(c.offsets.has(r)){if(!c.pack){let f=l.replace(/idx$/,"pack");c.pack=e.read(f)}let u=await c.read({oid:r,getExternalRefDelta:a});return u.format="content",u.source=`objects/pack/${o.replace(/idx$/,"pack")}`,u}}return null}async function We({fs:e,cache:t,gitdir:n,oid:r,format:i="content"}){let a=u=>We({fs:e,cache:t,gitdir:n,oid:u}),s;if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await $5({fs:e,gitdir:n,oid:r})),!s){if(s=await K5({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:a}),!s)throw new Re(r);return s}if(i==="deflated"||(s.format==="deflated"&&(s.object=Buffer.from(await O1(s.object)),s.format="wrapped"),i==="wrapped"))return s;let o=await Un(s.object);if(o!==r)throw new ue(`SHA check failed! Expected ${r}, computed ${o}`);let{object:l,type:c}=ur.unwrap(s.object);if(s.type=c,s.object=l,s.format="content",i==="content")return s;throw new ue(`invalid requested format "${i}"`)}var hn=class e extends ge{constructor(t,n,r=!0){super(`Failed to create ${t} at ${n} because it already exists.${r?` (Hint: use 'force: true' parameter to overwrite existing ${t}.)`:""}`),this.code=this.name=e.code,this.data={noun:t,where:n,canForce:r}}};hn.code="AlreadyExistsError";var es=class e extends ge{constructor(t,n,r){super(`Found multiple ${t} matching "${n}" (${r.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=e.code,this.data={nouns:t,short:n,matches:r}}};es.code="AmbiguousError";var ts=class e extends ge{constructor(t){super(`Your local changes to the following files would be overwritten by checkout: ${t.join(", ")}`),this.code=this.name=e.code,this.data={filepaths:t}}};ts.code="CheckoutConflictError";var ns=class e extends ge{constructor(t,n){super(`Failed to checkout "${t}" because commit ${n} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=e.code,this.data={ref:t,oid:n}}};ns.code="CommitNotFetchedError";var rs=class e extends ge{constructor(){super("Empty response from git server."),this.code=this.name=e.code,this.data={}}};rs.code="EmptyServerResponseError";var is=class e extends ge{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=e.code,this.data={}}};is.code="FastForwardError";var as=class e extends ge{constructor(t,n){super(`One or more branches were not updated: ${t}`),this.code=this.name=e.code,this.data={prettyDetails:t,result:n}}};as.code="GitPushError";var Ti=class e extends ge{constructor(t,n,r){super(`HTTP Error: ${t} ${n}`),this.code=this.name=e.code,this.data={statusCode:t,statusMessage:n,response:r}}};Ti.code="HttpError";var fr=class e extends ge{constructor(t){let n="invalid filepath";t==="leading-slash"||t==="trailing-slash"?n='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':t==="directory"&&(n='"filepath" should not be a directory.'),super(n),this.code=this.name=e.code,this.data={reason:t}}};fr.code="InvalidFilepathError";var Gn=class e extends ge{constructor(t,n){super(`"${t}" would be an invalid git reference. (Hint: a valid alternative would be "${n}".)`),this.code=this.name=e.code,this.data={ref:t,suggestion:n}}};Gn.code="InvalidRefNameError";var ss=class e extends ge{constructor(t){super(`Maximum search depth of ${t} exceeded.`),this.code=this.name=e.code,this.data={depth:t}}};ss.code="MaxDepthError";var Ci=class e extends ge{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=e.code,this.data={}}};Ci.code="MergeNotSupportedError";var Fi=class e extends ge{constructor(t,n,r,i){super(`Automatic merge failed with one or more merge conflicts in the following files: ${t.toString()}. Fix conflicts then commit the result.`),this.code=this.name=e.code,this.data={filepaths:t,bothModified:n,deleteByUs:r,deleteByTheirs:i}}};Fi.code="MergeConflictError";var kt=class e extends ge{constructor(t){super(`No name was provided for ${t} in the argument or in the .git/config file.`),this.code=this.name=e.code,this.data={role:t}}};kt.code="MissingNameError";var Ot=class e extends ge{constructor(t){super(`The function requires a "${t}" parameter but none was provided.`),this.code=this.name=e.code,this.data={parameter:t}}};Ot.code="MissingParameterError";var os=class e extends ge{constructor(t){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=e.code,this.data={errors:t},this.errors=t}};os.code="MultipleGitError";var Ur=class e extends ge{constructor(t,n){super(`Expected "${t}" but received "${n}".`),this.code=this.name=e.code,this.data={expected:t,actual:n}}};Ur.code="ParseError";var Pi=class e extends ge{constructor(t){let n="";t==="not-fast-forward"?n=" because it was not a simple fast-forward":t==="tag-exists"&&(n=" because tag already exists"),super(`Push rejected${n}. Use "force: true" to override.`),this.code=this.name=e.code,this.data={reason:t}}};Pi.code="PushRejectedError";var or=class e extends ge{constructor(t,n){super(`Remote does not support the "${t}" so the "${n}" parameter cannot be used.`),this.code=this.name=e.code,this.data={capability:t,parameter:n}}};or.code="RemoteCapabilityError";var ls=class e extends ge{constructor(t,n){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${t}`),this.code=this.name=e.code,this.data={preview:t,response:n}}};ls.code="SmartHttpError";var cs=class e extends ge{constructor(t,n,r){super(`Git remote "${t}" uses an unrecognized transport protocol: "${n}"`),this.code=this.name=e.code,this.data={url:t,transport:n,suggestion:r}}};cs.code="UnknownTransportError";var us=class e extends ge{constructor(t){super(`Cannot parse remote URL: "${t}"`),this.code=this.name=e.code,this.data={url:t}}};us.code="UrlParseError";var Mi=class e extends ge{constructor(){super("The operation was canceled."),this.code=this.name=e.code,this.data={}}};Mi.code="UserCanceledError";var fs=class e extends ge{constructor(t){super(`Could not merge index: Entry for '${t}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=e.code,this.data={filepath:t}}};fs.code="IndexResetError";var hs=class e extends ge{constructor(t){super(`"${t}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=e.code,this.data={ref:t}}};hs.code="NoCommitError";var ps=Object.freeze({__proto__:null,AlreadyExistsError:hn,AmbiguousError:es,CheckoutConflictError:ts,CommitNotFetchedError:ns,EmptyServerResponseError:rs,FastForwardError:is,GitPushError:as,HttpError:Ti,InternalError:ue,InvalidFilepathError:fr,InvalidOidError:cr,InvalidRefNameError:Gn,MaxDepthError:ss,MergeNotSupportedError:Ci,MergeConflictError:Fi,MissingNameError:kt,MissingParameterError:Ot,MultipleGitError:os,NoRefspecError:Ja,NotFoundError:Re,ObjectTypeError:At,ParseError:Ur,PushRejectedError:Pi,RemoteCapabilityError:or,SmartHttpError:ls,UnknownTransportError:cs,UnsafeFilepathError:Ei,UrlParseError:us,UserCanceledError:Mi,UnmergedPathsError:Ka,IndexResetError:fs,NoCommitError:hs});function jf({name:e,email:t,timestamp:n,timezoneOffset:r}){return r=J5(r),`${e} <${t}> ${n} ${r}`}function J5(e){let t=Q5(eC(e));e=Math.abs(e);let n=Math.floor(e/60);e-=n*60;let r=String(n),i=String(e);return r.length<2&&(r="0"+r),i.length<2&&(i="0"+i),(t===-1?"-":"+")+r+i}function Q5(e){return Math.sign(e)||(Object.is(e,-0)?-1:1)}function eC(e){return e===0?e:-e}function Hn(e){return e=e.replace(/\r/g,""),e=e.replace(/^\n+/,""),e=e.replace(/\n+$/,"")+` +`,e}function Uo(e){let[,t,n,r,i]=e.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:t,email:n,timestamp:Number(r),timezoneOffset:tC(i)}}function tC(e){let[,t,n,r]=e.match(/(\+|-)(\d\d)(\d\d)/);return r=(t==="+"?1:-1)*(Number(n)*60+Number(r)),nC(r)}function nC(e){return e===0?e:-e}var Ut=class e{constructor(t){if(typeof t=="string")this._tag=t;else if(Buffer.isBuffer(t))this._tag=t.toString("utf8");else if(typeof t=="object")this._tag=e.render(t);else throw new ue("invalid type passed to GitAnnotatedTag constructor")}static from(t){return new e(t)}static render(t){return`object ${t.object} +type ${t.type} +tag ${t.tag} +tagger ${jf(t.tagger)} + +${t.message} +${t.gpgsig?t.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(` + +`))}message(){let t=this.withoutSignature();return t.slice(t.indexOf(` + +`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let t=this.justHeaders().split(` +`),n=[];for(let i of t)i[0]===" "?n[n.length-1]+=` +`+i.slice(1):n.push(i);let r={};for(let i of n){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(r[a])?r[a].push(s):r[a]=s}return r.tagger&&(r.tagger=Uo(r.tagger)),r.committer&&(r.committer=Uo(r.committer)),r}withoutSignature(){let t=Hn(this._tag);return t.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1?t:t.slice(0,t.lastIndexOf(` +-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1)return;let t=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return Hn(t)}payload(){return this.withoutSignature()+` +`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(t,n,r){let i=t.payload(),{signature:a}=await n({payload:i,secretKey:r});a=Hn(a);let s=i+a;return e.from(s)}};function Af(e){return e.trim().split(` +`).map(t=>" "+t).join(` +`)+` +`}function rC(e){return e.split(` +`).map(t=>t.replace(/^ /,"")).join(` +`)}var Rt=class e{constructor(t){if(typeof t=="string")this._commit=t;else if(Buffer.isBuffer(t))this._commit=t.toString("utf8");else if(typeof t=="object")this._commit=e.render(t);else throw new ue("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:t,signature:n}){let r=e.justHeaders(t),i=e.justMessage(t),a=Hn(r+` +gpgsig`+Af(n)+` +`+i);return new e(a)}static from(t){return new e(t)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return e.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(t){return Hn(t.slice(t.indexOf(` + +`)+2))}static justHeaders(t){return t.slice(0,t.indexOf(` + +`))}parseHeaders(){let t=e.justHeaders(this._commit).split(` +`),n=[];for(let i of t)i[0]===" "?n[n.length-1]+=` +`+i.slice(1):n.push(i);let r={parent:[]};for(let i of n){let a=i.slice(0,i.indexOf(" ")),s=i.slice(i.indexOf(" ")+1);Array.isArray(r[a])?r[a].push(s):r[a]=s}return r.author&&(r.author=Uo(r.author)),r.committer&&(r.committer=Uo(r.committer)),r}static renderHeaders(t){let n="";if(t.tree?n+=`tree ${t.tree} +`:n+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +`,t.parent){if(t.parent.length===void 0)throw new ue("commit 'parent' property should be an array");for(let a of t.parent)n+=`parent ${a} +`}let r=t.author;n+=`author ${jf(r)} +`;let i=t.committer||t.author;return n+=`committer ${jf(i)} +`,t.gpgsig&&(n+="gpgsig"+Af(t.gpgsig)),n}static render(t){return e.renderHeaders(t)+` +`+Hn(t.message)}render(){return this._commit}withoutSignature(){let t=Hn(this._commit);if(t.indexOf(` +gpgsig`)===-1)return t;let n=t.slice(0,t.indexOf(` +gpgsig`)),r=t.slice(t.indexOf(`-----END PGP SIGNATURE----- +`)+28);return Hn(n+` +`+r)}isolateSignature(){let t=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return rC(t)}static async sign(t,n,r){let i=t.withoutSignature(),a=e.justMessage(t._commit),{signature:s}=await n({payload:i,secretKey:r});s=Hn(s);let l=e.justHeaders(t._commit)+` +gpgsig`+Af(s)+` +`+a;return e.from(l)}};async function Oi({fs:e,cache:t,gitdir:n,oid:r}){if(r==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:It.from([]),oid:r};let{type:i,object:a}=await We({fs:e,cache:t,gitdir:n,oid:r});if(i==="tag")return r=Ut.from(a).parse().object,Oi({fs:e,cache:t,gitdir:n,oid:r});if(i==="commit")return r=Rt.from(a).parse().tree,Oi({fs:e,cache:t,gitdir:n,oid:r});if(i!=="tree")throw new At(r,i,"tree");return{tree:It.from(a),oid:r}}var Df=class{constructor({fs:t,gitdir:n,ref:r,cache:i}){this.fs=t,this.cache=i,this.gitdir=n,this.mapPromise=(async()=>{let s=new Map,o;try{o=await q.resolve({fs:t,gitdir:n,ref:r})}catch(c){c instanceof Re&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Oi({fs:t,cache:this.cache,gitdir:n,oid:o});return l.type="tree",l.mode="40000",s.set(".",l),s})();let a=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){let n=t._fullpath,{fs:r,cache:i,gitdir:a}=this,s=await this.mapPromise,o=s.get(n);if(!o)throw new Error(`No obj for ${n}`);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 We({fs:r,cache:i,gitdir:a,oid:l});if(c!==o.type)throw new At(l,c,o.type);let f=It.from(u);for(let h of f)s.set(B(n,h.path),h);return f.entries().map(h=>B(n,h.path))}async type(t){if(t._type===!1){let n=await this.mapPromise,{type:r}=n.get(t._fullpath);t._type=r}return t._type}async mode(t){if(t._mode===!1){let n=await this.mapPromise,{mode:r}=n.get(t._fullpath);t._mode=T1(parseInt(r,8))}return t._mode}async stat(t){}async content(t){if(t._content===!1){let n=await this.mapPromise,{fs:r,cache:i,gitdir:a}=this,o=n.get(t._fullpath).oid,{type:l,object:c}=await We({fs:r,cache:i,gitdir:a,oid:o});l!=="blob"?t._content=void 0:t._content=new Uint8Array(c)}return t._content}async oid(t){if(t._oid===!1){let r=(await this.mapPromise).get(t._fullpath);t._oid=r.oid}return t._oid}};function lr({ref:e="HEAD"}={}){let t=Object.create(null);return Object.defineProperty(t,Yo,{value:function({fs:n,gitdir:r,cache:i}){return new Df({fs:n,gitdir:r,ref:e,cache:i})}}),Object.freeze(t),t}var Bf=class{constructor({fs:t,dir:n,gitdir:r,cache:i}){this.fs=t,this.cache=i,this.dir=n,this.gitdir=r;let a=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return a.type(this)}async mode(){return a.mode(this)}async stat(){return a.stat(this)}async content(){return a.content(this)}async oid(){return a.oid(this)}}}async readdir(t){let n=t._fullpath,{fs:r,dir:i}=this,a=await r.readdir(B(i,n));return a===null?null:a.map(s=>B(n,s))}async type(t){return t._type===!1&&await t.stat(),t._type}async mode(t){return t._mode===!1&&await t.stat(),t._mode}async stat(t){if(t._stat===!1){let{fs:n,dir:r}=this,i=await n.lstat(`${r}/${t._fullpath}`);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${t._fullpath}'`);let a=i.isDirectory()?"tree":"blob";a==="blob"&&!i.isFile()&&!i.isSymbolicLink()&&(a="special"),t._type=a,i=Ai(i),t._mode=i.mode,i.size===-1&&t._actualSize&&(i.size=t._actualSize),t._stat=i}return t._stat}async content(t){if(t._content===!1){let{fs:n,dir:r,gitdir:i}=this;if(await t.type()==="tree")t._content=void 0;else{let s=await(await Ve.get({fs:n,gitdir:i})).get("core.autocrlf"),o=await n.read(`${r}/${t._fullpath}`,{autocrlf:s});t._actualSize=o.length,t._stat&&t._stat.size===-1&&(t._stat.size=t._actualSize),t._content=new Uint8Array(o)}}return t._content}async oid(t){if(t._oid===!1){let{fs:n,gitdir:r,cache:i}=this,a;await ct.acquire({fs:n,gitdir:r,cache:i},async function(s){let o=s.entriesMap.get(t._fullpath),l=await t.stat(),u=await(await Ve.get({fs:n,gitdir:r})).get("core.filemode"),f=typeof process!="undefined"?process.platform!=="win32":!0;!o||Do(l,o,u,f)?await t.content()===void 0?a=void 0:(a=await Un(ur.wrap({type:"blob",object:await t.content()})),o&&a===o.oid&&(!u||l.mode===o.mode)&&Do(l,o,u,f)&&s.insert({filepath:t._fullpath,stats:l,oid:a})):a=o.oid}),t._oid=a}return t._oid}};function Ko(){let e=Object.create(null);return Object.defineProperty(e,Yo,{value:function({fs:t,dir:n,gitdir:r,cache:i}){return new Bf({fs:t,dir:n,gitdir:r,cache:i})}}),Object.freeze(e),e}function iC(e,t){let n=t-e;return Array.from({length:n},(r,i)=>e+i)}var I1=typeof Array.prototype.flat=="undefined"?e=>e.reduce((t,n)=>t.concat(n),[]):e=>e.flat(),Nf=class{constructor(){this.value=null}consider(t){t!=null&&(this.value===null?this.value=t:tc,reduce:s=async(l,c)=>{let u=I1(c);return l!==void 0&&u.unshift(l),u},iterate:o=(l,c)=>Promise.all([...c].map(l))}){let l=i.map(d=>d[Yo]({fs:e,dir:n,gitdir:r,cache:t})),c=new Array(l.length).fill("."),u=iC(0,l.length),f=async d=>{u.map(m=>{d[m]=d[m]&&new l[m].ConstructEntry(d[m])});let g=(await Promise.all(u.map(m=>d[m]?l[m].readdir(d[m]):[]))).map(m=>m===null?[]:m).map(m=>m[Symbol.iterator]());return{entries:d,children:aC(g)}},h=async d=>{let{entries:p,children:g}=await f(d),m=p.find(b=>b&&b._fullpath)._fullpath,w=await a(m,p);if(w!==null){let b=await o(h,g);return b=b.filter(S=>S!==void 0),s(w,b)}};return h(c)}async function $f(e,t){let n=await e.readdir(t);n==null?await e.rm(t):n.length?await Promise.all(n.map(r=>{let i=B(t,r);return e.lstat(i).then(a=>{if(a)return a.isDirectory()?$f(e,i):e.rm(i)})})).then(()=>e.rmdir(t)):await e.rmdir(t)}function sC(e){return oC(e)&&h1(e.then)&&h1(e.catch)}function oC(e){return e&&typeof e=="object"}function h1(e){return typeof e=="function"}function d1(e){return sC((n=>{try{return n.readFile().catch(r=>r)}catch(r){return r}})(e))}var p1=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function m1(e,t){if(d1(t))for(let n of p1)e[`_${n}`]=t[n].bind(t);else for(let n of p1)e[`_${n}`]=(0,jo.default)(t[n].bind(t));d1(t)?t.rm?e._rm=t.rm.bind(t):t.rmdir.length>1?e._rm=t.rmdir.bind(t):e._rm=$f.bind(null,e):t.rm?e._rm=(0,jo.default)(t.rm.bind(t)):t.rmdir.length>2?e._rm=(0,jo.default)(t.rmdir.bind(t)):e._rm=$f.bind(null,e)}var Q=class{constructor(t){if(typeof t._original_unwrapped_fs!="undefined")return t;let n=Object.getOwnPropertyDescriptor(t,"promises");n&&n.enumerable?m1(this,t.promises):m1(this,t),this._original_unwrapped_fs=t}async exists(t,n={}){try{return await this._stat(t),!0}catch(r){if(r.code==="ENOENT"||r.code==="ENOTDIR")return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',r),r}}async read(t,n={}){try{let r=await this._readFile(t,n);if(n.autocrlf==="true")try{r=new TextDecoder("utf8",{fatal:!0}).decode(r),r=r.replace(/\r\n/g,` +`),r=new TextEncoder().encode(r)}catch(i){}return typeof r!="string"&&(r=Buffer.from(r)),r}catch(r){return null}}async write(t,n,r={}){try{await this._writeFile(t,n,r);return}catch(i){await this.mkdir(ki(t)),await this._writeFile(t,n,r)}}async mkdir(t,n=!1){try{await this._mkdir(t);return}catch(r){if(r===null||r.code==="EEXIST")return;if(n)throw r;if(r.code==="ENOENT"){let i=ki(t);if(i==="."||i==="/"||i===t)throw r;await this.mkdir(i),await this.mkdir(t,!0)}}}async rm(t){try{await this._unlink(t)}catch(n){if(n.code!=="ENOENT")throw n}}async rmdir(t,n){try{n&&n.recursive?await this._rm(t,n):await this._rmdir(t)}catch(r){if(r.code!=="ENOENT")throw r}}async readdir(t){try{let n=await this._readdir(t);return n.sort(Xo),n}catch(n){return n.code==="ENOTDIR"?null:[]}}async readdirDeep(t){let n=await this._readdir(t);return(await Promise.all(n.map(async i=>{let a=t+"/"+i;return(await this._stat(a)).isDirectory()?this.readdirDeep(a):a}))).reduce((i,a)=>i.concat(a),[])}async lstat(t){try{return await this._lstat(t)}catch(n){if(n.code==="ENOENT")return null;throw n}}async readlink(t,n={encoding:"buffer"}){try{let r=await this._readlink(t,n);return Buffer.isBuffer(r)?r:Buffer.from(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}async writelink(t,n){return this._symlink(n.toString("utf8"),t)}};function F(e,t){if(t===void 0)throw new Ot(e)}async function Go(e,t){return!e&&!t?!1:e&&!t||!e&&t?!0:!(await e.type()==="tree"&&await t.type()==="tree"||await e.type()===await t.type()&&await e.mode()===await t.mode()&&await e.oid()===await t.oid())}async function lC({fs:e,dir:t,gitdir:n=B(t,".git"),commit:r="HEAD",cache:i={}}){try{F("fs",e),F("dir",t),F("gitdir",n);let a=new Q(e),s=[lr({ref:r}),Ko(),Zo()],o=[];await ct.acquire({fs:a,gitdir:n,cache:i},async function(c){o=c.unmergedPaths});let l=await Ii({fs:a,cache:i,dir:t,gitdir:n,trees:s,map:async function(c,[u,f,h]){let d=!await Go(f,h),p=o.includes(c),g=!await Go(h,u);if(d||p)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(g)return!1;throw new fs(c)}});await ct.acquire({fs:a,gitdir:n,cache:i},async function(c){for(let u of l)if(u!==!1){if(!u){await a.rmdir(`${t}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let f=new TextDecoder().decode(u.content);await a.write(`${t}/${u.path}`,f,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(a){throw a.caller="git.abortMerge",a}}var Ri=class{static async isIgnored({fs:t,dir:n,gitdir:r=B(n,".git"),filepath:i}){if(Bo(i)===".git")return!0;if(i===".")return!1;let a="",s=B(r,"info","exclude");await t.exists(s)&&(a=await t.read(s,"utf8"));let o=[{gitignore:B(n,".gitignore"),filepath:i}],l=i.split("/").filter(Boolean);for(let u=1;uHf({dir:t,gitdir:n,fs:o,filepath:r,index:l,force:a,parallel:s}))}catch(o){throw o.caller="git.add",o}}async function Hf({dir:e,gitdir:t,fs:n,filepath:r,index:i,force:a,parallel:s}){r=Array.isArray(r)?r:[r];let o=r.map(async f=>{if(!a&&await Ri.isIgnored({fs:n,dir:e,gitdir:t,filepath:f}))return;let h=await n.lstat(B(e,f));if(!h)throw new Re(f);if(h.isDirectory()){let d=await n.readdir(B(e,f));if(s){let p=d.map(g=>Hf({dir:e,gitdir:t,fs:n,filepath:[B(f,g)],index:i,force:a,parallel:s}));await Promise.all(p)}else for(let p of d)await Hf({dir:e,gitdir:t,fs:n,filepath:[B(f,p)],index:i,force:a,parallel:s})}else{let p=await(await Ve.get({fs:n,gitdir:t})).get("core.autocrlf"),g=h.isSymbolicLink()?await n.readlink(B(e,f)).then(hC):await n.read(B(e,f),{autocrlf:p});if(g===null)throw new Re(f);let m=await Gt({fs:n,gitdir:t,type:"blob",object:g});i.insert({filepath:f,stats:h,oid:m})}}),l=await Promise.allSettled(o),c=l.filter(f=>f.status==="rejected").map(f=>f.reason);if(c.length>1)throw new os(c);if(c.length===1)throw c[0];return l.filter(f=>f.status==="fulfilled"&&f.value).map(f=>f.value)}async function ds({fs:e,gitdir:t,path:n}){return(await Ve.get({fs:e,gitdir:t})).get(n)}function L1(e,...t){for(let n of t)if(n)for(let r of Object.keys(n)){let i=n[r];i!==void 0&&(e[r]=i)}return e}async function Gr({fs:e,gitdir:t,author:n,commit:r}){let i=Math.floor(Date.now()/1e3),a={name:await ds({fs:e,gitdir:t,path:"user.name"}),email:await ds({fs:e,gitdir:t,path:"user.email"})||"",timestamp:i,timezoneOffset:new Date(i*1e3).getTimezoneOffset()},s=L1({},a,r?r.author:void 0,n);if(s.name!==void 0)return s}async function Li({fs:e,gitdir:t,author:n,committer:r,commit:i}){let a=Math.floor(Date.now()/1e3),s={name:await ds({fs:e,gitdir:t,path:"user.name"}),email:await ds({fs:e,gitdir:t,path:"user.email"})||"",timestamp:a,timezoneOffset:new Date(a*1e3).getTimezoneOffset()},o=L1({},s,i?i.committer:void 0,n,r);if(o.name!==void 0)return o}async function j1({fs:e,cache:t,gitdir:n,oid:r}){let{type:i,object:a}=await We({fs:e,cache:t,gitdir:n,oid:r});if(i==="tag")return r=Ut.from(a).parse().object,j1({fs:e,cache:t,gitdir:n,oid:r});if(i!=="commit")throw new At(r,i,"commit");return{commit:Rt.from(a),oid:r}}async function zo({fs:e,cache:t,gitdir:n,oid:r}){let{commit:i,oid:a}=await j1({fs:e,cache:t,gitdir:n,oid:r});return{oid:a,commit:i.parse(),payload:i.withoutSignature()}}async function Jo({fs:e,cache:t,onSign:n,gitdir:r,message:i,author:a,committer:s,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:h,tree:d}){let p=!1;f||(f=await q.resolve({fs:e,gitdir:r,ref:"HEAD",depth:2}));let g,m;try{g=await q.resolve({fs:e,gitdir:r,ref:f}),m=await zo({fs:e,gitdir:r,oid:g,cache:{}})}catch(S){p=!0}if(l&&p)throw new hs(f);let w=l?await Gr({fs:e,gitdir:r,author:a,commit:m.commit}):await Gr({fs:e,gitdir:r,author:a});if(!w)throw new kt("author");let b=l?await Li({fs:e,gitdir:r,author:w,committer:s,commit:m.commit}):await Li({fs:e,gitdir:r,author:w,committer:s});if(!b)throw new kt("committer");return ct.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async function(S){let x=F1(S.entries).get(".");if(d||(d=await D1({fs:e,gitdir:r,inode:x,dryRun:c})),h?h=await Promise.all(h.map(E=>q.resolve({fs:e,gitdir:r,ref:E}))):l?h=m.commit.parent:h=g?[g]:[],!i)if(l)i=m.commit.message;else throw new Ot("message");let k=Rt.from({tree:d,parent:h,author:w,committer:b,message:i});o&&(k=await Rt.sign(k,n,o));let y=await Gt({fs:e,gitdir:r,type:"commit",object:k.toObject(),dryRun:c});return!u&&!c&&await q.writeRef({fs:e,gitdir:r,ref:f,value:y}),y})}async function D1({fs:e,gitdir:t,inode:n,dryRun:r}){let i=n.children;for(let l of i)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await D1({fs:e,gitdir:t,inode:l,dryRun:r}));let a=i.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),s=It.from(a);return await Gt({fs:e,gitdir:t,type:"tree",object:s.toObject(),dryRun:r})}async function ms({fs:e,cache:t,gitdir:n,oid:r,filepath:i}){if(i.startsWith("/"))throw new fr("leading-slash");if(i.endsWith("/"))throw new fr("trailing-slash");let a=r,s=await Oi({fs:e,cache:t,gitdir:n,oid:r}),o=s.tree;if(i==="")r=s.oid;else{let l=i.split("/");r=await B1({fs:e,cache:t,gitdir:n,tree:o,pathArray:l,oid:a,filepath:i})}return r}async function B1({fs:e,cache:t,gitdir:n,tree:r,pathArray:i,oid:a,filepath:s}){let o=i.shift();for(let l of r)if(l.path===o){if(i.length===0)return l.oid;{let{type:c,object:u}=await We({fs:e,cache:t,gitdir:n,oid:l.oid});if(c!=="tree")throw new At(a,c,"tree",s);return r=It.from(u),B1({fs:e,cache:t,gitdir:n,tree:r,pathArray:i,oid:a,filepath:s})}}throw new Re(`file or directory found at "${a}:${s}"`)}async function Bi({fs:e,cache:t,gitdir:n,oid:r,filepath:i=void 0}){i!==void 0&&(r=await ms({fs:e,cache:t,gitdir:n,oid:r,filepath:i}));let{tree:a,oid:s}=await Oi({fs:e,cache:t,gitdir:n,oid:r});return{oid:s,tree:a.entries()}}async function Vf({fs:e,gitdir:t,tree:n}){let r=It.from(n).toObject();return await Gt({fs:e,gitdir:t,type:"tree",object:r,format:"content"})}async function pC({fs:e,cache:t,onSign:n,gitdir:r,ref:i,oid:a,note:s,force:o,author:l,committer:c,signingKey:u}){let f;try{f=await q.resolve({gitdir:r,fs:e,ref:i})}catch(w){if(!(w instanceof Re))throw w}let d=(await Bi({fs:e,cache:t,gitdir:r,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(o)d=d.filter(w=>w.path!==a);else for(let w of d)if(w.path===a)throw new hn("note",a);typeof s=="string"&&(s=Buffer.from(s,"utf8"));let p=await Gt({fs:e,gitdir:r,type:"blob",object:s,format:"content"});d.push({mode:"100644",path:a,oid:p,type:"blob"});let g=await Vf({fs:e,gitdir:r,tree:d});return await Jo({fs:e,cache:t,onSign:n,gitdir:r,ref:i,tree:g,parent:f&&[f],message:`Note added by 'isomorphic-git addNote' +`,author:l,committer:c,signingKey:u})}async function mC({fs:e,onSign:t,dir:n,gitdir:r=B(n,".git"),ref:i="refs/notes/commits",oid:a,note:s,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{F("fs",e),F("gitdir",r),F("oid",a),F("note",s),u&&F("onSign",t);let h=new Q(e),d=await Gr({fs:h,gitdir:r,author:l});if(!d)throw new kt("author");let p=await Li({fs:h,gitdir:r,author:d,committer:c});if(!p)throw new kt("committer");return await pC({fs:new Q(h),cache:f,onSign:t,gitdir:r,ref:i,oid:a,note:s,force:o,author:d,committer:p,signingKey:u})}catch(h){throw h.caller="git.addNote",h}}async function N1({fs:e,gitdir:t,remote:n,url:r,force:i}){if(n!==fn.default.clean(n))throw new Gn(n,fn.default.clean(n));let a=await Ve.get({fs:e,gitdir:t});if(!i&&(await a.getSubsections("remote")).includes(n)&&r!==await a.get(`remote.${n}.url`))throw new hn("remote",n);await a.set(`remote.${n}.url`,r),await a.set(`remote.${n}.fetch`,`+refs/heads/*:refs/remotes/${n}/*`),await Ve.save({fs:e,gitdir:t,config:a})}async function gC({fs:e,dir:t,gitdir:n=B(t,".git"),remote:r,url:i,force:a=!1}){try{return F("fs",e),F("gitdir",n),F("remote",r),F("url",i),await N1({fs:new Q(e),gitdir:n,remote:r,url:i,force:a})}catch(s){throw s.caller="git.addRemote",s}}async function yC({fs:e,cache:t,onSign:n,gitdir:r,ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`,!u&&await q.exists({fs:e,gitdir:r,ref:i}))throw new hn("tag",i);let f=await q.resolve({fs:e,gitdir:r,ref:l||"HEAD"}),{type:h}=await We({fs:e,cache:t,gitdir:r,oid:f}),d=Ut.from({object:f,type:h,tag:i.replace("refs/tags/",""),tagger:a,message:s,gpgsig:o});c&&(d=await Ut.sign(d,n,c));let p=await Gt({fs:e,gitdir:r,type:"tag",object:d.toObject()});await q.writeRef({fs:e,gitdir:r,ref:i,value:p})}async function vC({fs:e,onSign:t,dir:n,gitdir:r=B(n,".git"),ref:i,tagger:a,message:s=i,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{F("fs",e),F("gitdir",r),F("ref",i),c&&F("onSign",t);let h=new Q(e),d=await Gr({fs:h,gitdir:r,author:a});if(!d)throw new kt("tagger");return await yC({fs:h,cache:f,onSign:t,gitdir:r,ref:i,tagger:d,message:s,gpgsig:o,object:l,signingKey:c,force:u})}catch(h){throw h.caller="git.annotatedTag",h}}async function wC({fs:e,gitdir:t,ref:n,object:r,checkout:i=!1,force:a=!1}){if(n!==fn.default.clean(n))throw new Gn(n,fn.default.clean(n));let s=`refs/heads/${n}`;if(!a&&await q.exists({fs:e,gitdir:t,ref:s}))throw new hn("branch",n,!1);let o;try{o=await q.resolve({fs:e,gitdir:t,ref:r||"HEAD"})}catch(l){}o&&await q.writeRef({fs:e,gitdir:t,ref:s,value:o}),i&&await q.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:s})}async function bC({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r,object:i,checkout:a=!1,force:s=!1}){try{return F("fs",e),F("gitdir",n),F("ref",r),await wC({fs:new Q(e),gitdir:n,ref:r,object:i,checkout:a,force:s})}catch(o){throw o.caller="git.branch",o}}var $1=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);async function Wf({fs:e,cache:t,onProgress:n,onPostCheckout:r,dir:i,gitdir:a,remote:s,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:h,track:d=!0}){let p;if(r)try{p=await q.resolve({fs:e,gitdir:a,ref:"HEAD"})}catch(m){p="0000000000000000000000000000000000000000"}let g;try{g=await q.resolve({fs:e,gitdir:a,ref:o})}catch(m){if(o==="HEAD")throw m;let w=`${s}/${o}`;if(g=await q.resolve({fs:e,gitdir:a,ref:w}),d){let b=await Ve.get({fs:e,gitdir:a});await b.set(`branch.${o}.remote`,s),await b.set(`branch.${o}.merge`,`refs/heads/${o}`),await Ve.save({fs:e,gitdir:a,config:b})}await q.writeRef({fs:e,gitdir:a,ref:`refs/heads/${o}`,value:g})}if(!c){let m;try{m=await xC({fs:e,cache:t,onProgress:n,dir:i,gitdir:a,ref:o,force:h,filepaths:l})}catch(x){throw x instanceof Re&&x.data.what===g?new ns(o,g):x}let w=m.filter(([x])=>x==="conflict").map(([x,k])=>k);if(w.length>0)throw new ts(w);let b=m.filter(([x])=>x==="error").map(([x,k])=>k);if(b.length>0)throw new ue(b.join(", "));if(f){r&&await r({previousHead:p,newHead:g,type:l!=null&&l.length>0?"file":"branch"});return}let S=0,A=m.length;await ct.acquire({fs:e,gitdir:a,cache:t},async function(x){await Promise.all(m.filter(([k])=>k==="delete"||k==="delete-index").map(async function([k,y]){let E=`${i}/${y}`;k==="delete"&&await e.rm(E),x.delete({filepath:y}),n&&await n({phase:"Updating workdir",loaded:++S,total:A})}))}),await ct.acquire({fs:e,gitdir:a,cache:t},async function(x){for(let[k,y]of m)if(k==="rmdir"||k==="rmdir-index"){let E=`${i}/${y}`;try{k==="rmdir-index"&&x.delete({filepath:y}),await e.rmdir(E),n&&await n({phase:"Updating workdir",loaded:++S,total:A})}catch(_){if(_.code==="ENOTEMPTY")console.log(`Did not delete ${y} because directory is not empty`);else throw _}}}),await Promise.all(m.filter(([x])=>x==="mkdir"||x==="mkdir-index").map(async function([x,k]){let y=`${i}/${k}`;await e.mkdir(y),n&&await n({phase:"Updating workdir",loaded:++S,total:A})})),await ct.acquire({fs:e,gitdir:a,cache:t},async function(x){await Promise.all(m.filter(([k])=>k==="create"||k==="create-index"||k==="update"||k==="mkdir-index").map(async function([k,y,E,_,C]){let P=`${i}/${y}`;try{if(k!=="create-index"&&k!=="mkdir-index"){let{object:N}=await We({fs:e,cache:t,gitdir:a,oid:E});if(C&&await e.rm(P),_===33188)await e.write(P,N);else if(_===33261)await e.write(P,N,{mode:511});else if(_===40960)await e.writelink(P,N);else throw new ue(`Invalid mode 0o${_.toString(8)} detected in blob ${E}`)}let L=await e.lstat(P);_===33261&&(L.mode=493),k==="mkdir-index"&&(L.mode=57344),x.insert({filepath:y,stats:L,oid:E}),n&&await n({phase:"Updating workdir",loaded:++S,total:A})}catch(L){console.log(L)}}))}),r&&await r({previousHead:p,newHead:g,type:l!=null&&l.length>0?"file":"branch"})}if(!u){let m=await q.expand({fs:e,gitdir:a,ref:o});m.startsWith("refs/heads")?await q.writeSymbolicRef({fs:e,gitdir:a,ref:"HEAD",value:m}):await q.writeRef({fs:e,gitdir:a,ref:"HEAD",value:g})}}async function xC({fs:e,cache:t,onProgress:n,dir:r,gitdir:i,ref:a,force:s,filepaths:o}){let l=0;return Ii({fs:e,cache:t,dir:r,gitdir:i,trees:[lr({ref:a}),Ko(),Zo()],map:async function(c,[u,f,h]){if(c===".")return;if(o&&!o.some(p=>$1(c,p)))return null;switch(n&&await n({phase:"Analyzing workdir",loaded:++l}),[!!h,!!u,!!f].map(Number).join("")){case"000":return;case"001":return s&&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()?s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]:await u.mode()!==await f.mode()?s?["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 h.type()){case"tree":return["rmdir",c];case"blob":return await h.oid()!==await f.oid()?s?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await h.type()}`]}case"110":case"111":switch(`${await h.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await h.oid()===await u.oid()&&await h.mode()===await u.mode()&&!s)return;if(f){if(await f.oid()!==await h.oid()&&await f.oid()!==await u.oid())return s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]}else if(s)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()];return await u.mode()!==await h.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await h.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 h.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=I1(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function _C({fs:e,onProgress:t,onPostCheckout:n,dir:r,gitdir:i=B(r,".git"),remote:a="origin",ref:s,filepaths:o,noCheckout:l=!1,noUpdateHead:c=s===void 0,dryRun:u=!1,force:f=!1,track:h=!0,cache:d={}}){try{F("fs",e),F("dir",r),F("gitdir",i);let p=s||"HEAD";return await Wf({fs:new Q(e),cache:d,onProgress:t,onPostCheckout:n,dir:r,gitdir:i,remote:a,ref:p,filepaths:o,noCheckout:l,noUpdateHead:c,dryRun:u,force:f,track:h})}catch(p){throw p.caller="git.checkout",p}}var SC=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function Hr(e){let t=SC.exec(e);return t?t[1]==="remotes/"&&e.endsWith("/HEAD")?t[2].slice(0,-5):t[2]:e}async function Vr({fs:e,gitdir:t,fullname:n=!1,test:r=!1}){let i=await q.resolve({fs:e,gitdir:t,ref:"HEAD",depth:2});if(r)try{await q.resolve({fs:e,gitdir:t,ref:i})}catch(a){return}if(i.startsWith("refs/"))return n?i:Hr(i)}function EC(e){return e=e.replace(/^git@([^:]+):/,"https://$1/"),e=e.replace(/^ssh:\/\//,"https://"),e}function H1({username:e="",password:t=""}){return`Basic ${Buffer.from(`${e}:${t}`).toString("base64")}`}async function gs(e,t){let n=M1(e);for(;;){let{value:r,done:i}=await n.next();if(r&&await t(r),i)break}n.return&&n.return()}async function Vo(e){let t=0,n=[];await gs(e,a=>{n.push(a),t+=a.byteLength});let r=new Uint8Array(t),i=0;for(let a of n)r.set(a,i),i+=a.byteLength;return r}function g1(e){let t=e.match(/^https?:\/\/([^/]+)@/);if(t==null)return{url:e,auth:{}};t=t[1];let[n,r]=t.split(":");return e=e.replace(`${t}@`,""),{url:e,auth:{username:n,password:r}}}function Uf(e,t){let n=t.toString(16);return"0".repeat(e-n.length)+n}var ze=class{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(t){typeof t=="string"&&(t=Buffer.from(t));let n=t.length+4,r=Uf(4,n);return Buffer.concat([Buffer.from(r,"utf8"),t])}static streamReader(t){let n=new Ho(t);return async function(){try{let i=await n.read(4);if(i==null)return!0;if(i=parseInt(i.toString("utf8"),16),i===0||i===1)return null;let a=await n.read(i-4);return a==null?!0:a}catch(i){return t.error=i,!0}}}};async function y1(e){let t={},n;for(;n=await e(),n!==!0;){if(n===null)continue;n=n.toString("utf8").replace(/\n$/,"");let r=n.indexOf("=");if(r>-1){let i=n.slice(0,r),a=n.slice(r+1);t[i]=a}else t[n]=!0}return{protocolVersion:2,capabilities2:t}}async function v1(e,{service:t}){let n=new Set,r=new Map,i=new Map,a=ze.streamReader(e),s=await a();for(;s===null;)s=await a();if(s===!0)throw new rs;if(s.includes("version 2"))return y1(a);if(s.toString("utf8").replace(/\n$/,"")!==`# service=${t}`)throw new Ur(`# service=${t}\\n`,s.toString("utf8"));let o=await a();for(;o===null;)o=await a();if(o===!0)return{capabilities:n,refs:r,symrefs:i};if(o=o.toString("utf8"),o.includes("version 2"))return y1(a);let[l,c]=Tf(o,"\0","\\x00");if(c.split(" ").map(u=>n.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,f]=Tf(l," "," ");for(r.set(f,u);;){let h=await a();if(h===!0)break;if(h!==null){let[d,p]=Tf(h.toString("utf8")," "," ");r.set(p,d)}}}for(let u of n)if(u.startsWith("symref=")){let f=u.match(/symref=([^:]+):(.*)/);f.length===3&&i.set(f[1],f[2])}return{protocolVersion:1,capabilities:n,refs:r,symrefs:i}}function Tf(e,t,n){let r=e.trim().split(t);if(r.length!==2)throw new Ur(`Two strings separated by '${n}'`,e.toString("utf8"));return r}var w1=(e,t)=>e.endsWith("?")?`${e}${t}`:`${e}/${t.replace(/^https?:\/\//,"")}`,b1=(e,t)=>{(t.username||t.password)&&(e.Authorization=H1(t)),t.headers&&Object.assign(e,t.headers)},Cf=async e=>{try{let t=Buffer.from(await Vo(e.body)),n=t.toString("utf8");return{preview:n.length<256?n:n.slice(0,256)+"...",response:n,data:t}}catch(t){return{}}},ji=class{static async capabilities(){return["discover","connect"]}static async discover({http:t,onProgress:n,onAuth:r,onAuthSuccess:i,onAuthFailure:a,corsProxy:s,service:o,url:l,headers:c,protocolVersion:u}){let{url:f,auth:h}=g1(l),d=s?w1(s,f):f;(h.username||h.password)&&(c.Authorization=H1(h)),u===2&&(c["Git-Protocol"]="version=2");let p,g,m=!1;do if(p=await t.request({onProgress:n,method:"GET",url:`${d}/info/refs?service=${o}`,headers:c}),g=!1,p.statusCode===401||p.statusCode===203){let w=m?a:r;if(w){if(h=await w(f,{...h,headers:{...c}}),h&&h.cancel)throw new Mi;h&&(b1(c,h),m=!0,g=!0)}}else p.statusCode===200&&m&&i&&await i(f,h);while(g);if(p.statusCode!==200){let{response:w}=await Cf(p);throw new Ti(p.statusCode,p.statusMessage,w)}if(p.headers["content-type"]===`application/x-${o}-advertisement`){let w=await v1(p.body,{service:o});return w.auth=h,w}else{let{preview:w,response:b,data:S}=await Cf(p);try{let A=await v1([S],{service:o});return A.auth=h,A}catch(A){throw new ls(w,b)}}}static async connect({http:t,onProgress:n,corsProxy:r,service:i,url:a,auth:s,body:o,headers:l}){let c=g1(a);c&&(a=c.url),r&&(a=w1(r,a)),l["content-type"]=`application/x-${i}-request`,l.accept=`application/x-${i}-result`,b1(l,s);let u=await t.request({onProgress:n,method:"POST",url:`${a}/${i}`,body:o,headers:l});if(u.statusCode!==200){let{response:f}=Cf(u);throw new Ti(u.statusCode,u.statusMessage,f)}return u}};function AC({url:e}){if(e.startsWith("git@"))return{transport:"ssh",address:e};let t=e.match(/(\w+)(:\/\/|::)(.*)/);if(t!==null){if(t[2]==="://")return{transport:t[1],address:t[0]};if(t[2]==="::")return{transport:t[1],address:t[3]}}}var Di=class{static getRemoteHelperFor({url:t}){let n=new Map;n.set("http",ji),n.set("https",ji);let r=AC({url:t});if(!r)throw new us(t);if(n.has(r.transport))return n.get(r.transport);throw new cs(t,r.transport,r.transport==="ssh"?EC(t):void 0)}},$r=null,zr=class{static async read({fs:t,gitdir:n}){$r===null&&($r=new Za.default);let r=B(n,"shallow"),i=new Set;return await $r.acquire(r,async function(){let a=await t.read(r,{encoding:"utf8"});if(a===null||a.trim()==="")return i;a.trim().split(` +`).map(s=>i.add(s))}),i}static async write({fs:t,gitdir:n,oids:r}){$r===null&&($r=new Za.default);let i=B(n,"shallow");if(r.size>0){let a=[...r].join(` +`)+` +`;await $r.acquire(i,async function(){await t.write(i,a,{encoding:"utf8"})})}else await $r.acquire(i,async function(){await t.rm(i)})}};async function kC({fs:e,gitdir:t,oid:n}){let r=`objects/${n.slice(0,2)}/${n.slice(2)}`;return e.exists(`${t}/${r}`)}async function TC({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i}){let a=await e.readdir(B(n,"objects/pack"));a=a.filter(s=>s.endsWith(".idx"));for(let s of a){let o=`${n}/objects/pack/${s}`,l=await zf({fs:e,cache:t,filename:o,getExternalRefDelta:i});if(l.error)throw new ue(l.error);if(l.offsets.has(r))return!0}return!1}async function x1({fs:e,cache:t,gitdir:n,oid:r,format:i="content"}){let a=o=>We({fs:e,cache:t,gitdir:n,oid:o}),s=await kC({fs:e,gitdir:n,oid:r});return s||(s=await TC({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:a})),s}function CC(e){let i="5041434b"+"00000002"+"00000000";return e.slice(0,12).toString("hex")===i}function U1(e,t){let n=e.map(r=>r.split("=",1)[0]);return t.filter(r=>{let i=r.split("=",1)[0];return n.includes(i)})}var Qo={name:"isomorphic-git",version:"1.27.1",agent:"git/isomorphic-git@1.27.1"},Si=class{constructor(){this._queue=[]}write(t){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let n=this._waiting;this._waiting=null,n({value:t})}else this._queue.push(t)}end(){if(this._ended=!0,this._waiting){let t=this._waiting;this._waiting=null,t({done:!0})}}destroy(t){this.error=t,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(t=>{this._waiting=t})}};function FC(e){let t=e.indexOf("\r"),n=e.indexOf(` +`);return t===-1&&n===-1?-1:t===-1?n+1:n===-1?t+1:n===t+1?n+1:Math.min(t,n)+1}function G1(e){let t=new Si,n="";return(async()=>(await gs(e,r=>{for(r=r.toString("utf8"),n+=r;;){let i=FC(n);if(i===-1)break;t.write(n.slice(0,i)),n=n.slice(i)}}),n.length>0&&t.write(n),t.end()))(),t}var Wo=class{static demux(t){let n=ze.streamReader(t),r=new Si,i=new Si,a=new Si,s=async function(){let o=await n();if(o===null)return s();if(o===!0){r.end(),a.end(),t.error?i.destroy(t.error):i.end();return}switch(o[0]){case 1:{i.write(o.slice(1));break}case 2:{a.write(o.slice(1));break}case 3:{let l=o.slice(1);a.write(l),r.end(),a.end(),i.destroy(new Error(l.toString("utf8")));return}default:r.write(o)}s()};return s(),{packetlines:r,packfile:i,progress:a}}};async function PC(e){let{packetlines:t,packfile:n,progress:r}=Wo.demux(e),i=[],a=[],s=[],o=!1,l=!1;return new Promise((c,u)=>{gs(t,f=>{let h=f.toString("utf8").trim();if(h.startsWith("shallow")){let d=h.slice(-41).trim();d.length!==40&&u(new cr(d)),i.push(d)}else if(h.startsWith("unshallow")){let d=h.slice(-41).trim();d.length!==40&&u(new cr(d)),a.push(d)}else if(h.startsWith("ACK")){let[,d,p]=h.split(" ");s.push({oid:d,status:p}),p||(l=!0)}else h.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(e.error?u(e.error):c({shallows:i,unshallows:a,acks:s,nak:o,packfile:n,progress:r}))}).finally(()=>{l||(e.error?u(e.error):c({shallows:i,unshallows:a,acks:s,nak:o,packfile:n,progress:r}))})})}function MC({capabilities:e=[],wants:t=[],haves:n=[],shallows:r=[],depth:i=null,since:a=null,exclude:s=[]}){let o=[];t=[...new Set(t)];let l=` ${e.join(" ")}`;for(let c of t)o.push(ze.encode(`want ${c}${l} +`)),l="";for(let c of r)o.push(ze.encode(`shallow ${c} +`));i!==null&&o.push(ze.encode(`deepen ${i} +`)),a!==null&&o.push(ze.encode(`deepen-since ${Math.floor(a.valueOf()/1e3)} +`));for(let c of s)o.push(ze.encode(`deepen-not ${c} +`));o.push(ze.flush());for(let c of n)o.push(ze.encode(`have ${c} +`));return o.push(ze.encode(`done +`)),o}async function qf({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:h,corsProxy:d,depth:p=null,since:g=null,exclude:m=[],relative:w=!1,tags:b=!1,singleBranch:S=!1,headers:A={},prune:x=!1,pruneTags:k=!1}){let y=c||await Vr({fs:e,gitdir:l,test:!0}),E=await Ve.get({fs:e,gitdir:l}),_=f||y&&await E.get(`branch.${y}.remote`)||"origin",C=h||await E.get(`remote.${_}.url`);if(typeof C=="undefined")throw new Ot("remote OR url");let P=u||y&&await E.get(`branch.${y}.merge`)||c||"HEAD";d===void 0&&(d=await E.get("http.corsProxy"));let L=Di.getRemoteHelperFor({url:C}),N=await L.discover({http:n,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:d,service:"git-upload-pack",url:C,headers:A,protocolVersion:1}),j=N.auth,Y=N.refs;if(Y.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!N.capabilities.has("shallow"))throw new or("shallow","depth");if(g!==null&&!N.capabilities.has("deepen-since"))throw new or("deepen-since","since");if(m.length>0&&!N.capabilities.has("deepen-not"))throw new or("deepen-not","exclude");if(w===!0&&!N.capabilities.has("deepen-relative"))throw new or("deepen-relative","relative");let{oid:le,fullref:he}=q.resolveAgainstMap({ref:P,map:Y});for(let G of Y.keys())G===he||G==="HEAD"||G.startsWith("refs/heads/")||b&&G.startsWith("refs/tags/")||Y.delete(G);let ae=U1([...N.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Qo.agent}`]);w&&ae.push("deepen-relative");let Pe=S?[le]:Y.values(),de=S?[y]:await q.listRefs({fs:e,gitdir:l,filepath:"refs"}),$=[];for(let G of de)try{G=await q.expand({fs:e,gitdir:l,ref:G});let rt=await q.resolve({fs:e,gitdir:l,ref:G});await x1({fs:e,cache:t,gitdir:l,oid:rt})&&$.push(rt)}catch(rt){}$=[...new Set($)];let z=await zr.read({fs:e,gitdir:l}),D=N.capabilities.has("shallow")?[...z]:[],se=MC({capabilities:ae,wants:Pe,haves:$,shallows:D,depth:p,since:g,exclude:m}),Se=Buffer.from(await Vo(se)),gt=await L.connect({http:n,onProgress:r,corsProxy:d,service:"git-upload-pack",url:C,auth:j,body:[Se],headers:A}),be=await PC(gt.body);gt.headers&&(be.headers=gt.headers);for(let G of be.shallows)if(!z.has(G))try{let{object:rt}=await We({fs:e,cache:t,gitdir:l,oid:G}),H=new Rt(rt),Z=await Promise.all(H.headers().parent.map(Ke=>x1({fs:e,cache:t,gitdir:l,oid:Ke})));Z.length===0||Z.every(Ke=>Ke)||z.add(G)}catch(rt){z.add(G)}for(let G of be.unshallows)z.delete(G);if(await zr.write({fs:e,gitdir:l,oids:z}),S){let G=new Map([[he,le]]),rt=new Map,H=10,Z=he;for(;H--;){let _t=N.symrefs.get(Z);if(_t===void 0)break;rt.set(Z,_t),Z=_t}let ye=Y.get(Z);ye&&G.set(Z,ye);let{pruned:Ke}=await q.updateRemoteRefs({fs:e,gitdir:l,remote:_,refs:G,symrefs:rt,tags:b,prune:x});x&&(be.pruned=Ke)}else{let{pruned:G}=await q.updateRemoteRefs({fs:e,gitdir:l,remote:_,refs:Y,symrefs:N.symrefs,tags:b,prune:x,pruneTags:k});x&&(be.pruned=G)}if(be.HEAD=N.symrefs.get("HEAD"),be.HEAD===void 0){let{oid:G}=q.resolveAgainstMap({ref:"HEAD",map:Y});for(let[rt,H]of Y.entries())if(rt!=="HEAD"&&H===G){be.HEAD=rt;break}}let ot=he.startsWith("refs/tags")?"tag":"branch";if(be.FETCH_HEAD={oid:le,description:`${ot} '${Hr(he)}' of ${C}`},r||i){let G=G1(be.progress);gs(G,async rt=>{if(i&&await i(rt),r){let H=rt.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);H&&await r({phase:H[1].trim(),loaded:parseInt(H[2],10),total:parseInt(H[3],10)})}})}let ee=Buffer.from(await Vo(be.packfile));if(gt.body.error)throw gt.body.error;let Ie=ee.slice(-20).toString("hex"),Ee={defaultBranch:be.HEAD,fetchHead:be.FETCH_HEAD.oid,fetchHeadDescription:be.FETCH_HEAD.description};if(be.headers&&(Ee.headers=be.headers),x&&(Ee.pruned=be.pruned),Ie!==""&&!CC(ee)){Ee.packfile=`objects/pack/pack-${Ie}.pack`;let G=B(l,Ee.packfile);await e.write(G,ee);let rt=Z=>We({fs:e,cache:t,gitdir:l,oid:Z}),H=await Qa.fromPack({pack:ee,getExternalRefDelta:rt,onProgress:r});await e.write(G.replace(/\.pack$/,".idx"),await H.toBuffer())}return Ee}async function z1({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:B(n,".git"),defaultBranch:i="master"}){if(await e.exists(r+"/config"))return;let a=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];a=a.map(s=>r+"/"+s);for(let s of a)await e.mkdir(s);await e.write(r+"/config",`[core] + repositoryformatversion = 0 + filemode = false + bare = ${t} +`+(t?"":` logallrefupdates = true +`)+` symlinks = false + ignorecase = true +`),await e.write(r+"/HEAD",`ref: refs/heads/${i} +`)}async function OC({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:h,ref:d,remote:p,depth:g,since:m,exclude:w,relative:b,singleBranch:S,noCheckout:A,noTags:x,headers:k}){try{if(await z1({fs:e,gitdir:u}),await N1({fs:e,gitdir:u,remote:p,url:f,force:!1}),h){let _=await Ve.get({fs:e,gitdir:u});await _.set("http.corsProxy",h),await Ve.save({fs:e,gitdir:u,config:_})}let{defaultBranch:y,fetchHead:E}=await qf({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:u,ref:d,remote:p,corsProxy:h,depth:g,since:m,exclude:w,relative:b,singleBranch:S,headers:k,tags:!x});if(E===null)return;d=d||y,d=d.replace("refs/heads/",""),await Wf({fs:e,cache:t,onProgress:r,onPostCheckout:l,dir:c,gitdir:u,ref:d,remote:p,noCheckout:A})}catch(y){throw await e.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),y}}async function IC({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c=B(l,".git"),url:u,corsProxy:f=void 0,ref:h=void 0,remote:d="origin",depth:p=void 0,since:g=void 0,exclude:m=[],relative:w=!1,singleBranch:b=!1,noCheckout:S=!1,noTags:A=!1,headers:x={},cache:k={}}){try{return F("fs",e),F("http",t),F("gitdir",c),S||F("dir",l),F("url",u),await OC({fs:new Q(e),cache:k,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPostCheckout:o,dir:l,gitdir:c,url:u,corsProxy:f,ref:h,remote:d,depth:p,since:g,exclude:m,relative:w,singleBranch:b,noCheckout:S,noTags:A,headers:x})}catch(y){throw y.caller="git.clone",y}}async function RC({fs:e,onSign:t,dir:n,gitdir:r=B(n,".git"),message:i,author:a,committer:s,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:h,tree:d,cache:p={}}){try{F("fs",e),l||F("message",i),o&&F("onSign",t);let g=new Q(e);return await Jo({fs:g,cache:p,onSign:t,gitdir:r,message:i,author:a,committer:s,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:h,tree:d})}catch(g){throw g.caller="git.commit",g}}async function LC({fs:e,dir:t,gitdir:n=B(t,".git"),fullname:r=!1,test:i=!1}){try{return F("fs",e),F("gitdir",n),await Vr({fs:new Q(e),gitdir:n,fullname:r,test:i})}catch(a){throw a.caller="git.currentBranch",a}}async function jC({fs:e,gitdir:t,ref:n}){if(n=n.startsWith("refs/heads/")?n:`refs/heads/${n}`,!await q.exists({fs:e,gitdir:t,ref:n}))throw new Re(n);let i=await q.expand({fs:e,gitdir:t,ref:n}),a=await Vr({fs:e,gitdir:t,fullname:!0});if(i===a){let l=await q.resolve({fs:e,gitdir:t,ref:i});await q.writeRef({fs:e,gitdir:t,ref:"HEAD",value:l})}await q.deleteRef({fs:e,gitdir:t,ref:i});let s=Hr(n),o=await Ve.get({fs:e,gitdir:t});await o.deleteSection("branch",s),await Ve.save({fs:e,gitdir:t,config:o})}async function DC({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r}){try{return F("fs",e),F("ref",r),await jC({fs:new Q(e),gitdir:n,ref:r})}catch(i){throw i.caller="git.deleteBranch",i}}async function BC({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r}){try{F("fs",e),F("ref",r),await q.deleteRef({fs:new Q(e),gitdir:n,ref:r})}catch(i){throw i.caller="git.deleteRef",i}}async function NC({fs:e,gitdir:t,remote:n}){let r=await Ve.get({fs:e,gitdir:t});await r.deleteSection("remote",n),await Ve.save({fs:e,gitdir:t,config:r})}async function $C({fs:e,dir:t,gitdir:n=B(t,".git"),remote:r}){try{return F("fs",e),F("remote",r),await NC({fs:new Q(e),gitdir:n,remote:r})}catch(i){throw i.caller="git.deleteRemote",i}}async function HC({fs:e,gitdir:t,ref:n}){n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,await q.deleteRef({fs:e,gitdir:t,ref:n})}async function UC({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r}){try{return F("fs",e),F("ref",r),await HC({fs:new Q(e),gitdir:n,ref:r})}catch(i){throw i.caller="git.deleteTag",i}}async function GC({fs:e,gitdir:t,oid:n}){let r=n.slice(0,2);return(await e.readdir(`${t}/objects/${r}`)).map(a=>`${r}${a}`).filter(a=>a.startsWith(n))}async function zC({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i}){let a=[],s=await e.readdir(B(n,"objects/pack"));s=s.filter(o=>o.endsWith(".idx"));for(let o of s){let l=`${n}/objects/pack/${o}`,c=await zf({fs:e,cache:t,filename:l,getExternalRefDelta:i});if(c.error)throw new ue(c.error);for(let u of c.offsets.keys())u.startsWith(r)&&a.push(u)}return a}async function VC({fs:e,cache:t,gitdir:n,oid:r}){let i=o=>We({fs:e,cache:t,gitdir:n,oid:o}),a=await GC({fs:e,gitdir:n,oid:r}),s=await zC({fs:e,cache:t,gitdir:n,oid:r,getExternalRefDelta:i});for(let o of s)a.indexOf(o)===-1&&a.push(o);if(a.length===1)return a[0];throw a.length>1?new es("oids",r,a):new Re(`an object matching "${r}"`)}async function WC({fs:e,dir:t,gitdir:n=B(t,".git"),oid:r,cache:i={}}){try{return F("fs",e),F("gitdir",n),F("oid",r),await VC({fs:new Q(e),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.expandOid",a}}async function qC({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r}){try{return F("fs",e),F("gitdir",n),F("ref",r),await q.expand({fs:new Q(e),gitdir:n,ref:r})}catch(i){throw i.caller="git.expandRef",i}}async function Xf({fs:e,cache:t,gitdir:n,oids:r}){let i={},a=r.length,s=r.map((o,l)=>({index:l,oid:o}));for(;s.length;){let o=new Set;for(let{oid:c,index:u}of s)i[c]||(i[c]=new Set),i[c].add(u),i[c].size===a&&o.add(c);if(o.size>0)return[...o];let l=new Map;for(let{oid:c,index:u}of s)try{let{object:f}=await We({fs:e,cache:t,gitdir:n,oid:c}),h=Rt.from(f),{parent:d}=h.parseHeaders();for(let p of d)(!i[p]||!i[p].has(u))&&l.set(p+":"+u,{oid:p,index:u})}catch(f){}s=Array.from(l.values())}return[]}var Ff=/^.*(\r?\n|$)/gm;function XC({branches:e,contents:t}){let n=e[1],r=e[2],i=t[0],a=t[1],s=t[2],o=a.match(Ff),l=i.match(Ff),c=s.match(Ff),u=(0,A1.default)(o,l,c),f=7,h="",d=!0;for(let p of u)p.ok&&(h+=p.ok.join("")),p.conflict&&(d=!1,h+=`${"<".repeat(f)} ${n} +`,h+=p.conflict.a.join(""),h+=`${"=".repeat(f)} +`,h+=p.conflict.b.join(""),h+=`${">".repeat(f)} ${r} +`);return{cleanMerge:d,mergedText:h}}async function YC({fs:e,cache:t,dir:n,gitdir:r=B(n,".git"),index:i,ourOid:a,baseOid:s,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:h=!0,mergeDriver:d}){let p=lr({ref:a}),g=lr({ref:s}),m=lr({ref:o}),w=[],b=[],S=[],A=[],x=await Ii({fs:e,cache:t,dir:n,gitdir:r,trees:[p,g,m],map:async function(k,[y,E,_]){let C=Bo(k),P=await Go(y,E),L=await Go(_,E);switch(`${P}-${L}`){case"false-false":return{mode:await E.mode(),path:C,oid:await E.oid(),type:await E.type()};case"false-true":return _?{mode:await _.mode(),path:C,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return y?{mode:await y.mode(),path:C,oid:await y.oid(),type:await y.type()}:void 0;case"true-true":{if(y&&E&&_&&await y.type()==="blob"&&await E.type()==="blob"&&await _.type()==="blob")return ZC({fs:e,gitdir:r,path:C,ours:y,base:E,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:d}).then(async N=>{if(N.cleanMerge)h||i.insert({filepath:k,oid:N.mergeResult.oid,stage:0});else if(w.push(k),b.push(k),!h){let j=await E.oid(),Y=await y.oid(),le=await _.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:j,stage:1}),i.insert({filepath:k,oid:Y,stage:2}),i.insert({filepath:k,oid:le,stage:3})}return N.mergeResult});if(E&&!y&&_&&await E.type()==="blob"&&await _.type()==="blob"){if(w.push(k),S.push(k),!h){let N=await E.oid(),j=await _.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:N,stage:1}),i.insert({filepath:k,oid:j,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:C}}if(E&&y&&!_&&await E.type()==="blob"&&await y.type()==="blob"){if(w.push(k),A.push(k),!h){let N=await E.oid(),j=await y.oid();i.delete({filepath:k}),i.insert({filepath:k,oid:N,stage:1}),i.insert({filepath:k,oid:j,stage:2})}return{mode:await y.mode(),oid:await y.oid(),type:"blob",path:C}}if(E&&!y&&!_&&await E.type()==="blob")return;throw new Ci}}},reduce:w.length!==0&&(!n||h)?void 0:async(k,y)=>{let E=y.filter(Boolean);if(k&&!(k&&k.type==="tree"&&E.length===0)){if(E.length>0){let C=new It(E).toObject(),P=await Gt({fs:e,gitdir:r,type:"tree",object:C,dryRun:f});k.oid=P}return k}}});return w.length!==0?(n&&!h&&await Ii({fs:e,cache:t,dir:n,gitdir:r,trees:[lr({ref:x.oid})],map:async function(k,[y]){let E=`${n}/${k}`;if(await y.type()==="blob"){let _=await y.mode(),C=new TextDecoder().decode(await y.content());await e.write(E,C,{mode:_})}return!0}}),new Fi(w,b,S,A)):x.oid}async function ZC({fs:e,gitdir:t,path:n,ours:r,base:i,theirs:a,ourName:s,theirName:o,baseName:l,dryRun:c,mergeDriver:u=XC}){let f="blob",h=await i.mode()===await r.mode()?await a.mode():await r.mode();if(await r.oid()===await a.oid())return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await r.oid(),type:f}};if(await r.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await a.oid(),type:f}};if(await a.oid()===await i.oid())return{cleanMerge:!0,mergeResult:{mode:h,path:n,oid:await r.oid(),type:f}};let d=Buffer.from(await r.content()).toString("utf8"),p=Buffer.from(await i.content()).toString("utf8"),g=Buffer.from(await a.content()).toString("utf8"),{mergedText:m,cleanMerge:w}=await u({branches:[l,s,o],contents:[p,d,g],path:n}),b=await Gt({fs:e,gitdir:t,type:"blob",object:Buffer.from(m,"utf8"),dryRun:c});return{cleanMerge:w,mergeResult:{mode:h,path:n,oid:b,type:f}}}async function V1({fs:e,cache:t,dir:n,gitdir:r,ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:h,committer:d,signingKey:p,onSign:g,mergeDriver:m}){i===void 0&&(i=await Vr({fs:e,gitdir:r,fullname:!0})),i=await q.expand({fs:e,gitdir:r,ref:i}),a=await q.expand({fs:e,gitdir:r,ref:a});let w=await q.resolve({fs:e,gitdir:r,ref:i}),b=await q.resolve({fs:e,gitdir:r,ref:a}),S=await Xf({fs:e,cache:t,gitdir:r,oids:[w,b]});if(S.length!==1)throw new Ci;let A=S[0];if(A===b)return{oid:w,alreadyMerged:!0};if(s&&A===w)return!l&&!c&&await q.writeRef({fs:e,gitdir:r,ref:i,value:b}),{oid:b,fastForward:!0};{if(o)throw new is;let x=await ct.acquire({fs:e,gitdir:r,cache:t,allowUnmerged:!1},async y=>YC({fs:e,cache:t,dir:n,gitdir:r,index:y,ourOid:w,theirOid:b,baseOid:A,ourName:Hr(i),baseName:"base",theirName:Hr(a),dryRun:l,abortOnConflict:u,mergeDriver:m}));if(x instanceof Fi)throw x;return f||(f=`Merge branch '${Hr(a)}' into ${Hr(i)}`),{oid:await Jo({fs:e,cache:t,gitdir:r,message:f,ref:i,tree:x,parent:[w,b],author:h,committer:d,signingKey:p,onSign:g,dryRun:l,noUpdateBranch:c}),tree:x,mergeCommit:!0}}}async function W1({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,dir:l,gitdir:c,ref:u,url:f,remote:h,remoteRef:d,prune:p,pruneTags:g,fastForward:m,fastForwardOnly:w,corsProxy:b,singleBranch:S,headers:A,author:x,committer:k,signingKey:y}){try{if(!u){let C=await Vr({fs:e,gitdir:c});if(!C)throw new Ot("ref");u=C}let{fetchHead:E,fetchHeadDescription:_}=await qf({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,gitdir:c,corsProxy:b,ref:u,url:f,remote:h,remoteRef:d,singleBranch:S,headers:A,prune:p,pruneTags:g});await V1({fs:e,cache:t,gitdir:c,ours:u,theirs:E,fastForward:m,fastForwardOnly:w,message:`Merge ${_}`,author:x,committer:k,signingKey:y,dryRun:!1,noUpdateBranch:!1}),await Wf({fs:e,cache:t,onProgress:r,dir:l,gitdir:c,ref:u,remote:h,noCheckout:!1})}catch(E){throw E.caller="git.pull",E}}async function KC({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l=B(o,".git"),ref:c,url:u,remote:f,remoteRef:h,corsProxy:d,singleBranch:p,headers:g={},cache:m={}}){try{F("fs",e),F("http",t),F("gitdir",l);let w={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await W1({fs:new Q(e),cache:m,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l,ref:c,url:u,remote:f,remoteRef:h,fastForwardOnly:!0,corsProxy:d,singleBranch:p,headers:g,author:w,committer:w})}catch(w){throw w.caller="git.fastForward",w}}async function JC({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l=B(o,".git"),ref:c,remote:u,remoteRef:f,url:h,corsProxy:d,depth:p=null,since:g=null,exclude:m=[],relative:w=!1,tags:b=!1,singleBranch:S=!1,headers:A={},prune:x=!1,pruneTags:k=!1,cache:y={}}){try{return F("fs",e),F("http",t),F("gitdir",l),await qf({fs:new Q(e),cache:y,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,gitdir:l,ref:c,remote:u,remoteRef:f,url:h,corsProxy:d,depth:p,since:g,exclude:m,relative:w,tags:b,singleBranch:S,headers:A,prune:x,pruneTags:k})}catch(E){throw E.caller="git.fetch",E}}async function QC({fs:e,dir:t,gitdir:n=B(t,".git"),oids:r,cache:i={}}){try{return F("fs",e),F("gitdir",n),F("oids",r),await Xf({fs:new Q(e),cache:i,gitdir:n,oids:r})}catch(a){throw a.caller="git.findMergeBase",a}}async function q1({fs:e,filepath:t}){if(await e.exists(B(t,".git")))return t;{let n=ki(t);if(n===t)throw new Re(`git root for ${t}`);return q1({fs:e,filepath:n})}}async function e8({fs:e,filepath:t}){try{return F("fs",e),F("filepath",t),await q1({fs:new Q(e),filepath:t})}catch(n){throw n.caller="git.findRoot",n}}async function t8({fs:e,dir:t,gitdir:n=B(t,".git"),path:r}){try{return F("fs",e),F("gitdir",n),F("path",r),await ds({fs:new Q(e),gitdir:n,path:r})}catch(i){throw i.caller="git.getConfig",i}}async function n8({fs:e,gitdir:t,path:n}){return(await Ve.get({fs:e,gitdir:t})).getall(n)}async function r8({fs:e,dir:t,gitdir:n=B(t,".git"),path:r}){try{return F("fs",e),F("gitdir",n),F("path",r),await n8({fs:new Q(e),gitdir:n,path:r})}catch(i){throw i.caller="git.getConfigAll",i}}async function i8({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:s={},forPush:o=!1}){try{F("http",e),F("url",a);let c=await Di.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[f,h]of c.refs){let d=f.split("/"),p=d.pop(),g=u;for(let m of d)g[m]=g[m]||{},g=g[m];g[p]=h}for(let[f,h]of c.symrefs){let d=f.split("/"),p=d.pop(),g=u;for(let m of d)g[m]=g[m]||{},g=g[m];g[p]=h}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function X1(e,t,n,r){let i=[];for(let[a,s]of e.refs){if(t&&!a.startsWith(t))continue;if(a.endsWith("^{}")){if(r){let l=a.replace("^{}",""),c=i[i.length-1],u=c.ref===l?c:i.find(f=>f.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=s}continue}let o={ref:a,oid:s};n&&e.symrefs.has(a)&&(o.target=e.symrefs.get(a)),i.push(o)}return i}async function a8({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:s={},forPush:o=!1,protocolVersion:l=2}){try{F("http",e),F("url",a);let u=await Di.getRemoteHelperFor({url:a}).discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let f={};for(let h of u.capabilities){let[d,p]=h.split("=");p?f[d]=p:f[d]=!0}return{protocolVersion:1,capabilities:f,refs:X1(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function s8({type:e,object:t,format:n="content",oid:r=void 0}){return n!=="deflated"&&(n!=="wrapped"&&(t=ur.wrap({type:e,object:t})),r=await Un(t)),{oid:r,object:t}}async function o8({object:e}){try{F("object",e),typeof e=="string"?e=Buffer.from(e,"utf8"):e=Buffer.from(e);let t="blob",{oid:n,object:r}=await s8({type:"blob",format:"content",object:e});return{oid:n,type:t,object:new Uint8Array(r),format:"wrapped"}}catch(t){throw t.caller="git.hashBlob",t}}async function l8({fs:e,cache:t,onProgress:n,dir:r,gitdir:i,filepath:a}){try{a=B(r,a);let s=await e.read(a),o=c=>We({fs:e,cache:t,gitdir:i,oid:c}),l=await Qa.fromPack({pack:s,getExternalRefDelta:o,onProgress:n});return await e.write(a.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(s){throw s.caller="git.indexPack",s}}async function c8({fs:e,onProgress:t,dir:n,gitdir:r=B(n,".git"),filepath:i,cache:a={}}){try{return F("fs",e),F("dir",n),F("gitdir",n),F("filepath",i),await l8({fs:new Q(e),cache:a,onProgress:t,dir:n,gitdir:r,filepath:i})}catch(s){throw s.caller="git.indexPack",s}}async function u8({fs:e,bare:t=!1,dir:n,gitdir:r=t?n:B(n,".git"),defaultBranch:i="master"}){try{return F("fs",e),F("gitdir",r),t||F("dir",n),await z1({fs:new Q(e),bare:t,dir:n,gitdir:r,defaultBranch:i})}catch(a){throw a.caller="git.init",a}}async function Y1({fs:e,cache:t,gitdir:n,oid:r,ancestor:i,depth:a}){let s=await zr.read({fs:e,gitdir:n});if(!r)throw new Ot("oid");if(!i)throw new Ot("ancestor");if(r===i)return!1;let o=[r],l=new Set,c=0;for(;o.length;){if(c++===a)throw new ss(a);let u=o.shift(),{type:f,object:h}=await We({fs:e,cache:t,gitdir:n,oid:u});if(f!=="commit")throw new At(u,f,"commit");let d=Rt.from(h).parse();for(let p of d.parent)if(p===i)return!0;if(!s.has(u))for(let p of d.parent)l.has(p)||(o.push(p),l.add(p))}return!1}async function f8({fs:e,dir:t,gitdir:n=B(t,".git"),oid:r,ancestor:i,depth:a=-1,cache:s={}}){try{return F("fs",e),F("gitdir",n),F("oid",r),F("ancestor",i),await Y1({fs:new Q(e),cache:s,gitdir:n,oid:r,ancestor:i,depth:a})}catch(o){throw o.caller="git.isDescendent",o}}async function h8({fs:e,dir:t,gitdir:n=B(t,".git"),filepath:r}){try{return F("fs",e),F("dir",t),F("gitdir",n),F("filepath",r),Ri.isIgnored({fs:new Q(e),dir:t,gitdir:n,filepath:r})}catch(i){throw i.caller="git.isIgnored",i}}async function d8({fs:e,dir:t,gitdir:n=B(t,".git"),remote:r}){try{return F("fs",e),F("gitdir",n),q.listBranches({fs:new Q(e),gitdir:n,remote:r})}catch(i){throw i.caller="git.listBranches",i}}async function p8({fs:e,gitdir:t,ref:n,cache:r}){if(n){let i=await q.resolve({gitdir:t,fs:e,ref:n}),a=[];return await Z1({fs:e,cache:r,gitdir:t,oid:i,filenames:a,prefix:""}),a}else return ct.acquire({fs:e,gitdir:t,cache:r},async function(i){return i.entries.map(a=>a.path)})}async function Z1({fs:e,cache:t,gitdir:n,oid:r,filenames:i,prefix:a}){let{tree:s}=await Bi({fs:e,cache:t,gitdir:n,oid:r});for(let o of s)o.type==="tree"?await Z1({fs:e,cache:t,gitdir:n,oid:o.oid,filenames:i,prefix:B(a,o.path)}):i.push(B(a,o.path))}async function m8({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r,cache:i={}}){try{return F("fs",e),F("gitdir",n),await p8({fs:new Q(e),cache:i,gitdir:n,ref:r})}catch(a){throw a.caller="git.listFiles",a}}async function g8({fs:e,cache:t,gitdir:n,ref:r}){let i;try{i=await q.resolve({gitdir:n,fs:e,ref:r})}catch(o){if(o instanceof Re)return[]}return(await Bi({fs:e,cache:t,gitdir:n,oid:i})).tree.map(o=>({target:o.path,note:o.oid}))}async function y8({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r="refs/notes/commits",cache:i={}}){try{return F("fs",e),F("gitdir",n),F("ref",r),await g8({fs:new Q(e),cache:i,gitdir:n,ref:r})}catch(a){throw a.caller="git.listNotes",a}}async function v8({fs:e,gitdir:t}){let n=await Ve.get({fs:e,gitdir:t}),r=await n.getSubsections("remote");return Promise.all(r.map(async a=>{let s=await n.get(`remote.${a}.url`);return{remote:a,url:s}}))}async function w8({fs:e,dir:t,gitdir:n=B(t,".git")}){try{return F("fs",e),F("gitdir",n),await v8({fs:new Q(e),gitdir:n})}catch(r){throw r.caller="git.listRemotes",r}}async function b8(e){let t=ze.streamReader(e),n=[],r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let[i,a,...s]=r.split(" "),o={ref:a,oid:i};for(let l of s){let[c,u]=l.split(":");c==="symref-target"?o.target=u:c==="peeled"&&(o.peeled=u)}n.push(o)}return n}async function x8({prefix:e,symrefs:t,peelTags:n}){let r=[];return r.push(ze.encode(`command=ls-refs +`)),r.push(ze.encode(`agent=${Qo.agent} +`)),(n||t||e)&&r.push(ze.delim()),n&&r.push(ze.encode("peel")),t&&r.push(ze.encode("symrefs")),e&&r.push(ze.encode(`ref-prefix ${e}`)),r.push(ze.flush()),r}async function _8({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,url:a,headers:s={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{F("http",e),F("url",a);let h=await ji.discover({http:e,onAuth:t,onAuthSuccess:n,onAuthFailure:r,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,headers:s,protocolVersion:l});if(h.protocolVersion===1)return X1(h,c,u,f);let d=await x8({prefix:c,symrefs:u,peelTags:f}),p=await ji.connect({http:e,auth:h.auth,headers:s,corsProxy:i,service:o?"git-receive-pack":"git-upload-pack",url:a,body:d});return b8(p.body)}catch(h){throw h.caller="git.listServerRefs",h}}async function S8({fs:e,dir:t,gitdir:n=B(t,".git")}){try{return F("fs",e),F("gitdir",n),q.listTags({fs:new Q(e),gitdir:n})}catch(r){throw r.caller="git.listTags",r}}function E8(e,t){return e.committer.timestamp-t.committer.timestamp}var A8="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function _1({fs:e,cache:t,gitdir:n,oid:r,fileId:i}){if(i===A8)return;let a=r,s,o=await Oi({fs:e,cache:t,gitdir:n,oid:r}),l=o.tree;return i===o.oid?s=o.path:(s=await K1({fs:e,cache:t,gitdir:n,tree:l,fileId:i,oid:a}),Array.isArray(s)&&(s.length===0?s=void 0:s.length===1&&(s=s[0]))),s}async function K1({fs:e,cache:t,gitdir:n,tree:r,fileId:i,oid:a,filepaths:s=[],parentPath:o=""}){let l=r.entries().map(function(c){let u;return c.oid===i?(u=B(o,c.path),s.push(u)):c.type==="tree"&&(u=We({fs:e,cache:t,gitdir:n,oid:c.oid}).then(function({object:f}){return K1({fs:e,cache:t,gitdir:n,tree:It.from(f),fileId:i,oid:a,filepaths:s,parentPath:B(o,c.path)})})),u});return await Promise.all(l),s}async function k8({fs:e,cache:t,gitdir:n,filepath:r,ref:i,depth:a,since:s,force:o,follow:l}){let c=typeof s=="undefined"?void 0:Math.floor(s.valueOf()/1e3),u=[],f=await zr.read({fs:e,gitdir:n}),h=await q.resolve({fs:e,gitdir:n,ref:i}),d=[await zo({fs:e,cache:t,gitdir:n,oid:h})],p,g,m;function w(b){m&&r&&u.push(b)}for(;d.length>0;){let b=d.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(r){let S;try{S=await ms({fs:e,cache:t,gitdir:n,oid:b.commit.tree,filepath:r}),g&&p!==S&&u.push(g),p=S,g=b,m=!0}catch(A){if(A instanceof Re){let x=l&&p;if(x&&(x=await _1({fs:e,cache:t,gitdir:n,oid:b.commit.tree,fileId:p}),x))if(Array.isArray(x)){if(g){let k=await _1({fs:e,cache:t,gitdir:n,oid:g.commit.tree,fileId:p});if(Array.isArray(k))if(x=x.filter(y=>k.indexOf(y)===-1),x.length===1)x=x[0],r=x,g&&u.push(g);else{x=!1,g&&u.push(g);break}}}else r=x,g&&u.push(g);if(!x){if(m&&p&&(u.push(g),!o))break;if(!o&&!l)throw A}g=b,m=!1}else throw A}}else u.push(b);if(a!==void 0&&u.length===a){w(b);break}if(!f.has(b.oid))for(let S of b.commit.parent){let A=await zo({fs:e,cache:t,gitdir:n,oid:S});d.map(x=>x.oid).includes(A.oid)||d.push(A)}d.length===0&&w(b),d.sort((S,A)=>E8(S.commit,A.commit))}return u}async function T8({fs:e,dir:t,gitdir:n=B(t,".git"),filepath:r,ref:i="HEAD",depth:a,since:s,force:o,follow:l,cache:c={}}){try{return F("fs",e),F("gitdir",n),F("ref",i),await k8({fs:new Q(e),cache:c,gitdir:n,filepath:r,ref:i,depth:a,since:s,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function C8({fs:e,onSign:t,dir:n,gitdir:r=B(n,".git"),ours:i,theirs:a,fastForward:s=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:h,committer:d,signingKey:p,cache:g={},mergeDriver:m}){try{F("fs",e),p&&F("onSign",t);let w=new Q(e),b=await Gr({fs:w,gitdir:r,author:h});if(!b&&(!o||!s))throw new kt("author");let S=await Li({fs:w,gitdir:r,author:b,committer:d});if(!S&&(!o||!s))throw new kt("committer");return await V1({fs:w,cache:g,dir:n,gitdir:r,ours:i,theirs:a,fastForward:s,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:b,committer:S,signingKey:p,onSign:t,mergeDriver:m})}catch(w){throw w.caller="git.merge",w}}var F8={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function J1({fs:e,cache:t,dir:n,gitdir:r=B(n,".git"),oids:i}){let a=new Gf.default,s=[];function o(u,f){let h=Buffer.from(u,f);s.push(h),a.update(h)}async function l({stype:u,object:f}){let h=F8[u],d=f.length,p=d>15?128:0,g=d&15;d=d>>>4;let m=(p|h|g).toString(16);for(o(m,"hex");p;)p=d>127?128:0,m=p|d&127,o(Uf(2,m),"hex"),d=d>>>7;o(Buffer.from(await R1(f)))}o("PACK"),o("00000002","hex"),o(Uf(8,i.length),"hex");for(let u of i){let{type:f,object:h}=await We({fs:e,cache:t,gitdir:r,oid:u});await l({write:o,object:h,stype:f})}let c=a.digest();return s.push(c),s}async function P8({fs:e,cache:t,gitdir:n,oids:r,write:i}){let a=await J1({fs:e,cache:t,gitdir:n,oids:r}),s=Buffer.from(await Vo(a)),l=`pack-${s.slice(-20).toString("hex")}.pack`;return i?(await e.write(B(n,`objects/pack/${l}`),s),{filename:l}):{filename:l,packfile:new Uint8Array(s)}}async function M8({fs:e,dir:t,gitdir:n=B(t,".git"),oids:r,write:i=!1,cache:a={}}){try{return F("fs",e),F("gitdir",n),F("oids",r),await P8({fs:new Q(e),cache:a,gitdir:n,oids:r,write:i})}catch(s){throw s.caller="git.packObjects",s}}async function O8({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l=B(o,".git"),ref:c,url:u,remote:f,remoteRef:h,prune:d=!1,pruneTags:p=!1,fastForward:g=!0,fastForwardOnly:m=!1,corsProxy:w,singleBranch:b,headers:S={},author:A,committer:x,signingKey:k,cache:y={}}){try{F("fs",e),F("gitdir",l);let E=new Q(e),_=await Gr({fs:E,gitdir:l,author:A});if(!_)throw new kt("author");let C=await Li({fs:E,gitdir:l,author:_,committer:x});if(!C)throw new kt("committer");return await W1({fs:E,cache:y,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,dir:o,gitdir:l,ref:c,url:u,remote:f,remoteRef:h,fastForward:g,fastForwardOnly:m,corsProxy:w,singleBranch:b,headers:S,author:_,committer:C,signingKey:k,prune:d,pruneTags:p})}catch(E){throw E.caller="git.pull",E}}async function I8({fs:e,cache:t,dir:n,gitdir:r=B(n,".git"),start:i,finish:a}){let s=await zr.read({fs:e,gitdir:r}),o=new Set,l=new Set;for(let f of i)o.add(await q.resolve({fs:e,gitdir:r,ref:f}));for(let f of a)try{let h=await q.resolve({fs:e,gitdir:r,ref:f});l.add(h)}catch(h){}let c=new Set;async function u(f){c.add(f);let{type:h,object:d}=await We({fs:e,cache:t,gitdir:r,oid:f});if(h==="tag"){let g=Ut.from(d).headers().object;return u(g)}if(h!=="commit")throw new At(f,h,"commit");if(!s.has(f)){let g=Rt.from(d).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 Pf({fs:e,cache:t,dir:n,gitdir:r=B(n,".git"),oids:i}){let a=new Set;async function s(o){if(a.has(o))return;a.add(o);let{type:l,object:c}=await We({fs:e,cache:t,gitdir:r,oid:o});if(l==="tag"){let f=Ut.from(c).headers().object;await s(f)}else if(l==="commit"){let f=Rt.from(c).headers().tree;await s(f)}else if(l==="tree"){let u=It.from(c);for(let f of u)f.type==="blob"&&a.add(f.oid),f.type==="tree"&&await s(f.oid)}}for(let o of i)await s(o);return a}async function R8(e){let t={},n="",r=ze.streamReader(e),i=await r();for(;i!==!0;)i!==null&&(n+=i.toString("utf8")+` +`),i=await r();let a=n.toString("utf8").split(` +`);if(i=a.shift(),!i.startsWith("unpack "))throw new Ur('unpack ok" or "unpack [error message]',i);t.ok=i==="unpack ok",t.ok||(t.error=i.slice(7)),t.refs={};for(let s of a){if(s.trim()==="")continue;let o=s.slice(0,2),l=s.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);t.refs[u]={ok:o==="ok",error:f}}return t}async function L8({capabilities:e=[],triplets:t=[]}){let n=[],r=`\0 ${e.join(" ")}`;for(let i of t)n.push(ze.encode(`${i.oldoid} ${i.oid} ${i.fullRef}${r} +`)),r="";return n.push(ze.flush()),n}async function j8({fs:e,cache:t,http:n,onProgress:r,onMessage:i,onAuth:a,onAuthSuccess:s,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:h,url:d,force:p=!1,delete:g=!1,corsProxy:m,headers:w={}}){let b=u||await Vr({fs:e,gitdir:c});if(typeof b=="undefined")throw new Ot("ref");let S=await Ve.get({fs:e,gitdir:c});h=h||await S.get(`branch.${b}.pushRemote`)||await S.get("remote.pushDefault")||await S.get(`branch.${b}.remote`)||"origin";let A=d||await S.get(`remote.${h}.pushurl`)||await S.get(`remote.${h}.url`);if(typeof A=="undefined")throw new Ot("remote OR url");let x=f||await S.get(`branch.${b}.merge`);if(typeof A=="undefined")throw new Ot("remoteRef");m===void 0&&(m=await S.get("http.corsProxy"));let k=await q.expand({fs:e,gitdir:c,ref:b}),y=g?"0000000000000000000000000000000000000000":await q.resolve({fs:e,gitdir:c,ref:k}),E=Di.getRemoteHelperFor({url:A}),_=await E.discover({http:n,onAuth:a,onAuthSuccess:s,onAuthFailure:o,corsProxy:m,service:"git-receive-pack",url:A,headers:w,protocolVersion:1}),C=_.auth,P;if(!x)P=k;else try{P=await q.expandAgainstMap({ref:x,map:_.refs})}catch(z){if(z instanceof Re)P=x.startsWith("refs/")?x:`refs/heads/${x}`;else throw z}let L=_.refs.get(P)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:h,url:A,localRef:{ref:g?"(delete)":k,oid:y},remoteRef:{ref:P,oid:L}}))throw new Mi;let N=!_.capabilities.has("no-thin"),j=new Set;if(!g){let z=[..._.refs.values()],D=new Set;if(L!=="0000000000000000000000000000000000000000"){let se=await Xf({fs:e,cache:t,gitdir:c,oids:[y,L]});for(let Se of se)z.push(Se);N&&(D=await Pf({fs:e,cache:t,gitdir:c,oids:se}))}if(!z.includes(y)){let se=await I8({fs:e,cache:t,gitdir:c,start:[y],finish:z});j=await Pf({fs:e,cache:t,gitdir:c,oids:se})}if(N){try{let se=await q.resolve({fs:e,gitdir:c,ref:`refs/remotes/${h}/HEAD`,depth:2}),{oid:Se}=await q.resolveAgainstMap({ref:se.replace(`refs/remotes/${h}/`,""),fullref:se,map:_.refs}),gt=[Se];for(let be of await Pf({fs:e,cache:t,gitdir:c,oids:gt}))D.add(be)}catch(se){}for(let se of D)j.delete(se)}if(y===L&&(p=!0),!p){if(k.startsWith("refs/tags")&&L!=="0000000000000000000000000000000000000000")throw new Pi("tag-exists");if(y!=="0000000000000000000000000000000000000000"&&L!=="0000000000000000000000000000000000000000"&&!await Y1({fs:e,cache:t,gitdir:c,oid:y,ancestor:L,depth:-1}))throw new Pi("not-fast-forward")}}let Y=U1([..._.capabilities],["report-status","side-band-64k",`agent=${Qo.agent}`]),le=await L8({capabilities:Y,triplets:[{oldoid:L,oid:y,fullRef:P}]}),he=g?[]:await J1({fs:e,cache:t,gitdir:c,oids:[...j]}),ae=await E.connect({http:n,onProgress:r,corsProxy:m,service:"git-receive-pack",url:A,auth:C,headers:w,body:[...le,...he]}),{packfile:Pe,progress:de}=await Wo.demux(ae.body);if(i){let z=G1(de);gs(z,async D=>{await i(D)})}let $=await R8(Pe);if(ae.headers&&($.headers=ae.headers),h&&$.ok&&$.refs[P].ok&&!k.startsWith("refs/tags")){let z=`refs/remotes/${h}/${P.replace("refs/heads","")}`;g?await q.deleteRef({fs:e,gitdir:c,ref:z}):await q.writeRef({fs:e,gitdir:c,ref:z,value:y})}if($.ok&&Object.values($.refs).every(z=>z.ok))return $;{let z=Object.entries($.refs).filter(([D,se])=>!se.ok).map(([D,se])=>` + - ${D}: ${se.error}`).join("");throw new as(z,$)}}async function D8({fs:e,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,dir:l,gitdir:c=B(l,".git"),ref:u,remoteRef:f,remote:h="origin",url:d,force:p=!1,delete:g=!1,corsProxy:m,headers:w={},cache:b={}}){try{return F("fs",e),F("http",t),F("gitdir",c),await j8({fs:new Q(e),cache:b,http:t,onProgress:n,onMessage:r,onAuth:i,onAuthSuccess:a,onAuthFailure:s,onPrePush:o,gitdir:c,ref:u,remoteRef:f,remote:h,url:d,force:p,delete:g,corsProxy:m,headers:w})}catch(S){throw S.caller="git.push",S}}async function Q1({fs:e,cache:t,gitdir:n,oid:r}){let{type:i,object:a}=await We({fs:e,cache:t,gitdir:n,oid:r});if(i==="tag")return r=Ut.from(a).parse().object,Q1({fs:e,cache:t,gitdir:n,oid:r});if(i!=="blob")throw new At(r,i,"blob");return{oid:r,blob:new Uint8Array(a)}}async function ey({fs:e,cache:t,gitdir:n,oid:r,filepath:i=void 0}){return i!==void 0&&(r=await ms({fs:e,cache:t,gitdir:n,oid:r,filepath:i})),await Q1({fs:e,cache:t,gitdir:n,oid:r})}async function ys({fs:e,dir:t,gitdir:n=B(t,".git"),oid:r,filepath:i,cache:a={}}){try{return F("fs",e),F("gitdir",n),F("oid",r),await ey({fs:new Q(e),cache:a,gitdir:n,oid:r,filepath:i})}catch(s){throw s.caller="git.readBlob",s}}async function B8({fs:e,dir:t,gitdir:n=B(t,".git"),oid:r,cache:i={}}){try{return F("fs",e),F("gitdir",n),F("oid",r),await zo({fs:new Q(e),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.readCommit",a}}async function N8({fs:e,cache:t,gitdir:n,ref:r="refs/notes/commits",oid:i}){let a=await q.resolve({gitdir:n,fs:e,ref:r}),{blob:s}=await ey({fs:e,cache:t,gitdir:n,oid:a,filepath:i});return s}async function $8({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r="refs/notes/commits",oid:i,cache:a={}}){try{return F("fs",e),F("gitdir",n),F("ref",r),F("oid",i),await N8({fs:new Q(e),cache:a,gitdir:n,ref:r,oid:i})}catch(s){throw s.caller="git.readNote",s}}async function H8({fs:e,dir:t,gitdir:n=B(t,".git"),oid:r,format:i="parsed",filepath:a=void 0,encoding:s=void 0,cache:o={}}){try{F("fs",e),F("gitdir",n),F("oid",r);let l=new Q(e);a!==void 0&&(r=await ms({fs:l,cache:o,gitdir:n,oid:r,filepath:a}));let u=await We({fs:l,cache:o,gitdir:n,oid:r,format:i==="parsed"?"content":i});if(u.oid=r,i==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=Rt.from(u.object).parse();break;case"tree":u.object=It.from(u.object).entries();break;case"blob":s?u.object=u.object.toString(s):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=Ut.from(u.object).parse();break;default:throw new At(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(l){throw l.caller="git.readObject",l}}async function U8({fs:e,cache:t,gitdir:n,oid:r}){let{type:i,object:a}=await We({fs:e,cache:t,gitdir:n,oid:r,format:"content"});if(i!=="tag")throw new At(r,i,"tag");let s=Ut.from(a);return{oid:r,tag:s.parse(),payload:s.payload()}}async function G8({fs:e,dir:t,gitdir:n=B(t,".git"),oid:r,cache:i={}}){try{return F("fs",e),F("gitdir",n),F("oid",r),await U8({fs:new Q(e),cache:i,gitdir:n,oid:r})}catch(a){throw a.caller="git.readTag",a}}async function z8({fs:e,dir:t,gitdir:n=B(t,".git"),oid:r,filepath:i=void 0,cache:a={}}){try{return F("fs",e),F("gitdir",n),F("oid",r),await Bi({fs:new Q(e),cache:a,gitdir:n,oid:r,filepath:i})}catch(s){throw s.caller="git.readTree",s}}async function V8({fs:e,dir:t,gitdir:n=B(t,".git"),filepath:r,cache:i={}}){try{F("fs",e),F("gitdir",n),F("filepath",r),await ct.acquire({fs:new Q(e),gitdir:n,cache:i},async function(a){a.delete({filepath:r})})}catch(a){throw a.caller="git.remove",a}}async function W8({fs:e,cache:t,onSign:n,gitdir:r,ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l}){let c;try{c=await q.resolve({gitdir:r,fs:e,ref:i})}catch(p){if(!(p instanceof Re))throw p}let f=(await Bi({fs:e,gitdir:r,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==a);let h=await Vf({fs:e,gitdir:r,tree:f});return await Jo({fs:e,cache:t,onSign:n,gitdir:r,ref:i,tree:h,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote' +`,author:s,committer:o,signingKey:l})}async function q8({fs:e,onSign:t,dir:n,gitdir:r=B(n,".git"),ref:i="refs/notes/commits",oid:a,author:s,committer:o,signingKey:l,cache:c={}}){try{F("fs",e),F("gitdir",r),F("oid",a);let u=new Q(e),f=await Gr({fs:u,gitdir:r,author:s});if(!f)throw new kt("author");let h=await Li({fs:u,gitdir:r,author:f,committer:o});if(!h)throw new kt("committer");return await W8({fs:u,cache:c,onSign:t,gitdir:r,ref:i,oid:a,author:f,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function X8({fs:e,gitdir:t,oldref:n,ref:r,checkout:i=!1}){if(r!==fn.default.clean(r))throw new Gn(r,fn.default.clean(r));if(n!==fn.default.clean(n))throw new Gn(n,fn.default.clean(n));let a=`refs/heads/${n}`,s=`refs/heads/${r}`;if(await q.exists({fs:e,gitdir:t,ref:s}))throw new hn("branch",r,!1);let l=await q.resolve({fs:e,gitdir:t,ref:a,depth:1});await q.writeRef({fs:e,gitdir:t,ref:s,value:l}),await q.deleteRef({fs:e,gitdir:t,ref:a});let u=await Vr({fs:e,gitdir:t,fullname:!0})===a;(i||u)&&await q.writeSymbolicRef({fs:e,gitdir:t,ref:"HEAD",value:s})}async function Y8({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r,oldref:i,checkout:a=!1}){try{return F("fs",e),F("gitdir",n),F("ref",r),F("oldref",i),await X8({fs:new Q(e),gitdir:n,ref:r,oldref:i,checkout:a})}catch(s){throw s.caller="git.renameBranch",s}}async function ty({gitdir:e,type:t,object:n}){return Un(ur.wrap({type:t,object:n}))}async function Z8({fs:e,dir:t,gitdir:n=B(t,".git"),filepath:r,ref:i,cache:a={}}){try{F("fs",e),F("gitdir",n),F("filepath",r);let s=new Q(e),o,l;try{o=await q.resolve({fs:s,gitdir:n,ref:i||"HEAD"})}catch(f){if(i)throw f}if(o)try{o=await ms({fs:s,cache:a,gitdir:n,oid:o,filepath:r})}catch(f){o=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=t&&await s.read(B(t,r));u&&(l=await ty({gitdir:n,type:"blob",object:u}),o===l&&(c=await s.lstat(B(t,r)))),await ct.acquire({fs:s,gitdir:n,cache:a},async function(f){f.delete({filepath:r}),o&&f.insert({filepath:r,stats:c,oid:o})})}catch(s){throw s.caller="git.reset",s}}async function K8({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r,depth:i}){try{return F("fs",e),F("gitdir",n),F("ref",r),await q.resolve({fs:new Q(e),gitdir:n,ref:r,depth:i})}catch(a){throw a.caller="git.resolveRef",a}}async function J8({fs:e,dir:t,gitdir:n=B(t,".git"),path:r,value:i,append:a=!1}){try{F("fs",e),F("gitdir",n),F("path",r);let s=new Q(e),o=await Ve.get({fs:s,gitdir:n});a?await o.append(r,i):await o.set(r,i),await Ve.save({fs:s,gitdir:n,config:o})}catch(s){throw s.caller="git.setConfig",s}}async function Q8({fs:e,dir:t,gitdir:n=B(t,".git"),filepath:r,cache:i={}}){try{F("fs",e),F("gitdir",n),F("filepath",r);let a=new Q(e);if(await Ri.isIgnored({fs:a,gitdir:n,dir:t,filepath:r}))return"ignored";let o=await e6({fs:a,cache:i,gitdir:n}),l=await ny({fs:a,cache:i,gitdir:n,tree:o,path:r}),c=await ct.acquire({fs:a,gitdir:n,cache:i},async function(g){for(let m of g)if(m.path===r)return m;return null}),u=await a.lstat(B(t,r)),f=l!==null,h=c!==null,d=u!==null,p=async()=>{if(h&&!Do(c,u))return c.oid;{let g=await a.read(B(t,r)),m=await ty({gitdir:n,type:"blob",object:g});return h&&c.oid===m&&u.size!==-1&&ct.acquire({fs:a,gitdir:n,cache:i},async function(w){w.insert({filepath:r,stats:u,oid:m})}),m}};if(!f&&!d&&!h)return"absent";if(!f&&!d&&h)return"*absent";if(!f&&d&&!h)return"*added";if(!f&&d&&h)return await p()===c.oid?"added":"*added";if(f&&!d&&!h)return"deleted";if(f&&!d&&h)return l===c.oid,"*deleted";if(f&&d&&!h)return await p()===l?"*undeleted":"*undeletemodified";if(f&&d&&h){let g=await p();return g===l?g===c.oid?"unmodified":"*unmodified":g===c.oid?"modified":"*modified"}}catch(a){throw a.caller="git.status",a}}async function ny({fs:e,cache:t,gitdir:n,tree:r,path:i}){typeof i=="string"&&(i=i.split("/"));let a=i.shift();for(let s of r)if(s.path===a){if(i.length===0)return s.oid;let{type:o,object:l}=await We({fs:e,cache:t,gitdir:n,oid:s.oid});if(o==="tree"){let c=It.from(l);return ny({fs:e,cache:t,gitdir:n,tree:c,path:i})}if(o==="blob")throw new At(s.oid,o,"blob",i.join("/"))}return null}async function e6({fs:e,cache:t,gitdir:n}){let r;try{r=await q.resolve({fs:e,gitdir:n,ref:"HEAD"})}catch(a){if(a instanceof Re)return[]}let{tree:i}=await Bi({fs:e,cache:t,gitdir:n,oid:r});return i}async function t6({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r="HEAD",filepaths:i=["."],filter:a,cache:s={},ignored:o=!1}){try{F("fs",e),F("gitdir",n),F("ref",r);let l=new Q(e);return await Ii({fs:l,cache:s,dir:t,gitdir:n,trees:[lr({ref:r}),Ko(),Zo()],map:async function(c,[u,f,h]){if(!u&&!h&&f&&!o&&await Ri.isIgnored({fs:l,dir:t,filepath:c})||!i.some(k=>$1(c,k)))return null;if(a&&!a(c))return;let[d,p,g]=await Promise.all([u&&u.type(),f&&f.type(),h&&h.type()]),m=[d,p,g].includes("blob");if((d==="tree"||d==="special")&&!m)return;if(d==="commit")return null;if((p==="tree"||p==="special")&&!m)return;if(g==="commit")return null;if((g==="tree"||g==="special")&&!m)return;let w=d==="blob"?await u.oid():void 0,b=g==="blob"?await h.oid():void 0,S;d!=="blob"&&p==="blob"&&g!=="blob"?S="42":p==="blob"&&(S=await f.oid());let A=[void 0,w,S,b],x=A.map(k=>A.indexOf(k));return x.shift(),[c,...x]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function n6({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r,object:i,force:a=!1}){try{F("fs",e),F("gitdir",n),F("ref",r);let s=new Q(e);if(r===void 0)throw new Ot("ref");r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`;let o=await q.resolve({fs:s,gitdir:n,ref:i||"HEAD"});if(!a&&await q.exists({fs:s,gitdir:n,ref:r}))throw new hn("tag",r);await q.writeRef({fs:s,gitdir:n,ref:r,value:o})}catch(s){throw s.caller="git.tag",s}}async function r6({fs:e,dir:t,gitdir:n=B(t,".git"),cache:r={},filepath:i,oid:a,mode:s,add:o,remove:l,force:c}){try{F("fs",e),F("gitdir",n),F("filepath",i);let u=new Q(e);if(l)return await ct.acquire({fs:u,gitdir:n,cache:r},async function(h){let d;if(!c&&(d=await u.lstat(B(t,i)),d)){if(d.isDirectory())throw new fr("directory");return}h.has({filepath:i})&&h.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(B(t,i)),!f)throw new Re(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new fr("directory")}return await ct.acquire({fs:u,gitdir:n,cache:r},async function(h){if(!o&&!h.has({filepath:i}))throw new Re(`file at "${i}" in index and "add" not set`);let d={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:s,uid:0,gid:0,size:0};if(!a){d=f;let p=d.isSymbolicLink()?await u.readlink(B(t,i)):await u.read(B(t,i));a=await Gt({fs:u,gitdir:n,type:"blob",format:"content",object:p})}return h.insert({filepath:i,oid:a,stats:d}),a})}catch(u){throw u.caller="git.updateIndex",u}}function i6(){try{return Qo.version}catch(e){throw e.caller="git.version",e}}async function a6({fs:e,dir:t,gitdir:n=B(t,".git"),trees:r,map:i,reduce:a,iterate:s,cache:o={}}){try{return F("fs",e),F("gitdir",n),F("trees",r),await Ii({fs:new Q(e),cache:o,dir:t,gitdir:n,trees:r,map:i,reduce:a,iterate:s})}catch(l){throw l.caller="git.walk",l}}async function s6({fs:e,dir:t,gitdir:n=B(t,".git"),blob:r}){try{return F("fs",e),F("gitdir",n),F("blob",r),await Gt({fs:new Q(e),gitdir:n,type:"blob",object:r,format:"content"})}catch(i){throw i.caller="git.writeBlob",i}}async function o6({fs:e,gitdir:t,commit:n}){let r=Rt.from(n).toObject();return await Gt({fs:e,gitdir:t,type:"commit",object:r,format:"content"})}async function l6({fs:e,dir:t,gitdir:n=B(t,".git"),commit:r}){try{return F("fs",e),F("gitdir",n),F("commit",r),await o6({fs:new Q(e),gitdir:n,commit:r})}catch(i){throw i.caller="git.writeCommit",i}}async function c6({fs:e,dir:t,gitdir:n=B(t,".git"),type:r,object:i,format:a="parsed",oid:s,encoding:o=void 0}){try{let l=new Q(e);if(a==="parsed"){switch(r){case"commit":i=Rt.from(i).toObject();break;case"tree":i=It.from(i).toObject();break;case"blob":i=Buffer.from(i,o);break;case"tag":i=Ut.from(i).toObject();break;default:throw new At(s||"",r,"blob|commit|tag|tree")}a="content"}return s=await Gt({fs:l,gitdir:n,type:r,object:i,oid:s,format:a}),s}catch(l){throw l.caller="git.writeObject",l}}async function u6({fs:e,dir:t,gitdir:n=B(t,".git"),ref:r,value:i,force:a=!1,symbolic:s=!1}){try{F("fs",e),F("gitdir",n),F("ref",r),F("value",i);let o=new Q(e);if(r!==fn.default.clean(r))throw new Gn(r,fn.default.clean(r));if(!a&&await q.exists({fs:o,gitdir:n,ref:r}))throw new hn("ref",r);s?await q.writeSymbolicRef({fs:o,gitdir:n,ref:r,value:i}):(i=await q.resolve({fs:o,gitdir:n,ref:i}),await q.writeRef({fs:o,gitdir:n,ref:r,value:i}))}catch(o){throw o.caller="git.writeRef",o}}async function f6({fs:e,gitdir:t,tag:n}){let r=Ut.from(n).toObject();return await Gt({fs:e,gitdir:t,type:"tag",object:r,format:"content"})}async function h6({fs:e,dir:t,gitdir:n=B(t,".git"),tag:r}){try{return F("fs",e),F("gitdir",n),F("tag",r),await f6({fs:new Q(e),gitdir:n,tag:r})}catch(i){throw i.caller="git.writeTag",i}}async function d6({fs:e,dir:t,gitdir:n=B(t,".git"),tree:r}){try{return F("fs",e),F("gitdir",n),F("tree",r),await Vf({fs:new Q(e),gitdir:n,tree:r})}catch(i){throw i.caller="git.writeTree",i}}var p6={Errors:ps,STAGE:Zo,TREE:lr,WORKDIR:Ko,add:dC,abortMerge:lC,addNote:mC,addRemote:gC,annotatedTag:vC,branch:bC,checkout:_C,clone:IC,commit:RC,getConfig:t8,getConfigAll:r8,setConfig:J8,currentBranch:LC,deleteBranch:DC,deleteRef:BC,deleteRemote:$C,deleteTag:UC,expandOid:WC,expandRef:qC,fastForward:KC,fetch:JC,findMergeBase:QC,findRoot:e8,getRemoteInfo:i8,getRemoteInfo2:a8,hashBlob:o8,indexPack:c8,init:u8,isDescendent:f8,isIgnored:h8,listBranches:d8,listFiles:m8,listNotes:y8,listRemotes:w8,listServerRefs:_8,listTags:S8,log:T8,merge:C8,packObjects:M8,pull:O8,push:D8,readBlob:ys,readCommit:B8,readNote:$8,readObject:H8,readTag:G8,readTree:z8,remove:V8,removeNote:q8,renameBranch:Y8,resetIndex:Z8,updateIndex:r6,resolveRef:K8,status:Q8,statusMatrix:t6,tag:n6,version:i6,walk:a6,writeBlob:s6,writeCommit:l6,writeObject:c6,writeRef:u6,writeTag:h6,writeTree:d6},ie=p6;var _e=require("obsidian");v();var ni=require("obsidian");v();var hp=require("child_process"),HS=Xe(nl()),Yn=Xe(require("fs/promises")),Xn=require("obsidian"),He=Xe(require("path")),Gs=require("path");v();var gl=Xe(ly(),1),hl=Xe(nl(),1),Rv=require("child_process"),yw=Xe(Zf(),1),Gi=Xe(Zf(),1),Gw=require("node:events"),pl=Object.defineProperty,I6=Object.defineProperties,R6=Object.getOwnPropertyDescriptor,L6=Object.getOwnPropertyDescriptors,gh=Object.getOwnPropertyNames,cy=Object.getOwnPropertySymbols,Uy=Object.prototype.hasOwnProperty,j6=Object.prototype.propertyIsEnumerable,uy=(e,t,n)=>t in e?pl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tn=(e,t)=>{for(var n in t||(t={}))Uy.call(t,n)&&uy(e,n,t[n]);if(cy)for(var n of cy(t))j6.call(t,n)&&uy(e,n,t[n]);return e},bs=(e,t)=>I6(e,L6(t)),W=(e,t)=>function(){return e&&(t=(0,e[gh(e)[0]])(e=0)),t},D6=(e,t)=>function(){return t||(0,e[gh(e)[0]])((t={exports:{}}).exports,t),t.exports},et=(e,t)=>{for(var n in t)pl(e,n,{get:t[n],enumerable:!0})},B6=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of gh(t))!Uy.call(e,i)&&i!==n&&pl(e,i,{get:()=>t[i],enumerable:!(r=R6(t,i))||r.enumerable});return e},Ye=e=>B6(pl({},"__esModule",{value:!0}),e),ws=(e,t,n)=>new Promise((r,i)=>{var a=l=>{try{o(n.next(l))}catch(c){i(c)}},s=l=>{try{o(n.throw(l))}catch(c){i(c)}},o=l=>l.done?r(l.value):Promise.resolve(l.value).then(a,s);o((n=n.apply(e,t)).next())});function N6(...e){let t=new String(e);return ml.set(t,e),t}function ul(e){return e instanceof String&&ml.has(e)}function fy(e){return ml.get(e)||[]}var ml,Es=W({"src/lib/args/pathspec.ts"(){"use strict";ml=new WeakMap}}),dn,dr=W({"src/lib/errors/git-error.ts"(){"use strict";dn=class extends Error{constructor(e,t){super(t),this.task=e,Object.setPrototypeOf(this,new.target.prototype)}}}}),As,Vi=W({"src/lib/errors/git-response-error.ts"(){"use strict";dr(),As=class extends dn{constructor(e,t){super(void 0,t||String(e)),this.git=e}}}}),Gy,zy=W({"src/lib/errors/task-configuration-error.ts"(){"use strict";dr(),Gy=class extends dn{constructor(e){super(void 0,e)}}}});function Vy(e){return typeof e=="function"?e:Zr}function Wy(e){return typeof e=="function"&&e!==Zr}function qy(e,t){let n=e.indexOf(t);return n<=0?[e,""]:[e.substr(0,n),e.substr(n+1)]}function Xy(e,t=0){return Yy(e)&&e.length>t?e[t]:void 0}function Yr(e,t=0){if(Yy(e)&&e.length>t)return e[e.length-1-t]}function Yy(e){return!!(e&&typeof e.length=="number")}function ks(e="",t=!0,n=` +`){return e.split(n).reduce((r,i)=>{let a=t?i.trim():i;return a&&r.push(a),r},[])}function yh(e,t){return ks(e,!0).map(n=>t(n))}function vh(e){return(0,gl.exists)(e,gl.FOLDER)}function we(e,t){return Array.isArray(e)?e.includes(t)||e.push(t):e.add(t),t}function Zy(e,t){return Array.isArray(e)&&!e.includes(t)&&e.push(t),e}function yl(e,t){if(Array.isArray(e)){let n=e.indexOf(t);n>=0&&e.splice(n,1)}else e.delete(t);return t}function Cn(e){return Array.isArray(e)?e:[e]}function Ky(e){return e.replace(/[\s-]+(.)/g,(t,n)=>n.toUpperCase())}function Jy(e){return Cn(e).map(String)}function Oe(e,t=0){if(e==null)return t;let n=parseInt(e,10);return isNaN(n)?t:n}function xs(e,t){let n=[];for(let r=0,i=e.length;rn in e?{[n]:e[n]}:{}))}function rh(e=0){return new Promise(t=>setTimeout(t,e))}function ih(e){if(e!==!1)return e}var zi,Zr,Ts,vl=W({"src/lib/utils/util.ts"(){"use strict";zi="\0",Zr=()=>{},Ts=Object.prototype.toString.call.bind(Object.prototype.toString)}});function Fn(e,t,n){return t(e)?e:arguments.length>2?n:void 0}function wh(e,t){let n=ul(e)?"string":typeof e;return/number|string|boolean/.test(n)&&(!t||!t.includes(n))}function bh(e){return!!e&&Ts(e)==="[object Object]"}function ev(e){return typeof e=="function"}var Cs,yt,tv,fl,xh,nv=W({"src/lib/utils/argument-filters.ts"(){"use strict";vl(),Es(),Cs=e=>Array.isArray(e),yt=e=>typeof e=="string",tv=e=>Array.isArray(e)&&e.every(yt),fl=e=>yt(e)||Array.isArray(e)&&e.every(yt),xh=e=>e==null||"number|boolean|function".includes(typeof e)?!1:Array.isArray(e)||typeof e=="string"||typeof e.length=="number"}}),ah,$6=W({"src/lib/utils/exit-codes.ts"(){"use strict";ah=(e=>(e[e.SUCCESS=0]="SUCCESS",e[e.ERROR=1]="ERROR",e[e.NOT_FOUND=-2]="NOT_FOUND",e[e.UNCLEAN=128]="UNCLEAN",e))(ah||{})}}),Ss,H6=W({"src/lib/utils/git-output-streams.ts"(){"use strict";Ss=class{constructor(e,t){this.stdOut=e,this.stdErr=t}asStrings(){return new Ss(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}}),fe,hr,U6=W({"src/lib/utils/line-parser.ts"(){"use strict";fe=class{constructor(e,t){this.matches=[],this.parse=(n,r)=>(this.resetMatches(),this._regExp.every((i,a)=>this.addMatch(i,a,n(a)))?this.useMatches(r,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(e)?e:[e],t&&(this.useMatches=t)}useMatches(e,t){throw new Error("LineParser:useMatches not implemented")}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(e,t,n){let r=n&&e.exec(n);return r&&this.pushMatch(t,r),!!r}pushMatch(e,t){this.matches.push(...t.slice(1))}},hr=class extends fe{addMatch(e,t,n){return/^remote:\s/.test(String(n))&&super.addMatch(e,t,n)}pushMatch(e,t){(e>0||t.length>1)&&super.pushMatch(e,t)}}}});function rv(...e){let t=process.cwd(),n=Object.assign(tn({baseDir:t},iv),...e.filter(r=>typeof r=="object"&&r));return n.baseDir=n.baseDir||t,n.trimmed=n.trimmed===!0,n}var iv,G6=W({"src/lib/utils/simple-git-options.ts"(){"use strict";iv={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function _h(e,t=[]){return bh(e)?Object.keys(e).reduce((n,r)=>{let i=e[r];return ul(i)?n.push(i):wh(i,["boolean"])?n.push(r+"="+i):n.push(r),n},t):t}function Lt(e,t=0,n=!1){let r=[];for(let i=0,a=t<0?e.length:t;i{for(let a=ks(i,r),s=0,o=a.length;s{if(!(s+c>=o))return a[s+c]};t.some(({parse:c})=>c(l,e))}}),e}var W6=W({"src/lib/utils/task-parser.ts"(){"use strict";vl()}}),av={};et(av,{ExitCodes:()=>ah,GitOutputStreams:()=>Ss,LineParser:()=>fe,NOOP:()=>Zr,NULL:()=>zi,RemoteLineParser:()=>hr,append:()=>we,appendTaskOptions:()=>_h,asArray:()=>Cn,asCamelCase:()=>Ky,asFunction:()=>Vy,asNumber:()=>Oe,asStringArray:()=>Jy,bufferToString:()=>_s,callTaskParser:()=>sh,createInstanceConfig:()=>rv,delay:()=>rh,filterArray:()=>Cs,filterFunction:()=>ev,filterHasLength:()=>xh,filterPlainObject:()=>bh,filterPrimitives:()=>wh,filterString:()=>yt,filterStringArray:()=>tv,filterStringOrStringArray:()=>fl,filterType:()=>Fn,first:()=>Xy,folderExists:()=>vh,forEachLineWithContent:()=>yh,getTrailingOptions:()=>Lt,including:()=>Zy,isUserFunction:()=>Wy,last:()=>Yr,objectToString:()=>Ts,orVoid:()=>ih,parseStringResponse:()=>Dt,pick:()=>Qy,prefixedArray:()=>xs,remove:()=>yl,splitOn:()=>qy,toLinesWithContent:()=>ks,trailingFunctionArgument:()=>Ze,trailingOptionsArgument:()=>Sh});var oe=W({"src/lib/utils/index.ts"(){"use strict";nv(),$6(),H6(),U6(),G6(),V6(),W6(),vl()}}),sv={};et(sv,{CheckRepoActions:()=>oh,checkIsBareRepoTask:()=>lv,checkIsRepoRootTask:()=>ov,checkIsRepoTask:()=>q6});function q6(e){switch(e){case"bare":return lv();case"root":return ov()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:wl,parser:Eh}}function ov(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:wl,parser(t){return/^\.(git)?$/.test(t.trim())}}}function lv(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:wl,parser:Eh}}function X6(e){return/(Not a git repository|Kein Git-Repository)/i.test(String(e))}var oh,wl,Eh,cv=W({"src/lib/tasks/check-is-repo.ts"(){"use strict";oe(),oh=(e=>(e.BARE="bare",e.IN_TREE="tree",e.IS_REPO_ROOT="root",e))(oh||{}),wl=({exitCode:e},t,n,r)=>{if(e===128&&X6(t))return n(Buffer.from("false"));r(t)},Eh=e=>e.trim()==="true"}});function Y6(e,t){let n=new uv(e),r=e?hv:fv;return ks(t).forEach(i=>{let a=i.replace(r,"");n.paths.push(a),(dv.test(a)?n.folders:n.files).push(a)}),n}var uv,fv,hv,dv,Z6=W({"src/lib/responses/CleanSummary.ts"(){"use strict";oe(),uv=class{constructor(e){this.dryRun=e,this.paths=[],this.files=[],this.folders=[]}},fv=/^[a-z]+\s*/i,hv=/^[a-z]+\s+[a-z]+\s*/i,dv=/\/$/}}),lh={};et(lh,{EMPTY_COMMANDS:()=>bl,adhocExecTask:()=>pv,configurationErrorTask:()=>jt,isBufferTask:()=>gv,isEmptyTask:()=>yv,straightThroughBufferTask:()=>mv,straightThroughStringTask:()=>Tt});function pv(e){return{commands:bl,format:"empty",parser:e}}function jt(e){return{commands:bl,format:"empty",parser(){throw typeof e=="string"?new Gy(e):e}}}function Tt(e,t=!1){return{commands:e,format:"utf-8",parser(n){return t?String(n).trim():n}}}function mv(e){return{commands:e,format:"buffer",parser(t){return t}}}function gv(e){return e.format==="buffer"}function yv(e){return e.format==="empty"||!e.commands.length}var bl,Qe=W({"src/lib/tasks/task.ts"(){"use strict";zy(),bl=[]}}),vv={};et(vv,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Ah,CONFIG_ERROR_MODE_REQUIRED:()=>kh,CONFIG_ERROR_UNKNOWN_OPTION:()=>Th,CleanOptions:()=>sl,cleanTask:()=>wv,cleanWithOptionsTask:()=>K6,isCleanOptionsArray:()=>J6});function K6(e,t){let{cleanMode:n,options:r,valid:i}=Q6(e);return n?i.options?(r.push(...t),r.some(n4)?jt(Ah):wv(n,r)):jt(Th+JSON.stringify(e)):jt(kh)}function wv(e,t){return{commands:["clean",`-${e}`,...t],format:"utf-8",parser(r){return Y6(e==="n",r)}}}function J6(e){return Array.isArray(e)&&e.every(t=>Ch.has(t))}function Q6(e){let t,n=[],r={cleanMode:!1,options:!0};return e.replace(/[^a-z]i/g,"").split("").forEach(i=>{e4(i)?(t=i,r.cleanMode=!0):r.options=r.options&&t4(n[n.length]=`-${i}`)}),{cleanMode:t,options:n,valid:r}}function e4(e){return e==="f"||e==="n"}function t4(e){return/^-[a-z]$/i.test(e)&&Ch.has(e.charAt(1))}function n4(e){return/^-[^\-]/.test(e)?e.indexOf("i")>0:e==="--interactive"}var Ah,kh,Th,sl,Ch,bv=W({"src/lib/tasks/clean.ts"(){"use strict";Z6(),oe(),Qe(),Ah="Git clean interactive mode is not supported",kh='Git clean mode parameter ("n" or "f") is required',Th="Git clean unknown option found in: ",sl=(e=>(e.DRY_RUN="n",e.FORCE="f",e.IGNORED_INCLUDED="x",e.IGNORED_ONLY="X",e.EXCLUDING="e",e.QUIET="q",e.RECURSIVE="d",e))(sl||{}),Ch=new Set(["i",...Jy(Object.values(sl))])}});function r4(e){let t=new _v;for(let n of xv(e))t.addValue(n.file,String(n.key),n.value);return t}function i4(e,t){let n=null,r=[],i=new Map;for(let a of xv(e,t))a.key===t&&(r.push(n=a.value),i.has(a.file)||i.set(a.file,[]),i.get(a.file).push(n));return{key:t,paths:Array.from(i.keys()),scopes:i,value:n,values:r}}function a4(e){return e.replace(/^(file):/,"")}function*xv(e,t=null){let n=e.split("\0");for(let r=0,i=n.length-1;rObject.assign(e,this.values[t]),{})),this._all}addFile(e){if(!(e in this.values)){let t=Yr(this.files);this.values[e]=t?Object.create(this.values[t]):{},this.files.push(e)}return this.values[e]}addValue(e,t,n){let r=this.addFile(e);r.hasOwnProperty(t)?Array.isArray(r[t])?r[t].push(n):r[t]=[r[t],n]:r[t]=n,this._all=void 0}}}});function Kf(e,t){return typeof e=="string"&&ch.hasOwnProperty(e)?e:t}function o4(e,t,n,r){let i=["config",`--${r}`];return n&&i.push("--add"),i.push(e,t),{commands:i,format:"utf-8",parser(a){return a}}}function l4(e,t){let n=["config","--null","--show-origin","--get-all",e];return t&&n.splice(1,0,`--${t}`),{commands:n,format:"utf-8",parser(r){return i4(r,e)}}}function c4(e){let t=["config","--list","--show-origin","--null"];return e&&t.push(`--${e}`),{commands:t,format:"utf-8",parser(n){return r4(n)}}}function u4(){return{addConfig(e,t,...n){return this._runTask(o4(e,t,n[0]===!0,Kf(n[1],"local")),Ze(arguments))},getConfig(e,t){return this._runTask(l4(e,Kf(t,void 0)),Ze(arguments))},listConfig(...e){return this._runTask(c4(Kf(e[0],void 0)),Ze(arguments))}}}var ch,Sv=W({"src/lib/tasks/config.ts"(){"use strict";s4(),oe(),ch=(e=>(e.system="system",e.global="global",e.local="local",e.worktree="worktree",e))(ch||{})}});function f4(e){return Ev.has(e)}var Jf,Ev,Av=W({"src/lib/tasks/diff-name-status.ts"(){"use strict";Jf=(e=>(e.ADDED="A",e.COPIED="C",e.DELETED="D",e.MODIFIED="M",e.RENAMED="R",e.CHANGED="T",e.UNMERGED="U",e.UNKNOWN="X",e.BROKEN="B",e))(Jf||{}),Ev=new Set(Object.values(Jf))}});function h4(...e){return new Tv().param(...e)}function d4(e){let t=new Set,n={};return yh(e,r=>{let[i,a,s]=r.split(zi);t.add(i),(n[i]=n[i]||[]).push({line:Oe(a),path:i,preview:s})}),{paths:t,results:n}}function p4(){return{grep(e){let t=Ze(arguments),n=Lt(arguments);for(let i of kv)if(n.includes(i))return this._runTask(jt(`git.grep: use of "${i}" is not supported.`),t);typeof e=="string"&&(e=h4().param(e));let r=["grep","--null","-n","--full-name",...n,...e];return this._runTask({commands:r,format:"utf-8",parser(i){return d4(i)}},t)}}}var kv,vs,hy,Tv,Cv=W({"src/lib/tasks/grep.ts"(){"use strict";oe(),Qe(),kv=["-h"],vs=Symbol("grepQuery"),Tv=class{constructor(){this[hy]=[]}*[(hy=vs,Symbol.iterator)](){for(let e of this[vs])yield e}and(...e){return e.length&&this[vs].push("--and","(",...xs(e,"-e"),")"),this}param(...e){return this[vs].push(...xs(e,"-e")),this}}}}),Fv={};et(Fv,{ResetMode:()=>ol,getResetMode:()=>g4,resetTask:()=>m4});function m4(e,t){let n=["reset"];return Pv(e)&&n.push(`--${e}`),n.push(...t),Tt(n)}function g4(e){if(Pv(e))return e;switch(typeof e){case"string":case"undefined":return"soft"}}function Pv(e){return Mv.includes(e)}var ol,Mv,Ov=W({"src/lib/tasks/reset.ts"(){"use strict";Qe(),ol=(e=>(e.MIXED="mixed",e.SOFT="soft",e.HARD="hard",e.MERGE="merge",e.KEEP="keep",e))(ol||{}),Mv=Array.from(Object.values(ol))}});function y4(){return(0,hl.default)("simple-git")}function dy(e,t,n){return!t||!String(t).replace(/\s*/,"")?n?(r,...i)=>{e(r,...i),n(r,...i)}:e:(r,...i)=>{e(`%s ${r}`,t,...i),n&&n(r,...i)}}function v4(e,t,{namespace:n}){if(typeof e=="string")return e;let r=t&&t.namespace||"";return r.startsWith(n)?r.substr(n.length+1):r||n}function Fh(e,t,n,r=y4()){let i=e&&`[${e}]`||"",a=[],s=typeof t=="string"?r.extend(t):t,o=v4(Fn(t,yt),s,r);return c(n);function l(u,f){return we(a,Fh(e,o.replace(/^[^:]+/,u),f,r))}function c(u){let f=u&&`[${u}]`||"",h=s&&dy(s,f)||Zr,d=dy(r,`${i} ${f}`,h);return Object.assign(s?h:d,{label:e,sibling:l,info:d,step:c})}}var Iv=W({"src/lib/git-logger.ts"(){"use strict";oe(),hl.default.formatters.L=e=>String(xh(e)?e.length:"-"),hl.default.formatters.B=e=>Buffer.isBuffer(e)?e.toString("utf8"):Ts(e)}}),il,uh,w4=W({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";dr(),Iv(),il=class{constructor(e="GitExecutor"){this.logLabel=e,this._queue=new Map}withProgress(e){return this._queue.get(e)}createProgress(e){let t=il.getName(e.commands[0]),n=Fh(this.logLabel,t);return{task:e,logger:n,name:t}}push(e){let t=this.createProgress(e);return t.logger("Adding task to the queue, commands = %o",e.commands),this._queue.set(e,t),t}fatal(e){for(let[t,{logger:n}]of Array.from(this._queue.entries()))t===e.task?(n.info("Failed %o",e),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",e.message),this.complete(t);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(e){this.withProgress(e)&&this._queue.delete(e)}attempt(e){let t=this.withProgress(e);if(!t)throw new dn(void 0,"TasksPendingQueue: attempt called for an unknown task");return t.logger("Starting task"),t}static getName(e="empty"){return`task:${e}:${++il.counter}`}},uh=il,uh.counter=0}});function Xr(e,t){return{method:Xy(e.commands)||"",commands:t}}function b4(e,t){return n=>{t("[ERROR] child process exception %o",n),e.push(Buffer.from(String(n.stack),"ascii"))}}function py(e,t,n,r){return i=>{n("%s received %L bytes",t,i),r("%B",i),e.push(i)}}var fh,x4=W({"src/lib/runners/git-executor-chain.ts"(){"use strict";dr(),Qe(),oe(),w4(),fh=class{constructor(e,t,n){this._executor=e,this._scheduler=t,this._plugins=n,this._chain=Promise.resolve(),this._queue=new uh}get cwd(){return this._cwd||this._executor.cwd}set cwd(e){this._cwd=e}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(e){return this._queue.push(e),this._chain=this._chain.then(()=>this.attemptTask(e))}attemptTask(e){return ws(this,null,function*(){let t=yield this._scheduler.next(),n=()=>this._queue.complete(e);try{let{logger:r}=this._queue.attempt(e);return yield yv(e)?this.attemptEmptyTask(e,r):this.attemptRemoteTask(e,r)}catch(r){throw this.onFatalException(e,r)}finally{n(),t()}})}onFatalException(e,t){let n=t instanceof dn?Object.assign(t,{task:e}):new dn(e,t&&String(t));return this._chain=Promise.resolve(),this._queue.fatal(n),n}attemptRemoteTask(e,t){return ws(this,null,function*(){let n=this._plugins.exec("spawn.binary","",Xr(e,e.commands)),r=this._plugins.exec("spawn.args",[...e.commands],Xr(e,e.commands)),i=yield this.gitResponse(e,n,r,this.outputHandler,t.step("SPAWN")),a=yield this.handleTaskData(e,r,i,t.step("HANDLE"));return t("passing response to task's parser as a %s",e.format),gv(e)?sh(e.parser,a):sh(e.parser,a.asStrings())})}attemptEmptyTask(e,t){return ws(this,null,function*(){return t("empty task bypassing child process to call to task's parser"),e.parser(this)})}handleTaskData(e,t,n,r){let{exitCode:i,rejection:a,stdOut:s,stdErr:o}=n;return new Promise((l,c)=>{r("Preparing to handle process response exitCode=%d stdOut=",i);let{error:u}=this._plugins.exec("task.error",{error:a},tn(tn({},Xr(e,t)),n));if(u&&e.onError)return r.info("exitCode=%s handling with custom error handler"),e.onError(n,u,f=>{r.info("custom error handler treated as success"),r("custom error returned a %s",Ts(f)),l(new Ss(Array.isArray(f)?Buffer.concat(f):f,Buffer.concat(o)))},c);if(u)return r.info("handling as error: exitCode=%s stdErr=%s rejection=%o",i,o.length,a),c(u);r.info("retrieving task output complete"),l(new Ss(Buffer.concat(s),Buffer.concat(o)))})}gitResponse(e,t,n,r,i){return ws(this,null,function*(){let a=i.sibling("output"),s=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Xr(e,e.commands));return new Promise(o=>{let l=[],c=[];i.info("%s %o",t,n),i("%O",s);let u=this._beforeSpawn(e,n);if(u)return o({stdOut:l,stdErr:c,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,bs(tn({},Xr(e,n)),{kill(h){u=h||u}}));let f=(0,Rv.spawn)(t,n,s);f.stdout.on("data",py(l,"stdOut",i,a.step("stdOut"))),f.stderr.on("data",py(c,"stdErr",i,a.step("stdErr"))),f.on("error",b4(c,i)),r&&(i("Passing child process stdOut/stdErr to custom outputHandler"),r(t,f.stdout,f.stderr,[...n])),this._plugins.exec("spawn.after",void 0,bs(tn({},Xr(e,n)),{spawned:f,close(h,d){o({stdOut:l,stdErr:c,exitCode:h,rejection:u||d})},kill(h){f.killed||(u=h,f.kill("SIGINT"))}}))})})}_beforeSpawn(e,t){let n;return this._plugins.exec("spawn.before",void 0,bs(tn({},Xr(e,t)),{kill(r){n=r||n}})),n}}}}),Lv={};et(Lv,{GitExecutor:()=>jv});var jv,_4=W({"src/lib/runners/git-executor.ts"(){"use strict";x4(),jv=class{constructor(e,t,n){this.cwd=e,this._scheduler=t,this._plugins=n,this._chain=new fh(this,this._scheduler,this._plugins)}chain(){return new fh(this,this._scheduler,this._plugins)}push(e){return this._chain.push(e)}}}});function S4(e,t,n=Zr){let r=a=>{n(null,a)},i=a=>{(a==null?void 0:a.task)===e&&n(a instanceof As?E4(a):a,void 0)};t.then(r,i)}function E4(e){let t=r=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${r} should be GitResponseError.git.${r}, this will no longer be available in version 3`),t=Zr};return Object.create(e,Object.getOwnPropertyNames(e.git).reduce(n,{}));function n(r,i){return i in e||(r[i]={enumerable:!1,configurable:!1,get(){return t(i),e.git[i]}}),r}}var A4=W({"src/lib/task-callback.ts"(){"use strict";Vi(),oe()}});function my(e,t){return pv(n=>{if(!vh(e))throw new Error(`Git.cwd: cannot change to non-directory "${e}"`);return(t||n).cwd=e})}var k4=W({"src/lib/tasks/change-working-directory.ts"(){"use strict";oe(),Qe()}});function Qf(e){let t=["checkout",...e];return t[1]==="-b"&&t.includes("-B")&&(t[1]=yl(t,"-B")),Tt(t)}function T4(){return{checkout(){return this._runTask(Qf(Lt(arguments,1)),Ze(arguments))},checkoutBranch(e,t){return this._runTask(Qf(["-b",e,t,...Lt(arguments)]),Ze(arguments))},checkoutLocalBranch(e){return this._runTask(Qf(["-b",e,...Lt(arguments)]),Ze(arguments))}}}var C4=W({"src/lib/tasks/checkout.ts"(){"use strict";oe(),Qe()}});function F4(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function P4(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(e){return Dt(F4(),[Dv],e)}})}}}var Dv,M4=W({"src/lib/tasks/count-objects.ts"(){"use strict";oe(),Dv=new fe(/([a-z-]+): (\d+)$/,(e,[t,n])=>{let r=Ky(t);e.hasOwnProperty(r)&&(e[r]=Oe(n))})}});function O4(e){return Dt({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},Bv,e)}var Bv,I4=W({"src/lib/parsers/parse-commit.ts"(){"use strict";oe(),Bv=[new fe(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(e,[t,n,r])=>{e.branch=t,e.commit=r,e.root=!!n}),new fe(/\s*Author:\s(.+)/i,(e,[t])=>{let n=t.split("<"),r=n.pop();!r||!r.includes("@")||(e.author={email:r.substr(0,r.length-1),name:n.join("<").trim()})}),new fe(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0,e.summary.insertions=parseInt(n,10)||0,e.summary.deletions=parseInt(r,10)||0}),new fe(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(e,[t,n,r])=>{e.summary.changes=parseInt(t,10)||0;let i=parseInt(n,10)||0;r==="-"?e.summary.deletions=i:r==="+"&&(e.summary.insertions=i)})]}});function R4(e,t,n){return{commands:["-c","core.abbrev=40","commit",...xs(e,"-m"),...t,...n],format:"utf-8",parser:O4}}function L4(){return{commit(t,...n){let r=Ze(arguments),i=e(t)||R4(Cn(t),Cn(Fn(n[0],fl,[])),[...Fn(n[1],Cs,[]),...Lt(arguments,0,!0)]);return this._runTask(i,r)}};function e(t){return!fl(t)&&jt("git.commit: requires the commit message to be supplied as a string/string[]")}}var j4=W({"src/lib/tasks/commit.ts"(){"use strict";I4(),oe(),Qe()}});function D4(){return{firstCommit(){return this._runTask(Tt(["rev-list","--max-parents=0","HEAD"],!0),Ze(arguments))}}}var B4=W({"src/lib/tasks/first-commit.ts"(){"use strict";oe(),Qe()}});function N4(e,t){let n=["hash-object",e];return t&&n.push("-w"),Tt(n,!0)}var $4=W({"src/lib/tasks/hash-object.ts"(){"use strict";Qe()}});function H4(e,t,n){let r=String(n).trim(),i;if(i=Nv.exec(r))return new ll(e,t,!1,i[1]);if(i=$v.exec(r))return new ll(e,t,!0,i[1]);let a="",s=r.split(" ");for(;s.length;)if(s.shift()==="in"){a=s.join(" ");break}return new ll(e,t,/^re/i.test(r),a)}var ll,Nv,$v,U4=W({"src/lib/responses/InitSummary.ts"(){"use strict";ll=class{constructor(e,t,n,r){this.bare=e,this.path=t,this.existing=n,this.gitDir=r}},Nv=/^Init.+ repository in (.+)$/,$v=/^Rein.+ in (.+)$/}});function G4(e){return e.includes(Ph)}function z4(e=!1,t,n){let r=["init",...n];return e&&!G4(r)&&r.splice(1,0,Ph),{commands:r,format:"utf-8",parser(i){return H4(r.includes("--bare"),t,i)}}}var Ph,V4=W({"src/lib/tasks/init.ts"(){"use strict";U4(),Ph="--bare"}});function Mh(e){for(let t=0;tDt(new Hv,t,n,!1)}var eh,gy,yy,vy,Gv,zv=W({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Fs(),q4(),Av(),oe(),eh=[new fe(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(e,[t,n,r=""])=>{e.files.push({file:t.trim(),changes:Oe(n),insertions:r.replace(/[^+]/g,"").length,deletions:r.replace(/[^-]/g,"").length,binary:!1})}),new fe(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(e,[t,n,r])=>{e.files.push({file:t.trim(),before:Oe(n),after:Oe(r),binary:!0})}),new fe(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(e,[t,n])=>{let r=/(\d+) i/.exec(n),i=/(\d+) d/.exec(n);e.changed=Oe(t),e.insertions=Oe(r==null?void 0:r[1]),e.deletions=Oe(i==null?void 0:i[1])})],gy=[new fe(/(\d+)\t(\d+)\t(.+)$/,(e,[t,n,r])=>{let i=Oe(t),a=Oe(n);e.changed++,e.insertions+=i,e.deletions+=a,e.files.push({file:r,changes:i+a,insertions:i,deletions:a,binary:!1})}),new fe(/-\t-\t(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,after:0,before:0,binary:!0})})],yy=[new fe(/(.+)$/,(e,[t])=>{e.changed++,e.files.push({file:t,changes:0,insertions:0,deletions:0,binary:!1})})],vy=[new fe(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(e,[t,n,r,i,a])=>{e.changed++,e.files.push({file:a!=null?a:r,changes:0,insertions:0,deletions:0,binary:!1,status:ih(f4(t)&&t),from:ih(!!a&&r!==a&&r),similarity:Oe(n)})})],Gv={"":eh,"--stat":eh,"--numstat":gy,"--name-status":vy,"--name-only":yy}}});function X4(e,t){return t.reduce((n,r,i)=>(n[r]=e[i]||"",n),Object.create({diff:null}))}function Vv(e=Lh,t=Wv,n=""){let r=Uv(n);return function(i){let a=ks(i.trim(),!1,Ih).map(function(s){let o=s.split(Rh),l=X4(o[0].split(e),t);return o.length>1&&o[1].trim()&&(l.diff=r(o[1])),l});return{all:a,latest:a.length&&a[0]||null,total:a.length}}}var Ih,Rh,Lh,Wv,qv=W({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";oe(),zv(),Fs(),Ih="\xF2\xF2\xF2\xF2\xF2\xF2 ",Rh=" \xF2\xF2",Lh=" \xF2 ",Wv=["hash","date","message","refs","author_name","author_email"]}}),Xv={};et(Xv,{diffSummaryTask:()=>Y4,validateLogFormatConfig:()=>xl});function Y4(e){let t=Mh(e),n=["diff"];return t===""&&(t="--stat",n.push("--stat=4096")),n.push(...e),xl(n)||{commands:n,format:"utf-8",parser:Uv(t)}}function xl(e){let t=e.filter(W4);if(t.length>1)return jt(`Summary flags are mutually exclusive - pick one of ${t.join(",")}`);if(t.length&&e.includes("-z"))return jt(`Summary flag ${t} parsing is not compatible with null termination option '-z'`)}var jh=W({"src/lib/tasks/diff.ts"(){"use strict";Fs(),zv(),Qe()}});function Z4(e,t){let n=[],r=[];return Object.keys(e).forEach(i=>{n.push(i),r.push(String(e[i]))}),[n,r.join(t)]}function K4(e){return Object.keys(e).reduce((t,n)=>(n in hh||(t[n]=e[n]),t),{})}function Yv(e={},t=[]){let n=Fn(e.splitter,yt,Lh),r=!wh(e.format)&&e.format?e.format:{hash:"%H",date:e.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:e.multiLine?"%B":"%b",author_name:e.mailMap!==!1?"%aN":"%an",author_email:e.mailMap!==!1?"%aE":"%ae"},[i,a]=Z4(r,n),s=[],o=[`--pretty=format:${Ih}${a}${Rh}`,...t],l=e.n||e["max-count"]||e.maxCount;if(l&&o.push(`--max-count=${l}`),e.from||e.to){let c=e.symmetric!==!1?"...":"..";s.push(`${e.from||""}${c}${e.to||""}`)}return yt(e.file)&&o.push("--follow",N6(e.file)),_h(K4(e),o),{fields:i,splitter:n,commands:[...o,...s]}}function J4(e,t,n){let r=Vv(e,t,Mh(n));return{commands:["log",...n],format:"utf-8",parser:r}}function Q4(){return{log(...n){let r=Ze(arguments),i=Yv(Sh(arguments),Fn(arguments[0],Cs)),a=t(...n)||xl(i.commands)||e(i);return this._runTask(a,r)}};function e(n){return J4(n.splitter,n.fields,n.commands)}function t(n,r){return yt(n)&&yt(r)&&jt("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var hh,Zv=W({"src/lib/tasks/log.ts"(){"use strict";Fs(),Es(),qv(),oe(),Qe(),jh(),hh=(e=>(e[e["--pretty"]=0]="--pretty",e[e["max-count"]=1]="max-count",e[e.maxCount=2]="maxCount",e[e.n=3]="n",e[e.file=4]="file",e[e.format=5]="format",e[e.from=6]="from",e[e.to=7]="to",e[e.splitter=8]="splitter",e[e.symmetric=9]="symmetric",e[e.mailMap=10]="mailMap",e[e.multiLine=11]="multiLine",e[e.strictDate=12]="strictDate",e))(hh||{})}}),cl,Kv,eF=W({"src/lib/responses/MergeSummary.ts"(){"use strict";cl=class{constructor(e,t=null,n){this.reason=e,this.file=t,this.meta=n}toString(){return`${this.file}:${this.reason}`}},Kv=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"}}}}),dh,Jv,tF=W({"src/lib/responses/PullSummary.ts"(){"use strict";dh=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},Jv=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function th(e){return e.objects=e.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function wy(e){let t=/^\s*(\d+)/.exec(e),n=/delta (\d+)/i.exec(e);return{count:Oe(t&&t[1]||"0"),delta:Oe(n&&n[1]||"0")}}var Qv,nF=W({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";oe(),Qv=[new hr(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=th(e.remoteMessages);Object.assign(i,{[r]:Oe(n)})}),new hr(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(e,[t,n])=>{let r=t.toLowerCase(),i=th(e.remoteMessages);Object.assign(i,{[r]:Oe(n)})}),new hr(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(e,[t,n,r])=>{let i=th(e.remoteMessages);i.total=wy(t),i.reused=wy(n),i.packReused=Oe(r)})]}});function ew(e,t){return Dt({remoteMessages:new nw},tw,t)}var tw,nw,rw=W({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";oe(),nF(),tw=[new hr(/^remote:\s*(.+)$/,(e,[t])=>(e.remoteMessages.all.push(t.trim()),!1)),...Qv,new hr([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(e,[t])=>{e.remoteMessages.pullRequestUrl=t}),new hr([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(e,[t,n,r])=>{e.remoteMessages.vulnerabilities={count:Oe(t),summary:n,url:r}})],nw=class{constructor(){this.all=[]}}}});function rF(e,t){let n=Dt(new Jv,iw,[e,t]);return n.message&&n}var by,xy,_y,Sy,iw,Ey,Dh,aw=W({"src/lib/parsers/parse-pull.ts"(){"use strict";tF(),oe(),rw(),by=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,xy=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,_y=/^(create|delete) mode \d+ (.+)/,Sy=[new fe(by,(e,[t,n,r])=>{e.files.push(t),n&&(e.insertions[t]=n.length),r&&(e.deletions[t]=r.length)}),new fe(xy,(e,[t,,n,,r])=>n!==void 0||r!==void 0?(e.summary.changes=+t||0,e.summary.insertions=+n||0,e.summary.deletions=+r||0,!0):!1),new fe(_y,(e,[t,n])=>{we(e.files,n),we(t==="create"?e.created:e.deleted,n)})],iw=[new fe(/^from\s(.+)$/i,(e,[t])=>void(e.remote=t)),new fe(/^fatal:\s(.+)$/,(e,[t])=>void(e.message=t)),new fe(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(e,[t,n,r,i])=>{e.branch.local=r,e.hash.local=t,e.branch.remote=i,e.hash.remote=n})],Ey=(e,t)=>Dt(new dh,Sy,[e,t]),Dh=(e,t)=>Object.assign(new dh,Ey(e,t),ew(e,t))}}),Ay,sw,ky,iF=W({"src/lib/parsers/parse-merge.ts"(){"use strict";eF(),oe(),aw(),Ay=[new fe(/^Auto-merging\s+(.+)$/,(e,[t])=>{e.merges.push(t)}),new fe(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(e,[t,n])=>{e.conflicts.push(new cl(t,n))}),new fe(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(e,[t,n,r])=>{e.conflicts.push(new cl(t,n,{deleteRef:r}))}),new fe(/^CONFLICT\s+\((.+)\):/,(e,[t])=>{e.conflicts.push(new cl(t,null))}),new fe(/^Automatic merge failed;\s+(.+)$/,(e,[t])=>{e.result=t})],sw=(e,t)=>Object.assign(ky(e,t),Dh(e,t)),ky=e=>Dt(new Kv,Ay,e)}});function Ty(e){return e.length?{commands:["merge",...e],format:"utf-8",parser(t,n){let r=sw(t,n);if(r.failed)throw new As(r);return r}}:jt("Git.merge requires at least one option")}var aF=W({"src/lib/tasks/merge.ts"(){"use strict";Vi(),iF(),Qe()}});function sF(e,t,n){let r=n.includes("deleted"),i=n.includes("tag")||/^refs\/tags/.test(e),a=!n.includes("new");return{deleted:r,tag:i,branch:!i,new:!a,alreadyUpdated:a,local:e,remote:t}}var Cy,ow,Fy,oF=W({"src/lib/parsers/parse-push.ts"(){"use strict";oe(),rw(),Cy=[new fe(/^Pushing to (.+)$/,(e,[t])=>{e.repo=t}),new fe(/^updating local tracking ref '(.+)'/,(e,[t])=>{e.ref=bs(tn({},e.ref||{}),{local:t})}),new fe(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(e,[t,n,r])=>{e.pushed.push(sF(t,n,r))}),new fe(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(e,[t,n,r])=>{e.branch=bs(tn({},e.branch||{}),{local:t,remote:n,remoteName:r})}),new fe(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(e,[t,n,r,i])=>{e.update={head:{local:t,remote:n},hash:{from:r,to:i}}})],ow=(e,t)=>{let n=Fy(e,t),r=ew(e,t);return tn(tn({},n),r)},Fy=(e,t)=>Dt({pushed:[]},Cy,[e,t])}}),lw={};et(lw,{pushTagsTask:()=>lF,pushTask:()=>Bh});function lF(e={},t){return we(t,"--tags"),Bh(e,t)}function Bh(e={},t){let n=["push",...t];return e.branch&&n.splice(1,0,e.branch),e.remote&&n.splice(1,0,e.remote),yl(n,"-v"),we(n,"--verbose"),we(n,"--porcelain"),{commands:n,format:"utf-8",parser:ow}}var cw=W({"src/lib/tasks/push.ts"(){"use strict";oF(),oe()}});function cF(){return{showBuffer(){let e=["show",...Lt(arguments,1)];return e.includes("--binary")||e.splice(1,0,"--binary"),this._runTask(mv(e),Ze(arguments))},show(){let e=["show",...Lt(arguments,1)];return this._runTask(Tt(e),Ze(arguments))}}}var uF=W({"src/lib/tasks/show.ts"(){"use strict";oe(),Qe()}}),Py,uw,fF=W({"src/lib/responses/FileStatusSummary.ts"(){"use strict";Py=/^(.+)\0(.+)$/,uw=class{constructor(e,t,n){if(this.path=e,this.index=t,this.working_dir=n,t==="R"||n==="R"){let r=Py.exec(e)||[null,e,e];this.from=r[2]||"",this.path=r[1]||""}}}}});function My(e){let[t,n]=e.split(zi);return{from:n||t,to:t}}function Wt(e,t,n){return[`${e}${t}`,n]}function nh(e,...t){return t.map(n=>Wt(e,n,(r,i)=>we(r.conflicted,i)))}function hF(e,t){let n=t.trim();switch(" "){case n.charAt(2):return r(n.charAt(0),n.charAt(1),n.substr(3));case n.charAt(1):return r(" ",n.charAt(0),n.substr(2));default:return}function r(i,a,s){let o=`${i}${a}`,l=fw.get(o);l&&l(e,s),o!=="##"&&o!=="!!"&&e.files.push(new uw(s,i,a))}}var Oy,fw,hw,dF=W({"src/lib/responses/StatusSummary.ts"(){"use strict";oe(),fF(),Oy=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}},fw=new Map([Wt(" ","A",(e,t)=>we(e.created,t)),Wt(" ","D",(e,t)=>we(e.deleted,t)),Wt(" ","M",(e,t)=>we(e.modified,t)),Wt("A"," ",(e,t)=>we(e.created,t)&&we(e.staged,t)),Wt("A","M",(e,t)=>we(e.created,t)&&we(e.staged,t)&&we(e.modified,t)),Wt("D"," ",(e,t)=>we(e.deleted,t)&&we(e.staged,t)),Wt("M"," ",(e,t)=>we(e.modified,t)&&we(e.staged,t)),Wt("M","M",(e,t)=>we(e.modified,t)&&we(e.staged,t)),Wt("R"," ",(e,t)=>{we(e.renamed,My(t))}),Wt("R","M",(e,t)=>{let n=My(t);we(e.renamed,n),we(e.modified,n.to)}),Wt("!","!",(e,t)=>{we(e.ignored=e.ignored||[],t)}),Wt("?","?",(e,t)=>we(e.not_added,t)),...nh("A","A","U"),...nh("D","D","U"),...nh("U","A","D","U"),["##",(e,t)=>{let n=/ahead (\d+)/,r=/behind (\d+)/,i=/^(.+?(?=(?:\.{3}|\s|$)))/,a=/\.{3}(\S*)/,s=/\son\s([\S]+)$/,o;o=n.exec(t),e.ahead=o&&+o[1]||0,o=r.exec(t),e.behind=o&&+o[1]||0,o=i.exec(t),e.current=o&&o[1],o=a.exec(t),e.tracking=o&&o[1],o=s.exec(t),e.current=o&&o[1]||e.current,e.detached=/\(no branch\)/.test(t)}]]),hw=function(e){let t=e.split(zi),n=new Oy;for(let r=0,i=t.length;r!dw.includes(n))],parser(n){return hw(n)}}}var dw,mF=W({"src/lib/tasks/status.ts"(){"use strict";dF(),dw=["--null","-z"]}});function dl(e=0,t=0,n=0,r="",i=!0){return Object.defineProperty({major:e,minor:t,patch:n,agent:r,installed:i},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function gF(){return dl(0,0,0,"",!1)}function yF(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:vF,onError(e,t,n,r){if(e.exitCode===-2)return n(Buffer.from(Nh));r(t)}})}}}function vF(e){return e===Nh?gF():Dt(dl(0,0,0,e),pw,e)}var Nh,pw,wF=W({"src/lib/tasks/version.ts"(){"use strict";oe(),Nh="installed=false",pw=[new fe(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(e,[t,n,r,i=""])=>{Object.assign(e,dl(Oe(t),Oe(n),Oe(r),i))}),new fe(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(e,[t,n,r,i=""])=>{Object.assign(e,dl(Oe(t),Oe(n),r,i))})]}}),mw={};et(mw,{SimpleGitApi:()=>ph});var ph,bF=W({"src/lib/simple-git-api.ts"(){"use strict";A4(),k4(),C4(),M4(),j4(),Sv(),B4(),Cv(),$4(),V4(),Zv(),aF(),cw(),uF(),mF(),Qe(),wF(),oe(),ph=class{constructor(e){this._executor=e}_runTask(e,t){let n=this._executor.chain(),r=n.push(e);return t&&S4(e,r,t),Object.create(this,{then:{value:r.then.bind(r)},catch:{value:r.catch.bind(r)},_executor:{value:n}})}add(e){return this._runTask(Tt(["add",...Cn(e)]),Ze(arguments))}cwd(e){let t=Ze(arguments);return typeof e=="string"?this._runTask(my(e,this._executor),t):typeof(e==null?void 0:e.path)=="string"?this._runTask(my(e.path,e.root&&this._executor||void 0),t):this._runTask(jt("Git.cwd: workingDirectory must be supplied as a string"),t)}hashObject(e,t){return this._runTask(N4(e,t===!0),Ze(arguments))}init(e){return this._runTask(z4(e===!0,this._executor.cwd,Lt(arguments)),Ze(arguments))}merge(){return this._runTask(Ty(Lt(arguments)),Ze(arguments))}mergeFromTo(e,t){return yt(e)&&yt(t)?this._runTask(Ty([e,t,...Lt(arguments)]),Ze(arguments,!1)):this._runTask(jt("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(e){return this._executor.outputHandler=e,this}push(){let e=Bh({remote:Fn(arguments[0],yt),branch:Fn(arguments[1],yt)},Lt(arguments));return this._runTask(e,Ze(arguments))}stash(){return this._runTask(Tt(["stash",...Lt(arguments)]),Ze(arguments))}status(){return this._runTask(pF(Lt(arguments)),Ze(arguments))}},Object.assign(ph.prototype,T4(),L4(),u4(),P4(),D4(),p4(),Q4(),cF(),yF())}}),gw={};et(gw,{Scheduler:()=>vw});var Iy,vw,xF=W({"src/lib/runners/scheduler.ts"(){"use strict";oe(),Iv(),Iy=(()=>{let e=0;return()=>{e++;let{promise:t,done:n}=(0,yw.createDeferred)();return{promise:t,done:n,id:e}}})(),vw=class{constructor(e=2){this.concurrency=e,this.logger=Fh("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",e)}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 e=we(this.running,this.pending.shift());this.logger("Attempting id=%s",e.id),e.done(()=>{this.logger("Completing id=",e.id),yl(this.running,e),this.schedule()})}next(){let{promise:e,id:t}=we(this.pending,Iy());return this.logger("Scheduling id=%s",t),this.schedule(),e}}}}),ww={};et(ww,{applyPatchTask:()=>_F});function _F(e,t){return Tt(["apply",...t,...e])}var SF=W({"src/lib/tasks/apply-patch.ts"(){"use strict";Qe()}});function EF(e,t){return{branch:e,hash:t,success:!0}}function AF(e){return{branch:e,hash:null,success:!1}}var bw,kF=W({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";bw=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function xw(e,t){return t===1&&mh.test(e)}var Ry,mh,Ly,_l,TF=W({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";kF(),oe(),Ry=/(\S+)\s+\(\S+\s([^)]+)\)/,mh=/^error[^']+'([^']+)'/m,Ly=[new fe(Ry,(e,[t,n])=>{let r=EF(t,n);e.all.push(r),e.branches[t]=r}),new fe(mh,(e,[t])=>{let n=AF(t);e.errors.push(n),e.all.push(n),e.branches[t]=n})],_l=(e,t)=>Dt(new bw,Ly,[e,t])}}),_w,CF=W({"src/lib/responses/BranchSummary.ts"(){"use strict";_w=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(e,t,n,r,i){e==="*"&&(this.detached=t,this.current=n),this.all.push(n),this.branches[n]={current:e==="*",linkedWorkTree:e==="+",name:n,commit:r,label:i}}}}});function jy(e){return e?e.charAt(0):""}function Sw(e){return Dt(new _w,Ew,e)}var Ew,FF=W({"src/lib/parsers/parse-branch.ts"(){"use strict";CF(),oe(),Ew=[new fe(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(e,[t,n,r,i])=>{e.push(jy(t),!0,n,r,i)}),new fe(new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$","s"),(e,[t,n,r,i])=>{e.push(jy(t),!1,n,r,i)})]}}),Aw={};et(Aw,{branchLocalTask:()=>MF,branchTask:()=>PF,containsDeleteBranchCommand:()=>kw,deleteBranchTask:()=>IF,deleteBranchesTask:()=>OF});function kw(e){let t=["-d","-D","--delete"];return e.some(n=>t.includes(n))}function PF(e){let t=kw(e),n=["branch",...e];return n.length===1&&n.push("-a"),n.includes("-v")||n.splice(1,0,"-v"),{format:"utf-8",commands:n,parser(r,i){return t?_l(r,i).all[0]:Sw(r)}}}function MF(){return{format:"utf-8",commands:["branch","-v"],parser:Sw}}function OF(e,t=!1){return{format:"utf-8",commands:["branch","-v",t?"-D":"-d",...e],parser(n,r){return _l(n,r)},onError({exitCode:n,stdOut:r},i,a,s){if(!xw(String(i),n))return s(i);a(r)}}}function IF(e,t=!1){let n={format:"utf-8",commands:["branch","-v",t?"-D":"-d",e],parser(r,i){return _l(r,i).branches[e]},onError({exitCode:r,stdErr:i,stdOut:a},s,o,l){if(!xw(String(s),r))return l(s);throw new As(n.parser(_s(a),_s(i)),String(s))}};return n}var RF=W({"src/lib/tasks/branch.ts"(){"use strict";Vi(),TF(),FF(),oe()}}),Tw,LF=W({"src/lib/responses/CheckIgnore.ts"(){"use strict";Tw=e=>e.split(/\n/g).map(t=>t.trim()).filter(t=>!!t)}}),Cw={};et(Cw,{checkIgnoreTask:()=>jF});function jF(e){return{commands:["check-ignore",...e],format:"utf-8",parser:Tw}}var DF=W({"src/lib/tasks/check-ignore.ts"(){"use strict";LF()}}),Fw={};et(Fw,{cloneMirrorTask:()=>NF,cloneTask:()=>Pw});function BF(e){return/^--upload-pack(=|$)/.test(e)}function Pw(e,t,n){let r=["clone",...n];return yt(e)&&r.push(e),yt(t)&&r.push(t),r.find(BF)?jt("git.fetch: potential exploit argument blocked."):Tt(r)}function NF(e,t,n){return we(n,"--mirror"),Pw(e,t,n)}var $F=W({"src/lib/tasks/clone.ts"(){"use strict";Qe(),oe()}});function HF(e,t){return Dt({raw:e,remote:null,branches:[],tags:[],updated:[],deleted:[]},Mw,[e,t])}var Mw,UF=W({"src/lib/parsers/parse-fetch.ts"(){"use strict";oe(),Mw=[new fe(/From (.+)$/,(e,[t])=>{e.remote=t}),new fe(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.branches.push({name:t,tracking:n})}),new fe(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(e,[t,n])=>{e.tags.push({name:t,tracking:n})}),new fe(/- \[deleted]\s+\S+\s*-> (.+)$/,(e,[t])=>{e.deleted.push({tracking:t})}),new fe(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(e,[t,n,r,i])=>{e.updated.push({name:r,tracking:i,to:n,from:t})})]}}),Ow={};et(Ow,{fetchTask:()=>zF});function GF(e){return/^--upload-pack(=|$)/.test(e)}function zF(e,t,n){let r=["fetch",...n];return e&&t&&r.push(e,t),r.find(GF)?jt("git.fetch: potential exploit argument blocked."):{commands:r,format:"utf-8",parser:HF}}var VF=W({"src/lib/tasks/fetch.ts"(){"use strict";UF(),Qe()}});function WF(e){return Dt({moves:[]},Iw,e)}var Iw,qF=W({"src/lib/parsers/parse-move.ts"(){"use strict";oe(),Iw=[new fe(/^Renaming (.+) to (.+)$/,(e,[t,n])=>{e.moves.push({from:t,to:n})})]}}),Rw={};et(Rw,{moveTask:()=>XF});function XF(e,t){return{commands:["mv","-v",...Cn(e),t],format:"utf-8",parser:WF}}var YF=W({"src/lib/tasks/move.ts"(){"use strict";qF(),oe()}}),Lw={};et(Lw,{pullTask:()=>ZF});function ZF(e,t,n){let r=["pull",...n];return e&&t&&r.splice(1,0,e,t),{commands:r,format:"utf-8",parser(i,a){return Dh(i,a)},onError(i,a,s,o){let l=rF(_s(i.stdOut),_s(i.stdErr));if(l)return o(new As(l));o(a)}}}var KF=W({"src/lib/tasks/pull.ts"(){"use strict";Vi(),aw(),oe()}});function JF(e){let t={};return jw(e,([n])=>t[n]={name:n}),Object.values(t)}function QF(e){let t={};return jw(e,([n,r,i])=>{t.hasOwnProperty(n)||(t[n]={name:n,refs:{fetch:"",push:""}}),i&&r&&(t[n].refs[i.replace(/[^a-z]/g,"")]=r)}),Object.values(t)}function jw(e,t){yh(e,n=>t(n.split(/\s+/)))}var eP=W({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";oe()}}),Dw={};et(Dw,{addRemoteTask:()=>tP,getRemotesTask:()=>nP,listRemotesTask:()=>rP,remoteTask:()=>iP,removeRemoteTask:()=>aP});function tP(e,t,n){return Tt(["remote","add",...n,e,t])}function nP(e){let t=["remote"];return e&&t.push("-v"),{commands:t,format:"utf-8",parser:e?QF:JF}}function rP(e){let t=[...e];return t[0]!=="ls-remote"&&t.unshift("ls-remote"),Tt(t)}function iP(e){let t=[...e];return t[0]!=="remote"&&t.unshift("remote"),Tt(t)}function aP(e){return Tt(["remote","remove",e])}var sP=W({"src/lib/tasks/remote.ts"(){"use strict";eP(),Qe()}}),Bw={};et(Bw,{stashListTask:()=>oP});function oP(e={},t){let n=Yv(e),r=["stash","list",...n.commands,...t],i=Vv(n.splitter,n.fields,Mh(r));return xl(r)||{commands:r,format:"utf-8",parser:i}}var lP=W({"src/lib/tasks/stash-list.ts"(){"use strict";Fs(),qv(),jh(),Zv()}}),Nw={};et(Nw,{addSubModuleTask:()=>cP,initSubModuleTask:()=>uP,subModuleTask:()=>Sl,updateSubModuleTask:()=>fP});function cP(e,t){return Sl(["add",e,t])}function uP(e){return Sl(["init",...e])}function Sl(e){let t=[...e];return t[0]!=="submodule"&&t.unshift("submodule"),Tt(t)}function fP(e){return Sl(["update",...e])}var hP=W({"src/lib/tasks/sub-module.ts"(){"use strict";Qe()}});function dP(e,t){let n=isNaN(e),r=isNaN(t);return n!==r?n?1:-1:n?$w(e,t):0}function $w(e,t){return e===t?0:e>t?1:-1}function pP(e){return e.trim()}function al(e){return typeof e=="string"&&parseInt(e.replace(/^\D+/g,""),10)||0}var Dy,Hw,mP=W({"src/lib/responses/TagList.ts"(){"use strict";Dy=class{constructor(e,t){this.all=e,this.latest=t}},Hw=function(e,t=!1){let n=e.split(` +`).map(pP).filter(Boolean);t||n.sort(function(i,a){let s=i.split("."),o=a.split(".");if(s.length===1||o.length===1)return dP(al(s[0]),al(o[0]));for(let l=0,c=Math.max(s.length,o.length);li.indexOf(".")>=0);return new Dy(n,r)}}}),Uw={};et(Uw,{addAnnotatedTagTask:()=>vP,addTagTask:()=>yP,tagListTask:()=>gP});function gP(e=[]){let t=e.some(n=>/^--sort=/.test(n));return{format:"utf-8",commands:["tag","-l",...e],parser(n){return Hw(n,t)}}}function yP(e){return{format:"utf-8",commands:["tag",e],parser(){return{name:e}}}}function vP(e,t){return{format:"utf-8",commands:["tag","-a","-m",t,e],parser(){return{name:e}}}}var wP=W({"src/lib/tasks/tag.ts"(){"use strict";mP()}}),bP=D6({"src/git.js"(e,t){"use strict";var{GitExecutor:n}=(_4(),Ye(Lv)),{SimpleGitApi:r}=(bF(),Ye(mw)),{Scheduler:i}=(xF(),Ye(gw)),{configurationErrorTask:a}=(Qe(),Ye(lh)),{asArray:s,filterArray:o,filterPrimitives:l,filterString:c,filterStringOrStringArray:u,filterType:f,getTrailingOptions:h,trailingFunctionArgument:d,trailingOptionsArgument:p}=(oe(),Ye(av)),{applyPatchTask:g}=(SF(),Ye(ww)),{branchTask:m,branchLocalTask:w,deleteBranchesTask:b,deleteBranchTask:S}=(RF(),Ye(Aw)),{checkIgnoreTask:A}=(DF(),Ye(Cw)),{checkIsRepoTask:x}=(cv(),Ye(sv)),{cloneTask:k,cloneMirrorTask:y}=($F(),Ye(Fw)),{cleanWithOptionsTask:E,isCleanOptionsArray:_}=(bv(),Ye(vv)),{diffSummaryTask:C}=(jh(),Ye(Xv)),{fetchTask:P}=(VF(),Ye(Ow)),{moveTask:L}=(YF(),Ye(Rw)),{pullTask:N}=(KF(),Ye(Lw)),{pushTagsTask:j}=(cw(),Ye(lw)),{addRemoteTask:Y,getRemotesTask:le,listRemotesTask:he,remoteTask:ae,removeRemoteTask:Pe}=(sP(),Ye(Dw)),{getResetMode:de,resetTask:$}=(Ov(),Ye(Fv)),{stashListTask:z}=(lP(),Ye(Bw)),{addSubModuleTask:D,initSubModuleTask:se,subModuleTask:Se,updateSubModuleTask:gt}=(hP(),Ye(Nw)),{addAnnotatedTagTask:be,addTagTask:ot,tagListTask:ee}=(wP(),Ye(Uw)),{straightThroughBufferTask:Ie,straightThroughStringTask:Ee}=(Qe(),Ye(lh));function G(H,Z){this._plugins=Z,this._executor=new n(H.baseDir,new i(H.maxConcurrentProcesses),Z),this._trimmed=H.trimmed}(G.prototype=Object.create(r.prototype)).constructor=G,G.prototype.customBinary=function(H){return this._plugins.reconfigure("binary",H),this},G.prototype.env=function(H,Z){return arguments.length===1&&typeof H=="object"?this._executor.env=H:(this._executor.env=this._executor.env||{})[H]=Z,this},G.prototype.stashList=function(H){return this._runTask(z(p(arguments)||{},o(H)&&H||[]),d(arguments))};function rt(H,Z,ye,Ke){return typeof ye!="string"?a(`git.${H}() requires a string 'repoPath'`):Z(ye,f(Ke,c),h(arguments))}G.prototype.clone=function(){return this._runTask(rt("clone",k,...arguments),d(arguments))},G.prototype.mirror=function(){return this._runTask(rt("mirror",y,...arguments),d(arguments))},G.prototype.mv=function(H,Z){return this._runTask(L(H,Z),d(arguments))},G.prototype.checkoutLatestTag=function(H){var Z=this;return this.pull(function(){Z.tags(function(ye,Ke){Z.checkout(Ke.latest,H)})})},G.prototype.pull=function(H,Z,ye,Ke){return this._runTask(N(f(H,c),f(Z,c),h(arguments)),d(arguments))},G.prototype.fetch=function(H,Z){return this._runTask(P(f(H,c),f(Z,c),h(arguments)),d(arguments))},G.prototype.silent=function(H){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},G.prototype.tags=function(H,Z){return this._runTask(ee(h(arguments)),d(arguments))},G.prototype.rebase=function(){return this._runTask(Ee(["rebase",...h(arguments)]),d(arguments))},G.prototype.reset=function(H){return this._runTask($(de(H),h(arguments)),d(arguments))},G.prototype.revert=function(H){let Z=d(arguments);return typeof H!="string"?this._runTask(a("Commit must be a string"),Z):this._runTask(Ee(["revert",...h(arguments,0,!0),H]),Z)},G.prototype.addTag=function(H){let Z=typeof H=="string"?ot(H):a("Git.addTag requires a tag name");return this._runTask(Z,d(arguments))},G.prototype.addAnnotatedTag=function(H,Z){return this._runTask(be(H,Z),d(arguments))},G.prototype.deleteLocalBranch=function(H,Z,ye){return this._runTask(S(H,typeof Z=="boolean"?Z:!1),d(arguments))},G.prototype.deleteLocalBranches=function(H,Z,ye){return this._runTask(b(H,typeof Z=="boolean"?Z:!1),d(arguments))},G.prototype.branch=function(H,Z){return this._runTask(m(h(arguments)),d(arguments))},G.prototype.branchLocal=function(H){return this._runTask(w(),d(arguments))},G.prototype.raw=function(H){let Z=!Array.isArray(H),ye=[].slice.call(Z?arguments:H,0);for(let _t=0;_te.removeEventListener("abort",a))}}]:void 0}function SP(e){return typeof e=="string"&&e.trim().toLowerCase()==="-c"}function EP(e,t){if(SP(e)&&/^\s*protocol(.[a-z]+)?.allow/.test(t))throw new zn(void 0,"unsafe","Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol")}function AP(e,t){if(/^\s*--(upload|receive)-pack/.test(e))throw new zn(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if(t==="clone"&&/^\s*-u\b/.test(e))throw new zn(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if(t==="push"&&/^\s*--exec\b/.test(e))throw new zn(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function kP({allowUnsafeProtocolOverride:e=!1,allowUnsafePack:t=!1}={}){return{type:"spawn.args",action(n,r){return n.forEach((i,a)=>{let s=arh(i))).then(s.done)}return{type:"spawn.after",action(i,a){return ws(this,arguments,function*(s,{spawned:o,close:l}){var c,u;let f=n(),h=!0,d=()=>void(h=!1);(c=o.stdout)==null||c.on("data",d),(u=o.stderr)==null||u.on("data",d),o.on("error",d),o.on("close",p=>f.close(p)),o.on("exit",p=>f.exit(p));try{yield f.result,h&&(yield rh(50)),l(f.exitCode)}catch(p){l(f.exitCode,p)}})}}}oe();var FP="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",Ny="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function PP(e){return!e||!/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(e)}function $y(e,t){if(e.length<1||e.length>2)throw new zn(void 0,"binary",FP);if(e.some(PP))if(t)console.warn(Ny);else throw new zn(void 0,"binary",Ny);let[r,i]=e;return{binary:r,prefix:i}}function MP(e,t=["git"],n=!1){let r=$y(Cn(t),n);e.on("binary",i=>{r=$y(Cn(i),n)}),e.append("spawn.binary",()=>r.binary),e.append("spawn.args",i=>r.prefix?[r.prefix,...i]:i)}dr();function OP(e){return!!(e.exitCode&&e.stdErr.length)}function IP(e){return Buffer.concat([...e.stdOut,...e.stdErr])}function RP(e=!1,t=OP,n=IP){return(r,i)=>!e&&r||!t(i)?r:n(i)}function Hy(e){return{type:"task.error",action(t,n){let r=e(t.error,{stdErr:n.stdErr,stdOut:n.stdOut,exitCode:n.exitCode});return Buffer.isBuffer(r)?{error:new dn(void 0,r.toString("utf-8"))}:{error:r}}}}oe();var LP=class{constructor(){this.plugins=new Set,this.events=new Gw.EventEmitter}on(e,t){this.events.on(e,t)}reconfigure(e,t){this.events.emit(e,t)}append(e,t){let n=we(this.plugins,{type:e,action:t});return()=>this.plugins.delete(n)}add(e){let t=[];return Cn(e).forEach(n=>n&&this.plugins.add(we(t,n))),()=>{t.forEach(n=>this.plugins.delete(n))}}exec(e,t,n){let r=t,i=Object.freeze(Object.create(n));for(let a of this.plugins)a.type===e&&(r=a.action(r,i));return r}};oe();function jP(e){let t="--progress",n=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(a,s){return n.includes(s.method)?Zy(a,t):a}},{type:"spawn.after",action(a,s){var o;s.commands.includes(t)&&((o=s.spawned.stderr)==null||o.on("data",l=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));c&&e({method:s.method,stage:DP(c[1]),progress:Oe(c[2]),processed:Oe(c[3]),total:Oe(c[4])})}))}}]}function DP(e){return String(e.toLowerCase().split(" ",1))||"unknown"}oe();function BP(e){let t=Qy(e,["uid","gid"]);return{type:"spawn.options",action(n){return tn(tn({},t),n)}}}function NP({block:e,stdErr:t=!0,stdOut:n=!0}){if(e>0)return{type:"spawn.after",action(r,i){var a,s;let o;function l(){o&&clearTimeout(o),o=setTimeout(u,e)}function c(){var f,h;(f=i.spawned.stdout)==null||f.off("data",l),(h=i.spawned.stderr)==null||h.off("data",l),i.spawned.off("exit",c),i.spawned.off("close",c),o&&clearTimeout(o)}function u(){c(),i.kill(new zn(void 0,"timeout","block timeout reached"))}n&&((a=i.spawned.stdout)==null||a.on("data",l)),t&&((s=i.spawned.stderr)==null||s.on("data",l)),i.spawned.on("exit",c),i.spawned.on("close",c),l()}}}Es();function $P(){return{type:"spawn.args",action(e){let t=[],n;function r(i){(n=n||[]).push(...i)}for(let i=0;iul(s)&&fy(s)||s));break}t.push(a)}return n?[...t,"--",...n.map(String)]:t}}}oe();var HP=bP();function UP(e,t){var n;let r=new LP,i=rv(e&&(typeof e=="string"?{baseDir:e}:e)||{},t);if(!vh(i.baseDir))throw new xP(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(TP(i.config)),r.add(kP(i.unsafe)),r.add($P()),r.add(CP(i.completion)),i.abort&&r.add(_P(i.abort)),i.progress&&r.add(jP(i.progress)),i.timeout&&r.add(NP(i.timeout)),i.spawnOptions&&r.add(BP(i.spawnOptions)),r.add(Hy(RP(!0))),i.errors&&r.add(Hy(i.errors)),MP(r,i.binary,(n=i.unsafe)==null?void 0:n.allowUnsafeCustomBinary),new HP(i,r)}Vi();var zw=UP;v();var Vw=require("obsidian"),El="YYYY-MM-DD",$h=`${El} HH:mm`,Hh=`${El} HH:mm:ss`,Al=40,Wi="conflict-files-obsidian-git.md",Pn={commitMessage:"vault backup: {{date}}",commitDateFormat:Hh,autoSaveInterval:0,autoPushInterval:0,autoPullInterval:0,autoPullOnBoot:!1,disablePush:!1,pullBeforePush:!0,disablePopups:!1,disablePopupsForNoChanges:!1,listChangedFilesInMessageBody:!1,showStatusBar:!0,updateSubmodules:!1,syncMethod:"merge",customMessageOnAutoBackup:!1,autoBackupAfterFileChange:!1,treeStructure:!1,refreshSourceControl:Vw.Platform.isDesktopApp,basePath:"",differentIntervalCommitAndPush:!1,changedFilesInStatusBar:!1,showedMobileNotice:!1,refreshSourceControlTimer:7e3,showBranchStatusBar:!0,setLastSaveToLastCommit:!1,submoduleRecurseCheckout:!1,gitDir:"",showFileMenu:!0,authorInHistoryView:"hide",dateInHistoryView:!1,lineAuthor:{show:!1,followMovement:"inactive",authorDisplay:"initials",showCommitHash:!1,dateTimeFormatOptions:"date",dateTimeFormatCustomString:$h,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}},pt={type:"git-view",name:"Source Control",icon:"git-pull-request"},nn={type:"git-history-view",name:"History",icon:"history"},Ct={type:"diff-view",name:"Diff View",icon:"git-pull-request"},kl="C:\\Program Files\\Git\\cmd\\git.exe",Tl="git_credentials_input",qi="obsidian_askpass.sh",Ww=`#!/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" +`;v();var qw=require("obsidian"),GP={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0},$e=class extends qw.SuggestModal{constructor(t,n){super(t.app),this.config={...GP,...n},this.setPlaceholder(this.config.placeholder)}openAndGetResult(){return new Promise(t=>{this.resolve=t,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(t=>setTimeout(t,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(t){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[t.length>0?t:" ",...this.config.options]:[t.length>0?t:"...",...this.config.options]}renderSuggestion(t,n){n.setText(t)}onChooseSuggestion(t,n){if(this.resolve){let r;this.config.allowEmpty&&t===" "?r="":t==="..."?r=void 0:r=t,this.resolve(r)}}};v();function Xw(e,t){let n=Object.assign({},e.lineAuthor,t.lineAuthor);return Object.assign({},e,t,{lineAuthor:n})}var Xi=class extends Error{constructor(n){super("No network connection available");this.originalError=n}};v();var PS=Xe(h2()),MS=Xe(FS()),aa=require("obsidian"),lp=(e,t)=>e==="."||t==null||t.length===0||t==="."?!0:t.length>=e.length?t.startsWith(e):e.startsWith(t);function Xt(e,t){let n;if(t){if(t.button===0||t.button===1){let r=aa.Keymap.isModEvent(t);n=e.workspace.getLeaf(r)}}else n=e.workspace.getLeaf(!1);return n}function In(e,t,n,r,i){if(t.button==2){let a=e.vault.getAbstractFileByPath(n);if(a!=null){let s=new aa.Menu;e.workspace.trigger("file-menu",s,a,i,r),s.showAtPosition({x:t.pageX,y:t.pageY})}}}function wr(e){throw new Error("Impossible branch: "+e)}function cp(e){return`rgb(${e.r},${e.g},${e.b})`}function OS(e){var a;let t=(a=PS.fromString(e))==null?void 0:a.toRgbaArray();if(t===void 0)return;let[n,r,i]=t;return{r:n,g:r,b:i}}function IS(e){return e.diff(aa.moment.unix(0),"seconds")}function RS(e){if(e.length!==0)return e.slice().sort()[Math.floor(e.length/2)]}function LS(e,t){return(0,MS.default)(e,t,{strict:!0})}function br(e,t){return new Proxy(e,{get(n,r){return r==="length"?Math.min(t,n.length):n[r]}})}function jS(e,t,n){return e.length<=t?new Array(t-e.length).fill(n).join("")+e:e.substring(e.length-t)}function DS(e,t){if(t<=0)return e;let n=new Array(t).fill(" ").join(""),r=e.substring(t,e.length);return n+r}function up(e,t,n){return e<=t&&t<=n}function xr(e){let[t,...n]=e.split("/");return[t,n.length===0?void 0:n.join("/")]}function Bt(e){return e.endsWith("/")?e:e.split("/").last().replace(".md","")}function Us(e){return e===1?"1 minute":`${e} minutes`}v();var BS=require("obsidian"),sa=class{constructor(t){this.plugin=t,this.app=t.app}getRelativeVaultPath(t){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+t:t}getRelativeRepoPath(t,n=!0){return n&&this.plugin.settings.basePath.length>0?t.substring(this.plugin.settings.basePath.length+1):t}unload(){}_getTreeStructure(t,n=0){let r=[];for(t=[...t];t.length>0;){let i=t.first(),a=i.path.substring(n);if(a.contains("/")){let s=a.substring(0,a.indexOf("/")),o=t.filter(c=>c.path.substring(n).startsWith(s+"/"));o.forEach(c=>t.remove(c));let l=i.path.substring(0,a.indexOf("/")+n);r.push({title:s,path:l,vaultPath:this.getRelativeVaultPath(l),children:this._getTreeStructure(o,(n>0?n+s.length:s.length)+1)})}else r.push({title:a,data:i,path:i.path,vaultPath:this.getRelativeVaultPath(i.path)}),t.remove(i)}return r}simplify(t){var n,r,i,a;for(let s of t){for(;;){let o=((n=s.children)==null?void 0:n.length)==1,l=((i=(r=s.children)==null?void 0:r.first())==null?void 0:i.data)==null;if(!(s.children!=null&&o&&l))break;let c=s.children.first();s.title+="/"+c.title,s.data=c.data,s.path=c.path,s.vaultPath=c.vaultPath,s.children=c.children}s.children!=null&&this.simplify(s.children),(a=s.children)==null||a.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 t.sort((s,o)=>{let l=(o.data==null?1:0)-(s.data==null?1:0);return l!=0?l:s.title.localeCompare(o.title)})}getTreeStructure(t){let n=this._getTreeStructure(t);return this.simplify(n)}async formatCommitMessage(t){let n;if(t.includes("{{numFiles}}")){n=await this.status();let r=n.staged.length;t=t.replace("{{numFiles}}",String(r))}if(t.includes("{{hostname}}")){let r=this.plugin.localStorage.getHostname()||"";t=t.replace("{{hostname}}",r)}if(t.includes("{{files}}")){n=n!=null?n:await this.status();let r={},i="";if(n.staged.length<100){n.staged.forEach(s=>{s.index in r?r[s.index].push(s.path):r[s.index]=[s.path]});let a=[];for(let[s,o]of Object.entries(r))a.push(s+" "+o.join(" "));i=a.join(", ")}else i="Too many files to list";t=t.replace("{{files}}",i)}if(t=t.replace("{{date}}",(0,BS.moment)().format(this.plugin.settings.commitDateFormat)),this.plugin.settings.listChangedFilesInMessageBody){let r=n!=null?n:await this.status(),i="";r.staged.length<100?i=r.staged.map(a=>a.path).join(` +`):i="Too many files to list",t=t+` + +Affected files: +`+i}return t}};var Le=class extends sa{constructor(n){super(n);this.useDefaultWindowsGitPath=!1}async setGitInstance(n=!1){if(this.isGitInstalled()){let r=this.app.vault.adapter,i=r.getBasePath(),a=i;this.plugin.settings.basePath&&(await r.exists((0,Xn.normalizePath)(this.plugin.settings.basePath))?a=He.join(i,this.plugin.settings.basePath):n||new Xn.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=a,this.git=zw({baseDir:a,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?kl:void 0),config:["core.quotepath=off"],unsafe:{allowUnsafeCustomBinary:!0}});let s=this.plugin.localStorage.getPATHPaths(),o=this.plugin.localStorage.getEnvVars(),l=this.plugin.settings.gitDir;if(s.length>0){let f=process.env.PATH+":"+s.join(":");process.env.PATH=f}l&&(process.env.GIT_DIR=l);for(let f of o){let[h,d]=f.split("=");process.env[h]=d}if(HS.default.enable("simple-git"),await this.git.checkIsRepo()){let f=await this.git.revparse("--show-cdup"),h=(0,Gs.resolve)(a+Gs.sep+f);this.absoluteRepoPath=h,await this.git.cwd(h)}let c=He.join(i,this.app.vault.configDir,"plugins","obsidian-git"),u=He.join(c,qi);process.env.SSH_ASKPASS==null&&(process.env.SSH_ASKPASS=u),process.env.OBSIDIAN_GIT_CREDENTIALS_INPUT=He.join(c,Tl),process.env.SSH_ASKPASS==u&&this.askpass().catch(f=>this.plugin.displayError(f))}}getRelativeVaultPath(n){let i=this.app.vault.adapter.getBasePath(),a=He.join(this.absoluteRepoPath,n),s=He.relative(i,a);return Xn.Platform.isWin&&(s=s.replace(/\\/g,"/")),s}getRelativeRepoPath(n,r=!0){if(r){let a=this.plugin.app.vault.adapter.getBasePath(),s=this.absoluteRepoPath,o=He.join(a,n),l=He.relative(s,o);return Xn.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return n}async askpass(){let n=this.app.vault.adapter,r=n.getBasePath(),i=He.join(r,this.app.vault.configDir,"plugins","obsidian-git"),a=this.app.vault.configDir+"/plugins/obsidian-git/";await Yn.writeFile(He.join(i,qi),Ww),await Yn.chmod(He.join(i,qi),493),this.watchAbortController=new AbortController;let{signal:s}=this.watchAbortController;try{let o=Yn.watch(i,{signal:s});for await(let l of o){if(l.filename!=Tl)continue;let c=a+Tl;if(!await n.exists(c))continue;let u=await n.read(c),f;u.length>60&&(f=new Xn.Notice(u,999999));let h=await new $e(this.plugin,{allowEmpty:!0,placeholder:u.length>60?"Enter a response to the message.":u}).openAndGetResult();f==null||f.hide(),await n.exists(c)&&await n.write(`${c}.response`,h!=null?h:"")}}catch(o){this.plugin.displayError(o),await Yn.rm(He.join(i,qi),{force:!0}),await Yn.rm(He.join(i,`${qi}.response`),{force:!0}),await new Promise(l=>setTimeout(l,5e3)),this.plugin.log("Retry watch for ask pass"),await this.askpass()}}unload(){var n;(n=this.watchAbortController)==null||n.abort()}async status(){this.plugin.setPluginState({gitAction:1});let n=await this.git.status();this.plugin.setPluginState({gitAction:0});let r=n.files.map(i=>{let a=this.formatPath(i);return{path:a.path,from:a.from,index:i.index==="?"?"U":i.index,working_dir:i.working_dir==="?"?"U":i.working_dir,vault_path:this.getRelativeVaultPath(a.path)}});return{all:r,changed:r.filter(i=>i.working_dir!==" "),staged:r.filter(i=>i.index!==" "&&i.index!="U"),conflicted:n.conflicted.map(i=>this.formatPath({path:i}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(n){let r=this.getRelativeRepoPath(n),a=["-C",He.dirname(r),"rev-parse","HEAD"],s=this.git.raw(a);return s.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),s}async getSubmodulePaths(){return new Promise(n=>{this.git.outputHandler((r,i,a,s)=>{if(!(s.contains("submodule")&&s.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");i.on("data",c=>{o+=c.toString("utf8")}),i.on("end",()=>{let u=o.split(` +`).map(f=>{let h=f.match(/'([^']*)'/);if(h!=null)return l+"/"+h[1]+Gs.sep}).filter(f=>!!f);u.reverse(),n(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},r=>this.plugin.displayError(r))})}formatPath(n,r=!1){function i(a){if(a!=null)return a.startsWith('"')&&a.endsWith('"')?a.substring(1,a.length-1):a}return r?{from:i(n.from),path:i(n.path)}:{path:i(n.path)}}async blame(n,r,i){if(n=this.getRelativeRepoPath(n),!await this.isTracked(n))return"untracked";let a=await this.getSubmoduleOfFile(n),s=a?["-C",a.submodule]:[],o=a?a.relativeFilepath:n;s.push("blame","--porcelain"),i&&s.push("-w");let l=`-C${Al}`;switch(r){case"inactive":break;case"same-commit":s.push("-C",l);break;case"all-commits":s.push("-C","-C",l);break;default:wr(r)}s.push("--",o);let c=await this.git.raw(s);return VR(c)}async isTracked(n){let r=await this.getSubmoduleOfFile(n),i=r?["-C",r.submodule]:[],a=r?r.relativeFilepath:n;return i.push("ls-files","--",a),this.git.raw(i).then(s=>s.trim()!=="")}async commitAll({message:n}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let i=await this.getSubmodulePaths();for(let a of i)await this.git.cwd({path:a,root:!1}).add("-A"),await this.git.cwd({path:a,root:!1}).commit(await this.formatCommitMessage(n))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let r=await this.git.commit(await this.formatCommitMessage(n));return this.app.workspace.trigger("obsidian-git:head-change"),r.summary.changes}async commit({message:n,amend:r}){this.plugin.setPluginState({gitAction:4});let i=(await this.git.commit(await this.formatCommitMessage(n),r?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),i}async stage(n,r){this.plugin.setPluginState({gitAction:3}),n=this.getRelativeRepoPath(n,r),await this.git.add(["--",n]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:n}){this.plugin.setPluginState({gitAction:3}),await this.git.add(n!=null?n:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:n}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(n!=null?["--",n]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(n,r){this.plugin.setPluginState({gitAction:3}),n=this.getRelativeRepoPath(n,r),await this.git.reset(["--",n]),this.plugin.setPluginState({gitAction:0})}async discard(n){this.plugin.setPluginState({gitAction:3}),await this.isTracked(n)?await this.git.checkout(["--",n]):await this.app.vault.adapter.rmdir(this.getRelativeVaultPath(n),!0),this.plugin.setPluginState({gitAction:0})}async hashObject(n){n=this.getRelativeRepoPath(n);let r=await this.getSubmoduleOfFile(n),i=r?["-C",r.submodule]:[],a=r?r.relativeFilepath:n;return i.push("hash-object","--",a),this.git.raw(i)}async discardAll({dir:n}){return this.discard(n!=null?n:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let n=await this.branchInfo(),r=await this.git.revparse([n.current]);if(!n.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let i=await this.git.revparse([n.tracking]);if(r!==i){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{switch(this.plugin.settings.syncMethod){case"merge":await this.git.merge([n.tracking]);break;case"rebase":await this.git.rebase([n.tracking])}}catch(o){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${n.current}`,i]),await this.unstageAll({})}catch(o){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`)}this.app.workspace.trigger("obsidian-git:head-change");let a=await this.git.revparse([n.current]);return(await this.git.diff([`${r}..${a}`,"--name-only"])).split(/\r\n|\r|\n/).filter(o=>o.length>0).map(o=>({path:o,working_dir:"P",vault_path:this.getRelativeVaultPath(o)}))}else return[]}catch(n){this.convertErrors(n)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let s=await this.git.env({...process.env,OBSIDIAN_GIT:1}).subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(s)}let n=await this.git.status(),r=n.tracking,i=n.current;if(!r&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring push of main repo and updating submodules only.");return}let a=(await this.git.diffSummary([i,r,"--"])).changed;return await this.git.env({...process.env,OBSIDIAN_GIT:1}).push(),a}catch(n){this.convertErrors(n)}}async getUnpushedCommits(){let n=await this.git.status(),r=n.tracking,i=n.current;return r==null||i==null?0:(await this.git.diffSummary([i,r,"--"])).changed}async canPush(){if(this.plugin.settings.updateSubmodules===!0)return!0;let n=await this.git.status(),r=n.tracking,i=n.current;return r?(await this.git.diffSummary([i,r,"--"])).changed!==0:!1}async checkRequirements(){return this.isGitInstalled()?await this.git.checkIsRepo()?"valid":"missing-repo":"missing-git"}async branchInfo(){let n=await this.git.status(),r=await this.git.branch(["--no-color"]);return{current:n.current||void 0,tracking:n.tracking||void 0,branches:r.all}}async getRemoteUrl(n){try{return await this.git.remote(["get-url",n])||void 0}catch(r){if(String(r).contains(n))return;throw r}}async log(n,r=!0,i){let a;return n&&(a=this.getRelativeRepoPath(n,r)),(await this.git.log({file:a,maxCount:i,"-m":null,"--name-status":null})).all.map(o=>{var l,c,u,f;return{...o,author:{name:o.author_name,email:o.author_email},refs:o.refs.split(", ").filter(h=>h.length>0),diff:{...o.diff,files:(c=(l=o.diff)==null?void 0:l.files.map(h=>({...h,status:h.status,path:h.file,hash:o.hash,vault_path:this.getRelativeVaultPath(h.file)})))!=null?c:[]},fileName:(f=(u=o.diff)==null?void 0:u.files.first())==null?void 0:f.file}})}async show(n,r,i=!0){let a=this.getRelativeRepoPath(r,i);return this.git.show([n+":"+a])}async checkout(n,r){if(r&&(n=`${r}/${n}`),await this.git.checkout(n),this.plugin.settings.submoduleRecurseCheckout){let i=await this.getSubmodulePaths();for(let a of i){let s=await this.git.cwd({path:a,root:!1}).branch();Object.keys(s.branches).includes(n)&&await this.git.cwd({path:a,root:!1}).checkout(n)}}}async createBranch(n){await this.git.checkout(["-b",n])}async deleteBranch(n,r){await this.git.branch([r?"-D":"-d",n])}async branchIsMerged(n){return!(await this.git.branch(["--no-merged"])).all.contains(n)}async init(){await this.git.init(!1)}async clone(n,r,i){await this.git.clone(n,He.join(this.app.vault.adapter.getBasePath(),r),i?["--depth",`${i}`]:[])}async setConfig(n,r){r==null?await this.git.raw(["config","--local","--unset",n]):await this.git.addConfig(n,r)}async getConfig(n){let i=(await this.git.listConfig("local")).all[n];if(typeof i=="string"||i==null)return i;throw new Error("Config value is not a string")}async fetch(n){await this.git.fetch(n!=null?[n]:[])}async setRemote(n,r){(await this.getRemotes()).includes(n)?await this.git.remote(["set-url",n,r]):await this.git.remote(["add",n,r])}async getRemoteBranches(n){let r=await this.git.branch(["-r","--list",`${n}*`]),i=[];for(let a in r.branches)i.push(r.branches[a].name);return i}async getRemotes(){let n=await this.git.remote([]);return n?n.trim().split(` +`):[]}async removeRemote(n){await this.git.removeRemote(n)}async updateUpstreamBranch(n){try{await this.git.branch(["--set-upstream-to",n])}catch(r){try{await this.git.branch(["--set-upstream",n])}catch(i){await this.git.push(["--set-upstream",...xr(n)])}}}updateGitPath(n){return this.setGitInstance()}updateBasePath(n){return this.setGitInstance(!0)}async getDiffString(n,r=!1,i){return r?await this.git.diff(["--cached","--",n]):i?await this.git.show([`${i}`,"--",n]):await this.git.diff(["--",n])}async diff(n,r,i){return await this.git.diff([`${r}..${i}`,"--",n])}async getSubmoduleOfFile(n){if(!await this.app.vault.adapter.exists(He.dirname(n)))return;let r=await this.git.raw(["-C",He.dirname(n),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(r=r.trim(),(await this.git.raw(["-C",He.dirname(n),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let s=this.app.vault.adapter.getFullPath(He.normalize(n)),o=He.relative(r,s);return{submodule:r,relativeFilepath:o}}async getLastCommitTime(){let n=await this.git.log({n:1});if(n!=null&&n.latest!=null)return new Date(n.latest.date)}isGitInstalled(){let n=this.plugin.localStorage.getGitPath(),r=(0,hp.spawnSync)(n||"git",["--version"],{stdio:"ignore"});if(r.error)if(Xn.Platform.isWin&&!n){this.plugin.log(`Git not found in PATH. Checking standard installation path(${kl}) of Git for Windows.`);let i=(0,hp.spawnSync)(kl,["--version"],{stdio:"ignore"});if(i.error)return console.error(i.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(r.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(n){if(n instanceof dn){let r=String(n.message);if(r.contains("Could not resolve host")||r.contains("Unable to resolve host")||r.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||r.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||r.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new Xi(r)}throw n}},US={hash:"000000",isZeroCommit:!0,summary:""};function VR(e){let n=e.replace(`\r +`,` +`).split(` +`),r={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},i=1;for(let a=0;a=4&&n.groupSizePerStartingLine.set(t,parseInt(e[3])),parseInt(e[2])!==t)throw Error(`git-blame output is out of order: ${t} vs ${e[2]}`);return r}function qR(e,t,n){let r=e[0],i=e.slice(1).join(" "),a=t.hashPerLine[n],s=t.commits.get(a)||{hash:a,author:{},committer:{},previous:{}};switch(r){case"summary":s.summary=i;break;case"author":s.author.name=i;break;case"author-mail":s.author.email=$S(i);break;case"author-time":s.author.epochSeconds=parseInt(i);break;case"author-tz":s.author.tz=i;break;case"committer":s.committer.name=i;break;case"committer-mail":s.committer.email=$S(i);break;case"committer-time":s.committer.epochSeconds=parseInt(i);break;case"committer-tz":s.committer.tz=i;break;case"previous":s.previous.commitHash=i;break;case"filename":s.previous.filename=i;break}t.commits.set(a,s)}function XR(e){if(e.summary===void 0)throw Error(`Summary not provided for commit: ${e.hash}`);fp(e.author)&&(e.author=void 0),fp(e.committer)&&(e.committer=void 0),fp(e.previous)&&(e.previous=void 0),e.isZeroCommit=!!e.hash.match(/^0*$/)}function fp(e){return!e||Object.keys(e).length===0}function NS(e){return e.length>0&&e[0].trim()===e[0]}function $S(e){let t=e.startsWith("<")?e.substring(1):e;return t.endsWith(">")?t.substring(0,t.length-1):t}v();var SE=require("@codemirror/state");v();var nE=require("@codemirror/state"),Fc=require("obsidian");v();var dp=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(t,n){if(t)return this.ensureInitialized(t),n(this.eventsPerFilepath.get(t))}forEachSubscriber(t){this.eventsPerFilepath.forEach(n=>n.forEach(t))}ensureInitialized(t){this.eventsPerFilepath.get(t)||this.eventsPerFilepath.set(t,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(t=>t==null?void 0:t.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},oa=new dp;v();var kc=require("@codemirror/state"),KS=Xe(pp());v();var V=require("obsidian");v();v();function gn(){}gn.prototype={diff:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.callback;typeof i=="function"&&(a=i,i={});var s=this;function o(A){return A=s.postProcess(A,i),a?(setTimeout(function(){a(A)},0),!0):A}t=this.castInput(t,i),n=this.castInput(n,i),t=this.removeEmpty(this.tokenize(t,i)),n=this.removeEmpty(this.tokenize(n,i));var l=n.length,c=t.length,u=1,f=l+c;i.maxEditLength!=null&&(f=Math.min(f,i.maxEditLength));var h=(r=i.timeout)!==null&&r!==void 0?r:1/0,d=Date.now()+h,p=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(p[0],n,t,0,i);if(p[0].oldPos+1>=c&&g+1>=l)return o(GS(s,p[0].lastComponent,n,t,s.useLongestToken));var m=-1/0,w=1/0;function b(){for(var A=Math.max(m,-u);A<=Math.min(w,u);A+=2){var x=void 0,k=p[A-1],y=p[A+1];k&&(p[A-1]=void 0);var E=!1;if(y){var _=y.oldPos-A;E=y&&0<=_&&_=c&&g+1>=l)return o(GS(s,x.lastComponent,n,t,s.useLongestToken));p[A]=x,x.oldPos+1>=c&&(w=Math.min(w,A-1)),g+1>=l&&(m=Math.max(m,A+1))}u++}if(a)(function A(){setTimeout(function(){if(u>f||Date.now()>d)return a();b()||A()},0)})();else for(;u<=f&&Date.now()<=d;){var S=b();if(S)return S}},addToPath:function(t,n,r,i,a){var s=t.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}},extractCommon:function(t,n,r,i,a){for(var s=n.length,o=r.length,l=t.oldPos,c=l-i,u=0;c+1d.length?g:d}),f.value=e.join(h)}else f.value=e.join(n.slice(c,c+f.count));c+=f.count,f.added||(u+=f.count)}}return a}var x$=new gn;function zS(e,t){var n;for(n=0;nt.length&&(n=e.length-t.length);var r=t.length;e.length0&&t[s]!=t[a];)a=i[a];t[s]==t[a]&&a++}a=0;for(var o=n;o0&&e[o]!=t[a];)a=i[a];e[o]==t[a]&&a++}return a}var vc="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",ZR=new RegExp("[".concat(vc,"]+|\\s+|[^").concat(vc,"]"),"ug"),bc=new gn;bc.equals=function(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()};bc.tokenize=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n;if(t.intlSegmenter){if(t.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');n=Array.from(t.intlSegmenter.segment(e),function(a){return a.segment})}else n=e.match(ZR)||[];var r=[],i=null;return n.forEach(function(a){/\s/.test(a)?i==null?r.push(a):r.push(r.pop()+a):/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+a):r.push(i+a):r.push(a),i=a}),r};bc.join=function(e){return e.map(function(t,n){return n==0?t:t.replace(/^\s+/,"")}).join("")};bc.postProcess=function(e,t){if(!e||t.oneChangePerToken)return e;var n=null,r=null,i=null;return e.forEach(function(a){a.added?r=a:a.removed?i=a:((r||i)&&qS(n,i,r,a),n=a,r=null,i=null)}),(r||i)&&qS(n,i,r,null),e};function qS(e,t,n,r){if(t&&n){var i=t.value.match(/^\s*/)[0],a=t.value.match(/\s*$/)[0],s=n.value.match(/^\s*/)[0],o=n.value.match(/\s*$/)[0];if(e){var l=zS(i,s);e.value=yp(e.value,s,l),t.value=zs(t.value,l),n.value=zs(n.value,l)}if(r){var c=VS(a,o);r.value=gp(r.value,o,c),t.value=yc(t.value,c),n.value=yc(n.value,c)}}else if(n)e&&(n.value=n.value.replace(/^\s*/,"")),r&&(r.value=r.value.replace(/^\s*/,""));else if(e&&r){var u=r.value.match(/^\s*/)[0],f=t.value.match(/^\s*/)[0],h=t.value.match(/\s*$/)[0],d=zS(u,f);t.value=zs(t.value,d);var p=VS(zs(u,d),h);t.value=yc(t.value,p),r.value=gp(r.value,u,p),e.value=yp(e.value,u,u.slice(0,u.length-p.length))}else if(r){var g=r.value.match(/^\s*/)[0],m=t.value.match(/\s*$/)[0],w=WS(m,g);t.value=yc(t.value,w)}else if(e){var b=e.value.match(/\s*$/)[0],S=t.value.match(/^\s*/)[0],A=WS(b,S);t.value=zs(t.value,A)}}var KR=new gn;KR.tokenize=function(e){var t=new RegExp("(\\r?\\n)|[".concat(vc,"]+|[^\\S\\n\\r]+|[^").concat(vc,"]"),"ug");return e.match(t)||[]};var xc=new gn;xc.tokenize=function(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,` +`));var n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?f(L.lines.slice(-s.context)):[],d-=g.length,p-=g.length)}(P=g).push.apply(P,mp(C.map(function(he){return(_.added?"+":"-")+he}))),_.added?w+=C.length:m+=C.length}else{if(d)if(C.length<=s.context*2&&S(0,_r.normalizePath)(a.substring(t.length))):i=r,i}async mkdir(t){return this.adapter.mkdir(t)}async rmdir(t,n){var r,i;return this.adapter.rmdir(t,(i=(r=n==null?void 0:n.options)==null?void 0:r.recursive)!=null?i:!1)}async stat(t){if(t.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.length,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let r=await this.adapter.stat(t);if(r==null)throw{code:"ENOENT"};return this.indexctime=r.ctime,this.indexmtime=r.mtime,{ctimeMs:r.ctime,mtimeMs:r.mtime,size:r.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}t==="."&&(t="/");let n=this.vault.getAbstractFileByPath(t);if(this.maybeLog("Stat: "+t),n instanceof _r.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:n.stat.ctime,mtimeMs:n.stat.mtime,size:n.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let r=await this.adapter.stat(t);if(r)return{ctimeMs:r.ctime,mtimeMs:r.mtime,size:r.size,type:r.type==="folder"?"directory":r.type,isFile:()=>r.type==="file",isDirectory:()=>r.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(t){return this.adapter.remove(t)}async lstat(t){return this.stat(t)}async readlink(t){throw new Error(`readlink of (${t}) is not implemented.`)}async symlink(t){throw new Error(`symlink of (${t}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(t){}};var yn=class extends sa{constructor(n){super(n);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 Sc(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var n,r;return{username:(n=this.plugin.localStorage.getUsername())!=null?n:void 0,password:(r=this.plugin.localStorage.getPassword())!=null?r:void 0}},onAuthFailure:async()=>{new ei.Notice("Authentication failed. Please try with different credentials");let n=await new $e(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(n){let r=await new $e(this.plugin,{placeholder:"Specify your password/personal access token"}).openAndGetResult();if(r)return this.plugin.localStorage.setUsername(n),this.plugin.localStorage.setPassword(r),{username:n,password:r}}return{cancel:!0}},http:{async request({url:n,method:r,headers:i,body:a}){let s;a&&(s=(await hL(a)).buffer);let o=await(0,ei.requestUrl)({url:n,method:r,headers:i,body:s,throw:!1});return{url:n,method:r,headers:o.headers,body:[new Uint8Array(o.arrayBuffer)],statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(n){try{let r=await n;return await this.fs.saveAndClear(),r}catch(r){throw await this.fs.saveAndClear(),r}}async status(){let n,r=window.setTimeout(()=>{n=new ei.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{this.plugin.setPluginState({gitAction:1});let i=(await this.wrapFS(ie.statusMatrix({...this.getRepo()}))).map(l=>this.getFileStatusResult(l)),a=i.filter(l=>l.working_dir!==" "),s=i.filter(l=>l.index!==" "&&l.index!=="U"),o=[];return window.clearTimeout(r),n==null||n.hide(),{all:i,changed:a,staged:s,conflicted:o}}catch(i){throw window.clearTimeout(r),n==null||n.hide(),this.plugin.displayError(i),i}}async commitAll({message:n,status:r,unstagedFiles:i}){try{return await this.checkAuthorInfo(),await this.stageAll({status:r,unstagedFiles:i}),this.commit({message:n})}catch(a){throw this.plugin.displayError(a),a}}async commit({message:n}){try{await this.checkAuthorInfo(),this.plugin.setPluginState({gitAction:4});let r=await this.formatCommitMessage(n),i=this.plugin.localStorage.getConflict(),a;if(i){let s=await this.branchInfo();a=[s.current,s.tracking]}await this.wrapFS(ie.commit({...this.getRepo(),message:r,parent:a})),this.plugin.localStorage.setConflict(!1);return}catch(r){throw this.plugin.displayError(r),r}}async stage(n,r){let i=this.getRelativeRepoPath(n,r),a;r?a=n:a=this.getRelativeVaultPath(n);try{this.plugin.setPluginState({gitAction:3}),await this.app.vault.adapter.exists(a)?await this.wrapFS(ie.add({...this.getRepo(),filepath:i})):await this.wrapFS(ie.remove({...this.getRepo(),filepath:i}))}catch(s){throw this.plugin.displayError(s),s}}async stageAll({dir:n,status:r,unstagedFiles:i}){try{if(r)await Promise.all(r.changed.map(a=>a.working_dir!=="D"?this.wrapFS(ie.add({...this.getRepo(),filepath:a.path})):ie.remove({...this.getRepo(),filepath:a.path})));else{let a=i!=null?i:await this.getUnstagedFiles(n!=null?n:".");await Promise.all(a.map(({filepath:s,deleted:o})=>o?ie.remove({...this.getRepo(),filepath:s}):this.wrapFS(ie.add({...this.getRepo(),filepath:s}))))}}catch(a){throw this.plugin.displayError(a),a}}async unstage(n,r){try{this.plugin.setPluginState({gitAction:3}),n=this.getRelativeRepoPath(n,r),await this.wrapFS(ie.resetIndex({...this.getRepo(),filepath:n}))}catch(i){throw this.plugin.displayError(i),i}}async unstageAll({dir:n,status:r}){try{let i;r?i=r.staged.map(a=>a.path):i=(await this.getStagedFiles(n!=null?n:".")).map(({filepath:s})=>s),await this.wrapFS(Promise.all(i.map(a=>ie.resetIndex({...this.getRepo(),filepath:a}))))}catch(i){throw this.plugin.displayError(i),i}}async discard(n){try{this.plugin.setPluginState({gitAction:3}),await this.wrapFS(ie.checkout({...this.getRepo(),filepaths:[n],force:!0}))}catch(r){throw this.plugin.displayError(r),r}}async discardAll({dir:n,status:r}){let i=[];r?n!=null?i=r.changed.filter(a=>a.path.startsWith(n)).map(a=>a.path):i=r.changed.map(a=>a.path):i=(await this.getUnstagedFiles(n)).map(({filepath:a})=>a);try{await this.wrapFS(ie.checkout({...this.getRepo(),filepaths:i,force:!0}))}catch(a){throw this.plugin.displayError(a),a}}getProgressText(n,r){let i=`${n} progress:`;return r.phase&&(i=`${i} ${r.phase}:`),r.loaded&&(i=`${i} ${r.loaded}`,r.total&&(i=`${i} of ${r.total}`)),i}resolveRef(n){return this.wrapFS(ie.resolveRef({...this.getRepo(),ref:n}))}async pull(){let n=this.showNotice("Initializing pull");try{this.plugin.setPluginState({gitAction:2});let r=await this.resolveRef("HEAD");await this.fetch();let i=await this.branchInfo();await this.checkAuthorInfo(),(await this.wrapFS(ie.merge({...this.getRepo(),ours:i.current,theirs:i.tracking,abortOnConflict:!1}))).alreadyMerged||await this.wrapFS(ie.checkout({...this.getRepo(),ref:i.current,onProgress:l=>{n!==void 0&&(n.noticeEl.innerText=this.getProgressText("Checkout",l))},remote:i.remote})),n==null||n.hide();let s=await this.resolveRef("HEAD"),o=await this.getFileChangesCount(r,s);return this.showNotice("Finished pull",!1),o.map(l=>({path:l.path,working_dir:"P",index:"P",vault_path:this.getRelativeVaultPath(l.path)}))}catch(r){throw n==null||n.hide(),r instanceof ps.MergeConflictError&&await this.plugin.handleConflict(r.data.filepaths.map(i=>this.getRelativeVaultPath(i))),this.plugin.displayError(r),r}}async push(){if(!await this.canPush())return 0;let n=this.showNotice("Initializing push");try{this.plugin.setPluginState({gitAction:1});let r=await this.branchInfo(),i=r.tracking,a=r.current,s=(await this.getFileChangesCount(a,i)).length;return this.plugin.setPluginState({gitAction:5}),await this.wrapFS(ie.push({...this.getRepo(),onProgress:o=>{n!==void 0&&(n.noticeEl.innerText=this.getProgressText("Pushing",o))}})),n==null||n.hide(),s}catch(r){throw n==null||n.hide(),this.plugin.displayError(r),r}}async getUnpushedCommits(){let n=await this.branchInfo(),r=n.tracking,i=n.current;if(r==null||i==null)return 0;let a=await this.resolveRef(i),s=await this.resolveRef(r);return(await this.getFileChangesCount(a,s)).length}async canPush(){let n=await this.branchInfo(),r=n.tracking,i=n.current,a=await this.resolveRef(i),s=await this.resolveRef(r);return a!=s}async checkRequirements(){return await this.plugin.app.vault.adapter.exists(`${this.getRepo().dir}/.git/HEAD`)?"valid":"missing-repo"}async branchInfo(){var n,r;try{let i=await ie.currentBranch(this.getRepo())||"",a=await ie.listBranches(this.getRepo()),s=(n=await this.getConfig(`branch.${i}.remote`))!=null?n:"origin",o=(r=await this.getConfig(`branch.${i}.merge`))==null?void 0:r.split("refs/heads")[1],l=o?s+o:void 0;return{current:i,tracking:l,branches:a,remote:s}}catch(i){throw this.plugin.displayError(i),i}}async getCurrentRemote(){var i;let n=await ie.currentBranch(this.getRepo())||"";return(i=await this.getConfig(`branch.${n}.remote`))!=null?i:"origin"}async checkout(n,r){try{return this.wrapFS(ie.checkout({...this.getRepo(),ref:n,force:!!r,remote:r}))}catch(i){throw this.plugin.displayError(i),i}}async createBranch(n){try{await this.wrapFS(ie.branch({...this.getRepo(),ref:n,checkout:!0}))}catch(r){throw this.plugin.displayError(r),r}}async deleteBranch(n){try{await this.wrapFS(ie.deleteBranch({...this.getRepo(),ref:n}))}catch(r){throw this.plugin.displayError(r),r}}branchIsMerged(n){return Promise.resolve(!0)}async init(){try{await this.wrapFS(ie.init(this.getRepo()))}catch(n){throw this.plugin.displayError(n),n}}async clone(n,r,i){let a=this.showNotice("Initializing clone");try{await this.wrapFS(ie.clone({...this.getRepo(),dir:r,url:n,depth:i,onProgress:s=>{a!==void 0&&(a.noticeEl.innerText=this.getProgressText("Cloning",s))}})),a==null||a.hide()}catch(s){throw a==null||a.hide(),this.plugin.displayError(s),s}}async setConfig(n,r){try{return this.wrapFS(ie.setConfig({...this.getRepo(),path:n,value:r}))}catch(i){throw this.plugin.displayError(i),i}}async getConfig(n){try{return this.wrapFS(ie.getConfig({...this.getRepo(),path:n}))}catch(r){throw this.plugin.displayError(r),r}}async fetch(n){let r=this.showNotice("Initializing fetch");try{let i={...this.getRepo(),onProgress:a=>{r!==void 0&&(r.noticeEl.innerText=this.getProgressText("Fetching",a))},remote:n!=null?n:await this.getCurrentRemote()};await this.wrapFS(ie.fetch(i)),r==null||r.hide()}catch(i){throw this.plugin.displayError(i),r==null||r.hide(),i}}async setRemote(n,r){try{await this.wrapFS(ie.addRemote({...this.getRepo(),remote:n,url:r,force:!0}))}catch(i){throw this.plugin.displayError(i),i}}async getRemoteBranches(n){let r=[];return r.push(...await this.wrapFS(ie.listBranches({...this.getRepo(),remote:n}))),r.remove("HEAD"),r=r.map(i=>`${n}/${i}`),r}async getRemotes(){return(await this.wrapFS(ie.listRemotes({...this.getRepo()}))).map(n=>n.remote)}async removeRemote(n){await this.wrapFS(ie.deleteRemote({...this.getRepo(),remote:n}))}async getRemoteUrl(n){var r;return(r=(await this.wrapFS(ie.listRemotes({...this.getRepo()}))).filter(i=>i.remote==n)[0])==null?void 0:r.url}async log(n,r=!0,i){let a=await this.wrapFS(ie.log({...this.getRepo(),depth:i}));return Promise.all(a.map(async s=>{let o=s.commit.message.split(` + +`);return{message:o[0],author:{name:s.commit.author.name,email:s.commit.author.email},body:o.slice(1).join(` + +`),date:new Date(s.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(s.commit.parent.first(),s.oid)).map(l=>({path:l.path,status:l.type,vault_path:this.getRelativeVaultPath(l.path),hash:s.oid,binary:void 0}))},hash:s.oid,refs:[]}}))}updateBasePath(n){return this.getRepo().dir=n,Promise.resolve()}async updateUpstreamBranch(n){let[r,i]=xr(n),a=await this.branchInfo();await this.wrapFS(ie.push({...this.getRepo(),remote:r,remoteRef:i})),await this.setConfig(`branch.${a.current}.merge`,`refs/heads/${i}`)}updateGitPath(n){return Promise.resolve()}async getFileChangesCount(n,r){return this.walkDifference({walkers:[ie.TREE({ref:n}),ie.TREE({ref:r})]})}async walkDifference({walkers:n,dir:r}){return await this.wrapFS(ie.walk({...this.getRepo(),trees:n,map:async function(a,[s,o]){if(!lp(a,r))return null;if(await(s==null?void 0:s.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(s==null?void 0:s.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(s),console.log(o)),u!=="equal")return{path:a,type:u}}}))}async getStagedFiles(n="."){return(await this.walkDifference({walkers:[ie.TREE({ref:"HEAD"}),ie.STAGE()],dir:n})).map(i=>({vault_path:this.getRelativeVaultPath(i.path),filepath:i.path}))}async getUnstagedFiles(n="."){let r,i=window.setTimeout(()=>{r=new ei.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let a=this.getRepo(),s=await this.wrapFS(ie.walk({...a,trees:[ie.WORKDIR(),ie.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await ie.isIgnored({...a,filepath:o})||!lp(o,n))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),h=[u,f].includes("blob");if((u==="tree"||u==="special")&&!h)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!h)return;let d=f==="blob"?await c.oid():void 0,p;return u==="blob"&&f!=="blob"?p="42":u==="blob"&&(p=await l.oid()),p?p!==d?{filepath:o,deleted:!1}:null:{filepath:o,deleted:!0}}}));return window.clearTimeout(i),r==null||r.hide(),s}catch(a){throw window.clearTimeout(i),r==null||r.hide(),this.plugin.displayError(a),a}}async getDiffString(n,r=!1,i){let a=this.getRelativeVaultPath(n),s=async(c,[u])=>{if(n==c){let f=await u.oid();return(await ie.readBlob({...this.getRepo(),oid:f})).blob}};if(i){let c=await ys({...this.getRepo(),filepath:n,oid:i}).then(d=>new TextDecoder().decode(d.blob)).catch(d=>{if(!(d instanceof ie.Errors.NotFoundError))throw d}),u=await ie.readCommit({...this.getRepo(),oid:i}),f=await ys({...this.getRepo(),filepath:n,oid:u.commit.parent.first()}).then(d=>new TextDecoder().decode(d.blob)).catch(d=>{if(!(d instanceof ie.Errors.NotFoundError))throw d});return _c(a,f!=null?f:"",c!=null?c:"")}let o=(await ie.walk({...this.getRepo(),trees:[ie.STAGE()],map:s})).first(),l=new TextDecoder().decode(o);if(r){let c=await this.resolveRef("HEAD").then(f=>ys({...this.getRepo(),filepath:n,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof ie.Errors.NotFoundError))throw f});return _c(a,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(a)?c=await this.app.vault.adapter.read(a):c="",_c(a,l,c)}}async getLastCommitTime(){let n=this.getRepo(),r=await this.resolveRef("HEAD"),a=(await ie.readCommit({...n,oid:r})).commit.committer.timestamp;return new Date(a*1e3)}getFileStatusResult(n){let r=this.status_mapping[`${n[this.HEAD]}${n[this.WORKDIR]}${n[this.STAGE]}`];return{index:r[0]=="?"?"U":r[0],working_dir:r[1]=="?"?"U":r[1],path:n[this.FILE],vault_path:this.getRelativeVaultPath(n[this.FILE])}}async checkAuthorInfo(){let n=await this.getConfig("user.name"),r=await this.getConfig("user.email");if(!n||!r)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(n,r=!0){if(!this.plugin.settings.disablePopups)return new ei.Notice(n,r?this.noticeLength:void 0)}};function cL(e){let t=[e];return{next(){return Promise.resolve({done:t.length===0,value:t.pop()})},return(){return t=[],{}},[Symbol.asyncIterator](){return this}}}function uL(e){return e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]?e[Symbol.iterator]():e.next?e:cL(e)}async function fL(e,t){let n=uL(e);for(;;){let{value:r,done:i}=await n.next();if(r&&await t(r),i)break}n.return&&n.return()}async function hL(e){let t=0,n=[];await fL(e,a=>{n.push(a),t+=a.byteLength});let r=new Uint8Array(t),i=0;for(let a of n)r.set(a,i),i+=a.byteLength;return r}var dL="https://momentjs.com/docs/#/parsing/string-format/",pL="https://publish.obsidian.md/git-doc/Line+Authoring",Ec=class extends V.PluginSettingTab{constructor(n,r){super(n,r);this.plugin=r;this.lineAuthorColorSettings=new Map}get settings(){return this.plugin.settings}display(){let{containerEl:n}=this,r=this.plugin,i;r.settings.differentIntervalCommitAndPush?i="commit":i="commit-and-sync";let a=r.gitReady;n.empty(),a||(n.createEl("p",{text:"Git is not ready. When all settings are correct you can configure commit-sync, etc."}),n.createEl("br"));let s;if(a){new V.Setting(n).setName("Automatic").setHeading(),new V.Setting(n).setName("Split timers for automatic commit and sync").setDesc("Enable to use one interval for commit and another for sync.").addToggle(u=>u.setValue(r.settings.differentIntervalCommitAndPush).onChange(async f=>{r.settings.differentIntervalCommitAndPush=f,await r.saveSettings(),r.automaticsManager.reload("commit","push"),this.display()})),new V.Setting(n).setName(`Auto ${i} interval (minutes)`).setDesc(`${r.settings.differentIntervalCommitAndPush?"Commit":"Commit and sync"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText(u=>u.setValue(String(r.settings.autoSaveInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoSaveInterval=Number(f),await r.saveSettings(),r.automaticsManager.reload("commit"),r.settings.autoSaveInterval>0?new V.Notice(`Automatic ${i} enabled! Every ${Us(r.settings.autoSaveInterval)}.`):r.settings.autoSaveInterval<=0&&new V.Notice(`Automatic ${i} disabled!`))})),s=new V.Setting(n).setName(`Auto ${i} after stopping file edits`).setDesc(`Requires the ${i} interval not to be 0. + If turned on, do auto ${i} every ${Us(r.settings.autoSaveInterval)} after stopping file edits. + This also prevents auto ${i} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(u=>u.setValue(r.settings.autoBackupAfterFileChange).onChange(async f=>{r.settings.autoBackupAfterFileChange=f,this.display(),await r.saveSettings(),r.automaticsManager.reload("commit")})),this.mayDisableSetting(s,r.settings.setLastSaveToLastCommit),s=new V.Setting(n).setName(`Auto ${i} after latest commit`).setDesc(`If turned on, sets last auto ${i} timestamp to the latest commit timestamp. This reduces the frequency of auto ${i} when doing manual commits.`).addToggle(u=>u.setValue(r.settings.setLastSaveToLastCommit).onChange(async f=>{r.settings.setLastSaveToLastCommit=f,await r.saveSettings(),r.automaticsManager.reload("commit"),this.display()})),this.mayDisableSetting(s,r.settings.autoBackupAfterFileChange),s=new V.Setting(n).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(u=>u.setValue(String(r.settings.autoPushInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoPushInterval=Number(f),await r.saveSettings(),r.automaticsManager.reload("push"),r.settings.autoPushInterval>0?new V.Notice(`Automatic push enabled! Every ${Us(r.settings.autoPushInterval)}.`):r.settings.autoPushInterval<=0&&new V.Notice("Automatic push disabled!"))})),this.mayDisableSetting(s,!r.settings.differentIntervalCommitAndPush),new V.Setting(n).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(u=>u.setValue(String(r.settings.autoPullInterval)).onChange(async f=>{isNaN(Number(f))?new V.Notice("Please specify a valid number."):(r.settings.autoPullInterval=Number(f),await r.saveSettings(),r.automaticsManager.reload("pull"),r.settings.autoPullInterval>0?new V.Notice(`Automatic pull enabled! Every ${Us(r.settings.autoPullInterval)}.`):r.settings.autoPullInterval<=0&&new V.Notice("Automatic pull disabled!"))})),new V.Setting(n).setName(`Specify custom commit message on auto ${i}`).setDesc("You will get a pop up to specify your message.").addToggle(u=>u.setValue(r.settings.customMessageOnAutoBackup).onChange(async f=>{r.settings.customMessageOnAutoBackup=f,await r.saveSettings(),this.display()})),s=new V.Setting(n).setName(`Commit message on auto ${i}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>u.setPlaceholder("vault backup: {{date}}").setValue(r.settings.autoCommitMessage).onChange(async f=>{r.settings.autoCommitMessage=f,await r.saveSettings()})),this.mayDisableSetting(s,r.settings.customMessageOnAutoBackup),new V.Setting(n).setName("Commit message").setHeading(),new V.Setting(n).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(u=>u.setPlaceholder("vault backup: {{date}}").setValue(r.settings.commitMessage?r.settings.commitMessage:"").onChange(async f=>{r.settings.commitMessage=f,await r.saveSettings()}));let c=new V.Setting(n).setName("{{date}} placeholder format").addMomentFormat(u=>u.setDefaultFormat(r.settings.commitDateFormat).setValue(r.settings.commitDateFormat).onChange(async f=>{r.settings.commitDateFormat=f,await r.saveSettings()}));c.descEl.innerHTML=` + Specify custom date format. E.g. "${Hh}. See Moment.js for more formats.`,new V.Setting(n).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device.").addText(u=>{var f;return u.setValue((f=r.localStorage.getHostname())!=null?f:"").onChange(h=>{r.localStorage.setHostname(h)})}),new V.Setting(n).setName("Preview commit message").addButton(u=>u.setButtonText("Preview").onClick(async()=>{let f=await r.gitManager.formatCommitMessage(r.settings.commitMessage);new V.Notice(`${f}`)})),new V.Setting(n).setName("List filenames affected by commit in the commit body").addToggle(u=>u.setValue(r.settings.listChangedFilesInMessageBody).onChange(async f=>{r.settings.listChangedFilesInMessageBody=f,await r.saveSettings()})),new V.Setting(n).setName("Pull").setHeading(),r.gitManager instanceof Le&&new V.Setting(n).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(u=>{let f={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};u.addOptions(f),u.setValue(r.settings.syncMethod),u.onChange(async h=>{r.settings.syncMethod=h,await r.saveSettings()})}),new V.Setting(n).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(u=>u.setValue(r.settings.autoPullOnBoot).onChange(async f=>{r.settings.autoPullOnBoot=f,await r.saveSettings()})),new V.Setting(n).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),s=new V.Setting(n).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 ${r.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(u=>u.setValue(!r.settings.disablePush).onChange(async f=>{r.settings.disablePush=!f,this.display(),await r.saveSettings()})),new V.Setting(n).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 ${r.settings.disablePush?"":"and push "}only.`).addToggle(u=>u.setValue(r.settings.pullBeforePush).onChange(async f=>{r.settings.pullBeforePush=f,this.display(),await r.saveSettings()})),r.gitManager instanceof Le&&(new V.Setting(n).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new V.Setting(n).setName("History view").setHeading(),new V.Setting(n).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(r.settings.authorInHistoryView),c.onChange(async f=>{r.settings.authorInHistoryView=f,await r.saveSettings(),await r.refresh()})}),new V.Setting(n).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(r.settings.dateInHistoryView).onChange(async u=>{r.settings.dateInHistoryView=u,await r.saveSettings(),await r.refresh()})),new V.Setting(n).setName("Source control view").setHeading(),new V.Setting(n).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(r.settings.refreshSourceControl).onChange(async u=>{r.settings.refreshSourceControl=u,await r.saveSettings()})),new V.Setting(n).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>c.setValue(r.settings.refreshSourceControlTimer.toString()).setPlaceholder("7000").onChange(async u=>{r.settings.refreshSourceControlTimer=Math.max(parseInt(u),500),await r.saveSettings(),r.setRefreshDebouncer()})),new V.Setting(n).setName("Miscellaneous").setHeading(),new V.Setting(n).setName("Disable notifications").setDesc("Disable notifications for git operations to minimize distraction (refer to status bar for updates). Errors are still shown as notifications even if you enable this setting.").addToggle(c=>c.setValue(r.settings.disablePopups).onChange(async u=>{r.settings.disablePopups=u,this.display(),await r.saveSettings()})),r.settings.disablePopups||new V.Setting(n).setName("Hide notifications for no changes").setDesc("Don't show notifications when there are no changes to commit or push.").addToggle(c=>c.setValue(r.settings.disablePopupsForNoChanges).onChange(async u=>{r.settings.disablePopupsForNoChanges=u,await r.saveSettings()})),new V.Setting(n).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(r.settings.showStatusBar).onChange(async u=>{r.settings.showStatusBar=u,await r.saveSettings()})),new V.Setting(n).setName("Show stage/unstage button in file menu").addToggle(c=>c.setValue(r.settings.showFileMenu).onChange(async u=>{r.settings.showFileMenu=u,await r.saveSettings()})),new V.Setting(n).setName("Show branch status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(r.settings.showBranchStatusBar).onChange(async u=>{r.settings.showBranchStatusBar=u,await r.saveSettings()})),new V.Setting(n).setName("Show the count of modified files in the status bar").addToggle(c=>c.setValue(r.settings.changedFilesInStatusBar).onChange(async u=>{r.settings.changedFilesInStatusBar=u,await r.saveSettings()})),r.gitManager instanceof yn?new V.Setting(n).setName("Authentication/commit author").setHeading():new V.Setting(n).setName("Commit author").setHeading(),r.gitManager instanceof yn&&new V.Setting(n).setName("Username on your git server. E.g. your username on GitHub").addText(c=>{var u;c.setValue((u=r.localStorage.getUsername())!=null?u:""),c.onChange(f=>{r.localStorage.setUsername(f)})}),r.gitManager instanceof yn&&new V.Setting(n).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=>{r.localStorage.setPassword(u)})}),r.gitReady&&new V.Setting(n).setName("Author name for commit").addText(async c=>{var u;c.setValue((u=await r.gitManager.getConfig("user.name"))!=null?u:""),c.onChange(async f=>{await r.gitManager.setConfig("user.name",f==""?void 0:f)})}),r.gitReady&&new V.Setting(n).setName("Author email for commit").addText(async c=>{var u;c.setValue((u=await r.gitManager.getConfig("user.email"))!=null?u:""),c.onChange(async f=>{await r.gitManager.setConfig("user.email",f==""?void 0:f)})}),new V.Setting(n).setName("Advanced").setDesc("These settings usually don't need to be changed, but may be requried for special setups.").setHeading(),r.gitManager instanceof Le&&(new V.Setting(n).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(r.settings.updateSubmodules).onChange(async u=>{r.settings.updateSubmodules=u,await r.saveSettings()})),r.settings.updateSubmodules&&new V.Setting(n).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(r.settings.submoduleRecurseCheckout).onChange(async u=>{r.settings.submoduleRecurseCheckout=u,await r.saveSettings()}))),r.gitManager instanceof Le&&new V.Setting(n).setName("Custom Git binary path").addText(c=>{var u;c.setValue((u=r.localStorage.getGitPath())!=null?u:""),c.setPlaceholder("git"),c.onChange(f=>{r.localStorage.setGitPath(f),r.gitManager.updateGitPath(f||"git").catch(h=>r.displayError(h))})}),r.gitManager instanceof Le&&new V.Setting(n).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(r.localStorage.getEnvVars().join(` +`)),c.onChange(u=>{r.localStorage.setEnvVars(u.split(` +`))})}),r.gitManager instanceof Le&&new V.Setting(n).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(r.localStorage.getPATHPaths().join(` +`)),c.onChange(u=>{r.localStorage.setPATHPaths(u.split(` +`))})}),r.gitManager instanceof Le&&new V.Setting(n).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 r.gitManager.setGitInstance()})}),new V.Setting(n).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(r.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{r.settings.basePath=u,await r.saveSettings(),r.gitManager.updateBasePath(u||"").catch(f=>r.displayError(f))})}),new V.Setting(n).setName("Custom Git directory path (Instead of '.git')").setDesc('Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(r.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{r.settings.gitDir=u,await r.saveSettings()})}),new V.Setting(n).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(r.localStorage.getPluginDisabled()).onChange(u=>{r.localStorage.setPluginDisabled(u),u?r.unloadPlugin():r.init({fromReload:!0}).catch(f=>r.displayError(f)),new V.Notice("Obsidian must be restarted for the changes to take affect.")})),new V.Setting(n).setName("Support").setHeading(),new V.Setting(n).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=n.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 V.Notice("Debug information copied to clipboard. May contain sensitive information!")},V.Platform.isDesktopApp){let c=n.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=n.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),V.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(n,r){r&&(n.setDisabled(r),n.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(n){this.settings.lineAuthor.show=n,this.plugin.saveSettings(),n?this.plugin.lineAuthoringFeature.activateFeature():this.plugin.lineAuthoringFeature.deactivateFeature()}async lineAuthorSettingHandler(n,r){this.settings.lineAuthor[n]=r,await this.plugin.saveSettings(),this.plugin.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let n=this.settings.lineAuthor;n.authorDisplay!=="hide"&&(n.lastShownAuthorDisplay=n.authorDisplay),n.dateTimeFormatOptions!=="hide"&&(n.lastShownDateTimeFormatOptions=n.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let n=new V.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform()||n.setDesc("Only available on desktop currently.").setDisabled(!0),n.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.`,n.addToggle(r=>r.setValue(this.settings.lineAuthor.show).onChange(i=>{this.configureLineAuthorShowStatus(i),this.display()})),this.settings.lineAuthor.show){let r=new V.Setting(this.containerEl).setName("Follow movement and copies across files and commits").setDesc("").addDropdown(a=>{a.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),a.setValue(this.settings.lineAuthor.followMovement),a.onChange(s=>this.lineAuthorSettingHandler("followMovement",s))});if(r.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 ${Al} characters) within the same (or all) commit(s), the originating commit's information is shown.`,new V.Setting(this.containerEl).setName("Show commit hash").addToggle(a=>{a.setValue(this.settings.lineAuthor.showCommitHash),a.onChange(s=>this.lineAuthorSettingHandler("showCommitHash",s))}),new V.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(a=>{let s={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};a.addOptions(s),a.setValue(this.settings.lineAuthor.authorDisplay),a.onChange(async o=>this.lineAuthorSettingHandler("authorDisplay",o))}),new V.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(a=>{let s={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeFormatOptions),a.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",o),this.display()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let a=new V.Setting(this.containerEl);a.setName("Custom authoring date format").addText(s=>{s.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),s.setPlaceholder("YYYY-MM-DD HH:mm"),s.onChange(async o=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",o),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(o)})}),a.descEl.innerHTML=this.previewCustomDateTimeDescriptionHtml(this.settings.lineAuthor.dateTimeFormatCustomString)}new V.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(a=>{let s={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};a.addOptions(s),a.setValue(this.settings.lineAuthor.dateTimeTimezone),a.onChange(async o=>this.lineAuthorSettingHandler("dateTimeTimezone",o))}).descEl.innerHTML=` + The time-zone in which the authoring date should be shown. + Either your local time-zone (default), + the author's time-zone during commit creation or + UTC\xB100:00. + `;let i=new V.Setting(this.containerEl).setName("Oldest age in coloring");i.descEl.innerHTML=this.previewOldestAgeDescriptionHtml(this.settings.lineAuthor.coloringMaxAge)[0],i.addText(a=>{a.setPlaceholder("1y"),a.setValue(this.settings.lineAuthor.coloringMaxAge),a.onChange(async s=>{let[o,l]=this.previewOldestAgeDescriptionHtml(s);i.descEl.innerHTML=o,l&&(await this.lineAuthorSettingHandler("coloringMaxAge",s),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest"),new V.Setting(this.containerEl).setName("Text color").addText(a=>{a.setValue(this.settings.lineAuthor.textColorCss),a.onChange(async s=>{await this.lineAuthorSettingHandler("textColorCss",s)})}).descEl.innerHTML=` + The CSS color of the gutter text.
+ + It is higly 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 V.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(a=>{a.setValue(this.settings.lineAuthor.ignoreWhitespace),a.onChange(s=>this.lineAuthorSettingHandler("ignoreWhitespace",s))}).descEl.innerHTML=` + Whitespace and newlines are interpreted as + part of the document and in changes + by default (hence not ignored). + This makes the last line being shown as 'changed' + when a new subsequent line is added, + even if the previously last line's text is the same. +
+ 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(n){let r=new V.Setting(this.containerEl).setName("").addText(i=>{let a=Sp(n,this.settings.lineAuthor),s=Sp(n,Pn.lineAuthor);i.setPlaceholder(cp(s)),i.setValue(cp(a)),i.onChange(async o=>{let l=OS(o);if(l!==void 0){let c=n==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(n,l)})});this.lineAuthorColorSettings.set(n,r),this.refreshColorSettingsName(n),this.refreshColorSettingsDesc(n,Sp(n,this.settings.lineAuthor))}refreshColorSettingsName(n){let r=this.lineAuthorColorSettings.get(n);if(r){let i=n==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";r.nameEl.innerText=`Color for ${i} commits`}}refreshColorSettingsDesc(n,r){let i=this.lineAuthorColorSettings.get(n);i&&(i.descEl.innerHTML=this.colorSettingPreviewDescHtml(n,this.settings.lineAuthor,r!==void 0))}colorSettingPreviewDescHtml(n,r,i){let a=i?Ep(n,r):"rgba(127,127,127,0.3)",s=V.moment.unix(V.moment.now()/1e3).format("YYYY-MM-DD"),o=i?`abcdef Author Name ${s}`:"invalid color";return`Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and + named colors (e.g. 'black', 'purple'). Color preview: ${`
${o}
`}`}previewCustomDateTimeDescriptionHtml(n){let r=(0,V.moment)().format(n);return`
Format string to display the authoring date.
Currently: ${r}`}previewOldestAgeDescriptionHtml(n){let r=Ac(n);return[`The oldest age in the line author coloring. Everything older will have the same color. +
Smallest valid age is "1d". Currently: ${r!==void 0?`${r.asDays()} days`:"invalid!"}`,r]}};function Sp(e,t){return e==="oldest"?t.colorOld:t.colorNew}function Ac(e){let t=V.moment.duration("P"+e.toUpperCase());return t.isValid()&&t.asDays()&&t.asDays()>=1?t:void 0}function JS(e,t,n){if(!(e===void 0||t===void 0||n===void 0))return`head${e}-obj${t}-path${n}`}var QS=kc.Annotation.define();function eE(e,t,n){return n.update({annotations:QS.of({key:e,la:t,lineOffsetsFromUnsavedChanges:new Map})})}function mL(e){return e.annotation(QS)}var la=kc.StateField.define({create:e=>{},update:(e,t)=>{var n;return(n=mL(t))!=null?n:gL(t,e)},compare:(e,t)=>(e==null?void 0:e.key)===(t==null?void 0:t.key)});function Tc(e){var a;let t=KS.sha256.create();if(!e)return t;let{la:n,key:r,lineOffsetsFromUnsavedChanges:i}=e;t.update(n==="untracked"?"t":"f"),t.update(r);for(let[s,o]of(a=i.entries())!=null?a:[])t.update([s,o]);return t}var an={get:void 0,save:void 0};function tE(e,t){an.get=e,an.save=t}function Cc(e){var t,n;return(n=(t=Ac(e.coloringMaxAge))==null?void 0:t.asDays())!=null?n:Ac(Pn.lineAuthor.coloringMaxAge).asDays()}function gL(e,t){if(t)return e.changes.empty||e.changes.iterChanges((n,r,i,a)=>{var p;let s=e.startState.doc,{newDoc:o}=e,l=s.lineAt(n).number,c=s.lineAt(r).number,u=o.lineAt(i).number,f=o.lineAt(a).number,h=c-l+1,d=f-u+1;for(let g=u;g<=f;g++){let m=(p=t.lineOffsetsFromUnsavedChanges.get(g))!=null?p:0,w=f===g,b=d-h;w&&(m+=b),t.lineOffsetsFromUnsavedChanges.set(g,m)}}),t}var Ap=class{constructor(t){this.state=t;this.subscribeMe()}notifyLineAuthoring(t,n){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${t}`);return}let r=this.view.state,i=eE(t,n,r);this.view.dispatch(i)}updateToNewState(t){let n=this.lastSeenPath&&this.filepath!=this.lastSeenPath;return this.state=t,n&&(this.unsubscribeMe(this.lastSeenPath),this.subscribeMe()),this}removeIfStale(){this.view.destroyed&&this.unsubscribeMe(this.lastSeenPath)}subscribeMe(){this.filepath!==void 0&&(oa.ifFilepathDefinedTransformSubscribers(this.filepath,t=>t.add(this)),this.lastSeenPath=this.filepath)}unsubscribeMe(t){oa.ifFilepathDefinedTransformSubscribers(t,n=>n.delete(this))}get filepath(){var t,n;return(n=(t=this.state.field(Fc.editorInfoField))==null?void 0:t.file)==null?void 0:n.path}get view(){return this.state.field(Fc.editorEditorField)}},rE=nE.StateField.define({create:e=>new Ap(e),update:(e,t)=>e.updateToNewState(t.state),compare:(e,t)=>e===t});v();function iE(){ca=void 0,kp=[],Pc=0,Oc.clear(),Ic.clear(),ua.clear()}var ca,Mc=()=>ca;function aE(e,t){var i;let n=t.length;if(n<((i=ca==null?void 0:ca.length)!=null?i:0))return;ca={gutter:e,length:n,text:t};let r=an.get();n!==r.gutterSpacingFallbackLength&&(r.gutterSpacingFallbackLength=n,an.save(r))}var kp=[],yL=15,Pc=0;function sE(e){kp[Pc]=e,Pc=(Pc+1)%yL}function oE(){return RS(kp)}var Oc=new Map,Ic=new Map,ua=new Set;v();var bE=require("@codemirror/state"),xE=require("@codemirror/view");v();var Pp=require("@codemirror/view"),gE=Xe(pp()),jc=require("obsidian");v();v();var Rc={x:-10,y:-10};function lE(){Rc.x===-10&&window.addEventListener("mousedown",e=>{Rc.x=e.clientX,Rc.y=e.clientY})}function cE(){for(let e of ua)if(vL(e,Rc))return e}function vL(e,t){let{x:n,y:r,width:i,height:a}=e.getBoundingClientRect();return n<=t.x&&t.x<=n+i&&r<=t.y&&t.y<=r+a}v();var Ws={};var uE="data-commit";function fE(e,t,n){if(t.hasFocus())return;let r=cE();if(!r)return;let i=bL(r);i&&(!i.isZeroCommit&&!i.isWaitingGutter&&wL(i,e),Tp("showCommitHash",e),Tp("authorDisplay",e),Tp("dateTimeFormatOptions",e))}function wL(e,t){t.addItem(n=>n.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(r=>navigator.clipboard.writeText(e.hash)))}function Tp(e,t){var l,c;let n,r,i=Ws.plugin.settings.lineAuthor,a=i[e],s=typeof a=="boolean"?a:a!=="hide",o=Pn.lineAuthor[e];if(e==="showCommitHash")n="Show commit hash",r=a;else if(e==="authorDisplay"){let u=(l=i.lastShownAuthorDisplay)!=null?l:o;n="Show author "+(s?a:u),r=s?"hide":u}else if(e==="dateTimeFormatOptions"){let u=(c=i.lastShownDateTimeFormatOptions)!=null?c:o;n="Show "+(s?a:u),n+=n.contains("date")?"":" date",r=s?"hide":u}else wr(e);t.addItem(u=>u.setTitle(n).setSection("obs-git-line-author-configure").setChecked(s).onClick(f=>{var h,d;return(d=(h=Ws.plugin)==null?void 0:h.settingsTab)==null?void 0:d.lineAuthorSettingHandler(e,r)}))}function hE(e,t,n){n.setAttr(uE,JSON.stringify({hash:e.hash,isZeroCommit:e.isZeroCommit,isWaitingGutter:t}))}function bL(e){let t=e.getAttr(uE);return t?JSON.parse(t):void 0}v();function Ep(e,t){return e==="oldest"?Lc(0,!1,t).color:Lc(void 0,!0,t).color}function Lc(e,t,n){let r=Cc(n),i=Date.now()/1e3,a=e!=null?e:0,o=(t?0:i-a)/60/60/24,l=Math.pow(Math.clamp(o/r,0,1),1/2.3),c=xL(),u=n.colorNew,f=n.colorOld,h=c?.4:1,d=Cp(u.r,f.r,l)*h,p=Cp(u.g,f.g,l)*h,g=Cp(u.b,f.b,l)*h;return{color:`rgba(${d},${p},${g},${c?.75:.25})`,daysSinceCommit:o}}function Cp(e,t,n){return e+(t-e)*n}function xL(){var e;return((e=window.app)==null?void 0:e.getTheme())==="obsidian"}function dE(e){document.body.style.setProperty("--obs-git-gutter-text",e.textColorCss)}v();function pE(e,t,n){let r;for(let i=t;i<=n;i++){let a=e.hashPerLine[i],s=e.commits.get(a);(!r||s.isZeroCommit||_L(s,r))&&(r=s)}return r}function _L(e,t){var i,a,s,o;let n=(a=(i=e.author)==null?void 0:i.epochSeconds)!=null?a:0,r=(o=(s=t.author)==null?void 0:s.epochSeconds)!=null?o:0;return n>r}var mE="-",SL="+",EL=3,AL="*",kL=/\S/g,TL="%",fa=class e extends Pp.GutterMarker{constructor(n){super();this.text=n}eq(n){return n instanceof e&&this.text===n.text}toDOM(){return document.createTextNode(this.text)}destroy(n){document.body.contains(n)||n.remove()}},Fp=class extends Pp.GutterMarker{constructor(n,r,i,a,s,o){super();this.lineAuthoring=n;this.startLine=r;this.endLine=i;this.key=a;this.settings=s;this.options=o;this.point=!1;this.elementClass="obs-git-blame-gutter"}eq(n){return this.key===(n==null?void 0:n.key)&&this.startLine===(n==null?void 0:n.startLine)&&this.endLine===(n==null?void 0:n.endLine)&&(this==null?void 0:this.options)===(n==null?void 0:n.options)}toDOM(){var n;return this.precomputedDomProvider=(n=this.precomputedDomProvider)!=null?n:this.computeDom(),this.precomputedDomProvider()}destroy(n){document.body.contains(n)||(n.remove(),ua.delete(n))}computeDom(){let n=pE(this.lineAuthoring,this.startLine,this.endLine),r=n.isZeroCommit?"":this.renderNonZeroCommit(n);return!n.isZeroCommit&&this.options!=="waiting-for-result"?aE(this,r):r=this.adaptTextForFakeCommit(n,r,this.options),this.createHtmlNode(n,r,this.options==="waiting-for-result")}createHtmlNode(n,r,i){var c;let a=window.createDiv();a.innerText=r;let{color:s,daysSinceCommit:o}=Lc((c=n==null?void 0:n.author)==null?void 0:c.epochSeconds,n==null?void 0:n.isZeroCommit,this.settings);a.style.backgroundColor=s,hE(n,i,a);function l(){let u=a.cloneNode(!0);return ua.add(u),i||sE(o),u}return l}renderNonZeroCommit(n){let r=this.settings.showCommitHash?this.renderHash(n):"",i=this.settings.authorDisplay==="hide"?"":`${this.renderAuthorName(n,this.settings.authorDisplay)}`,a=this.settings.dateTimeFormatOptions==="hide"?"":`${this.renderAuthoringDate(n,this.settings.dateTimeFormatOptions,this.settings.dateTimeFormatCustomString,this.settings.dateTimeTimezone)}`;return[r,i,a].filter(o=>o.length>=1).join(" ")}renderHash(n){return n.hash.substring(0,6)}renderAuthorName(n,r){var o,l,c,u;let i=(l=(o=n==null?void 0:n.author)==null?void 0:o.name)!=null?l:"",a=i.split(" ").filter(f=>f.length>=1),s;switch(r){case"initials":s=a.map(f=>f[0].toUpperCase()).join("");break;case"first name":s=(c=a.first())!=null?c:mE;break;case"last name":s=(u=a.last())!=null?u:mE;break;case"full":s=i;break;default:return wr(r)}return LS(n==null?void 0:n.author,n==null?void 0:n.committer)||(s=s+AL),s}renderAuthoringDate(n,r,i,a){var c;let s="?";if(((c=n==null?void 0:n.author)==null?void 0:c.epochSeconds)===void 0)return s;let o;switch(r){case"date":o=El;break;case"datetime":o=$h;break;case"custom":o=i;break;case"natural language":o=u=>{let f=u.diff((0,jc.moment)());return jc.moment.duration(f).humanize(!0)};break;default:return wr(r)}let l=jc.moment.unix(n.author.epochSeconds);switch(a){case"viewer-local":break;case"author-local":l=l.utcOffset(n.author.tz),typeof o=="string"&&(o+=" Z");break;case"utc0000":l=l.utc(),typeof o=="string"&&(o+="[Z]");break;default:return wr(a)}return typeof o=="string"?l.format(o):o(l)}adaptTextForFakeCommit(n,r,i){var l,c,u,f;let a=(c=(l=Mc())==null?void 0:l.text)!=null?c:r,s=i!=="waiting-for-result"&&n.isZeroCommit?SL:TL;r=a.replace(kL,s);let o=(f=(u=an.get())==null?void 0:u.gutterSpacingFallbackLength)!=null?f:r.length;if(r=jS(r,o,s),i!=="waiting-for-result"&&n.isZeroCommit){let h=Math.min(o,EL);r=DS(r,o-h)}return r}};function ti(e,t,n,r,i,a){let s=gE.sha256.create();s.update(Object.values(i).join(",")),s.update(`s${t}-e${n}-k${r}-o${a}`);let o=s.hex(),l=Oc.get(o);if(l)return l;let c=new Fp(e,t,n,r,i,a);return Oc.set(o,c),c}v();var yE=require("obsidian");function Mp(){var t,n;let e=(n=(t=an.get())==null?void 0:t.gutterSpacingFallbackLength)!=null?n:Pn.lineAuthor.gutterSpacingFallbackLength;return new fa(Array(e).fill("-").join(""))}function Op(e){let{lineAuthoring:t,ageForInitialRender:n}=CL(e);return ti(t,1,1,"initialGutter"+n,e,"waiting-for-result")}function CL(e){var a;let t=(a=oE())!=null?a:Cc(e)*.25,n=(0,yE.moment)().add(-t,"days"),r={name:"",epochSeconds:IS(n),tz:"+0000"},i={hash:"waiting-for-result",author:r,committer:r,isZeroCommit:!1};return{lineAuthoring:{hashPerLine:[void 0,"waiting-for-result"],commits:new Map([["waiting-for-result",i]])},ageForInitialRender:t}}v();function vE(e,t){return ti({hashPerLine:[void 0,"000000"],commits:new Map([["000000",US]])},1,1,e,t)}var Ip=new fa(""),_E=(0,xE.gutter)({class:"line-author-gutter-container",markers(e){let t=e.state.field(la,!1);return FL(e,t)},lineMarkerChange(e){let t=Tc(e.state.field(la));return Tc(e.startState.field(la))!==t},renderEmptyElements:!0,initialSpacer:e=>(wE(e),Mp()),updateSpacer:(e,t)=>{var n,r;return wE(t.view),(r=(n=Mc())==null?void 0:n.gutter)!=null?r:Mp()}});function FL(e,t){let n=Tc(t),r=e.state.doc,i=new Map;for(let u=1;u<=r.lines;u++){let f=r.line(u).from,h=e.lineBlockAt(f).to;i.set(u,[f,h]),n.update([f,h,0])}let a=an.get();n.update("s"+Object.values(an).join(","));let s=n.hex(),o=Ic.get(s);if(o)return o;let{result:l,allowCache:c}=PL(r,i,a,t);return c&&Ic.set(s,l),l}function PL(e,t,n,r){let i=!0,a=e.lines,s=[];function o(f,h,d){return s.push(d.range(f,h))}let l=ML(a,r),c=e.length===0,u=e.iterLines(a,a+1).next().value==="";for(let f=1;f<=a;f++){let[h,d]=t.get(f),p=e.lineAt(d).number;if(c){o(h,d,Ip);continue}if(f===a&&u){o(h,d,Ip);continue}if(r===void 0){o(h,d,Op(n)),i=!1;continue}let{key:g,la:m}=r;if(m==="untracked"){o(h,d,vE(m,n));continue}let w=m.hashPerLine.length-1,b=l[f],S=l[p];if(S&&S>w&&o(h,d,Ip),b!==void 0&&up(1,b,w)&&S!==void 0&&up(1,S,w)){o(h,d,ti(m,b,S,g,n));continue}if(w<1){o(h,d,Op(n)),i=!1;continue}let A=Math.clamp(b!=null?b:f,1,w),x=Math.clamp(S!=null?S:p,1,w);o(h,d,ti(m,A,x,g+"computing",n,"waiting-for-result"))}return{result:bE.RangeSet.of(s,!0),allowCache:i}}function ML(e,t){if(!(t!=null&&t.lineOffsetsFromUnsavedChanges))return Array.from(new Array(e+1),i=>i);let n=[void 0],r=0;for(let i=1;i<=e;i++){let a=t.lineOffsetsFromUnsavedChanges.get(i);r+=a!=null?a:0,n[i]=a===void 0?i-r:void 0}return n}function wE(e){e.dom.querySelectorAll(".cm-gutters").forEach(n=>{n!=null&&n.style&&(n.style.marginLeft||(n.style.marginLeft="unset"))})}var Dc=class{constructor(t){this.plugin=t;this.lineAuthorings=new Map}async trackChanged(t){return this.trackChangedHelper(t).catch(n=>(console.warn("Git: Error in trackChanged."+n),Promise.reject(n)))}async trackChangedHelper(t){if(t){if(t.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeLineAuthorInfo(t.path)}}destroy(){this.lineAuthorings.clear(),oa.clear(),iE()}async computeLineAuthorInfo(t){let n=this.plugin.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager,r=await n.submoduleAwareHeadRevisonInContainingDirectory(t),i=await n.hashObject(t),a=JS(r,i,t);if(a!==void 0){if(!this.lineAuthorings.has(a)){let s=await n.blame(t,this.plugin.settings.lineAuthor.followMovement,this.plugin.settings.lineAuthor.ignoreWhitespace);this.lineAuthorings.set(a,s)}this.notifyComputationResultToSubscribers(t,a)}}notifyComputationResultToSubscribers(t,n){oa.ifFilepathDefinedTransformSubscribers(t,r=>r.forEach(i=>i.notifyLineAuthoring(n,this.lineAuthorings.get(n))))}},EE=SE.Prec.high([rE,la,_E]);var Bc=class{constructor(t){this.plg=t;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=t=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let n=t==null?void 0:t.view;!(n instanceof ni.MarkdownView)||n.file==null||(n==null?void 0:n.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(n.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),tE(()=>this.plg.settings.lineAuthor,t=>{this.plg.settings.lineAuthor=t,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;dE(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new Dc(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(t){console.warn("Git: Error while loading line authoring feature.",t),this.deactivateFeature()}}deactivateFeature(){var t;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(t=this.lineAuthorInfoProvider)==null||t.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&ni.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Le?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(EE),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let t of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(t);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),lE(),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.fileRenameEvent)}destroyEventHandlers(){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.fileRenameEvent),this.plg.app.workspace.offref(this.gutterContextMenuEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",t=>{var n;return void((n=this.lineAuthorInfoProvider)==null?void 0:n.trackChanged(t).catch(console.error))})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(t,n)=>{var r;return t instanceof ni.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(t))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",t=>{var n;return t instanceof ni.TFile&&((n=this.lineAuthorInfoProvider)==null?void 0:n.trackChanged(t))})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",fE)}};v();var Nc=class{constructor(t){this.plugin=t;this.tasks=[]}addTask(t){this.tasks.push(t),this.tasks.length===1&&this.handleTask()}handleTask(){this.tasks.length>0&&this.tasks[0]().catch(t=>this.plugin.displayError(t)).finally(()=>{this.tasks.shift(),this.handleTask()})}clear(){this.tasks=[]}};v();var sn=require("obsidian");var $c=class{constructor(t,n){this.statusBarEl=t;this.plugin=n;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),n.registerEvent(n.app.workspace.on("obsidian-git:refresh",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(t,n){this.messages.push({message:`Git: ${t.slice(0,100)}`,timeout:n}),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.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,sn.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.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,sn.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,sn.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,sn.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,sn.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,sn.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,sn.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var r;let t=this.lastCommitTimestamp,n=this.plugin.state.offlineMode;if(t){let i=(0,sn.moment)(t).fromNow();this.statusBarEl.ariaLabel=`${n?"Offline: ":""}Last Commit: ${i}`,(r=this.unPushedCommits)!=null&&r&&(this.statusBarEl.ariaLabel+=` +(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=n?"Git is offline":"Git is ready";n?(0,sn.setIcon)(this.iconEl,"globe"):(0,sn.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()}};v();var Uc=require("obsidian"),Hc=class extends Uc.SuggestModal{constructor(n){super(n.app);this.plugin=n;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(n=>{this.resolve=n,this.open()})}onClose(){new Promise(n=>setTimeout(n,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(n){let r=(0,Uc.moment)().format(this.plugin.settings.commitDateFormat);return n==""&&(n="..."),[n,`${r}: ${n}`,`${n}: ${r}`]}renderSuggestion(n,r){r.innerText=n}onChooseSuggestion(n,r){this.resolve&&this.resolve(n)}};v();var AE=require("obsidian"),qs=class{constructor(t){this.plugin=t}saveLastAuto(t,n){n==="backup"?this.plugin.localStorage.setLastAutoBackup(t.toString()):n==="pull"?this.plugin.localStorage.setLastAutoPull(t.toString()):n==="push"&&this.plugin.localStorage.setLastAutoPush(t.toString())}loadLastAuto(){var t,n,r;return{backup:new Date((t=this.plugin.localStorage.getLastAutoBackup())!=null?t:""),pull:new Date((n=this.plugin.localStorage.getLastAutoPull())!=null?n:""),push:new Date((r=this.plugin.localStorage.getLastAutoPush())!=null?r:"")}}async init(){await this.setUpAutoCommitAndSync();let t=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let n=new Date,r=this.plugin.settings.autoPushInterval-Math.round((n.getTime()-t.push.getTime())/1e3/60);this.startAutoPush(r<=0?0:r)}if(this.plugin.settings.autoPullInterval>0){let n=new Date,r=this.plugin.settings.autoPullInterval-Math.round((n.getTime()-t.pull.getTime())/1e3/60);this.startAutoPull(r<=0?0:r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...t){t.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),t.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),t.contains("pull")&&(this.clearAutoPull(),this.plugin.settings.autoPullInterval>0&&this.startAutoPull(this.plugin.settings.autoPullInterval))}async setUpAutoCommitAndSync(){if(this.plugin.settings.setLastSaveToLastCommit){this.clearAutoCommitAndSync();let t=await this.plugin.gitManager.getLastCommitTime();t&&this.plugin.localStorage.setLastAutoBackup(t.toString())}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let t=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let n=new Date,r=this.plugin.settings.autoSaveInterval-Math.round((n.getTime()-t.backup.getTime())/1e3/60);this.startAutoCommitAndSync(r<=0?0:r)}}}startAutoCommitAndSync(t){let n=(t!=null?t:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?t===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,AE.debounce)(()=>this.doAutoCommitAndSync(),n,!0):(n>2147483647&&(n=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),n))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(()=>this.plugin.settings.differentIntervalCommitAndPush?this.plugin.commit({fromAuto:!0}):this.plugin.commitAndSync(!0)),this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync()}startAutoPull(t){let n=(t!=null?t:this.plugin.settings.autoPullInterval)*6e4;n>2147483647&&(n=2147483647),this.timeoutIDPull=window.setTimeout(()=>{this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote()),this.saveLastAuto(new Date,"pull"),this.startAutoPull()},n)}startAutoPush(t){let n=(t!=null?t:this.plugin.settings.autoPushInterval)*6e4;n>2147483647&&(n=2147483647),this.timeoutIDPush=window.setTimeout(()=>{this.plugin.promiseQueue.addTask(()=>this.plugin.push()),this.saveLastAuto(new Date,"push"),this.startAutoPush()},n)}clearAutoCommitAndSync(){var n;let t=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,t=!0),this.plugin.autoCommitDebouncer&&((n=this.plugin.autoCommitDebouncer)==null||n.cancel(),this.plugin.autoCommitDebouncer=void 0,t=!0),t}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}};v();var Ys=require("obsidian");v();var Xs=require("obsidian");async function kE(e,t,n){let r=await CE(t,n);if(r.result==="failure"){new Xs.Notice(r.reason);return}let{isGitHub:i,branch:a,repo:s,user:o,filePath:l}=r;if(i){let c=e.getCursor("from").line+1,u=e.getCursor("to").line+1;c===u?window.open(`https://github.com/${o}/${s}/blob/${a}/${l}?plain=1#L${c}`):window.open(`https://github.com/${o}/${s}/blob/${a}/${l}?plain=1#L${c}-L${u}`)}else new Xs.Notice("It seems like you are not using GitHub")}async function TE(e,t){let n=await CE(e,t);if(n.result==="failure"){new Xs.Notice(n.reason);return}let{isGitHub:r,branch:i,repo:a,user:s,filePath:o}=n;r?window.open(`https://github.com/${s}/${a}/commits/${i}/${o}`):new Xs.Notice("It seems like you are not using GitHub")}async function CE(e,t){let n=await t.branchInfo(),r=n.tracking,i=n.current,a,s=t.getRelativeRepoPath(e.path);if(t instanceof Le){let l=await t.getSubmoduleOfFile(t.getRelativeRepoPath(e.path));if(l){s=l.relativeFilepath;let c=await t.git.cwd({path:l.submodule,root:!1}).status();if(r=c.tracking||void 0,i=c.current||void 0,r){let u=r.substring(0,r.indexOf("/")),f=await t.git.cwd({path:l.submodule,root:!1}).getConfig(`remote.${u}.url`,"local");if(f.value!=null)a=f.value;else return{result:"failure",reason:"Failed to get remote url of submodule"}}}}if(r==null)return{result:"failure",reason:"Remote branch is not configured"};if(i==null)return{result:"failure",reason:"Failed to get current branch name"};if(a==null){let l=r.substring(0,r.indexOf("/"));if(a=await t.getConfig(`remote.${l}.url`),a==null)return{result:"failure",reason:"Failed to get remote url"}}let o=a.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,h]=o;return{result:"success",isGitHub:!!l,repo:u||h,user:c||f,branch:i,filePath:s}}}v();var FE=require("obsidian"),Gc=class extends FE.FuzzySuggestModal{constructor(t,n){super(t.app),this.plugin=t,this.changedFiles=n,this.setPlaceholder("Not supported files will be opened by default app!")}getItems(){return this.changedFiles}getItemText(t){if(t.index=="U"&&t.working_dir=="U")return`Untracked | ${t.vault_path}`;let n="",r="";return t.working_dir!=" "&&(n=`Working Dir: ${t.working_dir} `),t.index!=" "&&(r=`Index: ${t.index}`),`${n}${r} | ${t.vault_path}`}onChooseItem(t,n){this.plugin.app.metadataCache.getFirstLinkpathDest(t.vault_path,"")==null?this.app.openWithDefaultApp(t.vault_path):this.plugin.app.workspace.openLinkText(t.vault_path,"/")}};v();var PE=require("obsidian"),zc=class extends PE.Modal{constructor(n,r){super(n);this.content=r;this.resolve=null}openAndGetReslt(){return new Promise(n=>{this.resolve=n,this.open()})}onOpen(){let{contentEl:n,titleEl:r}=this;r.setText("Edit .gitignore");let i=n.createDiv(),a=i.createEl("textarea",{text:this.content,cls:["obsidian-git-textarea"],attr:{rows:10,cols:30,wrap:"off"}});i.createEl("button",{cls:["mod-cta","obsidian-git-center-button"],text:"Save"}).addEventListener("click",()=>{this.resolve(a.value),this.close()})}onClose(){let{contentEl:n}=this;n.empty(),this.resolve&&this.resolve(void 0)}};function ME(e){let t=e.app;e.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let n=e.gitManager.getRelativeVaultPath(".gitignore");await t.vault.adapter.exists(n)||await t.vault.adapter.write(n,"");let r=await t.vault.adapter.read(n),a=await new zc(t,r).openAndGetReslt();a!==void 0&&(await t.vault.adapter.write(n,a),await e.refresh())}}),e.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var i;let n=t.workspace.getLeavesOfType(pt.type),r;n.length===0?(r=(i=t.workspace.getRightLeaf(!1))!=null?i:t.workspace.getLeaf(),await r.setViewState({type:pt.type})):r=n.first(),await t.workspace.revealLeaf(r),t.workspace.trigger("obsidian-git:refresh")}}),e.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var i;let n=t.workspace.getLeavesOfType(nn.type),r;n.length===0?(r=(i=t.workspace.getRightLeaf(!1))!=null?i:t.workspace.getLeaf(),await r.setViewState({type:nn.type})):r=n.first(),await t.workspace.revealLeaf(r),t.workspace.trigger("obsidian-git:refresh")}}),e.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:n=>{var i;let r=t.workspace.getActiveFile();if(n)return r!==null;(i=Xt(t))==null||i.setViewState({type:Ct.type,active:!0,state:{staged:!1,file:e.gitManager.getRelativeRepoPath(r.path,!0)}})}}),e.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(n,{file:r})=>{if(r)return kE(n,r,e.gitManager)}}),e.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(n,{file:r})=>{if(r)return TE(r,e.gitManager)}}),e.addCommand({id:"pull",name:"Pull",callback:()=>e.promiseQueue.addTask(()=>e.pullChangesFromRemote())}),e.addCommand({id:"fetch",name:"Fetch",callback:()=>e.promiseQueue.addTask(()=>e.fetch())}),e.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>e.promiseQueue.addTask(()=>e.switchRemoteBranch())}),e.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:n=>{let r=t.workspace.getActiveFile();if(n)return r!==null;e.addFileToGitignore(r).catch(i=>e.displayError(i))}}),e.addCommand({id:"push",name:"Commit-and-sync",callback:()=>e.promiseQueue.addTask(()=>e.commitAndSync(!1))}),e.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>e.promiseQueue.addTask(async()=>{await e.commitAndSync(!1),window.close()})}),e.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>e.promiseQueue.addTask(()=>e.commitAndSync(!1,!0))}),e.addCommand({id:"commit",name:"Commit all changes",callback:()=>e.promiseQueue.addTask(()=>e.commit({fromAuto:!1}))}),e.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>e.promiseQueue.addTask(()=>e.commit({fromAuto:!1,requestCustomMessage:!0}))}),e.addCommand({id:"commit-staged",name:"Commit staged",callback:()=>e.promiseQueue.addTask(()=>e.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:!0}))}),Ys.Platform.isDesktopApp&&e.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>e.promiseQueue.addTask(()=>e.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),e.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",callback:()=>e.promiseQueue.addTask(()=>e.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0}))}),e.addCommand({id:"push2",name:"Push",callback:()=>e.promiseQueue.addTask(()=>e.push())}),e.addCommand({id:"stage-current-file",name:"Stage current file",checkCallback:n=>{let r=t.workspace.getActiveFile();if(n)return r!==null;e.promiseQueue.addTask(()=>e.stageFile(r))}}),e.addCommand({id:"unstage-current-file",name:"Unstage current file",checkCallback:n=>{let r=t.workspace.getActiveFile();if(n)return r!==null;e.promiseQueue.addTask(()=>e.unstageFile(r))}}),e.addCommand({id:"edit-remotes",name:"Edit remotes",callback:()=>e.editRemotes().catch(n=>e.displayError(n))}),e.addCommand({id:"remove-remote",name:"Remove remote",callback:()=>e.removeRemote().catch(n=>e.displayError(n))}),e.addCommand({id:"set-upstream-branch",name:"Set upstream branch",callback:()=>e.setUpstreamBranch().catch(n=>e.displayError(n))}),e.addCommand({id:"delete-repo",name:"CAUTION: Delete repository",callback:async()=>{await t.vault.adapter.exists(`${e.settings.basePath}/.git`)?await new $e(e,{options:["NO","YES"],placeholder:"Do you really want to delete the repository (.git directory)? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&(await t.vault.adapter.rmdir(`${e.settings.basePath}/.git`,!0),new Ys.Notice("Successfully deleted repository. Reloading plugin..."),e.unloadPlugin(),await e.init({fromReload:!0})):new Ys.Notice("No repository found")}}),e.addCommand({id:"init-repo",name:"Initialize a new repo",callback:()=>e.createNewRepo().catch(n=>e.displayError(n))}),e.addCommand({id:"clone-repo",name:"Clone an existing remote repo",callback:()=>e.cloneNewRepo().catch(n=>e.displayError(n))}),e.addCommand({id:"list-changed-files",name:"List changed files",callback:async()=>{if(await e.isAllInitialized())try{let n=await e.updateCachedStatus();if(n.changed.length+n.staged.length>500){e.displayError("Too many changes to display");return}new Gc(e,n.all).open()}catch(n){e.displayError(n)}}}),e.addCommand({id:"switch-branch",name:"Switch branch",callback:()=>{e.switchBranch().catch(n=>e.displayError(n))}}),e.addCommand({id:"create-branch",name:"Create new branch",callback:()=>{e.createBranch().catch(n=>e.displayError(n))}}),e.addCommand({id:"delete-branch",name:"Delete branch",callback:()=>{e.deleteBranch().catch(n=>e.displayError(n))}}),e.addCommand({id:"discard-all",name:"CAUTION: Discard all changes",callback:async()=>{if(!await e.isAllInitialized())return!1;await new $e(e,{options:["NO","YES"],placeholder:"Do you want to discard all changes to tracked files? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&e.promiseQueue.addTask(()=>e.discardAll())}}),e.addCommand({id:"toggle-line-author-info",name:"Toggle line author information",callback:()=>{var n;return(n=e.settingsTab)==null?void 0:n.configureLineAuthorShowStatus(!e.settings.lineAuthor.show)}})}v();var Vc=class{constructor(t){this.plugin=t;this.prefix=this.plugin.manifest.id+":",this.app=t.app}migrate(){let t=["password","hostname","conflict","lastAutoPull","lastAutoBackup","lastAutoPush","gitPath","pluginDisabled"];for(let n of t){let r=localStorage.getItem(this.prefix+n);this.app.loadLocalStorage(this.prefix+n)==null&&r!=null&&r!=null&&(this.app.saveLocalStorage(this.prefix+n,r),localStorage.removeItem(this.prefix+n))}}getPassword(){return this.app.loadLocalStorage(this.prefix+"password")}setPassword(t){return this.app.saveLocalStorage(this.prefix+"password",t)}getUsername(){return this.app.loadLocalStorage(this.prefix+"username")}setUsername(t){return this.app.saveLocalStorage(this.prefix+"username",t)}getHostname(){return this.app.loadLocalStorage(this.prefix+"hostname")}setHostname(t){return this.app.saveLocalStorage(this.prefix+"hostname",t)}getConflict(){return this.app.loadLocalStorage(this.prefix+"conflict")=="true"}setConflict(t){return this.app.saveLocalStorage(this.prefix+"conflict",`${t}`)}getLastAutoPull(){return this.app.loadLocalStorage(this.prefix+"lastAutoPull")}setLastAutoPull(t){return this.app.saveLocalStorage(this.prefix+"lastAutoPull",t)}getLastAutoBackup(){return this.app.loadLocalStorage(this.prefix+"lastAutoBackup")}setLastAutoBackup(t){return this.app.saveLocalStorage(this.prefix+"lastAutoBackup",t)}getLastAutoPush(){return this.app.loadLocalStorage(this.prefix+"lastAutoPush")}setLastAutoPush(t){return this.app.saveLocalStorage(this.prefix+"lastAutoPush",t)}getGitPath(){return this.app.loadLocalStorage(this.prefix+"gitPath")}setGitPath(t){return this.app.saveLocalStorage(this.prefix+"gitPath",t)}getPATHPaths(){var t,n;return(n=(t=this.app.loadLocalStorage(this.prefix+"PATHPaths"))==null?void 0:t.split(":"))!=null?n:[]}setPATHPaths(t){return this.app.saveLocalStorage(this.prefix+"PATHPaths",t.join(":"))}getEnvVars(){var t;return JSON.parse((t=this.app.loadLocalStorage(this.prefix+"envVars"))!=null?t:"[]")}setEnvVars(t){return this.app.saveLocalStorage(this.prefix+"envVars",JSON.stringify(t))}getPluginDisabled(){return this.app.loadLocalStorage(this.prefix+"pluginDisabled")=="true"}setPluginDisabled(t){return this.app.saveLocalStorage(this.prefix+"pluginDisabled",`${t}`)}};v();v();v();v();var Ue;(function(e){e.INSERT="insert",e.DELETE="delete",e.CONTEXT="context"})(Ue||(Ue={}));var OE={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},IE={LINES:"lines",WORDS:"words",NONE:"none"},RE={WORD:"word",CHAR:"char"},ri;(function(e){e.AUTO="auto",e.DARK="dark",e.LIGHT="light"})(ri||(ri={}));v();var OL=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],IL=RegExp("["+OL.join("\\")+"]","g");function LE(e){return e.replace(IL,"\\$&")}function Rp(e){return e&&e.replace(/\\/g,"/")}function jE(e){let t,n,r,i=0;for(t=0,r=e.length;t1?n[n.length-1]:t}function BE(e,t){return t.reduce((n,r)=>n||e.startsWith(r),!1)}var NE=["a/","b/","i/","w/","c/","o/"];function Sr(e,t,n){let r=n!==void 0?[...NE,n]:NE,i=t?new RegExp(`^${LE(t)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,a=""]=i.exec(e)||[],s=r.find(l=>a.indexOf(l)===0);return(s?a.slice(s.length):a).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function RL(e,t){return Sr(e,"---",t)}function LL(e,t){return Sr(e,"+++",t)}function $E(e,t={}){let n=[],r=null,i=null,a=null,s=null,o=null,l=null,c=null,u="--- ",f="+++ ",h="@@",d=/^old mode (\d{6})/,p=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,m=/^new file mode (\d{6})/,w=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,S=/^rename from "?(.+)"?/,A=/^rename to "?(.+)"?/,x=/^similarity index (\d+)%/,k=/^dissimilarity index (\d+)%/,y=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,E=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,C=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,P=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,L=/^new file mode (\d{6})/,N=/^deleted file mode (\d{6}),(\d{6})/,j=e.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,` +`).split(` +`);function Y(){i!==null&&r!==null&&(r.blocks.push(i),i=null)}function le(){r!==null&&(!r.oldName&&l!==null&&(r.oldName=l),!r.newName&&c!==null&&(r.newName=c),r.newName&&(n.push(r),r=null)),l=null,c=null}function he(){Y(),le(),r={blocks:[],deletedLines:0,addedLines:0}}function ae($){Y();let z;r!==null&&((z=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec($))?(r.isCombined=!1,a=parseInt(z[1],10),o=parseInt(z[2],10)):(z=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec($))?(r.isCombined=!0,a=parseInt(z[1],10),s=parseInt(z[2],10),o=parseInt(z[3],10)):($.startsWith(h)&&console.error("Failed to parse lines, starting in 0!"),a=0,o=0,r.isCombined=!1)),i={lines:[],oldStartLine:a,oldStartLine2:s,newStartLine:o,header:$}}function Pe($){if(r===null||i===null||a===null||o===null)return;let z={content:$},D=r.isCombined?["+ "," +","++"]:["+"],se=r.isCombined?["- "," -","--"]:["-"];BE($,D)?(r.addedLines++,z.type=Ue.INSERT,z.oldNumber=void 0,z.newNumber=o++):BE($,se)?(r.deletedLines++,z.type=Ue.DELETE,z.oldNumber=a++,z.newNumber=void 0):(z.type=Ue.CONTEXT,z.oldNumber=a++,z.newNumber=o++),i.lines.push(z)}function de($,z){let D=z;for(;D{if(!$||$.startsWith("*"))return;let D,se=j[z-1],Se=j[z+1],gt=j[z+2];if($.startsWith("diff --git")||$.startsWith("diff --combined")){if(he(),(D=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec($))&&(l=Sr(D[1],void 0,t.dstPrefix),c=Sr(D[2],void 0,t.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isGitDiff=!0;return}if($.startsWith("Binary files")&&!(r!=null&&r.isGitDiff)){if(he(),(D=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec($))&&(l=Sr(D[1],void 0,t.dstPrefix),c=Sr(D[2],void 0,t.srcPrefix)),r===null)throw new Error("Where is my file !!!");r.isBinary=!0;return}if((!r||!r.isGitDiff&&r&&$.startsWith(u)&&Se.startsWith(f)&>.startsWith(h))&&he(),r!=null&&r.isTooBig)return;if(r&&(typeof t.diffMaxChanges=="number"&&r.addedLines+r.deletedLines>t.diffMaxChanges||typeof t.diffMaxLineLength=="number"&&$.length>t.diffMaxLineLength)){r.isTooBig=!0,r.addedLines=0,r.deletedLines=0,r.blocks=[],i=null;let ot=typeof t.diffTooBigMessage=="function"?t.diffTooBigMessage(n.length):"Diff too big to be displayed";ae(ot);return}if($.startsWith(u)&&Se.startsWith(f)||$.startsWith(f)&&se.startsWith(u)){if(r&&!r.oldName&&$.startsWith("--- ")&&(D=RL($,t.srcPrefix))){r.oldName=D,r.language=DE(r.oldName,r.language);return}if(r&&!r.newName&&$.startsWith("+++ ")&&(D=LL($,t.dstPrefix))){r.newName=D,r.language=DE(r.newName,r.language);return}}if(r&&($.startsWith(h)||r.isGitDiff&&r.oldName&&r.newName&&!i)){ae($);return}if(i&&($.startsWith("+")||$.startsWith("-")||$.startsWith(" "))){Pe($);return}let be=!de($,z);if(r===null)throw new Error("Where is my file !!!");(D=d.exec($))?r.oldMode=D[1]:(D=p.exec($))?r.newMode=D[1]:(D=g.exec($))?(r.deletedFileMode=D[1],r.isDeleted=!0):(D=m.exec($))?(r.newFileMode=D[1],r.isNew=!0):(D=w.exec($))?(be&&(r.oldName=D[1]),r.isCopy=!0):(D=b.exec($))?(be&&(r.newName=D[1]),r.isCopy=!0):(D=S.exec($))?(be&&(r.oldName=D[1]),r.isRename=!0):(D=A.exec($))?(be&&(r.newName=D[1]),r.isRename=!0):(D=E.exec($))?(r.isBinary=!0,r.oldName=Sr(D[1],void 0,t.srcPrefix),r.newName=Sr(D[2],void 0,t.dstPrefix),ae("Binary file")):_.test($)?(r.isBinary=!0,ae($)):(D=x.exec($))?r.unchangedPercentage=parseInt(D[1],10):(D=k.exec($))?r.changedPercentage=parseInt(D[1],10):(D=y.exec($))?(r.checksumBefore=D[1],r.checksumAfter=D[2],D[3]&&(r.mode=D[3])):(D=C.exec($))?(r.checksumBefore=[D[2],D[3]],r.checksumAfter=D[1]):(D=P.exec($))?(r.oldMode=[D[2],D[3]],r.newMode=D[1]):(D=L.exec($))?(r.newFileMode=D[1],r.isNew=!0):(D=N.exec($))&&(r.deletedFileMode=D[1],r.isDeleted=!0)}),Y(),le(),n}v();v();v();function Zn(){}Zn.prototype={diff:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.callback;typeof r=="function"&&(i=r,r={}),this.options=r;var a=this;function s(g){return i?(setTimeout(function(){i(void 0,g)},0),!0):g}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var o=n.length,l=t.length,c=1,u=o+l;r.maxEditLength&&(u=Math.min(u,r.maxEditLength));var f=[{newPos:-1,components:[]}],h=this.extractCommon(f[0],n,t,0);if(f[0].newPos+1>=o&&h+1>=l)return s([{value:this.join(n),count:n.length}]);function d(){for(var g=-1*c;g<=c;g+=2){var m=void 0,w=f[g-1],b=f[g+1],S=(b?b.newPos:0)-g;w&&(f[g-1]=void 0);var A=w&&w.newPos+1=o&&S+1>=l)return s(DL(a,m.components,n,t,a.useLongestToken));f[g]=m}c++}if(i)(function g(){setTimeout(function(){if(c>u)return i();d()||g()},0)})();else for(;c<=u;){var p=d();if(p)return p}},pushComponent:function(t,n,r){var i=t[t.length-1];i&&i.added===n&&i.removed===r?t[t.length-1]={count:i.count+1,added:n,removed:r}:t.push({count:1,added:n,removed:r})},extractCommon:function(t,n,r,i){for(var a=n.length,s=r.length,o=t.newPos,l=o-i,c=0;o+1d.length?g:d}),c.value=e.join(u)}else c.value=e.join(n.slice(o,o+c.count));o+=c.count,c.added||(l+=c.count)}}var h=t[s-1];return s>1&&typeof h.value=="string"&&(h.added||h.removed)&&e.equals("",h.value)&&(t[s-2].value+=h.value,t.pop()),t}function BL(e){return{newPos:e.newPos,components:e.components.slice(0)}}var NL=new Zn;function GE(e,t,n){return NL.diff(e,t,n)}var HE=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,UE=/\S/,Dp=new Zn;Dp.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!UE.test(e)&&!UE.test(t)};Dp.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n{let r=e(t).trim(),i=e(n).trim();return zL(r,i)/(r.length+i.length)}}function da(e){function t(r,i,a=new Map){let s=1/0,o;for(let l=0;l0||o.indexB>0)&&(S=m.concat(S)),(r.length>h||i.length>d)&&(S=S.concat(b)),S}return n}var mt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},ii={matching:IE.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:RE.WORD,colorScheme:ri.LIGHT},Rn="/",WE=ha(e=>e.value),VL=da(WE);function Np(e){return e.indexOf("dev/null")!==-1}function WL(e){return e.replace(/(]*>((.|\n)*?)<\/ins>)/g,"")}function qL(e){return e.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}function pa(e){switch(e){case Ue.CONTEXT:return mt.CONTEXT;case Ue.INSERT:return mt.INSERTS;case Ue.DELETE:return mt.DELETES}}function ma(e){switch(e){case ri.DARK:return"d2h-dark-color-scheme";case ri.AUTO:return"d2h-auto-color-scheme";case ri.LIGHT:default:return"d2h-light-color-scheme"}}function XL(e){return e?2:1}function Er(e){return e.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function on(e,t,n=!0){let r=XL(t);return{prefix:e.substring(0,r),content:n?Er(e.substring(r)):e.substring(r)}}function ai(e){let t=Rp(e.oldName),n=Rp(e.newName);if(t!==n&&!Np(t)&&!Np(n)){let r=[],i=[],a=t.split(Rn),s=n.split(Rn),o=a.length,l=s.length,c=0,u=o-1,f=l-1;for(;cc&&f>c&&a[u]===s[f];)i.unshift(s[f]),u-=1,f-=1;let h=r.join(Rn),d=i.join(Rn),p=a.slice(c,u+1).join(Rn),g=s.slice(c,f+1).join(Rn);return h.length&&d.length?h+Rn+"{"+p+" \u2192 "+g+"}"+Rn+d:h.length?h+Rn+"{"+p+" \u2192 "+g+"}":d.length?"{"+p+" \u2192 "+g+"}"+Rn+d:t+" \u2192 "+n}else return Np(n)?t:n}function ga(e){return`d2h-${jE(ai(e)).toString().slice(-6)}`}function ya(e){let t="file-changed";return e.isRename||e.isCopy?t="file-renamed":e.isNew?t="file-added":e.isDeleted?t="file-deleted":e.newName!==e.oldName&&(t="file-renamed"),t}function qc(e,t,n,r={}){let{matching:i,maxLineLengthHighlight:a,matchWordsThreshold:s,diffStyle:o}=Object.assign(Object.assign({},ii),r),l=on(e,n,!1),c=on(t,n,!1);if(l.content.length>a||c.content.length>a)return{oldLine:{prefix:l.prefix,content:Er(l.content)},newLine:{prefix:c.prefix,content:Er(c.content)}};let u=o==="char"?GE(l.content,c.content):zE(l.content,c.content),f=[];if(o==="word"&&i==="words"){let d=u.filter(m=>m.removed),p=u.filter(m=>m.added);VL(p,d).forEach(m=>{m[0].length===1&&m[1].length===1&&WE(m[0][0],m[1][0]){let g=p.added?"ins":p.removed?"del":null,m=f.indexOf(p)>-1?' class="d2h-change"':"",w=Er(p.value);return g!==null?`${d}<${g}${m}>${w}`:`${d}${w}`},"");return{oldLine:{prefix:l.prefix,content:WL(h)},newLine:{prefix:c.prefix,content:qL(h)}}}var qE="file-summary",YL="icon",ZL={colorScheme:ii.colorScheme},Xc=class{constructor(t,n={}){this.hoganUtils=t,this.config=Object.assign(Object.assign({},ZL),n)}render(t){let n=t.map(r=>this.hoganUtils.render(qE,"line",{fileHtmlId:ga(r),oldName:r.oldName,newName:r.newName,fileName:ai(r),deletedLines:"-"+r.deletedLines,addedLines:"+"+r.addedLines},{fileIcon:this.hoganUtils.template(YL,ya(r))})).join(` +`);return this.hoganUtils.render(qE,"wrapper",{colorScheme:ma(this.config.colorScheme),filesNumber:t.length,files:n})}};v();var Hp=Object.assign(Object.assign({},ii),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Ks="generic",XE="line-by-line",KL="icon",JL="tag",Js=class{constructor(t,n={}){this.hoganUtils=t,this.config=Object.assign(Object.assign({},Hp),n)}render(t){let n=t.map(r=>{let i;return r.blocks.length?i=this.generateFileHtml(r):i=this.generateEmptyDiff(),this.makeFileDiffHtml(r,i)}).join(` +`);return this.hoganUtils.render(Ks,"wrapper",{colorScheme:ma(this.config.colorScheme),content:n})}makeFileDiffHtml(t,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(t.blocks)&&t.blocks.length===0)return"";let r=this.hoganUtils.template(XE,"file-diff"),i=this.hoganUtils.template(Ks,"file-path"),a=this.hoganUtils.template(KL,"file"),s=this.hoganUtils.template(JL,ya(t));return r.render({file:t,fileHtmlId:ga(t),diffs:n,filePath:i.render({fileDiffName:ai(t)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return this.hoganUtils.render(Ks,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:mt})}generateFileHtml(t){let n=da(ha(r=>on(r.content,t.isCombined).content));return t.blocks.map(r=>{let i=this.hoganUtils.render(Ks,"block-header",{CSSLineClass:mt,blockHeader:t.isTooBig?r.header:Er(r.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(r).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,n).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(t,t.isCombined,l,c);i+=u,i+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=on(l.content,t.isCombined);i+=this.generateSingleLineHtml(t,{type:mt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(t,t.isCombined,s,o);i+=l,i+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).join(` +`)}applyLineGroupping(t){let n=[],r=[],i=[];for(let a=0;a0)&&(n.push([[],r,i]),r=[],i=[]),s.type===Ue.CONTEXT?n.push([[s],[],[]]):s.type===Ue.INSERT&&r.length===0?n.push([[],[],[s]]):s.type===Ue.INSERT&&r.length>0?i.push(s):s.type===Ue.DELETE&&r.push(s)}return(r.length||i.length)&&(n.push([[],r,i]),r=[],i=[]),n}applyRematchMatching(t,n,r){let i=t.length*n.length,a=Math.max.apply(null,[0].concat(t.concat(n).map(o=>o.content.length)));return i{let i;return r.blocks.length?i=this.generateFileHtml(r):i=this.generateEmptyDiff(),this.makeFileDiffHtml(r,i)}).join(` +`);return this.hoganUtils.render(Qs,"wrapper",{colorScheme:ma(this.config.colorScheme),content:n})}makeFileDiffHtml(t,n){if(this.config.renderNothingWhenEmpty&&Array.isArray(t.blocks)&&t.blocks.length===0)return"";let r=this.hoganUtils.template(QL,"file-diff"),i=this.hoganUtils.template(Qs,"file-path"),a=this.hoganUtils.template(ej,"file"),s=this.hoganUtils.template(tj,ya(t));return r.render({file:t,fileHtmlId:ga(t),diffs:n,filePath:i.render({fileDiffName:ai(t)},{fileIcon:a,fileTag:s})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Qs,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:mt})}}generateFileHtml(t){let n=da(ha(r=>on(r.content,t.isCombined).content));return t.blocks.map(r=>{let i={left:this.makeHeaderHtml(r.header,t),right:this.makeHeaderHtml("")};return this.applyLineGroupping(r).forEach(([a,s,o])=>{if(s.length&&o.length&&!a.length)this.applyRematchMatching(s,o,n).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(t.isCombined,l,c);i.left+=u,i.right+=f});else if(a.length)a.forEach(l=>{let{prefix:c,content:u}=on(l.content,t.isCombined),{left:f,right:h}=this.generateLineHtml({type:mt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:mt.CONTEXT,prefix:c,content:u,number:l.newNumber});i.left+=f,i.right+=h});else if(s.length||o.length){let{left:l,right:c}=this.processChangedLines(t.isCombined,s,o);i.left+=l,i.right+=c}else console.error("Unknown state reached while processing groups of lines",a,s,o)}),i}).reduce((r,i)=>({left:r.left+i.left,right:r.right+i.right}),{left:"",right:""})}applyLineGroupping(t){let n=[],r=[],i=[];for(let a=0;a0)&&(n.push([[],r,i]),r=[],i=[]),s.type===Ue.CONTEXT?n.push([[s],[],[]]):s.type===Ue.INSERT&&r.length===0?n.push([[],[],[s]]):s.type===Ue.INSERT&&r.length>0?i.push(s):s.type===Ue.DELETE&&r.push(s)}return(r.length||i.length)&&(n.push([[],r,i]),r=[],i=[]),n}applyRematchMatching(t,n,r){let i=t.length*n.length,a=Math.max.apply(null,[0].concat(t.concat(n).map(o=>o.content.length)));return i'),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(r.rp("'),r.b(r.v(r.f("fileName",e,t,0))),r.b(""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(r.v(r.f("addedLines",e,t,0))),r.b(""),r.b(` +`+n),r.b(' '),r.b(r.v(r.f("deletedLines",e,t,0))),r.b(""),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{"'),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b(' Files changed ('),r.b(r.v(r.f("filesNumber",e,t,0))),r.b(")"),r.b(` +`+n),r.b(' hide'),r.b(` +`+n),r.b(' show'),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b('
    '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("files",e,t,0))),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});tt["generic-block-header"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b(""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b('
'),r.s(r.f("blockHeader",e,t,1),e,t,0,156,173,"{{ }}")&&(r.rs(e,t,function(i,a,s){s.b(s.t(s.f("blockHeader",i,a,0)))}),e.pop()),r.s(r.f("blockHeader",e,t,1),e,t,1,0,0,"")||r.b(" "),r.b("
"),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});tt["generic-empty-diff"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b(""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b(" File without changes"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});tt["generic-file-path"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b(''),r.b(` +`+n),r.b(r.rp("'),r.b(r.v(r.f("fileDiffName",e,t,0))),r.b(""),r.b(` +`+n),r.b(r.rp(""),r.b(` +`+n),r.b('"),r.fl()},partials:{""),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("lineNumber",e,t,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.s(r.f("prefix",e,t,1),e,t,0,162,238,"{{ }}")&&(r.rs(e,t,function(i,a,s){s.b(' '),s.b(s.t(s.f("prefix",i,a,0))),s.b(""),s.b(` +`+n)}),e.pop()),r.s(r.f("prefix",e,t,1),e,t,1,0,0,"")||(r.b('  '),r.b(` +`+n)),r.s(r.f("content",e,t,1),e,t,0,371,445,"{{ }}")&&(r.rs(e,t,function(i,a,s){s.b(' '),s.b(s.t(s.f("content",i,a,0))),s.b(""),s.b(` +`+n)}),e.pop()),r.s(r.f("content",e,t,1),e,t,1,0,0,"")||(r.b('
'),r.b(` +`+n)),r.b("
"),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b(""),r.fl()},partials:{},subs:{}});tt["generic-wrapper"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('
'),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("content",e,t,0))),r.b(` +`+n),r.b("
"),r.fl()},partials:{},subs:{}});tt["icon-file-added"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});tt["icon-file-changed"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});tt["icon-file-deleted"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});tt["icon-file-renamed"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});tt["icon-file"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('"),r.fl()},partials:{},subs:{}});tt["line-by-line-file-diff"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('
'),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("diffs",e,t,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.fl()},partials:{},subs:{}});tt["line-by-line-numbers"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('
'),r.b(r.v(r.f("oldNumber",e,t,0))),r.b("
"),r.b(` +`+n),r.b('
'),r.b(r.v(r.f("newNumber",e,t,0))),r.b("
"),r.fl()},partials:{},subs:{}});tt["side-by-side-file-diff"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('
'),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b(" "),r.b(r.t(r.f("filePath",e,t,0))),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.d("diffs.left",e,t,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b('
'),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(' '),r.b(` +`+n),r.b(" "),r.b(r.t(r.d("diffs.right",e,t,0))),r.b(` +`+n),r.b(" "),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.b(` +`+n),r.b("
"),r.fl()},partials:{},subs:{}});tt["tag-file-added"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('ADDED'),r.fl()},partials:{},subs:{}});tt["tag-file-changed"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('CHANGED'),r.fl()},partials:{},subs:{}});tt["tag-file-deleted"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('DELETED'),r.fl()},partials:{},subs:{}});tt["tag-file-renamed"]=new it.Template({code:function(e,t,n){var r=this;return r.b(n=n||""),r.b('RENAMED'),r.fl()},partials:{},subs:{}});var to=class{constructor({compiledTemplates:t={},rawTemplates:n={}}){let r=Object.entries(n).reduce((i,[a,s])=>{let o=Wp.compile(s,{asString:!1});return Object.assign(Object.assign({},i),{[a]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},tt),t),r)}static compile(t){return Wp.compile(t,{asString:!1})}render(t,n,r,i,a){let s=this.templateKey(t,n);try{return this.preCompiledTemplates[s].render(r,i,a)}catch(o){throw new Error(`Could not find template to render '${s}'`)}}template(t,n){return this.preCompiledTemplates[this.templateKey(t,n)]}templateKey(t,n){return`${t}-${n}`}};var rj=Object.assign(Object.assign(Object.assign({},Hp),Up),{outputFormat:OE.LINE_BY_LINE,drawFileList:!0});function JE(e,t={}){let n=Object.assign(Object.assign({},rj),t),r=typeof e=="string"?$E(e,n):e,i=new to(n),{colorScheme:a}=n,s={colorScheme:a},o=n.drawFileList?new Xc(i,s).render(r):"",l=n.outputFormat==="side-by-side"?new eo(i,n).render(r):new Js(i,n).render(r);return o+l}var Zc=require("obsidian");var va=class extends Zc.ItemView{constructor(n,r){super(n);this.plugin=r;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.gitRefreshRef=this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(console.error)}),this.gitViewRefreshRef=this.app.workspace.on("obsidian-git:view-refresh",()=>{this.refresh().catch(console.error)})}getViewType(){return Ct.type}getDisplayText(){var n;if(((n=this.state)==null?void 0:n.file)!=null){let r=this.state.file.split("/").last();return r!=null&&r.endsWith(".md")&&(r=r.slice(0,-3)),Ct.name+` (${r})`}return Ct.name}getIcon(){return Ct.icon}async setState(n,r){this.state=n,Zc.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 n;if((n=this.state)!=null&&n.file&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let r=await this.plugin.gitManager.getDiffString(this.state.file,this.state.staged,this.state.hash);this.contentEl.empty();let i=this.plugin.gitManager.getRelativeVaultPath(this.state.file);if(!r){if(this.plugin.gitManager instanceof Le&&await this.plugin.gitManager.isTracked(this.state.file))r=[`--- ${this.state.file}`,`+++ ${this.state.file}`,""].join(` +`);else if(await this.app.vault.adapter.exists(i)){let a=await this.app.vault.adapter.read(i);r=[...`--- /dev/null ++++ ${this.state.file} +@@ -0,0 +1,${a.split(` +`).length} @@`.split(` +`),...a.split(` +`).map(o=>`+${o}`)].join(` +`)}}if(r){let a=this.parser.parseFromString(JE(r),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(a)}else{let a=this.contentEl.createDiv({cls:"obsidian-git-center"});a.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),a.createEl("br"),a.createSpan({text:"File not found: "+this.state.file})}}finally{this.gettingDiff=!1}}}};v();var MA=require("obsidian");v();v();v();v();function Ae(){}var no=e=>e;function qp(e){return e()}function Kc(){return Object.create(null)}function ke(e){e.forEach(qp)}function wa(e){return typeof e=="function"}function at(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}function QE(e){return Object.keys(e).length===0}v();var eA=typeof window!="undefined",Xp=eA?()=>window.performance.now():()=>Date.now(),ro=eA?e=>requestAnimationFrame(e):Ae;v();var ba=new Set;function tA(e){ba.forEach(t=>{t.c(e)||(ba.delete(t),t.f())}),ba.size!==0&&ro(tA)}function Yp(e){let t;return ba.size===0&&ro(tA),{promise:new Promise(n=>{ba.add(t={c:e,f:n})}),abort(){ba.delete(t)}}}v();v();v();v();var Zp=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;var Jc=class e{constructor(t){ut(this,"_listeners","WeakMap"in Zp?new WeakMap:void 0);ut(this,"_observer");ut(this,"options");this.options=t}observe(t,n){return this._listeners.set(t,n),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return(t=this._observer)!=null?t:this._observer=new ResizeObserver(n=>{var r;for(let i of n)e.entries.set(i.target,i),(r=this._listeners.get(i.target))==null||r(i)})}};Jc.entries="WeakMap"in Zp?new WeakMap:void 0;var nA=!1;function rA(){nA=!0}function iA(){nA=!1}function M(e,t){e.appendChild(t)}function Nt(e,t,n){let r=Qc(e);if(!r.getElementById(t)){let i=I("style");i.id=t,i.textContent=n,sA(r,i)}}function Qc(e){if(!e)return document;let t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function aA(e){let t=I("style");return t.textContent="/* empty */",sA(Qc(e),t),t.sheet}function sA(e,t){return M(e.head||e,t),t.sheet}function re(e,t,n){e.insertBefore(t,n||null)}function ne(e){e.parentNode&&e.parentNode.removeChild(e)}function ln(e,t){for(let n=0;ne.removeEventListener(t,n,r)}function xe(e){return function(t){return t.stopPropagation(),e.call(this,t)}}function T(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function oA(e){return Array.from(e.childNodes)}function Me(e,t){t=""+t,e.data!==t&&(e.data=t)}function Kp(e,t){e.value=t==null?"":t}function Yt(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function ce(e,t,n){e.classList.toggle(t,!!n)}function eu(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}function lA(e){let t={};return e.childNodes.forEach(n=>{t[n.slot||"default"]=!0}),t}var tu=new Map,nu=0;function aj(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function sj(e,t){let n={stylesheet:aA(t),rules:{}};return tu.set(e,n),n}function ru(e,t,n,r,i,a,s,o=0){let l=16.666/r,c=`{ +`;for(let m=0;m<=1;m+=l){let w=t+(n-t)*a(m);c+=m*100+`%{${s(w,1-w)}} +`}let u=c+`100% {${s(n,1-n)}} +}`,f=`__svelte_${aj(u)}_${o}`,h=Qc(e),{stylesheet:d,rules:p}=tu.get(h)||sj(h,e);p[f]||(p[f]=!0,d.insertRule(`@keyframes ${f} ${u}`,d.cssRules.length));let g=e.style.animation||"";return e.style.animation=`${g?`${g}, `:""}${f} ${r}ms linear ${i}ms 1 both`,nu+=1,f}function Jp(e,t){let n=(e.style.animation||"").split(", "),r=n.filter(t?a=>a.indexOf(t)<0:a=>a.indexOf("__svelte")===-1),i=n.length-r.length;i&&(e.style.animation=r.join(", "),nu-=i,nu||oj())}function oj(){ro(()=>{nu||(tu.forEach(e=>{let{ownerNode:t}=e.stylesheet;t&&ne(t)}),tu.clear())})}v();v();v();v();var Ar;function Kn(e){Ar=e}function cA(){if(!Ar)throw new Error("Function called outside component initialization");return Ar}function io(e){cA().$$.on_destroy.push(e)}function kr(e,t){let n=e.$$.callbacks[t.type];n&&n.slice().forEach(r=>r.call(this,t))}var si=[];var je=[],Sa=[],uA=[],lj=Promise.resolve(),em=!1;function fA(){em||(em=!0,lj.then(iu))}function wt(e){Sa.push(e)}var Qp=new Set,_a=0;function iu(){if(_a!==0)return;let e=Ar;do{try{for(;_ae.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),Sa=t}var ao;function uj(){return ao||(ao=Promise.resolve(),ao.then(()=>{ao=null})),ao}function tm(e,t,n){e.dispatchEvent(eu(`${t?"intro":"outro"}${n}`))}var au=new Set,Jn;function Ce(){Jn={r:0,c:[],p:Jn}}function Fe(){Jn.r||ke(Jn.c),Jn=Jn.p}function U(e,t){e&&e.i&&(au.delete(e),e.i(t))}function X(e,t,n,r){if(e&&e.o){if(au.has(e))return;au.add(e),Jn.c.push(()=>{au.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}var fj={duration:0};function bt(e,t,n,r){let a=t(e,n,{direction:"both"}),s=r?0:1,o=null,l=null,c=null,u;function f(){c&&Jp(e,c)}function h(p,g){let m=p.b-s;return g*=Math.abs(m),{a:s,b:p.b,d:m,duration:g,start:p.start,end:p.start+g,group:p.group}}function d(p){let{delay:g=0,duration:m=300,easing:w=no,tick:b=Ae,css:S}=a||fj,A={start:Xp()+g,b:p};p||(A.group=Jn,Jn.r+=1),"inert"in e&&(p?u!==void 0&&(e.inert=u):(u=e.inert,e.inert=!0)),o||l?l=A:(S&&(f(),c=ru(e,s,p,m,g,w,S)),p&&b(0,1),o=h(A,m),wt(()=>tm(e,p,"start")),Yp(x=>{if(l&&x>l.start&&(o=h(l,m),l=null,tm(e,o.b,"start"),S&&(f(),c=ru(e,s,o.b,o.duration,0,w,a.css))),o){if(x>=o.end)b(s=o.b,1-s),tm(e,o.b,"end"),l||(o.b?f():--o.group.r||ke(o.group.c)),o=null;else if(x>=o.start){let k=x-o.start;s=o.a+o.d*w(k/o.duration),b(s,1-s)}}return!!(o||l)}))}return{run(p){wa(a)?uj().then(()=>{a=a({direction:p?"in":"out"}),d(p)}):d(p)},end(){f(),o=l=null}}}v();function nt(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}v();v();v();var hj=["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],dj=new Set([...hj]);v();v();v();function Ge(e){e&&e.c()}function De(e,t,n){let{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),wt(()=>{let a=e.$$.on_mount.map(qp).filter(wa);e.$$.on_destroy?e.$$.on_destroy.push(...a):ke(a),e.$$.on_mount=[]}),i.forEach(wt)}function Be(e,t){let n=e.$$;n.fragment!==null&&(hA(n.after_update),ke(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function mj(e,t){e.$$.dirty[0]===-1&&(si.push(e),fA(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{let p=d.length?d[0]:h;return c.ctx&&i(c.ctx[f],c.ctx[f]=p)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](p),u&&mj(e,f)),h}):[],c.update(),u=!0,ke(c.before_update),c.fragment=r?r(c.ctx):!1,t.target){if(t.hydrate){rA();let f=oA(t.target);c.fragment&&c.fragment.l(f),f.forEach(ne)}else c.fragment&&c.fragment.c();t.intro&&U(e.$$.fragment),De(e,t.target,t.anchor),iA(),iu()}Kn(l)}var gj;typeof HTMLElement=="function"&&(gj=class extends HTMLElement{constructor(t,n,r){super();ut(this,"$$ctor");ut(this,"$$s");ut(this,"$$c");ut(this,"$$cn",!1);ut(this,"$$d",{});ut(this,"$$r",!1);ut(this,"$$p_d",{});ut(this,"$$l",{});ut(this,"$$l_u",new Map);this.$$ctor=t,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(t,n,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(n),this.$$c){let i=this.$$c.$on(t,n);this.$$l_u.set(n,i)}super.addEventListener(t,n,r)}removeEventListener(t,n,r){if(super.removeEventListener(t,n,r),this.$$c){let i=this.$$l_u.get(n);i&&(i(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(a){return()=>{let s;return{c:function(){s=I("slot"),a!=="default"&&T(s,"name",a)},m:function(c,u){re(c,s,u)},d:function(c){c&&ne(s)}}}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let n={},r=lA(this);for(let a of this.$$s)a in r&&(n[a]=[t(a)]);for(let a of this.attributes){let s=this.$$g_p(a.name);s in this.$$d||(this.$$d[s]=nm(s,a.value,this.$$p_d,"toProp"))}for(let a in this.$$p_d)!(a in this.$$d)&&this[a]!==void 0&&(this.$$d[a]=this[a],delete this[a]);this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$scope:{ctx:[]}}});let i=()=>{this.$$r=!0;for(let a in this.$$p_d)if(this.$$d[a]=this.$$c.$$.ctx[this.$$c.$$.props[a]],this.$$p_d[a].reflect){let s=nm(a,this.$$d[a],this.$$p_d,"toAttribute");s==null?this.removeAttribute(this.$$p_d[a].attribute||a):this.setAttribute(this.$$p_d[a].attribute||a,s)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(let a in this.$$l)for(let s of this.$$l[a]){let o=this.$$c.$on(a,s);this.$$l_u.set(s,o)}this.$$l={}}}attributeChangedCallback(t,n,r){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=nm(t,r,this.$$p_d,"toProp"),(i=this.$$c)==null||i.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$c=void 0)})}$$g_p(t){return Object.keys(this.$$p_d).find(n=>this.$$p_d[n].attribute===t||!this.$$p_d[n].attribute&&n.toLowerCase()===t)||t}});function nm(e,t,n,r){var a;let i=(a=n[e])==null?void 0:a.type;if(t=i==="Boolean"&&typeof t!="boolean"?t!=null:t,!r||!n[e])return t;if(r==="toAttribute")switch(i){case"Object":case"Array":return t==null?null:JSON.stringify(t);case"Boolean":return t?"":null;case"Number":return t==null?null:t;default:return t}else switch(i){case"Object":case"Array":return t&&JSON.parse(t);case"Boolean":return t;case"Number":return t!=null?+t:t;default:return t}}var qe=class{constructor(){ut(this,"$$");ut(this,"$$set")}$destroy(){Be(this,1),this.$destroy=Ae}$on(t,n){if(!wa(n))return Ae;let r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{let i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!QE(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}};v();v();var dA="4";v();typeof window!="undefined"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(dA);v();function Ea(e,t,n,r){function i(a){return a instanceof n?a:new n(function(s){s(a)})}return new(n||(n=Promise))(function(a,s){function o(u){try{c(r.next(u))}catch(f){s(f)}}function l(u){try{c(r.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((r=r.apply(e,t||[])).next())})}var lu=require("obsidian");v();v();var so=require("obsidian");v();v();function pA(e){let t=e-1;return t*t*t+1}function xt(e,{delay:t=0,duration:n=400,easing:r=pA,axis:i="y"}={}){let a=getComputedStyle(e),s=+a.opacity,o=i==="y"?"height":"width",l=parseFloat(a[o]),c=i==="y"?["top","bottom"]:["left","right"],u=c.map(w=>`${w[0].toUpperCase()}${w.slice(1)}`),f=parseFloat(a[`padding${u[0]}`]),h=parseFloat(a[`padding${u[1]}`]),d=parseFloat(a[`margin${u[0]}`]),p=parseFloat(a[`margin${u[1]}`]),g=parseFloat(a[`border${u[0]}Width`]),m=parseFloat(a[`border${u[1]}Width`]);return{delay:t,duration:n,easing:r,css:w=>`overflow: hidden;opacity: ${Math.min(w*20,1)*s};${o}: ${w*l}px;padding-${c[0]}: ${w*f}px;padding-${c[1]}: ${w*h}px;margin-${c[0]}: ${w*d}px;margin-${c[1]}: ${w*p}px;border-${c[0]}-width: ${w*g}px;border-${c[1]}-width: ${w*m}px;`}}v();var Aa=require("obsidian");function yj(e){Nt(e,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function mA(e){let t,n,r;return{c(){t=I("div"),T(t,"data-icon","go-to-file"),T(t,"aria-label","Open File"),T(t,"class","clickable-icon")},m(i,a){re(i,t,a),e[7](t),n||(r=[te(t,"auxclick",xe(e[4])),te(t,"click",xe(e[4]))],n=!0)},p:Ae,d(i){i&&ne(t),e[7](null),n=!1,ke(r)}}}function vj(e){let t,n,r,i=Bt(e[0].vault_path)+"",a,s,o,l,c=e[1].app.vault.getAbstractFileByPath(e[0].vault_path)instanceof Aa.TFile,u,f,h=e[0].status+"",d,p,g,m,w,b,S=c&&mA(e);return{c(){var A,x;t=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("div"),S&&S.c(),u=J(),f=I("span"),d=Te(h),T(r,"class","tree-item-inner nav-file-title-content"),T(l,"class","buttons"),T(f,"class","type"),T(f,"data-type",p=e[0].status),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",g=e[0].vault_path),T(n,"data-tooltip-position",e[3]),T(n,"aria-label",m=e[0].vault_path),ce(n,"is-active",((A=e[1].plugin.lastDiffViewState)==null?void 0:A.file)==e[0].vault_path&&((x=e[1].plugin.lastDiffViewState)==null?void 0:x.hash)),T(t,"class","tree-item nav-file svelte-1wbh8tp")},m(A,x){re(A,t,x),M(t,n),M(n,r),M(r,a),M(n,s),M(n,o),M(o,l),S&&S.m(l,null),M(o,u),M(o,f),M(f,d),w||(b=[te(t,"click",xe(e[5])),te(t,"auxclick",xe(e[8])),te(t,"focus",e[6])],w=!0)},p(A,[x]){var k,y;x&1&&i!==(i=Bt(A[0].vault_path)+"")&&Me(a,i),x&3&&(c=A[1].app.vault.getAbstractFileByPath(A[0].vault_path)instanceof Aa.TFile),c?S?S.p(A,x):(S=mA(A),S.c(),S.m(l,null)):S&&(S.d(1),S=null),x&1&&h!==(h=A[0].status+"")&&Me(d,h),x&1&&p!==(p=A[0].status)&&T(f,"data-type",p),x&1&&g!==(g=A[0].vault_path)&&T(n,"data-path",g),x&8&&T(n,"data-tooltip-position",A[3]),x&1&&m!==(m=A[0].vault_path)&&T(n,"aria-label",m),x&3&&ce(n,"is-active",((k=A[1].plugin.lastDiffViewState)==null?void 0:k.file)==A[0].vault_path&&((y=A[1].plugin.lastDiffViewState)==null?void 0:y.hash))},i:Ae,o:Ae,d(A){A&&ne(t),S&&S.d(),w=!1,ke(b)}}}function wj(e,t,n){let r,{diff:i}=t,{view:a}=t,s=[];window.setTimeout(()=>s.forEach(h=>(0,Aa.setIcon)(h,h.getAttr("data-icon"))),0);function o(h){var d;let p=a.app.vault.getAbstractFileByPath(i.vault_path);p instanceof Aa.TFile&&((d=Xt(a.app,h))===null||d===void 0||d.openFile(p).catch(g=>a.plugin.displayError(g)))}function l(h){var d;(d=Xt(a.app,h))===null||d===void 0||d.setViewState({type:Ct.type,active:!0,state:{file:i.path,staged:!1,hash:i.hash}})}function c(h){kr.call(this,e,h)}function u(h){je[h?"unshift":"push"](()=>{s[0]=h,n(2,s)})}let f=h=>{h.button==2?In(a.app,h,i.vault_path,a.leaf,"git-history"):l(h)};return e.$$set=h=>{"diff"in h&&n(0,i=h.diff),"view"in h&&n(1,a=h.view)},e.$$.update=()=>{e.$$.dirty&2&&n(3,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,s,r,o,l,c,u,f]}var rm=class extends qe{constructor(t){super(),st(this,t,wj,vj,at,{diff:0,view:1},yj)}},su=rm;v();function bj(e){Nt(e,"svelte-1lnl15d","main.svelte-1lnl15d .nav-folder-title-content.svelte-1lnl15d{display:flex;align-items:center}")}function gA(e,t,n){let r=e.slice();return r[8]=t[n],r}function xj(e){let t,n,r,i,a,s,o,l=e[8].title+"",c,u,f,h,d,p,g;function m(){return e[7](e[8])}let w=!e[4][e[8].title]&&yA(e);return{c(){t=I("div"),n=I("div"),r=I("div"),i=J(),a=I("div"),a.innerHTML='',s=J(),o=I("div"),c=Te(l),f=J(),w&&w.c(),h=J(),T(r,"data-icon","folder"),Yt(r,"padding-right","5px"),Yt(r,"display","flex"),T(a,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(a,"is-collapsed",e[4][e[8].title]),T(o,"class","tree-item-inner nav-folder-title-content svelte-1lnl15d"),T(n,"class","tree-item-self is-clickable nav-folder-title"),T(n,"data-tooltip-position",e[5]),T(n,"aria-label",u=e[8].vaultPath),T(t,"class","tree-item nav-folder"),ce(t,"is-collapsed",e[4][e[8].title])},m(b,S){re(b,t,S),M(t,n),M(n,r),M(n,i),M(n,a),M(n,s),M(n,o),M(o,c),M(t,f),w&&w.m(t,null),M(t,h),d=!0,p||(g=te(n,"click",m),p=!0)},p(b,S){e=b,(!d||S&17)&&ce(a,"is-collapsed",e[4][e[8].title]),(!d||S&1)&&l!==(l=e[8].title+"")&&Me(c,l),(!d||S&32)&&T(n,"data-tooltip-position",e[5]),(!d||S&1&&u!==(u=e[8].vaultPath))&&T(n,"aria-label",u),e[4][e[8].title]?w&&(Ce(),X(w,1,1,()=>{w=null}),Fe()):w?(w.p(e,S),S&17&&U(w,1)):(w=yA(e),w.c(),U(w,1),w.m(t,h)),(!d||S&17)&&ce(t,"is-collapsed",e[4][e[8].title])},i(b){d||(U(w),d=!0)},o(b){X(w),d=!1},d(b){b&&ne(t),w&&w.d(),p=!1,g()}}}function _j(e){let t,n,r,i;return n=new su({props:{diff:e[8].data,view:e[2]}}),{c(){t=I("div"),Ge(n.$$.fragment),r=J()},m(a,s){re(a,t,s),De(n,t,null),M(t,r),i=!0},p(a,s){let o={};s&1&&(o.diff=a[8].data),s&4&&(o.view=a[2]),n.$set(o)},i(a){i||(U(n.$$.fragment,a),i=!0)},o(a){X(n.$$.fragment,a),i=!1},d(a){a&&ne(t),Be(n)}}}function yA(e){let t,n,r,i;return n=new ou({props:{hierarchy:e[8],plugin:e[1],view:e[2]}}),{c(){t=I("div"),Ge(n.$$.fragment),T(t,"class","tree-item-children nav-folder-children")},m(a,s){re(a,t,s),De(n,t,null),i=!0},p(a,s){let o={};s&1&&(o.hierarchy=a[8]),s&2&&(o.plugin=a[1]),s&4&&(o.view=a[2]),n.$set(o)},i(a){i||(U(n.$$.fragment,a),a&&wt(()=>{i&&(r||(r=bt(t,xt,{duration:150},!0)),r.run(1))}),i=!0)},o(a){X(n.$$.fragment,a),a&&(r||(r=bt(t,xt,{duration:150},!1)),r.run(0)),i=!1},d(a){a&&ne(t),Be(n),a&&r&&r.end()}}}function vA(e){let t,n,r,i,a=[_j,xj],s=[];function o(l,c){return l[8].data?0:1}return t=o(e,-1),n=s[t]=a[t](e),{c(){n.c(),r=xa()},m(l,c){s[t].m(l,c),re(l,r,c),i=!0},p(l,c){let u=t;t=o(l,c),t===u?s[t].p(l,c):(Ce(),X(s[u],1,1,()=>{s[u]=null}),Fe(),n=s[t],n?n.p(l,c):(n=s[t]=a[t](l),n.c()),U(n,1),n.m(r.parentNode,r))},i(l){i||(U(n),i=!0)},o(l){X(n),i=!1},d(l){l&&ne(r),s[t].d(l)}}}function Sj(e){let t,n,r=nt(e[0].children),i=[];for(let s=0;sX(i[s],1,1,()=>{i[s]=null});return{c(){t=I("main");for(let s=0;sc(f);return e.$$set=f=>{"hierarchy"in f&&n(0,i=f.hierarchy),"plugin"in f&&n(1,a=f.plugin),"view"in f&&n(2,s=f.view),"topLevel"in f&&n(3,o=f.topLevel)},e.$$.update=()=>{e.$$.dirty&4&&n(5,r=s.leaf.getRoot().side=="left"?"right":"left")},[i,a,s,o,l,r,c,u]}var ou=class extends qe{constructor(t){super(),st(this,t,Ej,Sj,at,{hierarchy:0,plugin:1,view:2,topLevel:3},bj)}},wA=ou;function bA(e,t,n){let r=e.slice();return r[9]=t[n],r}function xA(e){let t,n=e[0].refs.join(", ")+"",r;return{c(){t=I("div"),r=Te(n),T(t,"class","git-ref")},m(i,a){re(i,t,a),M(t,r)},p(i,a){a&1&&n!==(n=i[0].refs.join(", ")+"")&&Me(r,n)},d(i){i&&ne(t)}}}function _A(e){let t,n=e[7](e[0])+"",r;return{c(){t=I("div"),r=Te(n),T(t,"class","git-author")},m(i,a){re(i,t,a),M(t,r)},p(i,a){a&1&&n!==(n=i[7](i[0])+"")&&Me(r,n)},d(i){i&&ne(t)}}}function SA(e){let t,n=(0,so.moment)(e[0].date).format(e[3].settings.commitDateFormat)+"",r;return{c(){t=I("div"),r=Te(n),T(t,"class","git-date")},m(i,a){re(i,t,a),M(t,r)},p(i,a){a&9&&n!==(n=(0,so.moment)(i[0].date).format(i[3].settings.commitDateFormat)+"")&&Me(r,n)},d(i){i&&ne(t)}}}function EA(e){let t,n,r,i,a,s=[kj,Aj],o=[];function l(c,u){return c[2]?0:1}return n=l(e,-1),r=o[n]=s[n](e),{c(){t=I("div"),r.c(),T(t,"class","tree-item-children nav-folder-children")},m(c,u){re(c,t,u),o[n].m(t,null),a=!0},p(c,u){let f=n;n=l(c,u),n===f?o[n].p(c,u):(Ce(),X(o[f],1,1,()=>{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(t,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(t,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(t,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(t),o[n].d(),c&&i&&i.end()}}}function Aj(e){let t,n,r=nt(e[0].diff.files),i=[];for(let s=0;sX(i[s],1,1,()=>{i[s]=null});return{c(){for(let s=0;s0&&xA(e),S=e[3].settings.authorInHistoryView!="hide"&&((k=e[0].author)==null?void 0:k.name)&&_A(e),A=e[3].settings.dateInHistoryView&&SA(e),x=!e[4]&&EA(e);return{c(){var y;t=I("main"),n=I("div"),r=I("div"),i=I("div"),i.innerHTML='',a=J(),s=I("div"),b&&b.c(),o=J(),S&&S.c(),l=J(),A&&A.c(),c=J(),u=I("div"),h=Te(f),p=J(),x&&x.c(),T(i,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(i,"is-collapsed",e[4]),T(u,"class","tree-item-inner nav-folder-title-content"),T(r,"class","tree-item-self is-clickable nav-folder-title"),T(r,"aria-label",d=`${e[0].refs.length>0?e[0].refs.join(", ")+` +`:""}${(y=e[0].author)==null?void 0:y.name} +${(0,so.moment)(e[0].date).format(e[3].settings.commitDateFormat)} +${e[0].message}`),T(r,"data-tooltip-position",e[5]),T(n,"class","tree-item nav-folder"),ce(n,"is-collapsed",e[4])},m(y,E){re(y,t,E),M(t,n),M(n,r),M(r,i),M(r,a),M(r,s),b&&b.m(s,null),M(s,o),S&&S.m(s,null),M(s,l),A&&A.m(s,null),M(s,c),M(s,u),M(u,h),M(n,p),x&&x.m(n,null),g=!0,m||(w=te(r,"click",e[8]),m=!0)},p(y,[E]){var _,C;(!g||E&16)&&ce(i,"is-collapsed",y[4]),y[0].refs.length>0?b?b.p(y,E):(b=xA(y),b.c(),b.m(s,o)):b&&(b.d(1),b=null),y[3].settings.authorInHistoryView!="hide"&&((_=y[0].author)!=null&&_.name)?S?S.p(y,E):(S=_A(y),S.c(),S.m(s,l)):S&&(S.d(1),S=null),y[3].settings.dateInHistoryView?A?A.p(y,E):(A=SA(y),A.c(),A.m(s,c)):A&&(A.d(1),A=null),(!g||E&1)&&f!==(f=y[0].message+"")&&Me(h,f),(!g||E&9&&d!==(d=`${y[0].refs.length>0?y[0].refs.join(", ")+` +`:""}${(C=y[0].author)==null?void 0:C.name} +${(0,so.moment)(y[0].date).format(y[3].settings.commitDateFormat)} +${y[0].message}`))&&T(r,"aria-label",d),(!g||E&32)&&T(r,"data-tooltip-position",y[5]),y[4]?x&&(Ce(),X(x,1,1,()=>{x=null}),Fe()):x?(x.p(y,E),E&16&&U(x,1)):(x=EA(y),x.c(),U(x,1),x.m(n,null)),(!g||E&16)&&ce(n,"is-collapsed",y[4])},i(y){g||(U(x),g=!0)},o(y){X(x),g=!1},d(y){y&&ne(t),b&&b.d(),S&&S.d(),A&&A.d(),x&&x.d(),m=!1,w()}}}function Cj(e,t,n){let r,i,{log:a}=t,{view:s}=t,{showTree:o}=t,{plugin:l}=t,c=!0;function u(h){let d=h.author.name;if(l.settings.authorInHistoryView=="full")return d;if(l.settings.authorInHistoryView=="initials")return d.split(" ").filter(g=>g.length>0).map(g=>g[0].toUpperCase()).join("")}let f=()=>n(4,c=!c);return e.$$set=h=>{"log"in h&&n(0,a=h.log),"view"in h&&n(1,s=h.view),"showTree"in h&&n(2,o=h.showTree),"plugin"in h&&n(3,l=h.plugin)},e.$$.update=()=>{e.$$.dirty&9&&n(6,r={title:"",path:"",vaultPath:"",children:l.gitManager.getTreeStructure(a.diff.files)}),e.$$.dirty&2&&n(5,i=s.leaf.getRoot().side=="left"?"right":"left")},[a,s,o,l,c,i,r,u,f]}var im=class extends qe{constructor(t){super(),st(this,t,Cj,Tj,at,{log:0,view:1,showTree:2,plugin:3})}},kA=im;function TA(e,t,n){let r=e.slice();return r[13]=t[n],r}function CA(e){let t,n,r=nt(e[6]),i=[];for(let s=0;sX(i[s],1,1,()=>{i[s]=null});return{c(){t=I("div");for(let s=0;s{h=null}),Fe())},i(d){c||(U(h),c=!0)},o(d){X(h),c=!1},d(d){d&&ne(t),e[8](null),e[10](null),h&&h.d(),u=!1,ke(f)}}}function Pj(e,t,n){let{plugin:r}=t,{view:i}=t,a,s=[],o,l=r.settings.treeStructure,c,u;c=i.app.workspace.on("obsidian-git:view-refresh",()=>void h().catch(console.error)),h().catch(console.error),r.app.workspace.onLayoutReady(()=>{window.setTimeout(()=>{s.forEach(m=>(0,lu.setIcon)(m,m.getAttr("data-icon"))),(0,lu.setIcon)(u,l?"list":"folder")},0)}),io(()=>{i.app.workspace.offref(c)});function f(){i.app.workspace.trigger("obsidian-git:refresh")}function h(){return Ea(this,void 0,void 0,function*(){if(!r.gitReady){n(6,o=void 0);return}n(4,a=!0);let m=r.gitManager instanceof Le;n(6,o=yield r.gitManager.log(void 0,!1,m?50:10)),n(4,a=!1)})}function d(m){je[m?"unshift":"push"](()=>{u=m,n(3,u)})}let p=()=>{n(2,l=!l),n(0,r.settings.treeStructure=l,r),r.saveSettings()};function g(m){je[m?"unshift":"push"](()=>{s[6]=m,n(5,s)})}return e.$$set=m=>{"plugin"in m&&n(0,r=m.plugin),"view"in m&&n(1,i=m.view)},e.$$.update=()=>{e.$$.dirty&12&&u&&(u.empty(),(0,lu.setIcon)(u,l?"list":"folder"))},[r,i,l,u,a,s,o,f,d,p,g]}var am=class extends qe{constructor(t){super(),st(this,t,Pj,Fj,at,{plugin:0,view:1})}},PA=am;var oo=class extends MA.ItemView{constructor(t,n){super(t),this.plugin=n,this.hoverPopover=null}getViewType(){return nn.type}getDisplayText(){return nn.name}getIcon(){return nn.icon}onClose(){var t;return(t=this._view)==null||t.$destroy(),super.onClose()}reload(){var t;(t=this._view)==null||t.$destroy(),this._view=new PA({target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};v();var OA=require("obsidian"),cu=class extends OA.FuzzySuggestModal{constructor(n,r){super(n.app);this.branches=r;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(n){return n}onChooseItem(n,r){this.resolve(n)}openAndGetReslt(){return new Promise(n=>{this.resolve=n,this.open()})}onClose(){new Promise(n=>setTimeout(n,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};v();var tk=require("obsidian");v();var Fa=require("obsidian");v();var IA=require("obsidian"),Tr=class extends IA.Modal{constructor(n,r,i){super(n);this.deletion=r;this.filename=i;this.resolve=null}myOpen(){return this.open(),new Promise(n=>{this.resolve=n})}onOpen(){let{contentEl:n,titleEl:r}=this;r.setText(`${this.deletion?"Delete":"Discard"} this file?`),n.createEl("p").setText(`Do you really want to ${this.deletion?"delete":"discard the changes of"} "${this.filename}"`);let i=n.createDiv({cls:"modal-button-container"}),a=i.createEl("button",{cls:"mod-warning",text:this.deletion?"Delete":"Discard"});a.addEventListener("click",()=>{this.resolve&&this.resolve(!0),this.close()}),a.addEventListener("keypress",()=>{this.resolve&&this.resolve(!0),this.close()});let s=i.createEl("button",{text:"Cancel"});s.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),s.addEventListener("keypress",()=>(this.resolve&&this.resolve(!1),this.close()))}onClose(){let{contentEl:n}=this;n.empty()}};v();var ka=require("obsidian");v();v();var Mj=Xe(RA()),Cr=require("obsidian");function oi(e,t,n){let r=e.target;app.workspace.trigger("hover-link",{event:e,source:t.getViewType(),hoverParent:t,targetEl:r,linktext:n})}function Oj(e){Nt(e,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function LA(e){let t,n,r;return{c(){t=I("div"),T(t,"data-icon","go-to-file"),T(t,"aria-label","Open File"),T(t,"class","clickable-icon")},m(i,a){re(i,t,a),e[11](t),n||(r=[te(t,"auxclick",xe(e[5])),te(t,"click",xe(e[5]))],n=!0)},p:Ae,d(i){i&&ne(t),e[11](null),n=!1,ke(r)}}}function Ij(e){let t,n,r,i=Bt(e[0].vault_path)+"",a,s,o,l,c=e[1].app.vault.getAbstractFileByPath(e[0].vault_path)instanceof ka.TFile,u,f,h,d,p,g,m=e[0].working_dir+"",w,b,S,A,x,k,y=c&&LA(e);return{c(){var E,_,C;t=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("div"),y&&y.c(),u=J(),f=I("div"),h=J(),d=I("div"),p=J(),g=I("div"),w=Te(m),T(r,"class","tree-item-inner nav-file-title-content"),T(f,"data-icon","undo"),T(f,"aria-label","Discard"),T(f,"class","clickable-icon"),T(d,"data-icon","plus"),T(d,"aria-label","Stage"),T(d,"class","clickable-icon"),T(l,"class","buttons"),T(g,"class","type"),T(g,"data-type",b=e[0].working_dir),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",S=e[0].vault_path),T(n,"data-tooltip-position",e[3]),T(n,"aria-label",A=e[0].vault_path),ce(n,"is-active",((E=e[1].plugin.lastDiffViewState)==null?void 0:E.file)==e[0].vault_path&&!((_=e[1].plugin.lastDiffViewState)!=null&&_.hash)&&!((C=e[1].plugin.lastDiffViewState)!=null&&C.staged)),T(t,"class","tree-item nav-file svelte-1wbh8tp")},m(E,_){re(E,t,_),M(t,n),M(n,r),M(r,a),M(n,s),M(n,o),M(o,l),y&&y.m(l,null),M(l,u),M(l,f),e[12](f),M(l,h),M(l,d),e[13](d),M(o,p),M(o,g),M(g,w),x||(k=[te(f,"click",xe(e[8])),te(d,"click",xe(e[6])),te(t,"mouseover",e[4]),te(t,"click",xe(e[7])),te(t,"auxclick",xe(e[14])),te(t,"focus",e[10])],x=!0)},p(E,[_]){var C,P,L;_&1&&i!==(i=Bt(E[0].vault_path)+"")&&Me(a,i),_&3&&(c=E[1].app.vault.getAbstractFileByPath(E[0].vault_path)instanceof ka.TFile),c?y?y.p(E,_):(y=LA(E),y.c(),y.m(l,u)):y&&(y.d(1),y=null),_&1&&m!==(m=E[0].working_dir+"")&&Me(w,m),_&1&&b!==(b=E[0].working_dir)&&T(g,"data-type",b),_&1&&S!==(S=E[0].vault_path)&&T(n,"data-path",S),_&8&&T(n,"data-tooltip-position",E[3]),_&1&&A!==(A=E[0].vault_path)&&T(n,"aria-label",A),_&3&&ce(n,"is-active",((C=E[1].plugin.lastDiffViewState)==null?void 0:C.file)==E[0].vault_path&&!((P=E[1].plugin.lastDiffViewState)!=null&&P.hash)&&!((L=E[1].plugin.lastDiffViewState)!=null&&L.staged))},i:Ae,o:Ae,d(E){E&&ne(t),y&&y.d(),e[12](null),e[13](null),x=!1,ke(k)}}}function Rj(e,t,n){let r,{change:i}=t,{view:a}=t,{manager:s}=t,o=[];window.setTimeout(()=>o.forEach(b=>(0,ka.setIcon)(b,b.getAttr("data-icon"))),0);function l(b){a.app.vault.getAbstractFileByPath(i.vault_path)&&oi(b,a,i.vault_path)}function c(b){var S;let A=a.app.vault.getAbstractFileByPath(i.vault_path);A instanceof ka.TFile&&((S=Xt(a.app,b))===null||S===void 0||S.openFile(A).catch(x=>a.plugin.displayError(x)))}function u(){s.stage(i.path,!1).catch(b=>a.plugin.displayError(b)).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")})}function f(b){var S;(S=Xt(a.app,b))===null||S===void 0||S.setViewState({type:Ct.type,active:!0,state:{file:i.path,staged:!1}})}function h(){let b=i.working_dir=="U";new Tr(a.app,b,i.vault_path).myOpen().then(S=>{if(S===!0)return b?a.app.vault.adapter.remove(i.vault_path).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")}):s.discard(i.path).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")})},S=>a.plugin.displayError(S))}function d(b){kr.call(this,e,b)}function p(b){je[b?"unshift":"push"](()=>{o[1]=b,n(2,o)})}function g(b){je[b?"unshift":"push"](()=>{o[0]=b,n(2,o)})}function m(b){je[b?"unshift":"push"](()=>{o[2]=b,n(2,o)})}let w=b=>{b.button==2?In(a.app,b,i.vault_path,a.leaf,"git-source-control"):f(b)};return e.$$set=b=>{"change"in b&&n(0,i=b.change),"view"in b&&n(1,a=b.view),"manager"in b&&n(9,s=b.manager)},e.$$.update=()=>{e.$$.dirty&2&&n(3,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,o,r,l,c,u,f,h,s,d,p,g,m,w]}var om=class extends qe{constructor(t){super(),st(this,t,Rj,Ij,at,{change:0,view:1,manager:9},Oj)}},uu=om;v();var jA=require("obsidian");function Lj(e){Nt(e,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function jj(e){let t,n,r,i=Bt(e[0].vault_path)+"",a,s,o,l,c=e[0].working_dir+"",u,f,h,d,p,g;return{c(){t=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("span"),u=Te(c),T(r,"class","tree-item-inner nav-file-title-content"),T(l,"class","type"),T(l,"data-type",f=e[0].working_dir),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",h=e[0].vault_path),T(n,"data-tooltip-position",e[2]),T(n,"aria-label",d=e[0].vault_path),T(t,"class","tree-item nav-file svelte-1wbh8tp")},m(m,w){re(m,t,w),M(t,n),M(n,r),M(r,a),M(n,s),M(n,o),M(o,l),M(l,u),p||(g=[te(t,"mouseover",e[3]),te(t,"click",xe(e[4])),te(t,"auxclick",xe(e[6])),te(t,"focus",e[5])],p=!0)},p(m,[w]){w&1&&i!==(i=Bt(m[0].vault_path)+"")&&Me(a,i),w&1&&c!==(c=m[0].working_dir+"")&&Me(u,c),w&1&&f!==(f=m[0].working_dir)&&T(l,"data-type",f),w&1&&h!==(h=m[0].vault_path)&&T(n,"data-path",h),w&4&&T(n,"data-tooltip-position",m[2]),w&1&&d!==(d=m[0].vault_path)&&T(n,"aria-label",d)},i:Ae,o:Ae,d(m){m&&ne(t),p=!1,ke(g)}}}function Dj(e,t,n){let r,{change:i}=t,{view:a}=t;function s(u){a.app.vault.getAbstractFileByPath(i.vault_path)&&oi(u,a,i.vault_path)}function o(u){var f;let h=a.app.vault.getAbstractFileByPath(i.vault_path);h instanceof jA.TFile&&((f=Xt(a.app,u))===null||f===void 0||f.openFile(h).catch(d=>a.plugin.displayError(d)))}function l(u){kr.call(this,e,u)}let c=u=>{u.button==2?In(a.app,u,i.vault_path,a.leaf,"git-source-control"):o(u)};return e.$$set=u=>{"change"in u&&n(0,i=u.change),"view"in u&&n(1,a=u.view)},e.$$.update=()=>{e.$$.dirty&2&&n(2,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,r,s,o,l,c]}var lm=class extends qe{constructor(t){super(),st(this,t,Dj,jj,at,{change:0,view:1},Lj)}},fu=lm;v();var Ta=require("obsidian");function Bj(e){Nt(e,"svelte-1wbh8tp","main.svelte-1wbh8tp .nav-file-title.svelte-1wbh8tp{align-items:center}")}function DA(e){let t,n,r;return{c(){t=I("div"),T(t,"data-icon","go-to-file"),T(t,"aria-label","Open File"),T(t,"class","clickable-icon")},m(i,a){re(i,t,a),e[10](t),n||(r=te(t,"click",xe(e[5])),n=!0)},p:Ae,d(i){i&&ne(t),e[10](null),n=!1,r()}}}function Nj(e){let t,n,r,i=Bt(e[0].vault_path)+"",a,s,o,l,c=e[1].app.vault.getAbstractFileByPath(e[0].vault_path)instanceof Ta.TFile,u,f,h,d,p=e[0].index+"",g,m,w,b,S,A,x=c&&DA(e);return{c(){var k,y,E;t=I("main"),n=I("div"),r=I("div"),a=Te(i),s=J(),o=I("div"),l=I("div"),x&&x.c(),u=J(),f=I("div"),h=J(),d=I("div"),g=Te(p),T(r,"class","tree-item-inner nav-file-title-content"),T(f,"data-icon","minus"),T(f,"aria-label","Unstage"),T(f,"class","clickable-icon"),T(l,"class","buttons"),T(d,"class","type"),T(d,"data-type",m=e[0].index),T(o,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-file-title svelte-1wbh8tp"),T(n,"data-path",w=e[0].vault_path),T(n,"data-tooltip-position",e[3]),T(n,"aria-label",b=e[0].vault_path),ce(n,"is-active",((k=e[1].plugin.lastDiffViewState)==null?void 0:k.file)==e[0].vault_path&&!((y=e[1].plugin.lastDiffViewState)!=null&&y.hash)&&((E=e[1].plugin.lastDiffViewState)==null?void 0:E.staged)),T(t,"class","tree-item nav-file svelte-1wbh8tp")},m(k,y){re(k,t,y),M(t,n),M(n,r),M(r,a),M(n,s),M(n,o),M(o,l),x&&x.m(l,null),M(l,u),M(l,f),e[11](f),M(o,h),M(o,d),M(d,g),S||(A=[te(f,"click",xe(e[7])),te(t,"mouseover",e[4]),te(t,"focus",e[9]),te(t,"click",xe(e[6])),te(t,"auxclick",xe(e[12]))],S=!0)},p(k,[y]){var E,_,C;y&1&&i!==(i=Bt(k[0].vault_path)+"")&&Me(a,i),y&3&&(c=k[1].app.vault.getAbstractFileByPath(k[0].vault_path)instanceof Ta.TFile),c?x?x.p(k,y):(x=DA(k),x.c(),x.m(l,u)):x&&(x.d(1),x=null),y&1&&p!==(p=k[0].index+"")&&Me(g,p),y&1&&m!==(m=k[0].index)&&T(d,"data-type",m),y&1&&w!==(w=k[0].vault_path)&&T(n,"data-path",w),y&8&&T(n,"data-tooltip-position",k[3]),y&1&&b!==(b=k[0].vault_path)&&T(n,"aria-label",b),y&3&&ce(n,"is-active",((E=k[1].plugin.lastDiffViewState)==null?void 0:E.file)==k[0].vault_path&&!((_=k[1].plugin.lastDiffViewState)!=null&&_.hash)&&((C=k[1].plugin.lastDiffViewState)==null?void 0:C.staged))},i:Ae,o:Ae,d(k){k&&ne(t),x&&x.d(),e[11](null),S=!1,ke(A)}}}function $j(e,t,n){let r,{change:i}=t,{view:a}=t,{manager:s}=t,o=[];window.setTimeout(()=>o.forEach(m=>(0,Ta.setIcon)(m,m.getAttr("data-icon"))),0);function l(m){a.app.vault.getFileByPath(i.vault_path)&&oi(m,a,i.vault_path)}function c(m){var w;let b=a.app.vault.getAbstractFileByPath(i.vault_path);b instanceof Ta.TFile&&((w=Xt(a.app,m))===null||w===void 0||w.openFile(b).catch(S=>a.plugin.displayError(S)))}function u(m){var w;(w=Xt(a.app,m))===null||w===void 0||w.setViewState({type:Ct.type,active:!0,state:{file:i.path,staged:!0}})}function f(){s.unstage(i.path,!1).catch(m=>a.plugin.displayError(m)).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")})}function h(m){kr.call(this,e,m)}function d(m){je[m?"unshift":"push"](()=>{o[1]=m,n(2,o)})}function p(m){je[m?"unshift":"push"](()=>{o[0]=m,n(2,o)})}let g=m=>{m.button==2?In(a.app,m,i.vault_path,a.leaf,"git-source-control"):u(m)};return e.$$set=m=>{"change"in m&&n(0,i=m.change),"view"in m&&n(1,a=m.view),"manager"in m&&n(8,s=m.manager)},e.$$.update=()=>{e.$$.dirty&2&&n(3,r=a.leaf.getRoot().side=="left"?"right":"left")},[i,a,o,r,l,c,u,f,s,h,d,p,g]}var cm=class extends qe{constructor(t){super(),st(this,t,$j,Nj,at,{change:0,view:1,manager:8},Bj)}},hu=cm;v();v();function BA(e){let t,n,r,i="And "+(e[0].length-500)+" more files",a,s;return{c(){t=I("div"),n=I("div"),r=I("div"),a=Te(i),T(r,"class","tree-item-inner nav-file-title-content"),T(n,"class","tree-item-self nav-file-title"),T(n,"aria-label",s="And "+(e[0].length-500)+" more files"),T(t,"class","tree-item nav-file")},m(o,l){re(o,t,l),M(t,n),M(n,r),M(r,a)},p(o,l){l&1&&i!==(i="And "+(o[0].length-500)+" more files")&&Me(a,i),l&1&&s!==(s="And "+(o[0].length-500)+" more files")&&T(n,"aria-label",s)},d(o){o&&ne(t)}}}function Hj(e){let t,n=e[0].length>500&&BA(e);return{c(){t=I("main"),n&&n.c()},m(r,i){re(r,t,i),n&&n.m(t,null)},p(r,[i]){r[0].length>500?n?n.p(r,i):(n=BA(r),n.c(),n.m(t,null)):n&&(n.d(1),n=null)},i:Ae,o:Ae,d(r){r&&ne(t),n&&n.d()}}}function Uj(e,t,n){let{files:r}=t;return e.$$set=i=>{"files"in i&&n(0,r=i.files)},[r]}var um=class extends qe{constructor(t){super(),st(this,t,Uj,Hj,at,{files:0})}},Ca=um;function zj(e){Nt(e,"svelte-hup5mn","main.svelte-hup5mn .nav-folder-title.svelte-hup5mn{align-items:center}")}function NA(e,t,n){let r=e.slice();return r[18]=t[n],r}function Vj(e){let t,n,r,i,a,s,o,l=e[18].title+"",c,u,f,h,d,p,g,m,w,b,S;function A(C,P){return C[3]==0?Xj:qj}let x=A(e,-1),k=x(e),y=!e[5][e[18].title]&&$A(e);function E(){return e[14](e[18])}function _(...C){return e[15](e[18],...C)}return{c(){t=I("div"),n=I("div"),r=I("div"),i=J(),a=I("div"),a.innerHTML='',s=J(),o=I("div"),c=Te(l),u=J(),f=I("div"),h=I("div"),k.c(),d=J(),p=I("div"),m=J(),y&&y.c(),T(r,"data-icon","folder"),Yt(r,"padding-right","5px"),Yt(r,"display","flex"),T(a,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(a,"is-collapsed",e[5][e[18].title]),T(o,"class","tree-item-inner nav-folder-title-content"),Yt(p,"width","11px"),T(h,"class","buttons"),T(f,"class","git-tools"),T(n,"class","tree-item-self is-clickable nav-folder-title svelte-hup5mn"),T(n,"data-tooltip-position",e[6]),T(n,"aria-label",g=e[18].vaultPath),T(t,"class","tree-item nav-folder"),ce(t,"is-collapsed",e[5][e[18].title])},m(C,P){re(C,t,P),M(t,n),M(n,r),M(n,i),M(n,a),M(n,s),M(n,o),M(o,c),M(n,u),M(n,f),M(f,h),k.m(h,null),M(h,d),M(h,p),M(t,m),y&&y.m(t,null),w=!0,b||(S=[te(t,"click",xe(E)),te(t,"auxclick",xe(_))],b=!0)},p(C,P){e=C,(!w||P&33)&&ce(a,"is-collapsed",e[5][e[18].title]),(!w||P&1)&&l!==(l=e[18].title+"")&&Me(c,l),x===(x=A(e,P))&&k?k.p(e,P):(k.d(1),k=x(e),k&&(k.c(),k.m(h,d))),(!w||P&64)&&T(n,"data-tooltip-position",e[6]),(!w||P&1&&g!==(g=e[18].vaultPath))&&T(n,"aria-label",g),e[5][e[18].title]?y&&(Ce(),X(y,1,1,()=>{y=null}),Fe()):y?(y.p(e,P),P&33&&U(y,1)):(y=$A(e),y.c(),U(y,1),y.m(t,null)),(!w||P&33)&&ce(t,"is-collapsed",e[5][e[18].title])},i(C){w||(U(y),w=!0)},o(C){X(y),w=!1},d(C){C&&ne(t),k.d(),y&&y.d(),b=!1,ke(S)}}}function Wj(e){let t,n,r,i,a=[Kj,Zj,Yj],s=[];function o(l,c){return l[3]==0?0:l[3]==1?1:l[3]==2?2:-1}return~(n=o(e,-1))&&(r=s[n]=a[n](e)),{c(){t=I("div"),r&&r.c()},m(l,c){re(l,t,c),~n&&s[n].m(t,null),i=!0},p(l,c){let u=n;n=o(l,c),n===u?~n&&s[n].p(l,c):(r&&(Ce(),X(s[u],1,1,()=>{s[u]=null}),Fe()),~n?(r=s[n],r?r.p(l,c):(r=s[n]=a[n](l),r.c()),U(r,1),r.m(t,null)):r=null)},i(l){i||(U(r),i=!0)},o(l){X(r),i=!1},d(l){l&&ne(t),~n&&s[n].d()}}}function qj(e){let t,n,r,i,a;function s(){return e[12](e[18])}function o(){return e[13](e[18])}return{c(){t=I("div"),t.innerHTML='',n=J(),r=I("div"),r.innerHTML='',T(t,"data-icon","undo"),T(t,"aria-label","Discard"),T(t,"class","clickable-icon"),T(r,"data-icon","plus"),T(r,"aria-label","Stage"),T(r,"class","clickable-icon")},m(l,c){re(l,t,c),re(l,n,c),re(l,r,c),i||(a=[te(t,"click",xe(s)),te(r,"click",xe(o))],i=!0)},p(l,c){e=l},d(l){l&&(ne(t),ne(n),ne(r)),i=!1,ke(a)}}}function Xj(e){let t,n,r;function i(){return e[11](e[18])}return{c(){t=I("div"),t.innerHTML='',T(t,"data-icon","minus"),T(t,"aria-label","Unstage"),T(t,"class","clickable-icon")},m(a,s){re(a,t,s),n||(r=te(t,"click",xe(i)),n=!0)},p(a,s){e=a},d(a){a&&ne(t),n=!1,r()}}}function $A(e){let t,n,r,i;return n=new du({props:{hierarchy:e[18],plugin:e[1],view:e[2],fileType:e[3]}}),{c(){t=I("div"),Ge(n.$$.fragment),T(t,"class","tree-item-children nav-folder-children")},m(a,s){re(a,t,s),De(n,t,null),i=!0},p(a,s){let o={};s&1&&(o.hierarchy=a[18]),s&2&&(o.plugin=a[1]),s&4&&(o.view=a[2]),s&8&&(o.fileType=a[3]),n.$set(o)},i(a){i||(U(n.$$.fragment,a),a&&wt(()=>{i&&(r||(r=bt(t,xt,{duration:150},!0)),r.run(1))}),i=!0)},o(a){X(n.$$.fragment,a),a&&(r||(r=bt(t,xt,{duration:150},!1)),r.run(0)),i=!1},d(a){a&&ne(t),Be(n),a&&r&&r.end()}}}function Yj(e){let t,n;return t=new fu({props:{change:e[18].data,view:e[2]}}),{c(){Ge(t.$$.fragment)},m(r,i){De(t,r,i),n=!0},p(r,i){let a={};i&1&&(a.change=r[18].data),i&4&&(a.view=r[2]),t.$set(a)},i(r){n||(U(t.$$.fragment,r),n=!0)},o(r){X(t.$$.fragment,r),n=!1},d(r){Be(t,r)}}}function Zj(e){let t,n;return t=new uu({props:{change:e[18].data,manager:e[1].gitManager,view:e[2]}}),{c(){Ge(t.$$.fragment)},m(r,i){De(t,r,i),n=!0},p(r,i){let a={};i&1&&(a.change=r[18].data),i&2&&(a.manager=r[1].gitManager),i&4&&(a.view=r[2]),t.$set(a)},i(r){n||(U(t.$$.fragment,r),n=!0)},o(r){X(t.$$.fragment,r),n=!1},d(r){Be(t,r)}}}function Kj(e){let t,n;return t=new hu({props:{change:e[18].data,manager:e[1].gitManager,view:e[2]}}),{c(){Ge(t.$$.fragment)},m(r,i){De(t,r,i),n=!0},p(r,i){let a={};i&1&&(a.change=r[18].data),i&2&&(a.manager=r[1].gitManager),i&4&&(a.view=r[2]),t.$set(a)},i(r){n||(U(t.$$.fragment,r),n=!0)},o(r){X(t.$$.fragment,r),n=!1},d(r){Be(t,r)}}}function HA(e){let t,n,r,i,a=[Wj,Vj],s=[];function o(l,c){return l[18].data?0:1}return t=o(e,-1),n=s[t]=a[t](e),{c(){n.c(),r=xa()},m(l,c){s[t].m(l,c),re(l,r,c),i=!0},p(l,c){let u=t;t=o(l,c),t===u?s[t].p(l,c):(Ce(),X(s[u],1,1,()=>{s[u]=null}),Fe(),n=s[t],n?n.p(l,c):(n=s[t]=a[t](l),n.c()),U(n,1),n.m(r.parentNode,r))},i(l){i||(U(n),i=!0)},o(l){X(n),i=!1},d(l){l&&ne(r),s[t].d(l)}}}function Jj(e){let t,n,r,i,a=nt(br(e[0].children,500)),s=[];for(let l=0;lX(s[l],1,1,()=>{s[l]=null});return r=new Ca({props:{files:e[0].children}}),{c(){t=I("main");for(let l=0;l100;function h(x){o.gitManager.stageAll({dir:x}).catch(k=>o.displayError(k)).finally(()=>{l.app.workspace.trigger("obsidian-git:refresh")})}function d(x){o.gitManager.unstageAll({dir:x}).catch(k=>o.displayError(k)).finally(()=>{l.app.workspace.trigger("obsidian-git:refresh")})}function p(x){new Tr(l.app,!1,x.vaultPath).myOpen().then(k=>{if(k===!0)return o.gitManager.discardAll({dir:x.path,status:o.cachedStatus}).finally(()=>{l.app.workspace.trigger("obsidian-git:refresh")})},k=>o.displayError(k))}function g(x){n(5,f[x.title]=!f[x.title],f)}let m=x=>d(x.path),w=x=>p(x),b=x=>h(x.path),S=x=>g(x),A=(x,k)=>In(l.app,k,x.vaultPath,l.leaf,"git-source-control");return e.$$set=x=>{"hierarchy"in x&&n(0,s=x.hierarchy),"plugin"in x&&n(1,o=x.plugin),"view"in x&&n(2,l=x.view),"fileType"in x&&n(3,c=x.fileType),"topLevel"in x&&n(4,u=x.topLevel)},e.$$.update=()=>{e.$$.dirty&4&&n(6,r=l.leaf.getRoot().side=="left"?"right":"left")},[s,o,l,c,u,f,r,h,d,p,g,m,w,b,S,A]}var du=class extends qe{constructor(t){super(),st(this,t,Qj,Jj,at,{hierarchy:0,plugin:1,view:2,fileType:3,topLevel:4},zj)}},pu=du;function eD(e){Nt(e,"svelte-11adhly",`.commit-msg-input.svelte-11adhly.svelte-11adhly{width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field)}.git-commit-msg.svelte-11adhly.svelte-11adhly{position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto}main.svelte-11adhly .git-tools .files-count.svelte-11adhly{padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center}.nav-folder-title.svelte-11adhly.svelte-11adhly{align-items:center}.git-commit-msg-clear-button.svelte-11adhly.svelte-11adhly{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-11adhly.svelte-11adhly: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 UA(e,t,n){let r=e.slice();return r[42]=t[n],r}function GA(e,t,n){let r=e.slice();return r[42]=t[n],r}function zA(e,t,n){let r=e.slice();return r[47]=t[n],r}function VA(e){let t,n,r,i;return{c(){t=I("div"),T(t,"class","git-commit-msg-clear-button svelte-11adhly"),T(t,"aria-label",n="Clear")},m(a,s){re(a,t,s),r||(i=te(t,"click",e[34]),r=!0)},p:Ae,d(a){a&&ne(t),r=!1,i()}}}function WA(e){let t,n,r,i,a,s,o,l,c,u,f,h,d=e[6].staged.length+"",p,g,m,w,b,S,A,x,k,y,E,_,C,P,L,N,j=e[6].changed.length+"",Y,le,he,ae,Pe,de,$=e[13]&&qA(e),z=e[12]&&YA(e),D=e[7].length>0&&KA(e);return{c(){t=I("div"),n=I("div"),r=I("div"),i=I("div"),i.innerHTML='',a=J(),s=I("div"),s.textContent="Staged Changes",o=J(),l=I("div"),c=I("div"),u=I("div"),u.innerHTML='',f=J(),h=I("div"),p=Te(d),g=J(),$&&$.c(),m=J(),w=I("div"),b=I("div"),S=I("div"),S.innerHTML='',A=J(),x=I("div"),x.textContent="Changes",k=J(),y=I("div"),E=I("div"),_=I("div"),_.innerHTML='',C=J(),P=I("div"),P.innerHTML='',L=J(),N=I("div"),Y=Te(j),le=J(),z&&z.c(),he=J(),D&&D.c(),T(i,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(i,"is-collapsed",!e[13]),T(s,"class","tree-item-inner nav-folder-title-content"),T(u,"data-icon","minus"),T(u,"aria-label","Unstage"),T(u,"class","clickable-icon"),T(c,"class","buttons"),T(h,"class","files-count svelte-11adhly"),T(l,"class","git-tools"),T(r,"class","tree-item-self is-clickable nav-folder-title svelte-11adhly"),T(n,"class","staged tree-item nav-folder"),ce(n,"is-collapsed",!e[13]),T(S,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),ce(S,"is-collapsed",!e[12]),T(x,"class","tree-item-inner nav-folder-title-content"),T(_,"data-icon","undo"),T(_,"aria-label","Discard"),T(_,"class","clickable-icon"),T(P,"data-icon","plus"),T(P,"aria-label","Stage"),T(P,"class","clickable-icon"),T(E,"class","buttons"),T(N,"class","files-count svelte-11adhly"),T(y,"class","git-tools"),T(b,"class","tree-item-self is-clickable nav-folder-title svelte-11adhly"),T(w,"class","changes tree-item nav-folder"),ce(w,"is-collapsed",!e[12]),T(t,"class","tree-item nav-folder mod-root")},m(se,Se){re(se,t,Se),M(t,n),M(n,r),M(r,i),M(r,a),M(r,s),M(r,o),M(r,l),M(l,c),M(c,u),e[35](u),M(l,f),M(l,h),M(h,p),M(n,g),$&&$.m(n,null),M(t,m),M(t,w),M(w,b),M(b,S),M(b,A),M(b,x),M(b,k),M(b,y),M(y,E),M(E,_),M(E,C),M(E,P),e[37](P),M(y,L),M(y,N),M(N,Y),M(w,le),z&&z.m(w,null),M(t,he),D&&D.m(t,null),ae=!0,Pe||(de=[te(u,"click",xe(e[20])),te(r,"click",e[36]),te(_,"click",xe(e[23])),te(P,"click",xe(e[19])),te(b,"click",e[38])],Pe=!0)},p(se,Se){(!ae||Se[0]&8192)&&ce(i,"is-collapsed",!se[13]),(!ae||Se[0]&64)&&d!==(d=se[6].staged.length+"")&&Me(p,d),se[13]?$?($.p(se,Se),Se[0]&8192&&U($,1)):($=qA(se),$.c(),U($,1),$.m(n,null)):$&&(Ce(),X($,1,1,()=>{$=null}),Fe()),(!ae||Se[0]&8192)&&ce(n,"is-collapsed",!se[13]),(!ae||Se[0]&4096)&&ce(S,"is-collapsed",!se[12]),(!ae||Se[0]&64)&&j!==(j=se[6].changed.length+"")&&Me(Y,j),se[12]?z?(z.p(se,Se),Se[0]&4096&&U(z,1)):(z=YA(se),z.c(),U(z,1),z.m(w,null)):z&&(Ce(),X(z,1,1,()=>{z=null}),Fe()),(!ae||Se[0]&4096)&&ce(w,"is-collapsed",!se[12]),se[7].length>0?D?(D.p(se,Se),Se[0]&128&&U(D,1)):(D=KA(se),D.c(),U(D,1),D.m(t,null)):D&&(Ce(),X(D,1,1,()=>{D=null}),Fe())},i(se){ae||(U($),U(z),U(D),ae=!0)},o(se){X($),X(z),X(D),ae=!1},d(se){se&&ne(t),e[35](null),$&&$.d(),e[37](null),z&&z.d(),D&&D.d(),Pe=!1,ke(de)}}}function qA(e){let t,n,r,i,a,s=[nD,tD],o=[];function l(c,u){return c[3]?0:1}return n=l(e,[-1,-1]),r=o[n]=s[n](e),{c(){t=I("div"),r.c(),T(t,"class","tree-item-children nav-folder-children")},m(c,u){re(c,t,u),o[n].m(t,null),a=!0},p(c,u){let f=n;n=l(c,u),n===f?o[n].p(c,u):(Ce(),X(o[f],1,1,()=>{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(t,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(t,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(t,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(t),o[n].d(),c&&i&&i.end()}}}function tD(e){let t,n,r,i=nt(br(e[6].staged,500)),a=[];for(let o=0;oX(a[o],1,1,()=>{a[o]=null});return n=new Ca({props:{files:e[6].staged}}),{c(){for(let o=0;o{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(t,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(t,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(t,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(t),o[n].d(),c&&i&&i.end()}}}function rD(e){let t,n,r,i=nt(br(e[6].changed,500)),a=[];for(let o=0;oX(a[o],1,1,()=>{a[o]=null});return n=new Ca({props:{files:e[6].changed}}),{c(){for(let o=0;o',i=J(),a=I("div"),a.textContent="Recently Pulled Files",s=J(),o=I("span"),c=Te(l),u=J(),p&&p.c(),T(r,"class","tree-item-icon nav-folder-collapse-indicator collapse-icon"),T(a,"class","tree-item-inner nav-folder-title-content"),T(o,"class","tree-item-flair"),T(n,"class","tree-item-self is-clickable nav-folder-title svelte-11adhly"),T(t,"class","pulled nav-folder"),ce(t,"is-collapsed",!e[14])},m(g,m){re(g,t,m),M(t,n),M(n,r),M(n,i),M(n,a),M(n,s),M(n,o),M(o,c),M(t,u),p&&p.m(t,null),f=!0,h||(d=te(n,"click",e[39]),h=!0)},p(g,m){(!f||m[0]&128)&&l!==(l=g[7].length+"")&&Me(c,l),g[14]?p?(p.p(g,m),m[0]&16384&&U(p,1)):(p=JA(g),p.c(),U(p,1),p.m(t,null)):p&&(Ce(),X(p,1,1,()=>{p=null}),Fe()),(!f||m[0]&16384)&&ce(t,"is-collapsed",!g[14])},i(g){f||(U(p),f=!0)},o(g){X(p),f=!1},d(g){g&&ne(t),p&&p.d(),h=!1,d()}}}function JA(e){let t,n,r,i,a,s=[sD,aD],o=[];function l(c,u){return c[3]?0:1}return n=l(e,[-1,-1]),r=o[n]=s[n](e),{c(){t=I("div"),r.c(),T(t,"class","tree-item-children nav-folder-children")},m(c,u){re(c,t,u),o[n].m(t,null),a=!0},p(c,u){let f=n;n=l(c,u),n===f?o[n].p(c,u):(Ce(),X(o[f],1,1,()=>{o[f]=null}),Fe(),r=o[n],r?r.p(c,u):(r=o[n]=s[n](c),r.c()),U(r,1),r.m(t,null))},i(c){a||(U(r),c&&wt(()=>{a&&(i||(i=bt(t,xt,{duration:150},!0)),i.run(1))}),a=!0)},o(c){X(r),c&&(i||(i=bt(t,xt,{duration:150},!1)),i.run(0)),a=!1},d(c){c&&ne(t),o[n].d(),c&&i&&i.end()}}}function aD(e){let t,n,r,i=nt(e[7]),a=[];for(let o=0;oX(a[o],1,1,()=>{a[o]=null});return n=new Ca({props:{files:e[7]}}),{c(){for(let o=0;o{j=null}),Fe())},i(Y){C||(U(j),C=!0)},o(Y){X(j),C=!1},d(Y){Y&&ne(t),e[24](null),e[25](null),e[26](null),e[27](null),e[28](null),e[29](null),e[30](null),e[32](null),N&&N.d(),j&&j.d(),P=!1,ke(L)}}}function lD(e,t,n){let r,{plugin:i}=t,{view:a}=t,s,o,l=[],c=i.settings.commitMessage,u=[],f,h,d,p=!0,g=!0,m=!0,w=i.settings.treeStructure,b,S;S=a.app.workspace.on("obsidian-git:view-refresh",()=>void k().catch(console.error)),k().catch(console.error),i.app.workspace.onLayoutReady(()=>{window.setTimeout(()=>{u.forEach(ee=>(0,Fa.setIcon)(ee,ee.getAttr("data-icon"))),(0,Fa.setIcon)(b,w?"list":"folder")},0)}),io(()=>{a.app.workspace.offref(S)});function A(){return Ea(this,void 0,void 0,function*(){if(n(5,s=!0),o){if(yield i.tools.hasTooBigFiles(o.staged))return i.setPluginState({gitAction:0}),!1;i.promiseQueue.addTask(()=>i.gitManager.commit({message:c}).then(()=>Ea(this,void 0,void 0,function*(){c!==i.settings.commitMessage&&n(2,c=""),yield i.automaticsManager.setUpAutoCommitAndSync()})).finally(y))}})}function x(){n(5,s=!0),o&&i.promiseQueue.addTask(()=>i.commitAndSync(!1,!1,c).then(()=>{c!==i.settings.commitMessage&&n(2,c="")}).finally(y))}function k(){return Ea(this,void 0,void 0,function*(){if(!i.gitReady){n(6,o=void 0);return}let ee=yield i.gitManager.getUnpushedCommits();if(u.forEach(Ie=>{var Ee,G;Ie&&(Fa.Platform.isMobile?(Ie.removeClass("button-border"),Ie.id=="push"&&ee>0&&Ie.addClass("button-border")):((Ee=Ie.firstElementChild)===null||Ee===void 0||Ee.removeAttribute("color"),Ie.id=="push"&&ee>0&&((G=Ie.firstElementChild)===null||G===void 0||G.setAttr("color","var(--text-accent)"))))}),n(6,o=i.cachedStatus),i.lastPulledFiles&&i.lastPulledFiles!=l&&(n(7,l=i.lastPulledFiles),n(11,d={title:"",path:"",vaultPath:"",children:i.gitManager.getTreeStructure(l)})),o){let Ie=(Ee,G)=>Ee.vault_path.split("/").last().localeCompare(Bt(G.vault_path));o.changed.sort(Ie),o.staged.sort(Ie),n(9,f={title:"",path:"",vaultPath:"",children:i.gitManager.getTreeStructure(o.changed)}),n(10,h={title:"",path:"",vaultPath:"",children:i.gitManager.getTreeStructure(o.staged)})}else n(9,f=void 0),n(10,h=void 0);n(5,s=i.loading)})}function y(){a.app.workspace.trigger("obsidian-git:refresh")}function E(){n(5,s=!0),i.promiseQueue.addTask(()=>i.gitManager.stageAll({status:o}).finally(y))}function _(){n(5,s=!0),i.promiseQueue.addTask(()=>i.gitManager.unstageAll({status:o}).finally(y))}function C(){n(5,s=!0),i.promiseQueue.addTask(()=>i.push().finally(y))}function P(){n(5,s=!0),i.promiseQueue.addTask(()=>i.pullChangesFromRemote().finally(y))}function L(){new Tr(a.app,!1,i.gitManager.getRelativeVaultPath("/")).myOpen().then(ee=>{ee===!0&&i.promiseQueue.addTask(()=>i.gitManager.discardAll({status:i.cachedStatus}).finally(()=>{a.app.workspace.trigger("obsidian-git:refresh")}))},console.error)}function N(ee){je[ee?"unshift":"push"](()=>{u[5]=ee,n(8,u)})}function j(ee){je[ee?"unshift":"push"](()=>{u[0]=ee,n(8,u)})}function Y(ee){je[ee?"unshift":"push"](()=>{u[1]=ee,n(8,u)})}function le(ee){je[ee?"unshift":"push"](()=>{u[2]=ee,n(8,u)})}function he(ee){je[ee?"unshift":"push"](()=>{u[3]=ee,n(8,u)})}function ae(ee){je[ee?"unshift":"push"](()=>{u[4]=ee,n(8,u)})}function Pe(ee){je[ee?"unshift":"push"](()=>{b=ee,n(4,b)})}let de=()=>{n(3,w=!w),n(0,i.settings.treeStructure=w,i),i.saveSettings()};function $(ee){je[ee?"unshift":"push"](()=>{u[6]=ee,n(8,u)})}function z(){c=this.value,n(2,c)}let D=()=>n(2,c="");function se(ee){je[ee?"unshift":"push"](()=>{u[8]=ee,n(8,u)})}let Se=()=>n(13,g=!g);function gt(ee){je[ee?"unshift":"push"](()=>{u[9]=ee,n(8,u)})}let be=()=>n(12,p=!p),ot=()=>n(14,m=!m);return e.$$set=ee=>{"plugin"in ee&&n(0,i=ee.plugin),"view"in ee&&n(1,a=ee.view)},e.$$.update=()=>{e.$$.dirty[0]&24&&b&&(b.empty(),(0,Fa.setIcon)(b,w?"list":"folder")),e.$$.dirty[0]&4&&n(15,r=(c.match(/\n/g)||[]).length+1||1)},[i,a,c,w,b,s,o,l,u,f,h,d,p,g,m,r,A,x,y,E,_,C,P,L,N,j,Y,le,he,ae,Pe,de,$,z,D,se,Se,gt,be,ot]}var fm=class extends qe{constructor(t){super(),st(this,t,lD,oD,at,{plugin:0,view:1},eD,[-1,-1])}},ek=fm;var co=class extends tk.ItemView{constructor(t,n){super(t),this.plugin=n,this.hoverPopover=null}getViewType(){return pt.type}getDisplayText(){return pt.name}getIcon(){return pt.icon}onClose(){var t;return(t=this._view)==null||t.$destroy(),super.onClose()}reload(){var t;(t=this._view)==null||t.$destroy(),this._view=new ek({target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};v();var mu=class{constructor(t,n){this.statusBarEl=t;this.plugin=n;this.statusBarEl.addClass("mod-clickable"),this.statusBarEl.onClickEvent(r=>{this.plugin.switchBranch().catch(i=>n.displayError(i))})}async display(){if(this.plugin.gitReady){let t=await this.plugin.gitManager.branchInfo();t.current!=null?this.statusBarEl.setText(t.current):this.statusBarEl.empty()}else this.statusBarEl.empty()}remove(){this.statusBarEl.remove()}};v();var nk=require("obsidian");var uo=class{constructor(t){this.plugin=t}async hasTooBigFiles(t){let n=await this.plugin.gitManager.branchInfo(),r=n.tracking?xr(n.tracking)[0]:null;if(r){let i=await this.plugin.gitManager.getRemoteUrl(r);if(i!=null&&i.includes("github.com")){let a=t.filter(s=>{let o=this.plugin.app.vault.getAbstractFileByPath(s.vault_path);return o instanceof nk.TFile?o.stat.size>=1e8:!1});if(a.length>0)return this.plugin.displayError(`Did not commit, because following files are too big: ${a.map(s=>s.vault_path).join(` +`)}. Please remove them.`),!0}}return!1}async writeAndOpenFile(t){t!==void 0&&await this.plugin.app.vault.adapter.write(Wi,t);let n=!1;this.plugin.app.workspace.iterateAllLeaves(r=>{r.getDisplayText()!=""&&Wi.startsWith(r.getDisplayText())&&(n=!0)}),n||await this.plugin.app.workspace.openLinkText(Wi,"/",!0)}};var gu=class extends _e.Plugin{constructor(){super(...arguments);this.tools=new uo(this);this.state={gitAction:0,loading:!1,offlineMode:!1};this.gitReady=!1;this.promiseQueue=new Nc(this);this.loading=!1;this.intervalsToClear=[];this.lineAuthoringFeature=new Bc(this)}setPluginState(n){var r;this.state=Object.assign(this.state,n),(r=this.statusBar)==null||r.display()}async updateCachedStatus(){var n,r;return this.cachedStatus=await this.gitManager.status(),this.cachedStatus.conflicted.length>0?(this.localStorage.setConflict(!0),await((n=this.branchBar)==null?void 0:n.display())):(this.localStorage.setConflict(!1),await((r=this.branchBar)==null?void 0:r.display())),this.cachedStatus}async refresh(){if(!this.gitReady)return;let n=this.app.workspace.getLeavesOfType(pt.type),r=this.app.workspace.getLeavesOfType(nn.type);(this.settings.changedFilesInStatusBar||n.some(i=>{var a;return!((a=i.isDeferred)!=null&&a)})||r.some(i=>{var a;return!((a=i.isDeferred)!=null&&a)}))&&(this.loading=!0,this.app.workspace.trigger("obsidian-git:view-refresh"),await this.updateCachedStatus().catch(i=>this.displayError(i)),this.loading=!1,this.app.workspace.trigger("obsidian-git:view-refresh"))}refreshUpdatedHead(){this.lineAuthoringFeature.refreshLineAuthorViews()}async onload(){console.log("loading "+this.manifest.name+" plugin: v"+this.manifest.version),Ws.plugin=this,this.localStorage=new Vc(this),this.localStorage.migrate(),await this.loadSettings(),await this.migrateSettings(),this.settingsTab=new Ec(this.app,this),this.addSettingTab(this.settingsTab),this.localStorage.getPluginDisabled()||(this.registerStuff(),this.app.workspace.onLayoutReady(()=>this.init({fromReload:!1}).catch(n=>this.displayError(n))))}onExternalSettingsChange(){this.reloadSettings().catch(n=>this.displayError(n))}async reloadSettings(){let n=JSON.stringify(this.settings);await this.loadSettings();let r=JSON.stringify(this.settings);n!==r&&(this.log("Reloading settings"),this.unloadPlugin(),await this.init({fromReload:!0}),this.app.workspace.getLeavesOfType(pt.type).forEach(i=>{var a;if(!((a=i.isDeferred)!=null&&a))return i.view.reload()}),this.app.workspace.getLeavesOfType(nn.type).forEach(i=>{var a;if(!((a=i.isDeferred)!=null&&a))return i.view.reload()}))}registerStuff(){this.registerEvent(this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(n=>this.displayError(n))})),this.registerEvent(this.app.workspace.on("obsidian-git:head-change",()=>{this.refreshUpdatedHead()})),this.registerEvent(this.app.workspace.on("file-menu",(n,r,i)=>{this.handleFileMenu(n,r,i)})),this.registerEvent(this.app.workspace.on("active-leaf-change",n=>{this.handleViewActiveState(n)})),this.registerEvent(this.app.vault.on("modify",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerEvent(this.app.vault.on("delete",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerEvent(this.app.vault.on("create",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerEvent(this.app.vault.on("rename",()=>{var n;this.debRefresh(),(n=this.autoCommitDebouncer)==null||n.call(this)})),this.registerView(pt.type,n=>new co(n,this)),this.registerView(nn.type,n=>new oo(n,this)),this.registerView(Ct.type,n=>new va(n,this)),this.addRibbonIcon("git-pull-request","Open Git source control",async()=>{var i;let n=this.app.workspace.getLeavesOfType(pt.type),r;n.length===0?(r=(i=this.app.workspace.getRightLeaf(!1))!=null?i:this.app.workspace.getLeaf(),await r.setViewState({type:pt.type})):r=n.first(),await this.app.workspace.revealLeaf(r),this.app.workspace.trigger("obsidian-git:refresh")}),this.registerHoverLinkSource(pt.type,{display:"Git View",defaultMod:!0}),this.lineAuthoringFeature.onLoadPlugin(),this.setRefreshDebouncer(),ME(this)}setRefreshDebouncer(){var n;(n=this.debRefresh)==null||n.cancel(),this.debRefresh=(0,_e.debounce)(()=>{this.settings.refreshSourceControl&&this.refresh().catch(console.error)},this.settings.refreshSourceControlTimer,!0)}async addFileToGitignore(n){return await this.app.vault.adapter.append(this.gitManager.getRelativeVaultPath(".gitignore"),` +`+this.gitManager.getRelativeRepoPath(n.path,!0)),this.refresh()}handleFileMenu(n,r,i){this.gitReady&&this.settings.showFileMenu&&r&&(this.settings.showFileMenu&&i=="file-explorer-context-menu"&&(n.addItem(a=>{a.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(s=>{this.promiseQueue.addTask(async()=>{r instanceof _e.TFile?await this.gitManager.stage(r.path,!0):await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(r.path,!0)}),this.displayMessage(`Staged ${r.path}`)})})}),n.addItem(a=>{a.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(s=>{this.promiseQueue.addTask(async()=>{r instanceof _e.TFile?await this.gitManager.unstage(r.path,!0):await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(r.path,!0)}),this.displayMessage(`Unstaged ${r.path}`)})})}),n.addItem(a=>{a.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(s=>{this.addFileToGitignore(r).catch(o=>this.displayError(o))})})),i=="git-source-control"&&n.addItem(a=>{a.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(s=>{this.addFileToGitignore(r).catch(o=>this.displayError(o))})}))}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 n,r;this.gitReady=!1,this.app.workspace.trigger("obsidian-git:refresh"),this.lineAuthoringFeature.deactivateFeature(),this.automaticsManager.unload(),(n=this.branchBar)==null||n.remove(),(r=this.statusBar)==null||r.remove(),this.gitManager.unload(),this.promiseQueue.clear();for(let i of this.intervalsToClear)window.clearInterval(i);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let n=await this.loadData();n==null&&(n={showedMobileNotice:!0}),this.settings=Xw(Pn,n)}async saveSettings(){var n;(n=this.settingsTab)==null||n.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return _e.Platform.isDesktopApp}async init({fromReload:n=!1}){var r;if(this.settings.showStatusBar){let i=this.addStatusBarItem();this.statusBar=new $c(i,this),this.intervalsToClear.push(window.setInterval(()=>{var a;return(a=this.statusBar)==null?void 0:a.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Le(this),await this.gitManager.setGitInstance()):this.gitManager=new yn(this);let i=await this.gitManager.checkRequirements();switch(i){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new _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){let a=this.addStatusBarItem();this.branchBar=new mu(a,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return void((s=this.branchBar)==null?void 0:s.display().catch(console.error))},6e4))}await((r=this.branchBar)==null?void 0:r.display()),this.lineAuthoringFeature.conditionallyActivateBySettings(),this.app.workspace.trigger("obsidian-git:refresh"),!n&&this.settings.autoPullOnBoot&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),this.automaticsManager=new qs(this),await this.automaticsManager.init();break;default:this.log("Something weird happened. The 'checkRequirements' result is "+i)}}catch(i){this.displayError(i),console.error(i)}}async createNewRepo(){try{await this.gitManager.init(),new _e.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(n){this.displayError(n)}}async cloneNewRepo(){let r=await new $e(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(r){let i="Vault Root",a=await new $e(this,{options:this.gitManager instanceof yn?[i]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.gitManager instanceof yn}).openAndGetResult();if(a==null)return;if(a===i&&(a="."),a=(0,_e.normalizePath)(a),a==="/"&&(a="."),a==="."){let f=await new $e(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 h="DELETE ALL YOUR LOCAL CONFIG AND PLUGINS";if(await new $e(this,{options:["Abort clone",h],placeholder:`To avoid conflicts, the local ${this.app.vault.configDir} directory needs to be deleted.`,onlySelection:!0}).openAndGetResult()===h)await this.app.vault.adapter.rmdir(this.app.vault.configDir,!0);else{new _e.Notice("Aborted clone");return}}}let s=await new $e(this,{placeholder:"Specify depth of clone. Leave empty for full clone.",allowEmpty:!0}).openAndGetResult(),o;if(s!==""&&(o=parseInt(s),isNaN(o))){new _e.Notice("Invalid depth. Aborting clone.");return}new _e.Notice(`Cloning new repo into "${a}"`);let l=this.settings.basePath,c=a&&a!==".";c&&(this.settings.basePath=a);try{await this.gitManager.clone(r,a,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 n=await this.pull();if(await this.automaticsManager.setUpAutoCommitAndSync(),n!==!1){if(n||this.displayMessage("Pull: Everything is up-to-date"),this.gitManager instanceof Le){let r=await this.updateCachedStatus();r.conflicted.length>0&&(this.displayError(`You have conflicts in ${r.conflicted.length} ${r.conflicted.length==1?"file":"files"}`),await this.handleConflict(r.conflicted))}this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0})}}async commitAndSync(n,r=!1,i){!await this.isAllInitialized()||(this.settings.syncMethod=="reset"&&this.settings.pullBeforePush&&await this.pull(),!await this.commit({fromAuto:n,requestCustomMessage:r,commitMessage:i}))||(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:n,requestCustomMessage:r=!1,onlyStaged:i=!1,commitMessage:a,amend:s=!1}){if(!await this.isAllInitialized())return!1;try{let o=this.localStorage.getConflict(),l,c,u;if(this.gitManager instanceof Le){if(await this.mayDeleteConflictFile(),c=await this.updateCachedStatus(),c.conflicted.length==0&&(o=!1),n&&c.conflicted.length>0)return this.displayError(`Did not commit, because you have conflicts in ${c.conflicted.length} ${c.conflicted.length==1?"file":"files"}. Please resolve them and commit per command.`),await this.handleConflict(c.conflicted),!1;l=[...c.changed,...c.staged]}else{if(n&&o)return this.displayError("Did not commit, because you have conflicts. Please resolve them and commit per command."),!1;if(o)await this.mayDeleteConflictFile(),c=await this.updateCachedStatus(),l=[...c.changed,...c.staged];else{let f=this.gitManager;i?l=await f.getStagedFiles():(u=await f.getUnstagedFiles(),l=u.map(({filepath:h})=>({vault_path:this.gitManager.getRelativeVaultPath(h)})))}}if(await this.tools.hasTooBigFiles(l))return this.setPluginState({gitAction:0}),!1;if(l.length!==0||o){let f=a!=null?a:a=n?this.settings.autoCommitMessage:this.settings.commitMessage;if(n&&this.settings.customMessageOnAutoBackup||r){!this.settings.disablePopups&&n&&new _e.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort");let p=await new Hc(this).openAndGetResult();if(p!=null&&p!=""&&p!="...")f=p;else return this.setPluginState({gitAction:0}),!1}let h;i?h=await this.gitManager.commit({message:f,amend:s}):h=await this.gitManager.commitAll({message:f,status:c,unstagedFiles:u,amend:s}),this.gitManager instanceof Le&&await this.updateCachedStatus();let d=!1;h===void 0&&(d=!0,h=l.length),await this.automaticsManager.setUpAutoCommitAndSync(),this.displayMessage(`Committed${d?" approx.":""} ${h} ${h==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 n=this.localStorage.getConflict();try{this.gitManager instanceof Le&&await this.mayDeleteConflictFile();let r;if(this.gitManager instanceof Le&&(r=await this.updateCachedStatus()).conflicted.length>0)return this.displayError(`Cannot push. You have conflicts in ${r.conflicted.length} ${r.conflicted.length==1?"file":"files"}`),await this.handleConflict(r.conflicted),!1;if(this.gitManager instanceof yn&&n)return this.displayError("Cannot push. You have conflicts"),!1;this.log("Pushing....");let i=await this.gitManager.push();return i!==void 0&&(i>0?this.displayMessage(`Pushed ${i} ${i==1?"file":"files"} to remote`):this.displayMessage("No commits to push")),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(r){return r instanceof Xi?this.handleNoNetworkError(r):this.displayError(r),!1}}async pull(){if(!await this.remotesAreSet())return!1;try{this.log("Pulling....");let n=await this.gitManager.pull()||[];return this.setPluginState({offlineMode:!1}),n.length>0&&(this.displayMessage(`Pulled ${n.length} ${n.length==1?"file":"files"} from remote`),this.lastPulledFiles=n),n.length}catch(n){return this.displayError(n),!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(n){this.displayError(n)}}async mayDeleteConflictFile(){let n=this.app.vault.getAbstractFileByPath(Wi);n&&(this.app.workspace.iterateAllLeaves(r=>{var i;r.view instanceof _e.MarkdownView&&((i=r.view.file)==null?void 0:i.path)==n.path&&r.detach()}),await this.app.vault.delete(n))}async stageFile(n){return await this.isAllInitialized()?(await this.gitManager.stage(n.path,!0),this.displayMessage(`Staged ${n.path}`),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async unstageFile(n){return await this.isAllInitialized()?(await this.gitManager.unstage(n.path,!0),this.displayMessage(`Unstaged ${n.path}`),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async switchBranch(){var i;if(!await this.isAllInitialized())return;let n=await this.gitManager.branchInfo(),r=await new cu(this,n.branches).openAndGetReslt();if(r!=null)return await this.gitManager.checkout(r),this.displayMessage(`Switched to ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}async switchRemoteBranch(){var a;if(!await this.isAllInitialized())return;let n=await this.selectRemoteBranch()||"",[r,i]=xr(n);if(i!=null&&r!=null)return await this.gitManager.checkout(i,r),this.displayMessage(`Switched to ${n}`),await((a=this.branchBar)==null?void 0:a.display()),n}async createBranch(){var r;if(!await this.isAllInitialized())return;let n=await new $e(this,{placeholder:"Create new branch"}).openAndGetResult();if(n!=null)return await this.gitManager.createBranch(n),this.displayMessage(`Created new branch ${n}`),await((r=this.branchBar)==null?void 0:r.display()),n}async deleteBranch(){var i;if(!await this.isAllInitialized())return;let n=await this.gitManager.branchInfo();n.current&&n.branches.remove(n.current);let r=await new $e(this,{options:n.branches,placeholder:"Delete branch",onlySelection:!0}).openAndGetResult();if(r!=null){let a=!1;if(!await this.gitManager.branchIsMerged(r)){let o=await new $e(this,{options:["YES","NO"],placeholder:"This branch isn't merged into HEAD. Force delete?",onlySelection:!0}).openAndGetResult();if(o!=="YES")return;a=o==="YES"}return await this.gitManager.deleteBranch(r,a),this.displayMessage(`Deleted branch ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}}async remotesAreSet(){return this.settings.updateSubmodules||(await this.gitManager.branchInfo()).tracking?!0:(new _e.Notice("No upstream branch is set. Please select one."),await this.setUpstreamBranch())}async setUpstreamBranch(){let n=await this.selectRemoteBranch();return n==null?(this.displayError("Aborted. No upstream-branch is set!",1e4),this.setPluginState({gitAction:0}),!1):(await this.gitManager.updateUpstreamBranch(n),this.displayMessage(`Set upstream branch to ${n}`),this.setPluginState({gitAction:0}),!0)}async discardAll(){await this.gitManager.discardAll({status:this.cachedStatus}),new _e.Notice("All local changes have been discarded. New files remain untouched.")}async handleConflict(n){this.localStorage.setConflict(!0);let r;n!==void 0&&(r=["# 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","",...n.map(i=>{let a=this.app.vault.getAbstractFileByPath(i);return a instanceof _e.TFile?`- [[${this.app.metadataCache.fileToLinktext(a,"/")}]]`:`- Not a file: ${i}`}),` +# 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(r==null?void 0:r.join(` +`))}async editRemotes(){if(!await this.isAllInitialized())return;let n=await this.gitManager.getRemotes(),i=await new $e(this,{options:n,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(i){let a=await this.gitManager.getRemoteUrl(i),o=await new $e(this,{initialValue:a}).openAndGetResult();if(o)return await this.gitManager.setRemote(i,o),i}}async selectRemoteBranch(){let n=await this.gitManager.getRemotes(),r;n.length===0&&(r=await this.editRemotes(),r==null&&(n=await this.gitManager.getRemotes()));let i=new $e(this,{options:n,placeholder:"Select or create a new remote by typing its name and selecting it"}),a=r!=null?r:await i.openAndGetResult();if(a){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(a);let s=await this.gitManager.getRemoteBranches(a);return await new $e(this,{options:s,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult()}}async removeRemote(){if(!await this.isAllInitialized())return;let n=await this.gitManager.getRemotes(),i=await new $e(this,{options:n,placeholder:"Select a remote"}).openAndGetResult();i&&await this.gitManager.removeRemote(i)}handleViewActiveState(n){var a,s;if(!(n!=null&&n.view.getState().file))return;let r=this.app.workspace.getLeavesOfType(pt.type).first(),i=this.app.workspace.getLeavesOfType(nn.type).first();if((a=r==null?void 0:r.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||a.removeClass("is-active"),(s=i==null?void 0:i.view.containerEl.querySelector("div.nav-file-title.is-active"))==null||s.removeClass("is-active"),(n==null?void 0:n.view)instanceof va){let o=n.view.state.file;this.lastDiffViewState=n.view.getState();let l;r&&n.view.state.staged?l=r.view.containerEl.querySelector(`div.staged div.nav-file-title[data-path='${o}']`):r&&n.view.state.staged===!1&&!n.view.state.hash?l=r.view.containerEl.querySelector(`div.changes div.nav-file-title[data-path='${o}']`):i&&n.view.state.hash&&(l=i.view.containerEl.querySelector(`div.nav-file-title[data-path='${o}']`)),l==null||l.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(n){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(n,r=4*1e3){var i;(i=this.statusBar)==null||i.displayMessage(n.toLowerCase(),r),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!n.startsWith("No changes"))&&new _e.Notice(n,5*1e3),this.log(n)}displayError(n,r=10*1e3){var a;if(n instanceof ps.UserCanceledError){new _e.Notice("Aborted");return}let i;n instanceof Error?i=n:i=new Error(String(n)),this.setPluginState({gitAction:0}),new _e.Notice(i.message,r),console.error(`${this.manifest.id}:`,i.stack),(a=this.statusBar)==null||a.displayMessage(i.message.toLowerCase(),r)}log(...n){console.log(`${this.manifest.id}:`,...n)}}; +/*! 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 *) + +js-sha256/src/sha256.js: + (** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.9.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2017 + * @license MIT + *) + +feather-icons/dist/feather.js: + (*! + Copyright (c) 2016 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames + *) +*/ + +/* nosourcemap */ \ 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..ee4f742 --- /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.30.1" +} diff --git a/.obsidian/plugins/obsidian-git/obsidian_askpass.sh b/.obsidian/plugins/obsidian-git/obsidian_askpass.sh new file mode 100644 index 0000000..2e5eb5d --- /dev/null +++ b/.obsidian/plugins/obsidian-git/obsidian_askpass.sh @@ -0,0 +1,23 @@ +#!/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" diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css new file mode 100644 index 0000000..abe81d4 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -0,0 +1,566 @@ +@keyframes loading { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +.workspace-leaf-content[data-type="git-view"] .button-border { + border: 2px solid var(--interactive-accent); + border-radius: var(--radius-s); +} + +.workspace-leaf-content[data-type="git-view"] .view-content { + padding: 0; +} + +.workspace-leaf-content[data-type="git-history-view"] .view-content { + padding: 0; +} + +.loading > svg { + animation: 2s linear infinite loading; + transform-origin: 50% 50%; + display: inline-block; +} + +.obsidian-git-center { + margin: auto; + text-align: center; + width: 50%; +} + +.obsidian-git-textarea { + display: block; + margin-left: auto; + margin-right: auto; +} + +.obsidian-git-disabled { + opacity: 0.5; +} + +.obsidian-git-center-button { + display: block; + margin: 20px auto; +} + +.tooltip.mod-left { + overflow-wrap: break-word; +} + +.tooltip.mod-right { + overflow-wrap: break-word; +} +.git-tools { + display: flex; + margin-left: auto; +} +.git-tools .type { + padding-left: var(--size-2-1); + display: flex; + align-items: center; + justify-content: center; + width: 11px; +} + +.git-tools .type[data-type="M"] { + color: orange; +} +.git-tools .type[data-type="D"] { + color: red; +} +.git-tools .buttons { + display: flex; +} +.git-tools .buttons > * { + padding: 0 0; + height: auto; +} + +.is-active .git-tools .buttons > * { + color: var(--nav-item-color-active); +} + +.git-author { + color: var(--text-accent); +} + +.git-date { + color: var(--text-accent); +} + +.git-ref { + color: var(--text-accent); +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-d-none { + display: none; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-wrapper { + text-align: left; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-header { + background-color: var(--background-primary); + border-bottom: 1px solid var(--interactive-accent); + font-family: var(--font-monospace); + height: 35px; + padding: 5px 10px; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-header, +.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats { + display: -webkit-box; + display: -ms-flexbox; + display: flex; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-stats { + font-size: 14px; + margin-left: auto; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-lines-added { + border: 1px solid #b4e2b4; + border-radius: 5px 0 0 5px; + color: #399839; + padding: 2px; + text-align: right; + vertical-align: middle; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-lines-deleted { + border: 1px solid #e9aeae; + border-radius: 0 5px 5px 0; + color: #c33; + margin-left: 1px; + padding: 2px; + text-align: left; + vertical-align: middle; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-name-wrapper { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 15px; + width: 100%; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-name { + overflow-x: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-wrapper { + border: 1px solid var(--background-modifier-border); + border-radius: 3px; + margin-bottom: 1em; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse { + -webkit-box-pack: end; + -ms-flex-pack: end; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 1px solid var(--background-modifier-border); + border-radius: 3px; + cursor: pointer; + display: none; + font-size: 12px; + justify-content: flex-end; + padding: 4px 8px; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse.d2h-selected { + background-color: #c8e1ff; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-collapse-input { + margin: 0 4px 0 0; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-diff-table { + border-collapse: collapse; + font-family: Menlo, Consolas, monospace; + font-size: 13px; + width: 100%; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-files-diff { + width: 100%; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-diff { + overflow-y: hidden; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-side-diff { + display: inline-block; + margin-bottom: -8px; + margin-right: -4px; + overflow-x: scroll; + overflow-y: hidden; + width: 50%; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-line { + padding: 0 8em; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-line, +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line { + display: inline-block; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: 100%; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line { + padding: 0 4.5em; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-ctn { + word-wrap: normal; + background: none; + display: inline-block; + padding: 0; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + vertical-align: middle; + white-space: pre; + width: 100%; +} + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + del { + background-color: #ffb6ba; +} + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + del { + background-color: #8d232881; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-line del, +.workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line del, +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-line ins { + border-radius: 0.2em; + display: inline-block; + margin-top: -1px; + text-decoration: none; + vertical-align: middle; +} + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + ins { + background-color: #97f295; + text-align: left; +} + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-code-line ins, +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-code-side-line + ins { + background-color: #1d921996; + text-align: left; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix { + word-wrap: normal; + background: none; + display: inline; + padding: 0; + white-space: pre; +} + +.workspace-leaf-content[data-type="diff-view"] .line-num1 { + float: left; +} + +.workspace-leaf-content[data-type="diff-view"] .line-num1, +.workspace-leaf-content[data-type="diff-view"] .line-num2 { + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + padding: 0 0.5em; + text-overflow: ellipsis; + width: 3.5em; +} + +.workspace-leaf-content[data-type="diff-view"] .line-num2 { + float: right; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-muted); + cursor: pointer; + display: inline-block; + position: absolute; + text-align: right; + width: 7.5em; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber:after { + content: "\200b"; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-muted); + cursor: pointer; + display: inline-block; + overflow: hidden; + padding: 0 0.5em; + position: absolute; + text-align: right; + text-overflow: ellipsis; + width: 4em; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-diff-tbody tr { + position: relative; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber:after { + content: "\200b"; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-emptyplaceholder, +.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-line-prefix, +.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber, +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber, +.workspace-leaf-content[data-type="diff-view"] .d2h-emptyplaceholder { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-code-linenumber, +.workspace-leaf-content[data-type="diff-view"] .d2h-code-side-linenumber { + direction: rtl; +} + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-del { + background-color: #fee8e9; + border-color: #e9aeae; +} + +.theme-light .workspace-leaf-content[data-type="diff-view"] .d2h-ins { + background-color: #dfd; + border-color: #b4e2b4; +} + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-del { + background-color: #521b1d83; + border-color: #691d1d73; +} + +.theme-dark .workspace-leaf-content[data-type="diff-view"] .d2h-ins { + background-color: rgba(30, 71, 30, 0.5); + border-color: #13501381; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-info { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + color: var(--text-normal); +} + +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-del.d2h-change { + background-color: #fdf2d0; +} + +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-del.d2h-change { + background-color: #55492480; +} + +.theme-light + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-ins.d2h-change { + background-color: #ded; +} + +.theme-dark + .workspace-leaf-content[data-type="diff-view"] + .d2h-file-diff + .d2h-ins.d2h-change { + background-color: rgba(37, 78, 37, 0.418); +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper { + margin-bottom: 10px; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-wrapper a { + color: #3572b0; + text-decoration: none; +} + +.workspace-leaf-content[data-type="diff-view"] + .d2h-file-list-wrapper + a:visited { + color: #3572b0; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-header { + text-align: left; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-title { + font-weight: 700; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list-line { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + text-align: left; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list { + display: block; + list-style: none; + margin: 0; + padding: 0; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li { + border-bottom: 1px solid var(--background-modifier-border); + margin: 0; + padding: 5px 10px; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-list > li:last-child { + border-bottom: none; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-file-switch { + cursor: pointer; + display: none; + font-size: 10px; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-icon { + fill: currentColor; + margin-right: 10px; + vertical-align: middle; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-deleted { + color: #c33; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-added { + color: #399839; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-changed { + color: #d0b44c; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-moved { + color: #3572b0; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-tag { + background-color: var(--background-primary); + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 10px; + margin-left: 5px; + padding: 0 2px; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-deleted-tag { + border: 2px solid #c33; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-added-tag { + border: 1px solid #399839; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-changed-tag { + border: 1px solid #d0b44c; +} + +.workspace-leaf-content[data-type="diff-view"] .d2h-moved-tag { + border: 1px solid #3572b0; +} + +/* ====================== Line Authoring Information ====================== */ + +.cm-gutterElement.obs-git-blame-gutter { + /* Add background color to spacing inbetween and around the gutter for better aesthetics */ + border-width: 0px 2px 0.2px 2px; + border-style: solid; + border-color: var(--background-secondary); + background-color: var(--background-secondary); +} + +.cm-gutterElement.obs-git-blame-gutter > div, +.line-author-settings-preview { + /* delegate text color to settings */ + color: var(--obs-git-gutter-text); + font-family: monospace; + height: 100%; /* ensure, that age-based background color occupies entire parent */ + text-align: right; + padding: 0px 6px 0px 6px; + white-space: pre; /* Keep spaces and do not collapse them. */ +} + +@media (max-width: 800px) { + /* hide git blame gutter not to superpose text */ + .cm-gutterElement.obs-git-blame-gutter { + display: none; + } +} diff --git a/.obsidian/plugins/obsidian-kanban/main.js b/.obsidian/plugins/obsidian-kanban/main.js new file mode 100644 index 0000000..9090d50 --- /dev/null +++ b/.obsidian/plugins/obsidian-kanban/main.js @@ -0,0 +1,153 @@ +var sF=Object.create;var Vs=Object.defineProperty;var lF=Object.getOwnPropertyDescriptor;var uF=Object.getOwnPropertyNames;var cF=Object.getPrototypeOf,dF=Object.prototype.hasOwnProperty;var fF=(e,t,r)=>t in e?Vs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var hF=(e,t)=>()=>(e&&(t=e(e=0)),t);var wn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Rf=(e,t)=>{for(var r in t)Vs(e,r,{get:t[r],enumerable:!0})},av=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of uF(t))!dF.call(e,i)&&i!==r&&Vs(e,i,{get:()=>t[i],enumerable:!(n=lF(t,i))||n.enumerable});return e};var Ct=(e,t,r)=>(r=e!=null?sF(cF(e)):{},av(t||!e||!e.__esModule?Vs(r,"default",{value:e,enumerable:!0}):r,e)),ov=e=>av(Vs({},"__esModule",{value:!0}),e);var ur=(e,t,r)=>(fF(e,typeof t!="symbol"?t+"":t,r),r);var ln=wn((hi,Zv)=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});function Qr(e){return typeof e=="object"&&!("toString"in e)?Object.prototype.toString.call(e).slice(8,-1):e}var eI=typeof process=="object"&&!0;function Vr(e,t){if(!e)throw eI?new Error("Invariant failed"):new Error(t())}hi.invariant=Vr;var nh=Object.prototype.hasOwnProperty,tI=Array.prototype.splice,nI=Object.prototype.toString;function Ua(e){return nI.call(e).slice(8,-1)}var bu=Object.assign||function(e,t){return rh(t).forEach(function(r){nh.call(t,r)&&(e[r]=t[r])}),e},rh=typeof Object.getOwnPropertySymbols=="function"?function(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.keys(e)};function sa(e){return Array.isArray(e)?bu(e.constructor(e.length),e):Ua(e)==="Map"?new Map(e):Ua(e)==="Set"?new Set(e):e&&typeof e=="object"?bu(Object.create(Object.getPrototypeOf(e)),e):e}var Gv=function(){function e(){this.commands=bu({},rI),this.update=this.update.bind(this),this.update.extend=this.extend=this.extend.bind(this),this.update.isEquals=function(t,r){return t===r},this.update.newContext=function(){return new e().update}}return Object.defineProperty(e.prototype,"isEquals",{get:function(){return this.update.isEquals},set:function(t){this.update.isEquals=t},enumerable:!0,configurable:!0}),e.prototype.extend=function(t,r){this.commands[t]=r},e.prototype.update=function(t,r){var n=this,i=typeof r=="function"?{$apply:r}:r;Array.isArray(t)&&Array.isArray(i)||Vr(!Array.isArray(i),function(){return"update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value."}),Vr(typeof i=="object"&&i!==null,function(){return"update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the "+("following commands: "+Object.keys(n.commands).join(", ")+".")});var a=t;return rh(i).forEach(function(o){if(nh.call(n.commands,o)){var s=t===a;a=n.commands[o](i[o],a,i,t),s&&n.isEquals(a,t)&&(a=t)}else{var u=Ua(t)==="Map"?n.update(t.get(o),i[o]):n.update(t[o],i[o]),l=Ua(a)==="Map"?a.get(o):a[o];(!n.isEquals(u,l)||typeof u=="undefined"&&!nh.call(t,o))&&(a===t&&(a=sa(t)),Ua(a)==="Map"?a.set(o,u):a[o]=u)}}),a},e}();hi.Context=Gv;var rI={$push:function(e,t,r){return jv(t,r,"$push"),e.length?t.concat(e):t},$unshift:function(e,t,r){return jv(t,r,"$unshift"),e.length?e.concat(t):t},$splice:function(e,t,r,n){return iI(t,r),e.forEach(function(i){Jv(i),t===n&&i.length&&(t=sa(n)),tI.apply(t,i)}),t},$set:function(e,t,r){return oI(r),e},$toggle:function(e,t){zs(e,"$toggle");var r=e.length?sa(t):t;return e.forEach(function(n){r[n]=!t[n]}),r},$unset:function(e,t,r,n){return zs(e,"$unset"),e.forEach(function(i){Object.hasOwnProperty.call(t,i)&&(t===n&&(t=sa(n)),delete t[i])}),t},$add:function(e,t,r,n){return qv(t,"$add"),zs(e,"$add"),Ua(t)==="Map"?e.forEach(function(i){var a=i[0],o=i[1];t===n&&t.get(a)!==o&&(t=sa(n)),t.set(a,o)}):e.forEach(function(i){t===n&&!t.has(i)&&(t=sa(n)),t.add(i)}),t},$remove:function(e,t,r,n){return qv(t,"$remove"),zs(e,"$remove"),e.forEach(function(i){t===n&&t.has(i)&&(t=sa(n)),t.delete(i)}),t},$merge:function(e,t,r,n){return sI(t,e),rh(e).forEach(function(i){e[i]!==t[i]&&(t===n&&(t=sa(n)),t[i]=e[i])}),t},$apply:function(e,t){return aI(e),e(t)}},ih=new Gv;hi.isEquals=ih.update.isEquals;hi.extend=ih.extend;hi.default=ih.update;hi.default.default=Zv.exports=bu(hi.default,hi);function jv(e,t,r){Vr(Array.isArray(e),function(){return"update(): expected target of "+Qr(r)+" to be an array; got "+Qr(e)+"."}),zs(t[r],r)}function zs(e,t){Vr(Array.isArray(e),function(){return"update(): expected spec of "+Qr(t)+" to be an array; got "+Qr(e)+". Did you forget to wrap your parameter in an array?"})}function iI(e,t){Vr(Array.isArray(e),function(){return"Expected $splice target to be an array; got "+Qr(e)}),Jv(t.$splice)}function Jv(e){Vr(Array.isArray(e),function(){return"update(): expected spec of $splice to be an array of arrays; got "+Qr(e)+". Did you forget to wrap your parameters in an array?"})}function aI(e){Vr(typeof e=="function",function(){return"update(): expected spec of $apply to be a function; got "+Qr(e)+"."})}function oI(e){Vr(Object.keys(e).length===1,function(){return"Cannot have more than one key in an object with $set"})}function sI(e,t){Vr(t&&typeof t=="object",function(){return"update(): $merge expects a spec of type 'object'; got "+Qr(t)}),Vr(e&&typeof e=="object",function(){return"update(): $merge expects a target of type 'object'; got "+Qr(e)})}function qv(e,t){var r=Ua(e);Vr(r==="Map"||r==="Set",function(){return"update(): "+Qr(t)+" expects a target of type Set or Map; got "+Qr(r)})}});var tw=wn((JB,ew)=>{"use strict";var lI=function(t){return uI(t)&&!cI(t)};function uI(e){return!!e&&typeof e=="object"}function cI(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||hI(e)}var dI=typeof Symbol=="function"&&Symbol.for,fI=dI?Symbol.for("react.element"):60103;function hI(e){return e.$$typeof===fI}function mI(e){return Array.isArray(e)?[]:{}}function Ks(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Mo(mI(e),e,t):e}function pI(e,t,r){return e.concat(t).map(function(n){return Ks(n,r)})}function gI(e,t){if(!t.customMerge)return Mo;var r=t.customMerge(e);return typeof r=="function"?r:Mo}function yI(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Qv(e){return Object.keys(e).concat(yI(e))}function Xv(e,t){try{return t in e}catch(r){return!1}}function vI(e,t){return Xv(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function wI(e,t,r){var n={};return r.isMergeableObject(e)&&Qv(e).forEach(function(i){n[i]=Ks(e[i],r)}),Qv(t).forEach(function(i){vI(e,i)||(Xv(e,i)&&r.isMergeableObject(t[i])?n[i]=gI(i,r)(e[i],t[i],r):n[i]=Ks(t[i],r))}),n}function Mo(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||pI,r.isMergeableObject=r.isMergeableObject||lI,r.cloneUnlessOtherwiseSpecified=Ks;var n=Array.isArray(t),i=Array.isArray(e),a=n===i;return a?n?r.arrayMerge(e,t,r):wI(e,t,r):Ks(t,r)}Mo.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,i){return Mo(n,i,r)},{})};var bI=Mo;ew.exports=bI});var Db=wn((FU,Ch)=>{"use strict";var JA=Object.prototype.hasOwnProperty,cr="~";function al(){}Object.create&&(al.prototype=Object.create(null),new al().__proto__||(cr=!1));function ZA(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function bb(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var a=new ZA(r,n||e,i),o=cr?cr+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],a]:e._events[o].push(a):(e._events[o]=a,e._eventsCount++),e}function Ru(e,t){--e._eventsCount===0?e._events=new al:delete e._events[t]}function Xn(){this._events=new al,this._eventsCount=0}Xn.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)JA.call(r,n)&&t.push(cr?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};Xn.prototype.listeners=function(t){var r=cr?cr+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i{"use strict";"use restrict";var Ih=32;dn.INT_BITS=Ih;dn.INT_MAX=2147483647;dn.INT_MIN=-1<0)-(e<0)};dn.abs=function(e){var t=e>>Ih-1;return(e^t)-t};dn.min=function(e,t){return t^(e^t)&-(e65535)<<4,e>>>=t,r=(e>255)<<3,e>>>=r,t|=r,r=(e>15)<<2,e>>>=r,t|=r,r=(e>3)<<1,e>>>=r,t|=r,t|e>>1};dn.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0};dn.popCount=function(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24};function Fb(e){var t=32;return e&=-e,e&&t--,e&65535&&(t-=16),e&16711935&&(t-=8),e&252645135&&(t-=4),e&858993459&&(t-=2),e&1431655765&&(t-=1),t}dn.countTrailingZeros=Fb;dn.nextPow2=function(e){return e+=e===0,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e+1};dn.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e-(e>>>1)};dn.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,e&=15,27030>>>e&1};var ll=new Array(256);(function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=r&1,--i;e[t]=n<>>8&255]<<16|ll[e>>>16&255]<<8|ll[e>>>24&255]};dn.interleave2=function(e,t){return e&=65535,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t&=65535,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1};dn.deinterleave2=function(e,t){return e=e>>>t&1431655765,e=(e|e>>>1)&858993459,e=(e|e>>>2)&252645135,e=(e|e>>>4)&16711935,e=(e|e>>>16)&65535,e<<16>>16};dn.interleave3=function(e,t,r){return e&=1023,e=(e|e<<16)&4278190335,e=(e|e<<8)&251719695,e=(e|e<<4)&3272356035,e=(e|e<<2)&1227133513,t&=1023,t=(t|t<<16)&4278190335,t=(t|t<<8)&251719695,t=(t|t<<4)&3272356035,t=(t|t<<2)&1227133513,e|=t<<1,r&=1023,r=(r|r<<16)&4278190335,r=(r|r<<8)&251719695,r=(r|r<<4)&3272356035,r=(r|r<<2)&1227133513,e|r<<2};dn.deinterleave3=function(e,t){return e=e>>>t&1227133513,e=(e|e>>>2)&3272356035,e=(e|e>>>4)&251719695,e=(e|e>>>8)&4278190335,e=(e|e>>>16)&1023,e<<22>>22};dn.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>Fb(e)+1}});var Ob=wn((lW,Ab)=>{"use strict";function Ib(e,t,r){var n=e[r]|0;if(n<=0)return[];var i=new Array(n),a;if(r===e.length-1)for(a=0;a0)return tO(e|0,t);break;case"object":if(typeof e.length=="number")return Ib(e,t,0);break}return[]}Ab.exports=nO});var eD={};Rf(eD,{Buffer:()=>fe,INSPECT_MAX_BYTES:()=>$b,SlowBuffer:()=>mO,isBuffer:()=>Qb,kMaxLength:()=>uO});function Hb(){Oh=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");a=e[s-2]==="="?2:e[s-1]==="="?1:0,o=new rO(s*3/4-a),n=a>0?s-4:s;var u=0;for(t=0,r=0;t>16&255,o[u++]=i>>8&255,o[u++]=i&255;return a===2?(i=Wr[e.charCodeAt(t)]<<2|Wr[e.charCodeAt(t+1)]>>4,o[u++]=i&255):a===1&&(i=Wr[e.charCodeAt(t)]<<10|Wr[e.charCodeAt(t+1)]<<4|Wr[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=i&255),o}function aO(e){return wi[e>>18&63]+wi[e>>12&63]+wi[e>>6&63]+wi[e&63]}function oO(e,t,r){for(var n,i=[],a=t;au?u:s+o));return n===1?(t=e[r-1],i+=wi[t>>2],i+=wi[t<<4&63],i+="=="):n===2&&(t=(e[r-2]<<8)+e[r-1],i+=wi[t>>10],i+=wi[t>>4&63],i+=wi[t<<2&63],i+="="),a.push(i),a.join("")}function Ku(e,t,r,n,i){var a,o,s=i*8-n-1,u=(1<>1,c=-7,d=r?i-1:0,m=r?-1:1,h=e[t+d];for(d+=m,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=a*256+e[t+d],d+=m,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=o*256+e[t+d],d+=m,c-=8);if(a===0)a=1-l;else{if(a===u)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-l}return(h?-1:1)*o*Math.pow(2,a-n)}function Bb(e,t,r,n,i,a){var o,s,u,l=a*8-i-1,c=(1<>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,g=n?1:-1,y=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+d>=1?t+=m/u:t+=m*Math.pow(2,1-d),t*u>=2&&(o++,u/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*u-1)*Math.pow(2,i),o=o+d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=s&255,h+=g,s/=256,i-=8);for(o=o<0;e[r+h]=o&255,h+=g,o/=256,l-=8);e[r+h-g]|=y*128}function Yu(){return fe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Wi(e,t){if(Yu()=Yu())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Yu().toString(16)+" bytes");return e|0}function mO(e){return+e!=e&&(e=0),fe.alloc(+e)}function bi(e){return!!(e!=null&&e._isBuffer)}function Yb(e,t){if(bi(e))return e.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var r=e.length;if(r===0)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return zu(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Zb(e).length;default:if(n)return zu(e).length;t=(""+t).toLowerCase(),n=!0}}function pO(e,t,r){var n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,t>>>=0,r<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return xO(this,t,r);case"utf8":case"utf-8":return jb(this,t,r);case"ascii":return EO(this,t,r);case"latin1":case"binary":return kO(this,t,r);case"base64":return DO(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return CO(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Ga(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function zb(e,t,r,n,i){if(e.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0)if(i)r=0;else return-1;if(typeof t=="string"&&(t=fe.from(t,n)),bi(t))return t.length===0?-1:Nb(e,t,r,n,i);if(typeof t=="number")return t=t&255,fe.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Nb(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Nb(e,t,r,n,i){var a=1,o=e.length,s=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,r/=2}function u(h,g){return a===1?h[g]:h.readUInt16BE(g*a)}var l;if(i){var c=-1;for(l=r;lo&&(r=o-s),l=r;l>=0;l--){for(var d=!0,m=0;mi&&(n=i)):n=i;var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var u,l,c,d;switch(s){case 1:a<128&&(o=a);break;case 2:u=e[i+1],(u&192)===128&&(d=(a&31)<<6|u&63,d>127&&(o=d));break;case 3:u=e[i+1],l=e[i+2],(u&192)===128&&(l&192)===128&&(d=(a&15)<<12|(u&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(o=d));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(d=(a&15)<<18|(u&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(o=d))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return SO(n)}function SO(e){var t=e.length;if(t<=Rb)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function gr(e,t,r,n,i,a){if(!bi(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function ju(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>(n?i:1-i)*8}function qu(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>(n?i:3-i)*8&255}function qb(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Gb(e,t,r,n,i){return i||qb(e,t,r,4),Bb(e,t,r,n,23,4),r+4}function Jb(e,t,r,n,i){return i||qb(e,t,r,8),Bb(e,t,r,n,52,8),r+8}function MO(e){if(e=TO(e).replace(_O,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function TO(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function FO(e){return e<16?"0"+e.toString(16):e.toString(16)}function zu(e,t){t=t||1/0;for(var r,n=e.length,i=null,a=[],o=0;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function IO(e){for(var t=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function Zb(e){return iO(MO(e))}function Gu(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function OO(e){return e!==e}function Qb(e){return e!=null&&(!!e._isBuffer||Xb(e)||LO(e))}function Xb(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function LO(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Xb(e.slice(0,0))}var wi,Wr,rO,Oh,sO,Vb,$b,Pb,lO,uO,Rb,_O,tD=hF(()=>{wi=[],Wr=[],rO=typeof Uint8Array!="undefined"?Uint8Array:Array,Oh=!1;sO={}.toString,Vb=Array.isArray||function(e){return sO.call(e)=="[object Array]"};$b=50,Pb=window;fe.TYPED_ARRAY_SUPPORT=Pb.TYPED_ARRAY_SUPPORT!==void 0?Pb.TYPED_ARRAY_SUPPORT:!0;lO=Yu(),uO=lO;fe.poolSize=8192;fe._augment=function(e){return e.__proto__=fe.prototype,e};fe.from=function(e,t,r){return Ub(null,e,t,r)};fe.TYPED_ARRAY_SUPPORT&&(fe.prototype.__proto__=Uint8Array.prototype,fe.__proto__=Uint8Array);fe.alloc=function(e,t,r){return cO(null,e,t,r)};fe.allocUnsafe=function(e){return Lh(null,e)};fe.allocUnsafeSlow=function(e){return Lh(null,e)};fe.isBuffer=Qb;fe.compare=function(t,r){if(!bi(t)||!bi(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var n=t.length,i=r.length,a=0,o=Math.min(n,i);a0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""};fe.prototype.compare=function(t,r,n,i,a){if(!bi(t))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=t?t.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),r<0||n>t.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&r>=n)return 0;if(i>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,a>>>=0,this===t)return 0;for(var o=a-i,s=n-r,u=Math.min(o,s),l=this.slice(i,a),c=t.slice(r,n),d=0;da)&&(n=a),t.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return gO(this,t,r,n);case"utf8":case"utf-8":return yO(this,t,r,n);case"ascii":return Kb(this,t,r,n);case"latin1":case"binary":return vO(this,t,r,n);case"base64":return wO(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bO(this,t,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Rb=4096;fe.prototype.slice=function(t,r){var n=this.length;t=~~t,r=r===void 0?n:~~r,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(a*=256);)i+=this[t+--r]*a;return i};fe.prototype.readUInt8=function(t,r){return r||Pn(t,1,this.length),this[t]};fe.prototype.readUInt16LE=function(t,r){return r||Pn(t,2,this.length),this[t]|this[t+1]<<8};fe.prototype.readUInt16BE=function(t,r){return r||Pn(t,2,this.length),this[t]<<8|this[t+1]};fe.prototype.readUInt32LE=function(t,r){return r||Pn(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};fe.prototype.readUInt32BE=function(t,r){return r||Pn(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};fe.prototype.readIntLE=function(t,r,n){t=t|0,r=r|0,n||Pn(t,r,this.length);for(var i=this[t],a=1,o=0;++o=a&&(i-=Math.pow(2,8*r)),i};fe.prototype.readIntBE=function(t,r,n){t=t|0,r=r|0,n||Pn(t,r,this.length);for(var i=r,a=1,o=this[t+--i];i>0&&(a*=256);)o+=this[t+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*r)),o};fe.prototype.readInt8=function(t,r){return r||Pn(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]};fe.prototype.readInt16LE=function(t,r){r||Pn(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt16BE=function(t,r){r||Pn(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};fe.prototype.readInt32LE=function(t,r){return r||Pn(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};fe.prototype.readInt32BE=function(t,r){return r||Pn(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};fe.prototype.readFloatLE=function(t,r){return r||Pn(t,4,this.length),Ku(this,t,!0,23,4)};fe.prototype.readFloatBE=function(t,r){return r||Pn(t,4,this.length),Ku(this,t,!1,23,4)};fe.prototype.readDoubleLE=function(t,r){return r||Pn(t,8,this.length),Ku(this,t,!0,52,8)};fe.prototype.readDoubleBE=function(t,r){return r||Pn(t,8,this.length),Ku(this,t,!1,52,8)};fe.prototype.writeUIntLE=function(t,r,n,i){if(t=+t,r=r|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;gr(this,t,r,n,a,0)}var o=1,s=0;for(this[r]=t&255;++s=0&&(s*=256);)this[r+o]=t/s&255;return r+n};fe.prototype.writeUInt8=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,1,255,0),fe.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=t&255,r+1};fe.prototype.writeUInt16LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):ju(this,t,r,!0),r+2};fe.prototype.writeUInt16BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):ju(this,t,r,!1),r+2};fe.prototype.writeUInt32LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=t&255):qu(this,t,r,!0),r+4};fe.prototype.writeUInt32BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):qu(this,t,r,!1),r+4};fe.prototype.writeIntLE=function(t,r,n,i){if(t=+t,r=r|0,!i){var a=Math.pow(2,8*n-1);gr(this,t,r,n,a-1,-a)}var o=0,s=1,u=0;for(this[r]=t&255;++o>0)-u&255;return r+n};fe.prototype.writeIntBE=function(t,r,n,i){if(t=+t,r=r|0,!i){var a=Math.pow(2,8*n-1);gr(this,t,r,n,a-1,-a)}var o=n-1,s=1,u=0;for(this[r+o]=t&255;--o>=0&&(s*=256);)t<0&&u===0&&this[r+o+1]!==0&&(u=1),this[r+o]=(t/s>>0)-u&255;return r+n};fe.prototype.writeInt8=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,1,127,-128),fe.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=t&255,r+1};fe.prototype.writeInt16LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8):ju(this,t,r,!0),r+2};fe.prototype.writeInt16BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=t&255):ju(this,t,r,!1),r+2};fe.prototype.writeInt32LE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,2147483647,-2147483648),fe.TYPED_ARRAY_SUPPORT?(this[r]=t&255,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):qu(this,t,r,!0),r+4};fe.prototype.writeInt32BE=function(t,r,n){return t=+t,r=r|0,n||gr(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),fe.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=t&255):qu(this,t,r,!1),r+4};fe.prototype.writeFloatLE=function(t,r,n){return Gb(this,t,r,!0,n)};fe.prototype.writeFloatBE=function(t,r,n){return Gb(this,t,r,!1,n)};fe.prototype.writeDoubleLE=function(t,r,n){return Jb(this,t,r,!0,n)};fe.prototype.writeDoubleBE=function(t,r,n){return Jb(this,t,r,!1,n)};fe.prototype.copy=function(t,r,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),r>=t.length&&(r=t.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-r=0;--o)t[o+r]=this[o+n];else if(a<1e3||!fe.TYPED_ARRAY_SUPPORT)for(o=0;o>>0,n=n===void 0?this.length:n>>>0,t||(t=0);var o;if(typeof t=="number")for(o=r;o{var Ja=(tD(),ov(eD));if(Ja&&Ja.default){Ju.exports=Ja.default;for(let e in Ja)Ju.exports[e]=Ja[e]}else Ja&&(Ju.exports=Ja)});var Xu=wn(bt=>{"use strict";var pa=Wu(),Wn=Ob(),rD=nD().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:Wn([32,0]),UINT16:Wn([32,0]),UINT32:Wn([32,0]),BIGUINT64:Wn([32,0]),INT8:Wn([32,0]),INT16:Wn([32,0]),INT32:Wn([32,0]),BIGINT64:Wn([32,0]),FLOAT:Wn([32,0]),DOUBLE:Wn([32,0]),DATA:Wn([32,0]),UINT8C:Wn([32,0]),BUFFER:Wn([32,0])});var PO=typeof Uint8ClampedArray!="undefined",NO=typeof BigUint64Array!="undefined",RO=typeof BigInt64Array!="undefined",Sn=window.__TYPEDARRAY_POOL;Sn.UINT8C||(Sn.UINT8C=Wn([32,0]));Sn.BIGUINT64||(Sn.BIGUINT64=Wn([32,0]));Sn.BIGINT64||(Sn.BIGINT64=Wn([32,0]));Sn.BUFFER||(Sn.BUFFER=Wn([32,0]));var Zu=Sn.DATA,Qu=Sn.BUFFER;bt.free=function(t){if(rD.isBuffer(t))Qu[pa.log2(t.length)].push(t);else{if(Object.prototype.toString.call(t)!=="[object ArrayBuffer]"&&(t=t.buffer),!t)return;var r=t.length||t.byteLength,n=pa.log2(r)|0;Zu[n].push(t)}};function iD(e){if(e){var t=e.length||e.byteLength,r=pa.log2(t);Zu[r].push(e)}}function HO(e){iD(e.buffer)}bt.freeUint8=bt.freeUint16=bt.freeUint32=bt.freeBigUint64=bt.freeInt8=bt.freeInt16=bt.freeInt32=bt.freeBigInt64=bt.freeFloat32=bt.freeFloat=bt.freeFloat64=bt.freeDouble=bt.freeUint8Clamped=bt.freeDataView=HO;bt.freeArrayBuffer=iD;bt.freeBuffer=function(t){Qu[pa.log2(t.length)].push(t)};bt.malloc=function(t,r){if(r===void 0||r==="arraybuffer")return yr(t);switch(r){case"uint8":return Nh(t);case"uint16":return aD(t);case"uint32":return oD(t);case"int8":return sD(t);case"int16":return lD(t);case"int32":return uD(t);case"float":case"float32":return cD(t);case"double":case"float64":return dD(t);case"uint8_clamped":return fD(t);case"bigint64":return mD(t);case"biguint64":return hD(t);case"buffer":return gD(t);case"data":case"dataview":return pD(t);default:return null}return null};function yr(t){var t=pa.nextPow2(t),r=pa.log2(t),n=Zu[r];return n.length>0?n.pop():new ArrayBuffer(t)}bt.mallocArrayBuffer=yr;function Nh(e){return new Uint8Array(yr(e),0,e)}bt.mallocUint8=Nh;function aD(e){return new Uint16Array(yr(2*e),0,e)}bt.mallocUint16=aD;function oD(e){return new Uint32Array(yr(4*e),0,e)}bt.mallocUint32=oD;function sD(e){return new Int8Array(yr(e),0,e)}bt.mallocInt8=sD;function lD(e){return new Int16Array(yr(2*e),0,e)}bt.mallocInt16=lD;function uD(e){return new Int32Array(yr(4*e),0,e)}bt.mallocInt32=uD;function cD(e){return new Float32Array(yr(4*e),0,e)}bt.mallocFloat32=bt.mallocFloat=cD;function dD(e){return new Float64Array(yr(8*e),0,e)}bt.mallocFloat64=bt.mallocDouble=dD;function fD(e){return PO?new Uint8ClampedArray(yr(e),0,e):Nh(e)}bt.mallocUint8Clamped=fD;function hD(e){return NO?new BigUint64Array(yr(8*e),0,e):null}bt.mallocBigUint64=hD;function mD(e){return RO?new BigInt64Array(yr(8*e),0,e):null}bt.mallocBigInt64=mD;function pD(e){return new DataView(yr(e),0,e)}bt.mallocDataView=pD;function gD(e){e=pa.nextPow2(e);var t=pa.log2(e),r=Qu[t];return r.length>0?r.pop():new rD(e)}bt.mallocBuffer=gD;bt.clearCache=function(){for(var t=0;t<32;++t)Sn.UINT8[t].length=0,Sn.UINT16[t].length=0,Sn.UINT32[t].length=0,Sn.INT8[t].length=0,Sn.INT16[t].length=0,Sn.INT32[t].length=0,Sn.FLOAT[t].length=0,Sn.DOUBLE[t].length=0,Sn.BIGUINT64[t].length=0,Sn.BIGINT64[t].length=0,Sn.UINT8C[t].length=0,Zu[t].length=0,Qu[t].length=0}});var DD=wn((dW,bD)=>{"use strict";bD.exports=BO;var tc=32;function BO(e,t){t<=4*tc?nc(0,t-1,e):rc(0,t-1,e)}function nc(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,u=n-2;s-- >e;){var l=r[u-2],c=r[u-1];if(lr[t+1]:!0}function ec(e,t,r,n){e*=2;var i=n[e];return i>1,s=o-n,u=o+n,l=i,c=s,d=o,m=u,h=a,g=e+1,y=t-1,v=0;Yi(l,c,r)&&(v=l,l=c,c=v),Yi(m,h,r)&&(v=m,m=h,h=v),Yi(l,d,r)&&(v=l,l=d,d=v),Yi(c,d,r)&&(v=c,c=d,d=v),Yi(l,m,r)&&(v=l,l=m,m=v),Yi(d,m,r)&&(v=d,d=m,m=v),Yi(c,h,r)&&(v=c,c=h,h=v),Yi(c,d,r)&&(v=c,c=d,d=v),Yi(m,h,r)&&(v=m,m=h,h=v);for(var D=r[2*c],I=r[2*c+1],C=r[2*m],x=r[2*m+1],O=2*l,A=2*d,P=2*h,B=2*i,G=2*o,J=2*a,Q=0;Q<2;++Q){var oe=r[O+Q],te=r[A+Q],re=r[P+Q];r[B+Q]=oe,r[G+Q]=te,r[J+Q]=re}vD(s,e,r),vD(u,t,r);for(var ne=g;ne<=y;++ne)if(ec(ne,D,I,r))ne!==g&&yD(ne,g,r),++g;else if(!ec(ne,C,x,r))for(;;)if(ec(y,C,x,r)){ec(y,D,I,r)?(VO(ne,g,y,r),++g,--y):(yD(ne,y,r),--y);break}else{if(--y{"use strict";SD.exports={init:UO,sweepBipartite:WO,sweepComplete:YO,scanBipartite:zO,scanComplete:KO};var En=Xu(),$O=Wu(),ic=DD(),Fr=1<<28,Qa=1024,Yn=En.mallocInt32(Qa),zi=En.mallocInt32(Qa),Ki=En.mallocInt32(Qa),Za=En.mallocInt32(Qa),Uo=En.mallocInt32(Qa),ul=En.mallocInt32(Qa),dt=En.mallocDouble(Qa*8);function UO(e){var t=$O.nextPow2(e);Yn.length>>1;ic(dt,I);for(var C=0,x=0,g=0;g=Fr)O=O-Fr|0,Wo(Ki,Za,x--,O);else if(O>=0)Wo(Yn,zi,C--,O);else if(O<=-Fr){O=-O-Fr|0;for(var A=0;A>>1;ic(dt,I);for(var C=0,x=0,O=0,g=0;g>1===dt[2*g+3]>>1&&(P=2,g+=1),A<0){for(var B=-(A>>1)-1,G=0;G>1)-1;P===0?Wo(Yn,zi,C--,B):P===1?Wo(Ki,Za,x--,B):P===2&&Wo(Uo,ul,O--,B)}}}function zO(e,t,r,n,i,a,o,s,u,l,c,d){var m=0,h=2*e,g=t,y=t+e,v=1,D=1;n?D=Fr:v=Fr;for(var I=i;I>>1;ic(dt,A);for(var P=0,I=0;I=Fr?(G=!n,C-=Fr):(G=!!n,C-=1),G)Yo(Yn,zi,P++,C);else{var J=d[C],Q=h*C,oe=c[Q+t+1],te=c[Q+t+1+e];e:for(var re=0;re>>1;ic(dt,C);for(var x=0,y=0;y=Fr)Yn[x++]=v-Fr;else{v-=1;var A=c[v],P=m*v,B=l[P+t+1],G=l[P+t+1+e];e:for(var J=0;J=0;--J)if(Yn[J]===v){for(var re=J+1;re{"use strict";var Xa="d",jo="ax",ED="vv",Hh="fp",cl="es",ac="rs",Uh="re",dl="rb",kD="ri",zo="rp",oc="bs",Wh="be",fl="bb",xD="bi",Ko="bp",Bh="rv",Vh="Q",$h=[Xa,jo,ED,ac,Uh,dl,kD,oc,Wh,fl,xD];function jO(e,t,r){var n="bruteForce"+(e?"Red":"Blue")+(t?"Flip":"")+(r?"Full":""),i=["function ",n,"(",$h.join(),"){","var ",cl,"=2*",Xa,";"],a="for(var i="+ac+","+zo+"="+cl+"*"+ac+";i<"+Uh+";++i,"+zo+"+="+cl+"){var x0="+dl+"["+jo+"+"+zo+"],x1="+dl+"["+jo+"+"+zo+"+"+Xa+"],xi="+kD+"[i];",o="for(var j="+oc+","+Ko+"="+cl+"*"+oc+";j<"+Wh+";++j,"+Ko+"+="+cl+"){var y0="+fl+"["+jo+"+"+Ko+"],"+(r?"y1="+fl+"["+jo+"+"+Ko+"+"+Xa+"],":"")+"yi="+xD+"[j];";return e?i.push(a,Vh,":",o):i.push(o,Vh,":",a),r?i.push("if(y1"+Wh+"-"+oc+"){"),e?(a(!0,!1),i.push("}else{"),a(!1,!1)):(i.push("if("+Hh+"){"),a(!0,!0),i.push("}else{"),a(!0,!1),i.push("}}else{if("+Hh+"){"),a(!1,!0),i.push("}else{"),a(!1,!1),i.push("}")),i.push("}}return "+t);var o=r.join("")+i.join(""),s=new Function(o);return s()}Yh.partial=CD(!1);Yh.full=CD(!0)});var zh=wn((mW,MD)=>{"use strict";MD.exports=GO;var qO="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m";function GO(e,t){var r="abcdef".split("").concat(t),n=[];return e.indexOf("lo")>=0&&n.push("lo=e[k+n]"),e.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(qO.replace("_",n.join()).replace("$",e)),Function.apply(void 0,r)}});var ID=wn((pW,FD)=>{"use strict";FD.exports=XO;var JO=zh(),TD=JO("lor&&i[d+t]>l;--c,d-=o){for(var m=d,h=d+o,g=0;g>>1,l=2*e,c=u,d=i[l*u+t];o=v?(c=y,d=v):g>=I?(c=h,d=g):(c=D,d=I):v>=I?(c=y,d=v):I>=g?(c=h,d=g):(c=D,d=I);for(var O=l*(s-1),A=l*c,C=0;C{"use strict";RD.exports=fL;var qo=Xu(),Kh=Wu(),PD=_D(),eL=PD.partial,tL=PD.full,ga=Rh(),nL=ID(),Go=zh(),AD=128,rL=1<<22,iL=1<<22,aL=Go("!(lo>=p0)&&!(p1>=hi)",["p0","p1"]),OD=Go("lo===p0",["p0"]),oL=Go("lo0;){l-=1;var m=l*jh,h=dr[m],g=dr[m+1],y=dr[m+2],v=dr[m+3],D=dr[m+4],I=dr[m+5],C=l*qh,x=eo[C],O=eo[C+1],A=I&1,P=!!(I&16),B=i,G=a,J=s,Q=u;if(A&&(B=s,G=u,J=i,Q=a),!(I&2&&(y=oL(e,h,g,y,B,G,O),g>=y))&&!(I&4&&(g=sL(e,h,g,y,B,G,x),g>=y))){var oe=y-g,te=D-v;if(P){if(e*oe*(oe+te){"use strict";$D.exports=yL;var ya=Xu(),sc=Rh(),hL=HD();function mL(e,t){for(var r=0;r>>1;if(!(o<=0)){var s,u=ya.mallocDouble(2*o*i),l=ya.mallocInt32(i);if(i=BD(e,o,u,l),i>0){if(o===1&&n)sc.init(i),s=sc.sweepComplete(o,r,0,i,u,l,0,i,u,l);else{var c=ya.mallocDouble(2*o*a),d=ya.mallocInt32(a);a=BD(t,o,c,d),a>0&&(sc.init(i+a),o===1?s=sc.sweepBipartite(o,r,0,i,u,l,0,a,c,d):s=hL(o,r,n,i,u,l,a,c,d),ya.free(c),ya.free(d))}ya.free(u),ya.free(l)}return s}}}var hl;function VD(e,t){hl.push([e,t])}function pL(e){return hl=[],lc(e,e,VD,!0),hl}function gL(e,t){return hl=[],lc(e,t,VD,!1),hl}function yL(e,t,r){var n;switch(arguments.length){case 1:return pL(e);case 2:return typeof t=="function"?lc(e,e,t,!0):gL(e,t);case 3:return lc(e,t,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}});var o0=wn(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});var on=require("obsidian"),Zh="YYYY-MM-DD",Qh="gggg-[W]ww",jD="YYYY-MM",qD="YYYY-[Q]Q",GD="YYYY";function pl(e){var r,n;let t=window.app.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r[e])==null?void 0:n.enabled)}function gl(){var e,t,r,n;try{let{internalPlugins:i,plugins:a}=window.app;if(pl("daily")){let{format:l,folder:c,template:d}=((t=(e=a.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:l||Zh,folder:(c==null?void 0:c.trim())||"",template:(d==null?void 0:d.trim())||""}}let{folder:o,format:s,template:u}=((n=(r=i.getPluginById("daily-notes"))==null?void 0:r.instance)==null?void 0:n.options)||{};return{format:s||Zh,folder:(o==null?void 0:o.trim())||"",template:(u==null?void 0:u.trim())||""}}catch(i){console.info("No custom daily note settings found!",i)}}function yl(){var e,t,r,n,i,a,o;try{let s=window.app.plugins,u=(e=s.getPlugin("calendar"))==null?void 0:e.options,l=(r=(t=s.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.weekly;if(pl("weekly"))return{format:l.format||Qh,folder:((n=l.folder)==null?void 0:n.trim())||"",template:((i=l.template)==null?void 0:i.trim())||""};let c=u||{};return{format:c.weeklyNoteFormat||Qh,folder:((a=c.weeklyNoteFolder)==null?void 0:a.trim())||"",template:((o=c.weeklyNoteTemplate)==null?void 0:o.trim())||""}}catch(s){console.info("No custom weekly note settings found!",s)}}function vl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("monthly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.monthly)||{};return{format:a.format||jD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom monthly note settings found!",a)}}function wl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("quarterly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.quarterly)||{};return{format:a.format||qD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom quarterly note settings found!",a)}}function bl(){var t,r,n,i;let e=window.app.plugins;try{let a=pl("yearly")&&((r=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:r.yearly)||{};return{format:a.format||GD,folder:((n=a.folder)==null?void 0:n.trim())||"",template:((i=a.template)==null?void 0:i.trim())||""}}catch(a){console.info("No custom yearly note settings found!",a)}}function JD(...e){let t=[];for(let n=0,i=e.length;n{let I=n(),C=e.clone().set({hour:I.get("hour"),minute:I.get("minute"),second:I.get("second")});return g&&C.add(parseInt(y,10),v),D?C.format(D.substring(1).trim()):C.format(a)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(a)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(a)));return t.foldManager.save(d,u),d}catch(d){console.error(`Failed to create file: '${c}'`,d),new on.Notice("Unable to create new file.")}}function AL(e,t){var r;return(r=t[ni(e,"day")])!=null?r:null}function OL(){let{vault:e}=window.app,{folder:t}=gl(),r=e.getAbstractFileByPath(on.normalizePath(t));if(!r)throw new Xh("Failed to find daily notes folder");let n={};return on.Vault.recurseChildren(r,i=>{if(i instanceof on.TFile){let a=Zo(i,"day");if(a){let o=ni(a,"day");n[o]=i}}}),n}var em=class extends Error{};function LL(){let{moment:e}=window,t=e.localeData()._week.dow,r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)r.push(r.shift()),t--;return r}function PL(e){return LL().indexOf(e.toLowerCase())}async function e0(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=yl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*title\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(c,d,m)=>{let h=PL(d);return e.weekday(h).format(m.trim())}));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function NL(e,t){var r;return(r=t[ni(e,"week")])!=null?r:null}function RL(){let e={};if(!n0())return e;let{vault:t}=window.app,{folder:r}=yl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new em("Failed to find weekly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"week");if(a){let o=ni(a,"week");e[o]=i}}}),e}var tm=class extends Error{};async function t0(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=vl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function HL(e,t){var r;return(r=t[ni(e,"month")])!=null?r:null}function BL(){let e={};if(!r0())return e;let{vault:t}=window.app,{folder:r}=vl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new tm("Failed to find monthly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"month");if(a){let o=ni(a,"month");e[o]=i}}}),e}var nm=class extends Error{};async function VL(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=wl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function $L(e,t){var r;return(r=t[ni(e,"quarter")])!=null?r:null}function UL(){let e={};if(!i0())return e;let{vault:t}=window.app,{folder:r}=wl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new nm("Failed to find quarterly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"quarter");if(a){let o=ni(a,"quarter");e[o]=i}}}),e}var rm=class extends Error{};async function WL(e){let{vault:t}=window.app,{template:r,format:n,folder:i}=bl(),[a,o]=await Jo(r),s=e.format(n),u=await Dl(i,s);try{let l=await t.create(u,a.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(c,d,m,h,g,y)=>{let v=window.moment(),D=e.clone().set({hour:v.get("hour"),minute:v.get("minute"),second:v.get("second")});return m&&D.add(parseInt(h,10),g),y?D.format(y.substring(1).trim()):D.format(n)}).replace(/{{\s*date\s*}}/gi,s).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,s));return window.app.foldManager.save(l,o),l}catch(l){console.error(`Failed to create file: '${u}'`,l),new on.Notice("Unable to create new file.")}}function YL(e,t){var r;return(r=t[ni(e,"year")])!=null?r:null}function zL(){let e={};if(!a0())return e;let{vault:t}=window.app,{folder:r}=bl(),n=t.getAbstractFileByPath(on.normalizePath(r));if(!n)throw new rm("Failed to find yearly notes folder");return on.Vault.recurseChildren(n,i=>{if(i instanceof on.TFile){let a=Zo(i,"year");if(a){let o=ni(a,"year");e[o]=i}}}),e}function KL(){var n,i;let{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let r=e.plugins.getPlugin("periodic-notes");return r&&((i=(n=r.settings)==null?void 0:n.daily)==null?void 0:i.enabled)}function n0(){var r,n;let{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;let t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.weekly)==null?void 0:n.enabled)}function r0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.monthly)==null?void 0:n.enabled)}function i0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.quarterly)==null?void 0:n.enabled)}function a0(){var r,n;let{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((n=(r=t.settings)==null?void 0:r.yearly)==null?void 0:n.enabled)}function jL(e){let t={day:gl,week:yl,month:vl,quarter:wl,year:bl}[e];return t()}function qL(e,t){return{day:XD,month:t0,week:e0}[e](t)}gt.DEFAULT_DAILY_NOTE_FORMAT=Zh;gt.DEFAULT_MONTHLY_NOTE_FORMAT=jD;gt.DEFAULT_QUARTERLY_NOTE_FORMAT=qD;gt.DEFAULT_WEEKLY_NOTE_FORMAT=Qh;gt.DEFAULT_YEARLY_NOTE_FORMAT=GD;gt.appHasDailyNotesPluginLoaded=KL;gt.appHasMonthlyNotesPluginLoaded=r0;gt.appHasQuarterlyNotesPluginLoaded=i0;gt.appHasWeeklyNotesPluginLoaded=n0;gt.appHasYearlyNotesPluginLoaded=a0;gt.createDailyNote=XD;gt.createMonthlyNote=t0;gt.createPeriodicNote=qL;gt.createQuarterlyNote=VL;gt.createWeeklyNote=e0;gt.createYearlyNote=WL;gt.getAllDailyNotes=OL;gt.getAllMonthlyNotes=BL;gt.getAllQuarterlyNotes=UL;gt.getAllWeeklyNotes=RL;gt.getAllYearlyNotes=zL;gt.getDailyNote=AL;gt.getDailyNoteSettings=gl;gt.getDateFromFile=Zo;gt.getDateFromPath=IL;gt.getDateUID=ni;gt.getMonthlyNote=HL;gt.getMonthlyNoteSettings=vl;gt.getPeriodicNoteSettings=jL;gt.getQuarterlyNote=$L;gt.getQuarterlyNoteSettings=wl;gt.getTemplateInfo=Jo;gt.getWeeklyNote=NL;gt.getWeeklyNoteSettings=yl;gt.getYearlyNote=YL;gt.getYearlyNoteSettings=bl});var Ic=wn(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});require("obsidian");var qi=class extends Error{},fm=class extends qi{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}},hm=class extends qi{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}},mm=class extends qi{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}},ro=class extends qi{},yc=class extends qi{constructor(t){super(`Invalid unit ${t}`)}},vr=class extends qi{},Di=class extends qi{constructor(){super("Zone is an abstract class")}},_e="numeric",oi="short",Or="long",vc={year:_e,month:_e,day:_e},H0={year:_e,month:oi,day:_e},GL={year:_e,month:oi,day:_e,weekday:oi},B0={year:_e,month:Or,day:_e},V0={year:_e,month:Or,day:_e,weekday:Or},$0={hour:_e,minute:_e},U0={hour:_e,minute:_e,second:_e},W0={hour:_e,minute:_e,second:_e,timeZoneName:oi},Y0={hour:_e,minute:_e,second:_e,timeZoneName:Or},z0={hour:_e,minute:_e,hourCycle:"h23"},K0={hour:_e,minute:_e,second:_e,hourCycle:"h23"},j0={hour:_e,minute:_e,second:_e,hourCycle:"h23",timeZoneName:oi},q0={hour:_e,minute:_e,second:_e,hourCycle:"h23",timeZoneName:Or},G0={year:_e,month:_e,day:_e,hour:_e,minute:_e},J0={year:_e,month:_e,day:_e,hour:_e,minute:_e,second:_e},Z0={year:_e,month:oi,day:_e,hour:_e,minute:_e},Q0={year:_e,month:oi,day:_e,hour:_e,minute:_e,second:_e},JL={year:_e,month:oi,day:_e,weekday:oi,hour:_e,minute:_e},X0={year:_e,month:Or,day:_e,hour:_e,minute:_e,timeZoneName:oi},eS={year:_e,month:Or,day:_e,hour:_e,minute:_e,second:_e,timeZoneName:oi},tS={year:_e,month:Or,day:_e,weekday:Or,hour:_e,minute:_e,timeZoneName:Or},nS={year:_e,month:Or,day:_e,weekday:Or,hour:_e,minute:_e,second:_e,timeZoneName:Or},oo=class{get type(){throw new Di}get name(){throw new Di}get ianaName(){return this.name}get isUniversal(){throw new Di}offsetName(t,r){throw new Di}formatOffset(t,r){throw new Di}offset(t){throw new Di}equals(t){throw new Di}get isValid(){throw new Di}},im=null,wc=class e extends oo{static get instance(){return im===null&&(im=new e),im}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:r,locale:n}){return iS(t,r,n)}formatOffset(t,r){return _l(this.offset(t),r)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}},pc={};function ZL(e){return pc[e]||(pc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),pc[e]}var QL={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function XL(e,t){let r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,a,o,s,u,l,c]=n;return[o,i,a,s,u,l,c]}function e2(e,t){let r=e.formatToParts(t),n=[];for(let i=0;i=0?g:1e3+g,(m-h)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}},s0={};function t2(e,t={}){let r=JSON.stringify([e,t]),n=s0[r];return n||(n=new Intl.ListFormat(e,t),s0[r]=n),n}var pm={};function gm(e,t={}){let r=JSON.stringify([e,t]),n=pm[r];return n||(n=new Intl.DateTimeFormat(e,t),pm[r]=n),n}var ym={};function n2(e,t={}){let r=JSON.stringify([e,t]),n=ym[r];return n||(n=new Intl.NumberFormat(e,t),ym[r]=n),n}var vm={};function r2(e,t={}){let{base:r,...n}=t,i=JSON.stringify([e,n]),a=vm[i];return a||(a=new Intl.RelativeTimeFormat(e,t),vm[i]=a),a}var xl=null;function i2(){return xl||(xl=new Intl.DateTimeFormat().resolvedOptions().locale,xl)}function a2(e){let t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));let r=e.indexOf("-u-");if(r===-1)return[e];{let n,i;try{n=gm(e).resolvedOptions(),i=e}catch(s){let u=e.substring(0,r);n=gm(u).resolvedOptions(),i=u}let{numberingSystem:a,calendar:o}=n;return[i,a,o]}}function o2(e,t,r){return(r||t)&&(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`)),e}function s2(e){let t=[];for(let r=1;r<=12;r++){let n=mt.utc(2009,r,1);t.push(e(n))}return t}function l2(e){let t=[];for(let r=1;r<=7;r++){let n=mt.utc(2016,11,13+r);t.push(e(n))}return t}function cc(e,t,r,n){let i=e.listingMode();return i==="error"?null:i==="en"?r(t):n(t)}function u2(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}var wm=class{constructor(t,r,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:i,floor:a,...o}=n;if(!r||Object.keys(o).length>0){let s={useGrouping:!1,...n};n.padTo>0&&(s.minimumIntegerDigits=n.padTo),this.inf=n2(t,s)}}format(t){if(this.inf){let r=this.floor?Math.floor(t):t;return this.inf.format(r)}else{let r=this.floor?Math.floor(t):Om(t,3);return Tn(r,this.padTo)}}},bm=class{constructor(t,r,n){this.opts=n,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){let o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&Da.create(s).valid?(i=s,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);let a={...this.opts};a.timeZone=a.timeZone||i,this.dtf=gm(r,a)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){let t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(r=>{if(r.type==="timeZoneName"){let n=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...r,value:n}}else return r}):t}resolvedOptions(){return this.dtf.resolvedOptions()}},Dm=class{constructor(t,r,n){this.opts={style:"long",...n},!r&&rS()&&(this.rtf=r2(t,n))}format(t,r){return this.rtf?this.rtf.format(t,r):x2(r,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,r){return this.rtf?this.rtf.formatToParts(t,r):[]}},mn=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,r,n,i=!1){let a=t||hn.defaultLocale,o=a||(i?"en-US":i2()),s=r||hn.defaultNumberingSystem,u=n||hn.defaultOutputCalendar;return new e(o,s,u,a)}static resetCache(){xl=null,pm={},ym={},vm={}}static fromObject({locale:t,numberingSystem:r,outputCalendar:n}={}){return e.create(t,r,n)}constructor(t,r,n,i){let[a,o,s]=a2(t);this.locale=a,this.numberingSystem=r||o||null,this.outputCalendar=n||s||null,this.intl=o2(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=u2(this)),this.fastNumbersCached}listingMode(){let t=this.isEnglish(),r=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&r?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,r=!1){return cc(this,t,sS,()=>{let n=r?{month:t,day:"numeric"}:{month:t},i=r?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=s2(a=>this.extract(a,n,"month"))),this.monthsCache[i][t]})}weekdays(t,r=!1){return cc(this,t,cS,()=>{let n=r?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=r?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=l2(a=>this.extract(a,n,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return cc(this,void 0,()=>dS,()=>{if(!this.meridiemCache){let t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[mt.utc(2016,11,13,9),mt.utc(2016,11,13,19)].map(r=>this.extract(r,t,"dayperiod"))}return this.meridiemCache})}eras(t){return cc(this,t,fS,()=>{let r={era:t};return this.eraCache[t]||(this.eraCache[t]=[mt.utc(-40,1,1),mt.utc(2017,1,1)].map(n=>this.extract(n,r,"era"))),this.eraCache[t]})}extract(t,r,n){let i=this.dtFormatter(t,r),a=i.formatToParts(),o=a.find(s=>s.type.toLowerCase()===n);return o?o.value:null}numberFormatter(t={}){return new wm(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,r={}){return new bm(t,this.intl,r)}relFormatter(t={}){return new Dm(this.intl,this.isEnglish(),t)}listFormatter(t={}){return t2(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}},am=null,Kr=class e extends oo{static get utcInstance(){return am===null&&(am=new e(0)),am}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let r=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(r)return new e(Tc(r[1],r[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${_l(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${_l(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,r){return _l(this.fixed,r)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}},Sm=class extends oo{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function ba(e,t){if(kt(e)||e===null)return t;if(e instanceof oo)return e;if(c2(e)){let r=e.toLowerCase();return r==="default"?t:r==="local"||r==="system"?wc.instance:r==="utc"||r==="gmt"?Kr.utcInstance:Kr.parseSpecifier(r)||Da.create(e)}else return ao(e)?Kr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Sm(e)}var l0=()=>Date.now(),u0="system",c0=null,d0=null,f0=null,h0=60,m0,hn=class{static get now(){return l0}static set now(t){l0=t}static set defaultZone(t){u0=t}static get defaultZone(){return ba(u0,wc.instance)}static get defaultLocale(){return c0}static set defaultLocale(t){c0=t}static get defaultNumberingSystem(){return d0}static set defaultNumberingSystem(t){d0=t}static get defaultOutputCalendar(){return f0}static set defaultOutputCalendar(t){f0=t}static get twoDigitCutoffYear(){return h0}static set twoDigitCutoffYear(t){h0=t%100}static get throwOnInvalid(){return m0}static set throwOnInvalid(t){m0=t}static resetCaches(){mn.resetCache(),Da.resetCache()}};function kt(e){return typeof e=="undefined"}function ao(e){return typeof e=="number"}function _c(e){return typeof e=="number"&&e%1===0}function c2(e){return typeof e=="string"}function d2(e){return Object.prototype.toString.call(e)==="[object Date]"}function rS(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function f2(e){return Array.isArray(e)?e:[e]}function p0(e,t,r){if(e.length!==0)return e.reduce((n,i)=>{let a=[t(i),i];return n&&r(n[0],a[0])===n[0]?n:a},null)[1]}function h2(e,t){return t.reduce((r,n)=>(r[n]=e[n],r),{})}function rs(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ji(e,t,r){return _c(e)&&e>=t&&e<=r}function m2(e,t){return e-t*Math.floor(e/t)}function Tn(e,t=2){let r=e<0,n;return r?n="-"+(""+-e).padStart(t,"0"):n=(""+e).padStart(t,"0"),n}function wa(e){if(!(kt(e)||e===null||e===""))return parseInt(e,10)}function to(e){if(!(kt(e)||e===null||e===""))return parseFloat(e)}function Am(e){if(!(kt(e)||e===null||e==="")){let t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Om(e,t,r=!1){let n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function Fl(e){return e%4===0&&(e%100!==0||e%400===0)}function Cl(e){return Fl(e)?366:365}function bc(e,t){let r=m2(t-1,12)+1,n=e+(t-r)/12;return r===2?Fl(n)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function Mc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Dc(e){let t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,r=e-1,n=(r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400))%7;return t===4||n===3?53:52}function Em(e){return e>99?e:e>hn.twoDigitCutoffYear?1900+e:2e3+e}function iS(e,t,r,n=null){let i=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(a.timeZone=n);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(r,o).formatToParts(i).find(u=>u.type.toLowerCase()==="timezonename");return s?s.value:null}function Tc(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);let n=parseInt(t,10)||0,i=r<0||Object.is(r,-0)?-n:n;return r*60+i}function aS(e){let t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vr(`Invalid unit value ${e}`);return t}function Sc(e,t){let r={};for(let n in e)if(rs(e,n)){let i=e[n];if(i==null)continue;r[t(n)]=aS(i)}return r}function _l(e,t){let r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Tn(r,2)}:${Tn(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${Tn(r,2)}${Tn(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Fc(e){return h2(e,["hour","minute","second","millisecond"])}var p2=["January","February","March","April","May","June","July","August","September","October","November","December"],oS=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g2=["J","F","M","A","M","J","J","A","S","O","N","D"];function sS(e){switch(e){case"narrow":return[...g2];case"short":return[...oS];case"long":return[...p2];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var lS=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],uS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],y2=["M","T","W","T","F","S","S"];function cS(e){switch(e){case"narrow":return[...y2];case"short":return[...uS];case"long":return[...lS];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var dS=["AM","PM"],v2=["Before Christ","Anno Domini"],w2=["BC","AD"],b2=["B","A"];function fS(e){switch(e){case"narrow":return[...b2];case"short":return[...w2];case"long":return[...v2];default:return null}}function D2(e){return dS[e.hour<12?0:1]}function S2(e,t){return cS(t)[e.weekday-1]}function E2(e,t){return sS(t)[e.month-1]}function k2(e,t){return fS(t)[e.year<0?0:1]}function x2(e,t,r="always",n=!1){let i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(e)===-1;if(r==="auto"&&a){let d=e==="days";switch(t){case 1:return d?"tomorrow":`next ${i[e][0]}`;case-1:return d?"yesterday":`last ${i[e][0]}`;case 0:return d?"today":`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),u=s===1,l=i[e],c=n?u?l[1]:l[2]||l[1]:u?i[e][0]:e;return o?`${s} ${c} ago`:`in ${s} ${c}`}function g0(e,t){let r="";for(let n of e)n.literal?r+=n.val:r+=t(n.val);return r}var C2={D:vc,DD:H0,DDD:B0,DDDD:V0,t:$0,tt:U0,ttt:W0,tttt:Y0,T:z0,TT:K0,TTT:j0,TTTT:q0,f:G0,ff:Z0,fff:X0,ffff:tS,F:J0,FF:Q0,FFF:eS,FFFF:nS},Ir=class e{static create(t,r={}){return new e(t,r)}static parseFormat(t){let r=null,n="",i=!1,a=[];for(let o=0;o0&&a.push({literal:i||/^\s+$/.test(n),val:n}),r=null,n="",i=!i):i||s===r?n+=s:(n.length>0&&a.push({literal:/^\s+$/.test(n),val:n}),n=s,r=s)}return n.length>0&&a.push({literal:i||/^\s+$/.test(n),val:n}),a}static macroTokenToFormatOpts(t){return C2[t]}constructor(t,r){this.opts=r,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,r){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...r}).format()}dtFormatter(t,r={}){return this.loc.dtFormatter(t,{...this.opts,...r})}formatDateTime(t,r){return this.dtFormatter(t,r).format()}formatDateTimeParts(t,r){return this.dtFormatter(t,r).formatToParts()}formatInterval(t,r){return this.dtFormatter(t.start,r).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,r){return this.dtFormatter(t,r).resolvedOptions()}num(t,r=0){if(this.opts.forceSimple)return Tn(t,r);let n={...this.opts};return r>0&&(n.padTo=r),this.loc.numberFormatter(n).format(t)}formatDateTimeFromString(t,r){let n=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(h,g)=>this.loc.extract(t,h,g),o=h=>t.isOffsetFixed&&t.offset===0&&h.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,h.format):"",s=()=>n?D2(t):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),u=(h,g)=>n?E2(t,h):a(g?{month:h}:{month:h,day:"numeric"},"month"),l=(h,g)=>n?S2(t,h):a(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),c=h=>{let g=e.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(t,g):h},d=h=>n?k2(t,h):a({era:h},"era"),m=h=>{switch(h){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return i?a({day:"numeric"},"day"):this.num(t.day);case"dd":return i?a({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?a({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?a({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return u("short",!0);case"LLLL":return u("long",!0);case"LLLLL":return u("narrow",!0);case"M":return i?a({month:"numeric"},"month"):this.num(t.month);case"MM":return i?a({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return u("short",!1);case"MMMM":return u("long",!1);case"MMMMM":return u("narrow",!1);case"y":return i?a({year:"numeric"},"year"):this.num(t.year);case"yy":return i?a({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?a({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?a({year:"numeric"},"year"):this.num(t.year,6);case"G":return d("short");case"GG":return d("long");case"GGGGG":return d("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return c(h)}};return g0(e.parseFormat(r),m)}formatDurationFromString(t,r){let n=u=>{switch(u[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=u=>l=>{let c=n(l);return c?this.num(u.get(c),l.length):l},a=e.parseFormat(r),o=a.reduce((u,{literal:l,val:c})=>l?u:u.concat(c),[]),s=t.shiftTo(...o.map(n).filter(u=>u));return g0(a,i(s))}},Ar=class{constructor(t,r){this.reason=t,this.explanation=r}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},hS=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function is(...e){let t=e.reduce((r,n)=>r+n.source,"");return RegExp(`^${t}$`)}function as(...e){return t=>e.reduce(([r,n,i],a)=>{let[o,s,u]=a(t,i);return[{...r,...o},s||n,u]},[{},null,1]).slice(0,2)}function os(e,...t){if(e==null)return[null,null];for(let[r,n]of t){let i=r.exec(e);if(i)return n(i)}return[null,null]}function mS(...e){return(t,r)=>{let n={},i;for(i=0;ih!==void 0&&(g||h&&c)?-h:h;return[{years:m(to(r)),months:m(to(n)),weeks:m(to(i)),days:m(to(a)),hours:m(to(o)),minutes:m(to(s)),seconds:m(to(u),u==="-0"),milliseconds:m(Am(l),d)}]}var B2={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Nm(e,t,r,n,i,a,o){let s={year:t.length===2?Em(wa(t)):wa(t),month:oS.indexOf(r)+1,day:wa(n),hour:wa(i),minute:wa(a)};return o&&(s.second=wa(o)),e&&(s.weekday=e.length>3?lS.indexOf(e)+1:uS.indexOf(e)+1),s}var V2=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function $2(e){let[,t,r,n,i,a,o,s,u,l,c,d]=e,m=Nm(t,i,n,r,a,o,s),h;return u?h=B2[u]:l?h=0:h=Tc(c,d),[m,new Kr(h)]}function U2(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}var W2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Y2=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,z2=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function y0(e){let[,t,r,n,i,a,o,s]=e;return[Nm(t,i,n,r,a,o,s),Kr.utcInstance]}function K2(e){let[,t,r,n,i,a,o,s]=e;return[Nm(t,s,r,n,i,a,o),Kr.utcInstance]}var j2=is(M2,Pm),q2=is(T2,Pm),G2=is(F2,Pm),J2=is(gS),vS=as(P2,ss,Il,Al),Z2=as(I2,ss,Il,Al),Q2=as(A2,ss,Il,Al),X2=as(ss,Il,Al);function eP(e){return os(e,[j2,vS],[q2,Z2],[G2,Q2],[J2,X2])}function tP(e){return os(U2(e),[V2,$2])}function nP(e){return os(e,[W2,y0],[Y2,y0],[z2,K2])}function rP(e){return os(e,[R2,H2])}var iP=as(ss);function aP(e){return os(e,[N2,iP])}var oP=is(O2,L2),sP=is(yS),lP=as(ss,Il,Al);function uP(e){return os(e,[oP,vS],[sP,lP])}var v0="Invalid Duration",wS={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},cP={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...wS},Yr=146097/400,Qo=146097/4800,dP={years:{quarters:4,months:12,weeks:Yr/7,days:Yr,hours:Yr*24,minutes:Yr*24*60,seconds:Yr*24*60*60,milliseconds:Yr*24*60*60*1e3},quarters:{months:3,weeks:Yr/28,days:Yr/4,hours:Yr*24/4,minutes:Yr*24*60/4,seconds:Yr*24*60*60/4,milliseconds:Yr*24*60*60*1e3/4},months:{weeks:Qo/7,days:Qo,hours:Qo*24,minutes:Qo*24*60,seconds:Qo*24*60*60,milliseconds:Qo*24*60*60*1e3},...wS},io=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],fP=io.slice(0).reverse();function va(e,t,r=!1){let n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new He(n)}function bS(e,t){var n;let r=(n=t.milliseconds)!=null?n:0;for(let i of fP.slice(1))t[i]&&(r+=t[i]*e[i].milliseconds);return r}function w0(e,t){let r=bS(e,t)<0?-1:1;io.reduceRight((n,i)=>{if(kt(t[i]))return n;if(n){let a=t[n]*r,o=e[i][n],s=Math.floor(a/o);t[i]+=s*r,t[n]-=s*o*r}return i},null),io.reduce((n,i)=>{if(kt(t[i]))return n;if(n){let a=t[n]%1;t[n]-=a,t[i]+=a*e[n][i]}return i},null)}function hP(e){let t={};for(let[r,n]of Object.entries(e))n!==0&&(t[r]=n);return t}var He=class e{constructor(t){let r=t.conversionAccuracy==="longterm"||!1,n=r?dP:cP;t.matrix&&(n=t.matrix),this.values=t.values,this.loc=t.loc||mn.create(),this.conversionAccuracy=r?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,r){return e.fromObject({milliseconds:t},r)}static fromObject(t,r={}){if(t==null||typeof t!="object")throw new vr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new e({values:Sc(t,e.normalizeUnit),loc:mn.fromObject(r),conversionAccuracy:r.conversionAccuracy,matrix:r.matrix})}static fromDurationLike(t){if(ao(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t=="object")return e.fromObject(t);throw new vr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,r){let[n]=rP(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,r){let[n]=aP(t);return n?e.fromObject(n,r):e.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,r=null){if(!t)throw new vr("need to specify a reason the Duration is invalid");let n=t instanceof Ar?t:new Ar(t,r);if(hn.throwOnInvalid)throw new mm(n);return new e({invalid:n})}static normalizeUnit(t){let r={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!r)throw new yc(t);return r}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,r={}){let n={...r,floor:r.round!==!1&&r.floor!==!1};return this.isValid?Ir.create(this.loc,n).formatDurationFromString(this,t):v0}toHuman(t={}){if(!this.isValid)return v0;let r=io.map(n=>{let i=this.values[n];return kt(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:n.slice(0,-1)}).format(i)}).filter(n=>n);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Om(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;let r=this.toMillis();return r<0||r>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},mt.fromMillis(r,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.isValid?bS(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t),n={};for(let i of io)(rs(r.values,i)||rs(this.values,i))&&(n[i]=r.get(i)+this.get(i));return va(this,{values:n},!0)}minus(t){if(!this.isValid)return this;let r=e.fromDurationLike(t);return this.plus(r.negate())}mapUnits(t){if(!this.isValid)return this;let r={};for(let n of Object.keys(this.values))r[n]=aS(t(this.values[n],n));return va(this,{values:r},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let r={...this.values,...Sc(t,e.normalizeUnit)};return va(this,{values:r})}reconfigure({locale:t,numberingSystem:r,conversionAccuracy:n,matrix:i}={}){let o={loc:this.loc.clone({locale:t,numberingSystem:r}),matrix:i,conversionAccuracy:n};return va(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;let t=this.toObject();return w0(this.matrix,t),va(this,{values:t},!0)}rescale(){if(!this.isValid)return this;let t=hP(this.normalize().shiftToAll().toObject());return va(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>e.normalizeUnit(o));let r={},n={},i=this.toObject(),a;for(let o of io)if(t.indexOf(o)>=0){a=o;let s=0;for(let l in n)s+=this.matrix[l][o]*n[l],n[l]=0;ao(i[o])&&(s+=i[o]);let u=Math.trunc(s);r[o]=u,n[o]=(s*1e3-u*1e3)/1e3}else ao(i[o])&&(n[o]=i[o]);for(let o in n)n[o]!==0&&(r[a]+=o===a?n[o]:n[o]/this.matrix[a][o]);return w0(this.matrix,r),va(this,{values:r},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;let t={};for(let r of Object.keys(this.values))t[r]=this.values[r]===0?0:-this.values[r];return va(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function r(n,i){return n===void 0||n===0?i===void 0||i===0:n===i}for(let n of io)if(!r(this.values[n],t.values[n]))return!1;return!0}},Xo="Invalid Interval";function mP(e,t){return!e||!e.isValid?ns.invalid("missing or invalid start"):!t||!t.isValid?ns.invalid("missing or invalid end"):tt:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:r}={}){return this.isValid?e.fromDateTimes(t||this.s,r||this.e):this}splitAt(...t){if(!this.isValid)return[];let r=t.map(El).filter(o=>this.contains(o)).sort(),n=[],{s:i}=this,a=0;for(;i+this.e?this.e:o;n.push(e.fromDateTimes(i,s)),i=s,a+=1}return n}splitBy(t){let r=He.fromDurationLike(t);if(!this.isValid||!r.isValid||r.as("milliseconds")===0)return[];let{s:n}=this,i=1,a,o=[];for(;nu*i));a=+s>+this.e?this.e:s,o.push(e.fromDateTimes(n,a)),n=a,i+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;let r=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(r,n)}union(t){if(!this.isValid)return this;let r=this.st.e?this.e:t.e;return e.fromDateTimes(r,n)}static merge(t){let[r,n]=t.sort((i,a)=>i.s-a.s).reduce(([i,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[i,a.union(o)]:[i.concat([a]),o]:[i,o],[[],null]);return n&&r.push(n),r}static xor(t){let r=null,n=0,i=[],a=t.map(u=>[{time:u.s,type:"s"},{time:u.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((u,l)=>u.time-l.time);for(let u of s)n+=u.type==="s"?1:-1,n===1?r=u.time:(r&&+r!=+u.time&&i.push(e.fromDateTimes(r,u.time)),r=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(r=>this.intersection(r)).filter(r=>r&&!r.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Xo}toLocaleString(t=vc,r={}){return this.isValid?Ir.create(this.s.loc.clone(r),t).formatInterval(this):Xo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Xo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Xo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Xo}toFormat(t,{separator:r=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(t)}${r}${this.e.toFormat(t)}`:Xo}toDuration(t,r){return this.isValid?this.e.diff(this.s,t,r):He.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},es=class{static hasDST(t=hn.defaultZone){let r=mt.now().setZone(t).set({month:12});return!t.isUniversal&&r.offset!==r.set({month:6}).offset}static isValidIANAZone(t){return Da.isValidZone(t)}static normalizeZone(t){return ba(t,hn.defaultZone)}static months(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||mn.create(r,n,a)).months(t)}static monthsFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||mn.create(r,n,a)).months(t,!0)}static weekdays(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||mn.create(r,n,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:r=null,numberingSystem:n=null,locObj:i=null}={}){return(i||mn.create(r,n,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return mn.create(t).meridiems()}static eras(t="short",{locale:r=null}={}){return mn.create(r,null,"gregory").eras(t)}static features(){return{relative:rS()}}};function b0(e,t){let r=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(He.fromMillis(n).as("days"))}function pP(e,t,r){let n=[["years",(u,l)=>l.year-u.year],["quarters",(u,l)=>l.quarter-u.quarter+(l.year-u.year)*4],["months",(u,l)=>l.month-u.month+(l.year-u.year)*12],["weeks",(u,l)=>{let c=b0(u,l);return(c-c%7)/7}],["days",b0]],i={},a=e,o,s;for(let[u,l]of n)r.indexOf(u)>=0&&(o=u,i[u]=l(e,t),s=a.plus(i),s>t?(i[u]--,e=a.plus(i),e>t&&(s=e,i[u]--,e=a.plus(i))):e=s);return[e,i,s,o]}function gP(e,t,r,n){let[i,a,o,s]=pP(e,t,r),u=t-i,l=r.filter(d=>["hours","minutes","seconds","milliseconds"].indexOf(d)>=0);l.length===0&&(o0?He.fromMillis(u,n).shiftTo(...l).plus(c):c}var Rm={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},D0={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},yP=Rm.hanidec.replace(/[\[|\]]/g,"").split("");function vP(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r=a&&n<=o&&(t+=n-a)}}return parseInt(t,10)}else return t}function ri({numberingSystem:e},t=""){return new RegExp(`${Rm[e||"latn"]}${t}`)}var wP="missing Intl.DateTimeFormat.formatToParts support";function Nt(e,t=r=>r){return{regex:e,deser:([r])=>t(vP(r))}}var bP="\xA0",DS=`[ ${bP}]`,SS=new RegExp(DS,"g");function DP(e){return e.replace(/\./g,"\\.?").replace(SS,DS)}function S0(e){return e.replace(/\./g,"").replace(SS," ").toLowerCase()}function ii(e,t){return e===null?null:{regex:RegExp(e.map(DP).join("|")),deser:([r])=>e.findIndex(n=>S0(r)===S0(n))+t}}function E0(e,t){return{regex:e,deser:([,r,n])=>Tc(r,n),groups:t}}function dc(e){return{regex:e,deser:([t])=>t}}function SP(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function EP(e,t){let r=ri(t),n=ri(t,"{2}"),i=ri(t,"{3}"),a=ri(t,"{4}"),o=ri(t,"{6}"),s=ri(t,"{1,2}"),u=ri(t,"{1,3}"),l=ri(t,"{1,6}"),c=ri(t,"{1,9}"),d=ri(t,"{2,4}"),m=ri(t,"{4,6}"),h=v=>({regex:RegExp(SP(v.val)),deser:([D])=>D,literal:!0}),y=(v=>{if(e.literal)return h(v);switch(v.val){case"G":return ii(t.eras("short"),0);case"GG":return ii(t.eras("long"),0);case"y":return Nt(l);case"yy":return Nt(d,Em);case"yyyy":return Nt(a);case"yyyyy":return Nt(m);case"yyyyyy":return Nt(o);case"M":return Nt(s);case"MM":return Nt(n);case"MMM":return ii(t.months("short",!0),1);case"MMMM":return ii(t.months("long",!0),1);case"L":return Nt(s);case"LL":return Nt(n);case"LLL":return ii(t.months("short",!1),1);case"LLLL":return ii(t.months("long",!1),1);case"d":return Nt(s);case"dd":return Nt(n);case"o":return Nt(u);case"ooo":return Nt(i);case"HH":return Nt(n);case"H":return Nt(s);case"hh":return Nt(n);case"h":return Nt(s);case"mm":return Nt(n);case"m":return Nt(s);case"q":return Nt(s);case"qq":return Nt(n);case"s":return Nt(s);case"ss":return Nt(n);case"S":return Nt(u);case"SSS":return Nt(i);case"u":return dc(c);case"uu":return dc(s);case"uuu":return Nt(r);case"a":return ii(t.meridiems(),0);case"kkkk":return Nt(a);case"kk":return Nt(d,Em);case"W":return Nt(s);case"WW":return Nt(n);case"E":case"c":return Nt(r);case"EEE":return ii(t.weekdays("short",!1),1);case"EEEE":return ii(t.weekdays("long",!1),1);case"ccc":return ii(t.weekdays("short",!0),1);case"cccc":return ii(t.weekdays("long",!0),1);case"Z":case"ZZ":return E0(new RegExp(`([+-]${s.source})(?::(${n.source}))?`),2);case"ZZZ":return E0(new RegExp(`([+-]${s.source})(${n.source})?`),2);case"z":return dc(/[a-z_+-/]{1,256}?/i);case" ":return dc(/[^\S\n\r]/);default:return h(v)}})(e)||{invalidReason:wP};return y.token=e,y}var kP={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function xP(e,t,r){let{type:n,value:i}=e;if(n==="literal"){let u=/^\s+$/.test(i);return{literal:!u,val:u?" ":i}}let a=t[n],o=n;n==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=r.hour12?"hour12":"hour24");let s=kP[o];if(typeof s=="object"&&(s=s[a]),s)return{literal:!1,val:s}}function CP(e){return[`^${e.map(r=>r.regex).reduce((r,n)=>`${r}(${n.source})`,"")}$`,e]}function _P(e,t,r){let n=e.match(t);if(n){let i={},a=1;for(let o in r)if(rs(r,o)){let s=r[o],u=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(n.slice(a,a+u))),a+=u}return[n,i]}else return[n,{}]}function MP(e){let t=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}},r=null,n;return kt(e.z)||(r=Da.create(e.z)),kt(e.Z)||(r||(r=new Kr(e.Z)),n=e.Z),kt(e.q)||(e.M=(e.q-1)*3+1),kt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),kt(e.u)||(e.S=Am(e.u)),[Object.keys(e).reduce((a,o)=>{let s=t(o);return s&&(a[s]=e[o]),a},{}),r,n]}var om=null;function TP(){return om||(om=mt.fromMillis(1555555555555)),om}function FP(e,t){if(e.literal)return e;let r=Ir.macroTokenToFormatOpts(e.val),n=xS(r,t);return n==null||n.includes(void 0)?e:n}function ES(e,t){return Array.prototype.concat(...e.map(r=>FP(r,t)))}function kS(e,t,r){let n=ES(Ir.parseFormat(r),e),i=n.map(o=>EP(o,e)),a=i.find(o=>o.invalidReason);if(a)return{input:t,tokens:n,invalidReason:a.invalidReason};{let[o,s]=CP(i),u=RegExp(o,"i"),[l,c]=_P(t,u,s),[d,m,h]=c?MP(c):[null,null,void 0];if(rs(c,"a")&&rs(c,"H"))throw new ro("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:u,rawMatches:l,matches:c,result:d,zone:m,specificOffset:h}}}function IP(e,t,r){let{result:n,zone:i,specificOffset:a,invalidReason:o}=kS(e,t,r);return[n,i,a,o]}function xS(e,t){if(!e)return null;let n=Ir.create(t,e).dtFormatter(TP()),i=n.formatToParts(),a=n.resolvedOptions();return i.map(o=>xP(o,e,a))}var CS=[0,31,59,90,120,151,181,212,243,273,304,334],_S=[0,31,60,91,121,152,182,213,244,274,305,335];function zr(e,t){return new Ar("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function MS(e,t,r){let n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);let i=n.getUTCDay();return i===0?7:i}function TS(e,t,r){return r+(Fl(e)?_S:CS)[t-1]}function FS(e,t){let r=Fl(e)?_S:CS,n=r.findIndex(a=>aDc(t)?(s=t+1,o=1):s=t,{weekYear:s,weekNumber:o,weekday:a,...Fc(e)}}function k0(e){let{weekYear:t,weekNumber:r,weekday:n}=e,i=MS(t,1,4),a=Cl(t),o=r*7+n-i-3,s;o<1?(s=t-1,o+=Cl(s)):o>a?(s=t+1,o-=Cl(t)):s=t;let{month:u,day:l}=FS(s,o);return{year:s,month:u,day:l,...Fc(e)}}function sm(e){let{year:t,month:r,day:n}=e,i=TS(t,r,n);return{year:t,ordinal:i,...Fc(e)}}function x0(e){let{year:t,ordinal:r}=e,{month:n,day:i}=FS(t,r);return{year:t,month:n,day:i,...Fc(e)}}function AP(e){let t=_c(e.weekYear),r=ji(e.weekNumber,1,Dc(e.weekYear)),n=ji(e.weekday,1,7);return t?r?n?!1:zr("weekday",e.weekday):zr("week",e.week):zr("weekYear",e.weekYear)}function OP(e){let t=_c(e.year),r=ji(e.ordinal,1,Cl(e.year));return t?r?!1:zr("ordinal",e.ordinal):zr("year",e.year)}function IS(e){let t=_c(e.year),r=ji(e.month,1,12),n=ji(e.day,1,bc(e.year,e.month));return t?r?n?!1:zr("day",e.day):zr("month",e.month):zr("year",e.year)}function AS(e){let{hour:t,minute:r,second:n,millisecond:i}=e,a=ji(t,0,23)||t===24&&r===0&&n===0&&i===0,o=ji(r,0,59),s=ji(n,0,59),u=ji(i,0,999);return a?o?s?u?!1:zr("millisecond",i):zr("second",n):zr("minute",r):zr("hour",t)}var lm="Invalid DateTime",C0=864e13;function fc(e){return new Ar("unsupported zone",`the zone "${e.name}" is not supported`)}function um(e){return e.weekData===null&&(e.weekData=km(e.c)),e.weekData}function no(e,t){let r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new mt({...r,...t,old:r})}function OS(e,t,r){let n=e-t*60*1e3,i=r.offset(n);if(t===i)return[n,t];n-=(i-t)*60*1e3;let a=r.offset(n);return i===a?[n,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function hc(e,t){e+=t*60*1e3;let r=new Date(e);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function gc(e,t,r){return OS(Mc(e),t,r)}function _0(e,t){let r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:n,month:i,day:Math.min(e.c.day,bc(n,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=He.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Mc(a),[u,l]=OS(s,r,e.zone);return o!==0&&(u+=o,l=e.zone.offset(u)),{ts:u,o:l}}function Sl(e,t,r,n,i,a){let{setZone:o,zone:s}=r;if(e&&Object.keys(e).length!==0||t){let u=t||s,l=mt.fromObject(e,{...r,zone:u,specificOffset:a});return o?l:l.setZone(s)}else return mt.invalid(new Ar("unparsable",`the input "${i}" can't be parsed as ${n}`))}function mc(e,t,r=!0){return e.isValid?Ir.create(mn.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function cm(e,t){let r=e.c.year>9999||e.c.year<0,n="";return r&&e.c.year>=0&&(n+="+"),n+=Tn(e.c.year,r?6:4),t?(n+="-",n+=Tn(e.c.month),n+="-",n+=Tn(e.c.day)):(n+=Tn(e.c.month),n+=Tn(e.c.day)),n}function M0(e,t,r,n,i,a){let o=Tn(e.c.hour);return t?(o+=":",o+=Tn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=":")):o+=Tn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!r)&&(o+=Tn(e.c.second),(e.c.millisecond!==0||!n)&&(o+=".",o+=Tn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!a?o+="Z":e.o<0?(o+="-",o+=Tn(Math.trunc(-e.o/60)),o+=":",o+=Tn(Math.trunc(-e.o%60))):(o+="+",o+=Tn(Math.trunc(e.o/60)),o+=":",o+=Tn(Math.trunc(e.o%60)))),a&&(o+="["+e.zone.ianaName+"]"),o}var LS={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},LP={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},PP={ordinal:1,hour:0,minute:0,second:0,millisecond:0},PS=["year","month","day","hour","minute","second","millisecond"],NP=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],RP=["year","ordinal","hour","minute","second","millisecond"];function T0(e){let t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new yc(e);return t}function F0(e,t){let r=ba(t.zone,hn.defaultZone),n=mn.fromObject(t),i=hn.now(),a,o;if(kt(e.year))a=i;else{for(let l of PS)kt(e[l])&&(e[l]=LS[l]);let s=IS(e)||AS(e);if(s)return mt.invalid(s);let u=r.offset(i);[a,o]=gc(e,u,r)}return new mt({ts:a,zone:r,loc:n,o})}function I0(e,t,r){let n=kt(r.round)?!0:r.round,i=(o,s)=>(o=Om(o,n||r.calendary?0:2,!0),t.loc.clone(r).relFormatter(r).format(o,s)),a=o=>r.calendary?t.hasSame(e,o)?0:t.startOf(o).diff(e.startOf(o),o).get(o):t.diff(e,o).get(o);if(r.unit)return i(a(r.unit),r.unit);for(let o of r.units){let s=a(o);if(Math.abs(s)>=1)return i(s,o)}return i(e>t?-0:0,r.units[r.units.length-1])}function A0(e){let t={},r;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],r=Array.from(e).slice(0,e.length-1)):r=Array.from(e),[t,r]}var mt=class e{constructor(t){let r=t.zone||hn.defaultZone,n=t.invalid||(Number.isNaN(t.ts)?new Ar("invalid input"):null)||(r.isValid?null:fc(r));this.ts=kt(t.ts)?hn.now():t.ts;let i=null,a=null;if(!n)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(r))[i,a]=[t.old.c,t.old.o];else{let s=r.offset(this.ts);i=hc(this.ts,s),n=Number.isNaN(i.year)?new Ar("invalid input"):null,i=n?null:i,a=n?null:s}this._zone=r,this.loc=t.loc||mn.create(),this.invalid=n,this.weekData=null,this.c=i,this.o=a,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[t,r]=A0(arguments),[n,i,a,o,s,u,l]=r;return F0({year:n,month:i,day:a,hour:o,minute:s,second:u,millisecond:l},t)}static utc(){let[t,r]=A0(arguments),[n,i,a,o,s,u,l]=r;return t.zone=Kr.utcInstance,F0({year:n,month:i,day:a,hour:o,minute:s,second:u,millisecond:l},t)}static fromJSDate(t,r={}){let n=d2(t)?t.valueOf():NaN;if(Number.isNaN(n))return e.invalid("invalid input");let i=ba(r.zone,hn.defaultZone);return i.isValid?new e({ts:n,zone:i,loc:mn.fromObject(r)}):e.invalid(fc(i))}static fromMillis(t,r={}){if(ao(t))return t<-C0||t>C0?e.invalid("Timestamp out of range"):new e({ts:t,zone:ba(r.zone,hn.defaultZone),loc:mn.fromObject(r)});throw new vr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,r={}){if(ao(t))return new e({ts:t*1e3,zone:ba(r.zone,hn.defaultZone),loc:mn.fromObject(r)});throw new vr("fromSeconds requires a numerical input")}static fromObject(t,r={}){t=t||{};let n=ba(r.zone,hn.defaultZone);if(!n.isValid)return e.invalid(fc(n));let i=hn.now(),a=kt(r.specificOffset)?n.offset(i):r.specificOffset,o=Sc(t,T0),s=!kt(o.ordinal),u=!kt(o.year),l=!kt(o.month)||!kt(o.day),c=u||l,d=o.weekYear||o.weekNumber,m=mn.fromObject(r);if((c||s)&&d)throw new ro("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new ro("Can't mix ordinal dates with month/day");let h=d||o.weekday&&!c,g,y,v=hc(i,a);h?(g=NP,y=LP,v=km(v)):s?(g=RP,y=PP,v=sm(v)):(g=PS,y=LS);let D=!1;for(let B of g){let G=o[B];kt(G)?D?o[B]=y[B]:o[B]=v[B]:D=!0}let I=h?AP(o):s?OP(o):IS(o),C=I||AS(o);if(C)return e.invalid(C);let x=h?k0(o):s?x0(o):o,[O,A]=gc(x,a,n),P=new e({ts:O,zone:n,o:A,loc:m});return o.weekday&&c&&t.weekday!==P.weekday?e.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${P.toISO()}`):P}static fromISO(t,r={}){let[n,i]=eP(t);return Sl(n,i,r,"ISO 8601",t)}static fromRFC2822(t,r={}){let[n,i]=tP(t);return Sl(n,i,r,"RFC 2822",t)}static fromHTTP(t,r={}){let[n,i]=nP(t);return Sl(n,i,r,"HTTP",r)}static fromFormat(t,r,n={}){if(kt(t)||kt(r))throw new vr("fromFormat requires an input string and a format");let{locale:i=null,numberingSystem:a=null}=n,o=mn.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),[s,u,l,c]=IP(o,t,r);return c?e.invalid(c):Sl(s,u,n,`format ${r}`,t,l)}static fromString(t,r,n={}){return e.fromFormat(t,r,n)}static fromSQL(t,r={}){let[n,i]=uP(t);return Sl(n,i,r,"SQL",t)}static invalid(t,r=null){if(!t)throw new vr("need to specify a reason the DateTime is invalid");let n=t instanceof Ar?t:new Ar(t,r);if(hn.throwOnInvalid)throw new fm(n);return new e({invalid:n})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,r={}){let n=xS(t,mn.fromObject(r));return n?n.map(i=>i?i.val:null).join(""):null}static expandFormat(t,r={}){return ES(Ir.parseFormat(t),mn.fromObject(r)).map(i=>i.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?um(this).weekYear:NaN}get weekNumber(){return this.isValid?um(this).weekNumber:NaN}get weekday(){return this.isValid?um(this).weekday:NaN}get ordinal(){return this.isValid?sm(this.c).ordinal:NaN}get monthShort(){return this.isValid?es.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?es.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?es.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?es.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let t=864e5,r=6e4,n=Mc(this.c),i=this.zone.offset(n-t),a=this.zone.offset(n+t),o=this.zone.offset(n-i*r),s=this.zone.offset(n-a*r);if(o===s)return[this];let u=n-o*r,l=n-s*r,c=hc(u,o),d=hc(l,s);return c.hour===d.hour&&c.minute===d.minute&&c.second===d.second&&c.millisecond===d.millisecond?[no(this,{ts:u}),no(this,{ts:l})]:[this]}get isInLeapYear(){return Fl(this.year)}get daysInMonth(){return bc(this.year,this.month)}get daysInYear(){return this.isValid?Cl(this.year):NaN}get weeksInWeekYear(){return this.isValid?Dc(this.weekYear):NaN}resolvedLocaleOptions(t={}){let{locale:r,numberingSystem:n,calendar:i}=Ir.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:r,numberingSystem:n,outputCalendar:i}}toUTC(t=0,r={}){return this.setZone(Kr.instance(t),r)}toLocal(){return this.setZone(hn.defaultZone)}setZone(t,{keepLocalTime:r=!1,keepCalendarTime:n=!1}={}){if(t=ba(t,hn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(r||n){let a=t.offset(this.ts),o=this.toObject();[i]=gc(o,a,t)}return no(this,{ts:i,zone:t})}else return e.invalid(fc(t))}reconfigure({locale:t,numberingSystem:r,outputCalendar:n}={}){let i=this.loc.clone({locale:t,numberingSystem:r,outputCalendar:n});return no(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;let r=Sc(t,T0),n=!kt(r.weekYear)||!kt(r.weekNumber)||!kt(r.weekday),i=!kt(r.ordinal),a=!kt(r.year),o=!kt(r.month)||!kt(r.day),s=a||o,u=r.weekYear||r.weekNumber;if((s||i)&&u)throw new ro("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&i)throw new ro("Can't mix ordinal dates with month/day");let l;n?l=k0({...km(this.c),...r}):kt(r.ordinal)?(l={...this.toObject(),...r},kt(r.day)&&(l.day=Math.min(bc(l.year,l.month),l.day))):l=x0({...sm(this.c),...r});let[c,d]=gc(l,this.o,this.zone);return no(this,{ts:c,o:d})}plus(t){if(!this.isValid)return this;let r=He.fromDurationLike(t);return no(this,_0(this,r))}minus(t){if(!this.isValid)return this;let r=He.fromDurationLike(t).negate();return no(this,_0(this,r))}startOf(t){if(!this.isValid)return this;let r={},n=He.normalizeUnit(t);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(n==="weeks"&&(r.weekday=1),n==="quarters"){let i=Math.ceil(this.month/3);r.month=(i-1)*3+1}return this.set(r)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,r={}){return this.isValid?Ir.create(this.loc.redefaultToEN(r)).formatDateTimeFromString(this,t):lm}toLocaleString(t=vc,r={}){return this.isValid?Ir.create(this.loc.clone(r),t).formatDateTime(this):lm}toLocaleParts(t={}){return this.isValid?Ir.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:r=!1,suppressMilliseconds:n=!1,includeOffset:i=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;let o=t==="extended",s=cm(this,o);return s+="T",s+=M0(this,o,r,n,i,a),s}toISODate({format:t="extended"}={}){return this.isValid?cm(this,t==="extended"):null}toISOWeekDate(){return mc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:r=!1,includeOffset:n=!0,includePrefix:i=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+M0(this,o==="extended",r,t,n,a):null}toRFC2822(){return mc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return mc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?cm(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:r=!1,includeOffsetSpace:n=!0}={}){let i="HH:mm:ss.SSS";return(r||t)&&(n&&(i+=" "),r?i+="z":t&&(i+="ZZ")),mc(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():lm}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};let r={...this.c};return t.includeConfig&&(r.outputCalendar=this.outputCalendar,r.numberingSystem=this.loc.numberingSystem,r.locale=this.loc.locale),r}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,r="milliseconds",n={}){if(!this.isValid||!t.isValid)return He.invalid("created by diffing an invalid DateTime");let i={locale:this.locale,numberingSystem:this.numberingSystem,...n},a=f2(r).map(He.normalizeUnit),o=t.valueOf()>this.valueOf(),s=o?this:t,u=o?t:this,l=gP(s,u,a,i);return o?l.negate():l}diffNow(t="milliseconds",r={}){return this.diff(e.now(),t,r)}until(t){return this.isValid?ns.fromDateTimes(this,t):this}hasSame(t,r){if(!this.isValid)return!1;let n=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(r)<=n&&n<=i.endOf(r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;let r=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisr.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new vr("max requires all arguments be DateTimes");return p0(t,r=>r.valueOf(),Math.max)}static fromFormatExplain(t,r,n={}){let{locale:i=null,numberingSystem:a=null}=n,o=mn.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});return kS(o,t,r)}static fromStringExplain(t,r,n={}){return e.fromFormatExplain(t,r,n)}static get DATE_SHORT(){return vc}static get DATE_MED(){return H0}static get DATE_MED_WITH_WEEKDAY(){return GL}static get DATE_FULL(){return B0}static get DATE_HUGE(){return V0}static get TIME_SIMPLE(){return $0}static get TIME_WITH_SECONDS(){return U0}static get TIME_WITH_SHORT_OFFSET(){return W0}static get TIME_WITH_LONG_OFFSET(){return Y0}static get TIME_24_SIMPLE(){return z0}static get TIME_24_WITH_SECONDS(){return K0}static get TIME_24_WITH_SHORT_OFFSET(){return j0}static get TIME_24_WITH_LONG_OFFSET(){return q0}static get DATETIME_SHORT(){return G0}static get DATETIME_SHORT_WITH_SECONDS(){return J0}static get DATETIME_MED(){return Z0}static get DATETIME_MED_WITH_SECONDS(){return Q0}static get DATETIME_MED_WITH_WEEKDAY(){return JL}static get DATETIME_FULL(){return X0}static get DATETIME_FULL_WITH_SECONDS(){return eS}static get DATETIME_HUGE(){return tS}static get DATETIME_HUGE_WITH_SECONDS(){return nS}};function El(e){if(mt.isDateTime(e))return e;if(e&&e.valueOf&&ao(e.valueOf()))return mt.fromJSDate(e);if(e&&typeof e=="object")return mt.fromObject(e);throw new vr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var Hm={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},HP={allowHtml:!0};({...Hm,...HP});var xm=class e{constructor(t){ur(this,"value");ur(this,"successful");this.value=t,this.successful=!0}map(t){return new e(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,r){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}},Cm=class e{constructor(t){ur(this,"error");ur(this,"successful");this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new e(t(this.error))}bimap(t,r){return this.mapErr(r)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}},Ec;(function(e){function t(a){return new xm(a)}e.success=t;function r(a){return new Cm(a)}e.failure=r;function n(a,o,s){return a.successful?o.successful?s(a.value,o.value):r(o.error):r(a.error)}e.flatMap2=n;function i(a,o,s){return n(a,o,(u,l)=>t(s(u,l)))}e.map2=i})(Ec||(Ec={}));var BP=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"||typeof window!="undefined"?window:typeof self!="undefined"?self:{},kc={exports:{}};kc.exports;(function(e,t){(function(r,n){e.exports=n()})(typeof self!="undefined"?self:BP,function(){return function(r){var n={};function i(a){if(n[a])return n[a].exports;var o=n[a]={i:a,l:!1,exports:{}};return r[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=r,i.c=n,i.d=function(a,o,s){i.o(a,o)||Object.defineProperty(a,o,{configurable:!1,enumerable:!0,get:s})},i.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},i.n=function(a){var o=a&&a.__esModule?function(){return a.default}:function(){return a};return i.d(o,"a",o),o},i.o=function(a,o){return Object.prototype.hasOwnProperty.call(a,o)},i.p="",i(i.s=0)}([function(r,n,i){function a(L){if(!(this instanceof a))return new a(L);this._=L}var o=a.prototype;function s(L,K){for(var ee=0;ee>7),buf:function(de){var ve=u(function(ge,M,H,q){return ge.concat(H===q.length-1?Buffer.from([M,0]).readUInt16BE(0):q.readUInt16BE(H))},[],de);return Buffer.from(l(function(ge){return(ge<<1&65535)>>8},ve))}(ee.buf)}}),ee}function d(){return typeof Buffer!="undefined"}function m(){if(!d())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function h(L){m();var K=u(function(ve,ge){return ve+ge},0,L);if(K%8!=0)throw new Error("The bits ["+L.join(", ")+"] add up to "+K+" which is not an even number of bytes; the total should be divisible by 8");var ee,ue=K/8,de=(ee=function(ve){return ve>48},u(function(ve,ge){return ve||(ee(ge)?ge:ve)},null,L));if(de)throw new Error(de+" bit range requested exceeds 48 bit (6 byte) Number max.");return new a(function(ve,ge){var M=ue+ge;return M>ve.length?B(ge,ue.toString()+" bytes"):P(M,u(function(H,q){var ie=c(q,H.buf);return{coll:H.coll.concat(ie.v),buf:ie.buf}},{coll:[],buf:ve.slice(ge,M)},L).coll)})}function g(L,K){return new a(function(ee,ue){return m(),ue+K>ee.length?B(ue,K+" bytes for "+L):P(ue+K,ee.slice(ue,ue+K))})}function y(L,K){if(typeof(ee=K)!="number"||Math.floor(ee)!==ee||K<0||K>6)throw new Error(L+" requires integer length in range [0, 6].");var ee}function v(L){return y("uintBE",L),g("uintBE("+L+")",L).map(function(K){return K.readUIntBE(0,L)})}function D(L){return y("uintLE",L),g("uintLE("+L+")",L).map(function(K){return K.readUIntLE(0,L)})}function I(L){return y("intBE",L),g("intBE("+L+")",L).map(function(K){return K.readIntBE(0,L)})}function C(L){return y("intLE",L),g("intLE("+L+")",L).map(function(K){return K.readIntLE(0,L)})}function x(L){return L instanceof a}function O(L){return{}.toString.call(L)==="[object Array]"}function A(L){return d()&&Buffer.isBuffer(L)}function P(L,K){return{status:!0,index:L,value:K,furthest:-1,expected:[]}}function B(L,K){return O(K)||(K=[K]),{status:!1,index:-1,value:null,furthest:L,expected:K}}function G(L,K){if(!K||L.furthest>K.furthest)return L;var ee=L.furthest===K.furthest?function(ue,de){if(function(){if(a._supportsSet!==void 0)return a._supportsSet;var ae=typeof Set!="undefined";return a._supportsSet=ae,ae}()&&Array.from){for(var ve=new Set(ue),ge=0;ge=0;){if(ge in ee){ue=ee[ge].line,ve===0&&(ve=ee[ge].lineStart);break}(L.charAt(ge)===` +`||L.charAt(ge)==="\r"&&L.charAt(ge+1)!==` +`)&&(de++,ve===0&&(ve=ge+1)),ge--}var M=ue+de,H=K-ve;return ee[K]={line:M,lineStart:ve},{offset:K,line:M+1,column:H+1}}function oe(L){if(!x(L))throw new Error("not a parser: "+L)}function te(L,K){return typeof L=="string"?L.charAt(K):L[K]}function re(L){if(typeof L!="number")throw new Error("not a number: "+L)}function ne(L){if(typeof L!="function")throw new Error("not a function: "+L)}function be(L){if(typeof L!="string")throw new Error("not a string: "+L)}var pe=2,De=3,Ce=8,U=5*Ce,Je=4*Ce,it=" ";function N(L,K){return new Array(K+1).join(L)}function Ze(L,K,ee){var ue=K-L.length;return ue<=0?L:N(ee,ue)+L}function It(L,K,ee,ue){return{from:L-K>0?L-K:0,to:L+ee>ue?ue:L+ee}}function Mt(L,K){var ee,ue,de,ve,ge,M=K.index,H=M.offset,q=1;if(H===L.length)return"Got the end of the input";if(A(L)){var ie=H-H%Ce,ye=H-ie,ce=It(ie,U,Je+Ce,L.length),ae=l(function(Te){return l(function(Ue){return Ze(Ue.toString(16),2,"0")},Te)},function(Te,Ue){var We=Te.length,Ft=[],Hn=0;if(We<=Ue)return[Te.slice()];for(var Ot=0;Ot=4&&(ee+=1),q=2,de=l(function(Te){return Te.length<=4?Te.join(" "):Te.slice(0,4).join(" ")+" "+Te.slice(4).join(" ")},ae),(ge=(8*(ve.to>0?ve.to-1:ve.to)).toString(16).length)<2&&(ge=2)}else{var Se=L.split(/\r\n|[\n\r\u2028\u2029]/);ee=M.column-1,ue=M.line-1,ve=It(ue,pe,De,Se.length),de=Se.slice(ve.from,ve.to),ge=ve.to.toString().length}var nt=ue-ve.from;return A(L)&&(ge=(8*(ve.to>0?ve.to-1:ve.to)).toString(16).length)<2&&(ge=2),u(function(Te,Ue,We){var Ft,Hn=We===nt,Ot=Hn?"> ":it;return Ft=A(L)?Ze((8*(ve.from+We)).toString(16),ge,"0"):Ze((ve.from+We+1).toString(),ge," "),[].concat(Te,[Ot+Ft+" | "+Ue],Hn?[it+N(" ",ge)+" | "+Ze("",ee," ")+N("^",q)]:[])},[],de).join(` +`)}function jt(L,K){return[` +`,"-- PARSING FAILED "+N("-",50),` + +`,Mt(L,K),` + +`,(ee=K.expected,ee.length===1?`Expected: + +`+ee[0]:`Expected one of the following: + +`+ee.join(", ")),` +`].join("");var ee}function vt(L){return L.flags!==void 0?L.flags:[L.global?"g":"",L.ignoreCase?"i":"",L.multiline?"m":"",L.unicode?"u":"",L.sticky?"y":""].join("")}function Wt(){for(var L=[].slice.call(arguments),K=L.length,ee=0;ee=2?re(K):K=0;var ee=function(de){return RegExp("^(?:"+de.source+")",vt(de))}(L),ue=""+L;return a(function(de,ve){var ge=ee.exec(de.slice(ve));if(ge){if(0<=K&&K<=ge.length){var M=ge[0],H=ge[K];return P(ve+M.length,H)}return B(ve,"valid match group (0 to "+ge.length+") in "+ue)}return B(ve,ue)})}function xn(L){return a(function(K,ee){return P(ee,L)})}function jn(L){return a(function(K,ee){return B(ee,L)})}function sn(L){if(x(L))return a(function(K,ee){var ue=L._(K,ee);return ue.index=ee,ue.value="",ue});if(typeof L=="string")return sn(yn(L));if(L instanceof RegExp)return sn(vn(L));throw new Error("not a string, regexp, or parser: "+L)}function Rt(L){return oe(L),a(function(K,ee){var ue=L._(K,ee),de=K.slice(ee,ue.index);return ue.status?B(ee,'not "'+de+'"'):P(ee,null)})}function Vt(L){return ne(L),a(function(K,ee){var ue=te(K,ee);return ee=L.length?B(K,"any character/byte"):P(K+1,te(L,K))}),rn=a(function(L,K){return P(L.length,L.slice(K))}),At=a(function(L,K){return K=0}).desc(K)},a.optWhitespace=Dt,a.Parser=a,a.range=function(L,K){return Vt(function(ee){return L<=ee&&ee<=K}).desc(L+"-"+K)},a.regex=vn,a.regexp=vn,a.sepBy=en,a.sepBy1=gn,a.seq=Wt,a.seqMap=Tt,a.seqObj=function(){for(var L,K={},ee=0,ue=(L=arguments,Array.prototype.slice.call(L)),de=ue.length,ve=0;ve255)throw new Error("Value specified to byte constructor ("+L+"=0x"+L.toString(16)+") is larger in value than a single byte.");var K=(L>15?"0x":"0x0")+L.toString(16);return a(function(ee,ue){var de=te(ee,ue);return de===L?P(ue+1,de):B(ue,K)})},buffer:function(L){return g("buffer",L).map(function(K){return Buffer.from(K)})},encodedString:function(L,K){return g("string",K).map(function(ee){return ee.toString(L)})},uintBE:v,uint8BE:v(1),uint16BE:v(2),uint32BE:v(4),uintLE:D,uint8LE:D(1),uint16LE:D(2),uint32LE:D(4),intBE:I,int8BE:I(1),int16BE:I(2),int32BE:I(4),intLE:C,int8LE:C(1),int16LE:C(2),int32LE:C(4),floatBE:g("floatBE",4).map(function(L){return L.readFloatBE(0)}),floatLE:g("floatLE",4).map(function(L){return L.readFloatLE(0)}),doubleBE:g("doubleBE",8).map(function(L){return L.readDoubleBE(0)}),doubleLE:g("doubleLE",8).map(function(L){return L.readDoubleLE(0)})},r.exports=a}])})})(kc,kc.exports);var W=kc.exports,Bm=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function NS(e){return e==null?e:e.shiftToAll().normalize()}function O0(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}W.alt(W.regex(new RegExp(Bm(),"")),W.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),W.whitespace.map(e=>"-"),W.any.map(e=>"")).many().map(e=>e.join(""));var VP=W.alt(W.regex(new RegExp(Bm(),"")),W.regex(/[0-9\p{Letter}_-]+/u),W.whitespace.map(e=>" "),W.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function $P(e){return VP.tryParse(e)}function UP(e){return e=NS(e),e=He.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t!=0))),e.toHuman()}var Ml;(function(e){function t(x,O=Hm,A=!1){let P=r(x);if(!P)return O.renderNullAs;switch(P.type){case"null":return O.renderNullAs;case"string":return P.value;case"number":case"boolean":return""+P.value;case"html":return P.value.outerHTML;case"widget":return P.value.markdown();case"link":return P.value.markdown();case"function":return"";case"array":let B="";return A&&(B+="["),B+=P.value.map(G=>t(G,O,!0)).join(", "),A&&(B+="]"),B;case"object":return"{ "+Object.entries(P.value).map(G=>G[0]+": "+t(G[1],O,!0)).join(", ")+" }";case"date":return P.value.second==0&&P.value.hour==0&&P.value.minute==0?P.value.toFormat(O.defaultDateFormat):P.value.toFormat(O.defaultDateTimeFormat);case"duration":return UP(P.value)}}e.toString=t;function r(x){return m(x)?{type:"null",value:x}:l(x)?{type:"number",value:x}:u(x)?{type:"string",value:x}:g(x)?{type:"boolean",value:x}:d(x)?{type:"duration",value:x}:c(x)?{type:"date",value:x}:v(x)?{type:"widget",value:x}:h(x)?{type:"array",value:x}:y(x)?{type:"link",value:x}:C(x)?{type:"function",value:x}:D(x)?{type:"html",value:x}:I(x)?{type:"object",value:x}:void 0}e.wrapValue=r;function n(x,O){if(I(x)){let A={};for(let[P,B]of Object.entries(x))A[P]=n(B,O);return A}else if(h(x)){let A=[];for(let P of x)A.push(n(P,O));return A}else return O(x)}e.mapLeaves=n;function i(x,O,A){var G,J;if(x===void 0&&(x=null),O===void 0&&(O=null),x===null&&O===null)return 0;if(x===null)return-1;if(O===null)return 1;let P=r(x),B=r(O);if(P===void 0&&B===void 0)return 0;if(P===void 0)return-1;if(B===void 0)return 1;if(P.type!=B.type)return P.type.localeCompare(B.type);if(P.value===B.value)return 0;switch(P.type){case"string":return P.value.localeCompare(B.value);case"number":return P.valueN,re=te(Q.path).localeCompare(te(oe.path));if(re!=0)return re;let ne=Q.type.localeCompare(oe.type);return ne!=0?ne:Q.subpath&&!oe.subpath?1:!Q.subpath&&oe.subpath?-1:!Q.subpath&&!oe.subpath?0:((G=Q.subpath)!=null?G:"").localeCompare((J=oe.subpath)!=null?J:"");case"date":return P.value0;case"boolean":return O.value;case"link":return!!O.value.path;case"date":return O.value.toMillis()!=0;case"duration":return O.value.as("seconds")!=0;case"object":return Object.keys(O.value).length>0;case"array":return O.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=o;function s(x){if(x==null)return x;if(e.isArray(x))return[].concat(x.map(O=>s(O)));if(e.isObject(x)){let O={};for(let[A,P]of Object.entries(x))O[A]=s(P);return O}else return x}e.deepCopy=s;function u(x){return typeof x=="string"}e.isString=u;function l(x){return typeof x=="number"}e.isNumber=l;function c(x){return x instanceof mt}e.isDate=c;function d(x){return x instanceof He}e.isDuration=d;function m(x){return x==null}e.isNull=m;function h(x){return Array.isArray(x)}e.isArray=h;function g(x){return typeof x=="boolean"}e.isBoolean=g;function y(x){return x instanceof xc}e.isLink=y;function v(x){return x instanceof Tl}e.isWidget=v;function D(x){return typeof HTMLElement!="undefined"?x instanceof HTMLElement:!1}e.isHtml=D;function I(x){return typeof x=="object"&&!D(x)&&!v(x)&&!h(x)&&!d(x)&&!c(x)&&!y(x)&&x!==void 0&&!m(x)}e.isObject=I;function C(x){return typeof x=="function"}e.isFunction=C})(Ml||(Ml={}));var L0;(function(e){function t(i){return Ml.isObject(i)&&Object.keys(i).length==2&&"key"in i&&"rows"in i}e.isElementGroup=t;function r(i){for(let a of i)if(!t(a))return!1;return!0}e.isGrouping=r;function n(i){if(r(i)){let a=0;for(let o of i)a+=n(o.rows);return a}else return i.length}e.count=n})(L0||(L0={}));var xc=class e{constructor(t){ur(this,"path");ur(this,"display");ur(this,"subpath");ur(this,"embed");ur(this,"type");Object.assign(this,t)}static file(t,r=!1,n){return new e({path:t,embed:r,display:n,subpath:void 0,type:"file"})}static infer(t,r=!1,n){if(t.includes("#^")){let i=t.split("#^");return e.block(i[0],i[1],r,n)}else if(t.includes("#")){let i=t.split("#");return e.header(i[0],i[1],r,n)}else return e.file(t,r,n)}static header(t,r,n,i){return new e({path:t,embed:n,display:i,subpath:$P(r),type:"header"})}static block(t,r,n,i){return new e({path:t,embed:n,display:i,subpath:r,type:"block"})}static fromObject(t){return new e(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new e(Object.assign({},this,{path:t}))}withDisplay(t){return new e(Object.assign({},this,{display:t}))}withHeader(t){return e.header(this.path,t,this.embed,this.display)}toFile(){return e.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new e(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new e(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+O0(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var r,n;let t=this.path.replaceAll("|","\\|");return this.type=="header"?t+"#"+((r=this.subpath)==null?void 0:r.replaceAll("|","\\|")):this.type=="block"?t+"#^"+((n=this.subpath)==null?void 0:n.replaceAll("|","\\|")):t}fileName(){return O0(this.path).replace(".md","")}},Tl=class{constructor(t){ur(this,"$widget");this.$widget=t}},_m=class extends Tl{constructor(r,n){super("dataview:list-pair");ur(this,"key");ur(this,"value");this.key=r,this.value=n}markdown(){return`${Ml.toString(this.key)}: ${Ml.toString(this.value)}`}},Mm=class extends Tl{constructor(r,n){super("dataview:external-link");ur(this,"url");ur(this,"display");this.url=r,this.display=n}markdown(){var r;return`[${(r=this.display)!=null?r:this.url}](${this.url})`}},P0;(function(e){function t(o,s){return new _m(o,s)}e.listPair=t;function r(o,s){return new Mm(o,s)}e.externalLink=r;function n(o){return o.$widget==="dataview:list-pair"}e.isListPair=n;function i(o){return o.$widget==="dataview:external-link"}e.isExternalLink=i;function a(o){return n(o)||i(o)}e.isBuiltin=a})(P0||(P0={}));var fn;(function(e){function t(m){return{type:"variable",name:m}}e.variable=t;function r(m){return{type:"literal",value:m}}e.literal=r;function n(m,h,g){return{type:"binaryop",left:m,op:h,right:g}}e.binaryOp=n;function i(m,h){return{type:"index",object:m,index:h}}e.index=i;function a(m){let h=m.split("."),g=e.variable(h[0]);for(let y=1;y"||m==">="||m=="!="||m=="="}e.isCompareOp=d,e.NULL=e.literal(null)})(fn||(fn={}));var Si;(function(e){function t(c){return{type:"tag",tag:c}}e.tag=t;function r(c){return{type:"csv",path:c}}e.csv=r;function n(c){return{type:"folder",folder:c}}e.folder=n;function i(c,d){return{type:"link",file:c,direction:d?"incoming":"outgoing"}}e.link=i;function a(c,d,m){return{type:"binaryop",left:c,op:d,right:m}}e.binaryOp=a;function o(c,d){return{type:"binaryop",left:c,op:"&",right:d}}e.and=o;function s(c,d){return{type:"binaryop",left:c,op:"|",right:d}}e.or=s;function u(c){return{type:"negate",child:c}}e.negate=u;function l(){return{type:"empty"}}e.empty=l})(Si||(Si={}));var N0=new RegExp(Bm(),""),Tm={year:He.fromObject({years:1}),years:He.fromObject({years:1}),yr:He.fromObject({years:1}),yrs:He.fromObject({years:1}),month:He.fromObject({months:1}),months:He.fromObject({months:1}),mo:He.fromObject({months:1}),mos:He.fromObject({months:1}),week:He.fromObject({weeks:1}),weeks:He.fromObject({weeks:1}),wk:He.fromObject({weeks:1}),wks:He.fromObject({weeks:1}),w:He.fromObject({weeks:1}),day:He.fromObject({days:1}),days:He.fromObject({days:1}),d:He.fromObject({days:1}),hour:He.fromObject({hours:1}),hours:He.fromObject({hours:1}),hr:He.fromObject({hours:1}),hrs:He.fromObject({hours:1}),h:He.fromObject({hours:1}),minute:He.fromObject({minutes:1}),minutes:He.fromObject({minutes:1}),min:He.fromObject({minutes:1}),mins:He.fromObject({minutes:1}),m:He.fromObject({minutes:1}),second:He.fromObject({seconds:1}),seconds:He.fromObject({seconds:1}),sec:He.fromObject({seconds:1}),secs:He.fromObject({seconds:1}),s:He.fromObject({seconds:1})},Fm={now:()=>mt.local(),today:()=>mt.local().startOf("day"),yesterday:()=>mt.local().startOf("day").minus(He.fromObject({days:1})),tomorrow:()=>mt.local().startOf("day").plus(He.fromObject({days:1})),sow:()=>mt.local().startOf("week"),"start-of-week":()=>mt.local().startOf("week"),eow:()=>mt.local().endOf("week"),"end-of-week":()=>mt.local().endOf("week"),soy:()=>mt.local().startOf("year"),"start-of-year":()=>mt.local().startOf("year"),eoy:()=>mt.local().endOf("year"),"end-of-year":()=>mt.local().endOf("year"),som:()=>mt.local().startOf("month"),"start-of-month":()=>mt.local().startOf("month"),eom:()=>mt.local().endOf("month"),"end-of-month":()=>mt.local().endOf("month")},Im=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function WP(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function YP(e){let[t,r]=WP(e);return xc.infer(t,!1,r)}function kl(e,t,r){return W.seqMap(e,W.seq(W.optWhitespace,t,W.optWhitespace,e).many(),(n,i)=>{if(i.length==0)return n;let a=r(n,i[0][1],i[0][3]);for(let o=1;o(i,a)=>{let o=e._(i,a);if(!o.status)return o;for(let s of t){let u=s(o.value)._(i,o.index);if(!u.status)return o;o=u}return o})}var ai=W.createLanguage({number:e=>W.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>W.string('"').then(W.alt(e.escapeCharacter,W.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(W.string('"')).desc("string"),escapeCharacter:e=>W.string("\\").then(W.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>W.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>W.seqMap(W.string("#"),W.alt(W.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,r)=>t+r.join("")).desc("tag ('#hello/stuff')"),identifier:e=>W.seqMap(W.alt(W.regexp(/\p{Letter}/u),W.regexp(N0).desc("text")),W.alt(W.regexp(/[0-9\p{Letter}_-]/u),W.regexp(N0).desc("text")).many(),(t,r)=>t+r.join("")).desc("variable identifier"),link:e=>W.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>YP(t)).desc("file link"),embedLink:e=>W.seqMap(W.string("!").atMost(1),e.link,(t,r)=>(t.length>0&&(r.embed=!0),r)).desc("file link"),binaryPlusMinus:e=>W.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>W.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>W.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>W.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>W.seqMap(W.regexp(/\d{4}/),W.string("-"),W.regexp(/\d{2}/),(t,r,n)=>mt.fromObject({year:Number.parseInt(t),month:Number.parseInt(n)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>W.alt(...Object.keys(Fm).sort((t,r)=>r.length-t.length).map(W.string)),date:e=>zP(e.rootDate,t=>W.seqMap(W.string("-"),W.regexp(/\d{2}/),(r,n)=>t.set({day:Number.parseInt(n)})),t=>W.seqMap(W.string("T"),W.regexp(/\d{2}/),(r,n)=>t.set({hour:Number.parseInt(n)})),t=>W.seqMap(W.string(":"),W.regexp(/\d{2}/),(r,n)=>t.set({minute:Number.parseInt(n)})),t=>W.seqMap(W.string(":"),W.regexp(/\d{2}/),(r,n)=>t.set({second:Number.parseInt(n)})),t=>W.alt(W.seqMap(W.string("."),W.regexp(/\d{3}/),(r,n)=>t.set({millisecond:Number.parseInt(n)})),W.succeed(t)),t=>W.alt(W.seqMap(W.string("+").or(W.string("-")),W.regexp(/\d{1,2}(:\d{2})?/),(r,n)=>t.setZone("UTC"+r+n,{keepLocalTime:!0})),W.seqMap(W.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),W.seqMap(W.string("["),W.regexp(/[0-9A-Za-z+-\/]+/u),W.string("]"),(r,n,i)=>t.setZone(n,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>W.alt(e.dateShorthand.map(t=>Fm[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>W.alt(...Object.keys(Tm).sort((t,r)=>r.length-t.length).map(W.string)),duration:e=>W.seqMap(e.number,W.optWhitespace,e.durationType,(t,r,n)=>Tm[n].mapUnits(i=>i*t)).sepBy1(W.string(",").trim(W.optWhitespace).or(W.optWhitespace)).map(t=>t.reduce((r,n)=>r.plus(n))).desc("duration like 4hr2min"),rawNull:e=>W.string("null"),tagSource:e=>e.tag.map(t=>Si.tag(t)),csvSource:e=>W.seqMap(W.string("csv(").skip(W.optWhitespace),e.string,W.string(")"),(t,r,n)=>Si.csv(r)),linkIncomingSource:e=>e.link.map(t=>Si.link(t.path,!0)),linkOutgoingSource:e=>W.seqMap(W.string("outgoing(").skip(W.optWhitespace),e.link,W.string(")"),(t,r,n)=>Si.link(r.path,!1)),folderSource:e=>e.string.map(t=>Si.folder(t)),parensSource:e=>W.seqMap(W.string("("),W.optWhitespace,e.source,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>n),negateSource:e=>W.seqMap(W.alt(W.string("-"),W.string("!")),e.atomSource,(t,r)=>Si.negate(r)),atomSource:e=>W.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>kl(e.atomSource,e.binaryBooleanOp.map(t=>t),Si.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>Im.includes(t.toUpperCase())?W.fail("Variable fields cannot be a keyword ("+Im.join(" or ")+")"):W.succeed(fn.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>fn.literal(t)).desc("number"),stringField:e=>e.string.map(t=>fn.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>fn.literal(t)).desc("boolean"),dateField:e=>W.seqMap(W.string("date("),W.optWhitespace,e.datePlus,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>fn.literal(n)).desc("date"),durationField:e=>W.seqMap(W.string("dur("),W.optWhitespace,e.duration,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>fn.literal(n)).desc("duration"),nullField:e=>e.rawNull.map(t=>fn.NULL),linkField:e=>e.link.map(t=>fn.literal(t)),listField:e=>e.field.sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("[").skip(W.optWhitespace),W.optWhitespace.then(W.string("]"))).map(t=>fn.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>W.seqMap(e.identifier.or(e.string),W.string(":").trim(W.optWhitespace),e.field,(t,r,n)=>({name:t,value:n})).sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("{").skip(W.optWhitespace),W.optWhitespace.then(W.string("}"))).map(t=>{let r={};for(let n of t)r[n.name]=n.value;return fn.object(r)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>W.alt(e.date,e.duration.map(t=>NS(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(W.string(",").trim(W.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>W.alt(W.seqMap(e.atomInlineField,W.string(",").trim(W.optWhitespace),e.inlineFieldList,(t,r,n)=>[t].concat(n)),e.atomInlineField),atomField:e=>W.alt(e.embedLink.map(t=>fn.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>W.seqMap(e.atomField,W.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,r)=>{let n=t;for(let i of r)switch(i.type){case"dot":n=fn.index(n,fn.literal(i.field));break;case"index":n=fn.index(n,i.field);break;case"function":n=fn.func(n,i.fields);break}return n}),negatedField:e=>W.seqMap(W.string("!"),e.indexField,(t,r)=>fn.negate(r)).desc("negated field"),parensField:e=>W.seqMap(W.string("("),W.optWhitespace,e.field,W.optWhitespace,W.string(")"),(t,r,n,i,a)=>n),lambdaField:e=>W.seqMap(e.identifier.sepBy(W.string(",").trim(W.optWhitespace)).wrap(W.string("(").trim(W.optWhitespace),W.string(")").trim(W.optWhitespace)),W.string("=>").trim(W.optWhitespace),e.field,(t,r,n)=>({type:"lambda",arguments:t,value:n})),dotPostfix:e=>W.seqMap(W.string("."),e.identifier,(t,r)=>({type:"dot",field:r})),indexPostfix:e=>W.seqMap(W.string("["),W.optWhitespace,e.field,W.optWhitespace,W.string("]"),(t,r,n,i,a)=>({type:"index",field:n})),functionPostfix:e=>W.seqMap(W.string("("),W.optWhitespace,e.field.sepBy(W.string(",").trim(W.optWhitespace)),W.optWhitespace,W.string(")"),(t,r,n,i,a)=>({type:"function",fields:n})),binaryMulDivField:e=>kl(e.indexField,e.binaryMulDiv,fn.binaryOp),binaryPlusMinusField:e=>kl(e.binaryMulDivField,e.binaryPlusMinus,fn.binaryOp),binaryCompareField:e=>kl(e.binaryPlusMinusField,e.binaryCompareOp,fn.binaryOp),binaryBooleanField:e=>kl(e.binaryCompareField,e.binaryBooleanOp,fn.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function KP(e){try{return Ec.success(ai.field.tryParse(e))}catch(t){return Ec.failure(""+t)}}var Cc;(function(e){function t(n,i){return{name:n,field:i}}e.named=t;function r(n,i){return{field:n,direction:i}}e.sortBy=r})(Cc||(Cc={}));function jP(e){return W.custom((t,r)=>(n,i)=>{let a=e._(n,i);return a.status?Object.assign({},a,{value:[a.value,n.substring(i,a.index)]}):a})}function qP(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}function R0(e,t){return W.eof.map(e).or(W.whitespace.then(t))}var RS=W.createLanguage({queryType:e=>W.alt(W.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>W.seqMap(ai.field.skip(W.whitespace),W.regexp(/AS/i).skip(W.whitespace),ai.identifier.or(ai.string),(t,r,n)=>Cc.named(n,t)),comment:()=>W.Parser((e,t)=>{let r=e.substring(t);if(!r.startsWith("//"))return W.makeFailure(t,"Not a comment");r=r.split(` +`)[0];let n=r.substring(2).trim();return W.makeSuccess(t+r.length,n)}),namedField:e=>W.alt(e.explicitNamedField,jP(ai.field).map(([t,r])=>Cc.named(qP(r),t))),sortField:e=>W.seqMap(ai.field.skip(W.optWhitespace),W.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,r)=>{let n=r.length==0?"ascending":r[0].toLowerCase();return n=="desc"&&(n="descending"),n=="asc"&&(n="ascending"),{field:t,direction:n}}),headerClause:e=>e.queryType.chain(t=>{switch(t){case"table":return R0(()=>({type:t,fields:[],showId:!0}),W.seqMap(W.regexp(/WITHOUT\s+ID/i).skip(W.optWhitespace).atMost(1),W.sepBy(e.namedField,W.string(",").trim(W.optWhitespace)),(r,n)=>({type:t,fields:n,showId:r.length==0})));case"list":return R0(()=>({type:t,format:void 0,showId:!0}),W.seqMap(W.regexp(/WITHOUT\s+ID/i).skip(W.optWhitespace).atMost(1),ai.field.atMost(1),(r,n)=>({type:t,format:n.length==1?n[0]:void 0,showId:r.length==0})));case"task":return W.succeed({type:t});case"calendar":return W.whitespace.then(W.seqMap(e.namedField,r=>({type:t,showId:!0,field:r})));default:return W.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>W.seqMap(W.regexp(/FROM/i),W.whitespace,ai.source,(t,r,n)=>n),whereClause:e=>W.seqMap(W.regexp(/WHERE/i),W.whitespace,ai.field,(t,r,n)=>({type:"where",clause:n})).desc("WHERE "),sortByClause:e=>W.seqMap(W.regexp(/SORT/i),W.whitespace,e.sortField.sepBy1(W.string(",").trim(W.optWhitespace)),(t,r,n)=>({type:"sort",fields:n})).desc("SORT field [ASC/DESC]"),limitClause:e=>W.seqMap(W.regexp(/LIMIT/i),W.whitespace,ai.field,(t,r,n)=>({type:"limit",amount:n})).desc("LIMIT "),flattenClause:e=>W.seqMap(W.regexp(/FLATTEN/i).skip(W.whitespace),e.namedField,(t,r)=>({type:"flatten",field:r})).desc("FLATTEN [AS ]"),groupByClause:e=>W.seqMap(W.regexp(/GROUP BY/i).skip(W.whitespace),e.namedField,(t,r)=>({type:"group",field:r})).desc("GROUP BY [AS ]"),clause:e=>W.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>W.seqMap(e.headerClause.trim(dm),e.fromClause.trim(dm).atMost(1),e.clause.trim(dm).many(),(t,r,n)=>({header:t,source:r.length==0?Si.folder(""):r[0],operations:n,settings:Hm}))}),dm=W.alt(W.whitespace,RS.comment).many().map(e=>e.join("")),GP=e=>{var t;return e?(t=e.plugins.plugins.dataview)==null?void 0:t.api:window.DataviewAPI},JP=e=>e.plugins.enabledPlugins.has("dataview");Ei.DATE_SHORTHANDS=Fm;Ei.DURATION_TYPES=Tm;Ei.EXPRESSION=ai;Ei.KEYWORDS=Im;Ei.QUERY_LANGUAGE=RS;Ei.getAPI=GP;Ei.isPluginEnabled=JP;Ei.parseField=KP});var HS=wn((Vm,$m)=>{(function(e,t){typeof Vm=="object"&&typeof $m!="undefined"?$m.exports=t():typeof define=="function"&&define.amd?define(t):e.Mark=t()})(Vm,function(){"use strict";var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t=function(s,u){if(!(s instanceof u))throw new TypeError("Cannot call a class as a function")},r=function(){function s(u,l){for(var c=0;c1&&arguments[1]!==void 0?arguments[1]:!0,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5e3;t(this,s),this.ctx=u,this.iframes=l,this.exclude=c,this.iframesTimeout=d}return r(s,[{key:"getContexts",value:function(){var l=void 0,c=[];return typeof this.ctx=="undefined"||!this.ctx?l=[]:NodeList.prototype.isPrototypeOf(this.ctx)?l=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?l=this.ctx:typeof this.ctx=="string"?l=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):l=[this.ctx],l.forEach(function(d){var m=c.filter(function(h){return h.contains(d)}).length>0;c.indexOf(d)===-1&&!m&&c.push(d)}),c}},{key:"getIframeContents",value:function(l,c){var d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},m=void 0;try{var h=l.contentWindow;if(m=h.document,!h||!m)throw new Error("iframe inaccessible")}catch(g){d()}m&&c(m)}},{key:"isIframeBlank",value:function(l){var c="about:blank",d=l.getAttribute("src").trim(),m=l.contentWindow.location.href;return m===c&&d!==c&&d}},{key:"observeIframeLoad",value:function(l,c,d){var m=this,h=!1,g=null,y=function v(){if(!h){h=!0,activeWindow.clearTimeout(g);try{m.isIframeBlank(l)||(l.removeEventListener("load",v),m.getIframeContents(l,c,d))}catch(D){d()}}};l.addEventListener("load",y),g=activeWindow.setTimeout(y,this.iframesTimeout)}},{key:"onIframeReady",value:function(l,c,d){try{l.contentWindow.document.readyState==="complete"?this.isIframeBlank(l)?this.observeIframeLoad(l,c,d):this.getIframeContents(l,c,d):this.observeIframeLoad(l,c,d)}catch(m){d()}}},{key:"waitForIframes",value:function(l,c){var d=this,m=0;this.forEachIframe(l,function(){return!0},function(h){m++,d.waitForIframes(h.querySelector("html"),function(){--m||c()})},function(h){h||c()})}},{key:"forEachIframe",value:function(l,c,d){var m=this,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},g=l.querySelectorAll("iframe"),y=g.length,v=0;g=Array.prototype.slice.call(g);var D=function(){--y<=0&&h(v)};y||D(),g.forEach(function(I){s.matches(I,m.exclude)?D():m.onIframeReady(I,function(C){c(I)&&(v++,d(C)),D()},D)})}},{key:"createIterator",value:function(l,c,d){return document.createNodeIterator(l,c,d,!1)}},{key:"createInstanceOnIframe",value:function(l){return new s(l.querySelector("html"),this.iframes)}},{key:"compareNodeIframe",value:function(l,c,d){var m=l.compareDocumentPosition(d),h=Node.DOCUMENT_POSITION_PRECEDING;if(m&h)if(c!==null){var g=c.compareDocumentPosition(d),y=Node.DOCUMENT_POSITION_FOLLOWING;if(g&y)return!0}else return!0;return!1}},{key:"getIteratorNode",value:function(l){var c=l.previousNode(),d=void 0;return c===null?d=l.nextNode():d=l.nextNode()&&l.nextNode(),{prevNode:c,node:d}}},{key:"checkIframeFilter",value:function(l,c,d,m){var h=!1,g=!1;return m.forEach(function(y,v){y.val===d&&(h=v,g=y.handled)}),this.compareNodeIframe(l,c,d)?(h===!1&&!g?m.push({val:d,handled:!0}):h!==!1&&!g&&(m[h].handled=!0),!0):(h===!1&&m.push({val:d,handled:!1}),!1)}},{key:"handleOpenIframes",value:function(l,c,d,m){var h=this;l.forEach(function(g){g.handled||h.getIframeContents(g.val,function(y){h.createInstanceOnIframe(y).forEachNode(c,d,m)})})}},{key:"iterateThroughNodes",value:function(l,c,d,m,h){for(var g=this,y=this.createIterator(c,l,m),v=[],D=[],I=void 0,C=void 0,x=function(){var A=g.getIteratorNode(y);return C=A.prevNode,I=A.node,I};x();)this.iframes&&this.forEachIframe(c,function(O){return g.checkIframeFilter(I,C,O,v)},function(O){g.createInstanceOnIframe(O).forEachNode(l,function(A){return D.push(A)},m)}),D.push(I);D.forEach(function(O){d(O)}),this.iframes&&this.handleOpenIframes(v,l,d,m),h()}},{key:"forEachNode",value:function(l,c,d){var m=this,h=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){},g=this.getContexts(),y=g.length;y||h(),g.forEach(function(v){var D=function(){m.iterateThroughNodes(l,v,c,d,function(){--y<=0&&h()})};m.iframes?m.waitForIframes(v,D):D()})}}],[{key:"matches",value:function(l,c){var d=typeof c=="string"?[c]:c,m=l.matches||l.matchesSelector||l.msMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.webkitMatchesSelector;if(m){var h=!1;return d.every(function(g){return m.call(l,g)?(h=!0,!1):!0}),h}else return!1}}]),s}(),a=function(){function s(u){t(this,s),this.ctx=u,this.ie=!1;var l=window.navigator.userAgent;(l.indexOf("MSIE")>-1||l.indexOf("Trident")>-1)&&(this.ie=!0)}return r(s,[{key:"log",value:function(l){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"debug",d=this.opt.log;this.opt.debug&&(typeof d=="undefined"?"undefined":e(d))==="object"&&typeof d[c]=="function"&&d[c]("mark.js: "+l)}},{key:"escapeStr",value:function(l){return l.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}},{key:"createRegExp",value:function(l){return this.opt.wildcards!=="disabled"&&(l=this.setupWildcardsRegExp(l)),l=this.escapeStr(l),Object.keys(this.opt.synonyms).length&&(l=this.createSynonymsRegExp(l)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.setupIgnoreJoinersRegExp(l)),this.opt.diacritics&&(l=this.createDiacriticsRegExp(l)),l=this.createMergedBlanksRegExp(l),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.createJoinersRegExp(l)),this.opt.wildcards!=="disabled"&&(l=this.createWildcardsRegExp(l)),l=this.createAccuracyRegExp(l),l}},{key:"createSynonymsRegExp",value:function(l){var c=this.opt.synonyms,d=this.opt.caseSensitive?"":"i",m=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(var h in c)if(c.hasOwnProperty(h)){var g=c[h],y=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(h):this.escapeStr(h),v=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(g):this.escapeStr(g);y!==""&&v!==""&&(l=l.replace(new RegExp("("+this.escapeStr(y)+"|"+this.escapeStr(v)+")","gm"+d),m+("("+this.processSynomyms(y)+"|")+(this.processSynomyms(v)+")")+m))}return l}},{key:"processSynomyms",value:function(l){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(l=this.setupIgnoreJoinersRegExp(l)),l}},{key:"setupWildcardsRegExp",value:function(l){return l=l.replace(/(?:\\)*\?/g,function(c){return c.charAt(0)==="\\"?"?":""}),l.replace(/(?:\\)*\*/g,function(c){return c.charAt(0)==="\\"?"*":""})}},{key:"createWildcardsRegExp",value:function(l){var c=this.opt.wildcards==="withSpaces";return l.replace(/\u0001/g,c?"[\\S\\s]?":"\\S?").replace(/\u0002/g,c?"[\\S\\s]*?":"\\S*")}},{key:"setupIgnoreJoinersRegExp",value:function(l){return l.replace(/[^(|)\\]/g,function(c,d,m){var h=m.charAt(d+1);return/[(|)\\]/.test(h)||h===""?c:c+"\0"})}},{key:"createJoinersRegExp",value:function(l){var c=[],d=this.opt.ignorePunctuation;return Array.isArray(d)&&d.length&&c.push(this.escapeStr(d.join(""))),this.opt.ignoreJoiners&&c.push("\\u00ad\\u200b\\u200c\\u200d"),c.length?l.split(/\u0000+/).join("["+c.join("")+"]*"):l}},{key:"createDiacriticsRegExp",value:function(l){var c=this.opt.caseSensitive?"":"i",d=this.opt.caseSensitive?["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105","A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104","c\xE7\u0107\u010D","C\xC7\u0106\u010C","d\u0111\u010F","D\u0110\u010E","e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119","E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118","i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012B","I\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A","l\u0142","L\u0141","n\xF1\u0148\u0144","N\xD1\u0147\u0143","o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014D","O\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C","r\u0159","R\u0158","s\u0161\u015B\u0219\u015F","S\u0160\u015A\u0218\u015E","t\u0165\u021B\u0163","T\u0164\u021A\u0162","u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016B","U\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A","y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFF","Y\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178","z\u017E\u017C\u017A","Z\u017D\u017B\u0179"]:["a\xE0\xE1\u1EA3\xE3\u1EA1\u0103\u1EB1\u1EAF\u1EB3\u1EB5\u1EB7\xE2\u1EA7\u1EA5\u1EA9\u1EAB\u1EAD\xE4\xE5\u0101\u0105A\xC0\xC1\u1EA2\xC3\u1EA0\u0102\u1EB0\u1EAE\u1EB2\u1EB4\u1EB6\xC2\u1EA6\u1EA4\u1EA8\u1EAA\u1EAC\xC4\xC5\u0100\u0104","c\xE7\u0107\u010DC\xC7\u0106\u010C","d\u0111\u010FD\u0110\u010E","e\xE8\xE9\u1EBB\u1EBD\u1EB9\xEA\u1EC1\u1EBF\u1EC3\u1EC5\u1EC7\xEB\u011B\u0113\u0119E\xC8\xC9\u1EBA\u1EBC\u1EB8\xCA\u1EC0\u1EBE\u1EC2\u1EC4\u1EC6\xCB\u011A\u0112\u0118","i\xEC\xED\u1EC9\u0129\u1ECB\xEE\xEF\u012BI\xCC\xCD\u1EC8\u0128\u1ECA\xCE\xCF\u012A","l\u0142L\u0141","n\xF1\u0148\u0144N\xD1\u0147\u0143","o\xF2\xF3\u1ECF\xF5\u1ECD\xF4\u1ED3\u1ED1\u1ED5\u1ED7\u1ED9\u01A1\u1EDF\u1EE1\u1EDB\u1EDD\u1EE3\xF6\xF8\u014DO\xD2\xD3\u1ECE\xD5\u1ECC\xD4\u1ED2\u1ED0\u1ED4\u1ED6\u1ED8\u01A0\u1EDE\u1EE0\u1EDA\u1EDC\u1EE2\xD6\xD8\u014C","r\u0159R\u0158","s\u0161\u015B\u0219\u015FS\u0160\u015A\u0218\u015E","t\u0165\u021B\u0163T\u0164\u021A\u0162","u\xF9\xFA\u1EE7\u0169\u1EE5\u01B0\u1EEB\u1EE9\u1EED\u1EEF\u1EF1\xFB\xFC\u016F\u016BU\xD9\xDA\u1EE6\u0168\u1EE4\u01AF\u1EEA\u1EE8\u1EEC\u1EEE\u1EF0\xDB\xDC\u016E\u016A","y\xFD\u1EF3\u1EF7\u1EF9\u1EF5\xFFY\xDD\u1EF2\u1EF6\u1EF8\u1EF4\u0178","z\u017E\u017C\u017AZ\u017D\u017B\u0179"],m=[];return l.split("").forEach(function(h){d.every(function(g){if(g.indexOf(h)!==-1){if(m.indexOf(g)>-1)return!1;l=l.replace(new RegExp("["+g+"]","gm"+c),"["+g+"]"),m.push(g)}return!0})}),l}},{key:"createMergedBlanksRegExp",value:function(l){return l.replace(/[\s]+/gmi,"[\\s]+")}},{key:"createAccuracyRegExp",value:function(l){var c=this,d="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~\xA1\xBF",m=this.opt.accuracy,h=typeof m=="string"?m:m.value,g=typeof m=="string"?[]:m.limiters,y="";switch(g.forEach(function(v){y+="|"+c.escapeStr(v)}),h){case"partially":default:return"()("+l+")";case"complementary":return y="\\s"+(y||this.escapeStr(d)),"()([^"+y+"]*"+l+"[^"+y+"]*)";case"exactly":return"(^|\\s"+y+")("+l+")(?=$|\\s"+y+")"}}},{key:"getSeparatedKeywords",value:function(l){var c=this,d=[];return l.forEach(function(m){c.opt.separateWordSearch?m.split(" ").forEach(function(h){h.trim()&&d.indexOf(h)===-1&&d.push(h)}):m.trim()&&d.indexOf(m)===-1&&d.push(m)}),{keywords:d.sort(function(m,h){return h.length-m.length}),length:d.length}}},{key:"isNumeric",value:function(l){return Number(parseFloat(l))==l}},{key:"checkRanges",value:function(l){var c=this;if(!Array.isArray(l)||Object.prototype.toString.call(l[0])!=="[object Object]")return this.log("markRanges() will only accept an array of objects"),this.opt.noMatch(l),[];var d=[],m=0;return l.sort(function(h,g){return h.start-g.start}).forEach(function(h){var g=c.callNoMatchOnInvalidRanges(h,m),y=g.start,v=g.end,D=g.valid;D&&(h.start=y,h.length=v-y,d.push(h),m=v)}),d}},{key:"callNoMatchOnInvalidRanges",value:function(l,c){var d=void 0,m=void 0,h=!1;return l&&typeof l.start!="undefined"?(d=parseInt(l.start,10),m=d+parseInt(l.length,10),this.isNumeric(l.start)&&this.isNumeric(l.length)&&m-c>0&&m-d>0?h=!0:(this.log("Ignoring invalid or overlapping range: "+(""+JSON.stringify(l))),this.opt.noMatch(l))):(this.log("Ignoring invalid range: "+JSON.stringify(l)),this.opt.noMatch(l)),{start:d,end:m,valid:h}}},{key:"checkWhitespaceRanges",value:function(l,c,d){var m=void 0,h=!0,g=d.length,y=c-g,v=parseInt(l.start,10)-y;return v=v>g?g:v,m=v+parseInt(l.length,10),m>g&&(m=g,this.log("End range automatically set to the max value of "+g)),v<0||m-v<0||v>g||m>g?(h=!1,this.log("Invalid range: "+JSON.stringify(l)),this.opt.noMatch(l)):d.substring(v,m).replace(/\s+/g,"")===""&&(h=!1,this.log("Skipping whitespace only range: "+JSON.stringify(l)),this.opt.noMatch(l)),{start:v,end:m,valid:h}}},{key:"getTextNodes",value:function(l){var c=this,d="",m=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,function(h){m.push({start:d.length,end:(d+=h.textContent).length,node:h})},function(h){return c.matchesExclude(h.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},function(){l({value:d,nodes:m})})}},{key:"matchesExclude",value:function(l){return i.matches(l,this.opt.exclude.concat(["script","style","title","head","html"]))}},{key:"wrapRangeInTextNode",value:function(l,c,d){var m=this.opt.element?this.opt.element:"mark",h=l.splitText(c),g=h.splitText(d-c),y=document.createElement(m);return y.setAttribute("data-markjs","true"),this.opt.className&&y.setAttribute("class",this.opt.className),y.textContent=h.textContent,h.parentNode.replaceChild(y,h),g}},{key:"wrapRangeInMappedTextNode",value:function(l,c,d,m,h){var g=this;l.nodes.every(function(y,v){var D=l.nodes[v+1];if(typeof D=="undefined"||D.start>c){if(!m(y.node))return!1;var I=c-y.start,C=(d>y.end?y.end:d)-y.start,x=l.value.substr(0,y.start),O=l.value.substr(C+y.start);if(y.node=g.wrapRangeInTextNode(y.node,I,C),l.value=x+O,l.nodes.forEach(function(A,P){P>=v&&(l.nodes[P].start>0&&P!==v&&(l.nodes[P].start-=C),l.nodes[P].end-=C)}),d-=C,h(y.node.previousSibling,y.start),d>y.end)c=y.end;else return!1}return!0})}},{key:"wrapMatches",value:function(l,c,d,m,h){var g=this,y=c===0?0:c+1;this.getTextNodes(function(v){v.nodes.forEach(function(D){D=D.node;for(var I=void 0;(I=l.exec(D.textContent))!==null&&I[y]!=="";)if(d(I[y],D)){var C=I.index;if(y!==0)for(var x=1;x{(function(e,t){typeof Um=="object"&&typeof ls!="undefined"?ls.exports=t():typeof define=="function"&&define.amd?define(t):e.moment=t()})(Um,function(){"use strict";var e;function t(){return e.apply(null,arguments)}function r(f){e=f}function n(f){return f instanceof Array||Object.prototype.toString.call(f)==="[object Array]"}function i(f){return f!=null&&Object.prototype.toString.call(f)==="[object Object]"}function a(f,p){return Object.prototype.hasOwnProperty.call(f,p)}function o(f){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(f).length===0;var p;for(p in f)if(a(f,p))return!1;return!0}function s(f){return f===void 0}function u(f){return typeof f=="number"||Object.prototype.toString.call(f)==="[object Number]"}function l(f){return f instanceof Date||Object.prototype.toString.call(f)==="[object Date]"}function c(f,p){var w=[],S,F=f.length;for(S=0;S>>0,S;for(S=0;S0)for(w=0;w=0;return(j?w?"+":"":"-")+Math.pow(10,Math.max(0,F)).toString().substr(1)+S}var Ce=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,U=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Je={},it={};function N(f,p,w,S){var F=S;typeof S=="string"&&(F=function(){return this[S]()}),f&&(it[f]=F),p&&(it[p[0]]=function(){return De(F.apply(this,arguments),p[1],p[2])}),w&&(it[w]=function(){return this.localeData().ordinal(F.apply(this,arguments),f)})}function Ze(f){return f.match(/\[[\s\S]/)?f.replace(/^\[|\]$/g,""):f.replace(/\\/g,"")}function It(f){var p=f.match(Ce),w,S;for(w=0,S=p.length;w=0&&U.test(f);)f=f.replace(U,S),U.lastIndex=0,w-=1;return f}var vt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Wt(f){var p=this._longDateFormat[f],w=this._longDateFormat[f.toUpperCase()];return p||!w?p:(this._longDateFormat[f]=w.match(Ce).map(function(S){return S==="MMMM"||S==="MM"||S==="DD"||S==="dddd"?S.slice(1):S}).join(""),this._longDateFormat[f])}var Tt="Invalid date";function Jt(){return this._invalidDate}var en="%d",gn=/\d{1,2}/;function yn(f){return this._ordinal.replace("%d",f)}var vn={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function xn(f,p,w,S){var F=this._relativeTime[w];return Q(F)?F(f,p,w,S):F.replace(/%d/i,f)}function jn(f,p){var w=this._relativeTime[f>0?"future":"past"];return Q(w)?w(p):w.replace(/%s/i,p)}var sn={};function Rt(f,p){var w=f.toLowerCase();sn[w]=sn[w+"s"]=sn[p]=f}function Vt(f){return typeof f=="string"?sn[f]||sn[f.toLowerCase()]:void 0}function Sr(f){var p={},w,S;for(S in f)a(f,S)&&(w=Vt(S),w&&(p[w]=f[S]));return p}var Rr={};function Bt(f,p){Rr[f]=p}function Hr(f){var p=[],w;for(w in f)a(f,w)&&p.push({unit:w,priority:Rr[w]});return p.sort(function(S,F){return S.priority-F.priority}),p}function rn(f){return f%4===0&&f%100!==0||f%400===0}function At(f){return f<0?Math.ceil(f)||0:Math.floor(f)}function Z(f){var p=+f,w=0;return p!==0&&isFinite(p)&&(w=At(p)),w}function me(f,p){return function(w){return w!=null?(at(this,f,w),t.updateOffset(this,p),this):Ie(this,f)}}function Ie(f,p){return f.isValid()?f._d["get"+(f._isUTC?"UTC":"")+p]():NaN}function at(f,p,w){f.isValid()&&!isNaN(w)&&(p==="FullYear"&&rn(f.year())&&f.month()===1&&f.date()===29?(w=Z(w),f._d["set"+(f._isUTC?"UTC":"")+p](w,f.month(),b(w,f.month()))):f._d["set"+(f._isUTC?"UTC":"")+p](w))}function Dt(f){return f=Vt(f),Q(this[f])?this[f]():this}function Cn(f,p){if(typeof f=="object"){f=Sr(f);var w=Hr(f),S,F=w.length;for(S=0;S68?1900:2e3)};var On=me("FullYear",!0);function Vn(){return rn(this.year())}function ki(f,p,w,S,F,j,se){var Pe;return f<100&&f>=0?(Pe=new Date(f+400,p,w,S,F,j,se),isFinite(Pe.getFullYear())&&Pe.setFullYear(f)):Pe=new Date(f,p,w,S,F,j,se),Pe}function kr(f){var p,w;return f<100&&f>=0?(w=Array.prototype.slice.call(arguments),w[0]=f+400,p=new Date(Date.UTC.apply(null,w)),isFinite(p.getUTCFullYear())&&p.setUTCFullYear(f)):p=new Date(Date.UTC.apply(null,arguments)),p}function Jr(f,p,w){var S=7+p-w,F=(7+kr(f,0,S).getUTCDay()-p)%7;return-F+S-1}function My(f,p,w,S,F){var j=(7+w-S)%7,se=Jr(f,S,F),Pe=1+7*(p-1)+j+se,ut,$t;return Pe<=0?(ut=f-1,$t=qt(ut)+Pe):Pe>qt(f)?(ut=f+1,$t=Pe-qt(f)):(ut=f,$t=Pe),{year:ut,dayOfYear:$t}}function Ns(f,p,w){var S=Jr(f.year(),p,w),F=Math.floor((f.dayOfYear()-S-1)/7)+1,j,se;return F<1?(se=f.year()-1,j=F+xi(se,p,w)):F>xi(f.year(),p,w)?(j=F-xi(f.year(),p,w),se=f.year()+1):(se=f.year(),j=F),{week:j,year:se}}function xi(f,p,w){var S=Jr(f,p,w),F=Jr(f+1,p,w);return(qt(f)-S+F)/7}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),Rt("week","w"),Rt("isoWeek","W"),Bt("week",5),Bt("isoWeek",5),ae("w",L),ae("ww",L,Ht),ae("W",L),ae("WW",L,Ht),Ft(["w","ww","W","WW"],function(f,p,w,S){p[S.substr(0,1)]=Z(f)});function j_(f){return Ns(f,this._week.dow,this._week.doy).week}var q_={dow:0,doy:6};function G_(){return this._week.dow}function J_(){return this._week.doy}function Z_(f){var p=this.localeData().week(this);return f==null?p:this.add((f-p)*7,"d")}function Q_(f){var p=Ns(this,1,4).week;return f==null?p:this.add((f-p)*7,"d")}N("d",0,"do","day"),N("dd",0,0,function(f){return this.localeData().weekdaysMin(this,f)}),N("ddd",0,0,function(f){return this.localeData().weekdaysShort(this,f)}),N("dddd",0,0,function(f){return this.localeData().weekdays(this,f)}),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),Rt("day","d"),Rt("weekday","e"),Rt("isoWeekday","E"),Bt("day",11),Bt("weekday",11),Bt("isoWeekday",11),ae("d",L),ae("e",L),ae("E",L),ae("dd",function(f,p){return p.weekdaysMinRegex(f)}),ae("ddd",function(f,p){return p.weekdaysShortRegex(f)}),ae("dddd",function(f,p){return p.weekdaysRegex(f)}),Ft(["dd","ddd","dddd"],function(f,p,w,S){var F=w._locale.weekdaysParse(f,S,w._strict);F!=null?p.d=F:g(w).invalidWeekday=f}),Ft(["d","e","E"],function(f,p,w,S){p[S]=Z(f)});function X_(f,p){return typeof f!="string"?f:isNaN(f)?(f=p.weekdaysParse(f),typeof f=="number"?f:null):parseInt(f,10)}function e1(f,p){return typeof f=="string"?p.weekdaysParse(f)%7||7:isNaN(f)?null:f}function bf(f,p){return f.slice(p,7).concat(f.slice(0,p))}var t1="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ty="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),n1="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),r1=ye,i1=ye,a1=ye;function o1(f,p){var w=n(this._weekdays)?this._weekdays:this._weekdays[f&&f!==!0&&this._weekdays.isFormat.test(p)?"format":"standalone"];return f===!0?bf(w,this._week.dow):f?w[f.day()]:w}function s1(f){return f===!0?bf(this._weekdaysShort,this._week.dow):f?this._weekdaysShort[f.day()]:this._weekdaysShort}function l1(f){return f===!0?bf(this._weekdaysMin,this._week.dow):f?this._weekdaysMin[f.day()]:this._weekdaysMin}function u1(f,p,w){var S,F,j,se=f.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],S=0;S<7;++S)j=m([2e3,1]).day(S),this._minWeekdaysParse[S]=this.weekdaysMin(j,"").toLocaleLowerCase(),this._shortWeekdaysParse[S]=this.weekdaysShort(j,"").toLocaleLowerCase(),this._weekdaysParse[S]=this.weekdays(j,"").toLocaleLowerCase();return w?p==="dddd"?(F=_.call(this._weekdaysParse,se),F!==-1?F:null):p==="ddd"?(F=_.call(this._shortWeekdaysParse,se),F!==-1?F:null):(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null):p==="dddd"?(F=_.call(this._weekdaysParse,se),F!==-1||(F=_.call(this._shortWeekdaysParse,se),F!==-1)?F:(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null)):p==="ddd"?(F=_.call(this._shortWeekdaysParse,se),F!==-1||(F=_.call(this._weekdaysParse,se),F!==-1)?F:(F=_.call(this._minWeekdaysParse,se),F!==-1?F:null)):(F=_.call(this._minWeekdaysParse,se),F!==-1||(F=_.call(this._weekdaysParse,se),F!==-1)?F:(F=_.call(this._shortWeekdaysParse,se),F!==-1?F:null))}function c1(f,p,w){var S,F,j;if(this._weekdaysParseExact)return u1.call(this,f,p,w);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),S=0;S<7;S++){if(F=m([2e3,1]).day(S),w&&!this._fullWeekdaysParse[S]&&(this._fullWeekdaysParse[S]=new RegExp("^"+this.weekdays(F,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[S]=new RegExp("^"+this.weekdaysShort(F,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[S]=new RegExp("^"+this.weekdaysMin(F,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[S]||(j="^"+this.weekdays(F,"")+"|^"+this.weekdaysShort(F,"")+"|^"+this.weekdaysMin(F,""),this._weekdaysParse[S]=new RegExp(j.replace(".",""),"i")),w&&p==="dddd"&&this._fullWeekdaysParse[S].test(f))return S;if(w&&p==="ddd"&&this._shortWeekdaysParse[S].test(f))return S;if(w&&p==="dd"&&this._minWeekdaysParse[S].test(f))return S;if(!w&&this._weekdaysParse[S].test(f))return S}}function d1(f){if(!this.isValid())return f!=null?this:NaN;var p=this._isUTC?this._d.getUTCDay():this._d.getDay();return f!=null?(f=X_(f,this.localeData()),this.add(f-p,"d")):p}function f1(f){if(!this.isValid())return f!=null?this:NaN;var p=(this.day()+7-this.localeData()._week.dow)%7;return f==null?p:this.add(f-p,"d")}function h1(f){if(!this.isValid())return f!=null?this:NaN;if(f!=null){var p=e1(f,this.localeData());return this.day(this.day()%7?p:p-7)}else return this.day()||7}function m1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysStrictRegex:this._weekdaysRegex):(a(this,"_weekdaysRegex")||(this._weekdaysRegex=r1),this._weekdaysStrictRegex&&f?this._weekdaysStrictRegex:this._weekdaysRegex)}function p1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(a(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=i1),this._weekdaysShortStrictRegex&&f?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function g1(f){return this._weekdaysParseExact?(a(this,"_weekdaysRegex")||Df.call(this),f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(a(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=a1),this._weekdaysMinStrictRegex&&f?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Df(){function f(lr,Fi){return Fi.length-lr.length}var p=[],w=[],S=[],F=[],j,se,Pe,ut,$t;for(j=0;j<7;j++)se=m([2e3,1]).day(j),Pe=Te(this.weekdaysMin(se,"")),ut=Te(this.weekdaysShort(se,"")),$t=Te(this.weekdays(se,"")),p.push(Pe),w.push(ut),S.push($t),F.push(Pe),F.push(ut),F.push($t);p.sort(f),w.sort(f),S.sort(f),F.sort(f),this._weekdaysRegex=new RegExp("^("+F.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+S.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+w.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+p.join("|")+")","i")}function Sf(){return this.hours()%12||12}function y1(){return this.hours()||24}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Sf),N("k",["kk",2],0,y1),N("hmm",0,0,function(){return""+Sf.apply(this)+De(this.minutes(),2)}),N("hmmss",0,0,function(){return""+Sf.apply(this)+De(this.minutes(),2)+De(this.seconds(),2)}),N("Hmm",0,0,function(){return""+this.hours()+De(this.minutes(),2)}),N("Hmmss",0,0,function(){return""+this.hours()+De(this.minutes(),2)+De(this.seconds(),2)});function Fy(f,p){N(f,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),p)})}Fy("a",!0),Fy("A",!1),Rt("hour","h"),Bt("hour",13);function Iy(f,p){return p._meridiemParse}ae("a",Iy),ae("A",Iy),ae("H",L),ae("h",L),ae("k",L),ae("HH",L,Ht),ae("hh",L,Ht),ae("kk",L,Ht),ae("hmm",K),ae("hmmss",ee),ae("Hmm",K),ae("Hmmss",ee),We(["H","HH"],Yt),We(["k","kk"],function(f,p,w){var S=Z(f);p[Yt]=S===24?0:S}),We(["a","A"],function(f,p,w){w._isPm=w._locale.isPM(f),w._meridiem=f}),We(["h","hh"],function(f,p,w){p[Yt]=Z(f),g(w).bigHour=!0}),We("hmm",function(f,p,w){var S=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S)),g(w).bigHour=!0}),We("hmmss",function(f,p,w){var S=f.length-4,F=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S,2)),p[Er]=Z(f.substr(F)),g(w).bigHour=!0}),We("Hmm",function(f,p,w){var S=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S))}),We("Hmmss",function(f,p,w){var S=f.length-4,F=f.length-2;p[Yt]=Z(f.substr(0,S)),p[Bn]=Z(f.substr(S,2)),p[Er]=Z(f.substr(F))});function v1(f){return(f+"").toLowerCase().charAt(0)==="p"}var w1=/[ap]\.?m?\.?/i,b1=me("Hours",!0);function D1(f,p,w){return f>11?w?"pm":"PM":w?"am":"AM"}var Ay={calendar:be,longDateFormat:vt,invalidDate:Tt,ordinal:en,dayOfMonthOrdinalParse:gn,relativeTime:vn,months:T,monthsShort:V,week:q_,weekdays:t1,weekdaysMin:n1,weekdaysShort:Ty,meridiemParse:w1},tn={},Rs={},Hs;function S1(f,p){var w,S=Math.min(f.length,p.length);for(w=0;w0;){if(F=nu(j.slice(0,w).join("-")),F)return F;if(S&&S.length>=w&&S1(j,S)>=w-1)break;w--}p++}return Hs}function k1(f){return f.match("^[^/\\\\]*$")!=null}function nu(f){var p=null,w;if(tn[f]===void 0&&typeof ls!="undefined"&&ls&&ls.exports&&k1(f))try{p=Hs._abbr,w=require,w("./locale/"+f),na(p)}catch(S){tn[f]=null}return tn[f]}function na(f,p){var w;return f&&(s(p)?w=Ci(f):w=Ef(f,p),w?Hs=w:typeof console!="undefined"&&console.warn&&console.warn("Locale "+f+" not found. Did you forget to load it?")),Hs._abbr}function Ef(f,p){if(p!==null){var w,S=Ay;if(p.abbr=f,tn[f]!=null)J("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),S=tn[f]._config;else if(p.parentLocale!=null)if(tn[p.parentLocale]!=null)S=tn[p.parentLocale]._config;else if(w=nu(p.parentLocale),w!=null)S=w._config;else return Rs[p.parentLocale]||(Rs[p.parentLocale]=[]),Rs[p.parentLocale].push({name:f,config:p}),null;return tn[f]=new re(te(S,p)),Rs[f]&&Rs[f].forEach(function(F){Ef(F.name,F.config)}),na(f),tn[f]}else return delete tn[f],null}function x1(f,p){if(p!=null){var w,S,F=Ay;tn[f]!=null&&tn[f].parentLocale!=null?tn[f].set(te(tn[f]._config,p)):(S=nu(f),S!=null&&(F=S._config),p=te(F,p),S==null&&(p.abbr=f),w=new re(p),w.parentLocale=tn[f],tn[f]=w),na(f)}else tn[f]!=null&&(tn[f].parentLocale!=null?(tn[f]=tn[f].parentLocale,f===na()&&na(f)):tn[f]!=null&&delete tn[f]);return tn[f]}function Ci(f){var p;if(f&&f._locale&&f._locale._abbr&&(f=f._locale._abbr),!f)return Hs;if(!n(f)){if(p=nu(f),p)return p;f=[f]}return E1(f)}function C1(){return ne(tn)}function kf(f){var p,w=f._a;return w&&g(f).overflow===-2&&(p=w[or]<0||w[or]>11?or:w[sr]<1||w[sr]>b(w[Ot],w[or])?sr:w[Yt]<0||w[Yt]>24||w[Yt]===24&&(w[Bn]!==0||w[Er]!==0||w[Gr]!==0)?Yt:w[Bn]<0||w[Bn]>59?Bn:w[Er]<0||w[Er]>59?Er:w[Gr]<0||w[Gr]>999?Gr:-1,g(f)._overflowDayOfYear&&(psr)&&(p=sr),g(f)._overflowWeeks&&p===-1&&(p=tu),g(f)._overflowWeekday&&p===-1&&(p=z),g(f).overflow=p),f}var _1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,M1=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,T1=/Z|[+-]\d\d(?::?\d\d)?/,ru=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],xf=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],F1=/^\/?Date\((-?\d+)/i,I1=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,A1={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ly(f){var p,w,S=f._i,F=_1.exec(S)||M1.exec(S),j,se,Pe,ut,$t=ru.length,lr=xf.length;if(F){for(g(f).iso=!0,p=0,w=$t;pqt(se)||f._dayOfYear===0)&&(g(f)._overflowDayOfYear=!0),w=kr(se,0,f._dayOfYear),f._a[or]=w.getUTCMonth(),f._a[sr]=w.getUTCDate()),p=0;p<3&&f._a[p]==null;++p)f._a[p]=S[p]=F[p];for(;p<7;p++)f._a[p]=S[p]=f._a[p]==null?p===2?1:0:f._a[p];f._a[Yt]===24&&f._a[Bn]===0&&f._a[Er]===0&&f._a[Gr]===0&&(f._nextDay=!0,f._a[Yt]=0),f._d=(f._useUTC?kr:ki).apply(null,S),j=f._useUTC?f._d.getUTCDay():f._d.getDay(),f._tzm!=null&&f._d.setUTCMinutes(f._d.getUTCMinutes()-f._tzm),f._nextDay&&(f._a[Yt]=24),f._w&&typeof f._w.d!="undefined"&&f._w.d!==j&&(g(f).weekdayMismatch=!0)}}function V1(f){var p,w,S,F,j,se,Pe,ut,$t;p=f._w,p.GG!=null||p.W!=null||p.E!=null?(j=1,se=4,w=bo(p.GG,f._a[Ot],Ns(Zt(),1,4).year),S=bo(p.W,1),F=bo(p.E,1),(F<1||F>7)&&(ut=!0)):(j=f._locale._week.dow,se=f._locale._week.doy,$t=Ns(Zt(),j,se),w=bo(p.gg,f._a[Ot],$t.year),S=bo(p.w,$t.week),p.d!=null?(F=p.d,(F<0||F>6)&&(ut=!0)):p.e!=null?(F=p.e+j,(p.e<0||p.e>6)&&(ut=!0)):F=j),S<1||S>xi(w,j,se)?g(f)._overflowWeeks=!0:ut!=null?g(f)._overflowWeekday=!0:(Pe=My(w,S,F,j,se),f._a[Ot]=Pe.year,f._dayOfYear=Pe.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function _f(f){if(f._f===t.ISO_8601){Ly(f);return}if(f._f===t.RFC_2822){Py(f);return}f._a=[],g(f).empty=!0;var p=""+f._i,w,S,F,j,se,Pe=p.length,ut=0,$t,lr;for(F=jt(f._f,f._locale).match(Ce)||[],lr=F.length,w=0;w0&&g(f).unusedInput.push(se),p=p.slice(p.indexOf(S)+S.length),ut+=S.length),it[j]?(S?g(f).empty=!1:g(f).unusedTokens.push(j),Hn(j,S,f)):f._strict&&!S&&g(f).unusedTokens.push(j);g(f).charsLeftOver=Pe-ut,p.length>0&&g(f).unusedInput.push(p),f._a[Yt]<=12&&g(f).bigHour===!0&&f._a[Yt]>0&&(g(f).bigHour=void 0),g(f).parsedDateParts=f._a.slice(0),g(f).meridiem=f._meridiem,f._a[Yt]=$1(f._locale,f._a[Yt],f._meridiem),$t=g(f).era,$t!==null&&(f._a[Ot]=f._locale.erasConvertYear($t,f._a[Ot])),Cf(f),kf(f)}function $1(f,p,w){var S;return w==null?p:f.meridiemHour!=null?f.meridiemHour(p,w):(f.isPM!=null&&(S=f.isPM(w),S&&p<12&&(p+=12),!S&&p===12&&(p=0)),p)}function U1(f){var p,w,S,F,j,se,Pe=!1,ut=f._f.length;if(ut===0){g(f).invalidFormat=!0,f._d=new Date(NaN);return}for(F=0;Fthis?this:f:D()});function Hy(f,p){var w,S;if(p.length===1&&n(p[0])&&(p=p[0]),!p.length)return Zt();for(w=p[0],S=1;Sthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function uM(){if(!s(this._isDSTShifted))return this._isDSTShifted;var f={},p;return x(f,this),f=Ny(f),f._a?(p=f._isUTC?m(f._a):Zt(f._a),this._isDSTShifted=this.isValid()&&eM(f._a,p.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function cM(){return this.isValid()?!this._isUTC:!1}function dM(){return this.isValid()?this._isUTC:!1}function Vy(){return this.isValid()?this._isUTC&&this._offset===0:!1}var fM=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,hM=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Zr(f,p){var w=f,S=null,F,j,se;return au(f)?w={ms:f._milliseconds,d:f._days,M:f._months}:u(f)||!isNaN(+f)?(w={},p?w[p]=+f:w.milliseconds=+f):(S=fM.exec(f))?(F=S[1]==="-"?-1:1,w={y:0,d:Z(S[sr])*F,h:Z(S[Yt])*F,m:Z(S[Bn])*F,s:Z(S[Er])*F,ms:Z(Mf(S[Gr]*1e3))*F}):(S=hM.exec(f))?(F=S[1]==="-"?-1:1,w={y:Ha(S[2],F),M:Ha(S[3],F),w:Ha(S[4],F),d:Ha(S[5],F),h:Ha(S[6],F),m:Ha(S[7],F),s:Ha(S[8],F)}):w==null?w={}:typeof w=="object"&&("from"in w||"to"in w)&&(se=mM(Zt(w.from),Zt(w.to)),w={},w.ms=se.milliseconds,w.M=se.months),j=new iu(w),au(f)&&a(f,"_locale")&&(j._locale=f._locale),au(f)&&a(f,"_isValid")&&(j._isValid=f._isValid),j}Zr.fn=iu.prototype,Zr.invalid=X1;function Ha(f,p){var w=f&&parseFloat(f.replace(",","."));return(isNaN(w)?0:w)*p}function $y(f,p){var w={};return w.months=p.month()-f.month()+(p.year()-f.year())*12,f.clone().add(w.months,"M").isAfter(p)&&--w.months,w.milliseconds=+p-+f.clone().add(w.months,"M"),w}function mM(f,p){var w;return f.isValid()&&p.isValid()?(p=Ff(p,f),f.isBefore(p)?w=$y(f,p):(w=$y(p,f),w.milliseconds=-w.milliseconds,w.months=-w.months),w):{milliseconds:0,months:0}}function Uy(f,p){return function(w,S){var F,j;return S!==null&&!isNaN(+S)&&(J(p,"moment()."+p+"(period, number) is deprecated. Please use moment()."+p+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),j=w,w=S,S=j),F=Zr(w,S),Wy(this,F,f),this}}function Wy(f,p,w,S){var F=p._milliseconds,j=Mf(p._days),se=Mf(p._months);f.isValid()&&(S=S==null?!0:S,se&&Qe(f,Ie(f,"Month")+se*w),j&&at(f,"Date",Ie(f,"Date")+j*w),F&&f._d.setTime(f._d.valueOf()+F*w),S&&t.updateOffset(f,j||se))}var pM=Uy(1,"add"),gM=Uy(-1,"subtract");function Yy(f){return typeof f=="string"||f instanceof String}function yM(f){return A(f)||l(f)||Yy(f)||u(f)||wM(f)||vM(f)||f===null||f===void 0}function vM(f){var p=i(f)&&!o(f),w=!1,S=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],F,j,se=S.length;for(F=0;Fw.valueOf():w.valueOf()9999?Mt(w,p?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Q(Date.prototype.toISOString)?p?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Mt(w,"Z")):Mt(w,p?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function OM(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var f="moment",p="",w,S,F,j;return this.isLocal()||(f=this.utcOffset()===0?"moment.utc":"moment.parseZone",p="Z"),w="["+f+'("]',S=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",F="-MM-DD[T]HH:mm:ss.SSS",j=p+'[")]',this.format(w+S+F+j)}function LM(f){f||(f=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var p=Mt(this,f);return this.localeData().postformat(p)}function PM(f,p){return this.isValid()&&(A(f)&&f.isValid()||Zt(f).isValid())?Zr({to:this,from:f}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function NM(f){return this.from(Zt(),f)}function RM(f,p){return this.isValid()&&(A(f)&&f.isValid()||Zt(f).isValid())?Zr({from:this,to:f}).locale(this.locale()).humanize(!p):this.localeData().invalidDate()}function HM(f){return this.to(Zt(),f)}function zy(f){var p;return f===void 0?this._locale._abbr:(p=Ci(f),p!=null&&(this._locale=p),this)}var Ky=B("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(f){return f===void 0?this.localeData():this.locale(f)});function jy(){return this._locale}var su=1e3,Do=60*su,lu=60*Do,qy=(365*400+97)*24*lu;function So(f,p){return(f%p+p)%p}function Gy(f,p,w){return f<100&&f>=0?new Date(f+400,p,w)-qy:new Date(f,p,w).valueOf()}function Jy(f,p,w){return f<100&&f>=0?Date.UTC(f+400,p,w)-qy:Date.UTC(f,p,w)}function BM(f){var p,w;if(f=Vt(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?Jy:Gy,f){case"year":p=w(this.year(),0,1);break;case"quarter":p=w(this.year(),this.month()-this.month()%3,1);break;case"month":p=w(this.year(),this.month(),1);break;case"week":p=w(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":p=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":p=w(this.year(),this.month(),this.date());break;case"hour":p=this._d.valueOf(),p-=So(p+(this._isUTC?0:this.utcOffset()*Do),lu);break;case"minute":p=this._d.valueOf(),p-=So(p,Do);break;case"second":p=this._d.valueOf(),p-=So(p,su);break}return this._d.setTime(p),t.updateOffset(this,!0),this}function VM(f){var p,w;if(f=Vt(f),f===void 0||f==="millisecond"||!this.isValid())return this;switch(w=this._isUTC?Jy:Gy,f){case"year":p=w(this.year()+1,0,1)-1;break;case"quarter":p=w(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":p=w(this.year(),this.month()+1,1)-1;break;case"week":p=w(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":p=w(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":p=w(this.year(),this.month(),this.date()+1)-1;break;case"hour":p=this._d.valueOf(),p+=lu-So(p+(this._isUTC?0:this.utcOffset()*Do),lu)-1;break;case"minute":p=this._d.valueOf(),p+=Do-So(p,Do)-1;break;case"second":p=this._d.valueOf(),p+=su-So(p,su)-1;break}return this._d.setTime(p),t.updateOffset(this,!0),this}function $M(){return this._d.valueOf()-(this._offset||0)*6e4}function UM(){return Math.floor(this.valueOf()/1e3)}function WM(){return new Date(this.valueOf())}function YM(){var f=this;return[f.year(),f.month(),f.date(),f.hour(),f.minute(),f.second(),f.millisecond()]}function zM(){var f=this;return{years:f.year(),months:f.month(),date:f.date(),hours:f.hours(),minutes:f.minutes(),seconds:f.seconds(),milliseconds:f.milliseconds()}}function KM(){return this.isValid()?this.toISOString():null}function jM(){return v(this)}function qM(){return d({},g(this))}function GM(){return g(this).overflow}function JM(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}N("N",0,0,"eraAbbr"),N("NN",0,0,"eraAbbr"),N("NNN",0,0,"eraAbbr"),N("NNNN",0,0,"eraName"),N("NNNNN",0,0,"eraNarrow"),N("y",["y",1],"yo","eraYear"),N("y",["yy",2],0,"eraYear"),N("y",["yyy",3],0,"eraYear"),N("y",["yyyy",4],0,"eraYear"),ae("N",Af),ae("NN",Af),ae("NNN",Af),ae("NNNN",sT),ae("NNNNN",lT),We(["N","NN","NNN","NNNN","NNNNN"],function(f,p,w,S){var F=w._locale.erasParse(f,S,w._strict);F?g(w).era=F:g(w).invalidEra=f}),ae("y",ge),ae("yy",ge),ae("yyy",ge),ae("yyyy",ge),ae("yo",uT),We(["y","yy","yyy","yyyy"],Ot),We(["yo"],function(f,p,w,S){var F;w._locale._eraYearOrdinalRegex&&(F=f.match(w._locale._eraYearOrdinalRegex)),w._locale.eraYearOrdinalParse?p[Ot]=w._locale.eraYearOrdinalParse(f,F):p[Ot]=parseInt(f,10)});function ZM(f,p){var w,S,F,j=this._eras||Ci("en")._eras;for(w=0,S=j.length;w=0)return j[S]}function XM(f,p){var w=f.since<=f.until?1:-1;return p===void 0?t(f.since).year():t(f.since).year()+(p-f.offset)*w}function eT(){var f,p,w,S=this.localeData().eras();for(f=0,p=S.length;fj&&(p=j),gT.call(this,f,p,w,S,F))}function gT(f,p,w,S,F){var j=My(f,p,w,S,F),se=kr(j.year,0,j.dayOfYear);return this.year(se.getUTCFullYear()),this.month(se.getUTCMonth()),this.date(se.getUTCDate()),this}N("Q",0,"Qo","quarter"),Rt("quarter","Q"),Bt("quarter",7),ae("Q",_n),We("Q",function(f,p){p[or]=(Z(f)-1)*3});function yT(f){return f==null?Math.ceil((this.month()+1)/3):this.month((f-1)*3+this.month()%3)}N("D",["DD",2],"Do","date"),Rt("date","D"),Bt("date",9),ae("D",L),ae("DD",L,Ht),ae("Do",function(f,p){return f?p._dayOfMonthOrdinalParse||p._ordinalParse:p._dayOfMonthOrdinalParseLenient}),We(["D","DD"],sr),We("Do",function(f,p){p[sr]=Z(f.match(L)[0])});var Qy=me("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),Rt("dayOfYear","DDD"),Bt("dayOfYear",4),ae("DDD",ue),ae("DDDD",ar),We(["DDD","DDDD"],function(f,p,w){w._dayOfYear=Z(f)});function vT(f){var p=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return f==null?p:this.add(f-p,"d")}N("m",["mm",2],0,"minute"),Rt("minute","m"),Bt("minute",14),ae("m",L),ae("mm",L,Ht),We(["m","mm"],Bn);var wT=me("Minutes",!1);N("s",["ss",2],0,"second"),Rt("second","s"),Bt("second",15),ae("s",L),ae("ss",L,Ht),We(["s","ss"],Er);var bT=me("Seconds",!1);N("S",0,0,function(){return~~(this.millisecond()/100)}),N(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,function(){return this.millisecond()*10}),N(0,["SSSSS",5],0,function(){return this.millisecond()*100}),N(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),N(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),N(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),N(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Rt("millisecond","ms"),Bt("millisecond",16),ae("S",ue,_n),ae("SS",ue,Ht),ae("SSS",ue,ar);var ra,Xy;for(ra="SSSS";ra.length<=9;ra+="S")ae(ra,ge);function DT(f,p){p[Gr]=Z(("0."+f)*1e3)}for(ra="S";ra.length<=9;ra+="S")We(ra,DT);Xy=me("Milliseconds",!1),N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");function ST(){return this._isUTC?"UTC":""}function ET(){return this._isUTC?"Coordinated Universal Time":""}var we=O.prototype;we.add=pM,we.calendar=SM,we.clone=EM,we.diff=FM,we.endOf=VM,we.format=LM,we.from=PM,we.fromNow=NM,we.to=RM,we.toNow=HM,we.get=Dt,we.invalidAt=GM,we.isAfter=kM,we.isBefore=xM,we.isBetween=CM,we.isSame=_M,we.isSameOrAfter=MM,we.isSameOrBefore=TM,we.isValid=jM,we.lang=Ky,we.locale=zy,we.localeData=jy,we.max=j1,we.min=K1,we.parsingFlags=qM,we.set=Cn,we.startOf=BM,we.subtract=gM,we.toArray=YM,we.toObject=zM,we.toDate=WM,we.toISOString=AM,we.inspect=OM,typeof Symbol!="undefined"&&Symbol.for!=null&&(we[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),we.toJSON=KM,we.toString=IM,we.unix=UM,we.valueOf=$M,we.creationData=JM,we.eraName=eT,we.eraNarrow=tT,we.eraAbbr=nT,we.eraYear=rT,we.year=On,we.isLeapYear=Vn,we.weekYear=cT,we.isoWeekYear=dT,we.quarter=we.quarters=yT,we.month=ot,we.daysInMonth=qe,we.week=we.weeks=Z_,we.isoWeek=we.isoWeeks=Q_,we.weeksInYear=mT,we.weeksInWeekYear=pT,we.isoWeeksInYear=fT,we.isoWeeksInISOWeekYear=hT,we.date=Qy,we.day=we.days=d1,we.weekday=f1,we.isoWeekday=h1,we.dayOfYear=vT,we.hour=we.hours=b1,we.minute=we.minutes=wT,we.second=we.seconds=bT,we.millisecond=we.milliseconds=Xy,we.utcOffset=nM,we.utc=iM,we.local=aM,we.parseZone=oM,we.hasAlignedHourOffset=sM,we.isDST=lM,we.isLocal=cM,we.isUtcOffset=dM,we.isUtc=Vy,we.isUTC=Vy,we.zoneAbbr=ST,we.zoneName=ET,we.dates=B("dates accessor is deprecated. Use date instead.",Qy),we.months=B("months accessor is deprecated. Use month instead",ot),we.years=B("years accessor is deprecated. Use year instead",On),we.zone=B("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",rM),we.isDSTShifted=B("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",uM);function kT(f){return Zt(f*1e3)}function xT(){return Zt.apply(null,arguments).parseZone()}function ev(f){return f}var Lt=re.prototype;Lt.calendar=pe,Lt.longDateFormat=Wt,Lt.invalidDate=Jt,Lt.ordinal=yn,Lt.preparse=ev,Lt.postformat=ev,Lt.relativeTime=xn,Lt.pastFuture=jn,Lt.set=oe,Lt.eras=ZM,Lt.erasParse=QM,Lt.erasConvertYear=XM,Lt.erasAbbrRegex=aT,Lt.erasNameRegex=iT,Lt.erasNarrowRegex=oT,Lt.months=he,Lt.monthsShort=Me,Lt.monthsParse=Le,Lt.monthsRegex=st,Lt.monthsShortRegex=yt,Lt.week=j_,Lt.firstDayOfYear=J_,Lt.firstDayOfWeek=G_,Lt.weekdays=o1,Lt.weekdaysMin=l1,Lt.weekdaysShort=s1,Lt.weekdaysParse=c1,Lt.weekdaysRegex=m1,Lt.weekdaysShortRegex=p1,Lt.weekdaysMinRegex=g1,Lt.isPM=v1,Lt.meridiem=D1;function cu(f,p,w,S){var F=Ci(),j=m().set(S,p);return F[w](j,f)}function tv(f,p,w){if(u(f)&&(p=f,f=void 0),f=f||"",p!=null)return cu(f,p,w,"month");var S,F=[];for(S=0;S<12;S++)F[S]=cu(f,S,w,"month");return F}function Lf(f,p,w,S){typeof f=="boolean"?(u(p)&&(w=p,p=void 0),p=p||""):(p=f,w=p,f=!1,u(p)&&(w=p,p=void 0),p=p||"");var F=Ci(),j=f?F._week.dow:0,se,Pe=[];if(w!=null)return cu(p,(w+j)%7,S,"day");for(se=0;se<7;se++)Pe[se]=cu(p,(se+j)%7,S,"day");return Pe}function CT(f,p){return tv(f,p,"months")}function _T(f,p){return tv(f,p,"monthsShort")}function MT(f,p,w){return Lf(f,p,w,"weekdays")}function TT(f,p,w){return Lf(f,p,w,"weekdaysShort")}function FT(f,p,w){return Lf(f,p,w,"weekdaysMin")}na("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(f){var p=f%10,w=Z(f%100/10)===1?"th":p===1?"st":p===2?"nd":p===3?"rd":"th";return f+w}}),t.lang=B("moment.lang is deprecated. Use moment.locale instead.",na),t.langData=B("moment.langData is deprecated. Use moment.localeData instead.",Ci);var _i=Math.abs;function IT(){var f=this._data;return this._milliseconds=_i(this._milliseconds),this._days=_i(this._days),this._months=_i(this._months),f.milliseconds=_i(f.milliseconds),f.seconds=_i(f.seconds),f.minutes=_i(f.minutes),f.hours=_i(f.hours),f.months=_i(f.months),f.years=_i(f.years),this}function nv(f,p,w,S){var F=Zr(p,w);return f._milliseconds+=S*F._milliseconds,f._days+=S*F._days,f._months+=S*F._months,f._bubble()}function AT(f,p){return nv(this,f,p,1)}function OT(f,p){return nv(this,f,p,-1)}function rv(f){return f<0?Math.floor(f):Math.ceil(f)}function LT(){var f=this._milliseconds,p=this._days,w=this._months,S=this._data,F,j,se,Pe,ut;return f>=0&&p>=0&&w>=0||f<=0&&p<=0&&w<=0||(f+=rv(Pf(w)+p)*864e5,p=0,w=0),S.milliseconds=f%1e3,F=At(f/1e3),S.seconds=F%60,j=At(F/60),S.minutes=j%60,se=At(j/60),S.hours=se%24,p+=At(se/24),ut=At(iv(p)),w+=ut,p-=rv(Pf(ut)),Pe=At(w/12),w%=12,S.days=p,S.months=w,S.years=Pe,this}function iv(f){return f*4800/146097}function Pf(f){return f*146097/4800}function PT(f){if(!this.isValid())return NaN;var p,w,S=this._milliseconds;if(f=Vt(f),f==="month"||f==="quarter"||f==="year")switch(p=this._days+S/864e5,w=this._months+iv(p),f){case"month":return w;case"quarter":return w/3;case"year":return w/12}else switch(p=this._days+Math.round(Pf(this._months)),f){case"week":return p/7+S/6048e5;case"day":return p+S/864e5;case"hour":return p*24+S/36e5;case"minute":return p*1440+S/6e4;case"second":return p*86400+S/1e3;case"millisecond":return Math.floor(p*864e5)+S;default:throw new Error("Unknown unit "+f)}}function NT(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+Z(this._months/12)*31536e6:NaN}function Mi(f){return function(){return this.as(f)}}var RT=Mi("ms"),HT=Mi("s"),BT=Mi("m"),VT=Mi("h"),$T=Mi("d"),UT=Mi("w"),WT=Mi("M"),YT=Mi("Q"),zT=Mi("y");function KT(){return Zr(this)}function jT(f){return f=Vt(f),this.isValid()?this[f+"s"]():NaN}function Ba(f){return function(){return this.isValid()?this._data[f]:NaN}}var qT=Ba("milliseconds"),GT=Ba("seconds"),JT=Ba("minutes"),ZT=Ba("hours"),QT=Ba("days"),XT=Ba("months"),eF=Ba("years");function tF(){return At(this.days()/7)}var Ti=Math.round,Eo={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nF(f,p,w,S,F){return F.relativeTime(p||1,!!w,f,S)}function rF(f,p,w,S){var F=Zr(f).abs(),j=Ti(F.as("s")),se=Ti(F.as("m")),Pe=Ti(F.as("h")),ut=Ti(F.as("d")),$t=Ti(F.as("M")),lr=Ti(F.as("w")),Fi=Ti(F.as("y")),ia=j<=w.ss&&["s",j]||j0,ia[4]=S,nF.apply(null,ia)}function iF(f){return f===void 0?Ti:typeof f=="function"?(Ti=f,!0):!1}function aF(f,p){return Eo[f]===void 0?!1:p===void 0?Eo[f]:(Eo[f]=p,f==="s"&&(Eo.ss=p-1),!0)}function oF(f,p){if(!this.isValid())return this.localeData().invalidDate();var w=!1,S=Eo,F,j;return typeof f=="object"&&(p=f,f=!1),typeof f=="boolean"&&(w=f),typeof p=="object"&&(S=Object.assign({},Eo,p),p.s!=null&&p.ss==null&&(S.ss=p.s-1)),F=this.localeData(),j=rF(this,!w,S,F),w&&(j=F.pastFuture(+this,j)),F.postformat(j)}var Nf=Math.abs;function ko(f){return(f>0)-(f<0)||+f}function du(){if(!this.isValid())return this.localeData().invalidDate();var f=Nf(this._milliseconds)/1e3,p=Nf(this._days),w=Nf(this._months),S,F,j,se,Pe=this.asSeconds(),ut,$t,lr,Fi;return Pe?(S=At(f/60),F=At(S/60),f%=60,S%=60,j=At(w/12),w%=12,se=f?f.toFixed(3).replace(/\.?0+$/,""):"",ut=Pe<0?"-":"",$t=ko(this._months)!==ko(Pe)?"-":"",lr=ko(this._days)!==ko(Pe)?"-":"",Fi=ko(this._milliseconds)!==ko(Pe)?"-":"",ut+"P"+(j?$t+j+"Y":"")+(w?$t+w+"M":"")+(p?lr+p+"D":"")+(F||S||f?"T":"")+(F?Fi+F+"H":"")+(S?Fi+S+"M":"")+(f?Fi+se+"S":"")):"P0D"}var xt=iu.prototype;xt.isValid=Q1,xt.abs=IT,xt.add=AT,xt.subtract=OT,xt.as=PT,xt.asMilliseconds=RT,xt.asSeconds=HT,xt.asMinutes=BT,xt.asHours=VT,xt.asDays=$T,xt.asWeeks=UT,xt.asMonths=WT,xt.asQuarters=YT,xt.asYears=zT,xt.valueOf=NT,xt._bubble=LT,xt.clone=KT,xt.get=jT,xt.milliseconds=qT,xt.seconds=GT,xt.minutes=JT,xt.hours=ZT,xt.days=QT,xt.weeks=tF,xt.months=XT,xt.years=eF,xt.humanize=oF,xt.toISOString=du,xt.toString=du,xt.toJSON=du,xt.locale=zy,xt.localeData=jy,xt.toIsoString=B("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",du),xt.lang=Ky,N("X",0,0,"unix"),N("x",0,0,"valueOf"),ae("x",M),ae("X",ie),We("X",function(f,p,w){w._d=new Date(parseFloat(f)*1e3)}),We("x",function(f,p,w){w._d=new Date(Z(f))});return t.version="2.29.4",r(Zt),t.fn=we,t.min=q1,t.max=G1,t.now=J1,t.utc=m,t.unix=kT,t.months=CT,t.isDate=l,t.locale=na,t.invalid=D,t.duration=Zr,t.isMoment=A,t.weekdays=MT,t.parseZone=xT,t.localeData=Ci,t.isDuration=au,t.monthsShort=_T,t.weekdaysMin=FT,t.defineLocale=Ef,t.updateLocale=x1,t.locales=C1,t.weekdaysShort=TT,t.normalizeUnits=Vt,t.relativeTimeRounding=iF,t.relativeTimeThreshold=aF,t.calendarFormat=DM,t.prototype=we,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})});var dx=wn((Fd,_g)=>{(function(t,r){typeof Fd=="object"&&typeof _g=="object"?_g.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Fd=="object"?Fd.Choices=r():t.Choices=r()})(window,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(n,i,a){r.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:a})},r.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,i){if(i&1&&(n=r(n)),i&8||i&4&&typeof n=="object"&&n&&n.__esModule)return n;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(var o in n)r.d(a,o,function(s){return n[s]}.bind(null,o));return a},r.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(i,"a",i),i},r.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},r.p="/public/assets/scripts/",r(r.s=4)}([function(e,t,r){"use strict";var n=function(x){return i(x)&&!a(x)};function i(C){return!!C&&typeof C=="object"}function a(C){var x=Object.prototype.toString.call(C);return x==="[object RegExp]"||x==="[object Date]"||u(C)}var o=typeof Symbol=="function"&&Symbol.for,s=o?Symbol.for("react.element"):60103;function u(C){return C.$$typeof===s}function l(C){return Array.isArray(C)?[]:{}}function c(C,x){return x.clone!==!1&&x.isMergeableObject(C)?D(l(C),C,x):C}function d(C,x,O){return C.concat(x).map(function(A){return c(A,O)})}function m(C,x){if(!x.customMerge)return D;var O=x.customMerge(C);return typeof O=="function"?O:D}function h(C){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(C).filter(function(x){return C.propertyIsEnumerable(x)}):[]}function g(C){return Object.keys(C).concat(h(C))}function y(C,x){try{return x in C&&!(Object.hasOwnProperty.call(C,x)&&Object.propertyIsEnumerable.call(C,x))}catch(O){return!1}}function v(C,x,O){var A={};return O.isMergeableObject(C)&&g(C).forEach(function(P){A[P]=c(C[P],O)}),g(x).forEach(function(P){y(C,P)||(!O.isMergeableObject(x[P])||!C[P]?A[P]=c(x[P],O):A[P]=m(P,O)(C[P],x[P],O))}),A}function D(C,x,O){O=O||{},O.arrayMerge=O.arrayMerge||d,O.isMergeableObject=O.isMergeableObject||n,O.cloneUnlessOtherwiseSpecified=c;var A=Array.isArray(x),P=Array.isArray(C),B=A===P;return B?A?O.arrayMerge(C,x,O):v(C,x,O):c(x,O)}D.all=function(x,O){if(!Array.isArray(x))throw new Error("first argument should be an array");return x.reduce(function(A,P){return D(A,P,O)},{})};var I=D;e.exports=I},function(e,t,r){"use strict";(function(n,i){var a=r(3),o;typeof self!="undefined"?o=self:typeof window!="undefined"?o=window:typeof n!="undefined"?o=n:o=i;var s=Object(a.a)(o);t.a=s}).call(this,r(5),r(6)(e))},function(e,t,r){(function(n,i){e.exports=i()})(this,function(){return function(n){var i={};function a(o){if(i[o])return i[o].exports;var s=i[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=i,a.d=function(o,s,u){a.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:u})},a.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},a.t=function(o,s){if(1&s&&(o=a(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var u=Object.create(null);if(a.r(u),Object.defineProperty(u,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var l in o)a.d(u,l,function(c){return o[c]}.bind(null,l));return u},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=1)}([function(n,i){n.exports=function(a){return Array.isArray?Array.isArray(a):Object.prototype.toString.call(a)==="[object Array]"}},function(n,i,a){function o(m){return(o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h})(m)}function s(m,h){for(var g=0;g1&&arguments[1]!==void 0?arguments[1]:{limit:!1};this._log(`--------- +Search pattern: "`.concat(v,'"'));var I=this._prepareSearchers(v),C=I.tokenSearchers,x=I.fullSearcher,O=this._search(C,x),A=O.weights,P=O.results;return this._computeScore(A,P),this.options.shouldSort&&this._sort(P),D.limit&&typeof D.limit=="number"&&(P=P.slice(0,D.limit)),this._format(P)}},{key:"_prepareSearchers",value:function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",D=[];if(this.options.tokenize)for(var I=v.split(this.options.tokenSeparator),C=0,x=I.length;C0&&arguments[0]!==void 0?arguments[0]:[],D=arguments.length>1?arguments[1]:void 0,I=this.list,C={},x=[];if(typeof I[0]=="string"){for(var O=0,A=I.length;O1)throw new Error("Key weight has to be > 0 and <= 1");te=te.name}else P[te]={weight:1};this._analyze({key:te,value:this.options.getFn(J,te),record:J,index:B},{resultMap:C,results:x,tokenSearchers:v,fullSearcher:D})}return{weights:P,results:x}}},{key:"_analyze",value:function(v,D){var I=v.key,C=v.arrayIndex,x=C===void 0?-1:C,O=v.value,A=v.record,P=v.index,B=D.tokenSearchers,G=B===void 0?[]:B,J=D.fullSearcher,Q=J===void 0?[]:J,oe=D.resultMap,te=oe===void 0?{}:oe,re=D.results,ne=re===void 0?[]:re;if(O!=null){var be=!1,pe=-1,De=0;if(typeof O=="string"){this._log(` +Key: `.concat(I===""?"-":I));var Ce=Q.search(O);if(this._log('Full text: "'.concat(O,'", score: ').concat(Ce.score)),this.options.tokenize){for(var U=O.split(this.options.tokenSeparator),Je=[],it=0;it-1&&(Jt=(Jt+pe)/2),this._log("Score average:",Jt);var en=!this.options.tokenize||!this.options.matchAllTokens||De>=G.length;if(this._log(` +Check Matches: `.concat(en)),(be||Ce.isMatch)&&en){var gn=te[P];gn?gn.output.push({key:I,arrayIndex:x,value:O,score:Jt,matchedIndices:Ce.matchedIndices}):(te[P]={item:A,output:[{key:I,arrayIndex:x,value:O,score:Jt,matchedIndices:Ce.matchedIndices}]},ne.push(te[P]))}}else if(c(O))for(var yn=0,vn=O.length;yn-1&&(be.arrayIndex=ne.arrayIndex),Q.matches.push(be)}}}),this.options.includeScore&&C.push(function(J,Q){Q.score=J.score});for(var x=0,O=v.length;xD)return s(y,this.pattern,I);var C=this.options,x=C.location,O=C.distance,A=C.threshold,P=C.findAllMatches,B=C.minMatchCharLength;return u(y,this.pattern,this.patternAlphabet,{location:x,distance:O,threshold:A,findAllMatches:P,minMatchCharLength:B})}}])&&o(m.prototype,h),g&&o(m,g),d}();n.exports=c},function(n,i){var a=/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g;n.exports=function(o,s){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:/ +/g,l=new RegExp(s.replace(a,"\\$&").replace(u,"|")),c=o.match(l),d=!!c,m=[];if(d)for(var h=0,g=c.length;h=it;It-=1){var Mt=It-1,jt=c[u.charAt(Mt)];if(jt&&(Q[Mt]=1),Ze[It]=(Ze[It+1]<<1|1)&jt,Ce!==0&&(Ze[It]|=(ne[It+1]|ne[It])<<1|1|ne[It+1]),Ze[It]&De&&(be=o(l,{errors:Ce,currentLocation:Mt,expectedLocation:A,distance:y}))<=B){if(B=be,(G=Mt)<=A)break;it=Math.max(1,2*A-G)}}if(o(l,{errors:Ce+1,currentLocation:A,expectedLocation:A,distance:y})>B)break;ne=Ze}return{isMatch:G>=0,score:be===0?.001:be,matchedIndices:s(Q,O)}}},function(n,i){n.exports=function(a,o){var s=o.errors,u=s===void 0?0:s,l=o.currentLocation,c=l===void 0?0:l,d=o.expectedLocation,m=d===void 0?0:d,h=o.distance,g=h===void 0?100:h,y=u/a.length,v=Math.abs(m-c);return g?y+v/g:v?1:y}},function(n,i){n.exports=function(){for(var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,s=[],u=-1,l=-1,c=0,d=a.length;c=o&&s.push([u,l]),u=-1)}return a[c-1]&&c-u>=o&&s.push([u,c-1]),s}},function(n,i){n.exports=function(a){for(var o={},s=a.length,u=0;u0)return"Unexpected "+(Y.length>1?"keys":"key")+" "+('"'+Y.join('", "')+'" found in '+V+". ")+"Expected to find one of the known reducer keys instead: "+('"'+T.join('", "')+'". Unexpected keys will be ignored.')}function y(z){Object.keys(z).forEach(function(k){var _=z[k],b=_(void 0,{type:l.INIT});if(typeof b=="undefined")throw new Error('Reducer "'+k+`" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof _(void 0,{type:l.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error('Reducer "'+k+'" returned undefined when probed with a random type. '+("Don't try to handle "+l.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.")})}function v(z){for(var k=Object.keys(z),_={},b=0;b-1?z.map(function(_){var b=_;return b.id===parseInt(k.choiceId,10)&&(b.selected=!0),b}):z;case"REMOVE_ITEM":return k.choiceId>-1?z.map(function(_){var b=_;return b.id===parseInt(k.choiceId,10)&&(b.selected=!1),b}):z;case"FILTER_CHOICES":return z.map(function(_){var b=_;return b.active=k.results.some(function(T){var V=T.item,Y=T.score;return V.id===b.id?(b.score=Y,!0):!1}),b});case"ACTIVATE_CHOICES":return z.map(function(_){var b=_;return b.active=k.active,b});case"CLEAR_CHOICES":return te;default:return z}}var ne={loading:!1},be=function(k,_){switch(k===void 0&&(k=ne),_.type){case"SET_IS_LOADING":return{loading:_.isLoading};default:return k}},pe=be,De=function(k,_){return Math.floor(Math.random()*(_-k)+k)},Ce=function(k){return Array.from({length:k},function(){return De(0,36).toString(36)}).join("")},U=function(k,_){var b=k.id||k.name&&k.name+"-"+Ce(2)||Ce(4);return b=b.replace(/(:|\.|\[|\]|,)/g,""),b=_+"-"+b,b},Je=function(k){return Object.prototype.toString.call(k).slice(8,-1)},it=function(k,_){return _!=null&&Je(_)===k},N=function(k,_){return _===void 0&&(_=document.createElement("div")),k.nextSibling?k.parentNode.insertBefore(_,k.nextSibling):k.parentNode.appendChild(_),_.appendChild(k)},Ze=function(k,_,b){if(b===void 0&&(b=1),!(!(k instanceof Element)||typeof _!="string")){for(var T=(b>0?"next":"previous")+"ElementSibling",V=k[T];V;){if(V.matches(_))return V;V=V[T]}return V}},It=function(k,_,b){if(b===void 0&&(b=1),!k)return!1;var T;return b>0?T=_.scrollTop+_.offsetHeight>=k.offsetTop+k.offsetHeight:T=k.offsetTop>=_.scrollTop,T},Mt=function(k){return typeof k!="string"?k:k.replace(/&/g,"&").replace(/>/g,"&rt;").replace(/"'+Mt(k)+'"'},maxItemText:function(k){return"Only "+k+" values can be added"},valueComparer:function(k,_){return k===_},fuseOptions:{includeScore:!0},callbackOnInit:null,callbackOnCreateTemplates:null,classNames:Bt},rn={showDropdown:"showDropdown",hideDropdown:"hideDropdown",change:"change",choice:"choice",search:"search",addItem:"addItem",removeItem:"removeItem",highlightItem:"highlightItem",highlightChoice:"highlightChoice"},At={ADD_CHOICE:"ADD_CHOICE",FILTER_CHOICES:"FILTER_CHOICES",ACTIVATE_CHOICES:"ACTIVATE_CHOICES",CLEAR_CHOICES:"CLEAR_CHOICES",ADD_GROUP:"ADD_GROUP",ADD_ITEM:"ADD_ITEM",REMOVE_ITEM:"REMOVE_ITEM",HIGHLIGHT_ITEM:"HIGHLIGHT_ITEM",CLEAR_ALL:"CLEAR_ALL"},Z={BACK_KEY:46,DELETE_KEY:8,ENTER_KEY:13,A_KEY:65,ESC_KEY:27,UP_KEY:38,DOWN_KEY:40,PAGE_UP_KEY:33,PAGE_DOWN_KEY:34},me="text",Ie="select-one",at="select-multiple",Dt=4,Cn=function(){function z(_){var b=_.element,T=_.type,V=_.classNames,Y=_.position;this.element=b,this.classNames=V,this.type=T,this.position=Y,this.isOpen=!1,this.isFlipped=!1,this.isFocussed=!1,this.isDisabled=!1,this.isLoading=!1,this._onFocus=this._onFocus.bind(this),this._onBlur=this._onBlur.bind(this)}var k=z.prototype;return k.addEventListeners=function(){this.element.addEventListener("focus",this._onFocus),this.element.addEventListener("blur",this._onBlur)},k.removeEventListeners=function(){this.element.removeEventListener("focus",this._onFocus),this.element.removeEventListener("blur",this._onBlur)},k.shouldFlip=function(b){if(typeof b!="number")return!1;var T=!1;return this.position==="auto"?T=!window.matchMedia("(min-height: "+(b+1)+"px)").matches:this.position==="top"&&(T=!0),T},k.setActiveDescendant=function(b){this.element.setAttribute("aria-activedescendant",b)},k.removeActiveDescendant=function(){this.element.removeAttribute("aria-activedescendant")},k.open=function(b){this.element.classList.add(this.classNames.openState),this.element.setAttribute("aria-expanded","true"),this.isOpen=!0,this.shouldFlip(b)&&(this.element.classList.add(this.classNames.flippedState),this.isFlipped=!0)},k.close=function(){this.element.classList.remove(this.classNames.openState),this.element.setAttribute("aria-expanded","false"),this.removeActiveDescendant(),this.isOpen=!1,this.isFlipped&&(this.element.classList.remove(this.classNames.flippedState),this.isFlipped=!1)},k.focus=function(){this.isFocussed||this.element.focus()},k.addFocusState=function(){this.element.classList.add(this.classNames.focusState)},k.removeFocusState=function(){this.element.classList.remove(this.classNames.focusState)},k.enable=function(){this.element.classList.remove(this.classNames.disabledState),this.element.removeAttribute("aria-disabled"),this.type===Ie&&this.element.setAttribute("tabindex","0"),this.isDisabled=!1},k.disable=function(){this.element.classList.add(this.classNames.disabledState),this.element.setAttribute("aria-disabled","true"),this.type===Ie&&this.element.setAttribute("tabindex","-1"),this.isDisabled=!0},k.wrap=function(b){N(b,this.element)},k.unwrap=function(b){this.element.parentNode.insertBefore(b,this.element),this.element.parentNode.removeChild(this.element)},k.addLoadingState=function(){this.element.classList.add(this.classNames.loadingState),this.element.setAttribute("aria-busy","true"),this.isLoading=!0},k.removeLoadingState=function(){this.element.classList.remove(this.classNames.loadingState),this.element.removeAttribute("aria-busy"),this.isLoading=!1},k._onFocus=function(){this.isFocussed=!0},k._onBlur=function(){this.isFocussed=!1},z}();function _n(z,k){for(var _=0;_0?this.element.scrollTop+he-X:b.offsetTop;activeWindow.requestAnimationFrame(function(){V._animateScroll(Me,T)})}},k._scrollDown=function(b,T,V){var Y=(V-b)/T,X=Y>1?Y:1;this.element.scrollTop=b+X},k._scrollUp=function(b,T,V){var Y=(b-V)/T,X=Y>1?Y:1;this.element.scrollTop=b-X},k._animateScroll=function(b,T){var V=this,Y=Dt,X=this.element.scrollTop,le=!1;T>0?(this._scrollDown(X,Y,b),Xb&&(le=!0)),le&&activeWindow.requestAnimationFrame(function(){V._animateScroll(b,T)})},z}();function St(z,k){for(var _=0;_0?"treeitem":"option"),Object.assign(lt.dataset,{choice:"",id:Me,value:Ve,selectText:b}),qe?(lt.classList.add(le),lt.dataset.choiceDisabled="",lt.setAttribute("aria-disabled","true")):(lt.classList.add(Y),lt.dataset.choiceSelectable=""),lt},input:function(k,_){var b=k.input,T=k.inputCloned,V=Object.assign(document.createElement("input"),{type:"text",className:b+" "+T,autocomplete:"off",autocapitalize:"off",spellcheck:!1});return V.setAttribute("role","textbox"),V.setAttribute("aria-autocomplete","list"),V.setAttribute("aria-label",_),V},dropdown:function(k){var _=k.list,b=k.listDropdown,T=document.createElement("div");return T.classList.add(_,b),T.setAttribute("aria-expanded","false"),T},notice:function(k,_,b){var T=k.item,V=k.itemChoice,Y=k.noResults,X=k.noChoices;b===void 0&&(b="");var le=[T,V];return b==="no-choices"?le.push(X):b==="no-results"&&le.push(Y),Object.assign(document.createElement("div"),{innerHTML:_,className:le.join(" ")})},option:function(k){var _=k.label,b=k.value,T=k.customProperties,V=k.active,Y=k.disabled,X=new Option(_,b,!1,V);return T&&(X.dataset.customProperties=T),X.disabled=Y,X}},ye=ie,ce=function(k){var _=k.value,b=k.label,T=k.id,V=k.groupId,Y=k.disabled,X=k.elementId,le=k.customProperties,he=k.placeholder,Me=k.keyCode;return{type:At.ADD_CHOICE,value:_,label:b,id:T,groupId:V,disabled:Y,elementId:X,customProperties:le,placeholder:he,keyCode:Me}},ae=function(k){return{type:At.FILTER_CHOICES,results:k}},Se=function(k){return k===void 0&&(k=!0),{type:At.ACTIVATE_CHOICES,active:k}},nt=function(){return{type:At.CLEAR_CHOICES}},Te=function(k){var _=k.value,b=k.label,T=k.id,V=k.choiceId,Y=k.groupId,X=k.customProperties,le=k.placeholder,he=k.keyCode;return{type:At.ADD_ITEM,value:_,label:b,id:T,choiceId:V,groupId:Y,customProperties:X,placeholder:le,keyCode:he}},Ue=function(k,_){return{type:At.REMOVE_ITEM,id:k,choiceId:_}},We=function(k,_){return{type:At.HIGHLIGHT_ITEM,id:k,highlighted:_}},Ft=function(k){var _=k.value,b=k.id,T=k.active,V=k.disabled;return{type:At.ADD_GROUP,value:_,id:b,active:T,disabled:V}},Hn=function(){return{type:"CLEAR_ALL"}},Ot=function(k){return{type:"RESET_TO",state:k}},or=function(k){return{type:"SET_IS_LOADING",isLoading:k}};function sr(z,k){for(var _=0;_=0?this._store.getGroupById(X):null;return this._store.dispatch(We(V,!0)),T&&this.passedElement.triggerEvent(rn.highlightItem,{id:V,value:he,label:Ve,groupValue:Le&&Le.value?Le.value:null}),this},k.unhighlightItem=function(b){if(!b)return this;var T=b.id,V=b.groupId,Y=V===void 0?-1:V,X=b.value,le=X===void 0?"":X,he=b.label,Me=he===void 0?"":he,Ve=Y>=0?this._store.getGroupById(Y):null;return this._store.dispatch(We(T,!1)),this.passedElement.triggerEvent(rn.highlightItem,{id:T,value:le,label:Me,groupValue:Ve&&Ve.value?Ve.value:null}),this},k.highlightAll=function(){var b=this;return this._store.items.forEach(function(T){return b.highlightItem(T)}),this},k.unhighlightAll=function(){var b=this;return this._store.items.forEach(function(T){return b.unhighlightItem(T)}),this},k.removeActiveItemsByValue=function(b){var T=this;return this._store.activeItems.filter(function(V){return V.value===b}).forEach(function(V){return T._removeItem(V)}),this},k.removeActiveItems=function(b){var T=this;return this._store.activeItems.filter(function(V){var Y=V.id;return Y!==b}).forEach(function(V){return T._removeItem(V)}),this},k.removeHighlightedItems=function(b){var T=this;return b===void 0&&(b=!1),this._store.highlightedActiveItems.forEach(function(V){T._removeItem(V),b&&T._triggerChange(V.value)}),this},k.showDropdown=function(b){var T=this;return this.dropdown.isActive?this:(activeWindow.requestAnimationFrame(function(){T.dropdown.show(),T.containerOuter.open(T.dropdown.distanceFromTopWindow),!b&&T._canSearch&&T.input.focus(),T.passedElement.triggerEvent(rn.showDropdown,{})}),this)},k.hideDropdown=function(b){var T=this;return this.dropdown.isActive?(activeWindow.requestAnimationFrame(function(){T.dropdown.hide(),T.containerOuter.close(),!b&&T._canSearch&&(T.input.removeActiveDescendant(),T.input.blur()),T.passedElement.triggerEvent(rn.hideDropdown,{})}),this):this},k.getValue=function(b){b===void 0&&(b=!1);var T=this._store.activeItems.reduce(function(V,Y){var X=b?Y.value:Y;return V.push(X),V},[]);return this._isSelectOneElement?T[0]:T},k.setValue=function(b){var T=this;return this.initialised?(b.forEach(function(V){return T._setChoiceOrItem(V)}),this):this},k.setChoiceByValue=function(b){var T=this;if(!this.initialised||this._isTextElement)return this;var V=Array.isArray(b)?b:[b];return V.forEach(function(Y){return T._findAndSelectChoiceByValue(Y)}),this},k.setChoices=function(b,T,V,Y){var X=this;if(b===void 0&&(b=[]),T===void 0&&(T="value"),V===void 0&&(V="label"),Y===void 0&&(Y=!1),!this.initialised)throw new ReferenceError("setChoices was called on a non-initialized instance of Choices");if(!this._isSelectElement)throw new TypeError("setChoices can't be used with INPUT based Choices");if(typeof T!="string"||!T)throw new TypeError("value parameter must be a name of 'value' field in passed objects");if(Y&&this.clearChoices(),typeof b=="function"){var le=b(this);if(typeof Promise=="function"&&le instanceof Promise)return new Promise(function(he){return activeWindow.requestAnimationFrame(he)}).then(function(){return X._handleLoadingState(!0)}).then(function(){return le}).then(function(he){return X.setChoices(he,T,V,Y)}).catch(function(he){X.config.silent||console.error(he)}).then(function(){return X._handleLoadingState(!1)}).then(function(){return X});if(!Array.isArray(le))throw new TypeError(".setChoices first argument function must return either array of choices or Promise, got: "+typeof le);return this.setChoices(le,T,V,!1)}if(!Array.isArray(b))throw new TypeError(".setChoices must be called either with array of choices with a function resulting into Promise of array of choices");return this.containerOuter.removeLoadingState(),this._startLoading(),b.forEach(function(he){he.choices?X._addGroup({id:parseInt(he.id,10)||null,group:he,valueKey:T,labelKey:V}):X._addChoice({value:he[T],label:he[V],isSelected:he.selected,isDisabled:he.disabled,customProperties:he.customProperties,placeholder:he.placeholder})}),this._stopLoading(),this},k.clearChoices=function(){return this._store.dispatch(nt()),this},k.clearStore=function(){return this._store.dispatch(Hn()),this},k.clearInput=function(){var b=!this._isSelectOneElement;return this.input.clear(b),!this._isTextElement&&this._canSearch&&(this._isSearching=!1,this._store.dispatch(Se(!0))),this},k._render=function(){if(!this._store.isLoading()){this._currentState=this._store.state;var b=this._currentState.choices!==this._prevState.choices||this._currentState.groups!==this._prevState.groups||this._currentState.items!==this._prevState.items,T=this._isSelectElement,V=this._currentState.items!==this._prevState.items;b&&(T&&this._renderChoices(),V&&this._renderItems(),this._prevState=this._currentState)}},k._renderChoices=function(){var b=this,T=this._store,V=T.activeGroups,Y=T.activeChoices,X=document.createDocumentFragment();if(this.choiceList.clear(),this.config.resetScrollPosition&&activeWindow.requestAnimationFrame(function(){return b.choiceList.scrollToTop()}),V.length>=1&&!this._isSearching){var le=Y.filter(function(Qe){return Qe.placeholder===!0&&Qe.groupId===-1});le.length>=1&&(X=this._createChoicesFragment(le,X)),X=this._createGroupsFragment(V,Y,X)}else Y.length>=1&&(X=this._createChoicesFragment(Y,X));if(X.childNodes&&X.childNodes.length>0){var he=this._store.activeItems,Me=this._canAddItem(he,this.input.value);Me.response?(this.choiceList.append(X),this._highlightChoice()):this.choiceList.append(this._getTemplate("notice",Me.notice))}else{var Ve,Le;this._isSearching?(Le=typeof this.config.noResultsText=="function"?this.config.noResultsText():this.config.noResultsText,Ve=this._getTemplate("notice",Le,"no-results")):(Le=typeof this.config.noChoicesText=="function"?this.config.noChoicesText():this.config.noChoicesText,Ve=this._getTemplate("notice",Le,"no-choices")),this.choiceList.append(Ve)}},k._renderItems=function(){var b=this._store.activeItems||[];this.itemList.clear();var T=this._createItemsFragment(b);T.childNodes&&this.itemList.append(T)},k._createGroupsFragment=function(b,T,V){var Y=this;V===void 0&&(V=document.createDocumentFragment());var X=function(he){return T.filter(function(Me){return Y._isSelectOneElement?Me.groupId===he.id:Me.groupId===he.id&&(Y.config.renderSelectedChoices==="always"||!Me.selected)})};return this.config.shouldSort&&b.sort(this.config.sorter),b.forEach(function(le){var he=X(le);if(he.length>=1){var Me=Y._getTemplate("choiceGroup",le);V.appendChild(Me),Y._createChoicesFragment(he,V,!0)}}),V},k._createChoicesFragment=function(b,T,V){var Y=this;T===void 0&&(T=document.createDocumentFragment()),V===void 0&&(V=!1);var X=this.config,le=X.renderSelectedChoices,he=X.searchResultLimit,Me=X.renderChoiceLimit,Ve=this._isSearching?Wt:this.config.sorter,Le=function(Vn){var ki=le==="auto"?Y._isSelectOneElement||!Vn.selected:!0;if(ki){var kr=Y._getTemplate("choice",Vn,Y.config.itemSelectText);T.appendChild(kr)}},Qe=b;le==="auto"&&!this._isSelectOneElement&&(Qe=b.filter(function(On){return!On.selected}));var ot=Qe.reduce(function(On,Vn){return Vn.placeholder?On.placeholderChoices.push(Vn):On.normalChoices.push(Vn),On},{placeholderChoices:[],normalChoices:[]}),qe=ot.placeholderChoices,yt=ot.normalChoices;(this.config.shouldSort||this._isSearching)&&yt.sort(Ve);var st=Qe.length,lt=this._isSelectOneElement?[].concat(qe,yt):yt;this._isSearching?st=he:Me&&Me>0&&!V&&(st=Me);for(var qt=0;qt=Y){var he=X?this._searchChoices(b):0;this.passedElement.triggerEvent(rn.search,{value:b,resultCount:he})}else le&&(this._isSearching=!1,this._store.dispatch(Se(!0)))}},k._canAddItem=function(b,T){var V=!0,Y=typeof this.config.addItemText=="function"?this.config.addItemText(T):this.config.addItemText;if(!this._isSelectOneElement){var X=Jt(b,T);this.config.maxItemCount>0&&this.config.maxItemCount<=b.length&&(V=!1,Y=typeof this.config.maxItemText=="function"?this.config.maxItemText(this.config.maxItemCount):this.config.maxItemText),!this.config.duplicateItemsAllowed&&X&&V&&(V=!1,Y=typeof this.config.uniqueItemText=="function"?this.config.uniqueItemText(T):this.config.uniqueItemText),this._isTextElement&&this.config.addItems&&V&&typeof this.config.addItemFilter=="function"&&!this.config.addItemFilter(T)&&(V=!1,Y=typeof this.config.customAddItemText=="function"?this.config.customAddItemText(T):this.config.customAddItemText)}return{response:V,notice:Y}},k._searchChoices=function(b){var T=typeof b=="string"?b.trim():b,V=typeof this._currentValue=="string"?this._currentValue.trim():this._currentValue;if(T.length<1&&T===V+" ")return 0;var Y=this._store.searchableChoices,X=T,le=[].concat(this.config.searchFields),he=Object.assign(this.config.fuseOptions,{keys:le}),Me=new i.a(Y,he),Ve=Me.search(X);return this._currentValue=T,this._highlightPosition=0,this._isSearching=!0,this._store.dispatch(ae(Ve)),Ve.length},k._addEventListeners=function(){var b=document,T=b.documentElement;T.addEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.addEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.addEventListener("mousedown",this._onMouseDown,!0),T.addEventListener("click",this._onClick,{passive:!0}),T.addEventListener("touchmove",this._onTouchMove,{passive:!0}),this.dropdown.element.addEventListener("mouseover",this._onMouseOver,{passive:!0}),this._isSelectOneElement&&(this.containerOuter.element.addEventListener("focus",this._onFocus,{passive:!0}),this.containerOuter.element.addEventListener("blur",this._onBlur,{passive:!0})),this.input.element.addEventListener("keyup",this._onKeyUp,{passive:!0}),this.input.element.addEventListener("focus",this._onFocus,{passive:!0}),this.input.element.addEventListener("blur",this._onBlur,{passive:!0}),this.input.element.form&&this.input.element.form.addEventListener("reset",this._onFormReset,{passive:!0}),this.input.addEventListeners()},k._removeEventListeners=function(){var b=document,T=b.documentElement;T.removeEventListener("touchend",this._onTouchEnd,!0),this.containerOuter.element.removeEventListener("keydown",this._onKeyDown,!0),this.containerOuter.element.removeEventListener("mousedown",this._onMouseDown,!0),T.removeEventListener("click",this._onClick),T.removeEventListener("touchmove",this._onTouchMove),this.dropdown.element.removeEventListener("mouseover",this._onMouseOver),this._isSelectOneElement&&(this.containerOuter.element.removeEventListener("focus",this._onFocus),this.containerOuter.element.removeEventListener("blur",this._onBlur)),this.input.element.removeEventListener("keyup",this._onKeyUp),this.input.element.removeEventListener("focus",this._onFocus),this.input.element.removeEventListener("blur",this._onBlur),this.input.element.form&&this.input.element.form.removeEventListener("reset",this._onFormReset),this.input.removeEventListeners()},k._onKeyDown=function(b){var T,V=b.target,Y=b.keyCode,X=b.ctrlKey,le=b.metaKey,he=this._store.activeItems,Me=this.input.isFocussed,Ve=this.dropdown.isActive,Le=this.itemList.hasChildren(),Qe=String.fromCharCode(Y),ot=Z.BACK_KEY,qe=Z.DELETE_KEY,yt=Z.ENTER_KEY,st=Z.A_KEY,lt=Z.ESC_KEY,qt=Z.UP_KEY,On=Z.DOWN_KEY,Vn=Z.PAGE_UP_KEY,ki=Z.PAGE_DOWN_KEY,kr=X||le;!this._isTextElement&&/[a-zA-Z0-9-_ ]/.test(Qe)&&this.showDropdown();var Jr=(T={},T[st]=this._onAKey,T[yt]=this._onEnterKey,T[lt]=this._onEscapeKey,T[qt]=this._onDirectionKey,T[Vn]=this._onDirectionKey,T[On]=this._onDirectionKey,T[ki]=this._onDirectionKey,T[qe]=this._onDeleteKey,T[ot]=this._onDeleteKey,T);Jr[Y]&&Jr[Y]({event:b,target:V,keyCode:Y,metaKey:le,activeItems:he,hasFocusedInput:Me,hasActiveDropdown:Ve,hasItems:Le,hasCtrlDownKeyPressed:kr})},k._onKeyUp=function(b){var T=b.target,V=b.keyCode,Y=this.input.value,X=this._store.activeItems,le=this._canAddItem(X,Y),he=Z.BACK_KEY,Me=Z.DELETE_KEY;if(this._isTextElement){var Ve=le.notice&&Y;if(Ve){var Le=this._getTemplate("notice",le.notice);this.dropdown.element.innerHTML=Le.outerHTML,this.showDropdown(!0)}else this.hideDropdown(!0)}else{var Qe=(V===he||V===Me)&&!T.value,ot=!this._isTextElement&&this._isSearching,qe=this._canSearch&&le.response;Qe&&ot?(this._isSearching=!1,this._store.dispatch(Se(!0))):qe&&this._handleSearch(this.input.value)}this._canSearch=this.config.searchEnabled},k._onAKey=function(b){var T=b.hasItems,V=b.hasCtrlDownKeyPressed;if(V&&T){this._canSearch=!1;var Y=this.config.removeItems&&!this.input.value&&this.input.element===document.activeElement;Y&&this.highlightAll()}},k._onEnterKey=function(b){var T=b.event,V=b.target,Y=b.activeItems,X=b.hasActiveDropdown,le=Z.ENTER_KEY,he=V.hasAttribute("data-button");if(this._isTextElement&&V.value){var Me=this.input.value,Ve=this._canAddItem(Y,Me);Ve.response&&(this.hideDropdown(!0),this._addItem({value:Me}),this._triggerChange(Me),this.clearInput())}if(he&&(this._handleButtonAction(Y,V),T.preventDefault()),X){var Le=this.dropdown.getChild("."+this.config.classNames.highlightedState);Le&&(Y[0]&&(Y[0].keyCode=le),this._handleChoiceAction(Y,Le)),T.preventDefault()}else this._isSelectOneElement&&(this.showDropdown(),T.preventDefault())},k._onEscapeKey=function(b){var T=b.hasActiveDropdown;T&&(this.hideDropdown(!0),this.containerOuter.focus())},k._onDirectionKey=function(b){var T=b.event,V=b.hasActiveDropdown,Y=b.keyCode,X=b.metaKey,le=Z.DOWN_KEY,he=Z.PAGE_UP_KEY,Me=Z.PAGE_DOWN_KEY;if(V||this._isSelectOneElement){this.showDropdown(),this._canSearch=!1;var Ve=Y===le||Y===Me?1:-1,Le=X||Y===Me||Y===he,Qe="[data-choice-selectable]",ot;if(Le)Ve>0?ot=this.dropdown.element.querySelector(Qe+":last-of-type"):ot=this.dropdown.element.querySelector(Qe);else{var qe=this.dropdown.element.querySelector("."+this.config.classNames.highlightedState);qe?ot=Ze(qe,Qe,Ve):ot=this.dropdown.element.querySelector(Qe)}ot&&(It(ot,this.choiceList.element,Ve)||this.choiceList.scrollToChildElement(ot,Ve),this._highlightChoice(ot)),T.preventDefault()}},k._onDeleteKey=function(b){var T=b.event,V=b.target,Y=b.hasFocusedInput,X=b.activeItems;Y&&!V.value&&!this._isSelectOneElement&&(this._handleBackspace(X),T.preventDefault())},k._onTouchMove=function(){this._wasTap&&(this._wasTap=!1)},k._onTouchEnd=function(b){var T=b||b.touches[0],V=T.target,Y=this._wasTap&&this.containerOuter.element.contains(V);if(Y){var X=V===this.containerOuter.element||V===this.containerInner.element;X&&(this._isTextElement?this.input.focus():this._isSelectMultipleElement&&this.showDropdown()),b.stopPropagation()}this._wasTap=!0},k._onMouseDown=function(b){var T=b.target;if(T instanceof HTMLElement){if(Bn&&this.choiceList.element.contains(T)){var V=this.choiceList.element.firstElementChild,Y=this._direction==="ltr"?b.offsetX>=V.offsetWidth:b.offsetX0;Y&&this.unhighlightAll(),this.containerOuter.removeFocusState(),this.hideDropdown(!0)}},k._onFocus=function(b){var T=this,V,Y=b.target,X=this.containerOuter.element.contains(Y);if(X){var le=(V={},V[me]=function(){Y===T.input.element&&T.containerOuter.addFocusState()},V[Ie]=function(){T.containerOuter.addFocusState(),Y===T.input.element&&T.showDropdown(!0)},V[at]=function(){Y===T.input.element&&(T.showDropdown(!0),T.containerOuter.addFocusState())},V);le[this.passedElement.element.type]()}},k._onBlur=function(b){var T=this,V=b.target,Y=this.containerOuter.element.contains(V);if(Y&&!this._isScrollingOnIe){var X,le=this._store.activeItems,he=le.some(function(Ve){return Ve.highlighted}),Me=(X={},X[me]=function(){V===T.input.element&&(T.containerOuter.removeFocusState(),he&&T.unhighlightAll(),T.hideDropdown(!0))},X[Ie]=function(){T.containerOuter.removeFocusState(),(V===T.input.element||V===T.containerOuter.element&&!T._canSearch)&&T.hideDropdown(!0)},X[at]=function(){V===T.input.element&&(T.containerOuter.removeFocusState(),T.hideDropdown(!0),he&&T.unhighlightAll())},X);Me[this.passedElement.element.type]()}else this._isScrollingOnIe=!1,this.input.element.focus()},k._onFormReset=function(){this._store.dispatch(Ot(this._initialState))},k._highlightChoice=function(b){var T=this;b===void 0&&(b=null);var V=Array.from(this.dropdown.element.querySelectorAll("[data-choice-selectable]"));if(V.length){var Y=b,X=Array.from(this.dropdown.element.querySelectorAll("."+this.config.classNames.highlightedState));X.forEach(function(le){le.classList.remove(T.config.classNames.highlightedState),le.setAttribute("aria-selected","false")}),Y?this._highlightPosition=V.indexOf(Y):(V.length>this._highlightPosition?Y=V[this._highlightPosition]:Y=V[V.length-1],Y||(Y=V[0])),Y.classList.add(this.config.classNames.highlightedState),Y.setAttribute("aria-selected","true"),this.passedElement.triggerEvent(rn.highlightChoice,{el:Y}),this.dropdown.isActive&&(this.input.setActiveDescendant(Y.id),this.containerOuter.setActiveDescendant(Y.id))}},k._addItem=function(b){var T=b.value,V=b.label,Y=V===void 0?null:V,X=b.choiceId,le=X===void 0?-1:X,he=b.groupId,Me=he===void 0?-1:he,Ve=b.customProperties,Le=Ve===void 0?null:Ve,Qe=b.placeholder,ot=Qe===void 0?!1:Qe,qe=b.keyCode,yt=qe===void 0?null:qe,st=typeof T=="string"?T.trim():T,lt=yt,qt=Le,On=this._store.items,Vn=Y||st,ki=le||-1,kr=Me>=0?this._store.getGroupById(Me):null,Jr=On?On.length+1:1;return this.config.prependValue&&(st=this.config.prependValue+st.toString()),this.config.appendValue&&(st+=this.config.appendValue.toString()),this._store.dispatch(Te({value:st,label:Vn,id:Jr,choiceId:ki,groupId:Me,customProperties:Le,placeholder:ot,keyCode:lt})),this._isSelectOneElement&&this.removeActiveItems(Jr),this.passedElement.triggerEvent(rn.addItem,{id:Jr,value:st,label:Vn,customProperties:qt,groupValue:kr&&kr.value?kr.value:void 0,keyCode:lt}),this},k._removeItem=function(b){if(!b||!it("Object",b))return this;var T=b.id,V=b.value,Y=b.label,X=b.choiceId,le=b.groupId,he=le>=0?this._store.getGroupById(le):null;return this._store.dispatch(Ue(T,X)),he&&he.value?this.passedElement.triggerEvent(rn.removeItem,{id:T,value:V,label:Y,groupValue:he.value}):this.passedElement.triggerEvent(rn.removeItem,{id:T,value:V,label:Y}),this},k._addChoice=function(b){var T=b.value,V=b.label,Y=V===void 0?null:V,X=b.isSelected,le=X===void 0?!1:X,he=b.isDisabled,Me=he===void 0?!1:he,Ve=b.groupId,Le=Ve===void 0?-1:Ve,Qe=b.customProperties,ot=Qe===void 0?null:Qe,qe=b.placeholder,yt=qe===void 0?!1:qe,st=b.keyCode,lt=st===void 0?null:st;if(!(typeof T=="undefined"||T===null)){var qt=this._store.choices,On=Y||T,Vn=qt?qt.length+1:1,ki=this._baseId+"-"+this._idNames.itemChoice+"-"+Vn;this._store.dispatch(ce({id:Vn,groupId:Le,elementId:ki,value:T,label:On,disabled:Me,customProperties:ot,placeholder:yt,keyCode:lt})),le&&this._addItem({value:T,label:On,choiceId:Vn,customProperties:ot,placeholder:yt,keyCode:lt})}},k._addGroup=function(b){var T=this,V=b.group,Y=b.id,X=b.valueKey,le=X===void 0?"value":X,he=b.labelKey,Me=he===void 0?"label":he,Ve=it("Object",V)?V.choices:Array.from(V.getElementsByTagName("OPTION")),Le=Y||Math.floor(new Date().valueOf()*Math.random()),Qe=V.disabled?V.disabled:!1;if(Ve){this._store.dispatch(Ft({value:V.label,id:Le,active:!0,disabled:Qe}));var ot=function(yt){var st=yt.disabled||yt.parentNode&&yt.parentNode.disabled;T._addChoice({value:yt[le],label:it("Object",yt)?yt[Me]:yt.innerHTML,isSelected:yt.selected,isDisabled:st,groupId:Le,customProperties:yt.customProperties,placeholder:yt.placeholder})};Ve.forEach(ot)}else this._store.dispatch(Ft({value:V.label,id:V.id,active:!1,disabled:V.disabled}))},k._getTemplate=function(b){var T;if(!b)return null;for(var V=this.config.classNames,Y=arguments.length,X=new Array(Y>1?Y-1:0),le=1;le{var IH=typeof Element!="undefined",AH=typeof Map=="function",OH=typeof Set=="function",LH=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function jd(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var r,n,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!jd(e[n],t[n]))return!1;return!0}var a;if(AH&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;for(a=e.entries();!(n=a.next()).done;)if(!jd(n.value[1],t.get(n.value[0])))return!1;return!0}if(OH&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a=e.entries();!(n=a.next()).done;)if(!t.has(n.value[0]))return!1;return!0}if(LH&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(e[n]!==t[n])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[n]))return!1;if(IH&&e instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&e.$$typeof)&&!jd(e[i[n]],t[i[n]]))return!1;return!0}return e!==e&&t!==t}pC.exports=function(t,r){try{return jd(t,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}});var S_=wn((Gne,Dy)=>{(function(){var e;typeof Dy!="undefined"?e=Dy.exports=n:e=function(){return this||(0,eval)("this")}(),e.format=n,e.vsprintf=r,typeof console!="undefined"&&typeof console.log=="function"&&(e.printf=t);function t(){console.log(n.apply(null,arguments))}function r(i,a){return n.apply(null,[i].concat(a))}function n(i){for(var a=1,o=[].slice.call(arguments),s=0,u=i.length,l="",c,d=!1,m,h,g=!1,y,v=function(){return o[a++]},D=function(){for(var I="";/\d/.test(i[s]);)I+=i[s++],c=i[s];return I.length>0?parseInt(I):null};swf});module.exports=ov(HB);function fu(e,t){let r=Object.keys(t).map(n=>mF(e,n,t[n]));return r.length===1?r[0]:function(){r.forEach(n=>n())}}function mF(e,t,r){let n=e[t],i=e.hasOwnProperty(t),a=r(n);return n&&Object.setPrototypeOf(a,n),Object.setPrototypeOf(o,a),e[t]=o,s;function o(...u){return a===n&&e[t]===o&&s(),a.apply(this,u)}function s(){e[t]===o&&(i?e[t]=n:delete e[t]),a!==n&&(a=n,Object.setPrototypeOf(o,n||Function))}}var Rn=require("obsidian");var Ws,Xe,cv,pF,Va,sv,dv,Hf,Wf,Bf,Vf,fv,Us={},hv=[],gF=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,pu=Array.isArray;function Ii(e,t){for(var r in t)e[r]=t[r];return e}function mv(e){var t=e.parentNode;t&&t.removeChild(e)}function xr(e,t,r){var n,i,a,o={};for(a in t)a=="key"?n=t[a]:a=="ref"?i=t[a]:o[a]=t[a];if(arguments.length>2&&(o.children=arguments.length>3?Ws.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)o[a]===void 0&&(o[a]=e.defaultProps[a]);return $s(e,o,n,i,null)}function $s(e,t,r,n,i){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i==null?++cv:i,__i:-1,__u:0};return i==null&&Xe.vnode!=null&&Xe.vnode(a),a}function Yf(){return{current:null}}function ct(e){return e.children}function Br(e,t){this.props=e,this.context=t}function $a(e,t){if(t==null)return e.__?$a(e.__,e.__i+1):null;for(var r;tt&&Va.sort(Hf));mu.__r=0}function gv(e,t,r,n,i,a,o,s,u,l,c){var d,m,h,g,y,v=n&&n.__k||hv,D=t.length;for(r.__d=u,yF(r,t,v),u=r.__d,d=0;d0?$s(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,s=vF(i,r,o,c),i.__i=s,a=null,s!==-1&&(c--,(a=r[s])&&(a.__u|=131072)),a==null||a.__v===null?(s==-1&&d--,typeof i.type!="function"&&(i.__u|=65536)):s!==o&&(s===o+1?d++:s>o?c>u-o?d+=s-o:d--:s(u!=null&&!(131072&u.__u)?1:0))for(;o>=0||s=0){if((u=t[o])&&!(131072&u.__u)&&i==u.key&&a===u.type)return o;o--}if(s2&&(s.children=arguments.length>3?Ws.call(arguments,2):r),$s(e.type,s,n||e.key,i||e.ref,null)}function aa(e,t){var r={__c:t="__cC"+fv++,__:e,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=[],(a={})[t]=this,this.getChildContext=function(){return a},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(s){s.__e=!0,$f(s)})},this.sub=function(o){i.push(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),s&&s.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Ws=hv.slice,Xe={__e:function(e,t,r,n){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(s){e=s}throw e}},cv=0,pF=function(e){return e!=null&&e.constructor==null},Br.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ii({},this.state),typeof e=="function"&&(e=e(Ii({},r),this.props)),e&&Ii(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),$f(this))},Br.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$f(this))},Br.prototype.render=ct,Va=[],dv=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):activeWindow.setTimeout,Hf=function(e,t){return e.__v.__b-t.__v.__b},mu.__r=0,Wf=0,Bf=uv(!1),Vf=uv(!0),fv=0;var oa,Qt,qf,bv,Co=0,Mv=[],gu=[],an=Xe,Dv=an.__b,Sv=an.__r,Ev=an.diffed,kv=an.__c,xv=an.unmount,Cv=an.__;function _o(e,t){an.__h&&an.__h(Qt,e,Co||t),Co=0;var r=Qt.__H||(Qt.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({__V:gu}),r.__[e]}function Ne(e){return Co=1,Jf(Av,e)}function Jf(e,t,r){var n=_o(oa++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Av(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],l=n.t(u,s);u!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Qt,!Qt.u)){var i=function(s,u,l){if(!n.__c.__H)return!0;var c=n.__c.__H.__.filter(function(m){return!!m.__c});if(c.every(function(m){return!m.__N}))return!a||a.call(this,s,u,l);var d=!1;return c.forEach(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(d=!0)}}),!(!d&&n.__c.props===s)&&(!a||a.call(this,s,u,l))};Qt.u=!0;var a=Qt.shouldComponentUpdate,o=Qt.componentWillUpdate;Qt.componentWillUpdate=function(s,u,l){if(this.__e){var c=a;a=void 0,i(s,u,l),a=c}o&&o.call(this,s,u,l)},Qt.shouldComponentUpdate=i}return n.__N||n.__}function Ae(e,t){var r=_o(oa++,3);!an.__s&&Zf(r.__H,t)&&(r.__=e,r.i=t,Qt.__H.__h.push(r))}function Ai(e,t){var r=_o(oa++,4);!an.__s&&Zf(r.__H,t)&&(r.__=e,r.i=t,Qt.__h.push(r))}function Fe(e){return Co=5,Re(function(){return{current:e}},[])}function Tv(e,t,r){Co=6,Ai(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function Re(e,t){var r=_o(oa++,7);return Zf(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function Ye(e,t){return Co=8,Re(function(){return e},t)}function Ee(e){var t=Qt.context[e.__c],r=_o(oa++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(Qt)),t.props.value):e.__}function Fv(e,t){an.useDebugValue&&an.useDebugValue(t?t(e):e)}function Iv(){var e=_o(oa++,11);if(!e.__){for(var t=Qt.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function DF(){for(var e;e=Mv.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(yu),e.__H.__h.forEach(Gf),e.__H.__h=[]}catch(t){e.__H.__h=[],an.__e(t,e.__v)}}an.__b=function(e){Qt=null,Dv&&Dv(e)},an.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cv&&Cv(e,t)},an.__r=function(e){Sv&&Sv(e),oa=0;var t=(Qt=e.__c).__H;t&&(qf===Qt?(t.__h=[],Qt.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=gu,r.__N=r.i=void 0})):(t.__h.forEach(yu),t.__h.forEach(Gf),t.__h=[],oa=0)),qf=Qt},an.diffed=function(e){Ev&&Ev(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mv.push(t)!==1&&bv===an.requestAnimationFrame||((bv=an.requestAnimationFrame)||SF)(DF)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==gu&&(r.__=r.__V),r.i=void 0,r.__V=gu})),qf=Qt=null},an.__c=function(e,t){t.some(function(r){try{r.__h.forEach(yu),r.__h=r.__h.filter(function(n){return!n.__||Gf(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],an.__e(n,r.__v)}}),kv&&kv(e,t)},an.unmount=function(e){xv&&xv(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{yu(n)}catch(i){t=i}}),r.__H=void 0,t&&an.__e(t,r.__v))};var _v=typeof activeWindow.requestAnimationFrame=="function";function SF(e){var t,r=function(){activeWindow.clearTimeout(n),_v&&activeWindow.cancelAnimationFrame(t),activeWindow.setTimeout(e)},n=activeWindow.setTimeout(r,100);_v&&(t=activeWindow.requestAnimationFrame(r))}function yu(e){var t=Qt,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Qt=t}function Gf(e){var t=Qt;e.__c=e.__(),Qt=t}function Zf(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Av(e,t){return typeof t=="function"?t(e):t}function $v(e,t){for(var r in t)e[r]=t[r];return e}function Xf(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function eh(e,t){this.props=e,this.context=t}function zt(e,t){function r(i){var a=this.props.ref,o=a==i.ref;return!o&&a&&(a.call?a(null):a.current=null),t?!t(this.props,i)||!o:Xf(this.props,i)}function n(i){return this.shouldComponentUpdate=r,xr(e,i)}return n.displayName="Memo("+(e.displayName||e.name)+")",n.prototype.isReactComponent=!0,n.__f=!0,n}(eh.prototype=new Br).isPureReactComponent=!0,eh.prototype.shouldComponentUpdate=function(e,t){return Xf(this.props,e)||Xf(this.state,t)};var Ov=Xe.__b;Xe.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ov&&Ov(e)};var EF=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function kF(e){function t(r){var n=$v({},r);return delete n.ref,e(n,r.ref||null)}return t.$$typeof=EF,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Lv=function(e,t){return e==null?null:fi(fi(e).map(t))},xF={map:Lv,forEach:Lv,count:function(e){return e?fi(e).length:0},only:function(e){var t=fi(e);if(t.length!==1)throw"Children.only";return t[0]},toArray:fi},CF=Xe.__e;Xe.__e=function(e,t,r,n){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}CF(e,t,r,n)};var Pv=Xe.unmount;function Uv(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=$v({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Uv(n,t,r)})),e}function Wv(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Wv(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function vu(){this.__u=0,this.t=null,this.__b=null}function Yv(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function _F(e){var t,r,n;function i(a){if(t||(t=e()).then(function(o){r=o.default||o},function(o){n=o}),n)throw n;if(!r)throw t;return xr(r,a)}return i.displayName="Lazy",i.__f=!0,i}function Ys(){this.u=null,this.o=null}Xe.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pv&&Pv(e)},(vu.prototype=new Br).__c=function(e,t){var r=t.__c,n=this;n.t==null&&(n.t=[]),n.t.push(r);var i=Yv(n.__v),a=!1,o=function(){a||(a=!0,r.__R=null,i?i(s):s())};r.__R=o;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Wv(u,u.__c.__P,u.__c.__O)}var l;for(n.setState({__a:n.__b=null});l=n.t.pop();)l.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(o,o)},vu.prototype.componentWillUnmount=function(){this.t=[]},vu.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Uv(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&xr(ct,null,e.fallback);return i&&(i.__u&=-33),[xr(ct,null,t.__a?null:e.children),i]};var Nv=function(e,t,r){if(++r[1]===r[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(r=e.u;r;){for(;r.length>3;)r.pop()();if(r[1]>>1,1),t.i.removeChild(n)}}),xo(xr(MF,{context:t.context},e.__v),t.l)}function Oi(e,t){var r=xr(TF,{__v:e,i:t});return r.containerInfo=t,r}(Ys.prototype=new Br).__a=function(e){var t=this,r=Yv(t.__v),n=t.o.get(e);return n[0]++,function(i){var a=function(){t.props.revealOrder?(n.push(i),Nv(t,e,n)):i()};r?r(a):a()}},Ys.prototype.render=function(e){this.u=null,this.o=new Map;var t=fi(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.o.set(t[r],this.u=[1,0,this.u]);return e.children},Ys.prototype.componentDidUpdate=Ys.prototype.componentDidMount=function(){var e=this;this.o.forEach(function(t,r){Nv(e,r,t)})};var zv=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,FF=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,IF=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,AF=/[A-Z0-9]/g,OF=typeof document!="undefined",LF=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Li(e,t,r){return t.__k==null&&(t.textContent=""),xo(e,t),typeof r=="function"&&r(),e?e.__c:null}function PF(e,t,r){return jf(e,t),typeof r=="function"&&r(),e?e.__c:null}Br.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Br.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Rv=Xe.event;function NF(){}function RF(){return this.cancelBubble}function HF(){return this.defaultPrevented}Xe.event=function(e){return Rv&&(e=Rv(e)),e.persist=NF,e.isPropagationStopped=RF,e.isDefaultPrevented=HF,e.nativeEvent=e};var th,BF={enumerable:!1,configurable:!0,get:function(){return this.class}},Hv=Xe.vnode;Xe.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={};for(var a in r){var o=r[a];if(!(a==="value"&&"defaultValue"in r&&o==null||OF&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var s=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&o===!0?o="":s==="translate"&&o==="no"?o=!1:s==="ondoubleclick"?a="ondblclick":s!=="onchange"||n!=="input"&&n!=="textarea"||LF(r.type)?s==="onfocus"?a="onfocusin":s==="onblur"?a="onfocusout":IF.test(a)?a=s:n.indexOf("-")===-1&&FF.test(a)?a=a.replace(AF,"-$&").toLowerCase():o===null&&(o=void 0):s=a="oninput",s==="oninput"&&i[a=s]&&(a="oninputCapture"),i[a]=o}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=fi(r.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=fi(r.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",BF)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=zv,Hv&&Hv(e)};var Bv=Xe.__r;Xe.__r=function(e){Bv&&Bv(e),th=e.__c};var Vv=Xe.diffed;Xe.diffed=function(e){Vv&&Vv(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),th=null};var VF={ReactCurrentDispatcher:{current:{readContext:function(e){return th.__n[e.__c].props.value}}}};function $F(e){return xr.bind(null,e)}function wu(e){return!!e&&e.$$typeof===zv}function UF(e){return wu(e)&&e.type===ct}function WF(e){return!!e&&!!e.displayName&&(typeof e.displayName=="string"||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function YF(e){return wu(e)?wv.apply(null,arguments):e}function Pi(e){return!!e.__k&&(xo(null,e),!0)}function zF(e){return e&&(e.base||e.nodeType===1&&e)||null}var KF=function(e,t){return e(t)},jF=function(e,t){return e(t)},qF=ct;function Kv(e){e()}function GF(e){return e}function JF(){return[!1,Kv]}var ZF=Ai,QF=wu;function XF(e,t){var r=t(),n=Ne({h:{__:r,v:t}}),i=n[0].h,a=n[1];return Ai(function(){i.__=r,i.v=t,Qf(i)&&a({h:i})},[e,r,t]),Ae(function(){return Qf(i)&&a({h:i}),e(function(){Qf(i)&&a({h:i})})},[e]),r}function Qf(e){var t,r,n=e.v,i=e.__;try{var a=n();return!((t=i)===(r=a)&&(t!==0||1/t==1/r)||t!=t&&r!=r)}catch(o){return!0}}var $e={useState:Ne,useId:Iv,useReducer:Jf,useEffect:Ae,useLayoutEffect:Ai,useInsertionEffect:ZF,useTransition:JF,useDeferredValue:GF,useSyncExternalStore:XF,startTransition:Kv,useRef:Fe,useImperativeHandle:Tv,useMemo:Re,useCallback:Ye,useContext:Ee,useDebugValue:Fv,version:"17.0.2",Children:xF,render:Li,hydrate:PF,unmountComponentAtNode:Pi,createPortal:Oi,createElement:xr,createContext:aa,createFactory:$F,cloneElement:YF,createRef:Yf,Fragment:ct,isValidElement:wu,isElement:QF,isFragment:UF,isMemo:WF,findDOMNode:zF,Component:Br,PureComponent:eh,memo:zt,forwardRef:kF,flushSync:jF,unstable_batchedUpdates:KF,StrictMode:qF,Suspense:vu,SuspenseList:Ys,lazy:_F,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:VF};function Ge(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let r=0,n;rn===i.length-1?r!==t[n]:r===t[n])}function SI(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}function js(e,t){if(SI(e,t))return 2;if(!DI(e,t))return 3;let r=e.length-1;return e[r]=0;n--)r={children:{[e[n]]:r}};return r}function qs(e,t){let r=t;for(let n=e.length-2;n>=0;n--)r={children:{[e[n]]:r}};return r}function iw(e,t){let r=t?[e.last(),1,t]:[e.last(),1];return qs(e,{children:{$splice:[r]}})}function aw(e,t,r=0){return qs(e,{children:{$splice:[[e.last()+r,0,...t]]}})}function xI(e,t){return qs(e,{children:{$push:t}})}function CI(e,t){return qs(e,{children:{$unshift:t}})}function Ri(e,t,r,n,i){let a=n?n(un(e,t)):un(e,t),s=js(t,r)===1?-1:0,u=i==null?void 0:i(un(e,t)),l=iw(t,u),c=aw(r,Array.isArray(a)?a:[a],s),d=(0,rw.default)(l,c,{isMergeableObject:h=>Ni(h)||Array.isArray(h)});return(0,la.default)(e,d)}function mi(e,t,r){return(0,la.default)(e,iw(t,r))}function Xr(e,t,r){return(0,la.default)(e,aw(t,r))}function ah(e,t,r){return(0,la.default)(e,xI(t,r))}function ow(e,t,r){return(0,la.default)(e,CI(t,r))}function Du(e,t,r){return(0,la.default)(e,kI(t,r))}function oh(e,t,r){return(0,la.default)(e,qs(t,r))}var Gs=["MO","TU","WE","TH","FR","SA","SU"],Mn=function(){function e(t,r){if(r===0)throw new Error("Can't create weekday with n == 0");this.weekday=t,this.n=r}return e.fromStr=function(t){return new e(Gs.indexOf(t))},e.prototype.nth=function(t){return this.n===t?this:new e(this.weekday,t)},e.prototype.equals=function(t){return this.weekday===t.weekday&&this.n===t.n},e.prototype.toString=function(){var t=Gs[this.weekday];return this.n&&(t=(this.n>0?"+":"")+String(this.n)+t),t},e.prototype.getJsWeekday=function(){return this.weekday===6?0:this.weekday+1},e}();var Gt=function(e){return e!=null},Cr=function(e){return typeof e=="number"},sh=function(e){return typeof e=="string"&&Gs.includes(e)},$n=Array.isArray,$r=function(e,t){t===void 0&&(t=e),arguments.length===1&&(t=e,e=0);for(var r=[],n=e;n>0,n.length>t?String(n):(t=t-n.length,t>r.length&&(r+=wt(r,t/r.length)),r.slice(0,t)+String(n))}var lw=function(e,t,r){var n=e.split(t);return r?n.slice(0,r).concat([n.slice(r).join(t)]):n},qn=function(e,t){var r=e%t;return r*t<0?r+t:r},Su=function(e,t){return{div:Math.floor(e/t),mod:qn(e,t)}},_r=function(e){return!Gt(e)||e.length===0},bn=function(e){return!_r(e)},Et=function(e,t){return bn(e)&&e.indexOf(t)!==-1};var pi=function(e,t,r,n,i,a){return n===void 0&&(n=0),i===void 0&&(i=0),a===void 0&&(a=0),new Date(Date.UTC(e,t-1,r,n,i,a))},_I=[31,28,31,30,31,30,31,31,30,31,30,31],cw=1e3*60*60*24,Eu=9999,dw=pi(1970,1,1),MI=[6,0,1,2,3,4,5];var To=function(e){return e%4===0&&e%100!==0||e%400===0},lh=function(e){return e instanceof Date},Ya=function(e){return lh(e)&&!isNaN(e.getTime())};var TI=function(e,t){var r=e.getTime(),n=t.getTime(),i=r-n;return Math.round(i/cw)},Js=function(e){return TI(e,dw)},ku=function(e){return new Date(dw.getTime()+e*cw)},FI=function(e){var t=e.getUTCMonth();return t===1&&To(e.getUTCFullYear())?29:_I[t]},Hi=function(e){return MI[e.getUTCDay()]},uh=function(e,t){var r=pi(e,t+1,1);return[Hi(r),FI(r)]},xu=function(e,t){return t=t||e,new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))},Cu=function(e){var t=new Date(e.getTime());return t},ch=function(e){for(var t=[],r=0;rthis.maxDate;if(this.method==="between"){if(r)return!0;if(n)return!1}else if(this.method==="before"){if(n)return!1}else if(this.method==="after")return r?!0:(this.add(t),!1);return this.add(t)},e.prototype.add=function(t){return this._result.push(t),!0},e.prototype.getValue=function(){var t=this._result;switch(this.method){case"all":case"between":return t;case"before":case"after":default:return t.length?t[t.length-1]:null}},e.prototype.clone=function(){return new e(this.method,this.args)},e}(),Vi=II;var dh=function(e,t){return dh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},dh(e,t)};function Io(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");dh(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var Un=function(){return Un=Object.assign||function(t){for(var r,n=1,i=arguments.length;n0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]0)&&!(i=n.next()).done;)a.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}function hw(){for(var e=[],t=0;tt[0].length)&&(t=a,r=i)}if(t!=null&&(this.text=this.text.substr(t[0].length),this.text===""&&(this.done=!0)),t==null){this.done=!0,this.symbol=null,this.value=null;return}}while(r==="SKIP");return this.symbol=r,this.value=t,!0},e.prototype.accept=function(t){if(this.symbol===t){if(this.value){var r=this.value;return this.nextSymbol(),r}return this.nextSymbol(),!0}return!1},e.prototype.acceptNumber=function(){return this.accept("number")},e.prototype.expect=function(t){if(this.accept(t))return!0;throw new Error("expected "+t+" but found "+this.symbol)},e}();function Qs(e,t){t===void 0&&(t=za);var r={},n=new HI(t.tokens);if(!n.start(e))return null;return i(),r;function i(){n.expect("every");var m=n.acceptNumber();if(m&&(r.interval=parseInt(m[0],10)),n.isDone())throw new Error("Unexpected end");switch(n.symbol){case"day(s)":r.freq=Oe.DAILY,n.nextSymbol()&&(o(),d());break;case"weekday(s)":r.freq=Oe.WEEKLY,r.byweekday=[Oe.MO,Oe.TU,Oe.WE,Oe.TH,Oe.FR],n.nextSymbol(),o(),d();break;case"week(s)":r.freq=Oe.WEEKLY,n.nextSymbol()&&(a(),o(),d());break;case"hour(s)":r.freq=Oe.HOURLY,n.nextSymbol()&&(a(),d());break;case"minute(s)":r.freq=Oe.MINUTELY,n.nextSymbol()&&(a(),d());break;case"month(s)":r.freq=Oe.MONTHLY,n.nextSymbol()&&(a(),d());break;case"year(s)":r.freq=Oe.YEARLY,n.nextSymbol()&&(a(),d());break;case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":r.freq=Oe.WEEKLY;var h=n.symbol.substr(0,2).toUpperCase();if(r.byweekday=[Oe[h]],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var g=u();if(!g)throw new Error("Unexpected symbol "+n.symbol+", expected weekday");r.byweekday.push(Oe[g]),n.nextSymbol()}o(),c(),d();break;case"january":case"february":case"march":case"april":case"may":case"june":case"july":case"august":case"september":case"october":case"november":case"december":if(r.freq=Oe.YEARLY,r.bymonth=[s()],!n.nextSymbol())return;for(;n.accept("comma");){if(n.isDone())throw new Error("Unexpected end");var y=s();if(!y)throw new Error("Unexpected symbol "+n.symbol+", expected month");r.bymonth.push(y),n.nextSymbol()}a(),d();break;default:throw new Error("Unknown symbol")}}function a(){var m=n.accept("on"),h=n.accept("the");if(m||h)do{var g=l(),y=u(),v=s();if(g)y?(n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(Oe[y].nth(g))):(r.bymonthday||(r.bymonthday=[]),r.bymonthday.push(g),n.accept("day(s)"));else if(y)n.nextSymbol(),r.byweekday||(r.byweekday=[]),r.byweekday.push(Oe[y]);else if(n.symbol==="weekday(s)")n.nextSymbol(),r.byweekday||(r.byweekday=[Oe.MO,Oe.TU,Oe.WE,Oe.TH,Oe.FR]);else if(n.symbol==="week(s)"){n.nextSymbol();var D=n.acceptNumber();if(!D)throw new Error("Unexpected symbol "+n.symbol+", expected week number");for(r.byweekno=[parseInt(D[0],10)];n.accept("comma");){if(D=n.acceptNumber(),!D)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.byweekno.push(parseInt(D[0],10))}}else if(v)n.nextSymbol(),r.bymonth||(r.bymonth=[]),r.bymonth.push(v);else return}while(n.accept("comma")||n.accept("the")||n.accept("on"))}function o(){var m=n.accept("at");if(m)do{var h=n.acceptNumber();if(!h)throw new Error("Unexpected symbol "+n.symbol+", expected hour");for(r.byhour=[parseInt(h[0],10)];n.accept("comma");){if(h=n.acceptNumber(),!h)throw new Error("Unexpected symbol "+n.symbol+"; expected hour");r.byhour.push(parseInt(h[0],10))}}while(n.accept("comma")||n.accept("at"))}function s(){switch(n.symbol){case"january":return 1;case"february":return 2;case"march":return 3;case"april":return 4;case"may":return 5;case"june":return 6;case"july":return 7;case"august":return 8;case"september":return 9;case"october":return 10;case"november":return 11;case"december":return 12;default:return!1}}function u(){switch(n.symbol){case"monday":case"tuesday":case"wednesday":case"thursday":case"friday":case"saturday":case"sunday":return n.symbol.substr(0,2).toUpperCase();default:return!1}}function l(){switch(n.symbol){case"last":return n.nextSymbol(),-1;case"first":return n.nextSymbol(),1;case"second":return n.nextSymbol(),n.accept("last")?-2:2;case"third":return n.nextSymbol(),n.accept("last")?-3:3;case"nth":var m=parseInt(n.value[1],10);if(m<-366||m>366)throw new Error("Nth out of range: "+m);return n.nextSymbol(),n.accept("last")?-m:m;default:return!1}}function c(){n.accept("on"),n.accept("the");var m=l();if(m)for(r.bymonthday=[m],n.nextSymbol();n.accept("comma");){if(m=l(),!m)throw new Error("Unexpected symbol "+n.symbol+"; expected monthday");r.bymonthday.push(m),n.nextSymbol()}}function d(){if(n.symbol==="until"){var m=Date.parse(n.text);if(!m)throw new Error("Cannot parse until date:"+n.text);r.until=new Date(m)}else n.accept("for")&&(r.count=parseInt(n.value[0],10),n.expect("number"))}}var pt;(function(e){e[e.YEARLY=0]="YEARLY",e[e.MONTHLY=1]="MONTHLY",e[e.WEEKLY=2]="WEEKLY",e[e.DAILY=3]="DAILY",e[e.HOURLY=4]="HOURLY",e[e.MINUTELY=5]="MINUTELY",e[e.SECONDLY=6]="SECONDLY"})(pt||(pt={}));function Xs(e){return e12){var n=Math.floor(this.month/12),i=qn(this.month,12);this.month=i,this.year+=n,this.month===0&&(this.month=12,--this.year)}},t.prototype.addWeekly=function(r,n){n>this.getWeekday()?this.day+=-(this.getWeekday()+1+(6-n))+r*7:this.day+=-(this.getWeekday()-n)+r*7,this.fixDay()},t.prototype.addDaily=function(r){this.day+=r,this.fixDay()},t.prototype.addHours=function(r,n,i){for(n&&(this.hour+=Math.floor((23-this.hour)/r)*r);;){this.hour+=r;var a=Su(this.hour,24),o=a.div,s=a.mod;if(o&&(this.hour=s,this.addDaily(o)),_r(i)||Et(i,this.hour))break}},t.prototype.addMinutes=function(r,n,i,a){for(n&&(this.minute+=Math.floor((1439-(this.hour*60+this.minute))/r)*r);;){this.minute+=r;var o=Su(this.minute,60),s=o.div,u=o.mod;if(s&&(this.minute=u,this.addHours(s,!1,i)),(_r(i)||Et(i,this.hour))&&(_r(a)||Et(a,this.minute)))break}},t.prototype.addSeconds=function(r,n,i,a,o){for(n&&(this.second+=Math.floor((86399-(this.hour*3600+this.minute*60+this.second))/r)*r);;){this.second+=r;var s=Su(this.second,60),u=s.div,l=s.mod;if(u&&(this.second=l,this.addMinutes(u,!1,i,a)),(_r(i)||Et(i,this.hour))&&(_r(a)||Et(a,this.minute))&&(_r(o)||Et(o,this.second)))break}},t.prototype.fixDay=function(){if(!(this.day<=28)){var r=uh(this.year,this.month-1)[1];if(!(this.day<=r))for(;this.day>r;){if(this.day-=r,++this.month,this.month===13&&(this.month=1,++this.year,this.year>Eu))return;r=uh(this.year,this.month-1)[1]}}},t.prototype.add=function(r,n){var i=r.freq,a=r.interval,o=r.wkst,s=r.byhour,u=r.byminute,l=r.bysecond;switch(i){case pt.YEARLY:return this.addYears(a);case pt.MONTHLY:return this.addMonths(a);case pt.WEEKLY:return this.addWeekly(a,o);case pt.DAILY:return this.addDaily(a);case pt.HOURLY:return this.addHours(a,n,s);case pt.MINUTELY:return this.addMinutes(a,n,s,u);case pt.SECONDLY:return this.addSeconds(a,n,s,u,l)}},t}(Po);function hh(e){for(var t=[],r=Object.keys(e),n=0,i=r;n=-366&&n<=366))throw new Error("bysetpos must be between 1 and 366, or between -366 and -1")}}if(!(t.byweekno||bn(t.byweekno)||bn(t.byyearday)||t.bymonthday||bn(t.bymonthday)||Gt(t.byweekday)||Gt(t.byeaster)))switch(t.freq){case Oe.YEARLY:t.bymonth||(t.bymonth=t.dtstart.getUTCMonth()+1),t.bymonthday=t.dtstart.getUTCDate();break;case Oe.MONTHLY:t.bymonthday=t.dtstart.getUTCDate();break;case Oe.WEEKLY:t.byweekday=[Hi(t.dtstart)];break}if(Gt(t.bymonth)&&!$n(t.bymonth)&&(t.bymonth=[t.bymonth]),Gt(t.byyearday)&&!$n(t.byyearday)&&Cr(t.byyearday)&&(t.byyearday=[t.byyearday]),!Gt(t.bymonthday))t.bymonthday=[],t.bynmonthday=[];else if($n(t.bymonthday)){for(var i=[],a=[],r=0;r0?i.push(n):n<0&&a.push(n)}t.bymonthday=i,t.bynmonthday=a}else t.bymonthday<0?(t.bynmonthday=[t.bymonthday],t.bymonthday=[]):(t.bynmonthday=[],t.bymonthday=[t.bymonthday]);if(Gt(t.byweekno)&&!$n(t.byweekno)&&(t.byweekno=[t.byweekno]),!Gt(t.byweekday))t.bynweekday=null;else if(Cr(t.byweekday))t.byweekday=[t.byweekday],t.bynweekday=null;else if(sh(t.byweekday))t.byweekday=[Mn.fromStr(t.byweekday).weekday],t.bynweekday=null;else if(t.byweekday instanceof Mn)!t.byweekday.n||t.freq>Oe.MONTHLY?(t.byweekday=[t.byweekday.weekday],t.bynweekday=null):(t.bynweekday=[[t.byweekday.weekday,t.byweekday.n]],t.byweekday=null);else{for(var o=[],s=[],r=0;rOe.MONTHLY?o.push(u.weekday):s.push([u.weekday,u.n])}t.byweekday=bn(o)?o:null,t.bynweekday=bn(s)?s:null}return Gt(t.byhour)?Cr(t.byhour)&&(t.byhour=[t.byhour]):t.byhour=t.freq=4?(c=0,l=s.yearlen+qn(o-t.wkst,7)):l=n-c;for(var d=Math.floor(l/7),m=qn(l,7),h=Math.floor(d+m/4),g=0;g0&&y<=h){var v=void 0;y>1?(v=c+(y-1)*7,c!==u&&(v-=7-u)):v=c;for(var D=0;D<7&&(s.wnomask[v]=1,v++,s.wdaymask[v]!==t.wkst);D++);}}if(Et(t.byweekno,1)){var v=c+h*7;if(c!==u&&(v-=7-u),v=4?(x=0,A=O+qn(C-t.wkst,7)):A=n-c,I=Math.floor(52+qn(A,7)/4)}if(Et(t.byweekno,I))for(var v=0;va)return $i(e);if(I>=r){var C=Hw(I,t);if(!e.accept(C)||s&&(--s,!s))return $i(e)}}else for(var D=h;Da)return $i(e);if(I>=r){var C=Hw(I,t);if(!e.accept(C)||s&&(--s,!s))return $i(e)}}}if(t.interval===0||(u.add(t,y),u.year>Eu))return $i(e);Xs(n)||(c=l.gettimeset(n)(u.hour,u.minute,u.second,0)),l.rebuild(u.year,u.month)}}function JI(e,t,r){var n=r.bymonth,i=r.byweekno,a=r.byweekday,o=r.byeaster,s=r.bymonthday,u=r.bynmonthday,l=r.byyearday;return bn(n)&&!Et(n,e.mmask[t])||bn(i)&&!e.wnomask[t]||bn(a)&&!Et(a,e.wdaymask[t])||bn(e.nwdaymask)&&!e.nwdaymask[t]||o!==null&&!Et(e.eastermask,t)||(bn(s)||bn(u))&&!Et(s,e.mdaymask[t])&&!Et(u,e.nmdaymask[t])||bn(l)&&(t=e.yearlen&&!Et(l,t+1-e.yearlen)&&!Et(l,-e.nextyearlen+t-e.yearlen))}function Hw(e,t){return new Ka(e,t.tzid).rezonedDate()}function $i(e){return e.getValue()}function ZI(e,t,r,n,i){for(var a=!1,o=t;o=Oe.HOURLY&&bn(i)&&!Et(i,t.hour)||n>=Oe.MINUTELY&&bn(a)&&!Et(a,t.minute)||n>=Oe.SECONDLY&&bn(o)&&!Et(o,t.second)?[]:e.gettimeset(n)(t.hour,t.minute,t.second,t.millisecond)}var Ur={MO:new Mn(0),TU:new Mn(1),WE:new Mn(2),TH:new Mn(3),FR:new Mn(4),SA:new Mn(5),SU:new Mn(6)},el={freq:pt.YEARLY,dtstart:null,interval:1,wkst:Ur.MO,count:null,until:null,tzid:null,bysetpos:null,bymonth:null,bymonthday:null,bynmonthday:null,byyearday:null,byweekno:null,byweekday:null,bynweekday:null,byhour:null,byminute:null,bysecond:null,byeaster:null},Dw=Object.keys(el),Oe=function(){function e(t,r){t===void 0&&(t={}),r===void 0&&(r=!1),this._cache=r?null:new kw,this.origOptions=hh(t);var n=ww(t).parsedOptions;this.options=n}return e.parseText=function(t,r){return Qs(t,r)},e.fromText=function(t,r){return pw(t,r)},e.fromString=function(t){return new e(e.parseString(t)||void 0)},e.prototype._iter=function(t){return _u(t,this.options)},e.prototype._cacheGet=function(t,r){return this._cache?this._cache._cacheGet(t,r):!1},e.prototype._cacheAdd=function(t,r,n){if(this._cache)return this._cache._cacheAdd(t,r,n)},e.prototype.all=function(t){if(t)return this._iter(new fh("all",{},t));var r=this._cacheGet("all");return r===!1&&(r=this._iter(new Vi("all",{})),this._cacheAdd("all",r)),r},e.prototype.between=function(t,r,n,i){if(n===void 0&&(n=!1),!Ya(t)||!Ya(r))throw new Error("Invalid date passed in to RRule.between");var a={before:r,after:t,inc:n};if(i)return this._iter(new fh("between",a,i));var o=this._cacheGet("between",a);return o===!1&&(o=this._iter(new Vi("between",a)),this._cacheAdd("between",o,a)),o},e.prototype.before=function(t,r){if(r===void 0&&(r=!1),!Ya(t))throw new Error("Invalid date passed in to RRule.before");var n={dt:t,inc:r},i=this._cacheGet("before",n);return i===!1&&(i=this._iter(new Vi("before",n)),this._cacheAdd("before",i,n)),i},e.prototype.after=function(t,r){if(r===void 0&&(r=!1),!Ya(t))throw new Error("Invalid date passed in to RRule.after");var n={dt:t,inc:r},i=this._cacheGet("after",n);return i===!1&&(i=this._iter(new Vi("after",n)),this._cacheAdd("after",i,n)),i},e.prototype.count=function(){return this.all().length},e.prototype.toString=function(){return rl(this.origOptions)},e.prototype.toText=function(t,r,n){return gw(this,t,r,n)},e.prototype.isFullyConvertibleToText=function(){return yw(this)},e.prototype.clone=function(){return new e(this.origOptions)},e.FREQUENCIES=["YEARLY","MONTHLY","WEEKLY","DAILY","HOURLY","MINUTELY","SECONDLY"],e.YEARLY=pt.YEARLY,e.MONTHLY=pt.MONTHLY,e.WEEKLY=pt.WEEKLY,e.DAILY=pt.DAILY,e.HOURLY=pt.HOURLY,e.MINUTELY=pt.MINUTELY,e.SECONDLY=pt.SECONDLY,e.MO=Ur.MO,e.TU=Ur.TU,e.WE=Ur.WE,e.TH=Ur.TH,e.FR=Ur.FR,e.SA=Ur.SA,e.SU=Ur.SU,e.parseString=nl,e.optionsToString=rl,e}();function Bw(e,t,r,n,i,a){var o={},s=e.accept;function u(m,h){r.forEach(function(g){g.between(m,h,!0).forEach(function(y){o[Number(y)]=!0})})}i.forEach(function(m){var h=new Ka(m,a).rezonedDate();o[Number(h)]=!0}),e.accept=function(m){var h=Number(m);return isNaN(h)?s.call(this,m):!o[h]&&(u(new Date(h-1),new Date(h+1)),!o[h])?(o[h]=!0,s.call(this,m)):!0},e.method==="between"&&(u(e.args.after,e.args.before),e.accept=function(m){var h=Number(m);return o[h]?!0:(o[h]=!0,s.call(this,m))});for(var l=0;l1||i.length||a.length||o.length){var c=new gh(l);return c.dtstart(s),c.tzid(u||void 0),n.forEach(function(m){c.rrule(new Oe(ph(m,s,u),l))}),i.forEach(function(m){c.rdate(m)}),a.forEach(function(m){c.exrule(new Oe(ph(m,s,u),l))}),o.forEach(function(m){c.exdate(m)}),t.compatible&&t.dtstart&&c.rdate(s),c}var d=n[0]||{};return new Oe(ph(d,d.dtstart||t.dtstart||s,d.tzid||t.tzid||u),l)}function Mu(e,t){return t===void 0&&(t={}),eA(e,tA(t))}function ph(e,t,r){return Un(Un({},e),{dtstart:t,tzid:r})}function tA(e){var t=[],r=Object.keys(e),n=Object.keys(Vw);if(r.forEach(function(i){Et(n,i)||t.push(i)}),t.length)throw new Error("Invalid options: "+t.join(", "));return Un(Un({},Vw),e)}function nA(e){if(e.indexOf(":")===-1)return{name:"RRULE",value:e};var t=lw(e,":",1),r=t[0],n=t[1];return{name:r,value:n}}function rA(e){var t=nA(e),r=t.name,n=t.value,i=r.split(";");if(!i)throw new Error("empty property name");return{name:i[0].toUpperCase(),parms:i.slice(1),value:n}}function iA(e,t){if(t===void 0&&(t=!1),e=e&&e.trim(),!e)throw new Error("Invalid empty string");if(!t)return e.split(/\s/);for(var r=e.split(` +`),n=0;n0&&i[0]===" "?(r[n-1]+=i.slice(1),r.splice(n,1)):n+=1:r.splice(n,1)}return r}function aA(e){e.forEach(function(t){if(!/(VALUE=DATE(-TIME)?)|(TZID=)/.test(t))throw new Error("unsupported RDATE/EXDATE parm: "+t)})}function $w(e,t){return aA(t),e.split(",").map(function(r){return Zs(r)})}function Uw(e){var t=this;return function(r){if(r!==void 0&&(t["_".concat(e)]=r),t["_".concat(e)]!==void 0)return t["_".concat(e)];for(var n=0;n