commit 5840b11621965773ea2d2b810b9b54975dc66116 Author: Andreas Bail Date: Wed Jun 17 13:56:57 2026 +0200 inital commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a168252 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Dokumentationen/ +tickets.md \ No newline at end of file diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..c146ada --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1,11 @@ +{ + "readableLineLength": false, + "promptDelete": false, + "alwaysUpdateLinks": true, + "pdfExportSettings": { + "pageSize": "A4", + "landscape": false, + "margin": "2", + "downscalePercent": 100 + } +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..89507ca --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,3 @@ +{ + "accentColor": "#f63131" +} \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json new file mode 100644 index 0000000..dfe93ec --- /dev/null +++ b/.obsidian/community-plugins.json @@ -0,0 +1,5 @@ +[ + "obsidian-kanban", + "obsidian-excel-to-markdown-table", + "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..98b1155 --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": false, + "outgoing-link": true, + "tag-pane": true, + "footnotes": false, + "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, + "bases": true, + "webviewer": false +} \ No newline at end of file diff --git a/.obsidian/daily-notes.json b/.obsidian/daily-notes.json new file mode 100644 index 0000000..50f43b4 --- /dev/null +++ b/.obsidian/daily-notes.json @@ -0,0 +1,5 @@ +{ + "folder": "Berichtsheft", + "format": "WW YYYY", + "template": "Templates/Berichtsheft" +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-excel-to-markdown-table/main.js b/.obsidian/plugins/obsidian-excel-to-markdown-table/main.js new file mode 100644 index 0000000..7080987 --- /dev/null +++ b/.obsidian/plugins/obsidian-excel-to-markdown-table/main.js @@ -0,0 +1,230 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __export = (target, all) => { + __markAsModule(target); + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && key !== "default") + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toModule = (module2) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// src/main.ts +__export(exports, { + default: () => ExcelToMarkdownTablePlugin +}); +var import_obsidian = __toModule(require("obsidian")); + +// src/table-alignment-syntax.ts +var ALIGNED_LEFT_SYNTAX = { + prefix: "", + postfix: "", + adjust: 0 +}; +var ALIGNED_RIGHT_SYNTAX = { + prefix: "", + postfix: ":", + adjust: 1 +}; +var ALIGNED_CENTER_SYNTAX = { + prefix: ":", + postfix: ":", + adjust: 2 +}; + +// src/excel-markdown-helpers.ts +var ALIGNED_LEFT = "l"; +var ALIGNED_RIGHT = "r"; +var ALIGNED_CENTER = "c"; +var EXCEL_COLUMN_DELIMITER = " "; +var MARKDOWN_NEWLINE = "
"; +var UNESCAPED_DOUBLE_QUOTE = '"'; +var EXCEL_ROW_DELIMITER_REGEX = /[\n\u0085\u2028\u2029]|\r\n?/g; +var COLUMN_ALIGNMENT_REGEX = /^(\^[lcr])/i; +var EXCEL_NEWLINE_ESCAPED_CELL_REGEX = /"([^\t]*(?<=[^\r])\n[^\t]*)"/g; +var EXCEL_NEWLINE_REGEX = /\n/g; +var EXCEL_DOUBLE_QUOTE_ESCAPED_REGEX = /""/g; +function addMarkdownSyntax(rows, columnWidths) { + return rows.map(function(row, rowIndex) { + return "| " + row.map(function(column, index) { + column = column.replace("|", "\\|"); + return column + Array(columnWidths[index] - column.length + 1).join(" "); + }).join(" | ") + " |"; + }); +} +function addAlignmentSyntax(markdownRows, columnWidths, colAlignments) { + let result = Object.assign([], markdownRows); + result.splice(1, 0, "|" + columnWidths.map(function(width, index) { + let { prefix, postfix, adjust } = calculateAlignmentMarkdownSyntaxMetadata(colAlignments[index]); + return prefix + Array(columnWidths[index] + 3 - adjust).join("-") + postfix; + }).join("|") + "|"); + return result; +} +function calculateAlignmentMarkdownSyntaxMetadata(alignment) { + switch (alignment) { + case ALIGNED_LEFT: + return ALIGNED_LEFT_SYNTAX; + case ALIGNED_CENTER: + return ALIGNED_CENTER_SYNTAX; + case ALIGNED_RIGHT: + return ALIGNED_RIGHT_SYNTAX; + default: + return ALIGNED_LEFT_SYNTAX; + } +} +function getColumnWidthsAndAlignments(rows) { + let colAlignments = []; + return { + columnWidths: rows[0].map(function(column, columnIndex) { + let alignment = columnAlignment(column); + colAlignments.push(alignment); + column = column.replace(COLUMN_ALIGNMENT_REGEX, ""); + rows[0][columnIndex] = column; + return columnWidth(rows, columnIndex); + }), + colAlignments + }; +} +function columnAlignment(columnHeaderText) { + var m = columnHeaderText.match(COLUMN_ALIGNMENT_REGEX); + if (m) { + var alignChar = m[1][1].toLowerCase(); + return columnAlignmentFromChar(alignChar); + } + return ALIGNED_LEFT; +} +function columnAlignmentFromChar(alignChar) { + switch (alignChar) { + case ALIGNED_LEFT: + return ALIGNED_LEFT; + case ALIGNED_CENTER: + return ALIGNED_CENTER; + case ALIGNED_RIGHT: + return ALIGNED_RIGHT; + default: + return ALIGNED_LEFT; + } +} +function columnWidth(rows, columnIndex) { + return Math.max.apply(null, rows.map(function(row) { + return row[columnIndex] && row[columnIndex].length || 0; + })); +} +function splitIntoRowsAndColumns(data) { + var rows = data.split(EXCEL_ROW_DELIMITER_REGEX).map(function(row) { + return row.split(EXCEL_COLUMN_DELIMITER); + }); + return rows; +} +function replaceIntraCellNewline(data) { + let cellReplacer = (_) => _.slice(1, -1).replace(EXCEL_DOUBLE_QUOTE_ESCAPED_REGEX, UNESCAPED_DOUBLE_QUOTE).replace(EXCEL_NEWLINE_REGEX, MARKDOWN_NEWLINE); + return data.replace(EXCEL_NEWLINE_ESCAPED_CELL_REGEX, cellReplacer); +} + +// src/excel-markdown-tables.ts +var LINE_ENDING = "\n"; +function excelToMarkdown(rawData) { + let data = rawData.trim(); + var intraCellNewlineReplacedData = replaceIntraCellNewline(data); + var rows = splitIntoRowsAndColumns(intraCellNewlineReplacedData); + var { columnWidths, colAlignments } = getColumnWidthsAndAlignments(rows); + const markdownRows = addMarkdownSyntax(rows, columnWidths); + return addAlignmentSyntax(markdownRows, columnWidths, colAlignments).join(LINE_ENDING); +} +function getExcelRows(rawData) { + let data = rawData.trim(); + var intraCellNewlineReplacedData = replaceIntraCellNewline(data); + return splitIntoRowsAndColumns(intraCellNewlineReplacedData); +} +function excelRowsToMarkdown(rows) { + var { columnWidths, colAlignments } = getColumnWidthsAndAlignments(rows); + const markdownRows = addMarkdownSyntax(rows, columnWidths); + return addAlignmentSyntax(markdownRows, columnWidths, colAlignments).join(LINE_ENDING); +} +function isExcelData(rows) { + return rows && rows[0] && rows[0].length > 1 ? true : false; +} + +// src/main.ts +var ExcelToMarkdownTablePlugin = class extends import_obsidian.Plugin { + constructor() { + super(...arguments); + this.pasteHandler = (evt, editor) => { + if (evt.clipboardData === null) { + return; + } + if (evt.clipboardData.types.length === 1 && evt.clipboardData.types[0] === "text/plain") { + return; + } + const rawData = evt.clipboardData.getData("text"); + const rows = getExcelRows(rawData); + if (isExcelData(rows)) { + const markdownData = excelRowsToMarkdown(rows); + editor.replaceSelection(markdownData + "\n"); + evt.preventDefault(); + } + }; + } + onload() { + return __async(this, null, function* () { + this.addCommand({ + id: "excel-to-markdown-table", + name: "Excel to Markdown", + hotkeys: [ + { + modifiers: ["Mod", "Alt"], + key: "v" + } + ], + editorCallback: (editor, view) => __async(this, null, function* () { + const text = yield navigator.clipboard.readText(); + editor.replaceSelection(excelToMarkdown(text)); + }) + }); + this.app.workspace.on("editor-paste", this.pasteHandler); + }); + } + onunload() { + this.app.workspace.off("editor-paste", this.pasteHandler); + } +}; + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-excel-to-markdown-table/manifest.json b/.obsidian/plugins/obsidian-excel-to-markdown-table/manifest.json new file mode 100644 index 0000000..7d3f9dd --- /dev/null +++ b/.obsidian/plugins/obsidian-excel-to-markdown-table/manifest.json @@ -0,0 +1,10 @@ +{ + "id": "obsidian-excel-to-markdown-table", + "name": "Excel to Markdown Table", + "version": "0.4.0", + "minAppVersion": "0.12.0", + "description": "An Obsidian plugin to paste data from Microsoft Excel, Google Sheets, Apple Numbers and LibreOffice Calc as Markdown tables in Obsidian editor.", + "author": "Ganessh Kumar R P ", + "authorUrl": "https://ganesshkumar.com", + "isDesktopOnly": false +} \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-excel-to-markdown-table/styles.css b/.obsidian/plugins/obsidian-excel-to-markdown-table/styles.css new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.obsidian/plugins/obsidian-excel-to-markdown-table/styles.css @@ -0,0 +1 @@ + diff --git a/.obsidian/plugins/obsidian-git/main.js b/.obsidian/plugins/obsidian-git/main.js new file mode 100644 index 0000000..e9f85a8 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/main.js @@ -0,0 +1,415 @@ +/* +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 TF=Object.create;var vc=Object.defineProperty;var PF=Object.getOwnPropertyDescriptor;var RF=Object.getOwnPropertyNames;var $F=Object.getPrototypeOf,FF=Object.prototype.hasOwnProperty;var yb=t=>{throw TypeError(t)};var IF=(t,e,r)=>e in t?vc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var MF=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var U=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},DF=(t,e)=>{for(var r in e)vc(t,r,{get:e[r],enumerable:!0})},xb=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of RF(e))!FF.call(t,n)&&n!==r&&vc(t,n,{get:()=>e[n],enumerable:!(i=PF(e,n))||i.enumerable});return t};var Gt=(t,e,r)=>(r=t!=null?TF($F(t)):{},xb(e||!t||!t.__esModule?vc(r,"default",{value:t,enumerable:!0}):r,t)),OF=t=>xb(vc({},"__esModule",{value:!0}),t);var He=(t,e,r)=>IF(t,typeof e!="symbol"?e+"":e,r),Yp=(t,e,r)=>e.has(t)||yb("Cannot "+r);var F=(t,e,r)=>(Yp(t,e,"read from private field"),r?r.call(t):e.get(t)),ge=(t,e,r)=>e.has(t)?yb("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),pe=(t,e,r,i)=>(Yp(t,e,"write to private field"),i?i.call(t,r):e.set(t,r),r),Ae=(t,e,r)=>(Yp(t,e,"access private method"),r);var kb=U(Cf=>{"use strict";m();Cf.byteLength=NF;Cf.toByteArray=HF;Cf.fromByteArray=jF;var on=[],pi=[],LF=typeof Uint8Array!="undefined"?Uint8Array:Array,Zp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ia=0,Eb=Zp.length;ia0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function NF(t){var e=Sb(t),r=e[0],i=e[1];return(r+i)*3/4-i}function BF(t,e,r){return(e+r)*3/4-r}function HF(t){var e,r=Sb(t),i=r[0],n=r[1],s=new LF(BF(t,i,n)),a=0,o=n>0?i-4:i,l;for(l=0;l>16&255,s[a++]=e>>8&255,s[a++]=e&255;return n===2&&(e=pi[t.charCodeAt(l)]<<2|pi[t.charCodeAt(l+1)]>>4,s[a++]=e&255),n===1&&(e=pi[t.charCodeAt(l)]<<10|pi[t.charCodeAt(l+1)]<<4|pi[t.charCodeAt(l+2)]>>2,s[a++]=e>>8&255,s[a++]=e&255),s}function UF(t){return on[t>>18&63]+on[t>>12&63]+on[t>>6&63]+on[t&63]}function GF(t,e,r){for(var i,n=[],s=e;so?o:a+s));return i===1?(e=t[r-1],n.push(on[e>>2]+on[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(on[e>>10]+on[e>>4&63]+on[e<<2&63]+"=")),n.join("")}});var Ab=U(Kp=>{m();Kp.read=function(t,e,r,i,n){var s,a,o=n*8-i-1,l=(1<>1,u=-7,f=r?n-1:0,d=r?-1:1,h=t[e+f];for(f+=d,s=h&(1<<-u)-1,h>>=-u,u+=o;u>0;s=s*256+t[e+f],f+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=i;u>0;a=a*256+t[e+f],f+=d,u-=8);if(s===0)s=1-c;else{if(s===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,i),s=s-c}return(h?-1:1)*a*Math.pow(2,s-i)};Kp.write=function(t,e,r,i,n,s){var a,o,l,c=s*8-n-1,u=(1<>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,p=i?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?e+=d/l:e+=d*Math.pow(2,1-f),e*l>=2&&(a++,l/=2),a+f>=u?(o=0,a=u):a+f>=1?(o=(e*l-1)*Math.pow(2,n),a=a+f):(o=e*Math.pow(2,f-1)*Math.pow(2,n),a=0));n>=8;t[r+h]=o&255,h+=p,o/=256,n-=8);for(a=a<0;t[r+h]=a&255,h+=p,a/=256,c-=8);t[r+h-p]|=g*128}});var sm=U(So=>{"use strict";m();var Xp=kb(),xo=Ab(),Cb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;So.Buffer=O;So.SlowBuffer=ZF;So.INSPECT_MAX_BYTES=50;var Tf=2147483647;So.kMaxLength=Tf;O.TYPED_ARRAY_SUPPORT=VF();!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 VF(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(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 Bn(t){if(t>Tf)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,O.prototype),e}function O(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return tm(t)}return $b(t,e,r)}O.poolSize=8192;function $b(t,e,r){if(typeof t=="string")return WF(t,e);if(ArrayBuffer.isView(t))return qF(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(ln(t,ArrayBuffer)||t&&ln(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(ln(t,SharedArrayBuffer)||t&&ln(t.buffer,SharedArrayBuffer)))return Jp(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return O.from(i,e,r);let n=YF(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return O.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}O.from=function(t,e,r){return $b(t,e,r)};Object.setPrototypeOf(O.prototype,Uint8Array.prototype);Object.setPrototypeOf(O,Uint8Array);function Fb(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function zF(t,e,r){return Fb(t),t<=0?Bn(t):e!==void 0?typeof r=="string"?Bn(t).fill(e,r):Bn(t).fill(e):Bn(t)}O.alloc=function(t,e,r){return zF(t,e,r)};function tm(t){return Fb(t),Bn(t<0?0:rm(t)|0)}O.allocUnsafe=function(t){return tm(t)};O.allocUnsafeSlow=function(t){return tm(t)};function WF(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!O.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Ib(t,e)|0,i=Bn(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function Qp(t){let e=t.length<0?0:rm(t.length)|0,r=Bn(e);for(let i=0;i=Tf)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tf.toString(16)+" bytes");return t|0}function ZF(t){return+t!=t&&(t=0),O.alloc(+t)}O.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==O.prototype};O.compare=function(e,r){if(ln(e,Uint8Array)&&(e=O.from(e,e.offset,e.byteLength)),ln(r,Uint8Array)&&(r=O.from(r,r.offset,r.byteLength)),!O.isBuffer(e)||!O.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,a=Math.min(i,n);sn.length?(O.isBuffer(a)||(a=O.from(a)),a.copy(n,s)):Uint8Array.prototype.set.call(n,a,s);else if(O.isBuffer(a))a.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=a.length}return n};function Ib(t,e){if(O.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||ln(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return em(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Gb(t).length;default:if(n)return i?-1:em(t).length;e=(""+e).toLowerCase(),n=!0}}O.byteLength=Ib;function KF(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return aI(this,e,r);case"utf8":case"utf-8":return Db(this,e,r);case"ascii":return nI(this,e,r);case"latin1":case"binary":return sI(this,e,r);case"base64":return rI(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oI(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}O.prototype._isBuffer=!0;function na(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}O.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};Cb&&(O.prototype[Cb]=O.prototype.inspect);O.prototype.compare=function(e,r,i,n,s){if(ln(e,Uint8Array)&&(e=O.from(e,e.offset,e.byteLength)),!O.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let a=s-n,o=i-r,l=Math.min(a,o),c=this.slice(n,s),u=e.slice(r,i);for(let f=0;f2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,nm(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=O.from(e,i)),O.isBuffer(e))return e.length===0?-1:Tb(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Tb(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Tb(t,e,r,i,n){let s=1,a=t.length,o=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,a/=2,o/=2,r/=2}function l(u,f){return s===1?u[f]:u.readUInt16BE(f*s)}let c;if(n){let u=-1;for(c=r;ca&&(r=a-o),c=r;c>=0;c--){let u=!0;for(let f=0;fn&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let a;for(a=0;a>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return XF(this,e,r,i);case"utf8":case"utf-8":return QF(this,e,r,i);case"ascii":case"latin1":case"binary":return JF(this,e,r,i);case"base64":return eI(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tI(this,e,r,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};O.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rI(t,e,r){return e===0&&r===t.length?Xp.fromByteArray(t):Xp.fromByteArray(t.slice(e,r))}function Db(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n239?4:s>223?3:s>191?2:1;if(n+o<=r){let l,c,u,f;switch(o){case 1:s<128&&(a=s);break;case 2:l=t[n+1],(l&192)===128&&(f=(s&31)<<6|l&63,f>127&&(a=f));break;case 3:l=t[n+1],c=t[n+2],(l&192)===128&&(c&192)===128&&(f=(s&15)<<12|(l&63)<<6|c&63,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:l=t[n+1],c=t[n+2],u=t[n+3],(l&192)===128&&(c&192)===128&&(u&192)===128&&(f=(s&15)<<18|(l&63)<<12|(c&63)<<6|u&63,f>65535&&f<1114112&&(a=f))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=o}return iI(i)}var Pb=4096;function iI(t){let e=t.length;if(e<=Pb)return String.fromCharCode.apply(String,t);let r="",i=0;for(;ii)&&(r=i);let n="";for(let s=e;si&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),rr)throw new RangeError("Trying to access beyond buffer length")}O.prototype.readUintLE=O.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||jt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a>>0,r=r>>>0,i||jt(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};O.prototype.readUint8=O.prototype.readUInt8=function(e,r){return e=e>>>0,r||jt(e,1,this.length),this[e]};O.prototype.readUint16LE=O.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||jt(e,2,this.length),this[e]|this[e+1]<<8};O.prototype.readUint16BE=O.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||jt(e,2,this.length),this[e]<<8|this[e+1]};O.prototype.readUint32LE=O.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};O.prototype.readUint32BE=O.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};O.prototype.readBigUInt64LE=vs(function(e){e=e>>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<>>0,r=r>>>0,i||jt(e,r,this.length);let n=this[e],s=1,a=0;for(;++a=s&&(n-=Math.pow(2,8*r)),n};O.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||jt(e,r,this.length);let n=r,s=1,a=this[e+--n];for(;n>0&&(s*=256);)a+=this[e+--n]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*r)),a};O.prototype.readInt8=function(e,r){return e=e>>>0,r||jt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};O.prototype.readInt16LE=function(e,r){e=e>>>0,r||jt(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};O.prototype.readInt16BE=function(e,r){e=e>>>0,r||jt(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};O.prototype.readInt32LE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};O.prototype.readInt32BE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};O.prototype.readBigInt64LE=vs(function(e){e=e>>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<>>0,Eo(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&wc(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<>>0,r||jt(e,4,this.length),xo.read(this,e,!0,23,4)};O.prototype.readFloatBE=function(e,r){return e=e>>>0,r||jt(e,4,this.length),xo.read(this,e,!1,23,4)};O.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||jt(e,8,this.length),xo.read(this,e,!0,52,8)};O.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||jt(e,8,this.length),xo.read(this,e,!1,52,8)};function $r(t,e,r,i,n,s){if(!O.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}O.prototype.writeUintLE=O.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;$r(this,e,r,i,o,0)}let s=1,a=0;for(this[r]=e&255;++a>>0,i=i>>>0,!n){let o=Math.pow(2,8*i)-1;$r(this,e,r,i,o,0)}let s=i-1,a=1;for(this[r+s]=e&255;--s>=0&&(a*=256);)this[r+s]=e/a&255;return r+i};O.prototype.writeUint8=O.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,1,255,0),this[r]=e&255,r+1};O.prototype.writeUint16LE=O.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};O.prototype.writeUint16BE=O.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};O.prototype.writeUint32LE=O.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};O.prototype.writeUint32BE=O.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Ob(t,e,r,i,n){Ub(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function Lb(t,e,r,i,n){Ub(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}O.prototype.writeBigUInt64LE=vs(function(e,r=0){return Ob(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeBigUInt64BE=vs(function(e,r=0){return Lb(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});O.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);$r(this,e,r,i,l-1,-l)}let s=0,a=1,o=0;for(this[r]=e&255;++s>0)-o&255;return r+i};O.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);$r(this,e,r,i,l-1,-l)}let s=i-1,a=1,o=0;for(this[r+s]=e&255;--s>=0&&(a*=256);)e<0&&o===0&&this[r+s+1]!==0&&(o=1),this[r+s]=(e/a>>0)-o&255;return r+i};O.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};O.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};O.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};O.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};O.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||$r(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};O.prototype.writeBigInt64LE=vs(function(e,r=0){return Ob(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});O.prototype.writeBigInt64BE=vs(function(e,r=0){return Lb(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Nb(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Bb(t,e,r,i,n){return e=+e,r=r>>>0,n||Nb(t,e,r,4,34028234663852886e22,-34028234663852886e22),xo.write(t,e,r,i,23,4),r+4}O.prototype.writeFloatLE=function(e,r,i){return Bb(this,e,r,!0,i)};O.prototype.writeFloatBE=function(e,r,i){return Bb(this,e,r,!1,i)};function Hb(t,e,r,i,n){return e=+e,r=r>>>0,n||Nb(t,e,r,8,17976931348623157e292,-17976931348623157e292),xo.write(t,e,r,i,52,8),r+8}O.prototype.writeDoubleLE=function(e,r,i){return Hb(this,e,r,!0,i)};O.prototype.writeDoubleBE=function(e,r,i){return Hb(this,e,r,!1,i)};O.prototype.copy=function(e,r,i,n){if(!O.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s2**32?n=Rb(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Rb(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Rb(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function lI(t,e,r){Eo(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&wc(e,t.length-(r+1))}function Ub(t,e,r,i,n,s){if(t>r||t3?e===0||e===BigInt(0)?o=`>= 0${a} and < 2${a} ** ${(s+1)*8}${a}`:o=`>= -(2${a} ** ${(s+1)*8-1}${a}) and < 2 ** ${(s+1)*8-1}${a}`:o=`>= ${e}${a} and <= ${r}${a}`,new yo.ERR_OUT_OF_RANGE("value",o,t)}lI(i,n,s)}function Eo(t,e){if(typeof t!="number")throw new yo.ERR_INVALID_ARG_TYPE(e,"number",t)}function wc(t,e,r){throw Math.floor(t)!==t?(Eo(t,r),new yo.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new yo.ERR_BUFFER_OUT_OF_BOUNDS:new yo.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var cI=/[^+/0-9A-Za-z-_]/g;function uI(t){if(t=t.split("=")[0],t=t.trim().replace(cI,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function em(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let a=0;a55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function fI(t){let e=[];for(let r=0;r>8,n=r%256,s.push(n),s.push(i);return s}function Gb(t){return Xp.toByteArray(uI(t))}function Pf(t,e,r,i){let n;for(n=0;n=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function ln(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function nm(t){return t!==t}var hI=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e})();function vs(t){return typeof BigInt=="undefined"?pI:t}function pI(){throw new Error("BigInt not supported")}});var jb,am,E,m=MF(()=>{jb=require("obsidian");jb.Platform.isMobileApp?am=sm().Buffer:am=global.Buffer;E=am});var zb=U((SG,Vb)=>{"use strict";m();var Zr=function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process=="undefined"||typeof process.domain=="undefined")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||Zr.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||Zr.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||Zr.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=Zr.DEFAULT_MAX_PENDING};Zr.DEFAULT_TIMEOUT=0;Zr.DEFAULT_MAX_OCCUPATION_TIME=0;Zr.DEFAULT_MAX_EXECUTION_TIME=0;Zr.DEFAULT_MAX_PENDING=1e3;Zr.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,s=null,a=null;typeof r!="function"&&(i=r,r=null,a=new this.Promise(function(b,S){n=b,s=S})),i=i||{};var o=!1,l=null,c=null,u=null,f=this,d=function(b,S,C){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),b&&(f.queues[t]&&f.queues[t].length===0&&delete f.queues[t],f.domainReentrant&&delete f.domains[t]),o||(a?S?s(S):n(C):typeof r=="function"&&r(S,C),o=!0),b&&f.queues[t]&&f.queues[t].length>0&&f.queues[t].shift()()},h=function(b){if(o)return d(b);l&&(clearTimeout(l),l=null),f.domainReentrant&&b&&(f.domains[t]=process.domain);var S=i.maxExecutionTime||f.maxExecutionTime;if(S&&(u=setTimeout(function(){f.queues[t]&&d(b,new Error("Maximum execution time is exceeded "+t))},S)),e.length===1){var C=!1;try{e(function(A,k){C||(C=!0,d(b,A,k))})}catch(A){C||(C=!0,d(b,A))}}else f._promiseTry(function(){return e()}).then(function(A){d(b,void 0,A)},function(A){d(b,A)})};f.domainReentrant&&process.domain&&(h=process.domain.bind(h));var p=i.maxPending||f.maxPending;if(!f.queues[t])f.queues[t]=[],h(!0);else if(f.domainReentrant&&process.domain&&process.domain===f.domains[t])h(!1);else if(f.queues[t].length>=p)d(!1,new Error("Too many pending tasks in queue "+t));else{var g=function(){h(!0)};i.skipQueue?f.queues[t].unshift(g):f.queues[t].push(g);var w=i.timeout||f.timeout;w&&(l=setTimeout(function(){l=null,d(!1,new Error("async-lock timed out in queue "+t))},w))}var y=i.maxOccupationTime||f.maxOccupationTime;if(y&&(c=setTimeout(function(){f.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},y)),a)return a};Zr.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,s=function(o,l){return function(c){n.acquire(o,l,c,i)}},a=t.reduceRight(function(o,l){return s(l,o)},e);if(typeof r=="function")a(r);else return new this.Promise(function(o,l){a.length===1?a(function(c,u){c?l(c):o(u)}):o(a())})};Zr.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};Zr.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};Vb.exports=Zr});var qb=U((AG,Wb)=>{"use strict";m();Wb.exports=zb()});var Yb=U((TG,om)=>{m();typeof Object.create=="function"?om.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:om.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var $f=U((lm,Kb)=>{m();var Rf=sm(),cn=Rf.Buffer;function Zb(t,e){for(var r in t)e[r]=t[r]}cn.from&&cn.alloc&&cn.allocUnsafe&&cn.allocUnsafeSlow?Kb.exports=Rf:(Zb(Rf,lm),lm.Buffer=sa);function sa(t,e,r){return cn(t,e,r)}sa.prototype=Object.create(cn.prototype);Zb(cn,sa);sa.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return cn(t,e,r)};sa.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=cn(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};sa.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return cn(t)};sa.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Rf.SlowBuffer(t)}});var Qb=U(($G,Xb)=>{m();var mI={}.toString;Xb.exports=Array.isArray||function(t){return mI.call(t)=="[object Array]"}});var ko=U((IG,Jb)=>{"use strict";m();Jb.exports=TypeError});var cm=U((DG,e_)=>{"use strict";m();e_.exports=Object});var r_=U((LG,t_)=>{"use strict";m();t_.exports=Error});var n_=U((BG,i_)=>{"use strict";m();i_.exports=EvalError});var a_=U((UG,s_)=>{"use strict";m();s_.exports=RangeError});var l_=U((jG,o_)=>{"use strict";m();o_.exports=ReferenceError});var um=U((zG,c_)=>{"use strict";m();c_.exports=SyntaxError});var f_=U((qG,u_)=>{"use strict";m();u_.exports=URIError});var h_=U((ZG,d_)=>{"use strict";m();d_.exports=Math.abs});var m_=U((XG,p_)=>{"use strict";m();p_.exports=Math.floor});var v_=U((JG,g_)=>{"use strict";m();g_.exports=Math.max});var b_=U((tj,w_)=>{"use strict";m();w_.exports=Math.min});var y_=U((ij,__)=>{"use strict";m();__.exports=Math.pow});var E_=U((sj,x_)=>{"use strict";m();x_.exports=Math.round});var k_=U((oj,S_)=>{"use strict";m();S_.exports=Number.isNaN||function(e){return e!==e}});var C_=U((cj,A_)=>{"use strict";m();var gI=k_();A_.exports=function(e){return gI(e)||e===0?e:e<0?-1:1}});var P_=U((fj,T_)=>{"use strict";m();T_.exports=Object.getOwnPropertyDescriptor});var Ao=U((hj,R_)=>{"use strict";m();var Ff=P_();if(Ff)try{Ff([],"length")}catch(t){Ff=null}R_.exports=Ff});var bc=U((mj,$_)=>{"use strict";m();var If=Object.defineProperty||!1;if(If)try{If({},"a",{value:1})}catch(t){If=!1}$_.exports=If});var fm=U((vj,F_)=>{"use strict";m();F_.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var s in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==n||o.enumerable!==!0)return!1}return!0}});var D_=U((bj,M_)=>{"use strict";m();var I_=typeof Symbol!="undefined"&&Symbol,vI=fm();M_.exports=function(){return typeof I_!="function"||typeof Symbol!="function"||typeof I_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vI()}});var dm=U((yj,O_)=>{"use strict";m();O_.exports=typeof Reflect!="undefined"&&Reflect.getPrototypeOf||null});var hm=U((Ej,L_)=>{"use strict";m();var wI=cm();L_.exports=wI.getPrototypeOf||null});var H_=U((kj,B_)=>{"use strict";m();var bI="Function.prototype.bind called on incompatible ",_I=Object.prototype.toString,yI=Math.max,xI="[object Function]",N_=function(e,r){for(var i=[],n=0;n{"use strict";m();var kI=H_();U_.exports=Function.prototype.bind||kI});var Mf=U((Pj,G_)=>{"use strict";m();G_.exports=Function.prototype.call});var Df=U(($j,j_)=>{"use strict";m();j_.exports=Function.prototype.apply});var z_=U((Ij,V_)=>{"use strict";m();V_.exports=typeof Reflect!="undefined"&&Reflect&&Reflect.apply});var pm=U((Dj,W_)=>{"use strict";m();var AI=Co(),CI=Df(),TI=Mf(),PI=z_();W_.exports=PI||AI.call(TI,CI)});var Of=U((Lj,q_)=>{"use strict";m();var RI=Co(),$I=ko(),FI=Mf(),II=pm();q_.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new $I("a function is required");return II(RI,FI,e)}});var J_=U((Bj,Q_)=>{"use strict";m();var MI=Of(),Y_=Ao(),K_;try{K_=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var mm=!!K_&&Y_&&Y_(Object.prototype,"__proto__"),X_=Object,Z_=X_.getPrototypeOf;Q_.exports=mm&&typeof mm.get=="function"?MI([mm.get]):typeof Z_=="function"?function(e){return Z_(e==null?e:X_(e))}:!1});var gm=U((Uj,iy)=>{"use strict";m();var ey=dm(),ty=hm(),ry=J_();iy.exports=ey?function(e){return ey(e)}:ty?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return ty(e)}:ry?function(e){return ry(e)}:null});var sy=U((jj,ny)=>{"use strict";m();var DI=Function.prototype.call,OI=Object.prototype.hasOwnProperty,LI=Co();ny.exports=LI.call(DI,OI)});var bm=U((zj,fy)=>{"use strict";m();var Te,NI=cm(),BI=r_(),HI=n_(),UI=a_(),GI=l_(),$o=um(),Ro=ko(),jI=f_(),VI=h_(),zI=m_(),WI=v_(),qI=b_(),YI=y_(),ZI=E_(),KI=C_(),cy=Function,vm=function(t){try{return cy('"use strict"; return ('+t+").constructor;")()}catch(e){}},_c=Ao(),XI=bc(),wm=function(){throw new Ro},QI=_c?(function(){try{return arguments.callee,wm}catch(t){try{return _c(arguments,"callee").get}catch(e){return wm}}})():wm,To=D_()(),Vt=gm(),JI=hm(),eM=dm(),uy=Df(),yc=Mf(),Po={},tM=typeof Uint8Array=="undefined"||!Vt?Te:Vt(Uint8Array),aa={__proto__:null,"%AggregateError%":typeof AggregateError=="undefined"?Te:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Te:ArrayBuffer,"%ArrayIteratorPrototype%":To&&Vt?Vt([][Symbol.iterator]()):Te,"%AsyncFromSyncIteratorPrototype%":Te,"%AsyncFunction%":Po,"%AsyncGenerator%":Po,"%AsyncGeneratorFunction%":Po,"%AsyncIteratorPrototype%":Po,"%Atomics%":typeof Atomics=="undefined"?Te:Atomics,"%BigInt%":typeof BigInt=="undefined"?Te:BigInt,"%BigInt64Array%":typeof BigInt64Array=="undefined"?Te:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array=="undefined"?Te:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?Te:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":BI,"%eval%":eval,"%EvalError%":HI,"%Float16Array%":typeof Float16Array=="undefined"?Te:Float16Array,"%Float32Array%":typeof Float32Array=="undefined"?Te:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?Te:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?Te:FinalizationRegistry,"%Function%":cy,"%GeneratorFunction%":Po,"%Int8Array%":typeof Int8Array=="undefined"?Te:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?Te:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?Te:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":To&&Vt?Vt(Vt([][Symbol.iterator]())):Te,"%JSON%":typeof JSON=="object"?JSON:Te,"%Map%":typeof Map=="undefined"?Te:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!To||!Vt?Te:Vt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":NI,"%Object.getOwnPropertyDescriptor%":_c,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Te:Promise,"%Proxy%":typeof Proxy=="undefined"?Te:Proxy,"%RangeError%":UI,"%ReferenceError%":GI,"%Reflect%":typeof Reflect=="undefined"?Te:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?Te:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!To||!Vt?Te:Vt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Te:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":To&&Vt?Vt(""[Symbol.iterator]()):Te,"%Symbol%":To?Symbol:Te,"%SyntaxError%":$o,"%ThrowTypeError%":QI,"%TypedArray%":tM,"%TypeError%":Ro,"%Uint8Array%":typeof Uint8Array=="undefined"?Te:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Te:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?Te:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?Te:Uint32Array,"%URIError%":jI,"%WeakMap%":typeof WeakMap=="undefined"?Te:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?Te:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?Te:WeakSet,"%Function.prototype.call%":yc,"%Function.prototype.apply%":uy,"%Object.defineProperty%":XI,"%Object.getPrototypeOf%":JI,"%Math.abs%":VI,"%Math.floor%":zI,"%Math.max%":WI,"%Math.min%":qI,"%Math.pow%":YI,"%Math.round%":ZI,"%Math.sign%":KI,"%Reflect.getPrototypeOf%":eM};if(Vt)try{null.error}catch(t){ay=Vt(Vt(t)),aa["%Error.prototype%"]=ay}var ay,rM=function t(e){var r;if(e==="%AsyncFunction%")r=vm("async function () {}");else if(e==="%GeneratorFunction%")r=vm("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=vm("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Vt&&(r=Vt(n.prototype))}return aa[e]=r,r},oy={__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"]},xc=Co(),Lf=sy(),iM=xc.call(yc,Array.prototype.concat),nM=xc.call(uy,Array.prototype.splice),ly=xc.call(yc,String.prototype.replace),Nf=xc.call(yc,String.prototype.slice),sM=xc.call(yc,RegExp.prototype.exec),aM=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,oM=/\\(\\)?/g,lM=function(e){var r=Nf(e,0,1),i=Nf(e,-1);if(r==="%"&&i!=="%")throw new $o("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new $o("invalid intrinsic syntax, expected opening `%`");var n=[];return ly(e,aM,function(s,a,o,l){n[n.length]=o?ly(l,oM,"$1"):a||s}),n},cM=function(e,r){var i=e,n;if(Lf(oy,i)&&(n=oy[i],i="%"+n[0]+"%"),Lf(aa,i)){var s=aa[i];if(s===Po&&(s=rM(i)),typeof s=="undefined"&&!r)throw new Ro("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new $o("intrinsic "+e+" does not exist!")};fy.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Ro("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ro('"allowMissing" argument must be a boolean');if(sM(/^%?[^%]*%?$/,e)===null)throw new $o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=lM(e),n=i.length>0?i[0]:"",s=cM("%"+n+"%",r),a=s.name,o=s.value,l=!1,c=s.alias;c&&(n=c[0],nM(i,iM([0,1],c)));for(var u=1,f=!0;u=i.length){var g=_c(o,d);f=!!g,f&&"get"in g&&!("originalValue"in g.get)?o=g.get:o=o[d]}else f=Lf(o,d),o=o[d];f&&!l&&(aa[a]=o)}}return o}});var _m=U((qj,py)=>{"use strict";m();var dy=bm(),hy=Of(),uM=hy([dy("%String.prototype.indexOf%")]);py.exports=function(e,r){var i=dy(e,!!r);return typeof i=="function"&&uM(e,".prototype.")>-1?hy([i]):i}});var wy=U((Zj,vy)=>{"use strict";m();var gy=Function.prototype.toString,Fo=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,xm,Bf;if(typeof Fo=="function"&&typeof Object.defineProperty=="function")try{xm=Object.defineProperty({},"length",{get:function(){throw Bf}}),Bf={},Fo(function(){throw 42},null,xm)}catch(t){t!==Bf&&(Fo=null)}else Fo=null;var fM=/^\s*class\b/,Em=function(e){try{var r=gy.call(e);return fM.test(r)}catch(i){return!1}},ym=function(e){try{return Em(e)?!1:(gy.call(e),!0)}catch(r){return!1}},Hf=Object.prototype.toString,dM="[object Object]",hM="[object Function]",pM="[object GeneratorFunction]",mM="[object HTMLAllCollection]",gM="[object HTML document.all class]",vM="[object HTMLCollection]",wM=typeof Symbol=="function"&&!!Symbol.toStringTag,bM=!(0 in[,]),Sm=function(){return!1};typeof document=="object"&&(my=document.all,Hf.call(my)===Hf.call(document.all)&&(Sm=function(e){if((bM||!e)&&(typeof e=="undefined"||typeof e=="object"))try{var r=Hf.call(e);return(r===mM||r===gM||r===vM||r===dM)&&e("")==null}catch(i){}return!1}));var my;vy.exports=Fo?function(e){if(Sm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Fo(e,null,xm)}catch(r){if(r!==Bf)return!1}return!Em(e)&&ym(e)}:function(e){if(Sm(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(wM)return ym(e);if(Em(e))return!1;var r=Hf.call(e);return r!==hM&&r!==pM&&!/^\[object HTML/.test(r)?!1:ym(e)}});var yy=U((Xj,_y)=>{"use strict";m();var _M=wy(),yM=Object.prototype.toString,by=Object.prototype.hasOwnProperty,xM=function(e,r,i){for(var n=0,s=e.length;n=3&&(n=i),kM(e)?xM(e,r,n):typeof e=="string"?EM(e,r,n):SM(e,r,n)}});var Ey=U((Jj,xy)=>{"use strict";m();xy.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var ky=U((tV,Sy)=>{"use strict";m();var km=Ey(),AM=typeof globalThis=="undefined"?global:globalThis;Sy.exports=function(){for(var e=[],r=0;r{"use strict";m();var Ay=bc(),CM=um(),Io=ko(),Cy=Ao();Ty.exports=function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new Io("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Io("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Io("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Io("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Io("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Io("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,o=arguments.length>6?arguments[6]:!1,l=!!Cy&&Cy(e,r);if(Ay)Ay(e,r,{configurable:a===null&&l?l.configurable:!a,enumerable:n===null&&l?l.enumerable:!n,value:i,writable:s===null&&l?l.writable:!s});else if(o||!n&&!s&&!a)e[r]=i;else throw new CM("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Fy=U((sV,$y)=>{"use strict";m();var Am=bc(),Ry=function(){return!!Am};Ry.hasArrayLengthDefineBug=function(){if(!Am)return null;try{return Am([],"length",{value:1}).length!==1}catch(e){return!0}};$y.exports=Ry});var Ly=U((oV,Oy)=>{"use strict";m();var TM=bm(),Iy=Py(),PM=Fy()(),My=Ao(),Dy=ko(),RM=TM("%Math.floor%");Oy.exports=function(e,r){if(typeof e!="function")throw new Dy("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||RM(r)!==r)throw new Dy("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in e&&My){var a=My(e,"length");a&&!a.configurable&&(n=!1),a&&!a.writable&&(s=!1)}return(n||s||!i)&&(PM?Iy(e,"length",r,!0,!0):Iy(e,"length",r)),e}});var By=U((cV,Ny)=>{"use strict";m();var $M=Co(),FM=Df(),IM=pm();Ny.exports=function(){return IM($M,FM,arguments)}});var Gy=U((fV,Uf)=>{"use strict";m();var MM=Ly(),Hy=bc(),DM=Of(),Uy=By();Uf.exports=function(e){var r=DM(arguments),i=1+e.length-(arguments.length-1);return MM(r,i>0?i:0,!0)};Hy?Hy(Uf.exports,"apply",{value:Uy}):Uf.exports.apply=Uy});var Vy=U((hV,jy)=>{"use strict";m();var OM=fm();jy.exports=function(){return OM()&&!!Symbol.toStringTag}});var Zy=U((mV,Yy)=>{"use strict";m();var Vf=yy(),LM=ky(),zy=Gy(),Tm=_m(),jf=Ao(),Gf=gm(),NM=Tm("Object.prototype.toString"),qy=Vy()(),Wy=typeof globalThis=="undefined"?global:globalThis,Cm=LM(),Pm=Tm("String.prototype.slice"),BM=Tm("Array.prototype.indexOf",!0)||function(e,r){for(var i=0;i-1}Yy.exports=function(e){if(!e||typeof e!="object")return!1;if(!qy){var r=Pm(NM(e),8,-1);return GM(r)?r:r!=="Object"?!1:UM(e)}return jf?HM(e):null}});var Xy=U((vV,Ky)=>{"use strict";m();var jM=Zy();Ky.exports=function(e){return!!jM(e)}});var Jy=U((bV,Qy)=>{"use strict";m();var VM=ko(),zM=_m(),WM=zM("TypedArray.prototype.buffer",!0),qM=Xy();Qy.exports=WM||function(e){if(!qM(e))throw new VM("Not a Typed Array");return e.buffer}});var rx=U((yV,tx)=>{"use strict";m();var Ni=$f().Buffer,YM=Qb(),ZM=Jy(),KM=ArrayBuffer.isView||function(e){try{return ZM(e),!0}catch(r){return!1}},XM=typeof Uint8Array!="undefined",ex=typeof ArrayBuffer!="undefined"&&typeof Uint8Array!="undefined",QM=ex&&(Ni.prototype instanceof Uint8Array||Ni.TYPED_ARRAY_SUPPORT);tx.exports=function(e,r){if(Ni.isBuffer(e))return e.constructor&&!("isBuffer"in e)?Ni.from(e):e;if(typeof e=="string")return Ni.from(e,r);if(ex&&KM(e)){if(e.byteLength===0)return Ni.alloc(0);if(QM){var i=Ni.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),s=Ni.from(n);if(s.length===e.byteLength)return s}if(XM&&e instanceof Uint8Array)return Ni.from(e);var a=YM(e);if(a)for(var o=0;o255||~~l!==l)throw new RangeError("Array items must be numbers in the range 0-255.")}if(a||Ni.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return Ni.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var nx=U((EV,ix)=>{"use strict";m();var JM=$f().Buffer,eD=rx();function Wf(t,e){this._block=JM.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Wf.prototype.update=function(t,e){t=eD(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};Wf.prototype._update=function(){throw new Error("_update must be implemented by subclass")};ix.exports=Wf});var ox=U((kV,ax)=>{"use strict";m();var tD=Yb(),sx=nx(),rD=$f().Buffer,iD=[1518500249,1859775393,-1894007588,-899497514],nD=new Array(80);function Ec(){this.init(),this._w=nD,sx.call(this,64,56)}tD(Ec,sx);Ec.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function sD(t){return t<<1|t>>>31}function aD(t){return t<<5|t>>>27}function oD(t){return t<<30|t>>>2}function lD(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}Ec.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,s=this._d|0,a=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=sD(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=aD(r)+lD(c,i,n,s)+a+e[l]+iD[c]|0;a=s,s=n,n=oD(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};Ec.prototype._hash=function(){var t=rD.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};ax.exports=Ec});var cx=U(Rm=>{m();var lx;(function(t){typeof DO_NOT_EXPORT_CRC=="undefined"?typeof Rm=="object"?t(Rm):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(lx={}):t(lx={})})(function(t){t.version="1.2.2";function e(){for(var v=0,x=new Array(256),_=0;_!=256;++_)v=_,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,v=v&1?-306674912^v>>>1:v>>>1,x[_]=v;return typeof Int32Array!="undefined"?new Int32Array(x):x}var r=e();function i(v){var x=0,_=0,P=0,T=typeof Int32Array!="undefined"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)T[P]=v[P];for(P=0;P!=256;++P)for(_=v[P],x=256+P;x<4096;x+=256)_=T[x]=_>>>8^v[_&255];var M=[];for(P=1;P!=16;++P)M[P-1]=typeof Int32Array!="undefined"?T.subarray(P*256,P*256+256):T.slice(P*256,P*256+256);return M}var n=i(r),s=n[0],a=n[1],o=n[2],l=n[3],c=n[4],u=n[5],f=n[6],d=n[7],h=n[8],p=n[9],g=n[10],w=n[11],y=n[12],b=n[13],S=n[14];function C(v,x){for(var _=x^-1,P=0,T=v.length;P>>8^r[(_^v.charCodeAt(P++))&255];return~_}function A(v,x){for(var _=x^-1,P=v.length-15,T=0;T>8&255]^y[v[T++]^_>>16&255]^w[v[T++]^_>>>24]^g[v[T++]]^p[v[T++]]^h[v[T++]]^d[v[T++]]^f[v[T++]]^u[v[T++]]^c[v[T++]]^l[v[T++]]^o[v[T++]]^a[v[T++]]^s[v[T++]]^r[v[T++]];for(P+=15;T>>8^r[(_^v[T++])&255];return~_}function k(v,x){for(var _=x^-1,P=0,T=v.length,M=0,$=0;P>>8^r[(_^M)&255]:M<2048?(_=_>>>8^r[(_^(192|M>>6&31))&255],_=_>>>8^r[(_^(128|M&63))&255]):M>=55296&&M<57344?(M=(M&1023)+64,$=v.charCodeAt(P++)&1023,_=_>>>8^r[(_^(240|M>>8&7))&255],_=_>>>8^r[(_^(128|M>>2&63))&255],_=_>>>8^r[(_^(128|$>>6&15|(M&3)<<4))&255],_=_>>>8^r[(_^(128|$&63))&255]):(_=_>>>8^r[(_^(224|M>>12&15))&255],_=_>>>8^r[(_^(128|M>>6&63))&255],_=_>>>8^r[(_^(128|M&63))&255]);return~_}t.table=r,t.bstr=C,t.buf=A,t.str=k})});var Hn=U(wr=>{"use strict";m();var cD=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Int32Array!="undefined";function uD(t,e){return Object.prototype.hasOwnProperty.call(t,e)}wr.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)uD(r,i)&&(t[i]=r[i])}}return t};wr.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var fD={arraySet:function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var s=0;s{"use strict";m();var hD=Hn(),pD=4,ux=0,fx=1,mD=2;function Do(t){for(var e=t.length;--e>=0;)t[e]=0}var gD=0,vx=1,vD=2,wD=3,bD=258,Lm=29,Pc=256,kc=Pc+1+Lm,Mo=30,Nm=19,wx=2*kc+1,oa=15,$m=16,_D=7,Bm=256,bx=16,_x=17,yx=18,Dm=[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],qf=[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],yD=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],xx=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],xD=512,Un=new Array((kc+2)*2);Do(Un);var Sc=new Array(Mo*2);Do(Sc);var Ac=new Array(xD);Do(Ac);var Cc=new Array(bD-wD+1);Do(Cc);var Hm=new Array(Lm);Do(Hm);var Yf=new Array(Mo);Do(Yf);function Fm(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}var Ex,Sx,kx;function Im(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Ax(t){return t<256?Ac[t]:Ac[256+(t>>>7)]}function Tc(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function Fr(t,e,r){t.bi_valid>$m-r?(t.bi_buf|=e<>$m-t.bi_valid,t.bi_valid+=r-$m):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1}function ED(t){t.bi_valid===16?(Tc(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function SD(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,s=e.stat_desc.has_stree,a=e.stat_desc.extra_bits,o=e.stat_desc.extra_base,l=e.stat_desc.max_length,c,u,f,d,h,p,g=0;for(d=0;d<=oa;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;cl&&(d=l,g++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,h=0,u>=o&&(h=a[u-o]),p=r[u*2],t.opt_len+=p*(d+h),s&&(t.static_len+=p*(n[u*2+1]+h)));if(g!==0){do{for(d=l-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[l]--,g-=2}while(g>0);for(d=l;d!==0;d--)for(u=t.bl_count[d];u!==0;)f=t.heap[--c],!(f>i)&&(r[f*2+1]!==d&&(t.opt_len+=(d-r[f*2+1])*r[f*2],r[f*2+1]=d),u--)}}function Tx(t,e,r){var i=new Array(oa+1),n=0,s,a;for(s=1;s<=oa;s++)i[s]=n=n+r[s-1]<<1;for(a=0;a<=e;a++){var o=t[a*2+1];o!==0&&(t[a*2]=Cx(i[o]++,o))}}function kD(){var t,e,r,i,n,s=new Array(oa+1);for(r=0,i=0;i>=7;i8?Tc(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function AD(t,e,r,i){Rx(t),i&&(Tc(t,r),Tc(t,~r)),hD.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function dx(t,e,r,i){var n=e*2,s=r*2;return t[n]>1;a>=1;a--)Mm(t,r,a);c=s;do a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Mm(t,r,1),o=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=o,r[c*2]=r[a*2]+r[o*2],t.depth[c]=(t.depth[a]>=t.depth[o]?t.depth[a]:t.depth[o])+1,r[a*2+1]=r[o*2+1]=c,t.heap[1]=c++,Mm(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],SD(t,e),Tx(r,l,t.bl_count)}function px(t,e,r){var i,n=-1,s,a=e[1],o=0,l=7,c=4;for(a===0&&(l=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)s=a,a=e[(i+1)*2+1],!(++o=3&&t.bl_tree[xx[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function TD(t,e,r,i){var n;for(Fr(t,e-257,5),Fr(t,r-1,5),Fr(t,i-4,4),n=0;n>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return ux;if(t.dyn_ltree[18]!==0||t.dyn_ltree[20]!==0||t.dyn_ltree[26]!==0)return fx;for(r=32;r0?(t.strm.data_type===mD&&(t.strm.data_type=PD(t)),Om(t,t.l_desc),Om(t,t.d_desc),a=CD(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=r+5,r+4<=n&&e!==-1?$x(t,e,r,i):t.strategy===pD||s===n?(Fr(t,(vx<<1)+(i?1:0),3),hx(t,Un,Sc)):(Fr(t,(vD<<1)+(i?1:0),3),TD(t,t.l_desc.max_code+1,t.d_desc.max_code+1,a+1),hx(t,t.dyn_ltree,t.dyn_dtree)),Px(t),i&&Rx(t)}function ID(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Cc[r]+Pc+1)*2]++,t.dyn_dtree[Ax(e)*2]++),t.last_lit===t.lit_bufsize-1}Oo._tr_init=RD;Oo._tr_stored_block=$x;Oo._tr_flush_block=FD;Oo._tr_tally=ID;Oo._tr_align=$D});var Um=U((IV,Ix)=>{"use strict";m();function MD(t,e,r,i){for(var n=t&65535|0,s=t>>>16&65535|0,a=0;r!==0;){a=r>2e3?2e3:r,r-=a;do n=n+e[i++]|0,s=s+n|0;while(--a);n%=65521,s%=65521}return n|s<<16|0}Ix.exports=MD});var Gm=U((DV,Mx)=>{"use strict";m();function DD(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var OD=DD();function LD(t,e,r,i){var n=OD,s=i+r;t^=-1;for(var a=i;a>>8^n[(t^e[a])&255];return t^-1}Mx.exports=LD});var Zf=U((LV,Dx)=>{"use strict";m();Dx.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 Vx=U(hn=>{"use strict";m();var br=Hn(),mi=Fx(),Bx=Um(),ws=Gm(),ND=Zf(),fa=0,BD=1,HD=3,Es=4,Ox=5,dn=0,Lx=1,gi=-2,UD=-3,jm=-5,GD=-1,jD=1,Kf=2,VD=3,zD=4,WD=0,qD=2,td=8,YD=9,ZD=15,KD=8,XD=29,QD=256,zm=QD+1+XD,JD=30,eO=19,tO=2*zm+1,rO=15,$e=3,ys=258,Bi=ys+$e+1,iO=32,rd=42,Wm=69,Xf=73,Qf=91,Jf=103,la=113,$c=666,Ft=1,Fc=2,ca=3,Bo=4,nO=3;function xs(t,e){return t.msg=ND[e],e}function Nx(t){return(t<<1)-(t>4?9:0)}function _s(t){for(var e=t.length;--e>=0;)t[e]=0}function bs(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(br.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function Kt(t,e){mi._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,bs(t.strm)}function Oe(t,e){t.pending_buf[t.pending++]=e}function Rc(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function sO(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,br.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=Bx(t.adler,e,n,r):t.state.wrap===2&&(t.adler=ws(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}function Hx(t,e){var r=t.max_chain_length,i=t.strstart,n,s,a=t.prev_length,o=t.nice_match,l=t.strstart>t.w_size-Bi?t.strstart-(t.w_size-Bi):0,c=t.window,u=t.w_mask,f=t.prev,d=t.strstart+ys,h=c[i+a-1],p=c[i+a];t.prev_length>=t.good_match&&(r>>=2),o>t.lookahead&&(o=t.lookahead);do if(n=e,!(c[n+a]!==p||c[n+a-1]!==h||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&ia){if(t.match_start=e,a=s,s>=o)break;h=c[i+a-1],p=c[i+a]}}while((e=f[e&u])>l&&--r!==0);return a<=t.lookahead?a:t.lookahead}function ua(t){var e=t.w_size,r,i,n,s,a;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Bi)){br.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);s+=e}if(t.strm.avail_in===0)break;if(i=sO(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=i,t.lookahead+t.insert>=$e)for(a=t.strstart-t.insert,t.ins_h=t.window[a],t.ins_h=(t.ins_h<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ua(t),t.lookahead===0&&e===fa)return Ft;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,Kt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Bi&&(Kt(t,!1),t.strm.avail_out===0))return Ft}return t.insert=0,e===Es?(Kt(t,!0),t.strm.avail_out===0?ca:Bo):(t.strstart>t.block_start&&(Kt(t,!1),t.strm.avail_out===0),Ft)}function Vm(t,e){for(var r,i;;){if(t.lookahead=$e&&(t.ins_h=(t.ins_h<=$e)if(i=mi._tr_tally(t,t.strstart-t.match_start,t.match_length-$e),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=$e){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<=$e&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=$e-1)),t.prev_length>=$e&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-$e,i=mi._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-$e),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<=$e&&t.strstart>0&&(n=t.strstart-1,i=a[n],i===a[++n]&&i===a[++n]&&i===a[++n])){s=t.strstart+ys;do;while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=$e?(r=mi._tr_tally(t,1,t.match_length-$e),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=mi._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Kt(t,!1),t.strm.avail_out===0))return Ft}return t.insert=0,e===Es?(Kt(t,!0),t.strm.avail_out===0?ca:Bo):t.last_lit&&(Kt(t,!1),t.strm.avail_out===0)?Ft:Fc}function lO(t,e){for(var r;;){if(t.lookahead===0&&(ua(t),t.lookahead===0)){if(e===fa)return Ft;break}if(t.match_length=0,r=mi._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Kt(t,!1),t.strm.avail_out===0))return Ft}return t.insert=0,e===Es?(Kt(t,!0),t.strm.avail_out===0?ca:Bo):t.last_lit&&(Kt(t,!1),t.strm.avail_out===0)?Ft:Fc}function fn(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var No;No=[new fn(0,0,0,0,aO),new fn(4,4,8,4,Vm),new fn(4,5,16,8,Vm),new fn(4,6,32,32,Vm),new fn(4,4,16,16,Lo),new fn(8,16,32,32,Lo),new fn(8,16,128,128,Lo),new fn(8,32,128,256,Lo),new fn(32,128,258,1024,Lo),new fn(32,258,258,4096,Lo)];function cO(t){t.window_size=2*t.w_size,_s(t.head),t.max_lazy_match=No[t.level].max_lazy,t.good_match=No[t.level].good_length,t.nice_match=No[t.level].nice_length,t.max_chain_length=No[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=$e-1,t.match_available=0,t.ins_h=0}function uO(){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=td,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 br.Buf16(tO*2),this.dyn_dtree=new br.Buf16((2*JD+1)*2),this.bl_tree=new br.Buf16((2*eO+1)*2),_s(this.dyn_ltree),_s(this.dyn_dtree),_s(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new br.Buf16(rO+1),this.heap=new br.Buf16(2*zm+1),_s(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new br.Buf16(2*zm+1),_s(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 Ux(t){var e;return!t||!t.state?xs(t,gi):(t.total_in=t.total_out=0,t.data_type=qD,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?rd:la,t.adler=e.wrap===2?0:1,e.last_flush=fa,mi._tr_init(e),dn)}function Gx(t){var e=Ux(t);return e===dn&&cO(t.state),e}function fO(t,e){return!t||!t.state||t.state.wrap!==2?gi:(t.state.gzhead=e,dn)}function jx(t,e,r,i,n,s){if(!t)return gi;var a=1;if(e===GD&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),n<1||n>YD||r!==td||i<8||i>15||e<0||e>9||s<0||s>zD)return xs(t,gi);i===8&&(i=9);var o=new uO;return t.state=o,o.strm=t,o.wrap=a,o.gzhead=null,o.w_bits=i,o.w_size=1<Ox||e<0)return t?xs(t,gi):gi;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===$c&&e!==Es)return xs(t,t.avail_out===0?jm:gi);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===rd)if(i.wrap===2)t.adler=0,Oe(i,31),Oe(i,139),Oe(i,8),i.gzhead?(Oe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Oe(i,i.gzhead.time&255),Oe(i,i.gzhead.time>>8&255),Oe(i,i.gzhead.time>>16&255),Oe(i,i.gzhead.time>>24&255),Oe(i,i.level===9?2:i.strategy>=Kf||i.level<2?4:0),Oe(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(Oe(i,i.gzhead.extra.length&255),Oe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=ws(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Wm):(Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,0),Oe(i,i.level===9?2:i.strategy>=Kf||i.level<2?4:0),Oe(i,nO),i.status=la);else{var a=td+(i.w_bits-8<<4)<<8,o=-1;i.strategy>=Kf||i.level<2?o=0:i.level<6?o=1:i.level===6?o=2:o=3,a|=o<<6,i.strstart!==0&&(a|=iO),a+=31-a%31,i.status=la,Rc(i,a),i.strstart!==0&&(Rc(i,t.adler>>>16),Rc(i,t.adler&65535)),t.adler=1}if(i.status===Wm)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),bs(t),n=i.pending,i.pending===i.pending_buf_size));)Oe(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=Xf)}else i.status=Xf;if(i.status===Xf)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),bs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.gzindex=0,i.status=Qf)}else i.status=Qf;if(i.status===Qf)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),bs(t),n=i.pending,i.pending===i.pending_buf_size)){s=1;break}i.gzindexn&&(t.adler=ws(t.adler,i.pending_buf,i.pending-n,n)),s===0&&(i.status=Jf)}else i.status=Jf;if(i.status===Jf&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&bs(t),i.pending+2<=i.pending_buf_size&&(Oe(i,t.adler&255),Oe(i,t.adler>>8&255),t.adler=0,i.status=la)):i.status=la),i.pending!==0){if(bs(t),t.avail_out===0)return i.last_flush=-1,dn}else if(t.avail_in===0&&Nx(e)<=Nx(r)&&e!==Es)return xs(t,jm);if(i.status===$c&&t.avail_in!==0)return xs(t,jm);if(t.avail_in!==0||i.lookahead!==0||e!==fa&&i.status!==$c){var l=i.strategy===Kf?lO(i,e):i.strategy===VD?oO(i,e):No[i.level].func(i,e);if((l===ca||l===Bo)&&(i.status=$c),l===Ft||l===ca)return t.avail_out===0&&(i.last_flush=-1),dn;if(l===Fc&&(e===BD?mi._tr_align(i):e!==Ox&&(mi._tr_stored_block(i,0,0,!1),e===HD&&(_s(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),bs(t),t.avail_out===0))return i.last_flush=-1,dn}return e!==Es?dn:i.wrap<=0?Lx:(i.wrap===2?(Oe(i,t.adler&255),Oe(i,t.adler>>8&255),Oe(i,t.adler>>16&255),Oe(i,t.adler>>24&255),Oe(i,t.total_in&255),Oe(i,t.total_in>>8&255),Oe(i,t.total_in>>16&255),Oe(i,t.total_in>>24&255)):(Rc(i,t.adler>>>16),Rc(i,t.adler&65535)),bs(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?dn:Lx)}function pO(t){var e;return!t||!t.state?gi:(e=t.state.status,e!==rd&&e!==Wm&&e!==Xf&&e!==Qf&&e!==Jf&&e!==la&&e!==$c?xs(t,gi):(t.state=null,e===la?xs(t,UD):dn))}function mO(t,e){var r=e.length,i,n,s,a,o,l,c,u;if(!t||!t.state||(i=t.state,a=i.wrap,a===2||a===1&&i.status!==rd||i.lookahead))return gi;for(a===1&&(t.adler=Bx(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(a===0&&(_s(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new br.Buf8(i.w_size),br.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),o=t.avail_in,l=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,ua(i);i.lookahead>=$e;){n=i.strstart,s=i.lookahead-($e-1);do i.ins_h=(i.ins_h<{"use strict";m();var id=Hn(),zx=!0,Wx=!0;try{String.fromCharCode.apply(null,[0])}catch(t){zx=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Wx=!1}var Ic=new id.Buf8(256);for(Gn=0;Gn<256;Gn++)Ic[Gn]=Gn>=252?6:Gn>=248?5:Gn>=240?4:Gn>=224?3:Gn>=192?2:1;var Gn;Ic[254]=Ic[254]=1;Ho.string2buf=function(t){var e,r,i,n,s,a=t.length,o=0;for(n=0;n>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function qx(t,e){if(e<65534&&(t.subarray&&Wx||!t.subarray&&zx))return String.fromCharCode.apply(null,id.shrinkBuf(t,e));for(var r="",i=0;i4){o[i++]=65533,r+=s-1;continue}for(n&=s===2?31:s===3?15:7;s>1&&r1){o[i++]=65533;continue}n<65536?o[i++]=n:(n-=65536,o[i++]=55296|n>>10&1023,o[i++]=56320|n&1023)}return qx(o,i)};Ho.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+Ic[t[r]]>e?r:e}});var Ym=U((jV,Yx)=>{"use strict";m();function gO(){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}Yx.exports=gO});var Qx=U(Oc=>{"use strict";m();var Mc=Vx(),Dc=Hn(),Km=qm(),Xm=Zf(),vO=Ym(),Xx=Object.prototype.toString,wO=0,Zm=4,Uo=0,Zx=1,Kx=2,bO=-1,_O=0,yO=8;function da(t){if(!(this instanceof da))return new da(t);this.options=Dc.assign({level:bO,method:yO,chunkSize:16384,windowBits:15,memLevel:8,strategy:_O,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vO,this.strm.avail_out=0;var r=Mc.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Uo)throw new Error(Xm[r]);if(e.header&&Mc.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=Km.string2buf(e.dictionary):Xx.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=Mc.deflateSetDictionary(this.strm,i),r!==Uo)throw new Error(Xm[r]);this._dict_set=!0}}da.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,s;if(this.ended)return!1;s=e===~~e?e:e===!0?Zm:wO,typeof t=="string"?r.input=Km.string2buf(t):Xx.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Dc.Buf8(i),r.next_out=0,r.avail_out=i),n=Mc.deflate(r,s),n!==Zx&&n!==Uo)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Zm||s===Kx))&&(this.options.to==="string"?this.onData(Km.buf2binstring(Dc.shrinkBuf(r.output,r.next_out))):this.onData(Dc.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==Zx);return s===Zm?(n=Mc.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Uo):(s===Kx&&(this.onEnd(Uo),r.avail_out=0),!0)};da.prototype.onData=function(t){this.chunks.push(t)};da.prototype.onEnd=function(t){t===Uo&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Dc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Qm(t,e){var r=new da(e);if(r.push(t,!0),r.err)throw r.msg||Xm[r.err];return r.result}function xO(t,e){return e=e||{},e.raw=!0,Qm(t,e)}function EO(t,e){return e=e||{},e.gzip=!0,Qm(t,e)}Oc.Deflate=da;Oc.deflate=Qm;Oc.deflateRaw=xO;Oc.gzip=EO});var e1=U((qV,Jx)=>{"use strict";m();var nd=30,SO=12;Jx.exports=function(e,r){var i,n,s,a,o,l,c,u,f,d,h,p,g,w,y,b,S,C,A,k,v,x,_,P,T;i=e.state,n=e.next_in,P=e.input,s=n+(e.avail_in-5),a=e.next_out,T=e.output,o=a-(r-e.avail_out),l=a+(e.avail_out-257),c=i.dmax,u=i.wsize,f=i.whave,d=i.wnext,h=i.window,p=i.hold,g=i.bits,w=i.lencode,y=i.distcode,b=(1<>>24,p>>>=A,g-=A,A=C>>>16&255,A===0)T[a++]=C&65535;else if(A&16){k=C&65535,A&=15,A&&(g>>=A,g-=A),g<15&&(p+=P[n++]<>>24,p>>>=A,g-=A,A=C>>>16&255,A&16){if(v=C&65535,A&=15,gc){e.msg="invalid distance too far back",i.mode=nd;break e}if(p>>>=A,g-=A,A=a-o,v>A){if(A=v-A,A>f&&i.sane){e.msg="invalid distance too far back",i.mode=nd;break e}if(x=0,_=h,d===0){if(x+=u-A,A2;)T[a++]=_[x++],T[a++]=_[x++],T[a++]=_[x++],k-=3;k&&(T[a++]=_[x++],k>1&&(T[a++]=_[x++]))}else{x=a-v;do T[a++]=T[x++],T[a++]=T[x++],T[a++]=T[x++],k-=3;while(k>2);k&&(T[a++]=T[x++],k>1&&(T[a++]=T[x++]))}}else if((A&64)===0){C=y[(C&65535)+(p&(1<>3,n-=k,g-=k<<3,p&=(1<{"use strict";m();var t1=Hn(),Go=15,r1=852,i1=592,n1=0,Jm=1,s1=2,kO=[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],AO=[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],CO=[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],TO=[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];a1.exports=function(e,r,i,n,s,a,o,l){var c=l.bits,u=0,f=0,d=0,h=0,p=0,g=0,w=0,y=0,b=0,S=0,C,A,k,v,x,_=null,P=0,T,M=new t1.Buf16(Go+1),$=new t1.Buf16(Go+1),D=null,Q=0,ye,de,J;for(u=0;u<=Go;u++)M[u]=0;for(f=0;f=1&&M[h]===0;h--);if(p>h&&(p=h),h===0)return s[a++]=1<<24|64<<16|0,s[a++]=1<<24|64<<16|0,l.bits=1,0;for(d=1;d0&&(e===n1||h!==1))return-1;for($[1]=0,u=1;ur1||e===s1&&b>i1)return 1;for(;;){ye=u-w,o[f]T?(de=D[Q+o[f]],J=_[P+o[f]]):(de=96,J=0),C=1<>w)+A]=ye<<24|de<<16|J|0;while(A!==0);for(C=1<>=1;if(C!==0?(S&=C-1,S+=C):S=0,f++,--M[u]===0){if(u===h)break;u=r[i+o[f]]}if(u>p&&(S&v)!==k){for(w===0&&(w=p),x+=d,g=u-w,y=1<r1||e===s1&&b>i1)return 1;k=S&v,s[k]=p<<24|g<<16|x-a|0}}return S!==0&&(s[x+S]=u-w<<24|64<<16|0),l.bits=p,0}});var G1=U(Hi=>{"use strict";m();var Kr=Hn(),sg=Um(),pn=Gm(),PO=e1(),Lc=o1(),RO=0,I1=1,M1=2,l1=4,$O=5,sd=6,ha=0,FO=1,IO=2,vi=-2,D1=-3,ag=-4,MO=-5,c1=8,O1=1,u1=2,f1=3,d1=4,h1=5,p1=6,m1=7,g1=8,v1=9,w1=10,ld=11,jn=12,eg=13,b1=14,tg=15,_1=16,y1=17,x1=18,E1=19,ad=20,od=21,S1=22,k1=23,A1=24,C1=25,T1=26,rg=27,P1=28,R1=29,nt=30,og=31,DO=32,OO=852,LO=592,NO=15,BO=NO;function $1(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function HO(){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 Kr.Buf16(320),this.work=new Kr.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function L1(t){var e;return!t||!t.state?vi:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=O1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Kr.Buf32(OO),e.distcode=e.distdyn=new Kr.Buf32(LO),e.sane=1,e.back=-1,ha)}function N1(t){var e;return!t||!t.state?vi:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,L1(t))}function B1(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?vi:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,N1(t))}function H1(t,e){var r,i;return t?(i=new HO,t.state=i,i.window=null,r=B1(t,e),r!==ha&&(t.state=null),r):vi}function UO(t){return H1(t,BO)}var F1=!0,ig,ng;function GO(t){if(F1){var e;for(ig=new Kr.Buf32(512),ng=new Kr.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Lc(I1,t.lens,0,288,ig,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Lc(M1,t.lens,0,32,ng,0,t.work,{bits:5}),F1=!1}t.lencode=ig,t.lenbits=9,t.distcode=ng,t.distbits=5}function U1(t,e,r,i){var n,s=t.state;return s.window===null&&(s.wsize=1<=s.wsize?(Kr.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(n=s.wsize-s.wnext,n>i&&(n=i),Kr.arraySet(s.window,e,r-i,n,s.wnext),i-=n,i?(Kr.arraySet(s.window,e,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=n,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=pn(r.check,_,2,0),c=0,u=0,r.mode=u1;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=nt;break}if((c&15)!==c1){t.msg="unknown compression method",r.mode=nt;break}if(c>>>=4,u-=4,v=(c&15)+8,r.wbits===0)r.wbits=v;else if(v>r.wbits){t.msg="invalid window size",r.mode=nt;break}r.dmax=1<>8&1),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=pn(r.check,_,2,0)),c=0,u=0,r.mode=f1;case f1:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,r.check=pn(r.check,_,4,0)),c=0,u=0,r.mode=d1;case d1:for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>8),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=pn(r.check,_,2,0)),c=0,u=0,r.mode=h1;case h1:if(r.flags&1024){for(;u<16;){if(o===0)break e;o--,c+=i[s++]<>>8&255,r.check=pn(r.check,_,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=p1;case p1:if(r.flags&1024&&(h=r.length,h>o&&(h=o),h&&(r.head&&(v=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),Kr.arraySet(r.head.extra,i,s,h,v)),r.flags&512&&(r.check=pn(r.check,i,h,s)),o-=h,s+=h,r.length-=h),r.length))break e;r.length=0,r.mode=m1;case m1:if(r.flags&2048){if(o===0)break e;h=0;do v=i[s+h++],r.head&&v&&r.length<65536&&(r.head.name+=String.fromCharCode(v));while(v&&h>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=jn;break;case w1:for(;u<32;){if(o===0)break e;o--,c+=i[s++]<>>=u&7,u-=u&7,r.mode=rg;break}for(;u<3;){if(o===0)break e;o--,c+=i[s++]<>>=1,u-=1,c&3){case 0:r.mode=b1;break;case 1:if(GO(r),r.mode=ad,e===sd){c>>>=2,u-=2;break e}break;case 2:r.mode=y1;break;case 3:t.msg="invalid block type",r.mode=nt}c>>>=2,u-=2;break;case b1:for(c>>>=u&7,u-=u&7;u<32;){if(o===0)break e;o--,c+=i[s++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=nt;break}if(r.length=c&65535,c=0,u=0,r.mode=tg,e===sd)break e;case tg:r.mode=_1;case _1:if(h=r.length,h){if(h>o&&(h=o),h>l&&(h=l),h===0)break e;Kr.arraySet(n,i,s,h,a),o-=h,s+=h,l-=h,a+=h,r.length-=h;break}r.mode=jn;break;case y1:for(;u<14;){if(o===0)break e;o--,c+=i[s++]<>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=nt;break}r.have=0,r.mode=x1;case x1:for(;r.have>>=3,u-=3}for(;r.have<19;)r.lens[M[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},x=Lc(RO,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid code lengths set",r.mode=nt;break}r.have=0,r.mode=E1;case E1:for(;r.have>>24,b=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=i[s++]<>>=y,u-=y,r.lens[r.have++]=S;else{if(S===16){for(T=y+2;u>>=y,u-=y,r.have===0){t.msg="invalid bit length repeat",r.mode=nt;break}v=r.lens[r.have-1],h=3+(c&3),c>>>=2,u-=2}else if(S===17){for(T=y+3;u>>=y,u-=y,v=0,h=3+(c&7),c>>>=3,u-=3}else{for(T=y+7;u>>=y,u-=y,v=0,h=11+(c&127),c>>>=7,u-=7}if(r.have+h>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=nt;break}for(;h--;)r.lens[r.have++]=v}}if(r.mode===nt)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=nt;break}if(r.lenbits=9,P={bits:r.lenbits},x=Lc(I1,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid literal/lengths set",r.mode=nt;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},x=Lc(M1,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,x){t.msg="invalid distances set",r.mode=nt;break}if(r.mode=ad,e===sd)break e;case ad:r.mode=od;case od:if(o>=6&&l>=258){t.next_out=a,t.avail_out=l,t.next_in=s,t.avail_in=o,r.hold=c,r.bits=u,PO(t,d),a=t.next_out,n=t.output,l=t.avail_out,s=t.next_in,i=t.input,o=t.avail_in,c=r.hold,u=r.bits,r.mode===jn&&(r.back=-1);break}for(r.back=0;w=r.lencode[c&(1<>>24,b=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=i[s++]<>C)],y=w>>>24,b=w>>>16&255,S=w&65535,!(C+y<=u);){if(o===0)break e;o--,c+=i[s++]<>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,r.length=S,b===0){r.mode=T1;break}if(b&32){r.back=-1,r.mode=jn;break}if(b&64){t.msg="invalid literal/length code",r.mode=nt;break}r.extra=b&15,r.mode=S1;case S1:if(r.extra){for(T=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=k1;case k1:for(;w=r.distcode[c&(1<>>24,b=w>>>16&255,S=w&65535,!(y<=u);){if(o===0)break e;o--,c+=i[s++]<>C)],y=w>>>24,b=w>>>16&255,S=w&65535,!(C+y<=u);){if(o===0)break e;o--,c+=i[s++]<>>=C,u-=C,r.back+=C}if(c>>>=y,u-=y,r.back+=y,b&64){t.msg="invalid distance code",r.mode=nt;break}r.offset=S,r.extra=b&15,r.mode=A1;case A1:if(r.extra){for(T=r.extra;u>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=nt;break}r.mode=C1;case C1:if(l===0)break e;if(h=d-l,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=nt;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),g=r.window}else g=n,p=a-r.offset,h=r.length;h>l&&(h=l),l-=h,r.length-=h;do n[a++]=g[p++];while(--h);r.length===0&&(r.mode=od);break;case T1:if(l===0)break e;n[a++]=r.length,l--,r.mode=od;break;case rg:if(r.wrap){for(;u<32;){if(o===0)break e;o--,c|=i[s++]<{"use strict";m();j1.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 z1=U((tz,V1)=>{"use strict";m();function qO(){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}V1.exports=qO});var q1=U(Bc=>{"use strict";m();var jo=G1(),Nc=Hn(),cd=qm(),bt=lg(),cg=Zf(),YO=Ym(),ZO=z1(),W1=Object.prototype.toString;function pa(t){if(!(this instanceof pa))return new pa(t);this.options=Nc.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new YO,this.strm.avail_out=0;var r=jo.inflateInit2(this.strm,e.windowBits);if(r!==bt.Z_OK)throw new Error(cg[r]);if(this.header=new ZO,jo.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=cd.string2buf(e.dictionary):W1.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=jo.inflateSetDictionary(this.strm,e.dictionary),r!==bt.Z_OK)))throw new Error(cg[r])}pa.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,s,a,o,l,c,u=!1;if(this.ended)return!1;a=e===~~e?e:e===!0?bt.Z_FINISH:bt.Z_NO_FLUSH,typeof t=="string"?r.input=cd.binstring2buf(t):W1.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new Nc.Buf8(i),r.next_out=0,r.avail_out=i),s=jo.inflate(r,bt.Z_NO_FLUSH),s===bt.Z_NEED_DICT&&n&&(s=jo.inflateSetDictionary(this.strm,n)),s===bt.Z_BUF_ERROR&&u===!0&&(s=bt.Z_OK,u=!1),s!==bt.Z_STREAM_END&&s!==bt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===bt.Z_STREAM_END||r.avail_in===0&&(a===bt.Z_FINISH||a===bt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(o=cd.utf8border(r.output,r.next_out),l=r.next_out-o,c=cd.buf2string(r.output,o),r.next_out=l,r.avail_out=i-l,l&&Nc.arraySet(r.output,r.output,o,l,0),this.onData(c)):this.onData(Nc.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==bt.Z_STREAM_END);return s===bt.Z_STREAM_END&&(a=bt.Z_FINISH),a===bt.Z_FINISH?(s=jo.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===bt.Z_OK):(a===bt.Z_SYNC_FLUSH&&(this.onEnd(bt.Z_OK),r.avail_out=0),!0)};pa.prototype.onData=function(t){this.chunks.push(t)};pa.prototype.onEnd=function(t){t===bt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Nc.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function ug(t,e){var r=new pa(e);if(r.push(t,!0),r.err)throw r.msg||cg[r.err];return r.result}function KO(t,e){return e=e||{},e.raw=!0,ug(t,e)}Bc.Inflate=pa;Bc.inflate=ug;Bc.inflateRaw=KO;Bc.ungzip=ug});var K1=U((sz,Z1)=>{"use strict";m();var XO=Hn().assign,QO=Qx(),JO=q1(),eL=lg(),Y1={};XO(Y1,QO,JO,eL);Z1.exports=Y1});var J1=U((oz,Q1)=>{"use strict";m();var X1=(t,e)=>function(...r){let i=e.promiseModule;return new i((n,s)=>{e.multiArgs?r.push((...a)=>{e.errorFirst?a[0]?s(a):(a.shift(),n(a)):n(a)}):e.errorFirst?r.push((a,o)=>{a?s(a):n(o)}):r.push(n),t.apply(this,r)})};Q1.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=s=>{let a=o=>typeof o=="string"?s===o:o.test(s);return e.include?e.include.some(a):!e.exclude.some(a)},n;r==="function"?n=function(...s){return e.excludeMain?t(...s):X1(t,e).apply(this,s)}:n=Object.create(Object.getPrototypeOf(t));for(let s in t){let a=t[s];n[s]=typeof a=="function"&&i(s)?X1(a,e):a}return n}});var lE=U((cz,oE)=>{m();function eE(t){return Array.isArray(t)?t:[t]}var hg="",tE=" ",fg="\\",tL=/^\s+$/,rL=/(?:[^\\]|^)\\$/,iL=/^\\!/,nL=/^\\#/,sL=/\r?\n/g,aL=/^\.*\/|^\.+$/,dg="/",nE="node-ignore";typeof Symbol!="undefined"&&(nE=Symbol.for("node-ignore"));var rE=nE,oL=(t,e,r)=>Object.defineProperty(t,e,{value:r}),lL=/([0-z])-([0-z])/g,sE=()=>!1,cL=t=>t.replace(lL,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:hg),uL=t=>{let{length:e}=t;return t.slice(0,e-e%2)},fL=[[/^\uFEFF/,()=>hg],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?tE:hg)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+tE}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>fg],[/\\\\/g,()=>fg],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===fg?`\\[${r}${uL(i)}${n}`:n==="]"&&i.length%2===0?`[${cL(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],iE=Object.create(null),dL=(t,e)=>{let r=iE[t];return r||(r=fL.reduce((i,[n,s])=>i.replace(n,s.bind(t)),t),iE[t]=r),e?new RegExp(r,"i"):new RegExp(r)},gg=t=>typeof t=="string",hL=t=>t&&gg(t)&&!tL.test(t)&&!rL.test(t)&&t.indexOf("#")!==0,pL=t=>t.split(sL),pg=class{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}},mL=(t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(iL,"!").replace(nL,"#");let n=dL(t,e);return new pg(r,t,i,n)},gL=(t,e)=>{throw new e(t)},Vn=(t,e,r)=>gg(t)?t?Vn.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),aE=t=>aL.test(t);Vn.isNotRelative=aE;Vn.convert=t=>t;var mg=class{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){oL(this,rE,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[rE]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(hL(e)){let r=mL(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,eE(gg(e)?pL(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(s=>{let{negative:a}=s;if(n===a&&i!==n||a&&!i&&!n&&!r)return;s.regex.test(e)&&(i=!a,n=a)}),{ignored:i,unignored:n}}_test(e,r,i,n){let s=e&&Vn.convert(e);return Vn(s,e,this._allowRelativePaths?sE:gL),this._t(s,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(dg)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let s=this._t(n.join(dg)+dg,r,i,n);return r[e]=s.ignored?s:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return eE(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},ud=t=>new mg(t),vL=t=>Vn(t&&Vn.convert(t),t,sE);ud.isPathValid=vL;ud.default=ud;oE.exports=ud;if(typeof process!="undefined"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/");Vn.convert=t;let e=/^[a-z]:\//i;Vn.isNotRelative=r=>e.test(r)||aE(r)}});var uE=U((fz,cE)=>{"use strict";m();function wL(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mn(t,e,r){return e=e instanceof RegExp?e:new RegExp(wL(e),"g"),t.replace(e,r)}var bL={clean:function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=mn(e,"./","/"),e=mn(e,"..","."),e=mn(e," ","-"),e=mn(e,/^[~^:?*\\\-]/g,""),e=mn(e,/[~^:?*\\]/g,"-"),e=mn(e,/[~^:?*\\\-]$/g,""),e=mn(e,"@{","-"),e=mn(e,/\.$/g,""),e=mn(e,/\/$/g,""),e=mn(e,/\.lock$/g,""),e}};cE.exports=bL});var dE=U((hz,fE)=>{m();fE.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=null,l=n+1,c=[],u=[],f=[],d="",h=-1,p=0,g=1,w,y,b=function(){n>=s&&(w=r,y=n,r=i,i=w,n=s,s=y,a=!0,l=n+1)},S=function(v,x,_){return{x:v,y:x,k:_}},C=function(v,x){return{elem:v,t:x}},A=function(v,x,_){var P,T,M;for(x>_?P=c[v-1+l]:P=c[v+1+l],M=Math.max(x,_),T=M-v;T=0;--M)for(;PT-P?(a?f[f.length]=new C(i[T],h):f[f.length]=new C(i[T],g),++_,++T):v[M].y-v[M].x=v+1;--D)_[D+l]=A(D,_[D-1+l]+1,_[D+1+l]);_[v+l]=A(v,_[v-1+l]+1,_[v+1+l])}while(_[v+l]!==s);for(o=v+2*P,T=c[v+l],M=[];T!==-1;)M[M.length]=new S(u[T].x,u[T].y,null),T=u[T].k;k(M)}}}});var mE=U((mz,pE)=>{m();var _L=dE();function yL(t,e){var r=new _L(t,e);r.compose();for(var i=r.getses(),n,s,a=t.length-1,o=e.length-1,l=i.length-1;l>=0;--l)i[l].t===r.SES_COMMON?(s?(s.chain={file1index:a,file2index:o,chain:null},s=s.chain):(n={file1index:a,file2index:o,chain:null},s=n),a--,o--):i[l].t===r.SES_DELETE?a--:i[l].t===r.SES_ADD&&o--;var c={file1index:-1,file2index:-1,chain:null};return s?(s.chain=c,n):c}function hE(t,e){for(var r=[],i=t.length,n=e.length,s=yL(t,e);s!==null;s=s.chain){var a=i-s.file1index-1,o=n-s.file2index-1;i=s.file1index,n=s.file2index,(a||o)&&r.push({file1:[i+1,a],file2:[n+1,o]})}return r.reverse(),r}function xL(t,e,r){var i,n=hE(e,t),s=hE(e,r),a=[];function o($,D){a.push([$.file1[0],D,$.file1[1],$.file2[0],$.file2[1]])}for(i=0;ic&&(l.push([1,c,$-c]),c=$)}for(var f=0;fg)break;g=Math.max(g,y+w[2]),f++}if(u(p),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var S=h[1],C=b[S],A=h[0],k=A+h[2],v=h[3],x=v+h[4];C[0]=Math.min(v,C[0]),C[1]=Math.max(x,C[1]),C[2]=Math.min(A,C[2]),C[3]=Math.max(k,C[3])}var _=b[0][0]+(p-b[0][2]),P=b[0][1]+(g-b[0][3]),T=b[2][0]+(p-b[2][2]),M=b[2][1]+(g-b[2][3]);l.push([-1,_,P-_,p,g-p,T,M-T])}c=g}return u(e.length),l}function EL(t,e,r){var i=[],n=[t,e,r],s=xL(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var p=0;p{"use strict";m();Object.defineProperty(Z,"__esModule",{value:!0});function Fs(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Uc=Fs(qb()),BE=Fs(ox()),SL=Fs(cx()),Ug=Fs(K1()),fd=Fs(J1()),kL=Fs(lE()),Gc=Fs(uE()),AL=Fs(mE()),Pe=class t extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new t(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}},jc=class t extends Pe{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=t.code,this.data={filepaths:e}}};jc.code="UnmergedPathsError";var me=class t extends Pe{constructor(e){super(`An internal error caused this command to fail. + +If you're not a developer, report the bug to the developers of the application you're using. If this is a bug in isomorphic-git then you should create a proper bug yourselves. The bug should include a minimal reproduction and details about the version and environment. + +Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=t.code,this.data={message:e}}};me.code="InternalError";var zo=class t extends Pe{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=t.code,this.data={filepath:e}}};zo.code="UnsafeFilepathError";var wi=class{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};function Sd(t,e){return-(te)}function HE(t,e){return Sd(t.path,e.path)}function UE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}var gn=2**32;function gE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),s=(r-n*1e3)*1e6;return[n,s]}function Wo(t){let[e,r]=gE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=gE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%gn,ctimeNanoseconds:r%gn,mtimeSeconds:i%gn,mtimeNanoseconds:n%gn,dev:t.dev%gn,ino:t.ino%gn,mode:UE(t.mode%gn),uid:t.uid%gn,gid:t.gid%gn,size:t.size>-1?t.size%gn:0}}function CL(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}var vg=null;async function wn(t){return vg===null&&(vg=await PL()),vg?GE(t):TL(t)}function TL(t){return new BE().update(t).digest("hex")}async function GE(t){let e=await crypto.subtle.digest("SHA-1",t);return CL(e)}async function PL(){try{return await GE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(t){}return!1}function RL(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}function $L(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(E.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}var Pg=class t{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(E.isBuffer(e))return t.fromBuffer(e);if(e===null)return new t(null);throw new me("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new me("Index file is empty (.git/index)");let r=new t,i=new wi(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new me(`Invalid dircache magic file number: ${n}`);let s=await wn(e.slice(0,-20)),a=e.slice(-20).toString("hex");if(a!==s)throw new me(`Invalid checksum in GitIndex buffer: expected ${a} but saw ${s}`);let o=i.readUInt32BE();if(o!==2)throw new me(`Unsupported dircache version: ${o}`);let l=i.readUInt32BE(),c=0;for(;!i.eof()&&ce.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=Wo(r);let s=E.from(e),a={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:s.length<4095?s.length:4095},stages:[]};this._addEntry(a),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(` +`)}static async _entryToBuffer(e){let r=E.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=E.alloc(i),s=new wi(n),a=Wo(e);return s.writeUInt32BE(a.ctimeSeconds),s.writeUInt32BE(a.ctimeNanoseconds),s.writeUInt32BE(a.mtimeSeconds),s.writeUInt32BE(a.mtimeNanoseconds),s.writeUInt32BE(a.dev),s.writeUInt32BE(a.ino),s.writeUInt32BE(a.mode),s.writeUInt32BE(a.uid),s.writeUInt32BE(a.gid),s.writeUInt32BE(a.size),s.write(e.oid,20,"hex"),s.writeUInt16BE($L(e)),s.write(e.path,r.length,"utf8"),n}async toObject(){let e=E.alloc(12),r=new wi(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let o of this.entries)if(i.push(t._entryToBuffer(o)),o.stages.length>1)for(let l of o.stages)l&&l!==o&&i.push(t._entryToBuffer(l));i=await Promise.all(i);let n=E.concat(i),s=E.concat([e,n]),a=await wn(s);return E.concat([s,E.from(a,"hex")])}};function pd(t,e,r=!0,i=!0){let n=Wo(t),s=Wo(e);return r&&n.mode!==s.mode||n.mtimeSeconds!==s.mtimeSeconds||n.ctimeSeconds!==s.ctimeSeconds||n.uid!==s.uid||n.gid!==s.gid||i&&n.ino!==s.ino||n.size!==s.size}var wg=null,bg=Symbol("IndexCache");function FL(){return{map:new Map,stats:new Map}}async function IL(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),s=await Pg.from(n);r.map.set(e,s),r.stats.set(e,i)}async function ML(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:pd(i,n)}var dt=class{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},s){i[bg]||(i[bg]=FL());let a=`${r}/index`;wg===null&&(wg=new Uc({maxPending:1/0}));let o,l=[];return await wg.acquire(a,async()=>{let c=i[bg];await ML(e,a,c)&&await IL(e,a,c);let u=c.map.get(a);if(l=u.unmergedPaths,l.length&&!n)throw new jc(l);if(o=await s(u),u._dirty){let f=await u.toObject();await e.write(a,f),c.stats.set(a,await e.lstat(a)),u._dirty=!1}}),o}};function md(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}function va(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}function jE(t){let e=new Map,r=function(n){if(!e.has(n)){let s={type:"tree",fullpath:n,basename:md(n),metadata:{},children:[]};e.set(n,s),s.parent=r(va(n)),s.parent&&s.parent!==s&&s.parent.children.push(s)}return e.get(n)},i=function(n,s){if(!e.has(n)){let a={type:"blob",fullpath:n,basename:md(n),metadata:s,parent:r(va(n)),children:[]};a.parent&&a.parent.children.push(a),e.set(n,a)}return e.get(n)};r(".");for(let n of t)i(n.path,n);return e}function DL(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new me(`Unexpected GitTree entry mode: ${t.toString(8)}`)}var Rg=class{constructor({fs:e,gitdir:r,cache:i}){this.treePromise=dt.acquire({fs:e,gitdir:r,cache:i},async function(s){return jE(s.entries)});let n=this;this.ConstructEntry=class{constructor(a){this._fullpath=a,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}}}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let s=n.children.map(a=>a.fullpath);return s.sort(Sd),s}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:Wo(i.metadata);e._type=i.type==="tree"?"tree":DL(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}},kd=Symbol("GitWalkSymbol");function Ea(){let t=Object.create(null);return Object.defineProperty(t,kd,{value:function({fs:e,gitdir:r,cache:i}){return new Rg({fs:e,gitdir:r,cache:i})}}),Object.freeze(t),t}var Ge=class t extends Pe{constructor(e){super(`Could not find ${e}.`),this.code=this.name=t.code,this.data={what:e}}};Ge.code="NotFoundError";var _r=class t extends Pe{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=t.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};_r.code="ObjectTypeError";var As=class t extends Pe{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=t.code,this.data={value:e}}};As.code="InvalidOidError";var Vc=class t extends Pe{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following: +[remote "${e}"] + fetch = +refs/heads/*:refs/remotes/origin/* +`),this.code=this.name=t.code,this.data={remote:e}}};Vc.code="NoRefspecError";var gd=class t{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(` +`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let s=i.slice(1);return this.refs.set(r+"^{}",s),{line:i,ref:r,peeled:s}}else{let s=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,s),{line:i,ref:r,oid:s}}})}return this}static from(e){return new t(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(` +`)+` +`}},vd=class t{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,s,a]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),o=r==="+",l=n==="*";if(l!==(a==="*"))throw new me("Invalid refspec");return new t({remotePath:i,localPath:s,force:o,matchPrefix:l})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}},$g=class t{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(vd.from(i));return new t(r)}add(e){let r=vd.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let s=i.translate(n);s&&r.push([n,s])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};function OL(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(ri);return n===0?t.endsWith("^{}")?1:-1:n}function LL(t,e){let r="",i=0,n=-1,s=0,a="\0";for(let o=0;o<=t.length;++o){if(o2){let l=r.lastIndexOf("/");l===-1?(r="",i=0):(r=r.slice(0,l),i=r.length-1-r.lastIndexOf("/")),n=o,s=0;continue}else if(r.length!==0){r="",i=0,n=o,s=0;continue}}e&&(r+=r.length>0?"/..":"..",i=2)}else r.length>0?r+="/"+t.slice(n+1,o):r=t.slice(n+1,o),i=o-n-1;n=o,s=0}else a==="."&&s!==-1?++s:s=-1}return r}function NL(t){if(!t.length)return".";let e=t[0]==="/",r=t.at(-1)==="/";return t=LL(t,!e),t.length?(r&&(t+="/"),e?`/${t}`:t):e?"/":r?"./":"."}function H(...t){if(t.length===0)return".";let e;for(let r=0;r0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":NL(e)}var BL=t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},Hc=t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},vE={core:{filemode:Hc,bare:Hc,logallrefupdates:Hc,symlinks:Hc,ignorecase:Hc,bigFileThreshold:BL}},HL=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,UL=/^[A-Za-z0-9-.]+$/,GL=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,jL=/^[A-Za-z][A-Za-z-]*$/,VL=/^(.*?)( *[#;].*)$/,zL=t=>{let e=HL.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},WL=t=>{let e=GL.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=qL(i),s=YL(n);return[r,s]}return null},qL=t=>{let e=VL.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return wE(r)&&wE(i)?`${r}${i}`:r},wE=t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,YL=t=>t.split("").reduce((e,r,i,n)=>{let s=r==='"'&&n[i-1]!=="\\",a=r==="\\"&&n[i+1]==='"';return s||a?e:e+r},""),bE=t=>t!=null?t.toLowerCase():null,Fg=(t,e,r)=>[bE(t),e,bE(r)].filter(i=>i!=null).join("."),_E=t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:Fg(r,n,i),sectionPath:Fg(r,n,null),isSection:!!r}},ZL=(t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),Ig=class t{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(` +`).map(n=>{let s=null,a=null,o=n.trim(),l=zL(o),c=l!=null;if(c)[r,i]=l;else{let f=WL(o);f!=null&&([s,a]=f)}let u=Fg(r,i,s);return{line:n,isSection:c,section:r,subsection:i,name:s,value:a,path:u}}):[]}static from(e){return new t(e)}async get(e,r=!1){let i=_E(e).path,n=this.parsedConfig.filter(s=>s.path===i).map(({section:s,name:a,value:o})=>{let l=vE[s]&&vE[s][a];return l?l(o):o});return r?n:n.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:s,name:a,path:o,sectionPath:l,isSection:c}=_E(e),u=ZL(this.parsedConfig,f=>f.path===o);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let f=this.parsedConfig[u],d=Object.assign({},f,{name:a,value:r,modified:!0});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let f=this.parsedConfig.findIndex(h=>h.path===l),d={section:n,subsection:s,name:a,value:r,modified:!0,path:o};if(UL.test(n)&&jL.test(a))if(f>=0)this.parsedConfig.splice(f+1,0,d);else{let h={isSection:c,section:n,subsection:s,modified:!0,path:l};this.parsedConfig.push(h,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:s,modified:a=!1})=>a?n!=null&&s!=null?typeof s=="string"&&/[#;]/.test(s)?` ${n} = "${s}"`:` ${n} = ${s}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(` +`)}},ht=class{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return Ig.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}},dd=t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],KL=["config","description","index","shallow","commondir"],_g;async function Ss(t,e){return _g===void 0&&(_g=new Uc),_g.acquire(t,e)}var q=class t{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:s,tags:a,refspecs:o=void 0,prune:l=!1,pruneTags:c=!1}){for(let w of n.values())if(!w.match(/[0-9a-f]{40}/))throw new As(w);let u=await ht.get({fs:e,gitdir:r});if(!o){if(o=await u.getall(`remote.${i}.fetch`),o.length===0)throw new Vc(i);o.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let f=$g.from(o),d=new Map;if(c){let w=await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await t.deleteRefs({fs:e,gitdir:r,refs:w.map(y=>`refs/tags/${y}`)})}if(a){for(let w of n.keys())if(w.startsWith("refs/tags")&&!w.endsWith("^{}")&&!await t.exists({fs:e,gitdir:r,ref:w})){let y=n.get(w);d.set(w,y)}}let h=f.translate([...n.keys()]);for(let[w,y]of h){let b=n.get(w);d.set(y,b)}let p=f.translate([...s.keys()]);for(let[w,y]of p){let b=s.get(w),S=f.translateOne(b);S&&d.set(y,`ref: ${S}`)}let g=[];if(l){for(let w of f.localNamespaces()){let y=(await t.listRefs({fs:e,gitdir:r,filepath:w})).map(b=>`${w}/${b}`);for(let b of y)d.has(b)||g.push(b)}g.length>0&&await t.deleteRefs({fs:e,gitdir:r,refs:g})}for(let[w,y]of d)await Ss(w,async()=>e.write(H(r,w),`${y.trim()} +`,"utf8"));return{pruned:g}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new As(n);await Ss(i,async()=>e.write(H(r,i),`${n.trim()} +`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await Ss(i,async()=>e.write(H(r,i),`ref: ${n.trim()} +`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return t.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(o=>e.rm(H(r,o))));let n=await Ss("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),s=gd.from(n),a=s.refs.size;for(let o of i)s.refs.has(o)&&s.delete(o);s.refs.sizee.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),t.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let s=await t.packedRefs({fs:e,gitdir:r}),a=dd(i).filter(o=>!KL.includes(o));for(let o of a){let l=await Ss(o,async()=>await e.read(`${r}/${o}`,{encoding:"utf8"})||s.get(o));if(l)return t.resolve({fs:e,gitdir:r,ref:l.trim(),depth:n})}throw new Ge(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await t.expand({fs:e,gitdir:r,ref:i}),!0}catch(n){return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await t.packedRefs({fs:e,gitdir:r}),s=dd(i);for(let a of s)if(await Ss(a,async()=>e.exists(`${r}/${a}`))||n.has(a))return a;throw new Ge(i)}static async expandAgainstMap({ref:e,map:r}){let i=dd(e);for(let n of i)if(await r.has(n))return n;throw new Ge(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),t.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let s=dd(e);for(let a of s){let o=n.get(a);if(o)return t.resolveAgainstMap({ref:o.trim(),fullref:a,depth:i,map:n})}throw new Ge(e)}static async packedRefs({fs:e,gitdir:r}){let i=await Ss("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return gd.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=t.packedRefs({fs:e,gitdir:r}),s=null;try{s=await e.readdirDeep(`${r}/${i}`),s=s.map(a=>a.replace(`${r}/${i}/`,""))}catch(a){s=[]}for(let a of(await n).keys())a.startsWith(i)&&(a=a.replace(i+"/",""),s.includes(a)||s.push(a));return s.sort(OL),s}static async listBranches({fs:e,gitdir:r,remote:i}){return i?t.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):t.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await t.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(n=>!n.endsWith("^{}"))}};function XL(t,e){return Sd(yE(t),yE(e))}function yE(t){return t.mode==="040000"?t.path+"/":t.path}function VE(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new me(`Unexpected GitTree entry mode: ${t}`)}function QL(t){let e=[],r=0;for(;r`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(` +`)}toObject(){let e=[...this._entries];return e.sort(XL),E.concat(e.map(r=>{let i=E.from(r.mode.replace(/^0/,"")),n=E.from(" "),s=E.from(r.path,"utf8"),a=E.from([0]),o=E.from(r.oid,"hex");return E.concat([i,n,s,a,o])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}},Cs=class{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,s=n+r.length,a=new Uint8Array(s);for(let o=0;o>=1,n+=8;return i}function SE(t,e){let r=t.readUInt8(),i=128,n=15,s=112;if(r&i){let a=EE(t,r&n,4),o=EE(t,(r&s)>>4,3);return o===0&&(o=65536),e.slice(a,a+o)}else return t.slice(r)}function rN(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}function WE(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:rN(t)}var wd=class{constructor(e){if(typeof E=="undefined")throw new Error("Missing Buffer dependency");this.stream=WE(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?E.alloc(0):(r&&(r=E.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>iN(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=E.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};function iN(t){return t.reduce((e,r)=>e+r.length,0)}async function nN(t,e){let r=new wd(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new me(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new me(`Invalid packfile version: ${n}`);let s=await r.read(4);if(s=s.readUInt32BE(0),!(s<1))for(;!r.eof()&&s--;){let a=r.tell(),{type:o,length:l,ofs:c,reference:u}=await sN(r),f=new Ug.Inflate;for(;!f.result;){let d=await r.chunk();if(!d)break;if(f.push(d,!1),f.err)throw new me(`Pako error: ${f.msg}`);if(f.result){if(f.result.length!==l)throw new me("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-f.strm.avail_in);let h=r.tell();await e({data:f.result,type:o,num:s,offset:a,end:h,reference:u,ofs:c})}}}}async function sN(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let a=4;do e=await t.byte(),i|=(e&127)<n+1<<7|s,-1)}function cN(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<2048*1024*1024)throw new me("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+1020);let a=i.readUInt32BE(),o=[];for(let u=0;u{u===null&&(u=C);let A=Math.floor((u-C)*100/u);A!==f&&i&&await i({phase:"Receiving objects",loaded:u-C,total:u}),f=A,y=n[y],["commit","tree","blob","tag"].includes(y)?s[S]={type:y,offset:S}:y==="ofs-delta"?s[S]={type:y,offset:S}:y==="ref-delta"&&(s[S]={type:y,offset:S})});let d=Object.keys(s).map(Number);for(let[w,y]of d.entries()){let b=w+1===d.length?e.byteLength-20:d[w+1],S=s[y],C=SL.buf(e.slice(y,b))>>>0;S.end=b,S.crc=C}let h=new t({pack:Promise.resolve(e),packfileSha:a,crcs:l,hashes:o,offsets:c,getExternalRefDelta:r});f=null;let p=0,g=[0,0,0,0,0,0,0,0,0,0,0,0];for(let w in s){w=Number(w);let y=Math.floor(p*100/u);y!==f&&i&&await i({phase:"Resolving deltas",loaded:p,total:u}),p++,f=y;let b=s[w];if(!b.oid)try{h.readDepth=0,h.externalReadDepth=0;let{type:S,object:C}=await h.readSlice({start:w});g[h.readDepth]+=1;let A=await wn(Cs.wrap({type:S,object:C}));b.oid=A,o.push(A),c.set(A,w),l[A]=b.crc}catch(S){continue}}return o.sort(),h}async toBuffer(){let e=[],r=(c,u)=>{e.push(E.from(c,u))};r("ff744f63","hex"),r("00000002","hex");let i=new wi(E.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let f of this.hashes)parseInt(f.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new wi(E.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let s=new wi(E.alloc(this.hashes.length*4));for(let c of this.hashes)s.writeUInt32BE(this.offsets.get(c));e.push(s.buffer),r(this.packfileSha,"hex");let a=E.concat(e),o=await wn(a),l=E.alloc(20);return l.write(o,"hex"),E.concat([a,l])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new me(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"},i=await this.pack;if(!i)throw new me("Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.");let n=i.slice(e),s=new wi(n),a=s.readUInt8(),o=a&112,l=r[o];if(l===void 0)throw new me("Unrecognized type: 0b"+o.toString(2));let c=a&15,u=c;a&128&&(u=cN(s,c));let d=null,h=null;if(l==="ofs_delta"){let g=lN(s),w=e-g;({object:d,type:l}=await this.readSlice({start:w}))}if(l==="ref_delta"){let g=s.slice(20).toString("hex");({object:d,type:l}=await this.read({oid:g}))}let p=n.slice(s.tell());if(h=E.from(await qE(p)),h.byteLength!==u)throw new me(`Packfile told us object would have length ${u} but it had length ${h.byteLength}`);return d&&(h=E.from(tN(h,d))),this.readDepth>3&&(this.offsetCache[e]={type:l,object:h}),{type:l,format:"content",object:h}}},hd=Symbol("PackfileCache");async function uN({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let s=await t.read(e);return zc.fromIdx({idx:s,getExternalRefDelta:r})}function Gg({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}){e[hd]||(e[hd]=new Map);let a=e[hd].get(r);return a||(a=uN({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:s}),e[hd].set(r,a)),a}async function fN({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:s}){let a=await t.readdir(H(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await Gg({fs:t,cache:e,filename:l,getExternalRefDelta:s});if(c.error)throw new me(c.error);if(c.offsets.has(i)){let u=l.replace(/idx$/,"pack");c.pack||(c.pack=t.read(u));let f=await c.pack;if(!f)throw c.pack=null,new me(`Could not read packfile at ${u}. The file may be missing, corrupted, or too large to read into memory.`);if(!c._checksumVerified){let h=c.packfileSha,p=f.subarray(-20),g=Array.from(p).map(b=>b.toString(16).padStart(2,"0")).join("");if(g!==h)throw new me(`Packfile trailer mismatch: expected ${h}, got ${g}. The packfile may be corrupted.`);let w=f.subarray(0,-20),y=await wn(w);if(y!==h)throw new me(`Packfile payload corrupted: calculated ${y} but expected ${h}. The packfile may have been tampered with.`);c._checksumVerified=!0}let d=await c.read({oid:i,getExternalRefDelta:s});return d.format="content",d.source=`objects/pack/${o.replace(/idx$/,"pack")}`,d}}return null}async function et({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=u=>et({fs:t,cache:e,gitdir:r,oid:u}),a;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(a={format:"wrapped",object:E.from("tree 0\0")}),a||(a=await zE({fs:t,gitdir:r,oid:i})),!a){if(a=await fN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s}),!a)throw new Ge(i);return a}if(n==="deflated"||(a.format==="deflated"&&(a.object=E.from(await qE(a.object)),a.format="wrapped"),n==="wrapped"))return a;let o=await wn(a.object);if(o!==i)throw new me(`SHA check failed! Expected ${i}, computed ${o}`);let{object:l,type:c}=Cs.unwrap(a.object);if(a.type=c,a.object=l,a.format="content",n==="content")return a;throw new me(`invalid requested format "${n}"`)}var Ui=class t extends Pe{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=t.code,this.data={noun:e,where:r,canForce:i}}};Ui.code="AlreadyExistsError";var Wc=class t extends Pe{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=t.code,this.data={nouns:e,short:r,matches:i}}};Wc.code="AmbiguousError";var qc=class t extends Pe{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=t.code,this.data={filepaths:e}}};qc.code="CheckoutConflictError";var Yc=class t extends Pe{constructor(e,r){super(`Cannot cherry-pick merge commit ${e}. Merge commits have ${r} parents and require specifying which parent to use as the base.`),this.code=this.name=t.code,this.data={oid:e,parentCount:r}}};Yc.code="CherryPickMergeCommitError";var Zc=class t extends Pe{constructor(e){super(`Cannot cherry-pick root commit ${e}. Root commits have no parents.`),this.code=this.name=t.code,this.data={oid:e}}};Zc.code="CherryPickRootCommitError";var Kc=class t extends Pe{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=t.code,this.data={ref:e,oid:r}}};Kc.code="CommitNotFetchedError";var Xc=class t extends Pe{constructor(){super("Empty response from git server."),this.code=this.name=t.code,this.data={}}};Xc.code="EmptyServerResponseError";var Qc=class t extends Pe{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=t.code,this.data={}}};Qc.code="FastForwardError";var Jc=class t extends Pe{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=t.code,this.data={prettyDetails:e,result:r}}};Jc.code="GitPushError";var qo=class t extends Pe{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=t.code,this.data={statusCode:e,statusMessage:r,response:i}}};qo.code="HttpError";var Ts=class t extends Pe{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=t.code,this.data={reason:e}}};Ts.code="InvalidFilepathError";var Gi=class t extends Pe{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=t.code,this.data={ref:e,suggestion:r}}};Gi.code="InvalidRefNameError";var eu=class t extends Pe{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=t.code,this.data={depth:e}}};eu.code="MaxDepthError";var Yo=class t extends Pe{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=t.code,this.data={}}};Yo.code="MergeNotSupportedError";var wa=class t extends Pe{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=t.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};wa.code="MergeConflictError";var Xt=class t extends Pe{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=t.code,this.data={role:e}}};Xt.code="MissingNameError";var Ir=class t extends Pe{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=t.code,this.data={parameter:e}}};Ir.code="MissingParameterError";var tu=class t extends Pe{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=t.code,this.data={errors:e},this.errors=e}};tu.code="MultipleGitError";var ba=class t extends Pe{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=t.code,this.data={expected:e,actual:r}}};ba.code="ParseError";var Zo=class t extends Pe{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=t.code,this.data={reason:e}}};Zo.code="PushRejectedError";var ks=class t extends Pe{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=t.code,this.data={capability:e,parameter:r}}};ks.code="RemoteCapabilityError";var ru=class t extends Pe{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=t.code,this.data={preview:e,response:r}}};ru.code="SmartHttpError";var iu=class t extends Pe{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=t.code,this.data={url:e,transport:r,suggestion:i}}};iu.code="UnknownTransportError";var nu=class t extends Pe{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=t.code,this.data={url:e}}};nu.code="UrlParseError";var Ko=class t extends Pe{constructor(){super("The operation was canceled."),this.code=this.name=t.code,this.data={}}};Ko.code="UserCanceledError";var su=class t extends Pe{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=t.code,this.data={filepath:e}}};su.code="IndexResetError";var au=class t extends Pe{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=t.code,this.data={ref:e}}};au.code="NoCommitError";var YE=Object.freeze({__proto__:null,AlreadyExistsError:Ui,AmbiguousError:Wc,CheckoutConflictError:qc,CherryPickMergeCommitError:Yc,CherryPickRootCommitError:Zc,CommitNotFetchedError:Kc,EmptyServerResponseError:Xc,FastForwardError:Qc,GitPushError:Jc,HttpError:qo,InternalError:me,InvalidFilepathError:Ts,InvalidOidError:As,InvalidRefNameError:Gi,MaxDepthError:eu,MergeNotSupportedError:Yo,MergeConflictError:wa,MissingNameError:Xt,MissingParameterError:Ir,MultipleGitError:tu,NoRefspecError:Vc,NotFoundError:Ge,ObjectTypeError:_r,ParseError:ba,PushRejectedError:Zo,RemoteCapabilityError:ks,SmartHttpError:ru,UnknownTransportError:iu,UnsafeFilepathError:zo,UrlParseError:nu,UserCanceledError:Ko,UnmergedPathsError:jc,IndexResetError:su,NoCommitError:au});function Mg({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=dN(i),`${t} <${e}> ${r} ${i}`}function dN(t){let e=hN(pN(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}function hN(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}function pN(t){return t===0?t:-t}function zn(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+` +`,t}function bd(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:mN(n)}}function mN(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),gN(i)}function gN(t){return t===0?t:-t}var Qr=class t{constructor(e){if(typeof e=="string")this._tag=e;else if(E.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=t.render(e);else throw new me("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new t(e)}static render(e){return`object ${e.object} +type ${e.type} +tag ${e.tag} +tagger ${Mg(e.tagger)} + +${e.message} +${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(` + +`))}message(){let e=this.withoutSignature();return e.slice(e.indexOf(` + +`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let e=this.justHeaders().split(` +`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.tagger&&(i.tagger=bd(i.tagger)),i.committer&&(i.committer=bd(i.committer)),i}withoutSignature(){let e=zn(this._tag);return e.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(` +-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(` +-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return zn(e)}payload(){return this.withoutSignature()+` +`}toObject(){return E.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:s}=await r({payload:n,secretKey:i});s=zn(s);let a=n+s;return t.from(a)}};function xg(t){return t.trim().split(` +`).map(e=>" "+e).join(` +`)+` +`}function vN(t){return t.split(` +`).map(e=>e.replace(/^ /,"")).join(` +`)}var Dr=class t{constructor(e){if(typeof e=="string")this._commit=e;else if(E.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=t.render(e);else throw new me("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let i=t.justHeaders(e),n=t.justMessage(e),s=zn(i+` +gpgsig`+xg(r)+` +`+n);return new t(s)}static from(e){return new t(e)}toObject(){return E.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return t.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return zn(e.slice(e.indexOf(` + +`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(` + +`))}parseHeaders(){let e=t.justHeaders(this._commit).split(` +`),r=[];for(let n of e)n[0]===" "?r[r.length-1]+=` +`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let s=n.slice(0,n.indexOf(" ")),a=n.slice(n.indexOf(" ")+1);Array.isArray(i[s])?i[s].push(a):i[s]=a}return i.author&&(i.author=bd(i.author)),i.committer&&(i.committer=bd(i.committer)),i}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree} +`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904 +`,e.parent){if(e.parent.length===void 0)throw new me("commit 'parent' property should be an array");for(let s of e.parent)r+=`parent ${s} +`}let i=e.author;r+=`author ${Mg(i)} +`;let n=e.committer||e.author;return r+=`committer ${Mg(n)} +`,e.gpgsig&&(r+="gpgsig"+xg(e.gpgsig)),r}static render(e){return t.renderHeaders(e)+` +`+zn(e.message)}render(){return this._commit}withoutSignature(){let e=zn(this._commit);if(e.indexOf(` +gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(` +gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE----- +`)+28);return zn(r+` +`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return vN(e)}static async sign(e,r,i){let n=e.withoutSignature(),s=t.justMessage(e._commit),{signature:a}=await r({payload:n,secretKey:i});a=zn(a);let l=t.justHeaders(e._commit)+` +gpgsig`+xg(a)+` +`+s;return t.from(l)}};async function Xo({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:Mr.from([]),oid:i};let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Qr.from(s).parse().object,Xo({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=Dr.from(s).parse().tree,Xo({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new _r(i,n,"tree");return{tree:Mr.from(s),oid:i}}var Dg=class{constructor({fs:e,gitdir:r,ref:i,cache:n}){this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let a=new Map,o;try{o=await q.resolve({fs:e,gitdir:r,ref:i})}catch(c){c instanceof Ge&&(o="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let l=await Xo({fs:e,cache:this.cache,gitdir:r,oid:o});return l.type="tree",l.mode="40000",a.set(".",l),a})();let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,cache:n,gitdir:s}=this,a=await this.mapPromise,o=a.get(r);if(!o)throw new Error(`No obj for ${r}`);let l=o.oid;if(!l)throw new Error(`No oid for obj ${JSON.stringify(o)}`);if(o.type!=="tree")return null;let{type:c,object:u}=await et({fs:i,cache:n,gitdir:s,oid:l});if(c!==o.type)throw new _r(l,c,o.type);let f=Mr.from(u);for(let d of f)a.set(H(r,d.path),d);return f.entries().map(d=>H(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=UE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:s}=this,o=r.get(e._fullpath).oid,{type:l,object:c}=await et({fs:i,cache:n,gitdir:s,oid:o});l!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};function Xr({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,kd,{value:function({fs:r,gitdir:i,cache:n}){return new Dg({fs:r,gitdir:i,ref:t,cache:n})}}),Object.freeze(e),e}var Og=class{constructor({fs:e,dir:r,gitdir:i,cache:n}){this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,this.config=null;let s=this;this.ConstructEntry=class{constructor(o){this._fullpath=o,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return s.type(this)}async mode(){return s.mode(this)}async stat(){return s.stat(this)}async content(){return s.content(this)}async oid(){return s.oid(this)}}}async readdir(e){let r=e._fullpath,{fs:i,dir:n}=this,s=await i.readdir(H(n,r));return s===null?null:s.map(a=>H(r,a))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let s=n.isDirectory()?"tree":"blob";s==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(s="special"),e._type=s,n=Wo(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s;if(await e.mode()>>12===10)s=await r.readlink(`${i}/${e._fullpath}`);else{let o=await(await this._getGitConfig(r,n)).get("core.autocrlf");s=await r.read(`${i}/${e._fullpath}`,{autocrlf:o})}e._actualSize=s.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(s)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:i,gitdir:n,cache:s}=this,a;await dt.acquire({fs:i,gitdir:n,cache:s},async function(o){let l=o.entriesMap.get(e._fullpath),c=await e.stat(),f=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process!="undefined"?process.platform!=="win32":!0;if(!l||pd(c,l,f,d)){let h=await e.content();h===void 0?a=void 0:(a=await wn(Cs.wrap({type:"blob",object:h})),l&&a===l.oid&&(!f||c.mode===l.mode)&&pd(c,l,f,d)&&o.insert({filepath:e._fullpath,stats:c,oid:a}))}else a=l.oid}),e._oid=a}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await ht.get({fs:e,gitdir:r}),this.config)}};function tl(){let t=Object.create(null);return Object.defineProperty(t,kd,{value:function({fs:e,dir:r,gitdir:i,cache:n}){return new Og({fs:e,dir:r,gitdir:i,cache:n})}}),Object.freeze(t),t}function wN(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}var ZE=typeof Array.prototype.flat=="undefined"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),Lg=class{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:ec,reduce:a=async(l,c)=>{let u=ZE(c);return l!==void 0&&u.unshift(l),u},iterate:o=(l,c)=>Promise.all([...c].map(l))}){let l=n.map(h=>h[kd]({fs:t,dir:r,gitdir:i,cache:e})),c=new Array(l.length).fill("."),u=wN(0,l.length),f=async h=>{u.forEach(w=>{let y=h[w];h[w]=y&&new l[w].ConstructEntry(y)});let g=(await Promise.all(u.map(w=>{let y=h[w];return y?l[w].readdir(y):[]}))).map(w=>(w===null?[]:w)[Symbol.iterator]());return{entries:h,children:bN(g)}},d=async h=>{let{entries:p,children:g}=await f(h),w=p.find(b=>b&&b._fullpath)._fullpath,y=await s(w,p);if(y!==null){let b=await o(d,g);return b=b.filter(S=>S!==void 0),a(y,b)}};return d(c)}async function Ng(t,e){let r=await t.readdir(e);r==null?await t.rm(e):r.length?await Promise.all(r.map(i=>{let n=H(e,i);return t.lstat(n).then(s=>{if(s)return s.isDirectory()?Ng(t,n):t.rm(n)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}function _N(t){return yN(t)&&kE(t.then)&&kE(t.catch)}function yN(t){return t&&typeof t=="object"}function kE(t){return typeof t=="function"}function AE(t){return _N((r=>{try{return r.readFile().catch(i=>i)}catch(i){return i}})(t))}var CE=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function TE(t,e){if(AE(e))for(let r of CE)t[`_${r}`]=e[r].bind(e);else for(let r of CE)t[`_${r}`]=fd(e[r].bind(e));AE(e)?(e.cp&&(t._cp=e.cp.bind(e)),e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=Ng.bind(null,t)):(e.cp&&(t._cp=fd(e.cp.bind(e))),e.rm?t._rm=fd(e.rm.bind(e)):e.rmdir.length>2?t._rm=fd(e.rmdir.bind(e)):t._rm=Ng.bind(null,t))}var te=class{constructor(e){if(typeof e._original_unwrapped_fs!="undefined")return e;let r=Object.getOwnPropertyDescriptor(e,"promises");r&&r.enumerable?TE(this,e.promises):TE(this,e),this._original_unwrapped_fs=e}async exists(e,r={}){try{return await this._stat(e),!0}catch(i){if(i.code==="ENOENT"||i.code==="ENOTDIR"||(i.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',i),i}}async read(e,r={}){try{let i=await this._readFile(e,r);if(r.autocrlf==="true")try{i=new TextDecoder("utf8",{fatal:!0}).decode(i),i=i.replace(/\r\n/g,` +`),i=new TextEncoder().encode(i)}catch(n){}return typeof i!="string"&&(i=E.from(i)),i}catch(i){return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i)}catch(n){await this.mkdir(va(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e)}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=va(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Sd),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let s=e+"/"+n;return(await this._stat(s)).isDirectory()?this.readdirDeep(s):s}))).reduce((n,s)=>n.concat(s),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return E.isBuffer(i)?i:E.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};function R(t,e){if(e===void 0)throw new Ir(t)}function xN(t){return t.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(t)}async function ie({fsp:t,dotgit:e}){R("fsp",t),R("dotgit",e);let r=await t._stat(e).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));return r.isDirectory()?e:r.isFile()?t._readFile(e,"utf8").then(i=>i.trimRight().substr(8)).then(i=>xN(i)?i:H(va(e),i)):e}async function _d(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}async function KE({fs:t,dir:e,gitdir:r=H(e,".git"),commit:i="HEAD",cache:n={}}){try{R("fs",t),R("dir",e),R("gitdir",r);let s=new te(t),a=[Xr({ref:i}),tl(),Ea()],o=[],l=await ie({fsp:s,dotgit:r});await dt.acquire({fs:s,gitdir:l,cache:n},async function(u){o=u.unmergedPaths});let c=await Ps({fs:s,cache:n,dir:e,gitdir:l,trees:a,map:async function(u,[f,d,h]){let p=!await _d(d,h),g=o.includes(u),w=!await _d(h,f);if(p||g)return f?{path:u,mode:await f.mode(),oid:await f.oid(),type:await f.type(),content:await f.content()}:void 0;if(w)return!1;throw new su(u)}});await dt.acquire({fs:s,gitdir:l,cache:n},async function(u){for(let f of c)if(f!==!1){if(!f){await s.rmdir(`${e}/${f.path}`,{recursive:!0}),u.delete({filepath:f.path});continue}if(f.type==="blob"){let d=new TextDecoder().decode(f.content);await s.write(`${e}/${f.path}`,d,{mode:f.mode}),u.insert({filepath:f.path,oid:f.oid,stage:0})}}})}catch(s){throw s.caller="git.abortMerge",s}}var Rs=class{static async isIgnored({fs:e,dir:r,gitdir:i=H(r,".git"),filepath:n}){if(md(n)===".git")return!0;if(n===".")return!1;let s="",a=H(i,"info","exclude");await e.exists(a)&&(s=await e.read(a,"utf8"));let o=[{gitignore:H(r,".gitignore"),filepath:n}],l=n.split("/").filter(Boolean);for(let u=1;u{let f=await(await ht.get({fs:o,gitdir:l})).get("core.autocrlf");return Bg({dir:e,gitdir:l,fs:o,filepath:i,index:c,force:s,parallel:a,autocrlf:f})})}catch(o){throw o.caller="git.add",o}}async function Bg({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:s,parallel:a,autocrlf:o}){i=Array.isArray(i)?i:[i];let l=i.map(async d=>{if(!s&&await Rs.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let h=await r.lstat(H(t,d));if(!h)throw new Ge(d);if(h.isDirectory()){let p=await r.readdir(H(t,d));if(a){let g=p.map(w=>Bg({dir:t,gitdir:e,fs:r,filepath:[H(d,w)],index:n,force:s,parallel:a,autocrlf:o}));await Promise.all(g)}else for(let g of p)await Bg({dir:t,gitdir:e,fs:r,filepath:[H(d,g)],index:n,force:s,parallel:a,autocrlf:o})}else{let p=h.isSymbolicLink()?await r.readlink(H(t,d)).then(QE):await r.read(H(t,d),{autocrlf:o});if(p===null)throw new Ge(d);let g=await Or({fs:r,gitdir:e,type:"blob",object:p});n.insert({filepath:d,stats:h,oid:g})}}),c=await Promise.allSettled(l),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new tu(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}async function ou({fs:t,gitdir:e,path:r}){return(await ht.get({fs:t,gitdir:e})).get(r)}function eS(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}async function $s({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),s={name:await ou({fs:t,gitdir:e,path:"user.name"}),email:await ou({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},a=eS({},s,i?i.author:void 0,r);if(a.name!==void 0)return a}async function _a({fs:t,gitdir:e,author:r,committer:i,commit:n}){let s=Math.floor(Date.now()/1e3),a={name:await ou({fs:t,gitdir:e,path:"user.name"}),email:await ou({fs:t,gitdir:e,path:"user.email"})||"",timestamp:s,timezoneOffset:new Date(s*1e3).getTimezoneOffset()},o=eS({},a,n?n.committer:void 0,r,i);if(o.name!==void 0)return o}async function tS({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Qr.from(s).parse().object,tS({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new _r(i,n,"commit");return{commit:Dr.from(s),oid:i}}async function vn({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:s}=await tS({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,commit:n.parse(),payload:n.withoutSignature()}}async function cu({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h}){let p=!1,g=!1;f||(g=!(await t.read(`${i}/HEAD`,{encoding:"utf8"})).startsWith("ref:"),f=await q.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let w,y;try{w=await q.resolve({fs:t,gitdir:i,ref:f}),y=await vn({fs:t,gitdir:i,oid:w,cache:{}})}catch(C){p=!0}if(l&&p)throw new au(f);let b=l?await $s({fs:t,gitdir:i,author:s,commit:y.commit}):await $s({fs:t,gitdir:i,author:s});if(!b)throw new Xt("author");let S=l?await _a({fs:t,gitdir:i,author:b,committer:a,commit:y.commit}):await _a({fs:t,gitdir:i,author:b,committer:a});if(!S)throw new Xt("committer");return dt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(C){let k=jE(C.entries).get(".");if(h||(h=await rS({fs:t,gitdir:i,inode:k,dryRun:c})),d?d=await Promise.all(d.map(_=>q.resolve({fs:t,gitdir:i,ref:_}))):l?d=y.commit.parent:d=w?[w]:[],!n)if(l)n=y.commit.message;else throw new Ir("message");let v=Dr.from({tree:h,parent:d,author:b,committer:S,message:n});o&&(v=await Dr.sign(v,r,o));let x=await Or({fs:t,gitdir:i,type:"commit",object:v.toObject(),dryRun:c});return!u&&!c&&await q.writeRef({fs:t,gitdir:i,ref:g?"HEAD":f,value:x}),x})}async function rS({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let l of n)l.type==="tree"&&(l.metadata.mode="040000",l.metadata.oid=await rS({fs:t,gitdir:e,inode:l,dryRun:i}));let s=n.map(l=>({mode:l.metadata.mode,path:l.basename,oid:l.metadata.oid,type:l.type})),a=Mr.from(s);return await Or({fs:t,gitdir:e,type:"tree",object:a.toObject(),dryRun:i})}async function uu({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Ts("leading-slash");if(n.endsWith("/"))throw new Ts("trailing-slash");let s=i,a=await Xo({fs:t,cache:e,gitdir:r,oid:i}),o=a.tree;if(n==="")i=a.oid;else{let l=n.split("/");i=await iS({fs:t,cache:e,gitdir:r,tree:o,pathArray:l,oid:s,filepath:n})}return i}async function iS({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a}){let o=n.shift();for(let l of i)if(l.path===o){if(n.length===0)return l.oid;{let{type:c,object:u}=await et({fs:t,cache:e,gitdir:r,oid:l.oid});if(c!=="tree")throw new _r(s,c,"tree",a);return i=Mr.from(u),iS({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:s,filepath:a})}}throw new Ge(`file or directory found at "${s}:${a}"`)}async function rl({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await uu({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:s,oid:a}=await Xo({fs:t,cache:e,gitdir:r,oid:i});return{oid:a,tree:s.entries()}}async function fu({fs:t,gitdir:e,tree:r}){let i=Mr.from(r).toObject();return await Or({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}async function AN({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:s,note:a,force:o,author:l,committer:c,signingKey:u}){let f;try{f=await q.resolve({gitdir:i,fs:t,ref:n})}catch(y){if(!(y instanceof Ge))throw y}let h=(await rl({fs:t,cache:e,gitdir:i,oid:f||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(o)h=h.filter(y=>y.path!==s);else for(let y of h)if(y.path===s)throw new Ui("note",s);typeof a=="string"&&(a=E.from(a,"utf8"));let p=await Or({fs:t,gitdir:i,type:"blob",object:a,format:"content"});h.push({mode:"100644",path:s,oid:p,type:"blob"});let g=await fu({fs:t,gitdir:i,tree:h});return await cu({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:g,parent:f&&[f],message:`Note added by 'isomorphic-git addNote' +`,author:l,committer:c,signingKey:u})}async function nS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n="refs/notes/commits",oid:s,note:a,force:o,author:l,committer:c,signingKey:u,cache:f={}}){try{R("fs",t),R("gitdir",i),R("oid",s),R("note",a),u&&R("onSign",e);let d=new te(t),h=await $s({fs:d,gitdir:i,author:l});if(!h)throw new Xt("author");let p=await _a({fs:d,gitdir:i,author:h,committer:c});if(!p)throw new Xt("committer");let g=await ie({fsp:d,dotgit:i});return await AN({fs:d,cache:f,onSign:e,gitdir:g,ref:n,oid:s,note:a,force:o,author:h,committer:p,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}var CN=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function lu(t,e){if(typeof t!="string")throw new TypeError("Reference name must be a string");return!CN.test(t)&&(!!e||t.includes("/"))}async function sS({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let s=await ht.get({fs:t,gitdir:e});if(!n&&(await s.getSubsections("remote")).includes(r)&&i!==await s.get(`remote.${r}.url`))throw new Ui("remote",r);await s.set(`remote.${r}.url`,i),await s.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await ht.save({fs:t,gitdir:e,config:s})}async function aS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i,url:n,force:s=!1}){try{R("fs",t),R("gitdir",r),R("remote",i),R("url",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await sS({fs:a,gitdir:o,remote:i,url:n,force:s})}catch(a){throw a.caller="git.addRemote",a}}async function TN({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await q.exists({fs:t,gitdir:i,ref:n}))throw new Ui("tag",n);let f=await q.resolve({fs:t,gitdir:i,ref:l||"HEAD"}),{type:d}=await et({fs:t,cache:e,gitdir:i,oid:f}),h=Qr.from({object:f,type:d,tag:n.replace("refs/tags/",""),tagger:s,message:a,gpgsig:o});c&&(h=await Qr.sign(h,r,c));let p=await Or({fs:t,gitdir:i,type:"tag",object:h.toObject()});await q.writeRef({fs:t,gitdir:i,ref:n,value:p})}async function oS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n,tagger:s,message:a=n,gpgsig:o,object:l,signingKey:c,force:u=!1,cache:f={}}){try{R("fs",t),R("gitdir",i),R("ref",n),c&&R("onSign",e);let d=new te(t),h=await ie({fsp:d,dotgit:i}),p=await $s({fs:d,gitdir:h,author:s});if(!p)throw new Xt("tagger");return await TN({fs:d,cache:f,onSign:e,gitdir:h,ref:n,tagger:p,message:a,gpgsig:o,object:l,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}async function PN({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:s=!1}){if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let a=`refs/heads/${r}`;if(!s&&await q.exists({fs:t,gitdir:e,ref:a}))throw new Ui("branch",r,!1);let o;try{o=await q.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch(l){}o&&await q.writeRef({fs:t,gitdir:e,ref:a,value:o}),n&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function lS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,object:n,checkout:s=!1,force:a=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let o=new te(t),l=await ie({fsp:o,dotgit:r});return await PN({fs:o,gitdir:l,ref:i,object:n,checkout:s,force:a})}catch(o){throw o.caller="git.branch",o}}var cS=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);async function jg({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:s,remote:a,ref:o,filepaths:l,noCheckout:c,noUpdateHead:u,dryRun:f,force:d,track:h=!0,nonBlocking:p=!1,batchSize:g=100}){let w;if(i)try{w=await q.resolve({fs:t,gitdir:s,ref:"HEAD"})}catch(b){w="0000000000000000000000000000000000000000"}let y;try{y=await q.resolve({fs:t,gitdir:s,ref:o})}catch(b){if(o==="HEAD")throw b;let S=`${a}/${o}`;if(y=await q.resolve({fs:t,gitdir:s,ref:S}),h){let C=await ht.get({fs:t,gitdir:s});await C.set(`branch.${o}.remote`,a),await C.set(`branch.${o}.merge`,`refs/heads/${o}`),await ht.save({fs:t,gitdir:s,config:C})}await q.writeRef({fs:t,gitdir:s,ref:`refs/heads/${o}`,value:y})}if(!c){let b;try{b=await RN({fs:t,cache:e,onProgress:r,dir:n,gitdir:s,ref:o,force:d,filepaths:l})}catch(v){throw v instanceof Ge&&v.data.what===y?new Kc(o,y):v}let S=b.filter(([v])=>v==="conflict").map(([v,x])=>x);if(S.length>0)throw new qc(S);let C=b.filter(([v])=>v==="error").map(([v,x])=>x);if(C.length>0)throw new me(C.join(", "));if(f){i&&await i({previousHead:w,newHead:y,type:l!=null&&l.length>0?"file":"branch"});return}let A=0,k=b.length;if(await dt.acquire({fs:t,gitdir:s,cache:e},async function(v){await Promise.all(b.filter(([x])=>x==="delete"||x==="delete-index").map(async function([x,_]){let P=`${n}/${_}`;x==="delete"&&await t.rm(P),v.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}))}),await dt.acquire({fs:t,gitdir:s,cache:e},async function(v){for(let[x,_]of b)if(x==="rmdir"||x==="rmdir-index"){let P=`${n}/${_}`;try{x==="rmdir"&&await t.rmdir(P),v.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}catch(T){if(T.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw T}}}),await Promise.all(b.filter(([v])=>v==="mkdir"||v==="mkdir-index").map(async function([v,x]){let _=`${n}/${x}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++A,total:k})})),p){let v=b.filter(([_])=>_==="create"||_==="create-index"||_==="update"||_==="mkdir-index"),x=await PE("Update Working Dir",v.map(([_,P,T,M,$])=>()=>FN({fs:t,cache:e,gitdir:s,dir:n},[_,P,T,M,$])),r,g);await dt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(_){await PE("Update Index",x.map(([P,T,M])=>()=>$N({index:_,fullpath:P,oid:T,stats:M})),r,g)})}else await dt.acquire({fs:t,gitdir:s,cache:e,allowUnmerged:!0},async function(v){await Promise.all(b.filter(([x])=>x==="create"||x==="create-index"||x==="update"||x==="mkdir-index").map(async function([x,_,P,T,M]){let $=`${n}/${_}`;try{if(x!=="create-index"&&x!=="mkdir-index"){let{object:Q}=await et({fs:t,cache:e,gitdir:s,oid:P});if(M&&await t.rm($),T===33188)await t.write($,Q);else if(T===33261)await t.write($,Q,{mode:511});else if(T===40960)await t.writelink($,Q);else throw new me(`Invalid mode 0o${T.toString(8)} detected in blob ${P}`)}let D=await t.lstat($);T===33261&&(D.mode=493),x==="mkdir-index"&&(D.mode=57344),v.insert({filepath:_,stats:D,oid:P}),r&&await r({phase:"Updating workdir",loaded:++A,total:k})}catch(D){console.log(D)}}))});i&&await i({previousHead:w,newHead:y,type:l!=null&&l.length>0?"file":"branch"})}if(!u){let b=await q.expand({fs:t,gitdir:s,ref:o});b.startsWith("refs/heads")?await q.writeSymbolicRef({fs:t,gitdir:s,ref:"HEAD",value:b}):await q.writeRef({fs:t,gitdir:s,ref:"HEAD",value:y})}}async function RN({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:s,force:a,filepaths:o}){let l=0;return Ps({fs:t,cache:e,dir:i,gitdir:n,trees:[Xr({ref:s}),tl(),Ea()],map:async function(c,[u,f,d]){if(c===".")return;if(o&&!o.some(p=>cS(c,p)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++l}),[!!d,!!u,!!f].map(Number).join("")){case"000":return;case"001":return a&&o&&o.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await f.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await f.oid()?a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]:await u.mode()!==await f.mode()?a?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await f.oid()?a?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!a)return;if(f){if(await f.oid()!==await d.oid()&&await f.oid()!==await u.oid())return a?["update",c,await u.oid(),await u.mode(),await u.mode()!==await f.mode()]:["conflict",c]}else if(a)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},reduce:async function(c,u){return u=ZE(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u}})}async function $N({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}async function FN({fs:t,cache:e,gitdir:r,dir:i},[n,s,a,o,l]){let c=`${i}/${s}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:f}=await et({fs:t,cache:e,gitdir:r,oid:a});if(l&&await t.rm(c),o===33188)await t.write(c,f);else if(o===33261)await t.write(c,f,{mode:511});else if(o===40960)await t.writelink(c,f);else throw new me(`Invalid mode 0o${o.toString(8)} detected in blob ${a}`)}let u=await t.lstat(c);return o===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[s,a,u]}async function PE(t,e,r,i){let n=[];try{for(let s=0;sl());(await Promise.allSettled(a)).forEach(l=>{l.status==="fulfilled"&&n.push(l.value)}),r&&await r({phase:"Updating workdir",loaded:s+a.length,total:e.length})}return n}catch(s){console.error(`Error during ${t}: ${s}`)}return n}async function Vg({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=H(i,".git"),remote:s="origin",ref:a,filepaths:o,noCheckout:l=!1,noUpdateHead:c=a===void 0,dryRun:u=!1,force:f=!1,track:d=!0,cache:h={},nonBlocking:p=!1,batchSize:g=100}){try{R("fs",t),R("dir",i),R("gitdir",n);let w=a||"HEAD",y=new te(t),b=await ie({fsp:y,dotgit:n});return await jg({fs:y,cache:h,onProgress:e,onPostCheckout:r,dir:i,gitdir:b,remote:s,ref:w,filepaths:o,noCheckout:l,noUpdateHead:c,dryRun:u,force:f,track:d,nonBlocking:p,batchSize:g})}catch(w){throw w.caller="git.checkout",w}}var Sg=/^.*(\r?\n|$)/gm;function IN({branches:t,contents:e}){let r=t[1],i=t[2],n=e[0],s=e[1],a=e[2],o=s.match(Sg),l=n.match(Sg),c=a.match(Sg),u=AL(o,l,c),f=7,d="",h=!0;for(let p of u)p.ok&&(d+=p.ok.join("")),p.conflict&&(h=!1,d+=`${"<".repeat(f)} ${r} +`,d+=p.conflict.a.join(""),d+=`${"=".repeat(f)} +`,d+=p.conflict.b.join(""),d+=`${">".repeat(f)} ${i} +`);return{cleanMerge:h,mergedText:d}}async function uS({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),index:n,ourOid:s,baseOid:a,theirOid:o,ourName:l="ours",baseName:c="base",theirName:u="theirs",dryRun:f=!1,abortOnConflict:d=!0,mergeDriver:h}){let p=Xr({ref:s}),g=Xr({ref:a}),w=Xr({ref:o}),y=[],b=[],S=[],C=[],A=await Ps({fs:t,cache:e,dir:r,gitdir:i,trees:[p,g,w],map:async function(k,[v,x,_]){let P=md(k),T=await _d(v,x),M=await _d(_,x);switch(`${T}-${M}`){case"false-false":return{mode:await x.mode(),path:P,oid:await x.oid(),type:await x.type()};case"false-true":return!_&&await v.type()==="tree"?{mode:await v.mode(),path:P,oid:await v.oid(),type:await v.type()}:_?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!v&&await _.type()==="tree"?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:v?{mode:await v.mode(),path:P,oid:await v.oid(),type:await v.type()}:void 0;case"true-true":{if(v&&_&&await v.type()==="tree"&&await _.type()==="tree")return{mode:await v.mode(),path:P,oid:await v.oid(),type:"tree"};if(v&&_&&await v.type()==="blob"&&await _.type()==="blob")return MN({fs:t,gitdir:i,path:P,ours:v,base:x,theirs:_,ourName:l,baseName:c,theirName:u,mergeDriver:h}).then(async $=>{if($.cleanMerge)d||n.insert({filepath:k,oid:$.mergeResult.oid,stage:0});else if(y.push(k),b.push(k),!d){let D="";x&&await x.type()==="blob"&&(D=await x.oid());let Q=await v.oid(),ye=await _.oid();n.delete({filepath:k}),D&&n.insert({filepath:k,oid:D,stage:1}),n.insert({filepath:k,oid:Q,stage:2}),n.insert({filepath:k,oid:ye,stage:3})}return $.mergeResult});if(x&&!v&&_&&await x.type()==="blob"&&await _.type()==="blob"){if(y.push(k),S.push(k),!d){let $=await x.oid(),D=await _.oid();n.delete({filepath:k}),n.insert({filepath:k,oid:$,stage:1}),n.insert({filepath:k,oid:D,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:P}}if(x&&v&&!_&&await x.type()==="blob"&&await v.type()==="blob"){if(y.push(k),C.push(k),!d){let $=await x.oid(),D=await v.oid();n.delete({filepath:k}),n.insert({filepath:k,oid:$,stage:1}),n.insert({filepath:k,oid:D,stage:2})}return{mode:await v.mode(),oid:await v.oid(),type:"blob",path:P}}if(x&&!v&&!_&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new Yo}}},reduce:y.length!==0&&(!r||d)?void 0:async(k,v)=>{let x=v.filter(Boolean);if(k&&!(k&&k.type==="tree"&&x.length===0&&k.path!==".")){if(x.length>0||k.path==="."&&x.length===0){let P=new Mr(x).toObject(),T=await Or({fs:t,gitdir:i,type:"tree",object:P,dryRun:f});k.oid=T}return k}}});return y.length!==0?(r&&!d&&await Ps({fs:t,cache:e,dir:r,gitdir:i,trees:[Xr({ref:A.oid})],map:async function(k,[v]){let x=`${r}/${k}`;if(await v.type()==="blob"){let _=await v.mode(),P=new TextDecoder().decode(await v.content());await t.write(x,P,{mode:_})}return!0}}),new wa(y,b,S,C)):A.oid}async function MN({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:s,ourName:a,theirName:o,baseName:l,dryRun:c,mergeDriver:u=IN}){let f="blob",d="100755",h="",p="";n&&await n.type()==="blob"&&(d=await n.mode(),h=await n.oid(),p=E.from(await n.content()).toString("utf8"));let g=d===await i.mode()?await s.mode():await i.mode();if(await i.oid()===await s.oid())return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};if(await i.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await s.oid(),type:f}};if(await s.oid()===h)return{cleanMerge:!0,mergeResult:{mode:g,path:r,oid:await i.oid(),type:f}};let w=E.from(await i.content()).toString("utf8"),y=E.from(await s.content()).toString("utf8"),{mergedText:b,cleanMerge:S}=await u({branches:[l,a,o],contents:[p,w,y],path:r}),C=await Or({fs:t,gitdir:e,type:"blob",object:E.from(b,"utf8"),dryRun:c});return{cleanMerge:S,mergeResult:{mode:g,path:r,oid:C,type:f}}}var DN={stage:Ea,workdir:tl},kg;async function Qo(t,e){return kg===void 0&&(kg=new Uc),kg.acquire(t,e)}async function ON(t,e,r,i,n=null){let s=H(r,i),a=await t.lstat(s);if(!a)throw new Ge(s);if(a.isDirectory())throw new me(`${s}: file expected, but found directory`);let o=n?await zE({fs:t,gitdir:e,oid:n}):void 0,l=o?n:void 0;return o||await Qo({fs:t,gitdir:e,currentFilepath:s},async()=>{let c=a.isSymbolicLink()?await t.readlink(s).then(QE):await t.read(s);if(c===null)throw new Ge(s);l=await Or({fs:t,gitdir:e,type:"blob",object:c})}),l}async function LN({fs:t,dir:e,gitdir:r,entries:i}){async function n(s){if(s.type==="tree"){if(!s.oid){let a=await Promise.all(s.children.map(n));s.oid=await fu({fs:t,gitdir:r,tree:a}),s.mode=16384}}else s.type==="blob"&&(s.oid=await ON(t,r,e,s.path,s.oid),s.mode=33188);return s.path=s.path.split("/").pop(),s}return Promise.all(i.map(n))}async function RE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",s=i.map(h=>typeof h=="string"?DN[h]():h),a=[],u=await Ps({fs:t,cache:{},dir:e,gitdir:r,trees:s,map:async(h,[p,g])=>{if(!(h==="."||await Rs.isIgnored({fs:t,dir:e,gitdir:r,filepath:h}))&&g)return(!p||await p.oid()!==await g.oid()&&await g.oid()!==void 0)&&a.push([p,g]),{mode:await g.mode(),path:h,oid:await g.oid(),type:await g.type()}},reduce:async(h,p)=>(p=p.filter(Boolean),h?(h.children=p,h):p.length>0?p:void 0),iterate:async(h,p)=>{let g=[];for(let w of p){let[y,b]=w;n?b&&(await t.exists(`${e}/${b.toString()}`)?g.push(w):a.push([null,b])):y&&(b?g.push(w):a.push([y,null]))}return g.length?Promise.all(g.map(h)):[]}});if(a.length===0||u.length===0)return null;let d=(await LN({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(h=>({mode:h.mode,path:h.path,oid:h.oid,type:h.type}));return fu({fs:t,gitdir:r,tree:d})}async function fS({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:s}){let a=[],o=[],l=await Ps({fs:t,cache:{},dir:e,gitdir:r,trees:[Xr({ref:n}),Xr({ref:i})],map:async(c,[u,f])=>{if(c==="."||await Rs.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=f?await f.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!f&&u){let p=d==="tree"?"rmdir":"rm";return d==="tree"&&a.push(c),d==="blob"&&s&&o.push({filepath:c,oid:await u.oid()}),{method:p,filepath:c}}let h=await f.oid();if(!u||await u.oid()!==h)return d==="tree"?{method:"mkdir",filepath:c}:(s&&o.push({filepath:c,oid:h,stats:await t.lstat(H(e,c))}),{method:"write",filepath:c,oid:h})}});await Qo({fs:t,gitdir:r,dirRemoved:a,ops:l},async()=>{for(let c of l){let u=H(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!a.some(f=>u.startsWith(f))){let{object:f}=await et({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,f)}break}}}),await dt.acquire({fs:t,gitdir:r,cache:{}},async c=>{o.forEach(({filepath:u,stats:f,oid:d})=>{c.insert({filepath:u,stats:f,oid:d})})})}async function $E({fs:t,cache:e,dir:r,gitdir:i,oid:n,dryRun:s=!1,noUpdateBranch:a=!1,abortOnConflict:o=!0,committer:l,mergeDriver:c}){let{commit:u,oid:f}=await vn({fs:t,cache:e,gitdir:i,oid:n});if(u.parent.length>1)throw new Yc(f,u.parent.length);if(u.parent.length===0)throw new Zc(f);let d=await q.resolve({fs:t,gitdir:i,ref:"HEAD"}),{commit:h}=await vn({fs:t,cache:e,gitdir:i,oid:d}),p=u.parent[0],{commit:g}=await vn({fs:t,cache:e,gitdir:i,oid:p}),w=await dt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async b=>uS({fs:t,cache:e,dir:r,gitdir:i,index:b,ourOid:h.tree,baseOid:g.tree,theirOid:u.tree,ourName:"HEAD",baseName:`parent of ${f.slice(0,7)}`,theirName:f.slice(0,7),dryRun:s,abortOnConflict:o,mergeDriver:c}));if(w instanceof wa)throw w;let y=await cu({fs:t,cache:e,gitdir:i,message:u.message,tree:w,parent:[d],author:u.author,committer:l,dryRun:s,noUpdateBranch:a});return r&&!s&&!a&&await fS({fs:t,dir:r,gitdir:i,stashCommit:y,parentCommit:d,wasStaged:!0}),y}async function dS({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={},committer:s,dryRun:a=!1,noUpdateBranch:o=!1,abortOnConflict:l=!0,mergeDriver:c}){try{R("fs",t),R("gitdir",r),R("oid",i);let u=new te(t),f=await ie({fsp:u,dotgit:r}),{commit:d}=await vn({fs:u,cache:n,gitdir:f,oid:i});if(d.parent&&d.parent.length>1)return await $E({fs:u,cache:n,dir:e,gitdir:f,oid:i,dryRun:a,noUpdateBranch:o,abortOnConflict:l,committer:void 0,mergeDriver:c});let h=await _a({fs:u,gitdir:f,committer:s});if(!h)throw new Xt("committer");return await $E({fs:u,cache:n,dir:e,gitdir:f,oid:i,dryRun:a,noUpdateBranch:o,abortOnConflict:l,committer:h,mergeDriver:c})}catch(u){throw u.caller="git.cherryPick",u}}var NN=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function ga(t){let e=NN.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}async function Is({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await q.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await q.resolve({fs:t,gitdir:e,ref:n})}catch(s){return}if(n.startsWith("refs/"))return r?n:ga(n)}function BN(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}function hS({username:t="",password:e=""}){return`Basic ${E.from(`${t}:${e}`).toString("base64")}`}async function du(t,e){let r=WE(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}async function yd(t){let e=0,r=[];await du(t,s=>{r.push(s),e+=s.byteLength});let i=new Uint8Array(e),n=0;for(let s of r)i.set(s,n),n+=s.byteLength;return i}function FE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}function Hg(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}var lt=class{static flush(){return E.from("0000","utf8")}static delim(){return E.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=E.from(e));let r=e.length+4,i=Hg(4,r);return E.concat([E.from(i,"utf8"),e])}static streamReader(e){let r=new wd(e);return async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let s=await r.read(n-4);return s==null?!0:s}catch(n){return e.error=n,!0}}}};async function IE(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),s=r.slice(i+1);e[n]=s}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}async function ME(t,{service:e}){let r=new Set,i=new Map,n=new Map,s=lt.streamReader(t),a=await s();for(;a===null;)a=await s();if(a===!0)throw new Xc;if(a.includes("version 2"))return IE(s);if(a.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new ba(`# service=${e}\\n`,a.toString("utf8"));let o=await s();for(;o===null;)o=await s();if(o===!0)return{capabilities:r,refs:i,symrefs:n};if(o=o.toString("utf8"),o.includes("version 2"))return IE(s);let[l,c]=Ag(o,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),l!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,f]=Ag(l," "," ");for(i.set(f,u);;){let d=await s();if(d===!0)break;if(d!==null){let[h,p]=Ag(d.toString("utf8")," "," ");i.set(p,h)}}}for(let u of r)if(u.startsWith("symref=")){let f=u.match(/symref=([^:]+):(.*)/);f.length===3&&n.set(f[1],f[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}function Ag(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new ba(`Two strings separated by '${r}'`,t.toString("utf8"));return i}var DE=(t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,OE=(t,e)=>{(e.username||e.password)&&(t.Authorization=hS(e)),e.headers&&Object.assign(t,e.headers)},Cg=async t=>{try{let e=E.from(await yd(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch(e){return{}}},Jo=class{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:s,corsProxy:a,service:o,url:l,headers:c,protocolVersion:u}){let{url:f,auth:d}=FE(l),h=a?DE(a,f):f;(d.username||d.password)&&(c.Authorization=hS(d)),u===2&&(c["Git-Protocol"]="version=2");let p,g,w=!1;do if(p=await e.request({onProgress:r,method:"GET",url:`${h}/info/refs?service=${o}`,headers:c}),g=!1,p.statusCode===401||p.statusCode===203){let y=w?s:i;if(y){if(d=await y(f,{...d,headers:{...c}}),d&&d.cancel)throw new Ko;d&&(OE(c,d),w=!0,g=!0)}}else p.statusCode===200&&w&&n&&await n(f,d);while(g);if(p.statusCode!==200){let{response:y}=await Cg(p);throw new qo(p.statusCode,p.statusMessage,y)}if(p.headers["content-type"]===`application/x-${o}-advertisement`){let y=await ME(p.body,{service:o});return y.auth=d,y}else{let{preview:y,response:b,data:S}=await Cg(p);try{let C=await ME([S],{service:o});return C.auth=d,C}catch(C){throw new ru(y,b)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:s,auth:a,body:o,headers:l}){let c=FE(s);c&&(s=c.url),i&&(s=DE(i,s)),l["content-type"]=`application/x-${n}-request`,l.accept=`application/x-${n}-result`,OE(l,a);let u=await e.request({onProgress:r,method:"POST",url:`${s}/${n}`,body:o,headers:l});if(u.statusCode!==200){let{response:f}=Cg(u);throw new qo(u.statusCode,u.statusMessage,f)}return u}},el=class{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",Jo),r.set("https",Jo);let i=HN({url:e});if(!i)throw new nu(e);if(r.has(i.transport))return r.get(i.transport);throw new iu(e,i.transport,i.transport==="ssh"?BN(e):void 0)}};function HN({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}var ma=null,ya=class{static async read({fs:e,gitdir:r}){ma===null&&(ma=new Uc);let i=H(r,"shallow"),n=new Set;return await ma.acquire(i,async function(){let s=await e.read(i,{encoding:"utf8"});if(s===null||s.trim()==="")return n;s.trim().split(` +`).map(a=>n.add(a))}),n}static async write({fs:e,gitdir:r,oids:i}){ma===null&&(ma=new Uc);let n=H(r,"shallow");if(i.size>0){let s=[...i].join(` +`)+` +`;await ma.acquire(n,async function(){await e.write(n,s,{encoding:"utf8"})})}else await ma.acquire(n,async function(){await e.rm(n)})}};async function UN({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}async function GN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=await t.readdir(H(r,"objects/pack"));s=s.filter(a=>a.endsWith(".idx"));for(let a of s){let o=`${r}/objects/pack/${a}`,l=await Gg({fs:t,cache:e,filename:o,getExternalRefDelta:n});if(l.error)throw new me(l.error);if(l.offsets.has(i))return!0}return!1}async function LE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let s=o=>et({fs:t,cache:e,gitdir:r,oid:o}),a=await UN({fs:t,gitdir:r,oid:i});return a||(a=await GN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:s})),a}function jN(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}function pS(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}var Ad={name:"isomorphic-git",version:"1.37.4",agent:"git/isomorphic-git@1.37.4"},Vo=class{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};function VN(t){let e=t.indexOf("\r"),r=t.indexOf(` +`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}function mS(t){let e=new Vo,r="";return(async()=>(await du(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=VN(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}var xd=class{static demux(e){let r=lt.streamReader(e),i=new Vo,n=new Vo,s=new Vo,a=async function(){let o=await r();if(o===null)return a();if(o===!0){i.end(),s.end(),e.error?n.destroy(e.error):n.end();return}switch(o[0]){case 1:{n.write(o.slice(1));break}case 2:{s.write(o.slice(1));break}case 3:{let l=o.slice(1);s.write(l),i.end(),s.end(),n.destroy(new Error(l.toString("utf8")));return}default:i.write(o)}a()};return a(),{packetlines:i,packfile:n,progress:s}}};async function zN(t){let{packetlines:e,packfile:r,progress:i}=xd.demux(t),n=[],s=[],a=[],o=!1,l=!1;return new Promise((c,u)=>{du(e,f=>{let d=f.toString("utf8").trim();if(d.startsWith("shallow")){let h=d.slice(-41).trim();h.length!==40&&u(new As(h)),n.push(h)}else if(d.startsWith("unshallow")){let h=d.slice(-41).trim();h.length!==40&&u(new As(h)),s.push(h)}else if(d.startsWith("ACK")){let[,h,p]=d.split(" ");a.push({oid:h,status:p}),p||(l=!0)}else d.startsWith("NAK")?(o=!0,l=!0):(l=!0,o=!0);l&&(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))}).finally(()=>{l||(t.error?u(t.error):c({shallows:n,unshallows:s,acks:a,nak:o,packfile:r,progress:i}))})})}function WN({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:s=null,exclude:a=[]}){let o=[];e=[...new Set(e)];let l=` ${t.join(" ")}`;for(let c of e)o.push(lt.encode(`want ${c}${l} +`)),l="";for(let c of i)o.push(lt.encode(`shallow ${c} +`));n!==null&&o.push(lt.encode(`deepen ${n} +`)),s!==null&&o.push(lt.encode(`deepen-since ${Math.floor(s.valueOf()/1e3)} +`));for(let c of a)o.push(lt.encode(`deepen-not ${c} +`));o.push(lt.flush());for(let c of r)o.push(lt.encode(`have ${c} +`));return o.push(lt.encode(`done +`)),o}async function zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:l,ref:c,remoteRef:u,remote:f,url:d,corsProxy:h,depth:p=null,since:g=null,exclude:w=[],relative:y=!1,tags:b=!1,singleBranch:S=!1,headers:C={},prune:A=!1,pruneTags:k=!1}){let v=c||await Is({fs:t,gitdir:l,test:!0}),x=await ht.get({fs:t,gitdir:l}),_=f||v&&await x.get(`branch.${v}.remote`)||"origin",P=d||await x.get(`remote.${_}.url`);if(typeof P=="undefined")throw new Ir("remote OR url");let T=u||v&&await x.get(`branch.${v}.merge`)||c||"HEAD";h===void 0&&(h=await x.get("http.corsProxy"));let M=el.getRemoteHelperFor({url:P}),$=await M.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:h,service:"git-upload-pack",url:P,headers:C,protocolVersion:1}),D=$.auth,Q=$.refs;if(Q.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(p!==null&&!$.capabilities.has("shallow"))throw new ks("shallow","depth");if(g!==null&&!$.capabilities.has("deepen-since"))throw new ks("deepen-since","since");if(w.length>0&&!$.capabilities.has("deepen-not"))throw new ks("deepen-not","exclude");if(y===!0&&!$.capabilities.has("deepen-relative"))throw new ks("deepen-relative","relative");let{oid:ye,fullref:de}=q.resolveAgainstMap({ref:T,map:Q});for(let B of Q.keys())B===de||B==="HEAD"||B.startsWith("refs/heads/")||b&&B.startsWith("refs/tags/")||Q.delete(B);let J=pS([...$.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${Ad.agent}`]);y&&J.push("deepen-relative");let X=S?[ye]:Q.values(),he=S?[v]:await q.listRefs({fs:t,gitdir:l,filepath:"refs"}),z=[];for(let B of he)try{B=await q.expand({fs:t,gitdir:l,ref:B});let N=await q.resolve({fs:t,gitdir:l,ref:B});await LE({fs:t,cache:e,gitdir:l,oid:N})&&z.push(N)}catch(N){}z=[...new Set(z)];let K=await ya.read({fs:t,gitdir:l}),G=$.capabilities.has("shallow")?[...K]:[],Me=WN({capabilities:J,wants:X,haves:z,shallows:G,depth:p,since:g,exclude:w}),Et=E.from(await yd(Me)),Ht=await M.connect({http:r,onProgress:i,corsProxy:h,service:"git-upload-pack",url:P,auth:D,body:[Et],headers:C}),De=await zN(Ht.body);Ht.headers&&(De.headers=Ht.headers);for(let B of De.shallows)if(!K.has(B))try{let{object:N}=await et({fs:t,cache:e,gitdir:l,oid:B}),ue=new Dr(N),Re=await Promise.all(ue.headers().parent.map(Pr=>LE({fs:t,cache:e,gitdir:l,oid:Pr})));Re.length===0||Re.every(Pr=>Pr)||K.add(B)}catch(N){K.add(B)}for(let B of De.unshallows)K.delete(B);if(await ya.write({fs:t,gitdir:l,oids:K}),S){let B=new Map([[de,ye]]),N=new Map,ue=10,Re=de;for(;ue--;){let vo=$.symrefs.get(Re);if(vo===void 0)break;N.set(Re,vo),Re=vo}let Ut=Q.get(Re);Ut&&B.set(Re,Ut);let{pruned:Pr}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:B,symrefs:N,tags:b,prune:A});A&&(De.pruned=Pr)}else{let{pruned:B}=await q.updateRemoteRefs({fs:t,gitdir:l,remote:_,refs:Q,symrefs:$.symrefs,tags:b,prune:A,pruneTags:k});A&&(De.pruned=B)}if(De.HEAD=$.symrefs.get("HEAD"),De.HEAD===void 0){let{oid:B}=q.resolveAgainstMap({ref:"HEAD",map:Q});for(let[N,ue]of Q.entries())if(N!=="HEAD"&&ue===B){De.HEAD=N;break}}let Rt=de.startsWith("refs/tags")?"tag":"branch";if(De.FETCH_HEAD={oid:ye,description:`${Rt} '${ga(de)}' of ${P}`},i||n){let B=mS(De.progress);du(B,async N=>{if(n&&await n(N),i){let ue=N.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);ue&&await i({phase:ue[1].trim(),loaded:parseInt(ue[2],10),total:parseInt(ue[3],10)})}})}let $t=E.from(await yd(De.packfile));if(Ht.body.error)throw Ht.body.error;let Xe=$t.slice(-20).toString("hex"),re={defaultBranch:De.HEAD,fetchHead:De.FETCH_HEAD.oid,fetchHeadDescription:De.FETCH_HEAD.description};if(De.headers&&(re.headers=De.headers),A&&(re.pruned=De.pruned),Xe!==""&&!jN($t)){re.packfile=`objects/pack/pack-${Xe}.pack`;let B=H(l,re.packfile);await t.write(B,$t);let N=Re=>et({fs:t,cache:e,gitdir:l,oid:Re}),ue=await zc.fromPack({pack:$t,getExternalRefDelta:N,onProgress:i});await t.write(B.replace(/\.pack$/,".idx"),await ue.toBuffer())}return re}async function gS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:H(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let s=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];s=s.map(a=>i+"/"+a);for(let a of s)await t.mkdir(a);await t.write(i+"/config",`[core] + repositoryformatversion = 0 + filemode = false + bare = ${e} +`+(e?"":` logallrefupdates = true +`)+` symlinks = false + ignorecase = true +`),await t.write(i+"/HEAD",`ref: refs/heads/${n} +`)}async function qN({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPostCheckout:l,dir:c,gitdir:u,url:f,corsProxy:d,ref:h,remote:p,depth:g,since:w,exclude:y,relative:b,singleBranch:S,noCheckout:C,noTags:A,headers:k,nonBlocking:v,batchSize:x=100}){try{if(await gS({fs:t,gitdir:u}),await sS({fs:t,gitdir:u,remote:p,url:f,force:!1}),d){let T=await ht.get({fs:t,gitdir:u});await T.set("http.corsProxy",d),await ht.save({fs:t,gitdir:u,config:T})}let{defaultBranch:_,fetchHead:P}=await zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:u,ref:h,remote:p,corsProxy:d,depth:g,since:w,exclude:y,relative:b,singleBranch:S,headers:k,tags:!A});if(P===null)return;h=h||_,h=h.replace("refs/heads/",""),await jg({fs:t,cache:e,onProgress:i,onPostCheckout:l,dir:c,gitdir:u,ref:h,remote:p,noCheckout:C,nonBlocking:v,batchSize:x})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}async function vS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:c=H(l,".git"),url:u,corsProxy:f=void 0,ref:d=void 0,remote:h="origin",depth:p=void 0,since:g=void 0,exclude:w=[],relative:y=!1,singleBranch:b=!1,noCheckout:S=!1,noTags:C=!1,headers:A={},cache:k={},nonBlocking:v=!1,batchSize:x=100}){try{R("fs",t),R("http",e),R("gitdir",c),S||R("dir",l),R("url",u);let _=new te(t),P=await ie({fsp:_,dotgit:c});return await qN({fs:_,cache:k,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPostCheckout:o,dir:l,gitdir:P,url:u,corsProxy:f,ref:d,remote:h,depth:p,since:g,exclude:w,relative:y,singleBranch:b,noCheckout:S,noTags:C,headers:A,nonBlocking:v,batchSize:x})}catch(_){throw _.caller="git.clone",_}}async function wS({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),message:n,author:s,committer:a,signingKey:o,amend:l=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:f,parent:d,tree:h,cache:p={}}){try{R("fs",t),l||R("message",n),o&&R("onSign",e);let g=new te(t),w=await ie({fsp:g,dotgit:i});return await cu({fs:g,cache:p,onSign:e,gitdir:w,message:n,author:s,committer:a,signingKey:o,amend:l,dryRun:c,noUpdateBranch:u,ref:f,parent:d,tree:h})}catch(g){throw g.caller="git.commit",g}}async function bS({fs:t,dir:e,gitdir:r=H(e,".git"),fullname:i=!1,test:n=!1}){try{R("fs",t),R("gitdir",r);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await Is({fs:s,gitdir:a,fullname:i,test:n})}catch(s){throw s.caller="git.currentBranch",s}}async function YN({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await q.exists({fs:t,gitdir:e,ref:r}))throw new Ge(r);let n=await q.expand({fs:t,gitdir:e,ref:r}),s=await Is({fs:t,gitdir:e,fullname:!0});if(n===s){let l=await q.resolve({fs:t,gitdir:e,ref:n});await q.writeRef({fs:t,gitdir:e,ref:"HEAD",value:l})}await q.deleteRef({fs:t,gitdir:e,ref:n});let a=ga(r),o=await ht.get({fs:t,gitdir:e});await o.deleteSection("branch",a),await ht.save({fs:t,gitdir:e,config:o})}async function _S({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await YN({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}async function yS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});await q.deleteRef({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}async function ZN({fs:t,gitdir:e,remote:r}){let i=await ht.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await ht.save({fs:t,gitdir:e,config:i})}async function xS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i}){try{R("fs",t),R("remote",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await ZN({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}async function KN({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await q.deleteRef({fs:t,gitdir:e,ref:r})}async function ES({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await KN({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}async function XN({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(s=>`${i}${s}`).filter(s=>s.startsWith(r))}async function QN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let s=[],a=await t.readdir(H(r,"objects/pack"));a=a.filter(o=>o.endsWith(".idx"));for(let o of a){let l=`${r}/objects/pack/${o}`,c=await Gg({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(c.error)throw new me(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&s.push(u)}return s}async function JN({fs:t,cache:e,gitdir:r,oid:i}){let n=o=>et({fs:t,cache:e,gitdir:r,oid:o}),s=await XN({fs:t,gitdir:r,oid:i}),a=await QN({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let o of a)s.indexOf(o)===-1&&s.push(o);if(s.length===1)return s[0];throw s.length>1?new Wc("oids",i,s):new Ge(`an object matching "${i}"`)}async function SS({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await JN({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.expandOid",s}}async function kS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i}){try{R("fs",t),R("gitdir",r),R("ref",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await q.expand({fs:n,gitdir:s,ref:i})}catch(n){throw n.caller="git.expandRef",n}}async function Wg({fs:t,cache:e,gitdir:r,oids:i}){let n={},s=i.length,a=i.map((o,l)=>({index:l,oid:o}));for(;a.length;){let o=new Set;for(let{oid:c,index:u}of a)n[c]||(n[c]=new Set),n[c].add(u),n[c].size===s&&o.add(c);if(o.size>0)return[...o];let l=new Map;for(let{oid:c,index:u}of a)try{let{object:f}=await et({fs:t,cache:e,gitdir:r,oid:c}),d=Dr.from(f),{parent:h}=d.parseHeaders();for(let p of h)(!n[p]||!n[p].has(u))&&l.set(p+":"+u,{oid:p,index:u})}catch(f){}a=Array.from(l.values())}return[]}async function AS({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,onSign:g,mergeDriver:w,allowUnrelatedHistories:y=!1}){n===void 0&&(n=await Is({fs:t,gitdir:i,fullname:!0})),n=await q.expand({fs:t,gitdir:i,ref:n}),s=await q.expand({fs:t,gitdir:i,ref:s});let b=await q.resolve({fs:t,gitdir:i,ref:n}),S=await q.resolve({fs:t,gitdir:i,ref:s}),C=await Wg({fs:t,cache:e,gitdir:i,oids:[b,S]});if(C.length!==1)if(C.length===0&&y)C.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new Yo;let A=C[0];if(A===S)return{oid:b,alreadyMerged:!0};if(a&&A===b)return!l&&!c&&await q.writeRef({fs:t,gitdir:i,ref:n,value:S}),{oid:S,fastForward:!0};{if(o)throw new Qc;let k=await dt.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async x=>uS({fs:t,cache:e,dir:r,gitdir:i,index:x,ourOid:b,theirOid:S,baseOid:A,ourName:ga(n),baseName:"base",theirName:ga(s),dryRun:l,abortOnConflict:u,mergeDriver:w}));if(k instanceof wa)throw k;return f||(f=`Merge branch '${ga(s)}' into ${ga(n)}`),{oid:await cu({fs:t,cache:e,gitdir:i,message:f,ref:n,tree:k,parent:[b,S],author:d,committer:h,signingKey:p,onSign:g,dryRun:l,noUpdateBranch:c}),tree:k,mergeCommit:!0}}}async function CS({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,dir:l,gitdir:c,ref:u,url:f,remote:d,remoteRef:h,prune:p,pruneTags:g,fastForward:w,fastForwardOnly:y,corsProxy:b,singleBranch:S,headers:C,author:A,committer:k,signingKey:v}){try{if(!u){let P=await Is({fs:t,gitdir:c});if(!P)throw new Ir("ref");u=P}let{fetchHead:x,fetchHeadDescription:_}=await zg({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,gitdir:c,corsProxy:b,ref:u,url:f,remote:d,remoteRef:h,singleBranch:S,headers:C,prune:p,pruneTags:g});await AS({fs:t,cache:e,gitdir:c,ours:u,theirs:x,fastForward:w,fastForwardOnly:y,message:`Merge ${_}`,author:A,committer:k,signingKey:v,dryRun:!1,noUpdateBranch:!1}),await jg({fs:t,cache:e,onProgress:i,dir:l,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(x){throw x.caller="git.pull",x}}async function TS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=H(o,".git"),ref:c,url:u,remote:f,remoteRef:d,corsProxy:h,singleBranch:p,headers:g={},cache:w={}}){try{R("fs",t),R("http",e),R("gitdir",l);let y={name:"",email:"",timestamp:Date.now(),timezoneOffset:0},b=new te(t),S=await ie({fsp:b,dotgit:l});return await CS({fs:b,cache:w,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:S,ref:c,url:u,remote:f,remoteRef:d,fastForwardOnly:!0,corsProxy:h,singleBranch:p,headers:g,author:y,committer:y})}catch(y){throw y.caller="git.fastForward",y}}async function PS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=H(o,".git"),ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:p=null,since:g=null,exclude:w=[],relative:y=!1,tags:b=!1,singleBranch:S=!1,headers:C={},prune:A=!1,pruneTags:k=!1,cache:v={}}){try{R("fs",t),R("http",e),R("gitdir",l);let x=new te(t),_=await ie({fsp:x,dotgit:l});return await zg({fs:x,cache:v,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,gitdir:_,ref:c,remote:u,remoteRef:f,url:d,corsProxy:h,depth:p,since:g,exclude:w,relative:y,tags:b,singleBranch:S,headers:C,prune:A,pruneTags:k})}catch(x){throw x.caller="git.fetch",x}}async function RS({fs:t,dir:e,gitdir:r=H(e,".git"),oids:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oids",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await Wg({fs:s,cache:n,gitdir:a,oids:i})}catch(s){throw s.caller="git.findMergeBase",s}}async function $S({fs:t,filepath:e}){if(await t.exists(H(e,".git")))return e;{let r=va(e);if(r===e)throw new Ge(`git root for ${e}`);return $S({fs:t,filepath:r})}}async function FS({fs:t,filepath:e}){try{return R("fs",t),R("filepath",e),await $S({fs:new te(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}async function IS({fs:t,dir:e,gitdir:r=H(e,".git"),path:i}){try{R("fs",t),R("gitdir",r),R("path",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await ou({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfig",n}}async function eB({fs:t,gitdir:e,path:r}){return(await ht.get({fs:t,gitdir:e})).getall(r)}async function MS({fs:t,dir:e,gitdir:r=H(e,".git"),path:i}){try{R("fs",t),R("gitdir",r),R("path",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await eB({fs:n,gitdir:s,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}async function DS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1}){try{R("http",t),R("url",s);let c=await el.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[f,d]of c.refs){let h=f.split("/"),p=h.pop(),g=u;for(let w of h)g[w]=g[w]||{},g=g[w];g[p]=d}for(let[f,d]of c.symrefs){let h=f.split("/"),p=h.pop(),g=u;for(let w of h)g[w]=g[w]||{},g=g[w];g[p]=d}return u}catch(l){throw l.caller="git.getRemoteInfo",l}}function OS(t,e,r,i){let n=[];for(let[s,a]of t.refs){if(e&&!s.startsWith(e))continue;if(s.endsWith("^{}")){if(i){let l=s.replace("^{}",""),c=n[n.length-1],u=c.ref===l?c:n.find(f=>f.ref===l);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=a}continue}let o={ref:s,oid:a};r&&t.symrefs.has(s)&&(o.target=t.symrefs.get(s)),n.push(o)}return n}async function LS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2}){try{R("http",t),R("url",s);let u=await el.getRemoteHelperFor({url:s}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let f={};for(let d of u.capabilities){let[h,p]=d.split("=");p?f[h]=p:f[h]=!0}return{protocolVersion:1,capabilities:f,refs:OS(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}async function tB({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Cs.wrap({type:t,object:e})),i=await wn(e)),{oid:i,object:e}}async function NS({object:t}){try{R("object",t),typeof t=="string"?t=E.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await tB({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}async function rB({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:s}){try{s=H(i,s);let a=await t.read(s),o=c=>et({fs:t,cache:e,gitdir:n,oid:c}),l=await zc.fromPack({pack:a,getExternalRefDelta:o,onProgress:r});return await t.write(s.replace(/\.pack$/,".idx"),await l.toBuffer()),{oids:[...l.hashes]}}catch(a){throw a.caller="git.indexPack",a}}async function BS({fs:t,onProgress:e,dir:r,gitdir:i=H(r,".git"),filepath:n,cache:s={}}){try{R("fs",t),R("dir",r),R("gitdir",r),R("filepath",n);let a=new te(t),o=await ie({fsp:a,dotgit:i});return await rB({fs:a,cache:s,onProgress:e,dir:r,gitdir:o,filepath:n})}catch(a){throw a.caller="git.indexPack",a}}async function HS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:H(r,".git"),defaultBranch:n="master"}){try{R("fs",t),R("gitdir",i),e||R("dir",r);let s=new te(t),a=await ie({fsp:s,dotgit:i});return await gS({fs:s,bare:e,dir:r,gitdir:a,defaultBranch:n})}catch(s){throw s.caller="git.init",s}}async function US({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:s}){let a=await ya.read({fs:t,gitdir:r});if(!i)throw new Ir("oid");if(!n)throw new Ir("ancestor");if(i===n)return!1;let o=[i],l=new Set,c=0;for(;o.length;){if(c++===s)throw new eu(s);let u=o.shift(),{type:f,object:d}=await et({fs:t,cache:e,gitdir:r,oid:u});if(f!=="commit")throw new _r(u,f,"commit");let h=Dr.from(d).parse();for(let p of h.parent)if(p===n)return!0;if(!a.has(u))for(let p of h.parent)l.has(p)||(o.push(p),l.add(p))}return!1}async function GS({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,ancestor:n,depth:s=-1,cache:a={}}){try{R("fs",t),R("gitdir",r),R("oid",i),R("ancestor",n);let o=new te(t),l=await ie({fsp:o,dotgit:r});return await US({fs:o,cache:a,gitdir:l,oid:i,ancestor:n,depth:s})}catch(o){throw o.caller="git.isDescendent",o}}async function jS({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i}){try{R("fs",t),R("dir",e),R("gitdir",r),R("filepath",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return Rs.isIgnored({fs:n,dir:e,gitdir:s,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}async function VS({fs:t,dir:e,gitdir:r=H(e,".git"),remote:i}){try{R("fs",t),R("gitdir",r);let n=new te(t),s=await ie({fsp:n,dotgit:r});return q.listBranches({fs:n,gitdir:s,remote:i})}catch(n){throw n.caller="git.listBranches",n}}async function iB({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await q.resolve({gitdir:e,fs:t,ref:r}),s=[];return await zS({fs:t,cache:i,gitdir:e,oid:n,filenames:s,prefix:""}),s}else return dt.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(s=>s.path)})}async function zS({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:s}){let{tree:a}=await rl({fs:t,cache:e,gitdir:r,oid:i});for(let o of a)o.type==="tree"?await zS({fs:t,cache:e,gitdir:r,oid:o.oid,filenames:n,prefix:H(s,o.path)}):n.push(H(s,o.path))}async function WS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,cache:n={}}){try{R("fs",t),R("gitdir",r);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await iB({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listFiles",s}}async function nB({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await q.resolve({gitdir:r,fs:t,ref:i})}catch(o){if(o instanceof Ge)return[]}return(await rl({fs:t,cache:e,gitdir:r,oid:n})).tree.map(o=>({target:o.path,note:o.oid}))}async function qS({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{R("fs",t),R("gitdir",r),R("ref",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await nB({fs:s,cache:n,gitdir:a,ref:i})}catch(s){throw s.caller="git.listNotes",s}}async function YS({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i}){try{R("fs",t),R("gitdir",r);let n=new te(t),s=await ie({fsp:n,dotgit:r});return q.listRefs({fs:n,gitdir:s,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}async function sB({fs:t,gitdir:e}){let r=await ht.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async s=>{let a=await r.get(`remote.${s}.url`);return{remote:s,url:a}}))}async function ZS({fs:t,dir:e,gitdir:r=H(e,".git")}){try{R("fs",t),R("gitdir",r);let i=new te(t),n=await ie({fsp:i,dotgit:r});return await sB({fs:i,gitdir:n})}catch(i){throw i.caller="git.listRemotes",i}}async function aB(t){let e=lt.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,s,...a]=i.split(" "),o={ref:s,oid:n};for(let l of a){let[c,u]=l.split(":");c==="symref-target"?o.target=u:c==="peeled"&&(o.peeled=u)}r.push(o)}return r}async function oB({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(lt.encode(`command=ls-refs +`)),i.push(lt.encode(`agent=${Ad.agent} +`)),(r||e||t)&&i.push(lt.delim()),r&&i.push(lt.encode("peel")),e&&i.push(lt.encode("symrefs")),t&&i.push(lt.encode(`ref-prefix ${t}`)),i.push(lt.flush()),i}async function KS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:s,headers:a={},forPush:o=!1,protocolVersion:l=2,prefix:c,symrefs:u,peelTags:f}){try{R("http",t),R("url",s);let d=await Jo.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,headers:a,protocolVersion:l});if(d.protocolVersion===1)return OS(d,c,u,f);let h=await oB({prefix:c,symrefs:u,peelTags:f}),p=await Jo.connect({http:t,auth:d.auth,headers:a,corsProxy:n,service:o?"git-receive-pack":"git-upload-pack",url:s,body:h});return aB(p.body)}catch(d){throw d.caller="git.listServerRefs",d}}async function XS({fs:t,dir:e,gitdir:r=H(e,".git")}){try{R("fs",t),R("gitdir",r);let i=new te(t),n=await ie({fsp:i,dotgit:r});return q.listTags({fs:i,gitdir:n})}catch(i){throw i.caller="git.listTags",i}}function lB(t,e){return t.committer.timestamp-e.committer.timestamp}var cB="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function NE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===cB)return;let s=i,a,o=await Xo({fs:t,cache:e,gitdir:r,oid:i}),l=o.tree;return n===o.oid?a=o.path:(a=await QS({fs:t,cache:e,gitdir:r,tree:l,fileId:n,oid:s}),Array.isArray(a)&&(a.length===0?a=void 0:a.length===1&&(a=a[0]))),a}async function QS({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:s,filepaths:a=[],parentPath:o=""}){let l=i.entries().map(function(c){let u;return c.oid===n?(u=H(o,c.path),a.push(u)):c.type==="tree"&&(u=et({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:f}){return QS({fs:t,cache:e,gitdir:r,tree:Mr.from(f),fileId:n,oid:s,filepaths:a,parentPath:H(o,c.path)})})),u});return await Promise.all(l),a}async function uB({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:s,since:a,force:o,follow:l}){let c=typeof a=="undefined"?void 0:Math.floor(a.valueOf()/1e3),u=[],f=await ya.read({fs:t,gitdir:r}),d=await q.resolve({fs:t,gitdir:r,ref:n}),h=[await vn({fs:t,cache:e,gitdir:r,oid:d})],p,g,w;function y(b){w&&i&&u.push(b)}for(;h.length>0;){let b=h.pop();if(c!==void 0&&b.commit.committer.timestamp<=c)break;if(i){let S;try{S=await uu({fs:t,cache:e,gitdir:r,oid:b.commit.tree,filepath:i}),g&&p!==S&&u.push(g),p=S,g=b,w=!0}catch(C){if(C instanceof Ge){let A=l&&p;if(A&&(A=await NE({fs:t,cache:e,gitdir:r,oid:b.commit.tree,fileId:p}),A))if(Array.isArray(A)){if(g){let k=await NE({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:p});if(Array.isArray(k))if(A=A.filter(v=>k.indexOf(v)===-1),A.length===1)A=A[0],i=A,g&&u.push(g);else{A=!1,g&&u.push(g);break}}}else i=A,g&&u.push(g);if(!A){if(w&&p&&(u.push(g),!o))break;if(!o&&!l)throw C}g=b,w=!1}else throw C}}else u.push(b);if(s!==void 0&&u.length===s){y(b);break}if(!f.has(b.oid))for(let S of b.commit.parent){let C=await vn({fs:t,cache:e,gitdir:r,oid:S});h.map(A=>A.oid).includes(C.oid)||h.push(C)}h.length===0&&y(b),h.sort((S,C)=>lB(S.commit,C.commit))}return u}async function JS({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,ref:n="HEAD",depth:s,since:a,force:o,follow:l,cache:c={}}){try{R("fs",t),R("gitdir",r),R("ref",n);let u=new te(t),f=await ie({fsp:u,dotgit:r});return await uB({fs:u,cache:c,gitdir:f,filepath:i,ref:n,depth:s,since:a,force:o,follow:l})}catch(u){throw u.caller="git.log",u}}async function ek({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ours:n,theirs:s,fastForward:a=!0,fastForwardOnly:o=!1,dryRun:l=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:f,author:d,committer:h,signingKey:p,cache:g={},mergeDriver:w,allowUnrelatedHistories:y=!1}){try{R("fs",t),p&&R("onSign",e);let b=new te(t),S=await ie({fsp:b,dotgit:i}),C=await $s({fs:b,gitdir:S,author:d});if(!C&&(!o||!a))throw new Xt("author");let A=await _a({fs:b,gitdir:S,author:C,committer:h});if(!A&&(!o||!a))throw new Xt("committer");return await AS({fs:b,cache:g,dir:r,gitdir:S,ours:n,theirs:s,fastForward:a,fastForwardOnly:o,dryRun:l,noUpdateBranch:c,abortOnConflict:u,message:f,author:C,committer:A,signingKey:p,onSign:e,mergeDriver:w,allowUnrelatedHistories:y})}catch(b){throw b.caller="git.merge",b}}var fB={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function tk({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),oids:n}){let s=new BE,a=[];function o(u,f){let d=E.from(u,f);a.push(d),s.update(d)}async function l({stype:u,object:f}){let d=fB[u],h=f.length,p=h>15?128:0,g=h&15;h=h>>>4;let w=(p|d|g).toString(16);for(o(w,"hex");p;)p=h>127?128:0,w=p|h&127,o(Hg(2,w),"hex"),h=h>>>7;o(E.from(await XE(f)))}o("PACK"),o("00000002","hex"),o(Hg(8,n.length),"hex");for(let u of n){let{type:f,object:d}=await et({fs:t,cache:e,gitdir:i,oid:u});await l({write:o,object:d,stype:f})}let c=s.digest();return a.push(c),a}async function dB({fs:t,cache:e,gitdir:r,oids:i,write:n}){let s=await tk({fs:t,cache:e,gitdir:r,oids:i}),a=E.from(await yd(s)),l=`pack-${a.slice(-20).toString("hex")}.pack`;return n?(await t.write(H(r,`objects/pack/${l}`),a),{filename:l}):{filename:l,packfile:new Uint8Array(a)}}async function rk({fs:t,dir:e,gitdir:r=H(e,".git"),oids:i,write:n=!1,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oids",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await dB({fs:a,cache:s,gitdir:o,oids:i,write:n})}catch(a){throw a.caller="git.packObjects",a}}async function ik({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:l=H(o,".git"),ref:c,url:u,remote:f,remoteRef:d,prune:h=!1,pruneTags:p=!1,fastForward:g=!0,fastForwardOnly:w=!1,corsProxy:y,singleBranch:b,headers:S={},author:C,committer:A,signingKey:k,cache:v={}}){try{R("fs",t),R("gitdir",l);let x=new te(t),_=await ie({fsp:x,dotgit:l}),P=await $s({fs:x,gitdir:_,author:C});if(!P)throw new Xt("author");let T=await _a({fs:x,gitdir:_,author:P,committer:A});if(!T)throw new Xt("committer");return await CS({fs:x,cache:v,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,dir:o,gitdir:_,ref:c,url:u,remote:f,remoteRef:d,fastForward:g,fastForwardOnly:w,corsProxy:y,singleBranch:b,headers:S,author:P,committer:T,signingKey:k,prune:h,pruneTags:p})}catch(x){throw x.caller="git.pull",x}}async function hB({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),start:n,finish:s}){let a=await ya.read({fs:t,gitdir:i}),o=new Set,l=new Set;for(let f of n)o.add(await q.resolve({fs:t,gitdir:i,ref:f}));for(let f of s)try{let d=await q.resolve({fs:t,gitdir:i,ref:f});l.add(d)}catch(d){}let c=new Set;async function u(f){c.add(f);let{type:d,object:h}=await et({fs:t,cache:e,gitdir:i,oid:f});if(d==="tag"){let g=Qr.from(h).headers().object;return u(g)}if(d!=="commit")throw new _r(f,d,"commit");if(!a.has(f)){let g=Dr.from(h).headers().parent;for(f of g)!l.has(f)&&!c.has(f)&&await u(f)}}for(let f of o)await u(f);return c}async function Tg({fs:t,cache:e,dir:r,gitdir:i=H(r,".git"),oids:n}){let s=new Set;async function a(o){if(s.has(o))return;s.add(o);let{type:l,object:c}=await et({fs:t,cache:e,gitdir:i,oid:o});if(l==="tag"){let f=Qr.from(c).headers().object;await a(f)}else if(l==="commit"){let f=Dr.from(c).headers().tree;await a(f)}else if(l==="tree"){let u=Mr.from(c);for(let f of u)f.type==="blob"&&s.add(f.oid),f.type==="tree"&&await a(f.oid)}}for(let o of n)await a(o);return s}async function pB(t){let e={},r="",i=lt.streamReader(t),n=await i();for(;n!==!0;)n!==null&&(r+=n.toString("utf8")+` +`),n=await i();let s=r.toString("utf8").split(` +`);if(n=s.shift(),!n.startsWith("unpack "))throw new ba('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let a of s){if(a.trim()==="")continue;let o=a.slice(0,2),l=a.slice(3),c=l.indexOf(" ");c===-1&&(c=l.length);let u=l.slice(0,c),f=l.slice(c+1);e.refs[u]={ok:o==="ok",error:f}}return e}async function mB({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(lt.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i} +`)),i="";return r.push(lt.flush()),r}async function gB({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:s,onAuthSuccess:a,onAuthFailure:o,onPrePush:l,gitdir:c,ref:u,remoteRef:f,remote:d,url:h,force:p=!1,delete:g=!1,corsProxy:w,headers:y={}}){let b=u||await Is({fs:t,gitdir:c});if(typeof b=="undefined")throw new Ir("ref");let S=await ht.get({fs:t,gitdir:c});d=d||await S.get(`branch.${b}.pushRemote`)||await S.get("remote.pushDefault")||await S.get(`branch.${b}.remote`)||"origin";let C=h||await S.get(`remote.${d}.pushurl`)||await S.get(`remote.${d}.url`);if(typeof C=="undefined")throw new Ir("remote OR url");let A=f||await S.get(`branch.${b}.merge`);if(typeof C=="undefined")throw new Ir("remoteRef");w===void 0&&(w=await S.get("http.corsProxy"));let k=await q.expand({fs:t,gitdir:c,ref:b}),v=g?"0000000000000000000000000000000000000000":await q.resolve({fs:t,gitdir:c,ref:k}),x=el.getRemoteHelperFor({url:C}),_=await x.discover({http:r,onAuth:s,onAuthSuccess:a,onAuthFailure:o,corsProxy:w,service:"git-receive-pack",url:C,headers:y,protocolVersion:1}),P=_.auth,T;if(!A)T=k;else try{T=await q.expandAgainstMap({ref:A,map:_.refs})}catch(K){if(K instanceof Ge)T=A.startsWith("refs/")?A:`refs/heads/${A}`;else throw K}let M=_.refs.get(T)||"0000000000000000000000000000000000000000";if(l&&!await l({remote:d,url:C,localRef:{ref:g?"(delete)":k,oid:v},remoteRef:{ref:T,oid:M}}))throw new Ko;let $=!_.capabilities.has("no-thin"),D=new Set;if(!g){let K=[..._.refs.values()],G=new Set;if(M!=="0000000000000000000000000000000000000000"){let Me=await Wg({fs:t,cache:e,gitdir:c,oids:[v,M]});for(let Et of Me)K.push(Et);$&&(G=await Tg({fs:t,cache:e,gitdir:c,oids:Me}))}if(!K.includes(v)){let Me=await hB({fs:t,cache:e,gitdir:c,start:[v],finish:K});D=await Tg({fs:t,cache:e,gitdir:c,oids:Me})}if($){try{let Me=await q.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:Et}=await q.resolveAgainstMap({ref:Me.replace(`refs/remotes/${d}/`,""),fullref:Me,map:_.refs}),Ht=[Et];for(let De of await Tg({fs:t,cache:e,gitdir:c,oids:Ht}))G.add(De)}catch(Me){}for(let Me of G)D.delete(Me)}if(v===M&&(p=!0),!p){if(k.startsWith("refs/tags")&&M!=="0000000000000000000000000000000000000000")throw new Zo("tag-exists");if(v!=="0000000000000000000000000000000000000000"&&M!=="0000000000000000000000000000000000000000"&&!await US({fs:t,cache:e,gitdir:c,oid:v,ancestor:M,depth:-1}))throw new Zo("not-fast-forward")}}let Q=pS([..._.capabilities],["report-status","side-band-64k",`agent=${Ad.agent}`]),ye=await mB({capabilities:Q,triplets:[{oldoid:M,oid:v,fullRef:T}]}),de=g?[]:await tk({fs:t,cache:e,gitdir:c,oids:[...D]}),J=await x.connect({http:r,onProgress:i,corsProxy:w,service:"git-receive-pack",url:C,auth:P,headers:y,body:[...ye,...de]}),{packfile:X,progress:he}=await xd.demux(J.body);if(n){let K=mS(he);du(K,async G=>{await n(G)})}let z=await pB(X);if(J.headers&&(z.headers=J.headers),d&&z.ok&&z.refs[T].ok&&!k.startsWith("refs/tags")){let K=`refs/remotes/${d}/${T.replace("refs/heads","")}`;g?await q.deleteRef({fs:t,gitdir:c,ref:K}):await q.writeRef({fs:t,gitdir:c,ref:K,value:v})}if(z.ok&&Object.values(z.refs).every(K=>K.ok))return z;{let K=Object.entries(z.refs).filter(([G,Me])=>!Me.ok).map(([G,Me])=>` + - ${G}: ${Me.error}`).join("");throw new Jc(K,z)}}async function nk({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,dir:l,gitdir:c=H(l,".git"),ref:u,remoteRef:f,remote:d="origin",url:h,force:p=!1,delete:g=!1,corsProxy:w,headers:y={},cache:b={}}){try{R("fs",t),R("http",e),R("gitdir",c);let S=new te(t),C=await ie({fsp:S,dotgit:c});return await gB({fs:S,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:s,onAuthFailure:a,onPrePush:o,gitdir:C,ref:u,remoteRef:f,remote:d,url:h,force:p,delete:g,corsProxy:w,headers:y})}catch(S){throw S.caller="git.push",S}}async function sk({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=Qr.from(s).parse().object,sk({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new _r(i,n,"blob");return{oid:i,blob:new Uint8Array(s)}}async function ak({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await uu({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await sk({fs:t,cache:e,gitdir:r,oid:i})}async function ok({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,filepath:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await ak({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readBlob",a}}async function qg({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await vn({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readCommit",s}}async function vB({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let s=await q.resolve({gitdir:r,fs:t,ref:i}),{blob:a}=await ak({fs:t,cache:e,gitdir:r,oid:s,filepath:n});return a}async function lk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="refs/notes/commits",oid:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("ref",i),R("oid",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await vB({fs:a,cache:s,gitdir:o,ref:i,oid:n})}catch(a){throw a.caller="git.readNote",a}}async function ck({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,format:n="parsed",filepath:s=void 0,encoding:a=void 0,cache:o={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});s!==void 0&&(i=await uu({fs:l,cache:o,gitdir:c,oid:i,filepath:s}));let f=await et({fs:l,cache:o,gitdir:c,oid:i,format:n==="parsed"?"content":n});if(f.oid=i,n==="parsed")switch(f.format="parsed",f.type){case"commit":f.object=Dr.from(f.object).parse();break;case"tree":f.object=Mr.from(f.object).entries();break;case"blob":a?f.object=f.object.toString(a):(f.object=new Uint8Array(f.object),f.format="content");break;case"tag":f.object=Qr.from(f.object).parse();break;default:throw new _r(f.oid,f.type,"blob|commit|tag|tree")}else(f.format==="deflated"||f.format==="wrapped")&&(f.type=f.format);return f}catch(l){throw l.caller="git.readObject",l}}async function wB({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:s}=await et({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new _r(i,n,"tag");let a=Qr.from(s);return{oid:i,tag:a.parse(),payload:a.payload()}}async function uk({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await wB({fs:s,cache:n,gitdir:a,oid:i})}catch(s){throw s.caller="git.readTag",s}}async function fk({fs:t,dir:e,gitdir:r=H(e,".git"),oid:i,filepath:n=void 0,cache:s={}}){try{R("fs",t),R("gitdir",r),R("oid",i);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await rl({fs:a,cache:s,gitdir:o,oid:i,filepath:n})}catch(a){throw a.caller="git.readTree",a}}async function dk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});await dt.acquire({fs:s,gitdir:a,cache:n},async function(o){o.delete({filepath:i})})}catch(s){throw s.caller="git.remove",s}}async function bB({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l}){let c;try{c=await q.resolve({gitdir:i,fs:t,ref:n})}catch(p){if(!(p instanceof Ge))throw p}let f=(await rl({fs:t,cache:e,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;f=f.filter(p=>p.path!==s);let d=await fu({fs:t,gitdir:i,tree:f});return await cu({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote' +`,author:a,committer:o,signingKey:l})}async function hk({fs:t,onSign:e,dir:r,gitdir:i=H(r,".git"),ref:n="refs/notes/commits",oid:s,author:a,committer:o,signingKey:l,cache:c={}}){try{R("fs",t),R("gitdir",i),R("oid",s);let u=new te(t),f=await ie({fsp:u,dotgit:i}),d=await $s({fs:u,gitdir:f,author:a});if(!d)throw new Xt("author");let h=await _a({fs:u,gitdir:f,author:d,committer:o});if(!h)throw new Xt("committer");return await bB({fs:u,cache:c,onSign:e,gitdir:f,ref:n,oid:s,author:d,committer:h,signingKey:l})}catch(u){throw u.caller="git.removeNote",u}}async function _B({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!lu(i,!0))throw new Gi(i,Gc.clean(i));if(!lu(r,!0))throw new Gi(r,Gc.clean(r));let s=`refs/heads/${r}`,a=`refs/heads/${i}`;if(await q.exists({fs:t,gitdir:e,ref:a}))throw new Ui("branch",i,!1);let l=await q.resolve({fs:t,gitdir:e,ref:s,depth:1});await q.writeRef({fs:t,gitdir:e,ref:a,value:l}),await q.deleteRef({fs:t,gitdir:e,ref:s});let u=await Is({fs:t,gitdir:e,fullname:!0})===s;(n||u)&&await q.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:a})}async function pk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,oldref:n,checkout:s=!1}){try{R("fs",t),R("gitdir",r),R("ref",i),R("oldref",n);let a=new te(t),o=await ie({fsp:a,dotgit:r});return await _B({fs:a,gitdir:o,ref:i,oldref:n,checkout:s})}catch(a){throw a.caller="git.renameBranch",a}}async function mk({gitdir:t,type:e,object:r}){return wn(Cs.wrap({type:e,object:r}))}async function gk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,ref:n,cache:s={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let a=new te(t),o=await ie({fsp:a,dotgit:r}),l,c;try{l=await q.resolve({fs:a,gitdir:o,ref:n||"HEAD"})}catch(d){if(n)throw d}if(l)try{l=await uu({fs:a,cache:s,gitdir:o,oid:l,filepath:i})}catch(d){l=null}let u={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},f=e&&await a.read(H(e,i));f&&(c=await mk({gitdir:o,type:"blob",object:f}),l===c&&(u=await a.lstat(H(e,i)))),await dt.acquire({fs:a,gitdir:o,cache:s},async function(d){d.delete({filepath:i}),l&&d.insert({filepath:i,stats:u,oid:l})})}catch(a){throw a.caller="git.reset",a}}async function vk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,depth:n}){try{R("fs",t),R("gitdir",r),R("ref",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});return await q.resolve({fs:s,gitdir:a,ref:i,depth:n})}catch(s){throw s.caller="git.resolveRef",s}}async function wk({fs:t,dir:e,gitdir:r=H(e,".git"),path:i,value:n,append:s=!1}){try{R("fs",t),R("gitdir",r),R("path",i);let a=new te(t),o=await ie({fsp:a,dotgit:r}),l=await ht.get({fs:a,gitdir:o});s?await l.append(i,n):await l.set(i,n),await ht.save({fs:a,gitdir:o,config:l})}catch(a){throw a.caller="git.setConfig",a}}async function bk({fs:t,gitdir:e,commit:r}){let i=Dr.from(r).toObject();return await Or({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}var Ed=class t{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),s="0000000000000000000000000000000000000000",a=Math.floor(Date.now()/1e3),o=t.timezoneOffsetForRefLogEntry;return`${s} ${r} ${n} ${e.email} ${a} ${o} ${i} +`}static getStashReflogEntry(e,r=!1){return e.split(` +`).filter(s=>s).reverse().map((s,a)=>r?`stash@{${a}}: ${s.split(" ")[1]}`:s)}},xa=class t{constructor({fs:e,dir:r,gitdir:i=H(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return H(this.gitdir,t.refStash)}get refLogsStashPath(){return H(this.gitdir,t.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await $s({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new Xt("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:i}){return bk({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Gi(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?vn({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return q.writeRef({fs:this.fs,gitdir:this.gitdir,ref:t.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=Ed.createStashReflogEntry(i,e,r),s=this.refLogsStashPath;await Qo({filepath:s,entry:n},async()=>{let a=await this.fs.exists(s)?await this.fs.read(s,"utf8"):"";await this.fs.write(s,a+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return Ed.getStashReflogEntry(r,e)}};async function _k({fs:t,dir:e,gitdir:r,message:i=""}){let n=new xa({fs:t,dir:e,gitdir:r});await n.getAuthor();let s=await Is({fs:t,gitdir:r,fullname:!1}),a=await q.resolve({fs:t,gitdir:r,ref:"HEAD"}),l=(await qg({fs:t,dir:e,gitdir:r,oid:a})).commit.message,c=[a],u=null,f=Xr({ref:"HEAD"}),d=await RE({fs:t,dir:e,gitdir:r,treePair:[Xr({ref:"HEAD"}),"stage"]});if(d){let w=await n.writeStashCommit({message:`stash-Index: WIP on ${s} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(w),u=d,f=Ea()}let h=await RE({fs:t,dir:e,gitdir:r,treePair:[f,"workdir"]});if(h){let w=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${s} - ${new Date().toISOString()}`,tree:h,parent:[c[c.length-1]]});c.push(w),u=h}if(!u||!d&&!h)throw new Ge("changes, nothing to stash");let p=(i.trim()||`WIP on ${s}`)+`: ${a.substring(0,7)} ${l}`;return{stashCommit:await n.writeStashCommit({message:p,tree:u,parent:c}),stashMsg:p,branch:s,stashMgr:n}}async function yB({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n,stashMsg:s,branch:a,stashMgr:o}=await _k({fs:t,dir:e,gitdir:r,message:i});return await o.writeStashRef(n),await o.writeStashReflogEntry({stashCommit:n,message:s}),await Vg({fs:t,dir:e,gitdir:r,ref:a,track:!1,force:!0}),n}async function xB({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n}=await _k({fs:t,dir:e,gitdir:r,message:i});return n}async function yk({fs:t,dir:e,gitdir:r,refIdx:i=0}){let s=await new xa({fs:t,dir:e,gitdir:r}).readStashCommit(i),{parent:a=null}=s.commit?s.commit:{};if(!(!a||!Array.isArray(a)))for(let o=0;o{await t.exists(a)&&await t.rm(a)});let o=await n.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(i,1);let l=n.refLogsStashPath;await Qo({reflogEntries:o,stashReflogPath:l,stashMgr:n},async()=>{if(o.length){await t.write(l,o.reverse().join(` +`)+` +`,"utf8");let c=o[o.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(l)})}async function EB({fs:t,dir:e,gitdir:r}){return new xa({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}async function SB({fs:t,dir:e,gitdir:r}){let i=new xa({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await Qo(n,async()=>{await Promise.all(n.map(async s=>{if(await t.exists(s))return t.rm(s)}))})}async function kB({fs:t,dir:e,gitdir:r,refIdx:i=0}){await yk({fs:t,dir:e,gitdir:r,refIdx:i}),await xk({fs:t,dir:e,gitdir:r,refIdx:i})}async function Ek({fs:t,dir:e,gitdir:r=H(e,".git"),op:i="push",message:n="",refIdx:s=0}){R("fs",t),R("dir",e),R("gitdir",r),R("op",i);let a={push:yB,apply:yk,drop:xk,list:EB,clear:SB,pop:kB,create:xB},o=["apply","drop","pop"];try{let l=new te(t),c=await ie({fsp:l,dotgit:r});["refs","logs","logs/refs"].map(d=>H(c,d)).forEach(async d=>{await l.exists(d)||await l.mkdir(d)});let f=a[i];if(f){if(o.includes(i)&&s<0)throw new Gi(`stash@${s}`,"number that is in range of [0, num of stash pushed]");return await f({fs:l,dir:e,gitdir:c,message:n,refIdx:s})}throw new Error(`To be implemented: ${i}`)}catch(l){throw l.caller="git.stash",l}}async function Sk({fs:t,dir:e,gitdir:r=H(e,".git"),filepath:i,cache:n={}}){try{R("fs",t),R("gitdir",r),R("filepath",i);let s=new te(t),a=await ie({fsp:s,dotgit:r});if(await Rs.isIgnored({fs:s,gitdir:a,dir:e,filepath:i}))return"ignored";let l=await AB({fs:s,cache:n,gitdir:a}),c=await kk({fs:s,cache:n,gitdir:a,tree:l,path:i}),u=await dt.acquire({fs:s,gitdir:a,cache:n},async function(w){for(let y of w)if(y.path===i)return y;return null}),f=await s.lstat(H(e,i)),d=c!==null,h=u!==null,p=f!==null,g=async()=>{if(h&&!pd(u,f))return u.oid;{let w=await s.read(H(e,i)),y=await mk({gitdir:a,type:"blob",object:w});return h&&u.oid===y&&f.size!==-1&&dt.acquire({fs:s,gitdir:a,cache:n},async function(b){b.insert({filepath:i,stats:f,oid:y})}),y}};if(!d&&!p&&!h)return"absent";if(!d&&!p&&h)return"*absent";if(!d&&p&&!h)return"*added";if(!d&&p&&h)return await g()===u.oid?"added":"*added";if(d&&!p&&!h)return"deleted";if(d&&!p&&h)return c===u.oid,"*deleted";if(d&&p&&!h)return await g()===c?"*undeleted":"*undeletemodified";if(d&&p&&h){let w=await g();return w===c?w===u.oid?"unmodified":"*unmodified":w===u.oid?"modified":"*modified"}}catch(s){throw s.caller="git.status",s}}async function kk({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let s=n.shift();for(let a of i)if(a.path===s){if(n.length===0)return a.oid;let{type:o,object:l}=await et({fs:t,cache:e,gitdir:r,oid:a.oid});if(o==="tree"){let c=Mr.from(l);return kk({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(o==="blob")throw new _r(a.oid,o,"blob",n.join("/"))}return null}async function AB({fs:t,cache:e,gitdir:r}){let i;try{i=await q.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(s){if(s instanceof Ge)return[]}let{tree:n}=await rl({fs:t,cache:e,gitdir:r,oid:i});return n}async function Ak({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:s,cache:a={},ignored:o=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});return await Ps({fs:l,cache:a,dir:e,gitdir:c,trees:[Xr({ref:i}),tl(),Ea()],map:async function(u,[f,d,h]){if(!f&&!h&&d&&!o&&await Rs.isIgnored({fs:l,dir:e,filepath:u})||!n.some(v=>cS(u,v)))return null;if(s&&!s(u))return;let[p,g,w]=await Promise.all([f&&f.type(),d&&d.type(),h&&h.type()]),y=[p,g,w].includes("blob");if((p==="tree"||p==="special")&&!y)return;if(p==="commit")return null;if((g==="tree"||g==="special")&&!y)return;if(w==="commit")return null;if((w==="tree"||w==="special")&&!y)return;let b=p==="blob"?await f.oid():void 0,S=w==="blob"?await h.oid():void 0,C;p!=="blob"&&g==="blob"&&w!=="blob"?C="42":g==="blob"&&(C=await d.oid());let A=[void 0,b,C,S],k=A.map(v=>A.indexOf(v));return k.shift(),[u,...k]}})}catch(l){throw l.caller="git.statusMatrix",l}}async function Ck({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,object:n,force:s=!1}){try{R("fs",t),R("gitdir",r),R("ref",i);let a=new te(t);if(i===void 0)throw new Ir("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let o=await ie({fsp:a,dotgit:r}),l=await q.resolve({fs:a,gitdir:o,ref:n||"HEAD"});if(!s&&await q.exists({fs:a,gitdir:o,ref:i}))throw new Ui("tag",i);await q.writeRef({fs:a,gitdir:o,ref:i,value:l})}catch(a){throw a.caller="git.tag",a}}async function Tk({fs:t,dir:e,gitdir:r=H(e,".git"),cache:i={},filepath:n,oid:s,mode:a,add:o,remove:l,force:c}){try{R("fs",t),R("gitdir",r),R("filepath",n);let u=new te(t),f=await ie({fsp:u,dotgit:r});if(l)return await dt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!c){let p=await u.lstat(H(e,n));if(p){if(p.isDirectory())throw new Ts("directory");return}}h.has({filepath:n})&&h.delete({filepath:n})});let d;if(!s){if(d=await u.lstat(H(e,n)),!d)throw new Ge(`file at "${n}" on disk and "remove" not set`);if(d.isDirectory())throw new Ts("directory")}return await dt.acquire({fs:u,gitdir:f,cache:i},async function(h){if(!o&&!h.has({filepath:n}))throw new Ge(`file at "${n}" in index and "add" not set`);let p;if(s)p={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:a,uid:0,gid:0,size:0};else{p=d;let g=p.isSymbolicLink()?await u.readlink(H(e,n)):await u.read(H(e,n));s=await Or({fs:u,gitdir:f,type:"blob",format:"content",object:g})}return h.insert({filepath:n,oid:s,stats:p}),s})}catch(u){throw u.caller="git.updateIndex",u}}function Pk(){try{return Ad.version}catch(t){throw t.caller="git.version",t}}async function Rk({fs:t,dir:e,gitdir:r=H(e,".git"),trees:i,map:n,reduce:s,iterate:a,cache:o={}}){try{R("fs",t),R("gitdir",r),R("trees",i);let l=new te(t),c=await ie({fsp:l,dotgit:r});return await Ps({fs:l,cache:o,dir:e,gitdir:c,trees:i,map:n,reduce:s,iterate:a})}catch(l){throw l.caller="git.walk",l}}async function $k({fs:t,dir:e,gitdir:r=H(e,".git"),blob:i}){try{R("fs",t),R("gitdir",r),R("blob",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await Or({fs:n,gitdir:s,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}async function Fk({fs:t,dir:e,gitdir:r=H(e,".git"),commit:i}){try{R("fs",t),R("gitdir",r),R("commit",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await bk({fs:n,gitdir:s,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}async function Ik({fs:t,dir:e,gitdir:r=H(e,".git"),type:i,object:n,format:s="parsed",oid:a,encoding:o=void 0}){try{let l=new te(t),c=await ie({fsp:l,dotgit:r});if(s==="parsed"){switch(i){case"commit":n=Dr.from(n).toObject();break;case"tree":n=Mr.from(n).toObject();break;case"blob":n=E.from(n,o);break;case"tag":n=Qr.from(n).toObject();break;default:throw new _r(a||"",i,"blob|commit|tag|tree")}s="content"}return a=await Or({fs:l,gitdir:c,type:i,object:n,oid:a,format:s}),a}catch(l){throw l.caller="git.writeObject",l}}async function Mk({fs:t,dir:e,gitdir:r=H(e,".git"),ref:i,value:n,force:s=!1,symbolic:a=!1}){try{R("fs",t),R("gitdir",r),R("ref",i),R("value",n);let o=new te(t);if(!lu(i,!0))throw new Gi(i,Gc.clean(i));let l=await ie({fsp:o,dotgit:r});if(!s&&await q.exists({fs:o,gitdir:l,ref:i}))throw new Ui("ref",i);a?await q.writeSymbolicRef({fs:o,gitdir:l,ref:i,value:n}):(n=await q.resolve({fs:o,gitdir:l,ref:n}),await q.writeRef({fs:o,gitdir:l,ref:i,value:n}))}catch(o){throw o.caller="git.writeRef",o}}async function CB({fs:t,gitdir:e,tag:r}){let i=Qr.from(r).toObject();return await Or({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}async function Dk({fs:t,dir:e,gitdir:r=H(e,".git"),tag:i}){try{R("fs",t),R("gitdir",r),R("tag",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await CB({fs:n,gitdir:s,tag:i})}catch(n){throw n.caller="git.writeTag",n}}async function Ok({fs:t,dir:e,gitdir:r=H(e,".git"),tree:i}){try{R("fs",t),R("gitdir",r),R("tree",i);let n=new te(t),s=await ie({fsp:n,dotgit:r});return await fu({fs:n,gitdir:s,tree:i})}catch(n){throw n.caller="git.writeTree",n}}var TB={Errors:YE,STAGE:Ea,TREE:Xr,WORKDIR:tl,add:JE,abortMerge:KE,addNote:nS,addRemote:aS,annotatedTag:oS,branch:lS,cherryPick:dS,checkout:Vg,clone:vS,commit:wS,getConfig:IS,getConfigAll:MS,setConfig:wk,currentBranch:bS,deleteBranch:_S,deleteRef:yS,deleteRemote:xS,deleteTag:ES,expandOid:SS,expandRef:kS,fastForward:TS,fetch:PS,findMergeBase:RS,findRoot:FS,getRemoteInfo:DS,getRemoteInfo2:LS,hashBlob:NS,indexPack:BS,init:HS,isDescendent:GS,isIgnored:jS,listBranches:VS,listFiles:WS,listNotes:qS,listRefs:YS,listRemotes:ZS,listServerRefs:KS,listTags:XS,log:JS,merge:ek,packObjects:rk,pull:ik,push:nk,readBlob:ok,readCommit:qg,readNote:lk,readObject:ck,readTag:uk,readTree:fk,remove:dk,removeNote:hk,renameBranch:pk,resetIndex:gk,updateIndex:Tk,resolveRef:vk,status:Sk,statusMatrix:Ak,tag:Ck,version:Pk,walk:Rk,writeBlob:$k,writeCommit:Fk,writeObject:Ik,writeRef:Mk,writeTag:Dk,writeTree:Ok,stash:Ek};Z.Errors=YE;Z.STAGE=Ea;Z.TREE=Xr;Z.WORKDIR=tl;Z.abortMerge=KE;Z.add=JE;Z.addNote=nS;Z.addRemote=aS;Z.annotatedTag=oS;Z.branch=lS;Z.checkout=Vg;Z.cherryPick=dS;Z.clone=vS;Z.commit=wS;Z.currentBranch=bS;Z.default=TB;Z.deleteBranch=_S;Z.deleteRef=yS;Z.deleteRemote=xS;Z.deleteTag=ES;Z.expandOid=SS;Z.expandRef=kS;Z.fastForward=TS;Z.fetch=PS;Z.findMergeBase=RS;Z.findRoot=FS;Z.getConfig=IS;Z.getConfigAll=MS;Z.getRemoteInfo=DS;Z.getRemoteInfo2=LS;Z.hashBlob=NS;Z.indexPack=BS;Z.init=HS;Z.isDescendent=GS;Z.isIgnored=jS;Z.listBranches=VS;Z.listFiles=WS;Z.listNotes=qS;Z.listRefs=YS;Z.listRemotes=ZS;Z.listServerRefs=KS;Z.listTags=XS;Z.log=JS;Z.merge=ek;Z.packObjects=rk;Z.pull=ik;Z.push=nk;Z.readBlob=ok;Z.readCommit=qg;Z.readNote=lk;Z.readObject=ck;Z.readTag=uk;Z.readTree=fk;Z.remove=dk;Z.removeNote=hk;Z.renameBranch=pk;Z.resetIndex=gk;Z.resolveRef=vk;Z.setConfig=wk;Z.stash=Ek;Z.status=Sk;Z.statusMatrix=Ak;Z.tag=Ck;Z.updateIndex=Tk;Z.version=Pk;Z.walk=Rk;Z.writeBlob=$k;Z.writeCommit=Fk;Z.writeObject=Ik;Z.writeRef=Mk;Z.writeTag=Dk;Z.writeTree=Ok});var Vk=U((zz,jk)=>{"use strict";m();jk.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 Wk=U((qz,zk)=>{m();var tv={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}};zk.exports=function(t,e,r,i){if(!tv.hasOwnProperty(r))throw new Error("Cannot convert to "+r);if(!tv[r].hasOwnProperty(e))throw new Error("Cannot convert from "+e+" to "+r);var n=tv[r][e]*t;return i!==!1?(i=Math.pow(10,parseInt(i)||5),Math.round(n*i)/i):n}});var aA=U(Wn=>{"use strict";m();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.fromRgba=sl;Wn.fromRgb=rv;Wn.fromHsla=Id;Wn.fromHsl=nA;Wn.fromString=sA;Wn.default=void 0;var qk=Kk(Vk()),MB=Kk(Wk());function Kk(t){return t&&t.__esModule?t:{default:t}}function DB(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yk(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,i=new Array(e);r-1}function UB(t,e,r){var i=t/255,n=e/255,s=r/255,a=Math.max(i,n,s),o=Math.min(i,n,s),l=a-o,c=(a+o)/2;if(l===0)return[0,0,c*100];var u=l/(1-Math.abs(2*c-1)),f=(function(){switch(a){case i:return(n-s)/l%6;case n:return(s-i)/l+2;default:return(i-n)/l+4}})();return[f*60,u*100,c*100]}function GB(t,e,r){var i=t/60,n=e/100,s=r/100,a=(1-Math.abs(2*s-1))*n,o=a*(1-Math.abs(i%2-1)),l=s-a/2,c=(function(){return i<1?[a,o,0]:i<2?[o,a,0]:i<3?[0,a,o]:i<4?[0,o,a]:i<5?[o,0,a]:[a,0,o]})(),u=yr(c,3),f=u[0],d=u[1],h=u[2];return[(f+l)*255,(d+l)*255,(h+l)*255]}var jB=(function(){function t(e){var r=yr(e,4),i=r[0],n=r[1],s=r[2],a=r[3];DB(this,t),this.values=[Math.max(Math.min(parseInt(i,10),255),0),Math.max(Math.min(parseInt(n,10),255),0),Math.max(Math.min(parseInt(s,10),255),0),a==null?1:Math.max(Math.min(parseFloat(a),255),0)]}return OB(t,[{key:"toRgbString",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return a===1?"rgb(".concat(i,", ").concat(n,", ").concat(s,")"):"rgba(".concat(i,", ").concat(n,", ").concat(s,", ").concat(a,")")}},{key:"toHslString",value:function(){var r=this.toHslaArray(),i=yr(r,4),n=i[0],s=i[1],a=i[2],o=i[3];return o===1?"hsl(".concat(n,", ").concat(s,"%, ").concat(a,"%)"):"hsla(".concat(n,", ").concat(s,"%, ").concat(a,"%, ").concat(o,")")}},{key:"toHexString",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3];return i=Number(i).toString(16).padStart(2,"0"),n=Number(n).toString(16).padStart(2,"0"),s=Number(s).toString(16).padStart(2,"0"),a=a<1?parseInt(a*255,10).toString(16).padStart(2,"0"):"","#".concat(i).concat(n).concat(s).concat(a)}},{key:"toRgbaArray",value:function(){return this.values}},{key:"toHslaArray",value:function(){var r=yr(this.values,4),i=r[0],n=r[1],s=r[2],a=r[3],o=UB(i,n,s),l=yr(o,3),c=l[0],u=l[1],f=l[2];return[c,u,f,a]}}]),t})();function sl(t){var e=yr(t,4),r=e[0],i=e[1],n=e[2],s=e[3];return new jB([r,i,n,s])}function rv(t){var e=yr(t,3),r=e[0],i=e[1],n=e[2];return sl([r,i,n,1])}function Id(t){var e=yr(t,4),r=e[0],i=e[1],n=e[2],s=e[3],a=GB(r,i,n),o=yr(a,3),l=o[0],c=o[1],u=o[2];return sl([l,c,u,s])}function nA(t){var e=yr(t,3),r=e[0],i=e[1],n=e[2];return Id([r,i,n,1])}function VB(t){var e=Xk.exec(t)||Qk.exec(t),r=yr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=parseInt(i.length<2?i.repeat(2):i,16),n=parseInt(n.length<2?n.repeat(2):n,16),s=parseInt(s.length<2?s.repeat(2):s,16),a=a&&(parseInt(a.length<2?a.repeat(2):a,16)/255).toPrecision(1)||1,sl([i,n,s,a])}function zB(t){var e=Jk.exec(t)||tA.exec(t)||eA.exec(t)||rA.exec(t),r=yr(e,5),i=r[1],n=r[2],s=r[3],a=r[4];return i=mu(i,"%")?parseInt(i,10)*255/100:parseInt(i,10),n=mu(n,"%")?parseInt(n,10)*255/100:parseInt(n,10),s=mu(s,"%")>0?parseInt(s,10)*255/100:parseInt(s,10),a=a===void 0?1:parseFloat(a)/(mu(a,"%")?100:1),sl([i,n,s,a])}function WB(t){var e=iA.exec(t),r=yr(e,6),i=r[1],n=r[2],s=r[3],a=r[4],o=r[5];return n=n||"deg",i=(0,MB.default)(parseFloat(i),n,"deg"),s=parseFloat(s),a=parseFloat(a),o=o===void 0?1:parseFloat(o)/(mu(o,"%")?100:1),Id([i,s,a,o])}function sA(t){return qk.default[t]?rv(qk.default[t]):Xk.test(t)||Qk.test(t)?VB(t):Jk.test(t)||tA.test(t)||eA.test(t)||rA.test(t)?zB(t):iA.test(t)?WB(t):null}var qB={fromString:sA,fromRgb:rv,fromRgba:sl,fromHsl:nA,fromHsla:Id};Wn.default=qB});var wA=U((n9,vA)=>{m();vA.exports=function(t,e){var r=t,i=e,n=r.length,s=i.length,a=!1,o=n+1,l=[],c=[],u,f,d=function(){n>=s&&(u=r,f=n,r=i,i=u,n=s,s=f,a=!0,o=n+1)},h=function(g,w,y,b,S){return{startX:g,startY:w,endX:y,endY:b,r:S}},p=function(g,w,y){var b,S,C,A,k;for(w>y?b=l[g-1+o]:b=l[g+1+o],k=C=Math.max(w,y),A=S=C-g;S=g+1;--A)y[A+o]=p(A,y[A-1+o]+1,y[A+1+o]);y[g+o]=p(g,y[g-1+o]+1,y[g+1+o])}while(y[g+o]!==s);for(ed=g+2*b,S=l[g+o],k=n,v=s,x=[];S!==-1;){let _=c[S];(n!=_.endX||s!=_.endY)&&x.push({file1:[a?_.endY:_.endX,a?v-_.endY:k-_.endX],file2:[a?_.endX:_.endY,a?k-_.endX:v-_.endY]}),k=_.startX,v=_.startY,S=c[S].r}return(k!=0||v!=0)&&x.push({file1:[0,a?v:k],file2:[0,a?k:v]}),x.reverse(),x}}}});var yA=U((a9,_A)=>{m();var bA=wA();function KB(t,e,r){var i,n=new bA(e,t).compose(),s=new bA(e,r).compose(),a=[];function o($,D){a.push([$.file1[0],D,$.file1[1],$.file2[0],$.file2[1]])}for(i=0;ic&&(l.push([1,c,$-c]),c=$)}for(var f=0;fg)break;g=Math.max(g,y+w[2]),f++}if(u(p),d==f)h[4]>0&&l.push([h[1],h[3],h[4]]);else{var b={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=f;i++){h=a[i];var S=h[1],C=b[S],A=h[0],k=A+h[2],v=h[3],x=v+h[4];C[0]=Math.min(v,C[0]),C[1]=Math.max(x,C[1]),C[2]=Math.min(A,C[2]),C[3]=Math.max(k,C[3])}var _=b[0][0]+(p-b[0][2]),P=b[0][1]+(g-b[0][3]),T=b[2][0]+(p-b[2][2]),M=b[2][1]+(g-b[2][3]);l.push([-1,_,P-_,p,g-p,T,M-T])}c=g}return u(e.length),l}function XB(t,e,r){var i=[],n=[t,e,r],s=KB(t,e,r),a=[];function o(){a.length&&i.push({ok:a}),a=[]}function l(h){for(var p=0;p{m();var ul=1e3,fl=ul*60,dl=fl*60,Aa=dl*24,e3=Aa*7,t3=Aa*365.25;EA.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return r3(t);if(r==="number"&&isFinite(t))return e.long?n3(t):i3(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function r3(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*t3;case"weeks":case"week":case"w":return r*e3;case"days":case"day":case"d":return r*Aa;case"hours":case"hour":case"hrs":case"hr":case"h":return r*dl;case"minutes":case"minute":case"mins":case"min":case"m":return r*fl;case"seconds":case"second":case"secs":case"sec":case"s":return r*ul;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function i3(t){var e=Math.abs(t);return e>=Aa?Math.round(t/Aa)+"d":e>=dl?Math.round(t/dl)+"h":e>=fl?Math.round(t/fl)+"m":e>=ul?Math.round(t/ul)+"s":t+"ms"}function n3(t){var e=Math.abs(t);return e>=Aa?Ld(t,e,Aa,"day"):e>=dl?Ld(t,e,dl,"hour"):e>=fl?Ld(t,e,fl,"minute"):e>=ul?Ld(t,e,ul,"second"):t+" ms"}function Ld(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var AA=U((w9,kA)=>{m();function s3(t){r.debug=r,r.default=r,r.coerce=l,r.disable=a,r.enable=n,r.enabled=o,r.humanize=SA(),r.destroy=c,Object.keys(t).forEach(u=>{r[u]=t[u]}),r.names=[],r.skips=[],r.formatters={};function e(u){let f=0;for(let d=0;d{if(k==="%%")return"%";C++;let x=r.formatters[v];if(typeof x=="function"){let _=w[C];k=x.call(y,_),w.splice(C,1),C--}return k}),r.formatArgs.call(y,w),(y.log||r.log).apply(y,w)}return g.namespace=u,g.useColors=r.useColors(),g.color=r.selectColor(u),g.extend=i,g.destroy=r.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(h!==r.namespaces&&(h=r.namespaces,p=r.enabled(u)),p),set:w=>{d=w}}),typeof r.init=="function"&&r.init(g),g}function i(u,f){let d=r(this.namespace+(typeof f=="undefined"?":":f)+u);return d.log=this.log,d}function n(u){r.save(u),r.namespaces=u,r.names=[],r.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(u,f){let d=0,h=0,p=-1,g=0;for(;d"-"+f)].join(",");return r.enable(""),u}function o(u){for(let f of r.skips)if(s(u,f))return!1;for(let f of r.names)if(s(u,f))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}kA.exports=s3});var Bd=U((Lr,Nd)=>{m();Lr.formatArgs=o3;Lr.save=l3;Lr.load=c3;Lr.useColors=a3;Lr.storage=u3();Lr.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Lr.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 a3(){if(typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o3(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Nd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}Lr.log=console.debug||console.log||(()=>{});function l3(t){try{t?Lr.storage.setItem("debug",t):Lr.storage.removeItem("debug")}catch(e){}}function c3(){let t;try{t=Lr.storage.getItem("debug")||Lr.storage.getItem("DEBUG")}catch(e){}return!t&&typeof process!="undefined"&&"env"in process&&(t=process.env.DEBUG),t}function u3(){try{return localStorage}catch(t){}}Nd.exports=AA()(Lr);var{formatters:f3}=Nd.exports;f3.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var CA=U(Jr=>{"use strict";m();var d3=Jr&&Jr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Jr,"__esModule",{value:!0});var h3=require("fs"),p3=d3(Bd()),hl=p3.default("@kwsites/file-exists");function m3(t,e,r){hl("checking %s",t);try{let i=h3.statSync(t);return i.isFile()&&e?(hl("[OK] path represents a file"),!0):i.isDirectory()&&r?(hl("[OK] path represents a directory"),!0):(hl("[FAIL] path represents something other than a file or directory"),!1)}catch(i){if(i.code==="ENOENT")return hl("[FAIL] path is not accessible: %o",i),!1;throw hl("[FATAL] %o",i),i}}function g3(t,e=Jr.READABLE){return m3(t,(e&Jr.FILE)>0,(e&Jr.FOLDER)>0)}Jr.exists=g3;Jr.FILE=1;Jr.FOLDER=2;Jr.READABLE=Jr.FILE+Jr.FOLDER});var TA=U(Hd=>{"use strict";m();function v3(t){for(var e in t)Hd.hasOwnProperty(e)||(Hd[e]=t[e])}Object.defineProperty(Hd,"__esModule",{value:!0});v3(CA())});var uv=U(Ca=>{"use strict";m();Object.defineProperty(Ca,"__esModule",{value:!0});Ca.createDeferred=Ca.deferred=void 0;function cv(){let t,e,r="pending";return{promise:new Promise((n,s)=>{t=n,e=s}),done(n){r==="pending"&&(r="resolved",t(n))},fail(n){r==="pending"&&(r="rejected",e(n))},get fulfilled(){return r!=="pending"},get status(){return r}}}Ca.deferred=cv;Ca.createDeferred=cv;Ca.default=cv});var _2=U(()=>{m()});var y2=U(()=>{m()});var rw=U((RW,sh)=>{m();(function(){"use strict";var t="input is invalid type",e=typeof window=="object",r=e?window:{};r.JS_SHA256_NO_WINDOW&&(e=!1);var i=!e&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node&&process.type!="renderer";n?r=global:i&&(r=self);var s=!r.JS_SHA256_NO_COMMON_JS&&typeof sh=="object"&&sh.exports,a=typeof define=="function"&&define.amd,o=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",l="0123456789abcdef".split(""),c=[-2147483648,8388608,32768,128],u=[24,16,8,0],f=[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],d=["hex","array","digest","arrayBuffer"],h=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),o&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(k){return typeof k=="object"&&k.buffer&&k.buffer.constructor===ArrayBuffer});var p=function(k,v){return function(x){return new S(v,!0).update(x)[k]()}},g=function(k){var v=p("hex",k);n&&(v=w(v,k)),v.create=function(){return new S(k)},v.update=function(P){return v.create().update(P)};for(var x=0;x>>2]|=k[P]<>>2]|=_<>>2]|=(192|_>>>6)<>>2]|=(128|_&63)<=57344?($[T>>>2]|=(224|_>>>12)<>>2]|=(128|_>>>6&63)<>>2]|=(128|_&63)<>>2]|=(240|_>>>18)<>>2]|=(128|_>>>12&63)<>>2]|=(128|_>>>6&63)<>>2]|=(128|_&63)<=64?(this.block=$[16],this.start=T-64,this.hash(),this.hashed=!0):this.start=T}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var k=this.blocks,v=this.lastByteIndex;k[16]=this.block,k[v>>>2]|=c[v&3],this.block=k[16],v>=56&&(this.hashed||this.hash(),k[0]=this.block,k[16]=k[1]=k[2]=k[3]=k[4]=k[5]=k[6]=k[7]=k[8]=k[9]=k[10]=k[11]=k[12]=k[13]=k[14]=k[15]=0),k[14]=this.hBytes<<3|this.bytes>>>29,k[15]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var k=this.h0,v=this.h1,x=this.h2,_=this.h3,P=this.h4,T=this.h5,M=this.h6,$=this.h7,D=this.blocks,Q,ye,de,J,X,he,z,K,G,Me,Et;for(Q=16;Q<64;++Q)X=D[Q-15],ye=(X>>>7|X<<25)^(X>>>18|X<<14)^X>>>3,X=D[Q-2],de=(X>>>17|X<<15)^(X>>>19|X<<13)^X>>>10,D[Q]=D[Q-16]+ye+D[Q-7]+de<<0;for(Et=v&x,Q=0;Q<64;Q+=4)this.first?(this.is224?(K=300032,X=D[0]-1413257819,$=X-150054599<<0,_=X+24177077<<0):(K=704751109,X=D[0]-210244248,$=X-1521486534<<0,_=X+143694565<<0),this.first=!1):(ye=(k>>>2|k<<30)^(k>>>13|k<<19)^(k>>>22|k<<10),de=(P>>>6|P<<26)^(P>>>11|P<<21)^(P>>>25|P<<7),K=k&v,J=K^k&x^Et,z=P&T^~P&M,X=$+de+z+f[Q]+D[Q],he=ye+J,$=_+X<<0,_=X+he<<0),ye=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),de=($>>>6|$<<26)^($>>>11|$<<21)^($>>>25|$<<7),G=_&k,J=G^_&v^K,z=$&P^~$&T,X=M+de+z+f[Q+1]+D[Q+1],he=ye+J,M=x+X<<0,x=X+he<<0,ye=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),de=(M>>>6|M<<26)^(M>>>11|M<<21)^(M>>>25|M<<7),Me=x&_,J=Me^x&k^G,z=M&$^~M&P,X=T+de+z+f[Q+2]+D[Q+2],he=ye+J,T=v+X<<0,v=X+he<<0,ye=(v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10),de=(T>>>6|T<<26)^(T>>>11|T<<21)^(T>>>25|T<<7),Et=v&x,J=Et^v&_^Me,z=T&M^~T&$,X=P+de+z+f[Q+3]+D[Q+3],he=ye+J,P=k+X<<0,k=X+he<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+k<<0,this.h1=this.h1+v<<0,this.h2=this.h2+x<<0,this.h3=this.h3+_<<0,this.h4=this.h4+P<<0,this.h5=this.h5+T<<0,this.h6=this.h6+M<<0,this.h7=this.h7+$<<0},S.prototype.hex=function(){this.finalize();var k=this.h0,v=this.h1,x=this.h2,_=this.h3,P=this.h4,T=this.h5,M=this.h6,$=this.h7,D=l[k>>>28&15]+l[k>>>24&15]+l[k>>>20&15]+l[k>>>16&15]+l[k>>>12&15]+l[k>>>8&15]+l[k>>>4&15]+l[k&15]+l[v>>>28&15]+l[v>>>24&15]+l[v>>>20&15]+l[v>>>16&15]+l[v>>>12&15]+l[v>>>8&15]+l[v>>>4&15]+l[v&15]+l[x>>>28&15]+l[x>>>24&15]+l[x>>>20&15]+l[x>>>16&15]+l[x>>>12&15]+l[x>>>8&15]+l[x>>>4&15]+l[x&15]+l[_>>>28&15]+l[_>>>24&15]+l[_>>>20&15]+l[_>>>16&15]+l[_>>>12&15]+l[_>>>8&15]+l[_>>>4&15]+l[_&15]+l[P>>>28&15]+l[P>>>24&15]+l[P>>>20&15]+l[P>>>16&15]+l[P>>>12&15]+l[P>>>8&15]+l[P>>>4&15]+l[P&15]+l[T>>>28&15]+l[T>>>24&15]+l[T>>>20&15]+l[T>>>16&15]+l[T>>>12&15]+l[T>>>8&15]+l[T>>>4&15]+l[T&15]+l[M>>>28&15]+l[M>>>24&15]+l[M>>>20&15]+l[M>>>16&15]+l[M>>>12&15]+l[M>>>8&15]+l[M>>>4&15]+l[M&15];return this.is224||(D+=l[$>>>28&15]+l[$>>>24&15]+l[$>>>20&15]+l[$>>>16&15]+l[$>>>12&15]+l[$>>>8&15]+l[$>>>4&15]+l[$&15]),D},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var k=this.h0,v=this.h1,x=this.h2,_=this.h3,P=this.h4,T=this.h5,M=this.h6,$=this.h7,D=[k>>>24&255,k>>>16&255,k>>>8&255,k&255,v>>>24&255,v>>>16&255,v>>>8&255,v&255,x>>>24&255,x>>>16&255,x>>>8&255,x&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255,P>>>24&255,P>>>16&255,P>>>8&255,P&255,T>>>24&255,T>>>16&255,T>>>8&255,T&255,M>>>24&255,M>>>16&255,M>>>8&255,M&255];return this.is224||D.push($>>>24&255,$>>>16&255,$>>>8&255,$&255),D},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var k=new ArrayBuffer(this.is224?28:32),v=new DataView(k);return v.setUint32(0,this.h0),v.setUint32(4,this.h1),v.setUint32(8,this.h2),v.setUint32(12,this.h3),v.setUint32(16,this.h4),v.setUint32(20,this.h5),v.setUint32(24,this.h6),this.is224||v.setUint32(28,this.h7),k};function C(k,v,x){var _,P=typeof k;if(P==="string"){var T=[],M=k.length,$=0,D;for(_=0;_>>6,T[$++]=128|D&63):D<55296||D>=57344?(T[$++]=224|D>>>12,T[$++]=128|D>>>6&63,T[$++]=128|D&63):(D=65536+((D&1023)<<10|k.charCodeAt(++_)&1023),T[$++]=240|D>>>18,T[$++]=128|D>>>12&63,T[$++]=128|D>>>6&63,T[$++]=128|D&63);k=T}else if(P==="object"){if(k===null)throw new Error(t);if(o&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!o||!ArrayBuffer.isView(k)))throw new Error(t)}else throw new Error(t);k.length>64&&(k=new S(v,!0).update(k).array());var Q=[],ye=[];for(_=0;_<64;++_){var de=k[_]||0;Q[_]=92^de,ye[_]=54^de}S.call(this,v,x),this.update(ye),this.oKeyPad=Q,this.inner=!0,this.sharedMemory=x}C.prototype=new S,C.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var k=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(k),S.prototype.finalize.call(this)}};var A=g();A.sha256=A,A.sha224=g(!0),A.sha256.hmac=b(),A.sha224.hmac=b(!0),s?sh.exports=A:(r.sha256=A.sha256,r.sha224=A.sha224,a&&define(function(){return A}))})()});var rR=U(jw=>{m();(function(t){var e=/\S/,r=/\"/g,i=/\n/g,n=/\r/g,s=/\\/g,a=/\u2028/,o=/\u2029/;t.tags={"#":1,"^":2,"<":3,$:4,"/":5,"!":6,">":7,"=":8,_v:9,"{":10,"&":11,_t:12},t.scan=function(x,_){var P=x.length,T=0,M=1,$=2,D=T,Q=null,ye=null,de="",J=[],X=!1,he=0,z=0,K="{{",G="}}";function Me(){de.length>0&&(J.push({tag:"_t",text:new String(de)}),de="")}function Et(){for(var Rt=!0,$t=z;$t"&&(re.indent=J[Xe].text.toString()),J.splice(Xe,1));else $t||J.push({tag:` +`});X=!1,z=J.length}function De(Rt,$t){var Xe="="+G,re=Rt.indexOf(Xe,$t),B=c(Rt.substring(Rt.indexOf("=",$t)+1,re)).split(" ");return K=B[0],G=B[B.length-1],re+Xe.length-1}for(_&&(_=_.split(" "),K=_[0],G=_[1]),he=0;he0;){if(D=v.shift(),$&&$.tag=="<"&&!(D.tag in f))throw new Error("Illegal content in < super tag.");if(t.tags[D.tag]<=t.tags.$||h(D,P))_.push(D),D.nodes=d(v,D.tag,_,P);else if(D.tag=="/"){if(_.length===0)throw new Error("Closing tag without opener: /"+D.n);if(M=_.pop(),D.n!=M.n&&!p(D.n,M.n,P))throw new Error("Nesting error: "+M.n+" vs. "+D.n);return M.end=D.i,T}else D.tag==` +`&&(D.last=v.length==0||v[0].tag==` +`);T.push(D)}if(_.length>0)throw new Error("missing closing tag: "+_.pop().n);return T}function h(v,x){for(var _=0,P=x.length;_":C,"<":function(v,x){var _={partials:{},code:"",subs:{},inPartial:!0};t.walk(v.nodes,_);var P=x.partials[C(v,x)];P.subs=_.subs,P.partials=_.partials},$:function(v,x){var _={subs:{},code:"",partials:x.partials,prefix:v.n};t.walk(v.nodes,_),x.subs[v.n]=_.code,x.inPartial||(x.code+='t.sub("'+b(v.n)+'",c,p,i);')},"\n":function(v,x){x.code+=k('"\\n"'+(v.last?"":" + i"))},_v:function(v,x){x.code+="t.b(t.v(t."+S(v.n)+'("'+b(v.n)+'",c,p,0)));'},_t:function(v,x){x.code+=k('"'+b(v.text)+'"')},"{":A,"&":A};function A(v,x){x.code+="t.b(t.t(t."+S(v.n)+'("'+b(v.n)+'",c,p,0)));'}function k(v){return"t.b("+v+");"}t.walk=function(v,x){for(var _,P=0,T=v.length;P{m();var c4={};(function(t){t.Template=function(d,h,p,g){d=d||{},this.r=d.code||this.r,this.c=p,this.options=g||{},this.text=h||"",this.partials=d.partials||{},this.subs=d.subs||{},this.buf=""},t.Template.prototype={r:function(d,h,p){return""},v:u,t:c,render:function(h,p,g){return this.ri([h],p||{},g)},ri:function(d,h,p){return this.r(d,h,p)},ep:function(d,h){var p=this.partials[d],g=h[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[d].base=g,p.subs){h.stackText||(h.stackText={});for(key in p.subs)h.stackText[key]||(h.stackText[key]=this.activeSub!==void 0&&h.stackText[this.activeSub]?h.stackText[this.activeSub]:this.text);g=r(g,p.subs,p.partials,this.stackSubs,this.stackPartials,h.stackText)}return this.partials[d].instance=g,g},rp:function(d,h,p,g){var w=this.ep(d,p);return w?w.ri(h,p,g):""},rs:function(d,h,p){var g=d[d.length-1];if(!f(g)){p(d,h,this);return}for(var w=0;w=0;C--)if(y=h[C],w=e(d,y,S),w!==void 0){b=!0;break}return b?(!g&&typeof w=="function"&&(w=this.mv(w,h,p)),w):g?!1:""},ls:function(d,h,p,g,w,y){var b=this.options.delimiters;return this.options.delimiters=y,this.b(this.ct(c(d.call(h,w,p)),h,g)),this.options.delimiters=b,!1},ct:function(d,h,p){if(this.options.disableLambda)throw new Error("Lambda features disabled.");return this.c.compile(d,this.options).render(h,p)},b:function(d){this.buf+=d},fl:function(){var d=this.buf;return this.buf="",d},ms:function(d,h,p,g,w,y,b){var S,C=h[h.length-1],A=d.call(C);return typeof A=="function"?g?!0:(S=this.activeSub&&this.subsText&&this.subsText[this.activeSub]?this.subsText[this.activeSub]:this.text,this.ls(A,C,h,p,S.substring(w,y),b)):A},mv:function(d,h,p){var g=h[h.length-1],w=d.call(g);return typeof w=="function"?this.ct(c(w.call(g)),g,p):w},sub:function(d,h,p,g){var w=this.subs[d];w&&(this.activeSub=d,w(h,p,this,g),this.activeSub=!1)}};function e(d,h,p){var g;return h&&typeof h=="object"&&(h[d]!==void 0?g=h[d]:p&&h.get&&typeof h.get=="function"&&(g=h.get(d))),g}function r(d,h,p,g,w,y){function b(){}b.prototype=d;function S(){}S.prototype=d.subs;var C,A=new b;A.subs=new S,A.subsText={},A.buf="",g=g||{},A.stackSubs=g,A.subsText=y;for(C in h)g[C]||(g[C]=h[C]);for(C in g)A.subs[C]=g[C];w=w||{},A.stackPartials=w;for(C in p)w[C]||(w[C]=p[C]);for(C in w)A.partials[C]=w[C];return A}var i=/&/g,n=//g,a=/\'/g,o=/\"/g,l=/[&<>\"\']/;function c(d){return String(d==null?"":d)}function u(d){return d=c(d),l.test(d)?d.replace(i,"&").replace(n,"<").replace(s,">").replace(a,"'").replace(o,"""):d}var f=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}})(typeof Vw!="undefined"?Vw:c4)});var zw=U((hY,nR)=>{m();var Bh=rR();Bh.Template=iR().Template;Bh.template=Bh.Template;nR.exports=Bh});var oR=U(Ai=>{"use strict";m();Object.defineProperty(Ai,"__esModule",{value:!0});Ai.ColorSchemeType=Ai.DiffStyleType=Ai.LineMatchingType=Ai.OutputFormatType=Ai.LineType=void 0;var sR;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(sR||(Ai.LineType=sR={}));Ai.OutputFormatType={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"};Ai.LineMatchingType={LINES:"lines",WORDS:"words",NONE:"none"};Ai.DiffStyleType={WORD:"word",CHAR:"char"};var aR;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(aR||(Ai.ColorSchemeType=aR={}))});var pG={};DF(pG,{default:()=>Vp});module.exports=OF(pG);m();var hF=Gt(Yg(),1),Se=require("obsidian"),pF=Gt(require("path"),1),zp=Gt(require("fs/promises"),1);m();var zt={};m();var Cd=class{constructor(e){this.plugin=e;this.tasks=[]}addTask(e,r){this.tasks.push({task:e,onFinished:r!=null?r:(()=>{})}),this.tasks.length===1&&this.handleTask()}handleTask(){if(this.tasks.length>0){let e=this.tasks[0];e.task().then(r=>{e.onFinished(r),this.tasks.shift(),this.handleTask()},r=>{this.plugin.displayError(r),e.onFinished(void 0),this.tasks.shift(),this.handleTask()})}}clear(){this.tasks=[]}};m();var j=require("obsidian");m();var Lk=require("obsidian"),Td="YYYY-MM-DD",Zg=`${Td} HH:mm`,Kg=`${Td} HH:mm:ss`,Pd=40,il="conflict-files-obsidian-git.md",pt={commitMessage:"vault backup: {{date}}",autoCommitMessage:"vault backup: {{date}}",commitMessageScript:"",commitDateFormat:Kg,autoSaveInterval:0,autoPushInterval:0,autoPullInterval:0,autoPullOnBoot:!1,autoCommitOnlyStaged:!1,disablePush:!1,pullBeforePush:!0,disablePopups:!1,showErrorNotices:!0,disablePopupsForNoChanges:!1,listChangedFilesInMessageBody:!1,showStatusBar:!0,updateSubmodules:!1,syncMethod:"merge",mergeStrategy:"none",customMessageOnAutoBackup:!1,autoBackupAfterFileChange:!1,treeStructure:!1,refreshSourceControl:Lk.Platform.isDesktopApp,basePath:"",differentIntervalCommitAndPush:!1,changedFilesInStatusBar:!1,showedMobileNotice:!1,refreshSourceControlTimer:7e3,showBranchStatusBar:!0,setLastSaveToLastCommit:!1,submoduleRecurseCheckout:!1,gitDir:"",showFileMenu:!0,authorInHistoryView:"hide",dateInHistoryView:!1,diffStyle:"split",hunks:{showSigns:!1,hunkCommands:!1,statusBar:"disabled"},lineAuthor:{show:!1,followMovement:"inactive",authorDisplay:"initials",showCommitHash:!1,dateTimeFormatOptions:"date",dateTimeFormatCustomString:Zg,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}},Qt={type:"git-view",name:"Source Control",icon:"git-pull-request"},bi={type:"git-history-view",name:"History",icon:"history"},Ms={type:"split-diff-view",name:"Diff view",icon:"diff"},Ds={type:"diff-view",name:"Diff View",icon:"git-pull-request"},Rd="C:\\Program Files\\Git\\cmd\\git.exe",$d=".git_credentials_input",Sa="obsidian_askpass.sh",Nk=`#!/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" +`,Bk=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];m();m();m();var hu=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&p+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,w=1/0,y=()=>{for(let b=Math.max(g,-c);b<=Math.min(w,c);b+=2){let S,C=h[b-1],A=h[b+1];C&&(h[b-1]=void 0);let k=!1;if(A){let x=A.oldPos-b;k=A&&0<=x&&x=l&&p+1>=o)return a(this.buildValues(S.lastComponent,r,e))||!0;h[b]=S,S.oldPos+1>=l&&(w=Math.min(w,b-1)),p+1>=o&&(g=Math.max(g,b+1))}c++};if(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);y()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=y();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1d.length?p:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return n}};m();var Xg=class extends hu{constructor(){super(...arguments),this.tokenize=RB}equals(e,r,i){return i.ignoreWhitespace?((!i.newlineIsToken||!e.includes(` +`))&&(e=e.trim()),(!i.newlineIsToken||!r.includes(` +`))&&(r=r.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(e.endsWith(` +`)&&(e=e.slice(0,-1)),r.endsWith(` +`)&&(r=r.slice(0,-1))),super.equals(e,r,i)}},PB=new Xg;function Qg(t,e,r){return PB.diff(t,e,r)}function RB(t,e){e.stripTrailingCr&&(t=t.replace(/\r\n/g,` +`));let r=[],i=t.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let n=0;n"~"||t[e]==='"'||t[e]==="\\")return!0;return!1}function Os(t){if(!$B(t))return t;let e='"',r=new TextEncoder().encode(t),i=0;for(;i=32&&n<=126?e+=String.fromCharCode(n):e+="\\"+n.toString(8).padStart(3,"0"),i++}return e+='"',e}var Jg={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function ev(t,e,r,i,n,s,a){let o;a?typeof a=="function"?o={callback:a}:o=a:o={},typeof o.context=="undefined"&&(o.context=4);let l=o.context;if(o.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(o.callback){let{callback:u}=o;Qg(r,i,Object.assign(Object.assign({},o),{callback:f=>{let d=c(f);u(d)}}))}else return c(Qg(r,i,o));function c(u){if(!u)return;u.push({value:"",lines:[]});function f(b){return b.map(function(S){return" "+S})}let d=[],h=0,p=0,g=[],w=1,y=1;for(let b=0;b0?f(A.lines.slice(-l)):[],h-=g.length,p-=g.length)}for(let A of C)g.push((S.added?"+":"-")+A);S.added?y+=C.length:w+=C.length}else{if(h)if(C.length<=l*2&&b1&&!e.includeFileHeaders&&!t.every(u=>u.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return t.map(u=>Fd(u,e)).join(` +`)}let l=[];if(t.isGit){if(e=Jg,!t.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!t.newFileName)throw new Error("newFileName must be specified for Git patches");let u=t.oldFileName,f=t.newFileName;t.isCreate&&u==="/dev/null"?u=f.replace(/^b\//,"a/"):t.isDelete&&f==="/dev/null"&&(f=u.replace(/^a\//,"b/")),l.push("diff --git "+Os(u)+" "+Os(f)),t.isDelete&&l.push("deleted file mode "+((r=t.oldMode)!==null&&r!==void 0?r:"100644")),t.isCreate&&l.push("new file mode "+((i=t.newMode)!==null&&i!==void 0?i:"100644")),t.oldMode&&t.newMode&&!t.isDelete&&!t.isCreate&&(l.push("old mode "+t.oldMode),l.push("new mode "+t.newMode)),t.isRename&&(l.push("rename from "+Os(((n=t.oldFileName)!==null&&n!==void 0?n:"").replace(/^a\//,""))),l.push("rename to "+Os(((s=t.newFileName)!==null&&s!==void 0?s:"").replace(/^b\//,"")))),t.isCopy&&(l.push("copy from "+Os(((a=t.oldFileName)!==null&&a!==void 0?a:"").replace(/^a\//,""))),l.push("copy to "+Os(((o=t.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,""))))}else e.includeIndex&&t.oldFileName==t.newFileName&&t.oldFileName!==void 0&&l.push("Index: "+t.oldFileName),e.includeUnderline&&l.push("===================================================================");let c=t.hunks.length>0;e.includeFileHeaders&&t.oldFileName!==void 0&&t.newFileName!==void 0&&(!t.isGit||c)&&(l.push("--- "+Os(t.oldFileName)+(t.oldHeader?" "+t.oldHeader:"")),l.push("+++ "+Os(t.newFileName)+(t.newHeader?" "+t.newHeader:"")));for(let u=0;u{o(l?Fd(l,a.headerOptions):void 0)}}))}else{let o=ev(t,e,r,i,n,s,a);return o?Fd(o,a==null?void 0:a.headerOptions):void 0}}function pu(t,e,r,i,n,s){return Hk(t,t,e,r,i,n,s)}function FB(t){let e=t.endsWith(` +`),r=t.split(` +`).map(i=>i+` +`);return e?r.pop():r.push(r.pop().slice(0,-1)),r}var se=Gt(Yg(),1),ka=require("obsidian");m();function Uk(t,e){let r=Object.assign({},t.lineAuthor,e.lineAuthor);return Object.assign({},t,e,{lineAuthor:r})}var nl=class extends Error{constructor(r){super("No network connection available");this.originalError=r}};m();var Gk=require("obsidian"),IB={options:[],placeholder:"",allowEmpty:!1,onlySelection:!1,initialValue:void 0,obscure:!1},tt=class extends Gk.SuggestModal{constructor(e,r){if(super(e.app),this.config={...IB,...r},this.setPlaceholder(this.config.placeholder),this.config.obscure){this.inputEl.type="password";let i=this.containerEl.querySelector(".prompt-input-container");i.addClass("git-obscure-prompt"),i.setAttr("git-is-obscured","true");let n=i==null?void 0:i.createDiv({cls:"search-input-clear-button"});n.style.marginRight="32px",n.id="git-show-password",n.addEventListener("click",()=>{i.getAttr("git-is-obscured")==="true"?(this.inputEl.type="text",i.setAttr("git-is-obscured","false")):(this.inputEl.type="password",i.setAttr("git-is-obscured","true"))})}}openAndGetResult(){return new Promise(e=>{this.resolve=e,this.open(),this.config.initialValue!=null&&(this.inputEl.value=this.config.initialValue,this.inputEl.dispatchEvent(new Event("input")))})}onClose(){new Promise(e=>window.setTimeout(e,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(e){return this.config.onlySelection?this.config.options:this.config.allowEmpty?[e.length>0?e:" ",...this.config.options]:[e.length>0?e:"...",...this.config.options]}renderSuggestion(e,r){this.config.obscure?r.hide():r.setText(e)}onChooseSuggestion(e,r){if(this.resolve){let i;this.config.allowEmpty&&e===" "?i="":e==="..."?i=void 0:i=e,this.resolve(i)}}};m();var oA=Gt(aA(),1),lA=require("child_process"),qn=require("obsidian");function Md(t){throw new Error(`Unexpected object: ${t}`)}function gu(t,e,r){return t===1?`${t} ${e}`:`${t} ${r!=null?r:e+"s"}`}var iv=(t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e);function ji(t,e){let r;if(e){if(e.button===0||e.button===1){let i=qn.Keymap.isModEvent(e);r=t.workspace.getLeaf(i)}}else r=t.workspace.getLeaf(!1);return r}function bn(t,e,r,i,n){if(e.button==2){let s=t.vault.getAbstractFileByPath(r);if(s!=null){let a=new qn.Menu;t.workspace.trigger("file-menu",a,s,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}else{let a=new qn.Menu;t.workspace.trigger("obsidian-git:menu",a,r,n,i),a.showAtPosition({x:e.pageX,y:e.pageY})}}}function Ls(t){throw new Error("Impossible branch: "+t)}function nv(t){return`rgb(${t.r},${t.g},${t.b})`}function cA(t){var s;let e=(s=oA.fromString(t))==null?void 0:s.toRgbaArray();if(e===void 0)return;let[r,i,n]=e;return{r,g:i,b:n}}function uA(t){return t.diff(qn.moment.unix(0),"seconds")}function fA(t){if(t.length!==0)return t.slice().sort()[Math.floor(t.length/2)]}function vu(t,e){return new Proxy(t,{get(r,i){return i==="length"?Math.min(e,r.length):r[i]}})}function dA(t,e,r){return t.length<=e?new Array(e-t.length).fill(r).join("")+t:t.substring(t.length-e)}function hA(t,e){if(e<=0)return t;let r=new Array(e).fill(" ").join(""),i=t.substring(e,t.length);return r+i}function sv(t,e,r){return t<=e&&e<=r}function Yn(t){let[e,...r]=t.split("/");return[e,r.length===0?void 0:r.join("/")]}function _n(t){return t.endsWith("/")?t:t.split("/").last().replace(/\.md$/,"")}function pA(t){return t===1?"1 minute":`${t} minutes`}function YB(t){let e=t.lastIndexOf(".");return t.substring(e+1)}function al(t){if(t.endsWith(".md"))return!1;let e=YB(t);return Bk.includes(e)}function av(t){return(t.startsWith("https://github.com/")||t.startsWith("https://gitlab.com/"))&&(t.endsWith(".git")||(t=t+".git")),t}function ol(t,e){let r=e.vault.getAbstractFileByPath(t);if(!(r instanceof qn.TFile))return!1;try{return!!e.viewRegistry.getTypeByExtension(r.extension)}catch(i){return!0}}function mA({isFolder:t,gitRelativePath:e}){let r="/";return r+=e,t&&(r+="/"),r.replace(/([\\!#*?[\]])/g,String.raw`\$1`).replace(/\s(?=\s*$)/g,String.raw`\ `)}function ll(t,e,r,i){let n=e.target;t.workspace.trigger("hover-link",{event:e,source:r.getViewType(),hoverParent:r,targetEl:n,linktext:i})}function wu(t,e,r={}){return new Promise((i,n)=>{let s=(0,lA.spawn)(t,e,r),a="",o="";s.stdout.on("data",l=>{a+=l.toString()}),s.stderr.on("data",l=>{o+=l.toString()}),s.on("error",l=>{i({error:new Error(l.message),stdout:a,stderr:a,code:1})}),s.on("close",l=>{i({stdout:a,stderr:o,code:l!=null?l:1,error:void 0})})})}m();var gA=require("os"),Dd=require("obsidian"),cl=class{constructor(e){this.plugin=e,this.app=e.app}getRelativeVaultPath(e){return this.plugin.settings.basePath?this.plugin.settings.basePath+"/"+e:e}getRelativeRepoPath(e,r=!0){return r&&this.plugin.settings.basePath.length>0?e.substring(this.plugin.settings.basePath.length+1):e}unload(){}_getTreeStructure(e,r=0){let i=[];for(e=[...e];e.length>0;){let n=e.first(),s=n.path.substring(r);if(s.contains("/")){let a=s.substring(0,s.indexOf("/")),o=e.filter(c=>c.path.substring(r).startsWith(a+"/"));o.forEach(c=>e.remove(c));let l=n.path.substring(0,s.indexOf("/")+r);i.push({title:a,path:l,vaultPath:this.getRelativeVaultPath(l),children:this._getTreeStructure(o,(r>0?r+a.length:a.length)+1)})}else i.push({title:s,data:n,path:n.path,vaultPath:this.getRelativeVaultPath(n.path)}),e.remove(n)}return i}simplify(e){var r,i,n,s;for(let a of e){for(;;){let o=((r=a.children)==null?void 0:r.length)==1,l=((n=(i=a.children)==null?void 0:i.first())==null?void 0:n.data)==null;if(!(a.children!=null&&o&&l))break;let c=a.children.first();a.title+="/"+c.title,a.data=c.data,a.path=c.path,a.vaultPath=c.vaultPath,a.children=c.children}a.children!=null&&this.simplify(a.children),(s=a.children)==null||s.sort((o,l)=>{let c=(l.data==null?1:0)-(o.data==null?1:0);return c!=0?c:o.title.localeCompare(l.title)})}return e.sort((a,o)=>{let l=(o.data==null?1:0)-(a.data==null?1:0);return l!=0?l:a.title.localeCompare(o.title)})}getTreeStructure(e){let r=this._getTreeStructure(e);return this.simplify(r)}async formatCommitMessage(e){let r;if(e.includes("{{numFiles}}")){r=await this.status();let i=r.staged.length;e=e.replace("{{numFiles}}",String(i))}if(e.includes("{{hostname}}")){let i=this.plugin.localStorage.getHostname()||"";!i&&Dd.Platform.isDesktopApp&&(i=(0,gA.hostname)()),e=e.replace("{{hostname}}",i)}if(e.includes("{{files}}")){r=r!=null?r:await this.status();let i={},n="";if(r.staged.length<100){r.staged.forEach(a=>{a.index in i?i[a.index].push(a.path):i[a.index]=[a.path]});let s=[];for(let[a,o]of Object.entries(i))s.push(a+" "+o.join(" "));n=s.join(", ")}else n="Too many files to list";e=e.replace("{{files}}",n)}if(e=e.replace("{{date}}",(0,Dd.moment)().format(this.plugin.settings.commitDateFormat)),this.plugin.settings.listChangedFilesInMessageBody){let i=r!=null?r:await this.status(),n="";i.staged.length<100?n=i.staged.map(s=>s.path).join(` +`):n="Too many files to list",e=e+` + +Affected files: +`+n}return e}};m();var Ns=require("obsidian"),Od=class{constructor(e,r){this.plugin=r;this.promises={};this.adapter=e.adapter,this.vault=e,this.lastBasePath=this.plugin.settings.basePath,this.promises.readFile=this.readFile.bind(this),this.promises.writeFile=this.writeFile.bind(this),this.promises.readdir=this.readdir.bind(this),this.promises.mkdir=this.mkdir.bind(this),this.promises.rmdir=this.rmdir.bind(this),this.promises.stat=this.stat.bind(this),this.promises.unlink=this.unlink.bind(this),this.promises.lstat=this.lstat.bind(this),this.promises.readlink=this.readlink.bind(this),this.promises.symlink=this.symlink.bind(this)}async readFile(e,r){var i;if(this.maybeLog("Read: "+e+JSON.stringify(r)),r=="utf8"||r.encoding=="utf8"){let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?(this.maybeLog("Reuse"),this.vault.read(n)):this.adapter.read(e)}else{if(e.endsWith(this.gitDir+"/index"))return this.plugin.settings.basePath!=this.lastBasePath?(this.clearIndex(),this.lastBasePath=this.plugin.settings.basePath,this.adapter.readBinary(e)):(i=this.index)!=null?i:this.adapter.readBinary(e);let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?(this.maybeLog("Reuse"),this.vault.readBinary(n)):this.adapter.readBinary(e)}}async writeFile(e,r){if(this.maybeLog("Write: "+e),typeof r=="string"){let i=this.vault.getAbstractFileByPath(e);return i instanceof Ns.TFile?this.vault.modify(i,r):this.adapter.write(e,r)}else{let i=ZB(r);if(e.endsWith(this.gitDir+"/index"))this.index=i,this.indexmtime=Date.now();else{let n=this.vault.getAbstractFileByPath(e);return n instanceof Ns.TFile?this.vault.modifyBinary(n,i):this.adapter.writeBinary(e,i)}}}async readdir(e){e==="."&&(e="/");let r=await this.adapter.list(e),i=[...r.files,...r.folders],n;return e!=="/"?n=i.map(s=>(0,Ns.normalizePath)(s.substring(e.length))):n=i,n}async mkdir(e){return this.adapter.mkdir(e)}async rmdir(e,r){var i,n;return this.adapter.rmdir(e,(n=(i=r==null?void 0:r.options)==null?void 0:i.recursive)!=null?n:!1)}async stat(e){if(e.endsWith(this.gitDir+"/index")){if(this.index!==void 0&&this.indexctime!=null&&this.indexmtime!=null)return{isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1,size:this.index.byteLength,type:"file",ctimeMs:this.indexctime,mtimeMs:this.indexmtime};{let i=await this.adapter.stat(e);if(i==null)throw{code:"ENOENT"};return this.indexctime=i.ctime,this.indexmtime=i.mtime,{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1}}}e==="."&&(e="/");let r=this.vault.getAbstractFileByPath(e);if(this.maybeLog("Stat: "+e),r instanceof Ns.TFile)return this.maybeLog("Reuse stat"),{ctimeMs:r.stat.ctime,mtimeMs:r.stat.mtime,size:r.stat.size,type:"file",isFile:()=>!0,isDirectory:()=>!1,isSymbolicLink:()=>!1};{let i=await this.adapter.stat(e);if(i)return{ctimeMs:i.ctime,mtimeMs:i.mtime,size:i.size,type:i.type==="folder"?"directory":i.type,isFile:()=>i.type==="file",isDirectory:()=>i.type==="folder",isSymbolicLink:()=>!1};throw{code:"ENOENT"}}}async unlink(e){return this.adapter.remove(e)}async lstat(e){return this.stat(e)}async readlink(e){throw new Error(`readlink of (${e}) is not implemented.`)}async symlink(e){throw new Error(`symlink of (${e}) is not implemented.`)}async saveAndClear(){this.index!==void 0&&await this.adapter.writeBinary(this.plugin.gitManager.getRelativeVaultPath(this.gitDir+"/index"),this.index,{ctime:this.indexctime,mtime:this.indexmtime}),this.clearIndex()}clearIndex(){this.index=void 0,this.indexctime=void 0,this.indexmtime=void 0}get gitDir(){return this.plugin.settings.gitDir||".git"}maybeLog(e){}};function ZB(t){return t instanceof ArrayBuffer?t:t.buffer instanceof ArrayBuffer&&t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t.buffer,t.byteOffset,t.byteLength).slice().buffer}var xA=Gt(yA(),1),Vi=class extends cl{constructor(r){super(r);this.FILE=0;this.HEAD=1;this.WORKDIR=2;this.STAGE=3;this.status_mapping={"000":" ","003":"AD","020":"??","022":"A ","023":"AM",100:"D ",101:" D",103:"MD",110:"DA",111:" ",113:"MM",120:"DA",121:" M",122:"M ",123:"MM"};this.noticeLength=999999;this.fs=new Od(this.app.vault,this.plugin)}getRepo(){return{fs:this.fs,dir:this.plugin.settings.basePath,gitdir:this.plugin.settings.gitDir||void 0,onAuth:()=>{var r,i;return{username:(r=this.plugin.localStorage.getUsername())!=null?r:void 0,password:(i=this.plugin.localStorage.getPassword())!=null?i:void 0}},onAuthFailure:async()=>{new ka.Notice("Authentication failed. Please try with different credentials");let r=await new tt(this.plugin,{placeholder:"Specify your username"}).openAndGetResult();if(r){let i=await new tt(this.plugin,{placeholder:"Specify your password/personal access token",obscure:!0}).openAndGetResult();if(i)return this.plugin.localStorage.setUsername(r),this.plugin.localStorage.setPassword(i),{username:r,password:i}}return{cancel:!0}},http:{async request({url:r,method:i,headers:n,body:s}){let a;s&&(a=await JB(s));let o=await(0,ka.requestUrl)({url:r,method:i,headers:n,body:a,throw:!1});return{url:r,method:i,headers:o.headers,body:QB(o.arrayBuffer),statusCode:o.status,statusMessage:o.status.toString()}}}}}async wrapFS(r){try{let i=await r;return await this.fs.saveAndClear(),i}catch(i){throw await this.fs.saveAndClear(),i}}async status(r){let i,n=window.setTimeout(()=>{i=new ka.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{this.plugin.setPluginState({gitAction:1});let s={...this.getRepo()};(r==null?void 0:r.path)!=null&&(s.filepaths=[`${r.path}/`]);let a=(await this.wrapFS(se.default.statusMatrix(s))).map(f=>this.getFileStatusResult(f)),o=[],l=[],c=[];for(let f of a)f.workingDir!==" "&&o.push(f),f.index!==" "&&f.index!=="U"&&l.push(f),(f.index!=" "||f.workingDir!=" ")&&c.push(f);let u=[];return window.clearTimeout(n),i==null||i.hide(),{all:c,changed:o,staged:l,conflicted:u}}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async commitAll({message:r,status:i,unstagedFiles:n}){try{return await this.checkAuthorInfo(),await this.stageAll({status:i,unstagedFiles:n}),this.commit({message:r})}catch(s){throw this.plugin.displayError(s),s}}async commit({message:r}){try{await this.checkAuthorInfo(),this.plugin.setPluginState({gitAction:4});let i=await this.formatCommitMessage(r),n=this.plugin.localStorage.getConflict(),s;if(n){let a=await this.branchInfo();s=[a.current,a.tracking]}await this.wrapFS(se.default.commit({...this.getRepo(),message:i,parent:s})),this.plugin.localStorage.setConflict(!1);return}catch(i){throw this.plugin.displayError(i),i}}async stage(r,i){let n=this.getRelativeRepoPath(r,i),s;i?s=r:s=this.getRelativeVaultPath(r);try{this.plugin.setPluginState({gitAction:3}),await this.app.vault.adapter.exists(s)?await this.wrapFS(se.default.add({...this.getRepo(),filepath:n})):await this.wrapFS(se.default.remove({...this.getRepo(),filepath:n}))}catch(a){throw this.plugin.displayError(a),a}}async stageAll({dir:r,status:i,unstagedFiles:n}){try{if(i)await Promise.all(i.changed.map(s=>s.workingDir!=="D"?this.wrapFS(se.default.add({...this.getRepo(),filepath:s.path})):se.default.remove({...this.getRepo(),filepath:s.path})));else{let s=n!=null?n:await this.getUnstagedFiles(r!=null?r:".");await Promise.all(s.map(({path:a,type:o})=>o=="D"?se.default.remove({...this.getRepo(),filepath:a}):this.wrapFS(se.default.add({...this.getRepo(),filepath:a}))))}}catch(s){throw this.plugin.displayError(s),s}}async unstage(r,i){try{this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.wrapFS(se.default.resetIndex({...this.getRepo(),filepath:r}))}catch(n){throw this.plugin.displayError(n),n}}async unstageAll({dir:r,status:i}){try{let n;i?n=i.staged.map(s=>s.path):n=(await this.getStagedFiles(r!=null?r:".")).map(({path:a})=>a),await this.wrapFS(Promise.all(n.map(s=>se.default.resetIndex({...this.getRepo(),filepath:s}))))}catch(n){throw this.plugin.displayError(n),n}}async discard(r){try{this.plugin.setPluginState({gitAction:3}),await this.wrapFS(se.default.checkout({...this.getRepo(),filepaths:[r],force:!0}))}catch(i){throw this.plugin.displayError(i),i}}async discardAll({dir:r,status:i}){let n=[];i?r!=null?n=i.changed.filter(s=>s.workingDir!="U"&&s.path.startsWith(r)).map(s=>s.path):n=i.changed.filter(s=>s.workingDir!="U").map(s=>s.path):n=(await this.getUnstagedFiles(r)).filter(s=>s.type!="A").map(({path:s})=>s);try{await this.wrapFS(se.default.checkout({...this.getRepo(),filepaths:n,force:!0}))}catch(s){throw this.plugin.displayError(s),s}}async getUntrackedPaths(r){let i=[];if(r.status)for(let n of r.status.changed)n.index=="U"&&n.workingDir==="U"&&n.path.startsWith(r.path!=null?`${r.path}/`:"")&&i.push(n.path);else{let n=await this.status({path:r==null?void 0:r.path});for(let s of n.changed)s.index==="U"&&s.workingDir==="U"&&i.push(s.path)}return i}getProgressText(r,i){let n=`${r} progress:`;return i.phase&&(n=`${n} ${i.phase}:`),i.loaded&&(n=`${n} ${i.loaded}`,i.total&&(n=`${n} of ${i.total}`)),n}resolveRef(r){return this.wrapFS(se.default.resolveRef({...this.getRepo(),ref:r}))}async pull(){let r=this.showNotice("Initializing pull");try{this.plugin.setPluginState({gitAction:2});let i=await this.resolveRef("HEAD");await this.fetch();let n=await this.branchInfo();await this.checkAuthorInfo(),(await this.wrapFS(se.default.merge({...this.getRepo(),ours:n.current,theirs:n.tracking,abortOnConflict:!1,mergeDriver:this.plugin.settings.mergeStrategy!=="none"?({contents:l})=>{var b,S,C;let c=l[0],u=l[1],f=l[2],d=/^.*(\r?\n|$)/gm,h=(b=u.match(d))!=null?b:[],p=(S=c.match(d))!=null?S:[],g=(C=f.match(d))!=null?C:[],w=(0,xA.default)(h,p,g),y="";for(let A of w)A.ok&&(y+=A.ok.join("")),A.conflict&&(y+=this.plugin.settings.mergeStrategy==="ours"?A.conflict.a.join(""):A.conflict.b.join(""));return{cleanMerge:!0,mergedText:y}}:void 0}))).alreadyMerged||await this.wrapFS(se.default.checkout({...this.getRepo(),ref:n.current,onProgress:l=>{r!==void 0&&r.setMessage(this.getProgressText("Checkout",l))},remote:n.remote})),r==null||r.hide();let a=await this.resolveRef("HEAD"),o=await this.getFileChangesCount(i,a);return this.showNotice("Finished pull",!1),o.map(l=>({path:l.path,workingDir:"P",index:"P",vaultPath:this.getRelativeVaultPath(l.path)}))}catch(i){throw r==null||r.hide(),i instanceof se.Errors.MergeConflictError&&await this.plugin.handleConflict(i.data.filepaths.map(n=>this.getRelativeVaultPath(n))),this.plugin.displayError(i),i}}async push(){if(!await this.canPush())return 0;let r=this.showNotice("Initializing push");try{this.plugin.setPluginState({gitAction:1});let i=await this.branchInfo(),n=i.tracking,s=i.current,a=(await this.getFileChangesCount(s,n)).length;this.plugin.setPluginState({gitAction:5});let o=await this.getCurrentRemote();return await this.wrapFS(se.default.push({...this.getRepo(),remote:o,onProgress:l=>{r!==void 0&&r.setMessage(this.getProgressText("Pushing",l))}})),r==null||r.hide(),a}catch(i){throw r==null||r.hide(),this.plugin.displayError(i),i}}async getUnpushedCommits(){let r=await this.branchInfo(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let s=await this.resolveRef(n),a=await this.resolveRef(i);return(await this.getFileChangesCount(s,a)).length}async canPush(){let r=await this.branchInfo(),i=r.tracking,n=r.current,s=await this.resolveRef(n),a=await this.resolveRef(i);return s!=a}async checkRequirements(){return await this.plugin.app.vault.adapter.exists(`${this.getRepo().dir}/.git/HEAD`)?"valid":"missing-repo"}async branchInfo(){var r,i;try{let n=await se.default.currentBranch(this.getRepo())||"",s=await se.default.listBranches(this.getRepo()),a=(r=await this.getConfig(`branch.${n}.remote`))!=null?r:"origin",o=(i=await this.getConfig(`branch.${n}.merge`))==null?void 0:i.split("refs/heads")[1],l=o?a+o:void 0;return{current:n,tracking:l,branches:s,remote:a}}catch(n){throw this.plugin.displayError(n),n}}async getCurrentRemote(){var n;let r=await se.default.currentBranch(this.getRepo())||"";return(n=await this.getConfig(`branch.${r}.remote`))!=null?n:"origin"}async checkout(r,i){try{return this.wrapFS(se.default.checkout({...this.getRepo(),ref:r,force:!!i,remote:i}))}catch(n){throw this.plugin.displayError(n),n}}async createBranch(r){try{await this.wrapFS(se.default.branch({...this.getRepo(),ref:r,checkout:!0}))}catch(i){throw this.plugin.displayError(i),i}}async deleteBranch(r){try{await this.wrapFS(se.default.deleteBranch({...this.getRepo(),ref:r}))}catch(i){throw this.plugin.displayError(i),i}}branchIsMerged(r){return Promise.resolve(!0)}async init(){try{await this.wrapFS(se.default.init(this.getRepo()))}catch(r){throw this.plugin.displayError(r),r}}async clone(r,i,n){let s=this.showNotice("Initializing clone");try{await this.wrapFS(se.default.clone({...this.getRepo(),dir:i,url:r,depth:n,onProgress:a=>{s!==void 0&&s.setMessage(this.getProgressText("Cloning",a))}})),s==null||s.hide()}catch(a){throw s==null||s.hide(),this.plugin.displayError(a),a}}async setConfig(r,i){try{return this.wrapFS(se.default.setConfig({...this.getRepo(),path:r,value:i}))}catch(n){throw this.plugin.displayError(n),n}}async getConfig(r){try{return this.wrapFS(se.default.getConfig({...this.getRepo(),path:r}))}catch(i){throw this.plugin.displayError(i),i}}async fetch(r){let i=this.showNotice("Initializing fetch");try{let n={...this.getRepo(),onProgress:s=>{i!==void 0&&i.setMessage(this.getProgressText("Fetching",s))},remote:r!=null?r:await this.getCurrentRemote()};await this.wrapFS(se.default.fetch(n)),i==null||i.hide()}catch(n){throw this.plugin.displayError(n),i==null||i.hide(),n}}async setRemote(r,i){try{await this.wrapFS(se.default.addRemote({...this.getRepo(),remote:r,url:i,force:!0}))}catch(n){throw this.plugin.displayError(n),n}}async getRemoteBranches(r){let i=[];return i.push(...await this.wrapFS(se.default.listBranches({...this.getRepo(),remote:r}))),i.remove("HEAD"),i=i.map(n=>`${r}/${n}`),i}async getRemotes(){return(await this.wrapFS(se.default.listRemotes({...this.getRepo()}))).map(r=>r.remote)}async removeRemote(r){await this.wrapFS(se.default.deleteRemote({...this.getRepo(),remote:r}))}async getRemoteUrl(r){var i;return(i=(await this.wrapFS(se.default.listRemotes({...this.getRepo()}))).filter(n=>n.remote==r)[0])==null?void 0:i.url}async log(r,i=!0,n,s){let a=await this.wrapFS(se.default.log({...this.getRepo(),depth:n,ref:s}));return Promise.all(a.map(async o=>{let l=o.commit.message.split(` + +`);return{message:l[0],author:{name:o.commit.author.name,email:o.commit.author.email},body:l.slice(1).join(` + +`),date:new Date(o.commit.committer.timestamp).toDateString(),diff:{changed:0,files:(await this.getFileChangesCount(o.commit.parent.first(),o.oid)).map(c=>({path:c.path,status:c.type,vaultPath:this.getRelativeVaultPath(c.path),hash:o.oid}))},hash:o.oid,refs:[]}}))}updateBasePath(r){return this.getRepo().dir=r,Promise.resolve()}async updateUpstreamBranch(r){let[i,n]=Yn(r),s=await this.branchInfo();await this.wrapFS(se.default.push({...this.getRepo(),remote:i,remoteRef:n})),await this.setConfig(`branch.${s.current}.merge`,`refs/heads/${n}`)}updateGitPath(r){return Promise.resolve()}async getFileChangesCount(r,i){return this.walkDifference({walkers:[se.default.TREE({ref:r}),se.default.TREE({ref:i})]})}async walkDifference({walkers:r,dir:i}){return await this.wrapFS(se.default.walk({...this.getRepo(),trees:r,map:async function(s,[a,o]){if(!iv(s,i))return null;if(await(a==null?void 0:a.type())==="tree"||await(o==null?void 0:o.type())==="tree")return;let l=await(a==null?void 0:a.oid()),c=await(o==null?void 0:o.oid()),u="equal";if(l!==c&&(u="M"),l===void 0&&(u="A"),c===void 0&&(u="D"),l===void 0&&c===void 0&&(console.log("Something weird happened:"),console.log(a),console.log(o)),u!=="equal")return{path:s,type:u}}}))}async getStagedFiles(r="."){return(await this.walkDifference({walkers:[se.default.TREE({ref:"HEAD"}),se.default.STAGE()],dir:r})).map(n=>({vaultPath:this.getRelativeVaultPath(n.path),path:n.path}))}async getUnstagedFiles(r="."){let i,n=window.setTimeout(()=>{i=new ka.Notice("This takes longer: Getting status",this.noticeLength)},2e4);try{let s=this.getRepo(),a=await this.wrapFS(se.default.walk({...s,trees:[se.default.WORKDIR(),se.default.STAGE()],map:async function(o,[l,c]){if(!c&&l&&await se.default.isIgnored({...s,filepath:o})||!iv(o,r))return null;let[u,f]=await Promise.all([l&&l.type(),c&&c.type()]),d=[u,f].includes("blob");if((u==="tree"||u==="special")&&!d)return;if(f==="commit")return null;if((f==="tree"||f==="special")&&!d)return;let h=f==="blob"?await c.oid():void 0,p;return u==="blob"&&f!=="blob"?p="42":u==="blob"&&(p=await l.oid()),p?h?p!==h?{path:o,type:"M"}:null:{path:o,type:"A"}:{path:o,type:"D"}}}));return window.clearTimeout(n),i==null||i.hide(),a}catch(s){throw window.clearTimeout(n),i==null||i.hide(),this.plugin.displayError(s),s}}async getDiffString(r,i=!1,n){let s=this.getRelativeVaultPath(r),a=async(c,[u])=>{if(r==c){let f=await u.oid();return(await se.default.readBlob({...this.getRepo(),oid:f})).blob}};if(n){let c=await(0,se.readBlob)({...this.getRepo(),filepath:r,oid:n}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof se.default.Errors.NotFoundError))throw h}),u=await se.default.readCommit({...this.getRepo(),oid:n}),f=await(0,se.readBlob)({...this.getRepo(),filepath:r,oid:u.commit.parent.first()}).then(h=>new TextDecoder().decode(h.blob)).catch(h=>{if(!(h instanceof se.default.Errors.NotFoundError))throw h});return pu(s,f!=null?f:"",c!=null?c:"")}let o=(await se.default.walk({...this.getRepo(),trees:[se.default.STAGE()],map:a})).first(),l=new TextDecoder().decode(o);if(i){let c=await this.resolveRef("HEAD").then(f=>(0,se.readBlob)({...this.getRepo(),filepath:r,oid:f})).then(f=>new TextDecoder().decode(f.blob)).catch(f=>{if(!(f instanceof se.default.Errors.NotFoundError))throw f});return pu(s,c!=null?c:"",l)}else{let c;return await this.app.vault.adapter.exists(s)?c=await this.app.vault.adapter.read(s):c="",pu(s,l,c)}}async getLastCommitTime(){let r=this.getRepo(),i=await this.resolveRef("HEAD"),s=(await se.default.readCommit({...r,oid:i})).commit.committer.timestamp;return new Date(s*1e3)}getFileStatusResult(r){let i=this.status_mapping[`${r[this.HEAD]}${r[this.WORKDIR]}${r[this.STAGE]}`];return{index:i[0]=="?"?"U":i[0],workingDir:i[1]=="?"?"U":i[1],path:r[this.FILE],vaultPath:this.getRelativeVaultPath(r[this.FILE])}}async checkAuthorInfo(){let r=await this.getConfig("user.name"),i=await this.getConfig("user.email");if(!r||!i)throw Error("Git author name and email are not set. Please set both fields in the settings.")}showNotice(r,i=!0){if(!this.plugin.settings.disablePopups)return new ka.Notice(r,i?this.noticeLength:void 0)}};async function*QB(t){yield new Uint8Array(t)}async function JB(t){let e=new ReadableStream({async start(i){for await(let n of t)i.enqueue(n);i.close()}});return await new Response(e).arrayBuffer()}m();var w2=Gt(Bd(),1),Ur=Gt(require("fs/promises"),1),Zn=require("obsidian"),We=Gt(require("path"),1),Tu=require("path");m();var Zd=Gt(TA(),1);m();var lv=new WeakMap;function pl(...t){let e=new String(t);return lv.set(e,t),e}function _i(t){return t instanceof String&&lv.has(t)}function ml(t){var e;return(e=lv.get(t))!=null?e:[]}var qd=Gt(Bd(),1),nT=require("child_process");var GT=Gt(uv(),1),JT=require("node:path");m();function*PA(t,e){let r=e==="global";for(let i of t)i.isGlobal===r&&(yield i)}var w3=new Set(["--add","--edit","--remove-section","--rename-section","--replace-all","--unset","--unset-all","-e"]),b3=new Set(["--get","--get-all","--get-color","--get-colorbool","--get-regexp","--get-urlmatch","--list","-l"]),_3=new Set(["edit","remove-section","rename-section","set","unset"]),y3=new Set(["get","get-color","get-colorbool","list"]);function x3(t,e){var i;for(let{name:n}of PA(t,"task")){if(w3.has(n))return gl(!0,e);if(b3.has(n))return gl(!1,e)}let r=(i=e.at(0))==null?void 0:i.toLowerCase();return r===void 0?null:_3.has(r)?gl(!0,e.slice(1)):y3.has(r)?gl(!1,e.slice(1)):e.length===1?gl(!1,e):gl(!0,e)}function gl(t=!1,e=[]){var i;let r=(i=e.at(0))==null?void 0:i.toLowerCase();return r===void 0?null:{isWrite:t,isRead:!t,key:r,value:e.at(1)}}function E3(t,e){return e.isWrite&&e.value!==void 0?{key:e.key,value:e.value,scope:t}:{key:e.key,scope:t}}function S3(t){let e=(t==null?void 0:t.indexOf("="))||-1;return!t||e<0?null:{key:t.slice(0,e).trim().toLowerCase(),value:t.slice(e+1)}}function k3(t){for(let{name:e}of PA(t,"task"))switch(e){case"--global":return"global";case"--system":return"system";case"--worktree":return"worktree";case"--local":return"local";case"--file":case"-f":return"file"}return"local"}function A3({name:t}){if(t==="-c"||t==="--config")return"inline";if(t==="--config-env")return"env"}function*C3(t){for(let e of t){let r=A3(e),i=r&&S3(e.value);i&&(yield{...i,scope:r})}}function T3(t,e,r){let i={read:[],write:[...C3(e)]};return t==="config"&&P3(i,k3(e),x3(e,r)),i}function P3(t,e,r){if(r===null)return;let i=E3(e,r);r.isWrite?t.write.push(i):t.read.push(i)}var RA={short:new Map([["c",!0]])},R3={short:new Map([["C",!0],["P",!1],["h",!1],["p",!1],["v",!1],...RA.short.entries()]),long:new Set(["attr-source","config-env","exec-path","git-dir","list-cmds","namespace","super-prefix","work-tree"])},$3={clone:{short:new Map([["b",!0],["j",!0],["l",!1],["n",!1],["o",!0],["q",!1],["s",!1],["u",!0]]),long:new Set(["branch","config","jobs","origin","upload-pack","u","template"])},commit:{short:new Map([["C",!0],["F",!0],["c",!0],["m",!0],["t",!0]]),long:new Set(["file","message","reedit-message","reuse-message","template"])},config:{short:new Map([["e",!1],["f",!0],["l",!1]]),long:new Set(["blob","comment","default","file","type","value"])},fetch:{short:new Map,long:new Set(["upload-pack"])},init:{short:new Map,long:new Set(["template"])},pull:{short:new Map,long:new Set(["upload-pack"])},push:{short:new Map,long:new Set(["exec","receive-pack"])}},F3={short:new Map,long:new Set};function I3(t){var r;let e=(r=$3[t!=null?t:""])!=null?r:F3;return{short:new Map([...RA.short.entries(),...e.short.entries()]),long:e.long}}function $A(t,e=R3){if(t.startsWith("--")){let r=t.indexOf("=");if(r>2)return[{name:t.slice(0,r),value:t.slice(r+1),needsNext:!1}];let i=t.slice(2);return[{name:t,needsNext:e.long.has(i)}]}if(t.length===2){let r=t.charAt(1),i=e.short.get(r);return[{name:t,needsNext:i===!0}]}return M3(t,e.short)}function M3(t,e){let r=t.slice(1).split(""),i=[];for(let n=0;ne.has(l)))return i.push({name:`-${s}`,value:o,needsNext:!1}),i}i.push({name:`-${s}`,needsNext:a})}return i}function D3(t,e=[]){let r=0;for(;rfunction(){return t&&(e=(0,t[Fv(t)[0]])(t=0)),e},K3=(t,e)=>function(){return e||(0,t[Fv(t)[0]])((e={exports:{}}).exports,e),e.exports},St=(t,e)=>{for(var r in e)$v(t,r,{get:e[r],enumerable:!0})},X3=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fv(e))!Z3.call(t,n)&&n!==r&&$v(t,n,{get:()=>e[n],enumerable:!(i=Y3(e,n))||i.enumerable});return t},_t=t=>X3($v({},"__esModule",{value:!0}),t),Br,Hs=Y({"src/lib/errors/git-error.ts"(){"use strict";Br=class extends Error{constructor(t,e){super(e),this.task=t,Object.setPrototypeOf(this,new.target.prototype)}}}}),Eu,_l=Y({"src/lib/errors/git-response-error.ts"(){"use strict";Hs(),Eu=class extends Br{constructor(t,e){super(void 0,e||String(t)),this.git=t}}}}),hC,pC=Y({"src/lib/errors/task-configuration-error.ts"(){"use strict";Hs(),hC=class extends Br{constructor(t){super(void 0,t)}}}});function mC(t){return typeof t!="function"?$a:t}function gC(t){return typeof t=="function"&&t!==$a}function vC(t,e){let r=t.indexOf(e);return r<=0?[t,""]:[t.substr(0,r),t.substr(r+1)]}function wC(t,e=0){return bC(t)&&t.length>e?t[e]:void 0}function Ra(t,e=0){if(bC(t)&&t.length>e)return t[t.length-1-e]}function bC(t){return Jd(t)}function Su(t="",e=!0,r=` +`){return t.split(r).reduce((i,n)=>{let s=e?n.trim():n;return s&&i.push(s),i},[])}function Iv(t,e){return Su(t,!0).map(r=>e(r))}function Mv(t){return(0,Zd.exists)(t,Zd.FOLDER)}function Ei(t,e){return Array.isArray(t)?t.includes(e)||t.push(e):t.add(e),e}function _C(t,e){return Array.isArray(t)&&!t.includes(e)&&t.push(e),t}function Kd(t,e){if(Array.isArray(t)){let r=t.indexOf(e);r>=0&&t.splice(r,1)}else t.delete(e);return e}function yn(t){return Array.isArray(t)?t:[t]}function yC(t){return t.replace(/[\s-]+(.)/g,(e,r)=>r.toUpperCase())}function yl(t){return yn(t).map(e=>e instanceof String?e:String(e))}function Qe(t,e=0){if(t==null)return e;let r=parseInt(t,10);return Number.isNaN(r)?e:r}function yu(t,e){let r=[];for(let i=0,n=t.length;i{t[i]!==void 0&&(r[i]=t[i])}),r}function vv(t=0){return new Promise(e=>setTimeout(e,t))}function wv(t){if(t!==!1)return t}var wl,$a,ku,Xd=Y({"src/lib/utils/util.ts"(){"use strict";Dv(),wl="\0",$a=()=>{},ku=Object.prototype.toString.call.bind(Object.prototype.toString)}});function lr(t,e,r){return e(t)?t:arguments.length>2?r:void 0}function bv(t,e){let r=_i(t)?"string":typeof t;return/number|string|boolean/.test(r)&&(!e||!e.includes(r))}function Qd(t){return!!t&&ku(t)==="[object Object]"}function EC(t){return typeof t=="function"}var Au,SC,mt,zd,Jd,Dv=Y({"src/lib/utils/argument-filters.ts"(){"use strict";Xd(),Au=t=>Array.isArray(t),SC=t=>typeof t=="number",mt=t=>typeof t=="string"||_i(t),zd=t=>mt(t)||Array.isArray(t)&&t.every(mt),Jd=t=>t==null||"number|boolean|function".includes(typeof t)?!1:typeof t.length=="number"}}),_v,Q3=Y({"src/lib/utils/exit-codes.ts"(){"use strict";_v=(t=>(t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.NOT_FOUND=-2]="NOT_FOUND",t[t.UNCLEAN=128]="UNCLEAN",t))(_v||{})}}),Wd,J3=Y({"src/lib/utils/git-output-streams.ts"(){"use strict";Wd=class kC{constructor(e,r){this.stdOut=e,this.stdErr=r}asStrings(){return new kC(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});function e8(){throw new Error("LineParser:useMatches not implemented")}var _e,Bs,t8=Y({"src/lib/utils/line-parser.ts"(){"use strict";_e=class{constructor(t,e){this.matches=[],this.useMatches=e8,this.parse=(r,i)=>(this.resetMatches(),this._regExp.every((n,s)=>this.addMatch(n,s,r(s)))?this.useMatches(i,this.prepareMatches())!==!1:!1),this._regExp=Array.isArray(t)?t:[t],e&&(this.useMatches=e)}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(t,e,r){let i=r&&t.exec(r);return i&&this.pushMatch(e,i),!!i}pushMatch(t,e){this.matches.push(...e.slice(1))}},Bs=class extends _e{addMatch(t,e,r){return/^remote:\s/.test(String(r))&&super.addMatch(t,e,r)}pushMatch(t,e){(t>0||e.length>1)&&super.pushMatch(t,e)}}}});function AC(...t){let e=process.cwd(),r=Object.assign({baseDir:e,...CC},...t.filter(i=>typeof i=="object"&&i));return r.baseDir=r.baseDir||e,r.trimmed=r.trimmed===!0,r}var CC,r8=Y({"src/lib/utils/simple-git-options.ts"(){"use strict";CC={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});function Ov(t,e=[]){return Qd(t)?Object.keys(t).reduce((r,i)=>{let n=t[i];if(_i(n))r.push(n);else if(bv(n,["boolean"]))r.push(i+"="+n);else if(Array.isArray(n))for(let s of n)bv(s,["string","number"])||r.push(i+"="+s);else r.push(i);return r},e):e}function xr(t,e=0,r=!1){let i=[];for(let n=0,s=e<0?t.length:e;n{for(let s=Su(n,i),a=0,o=s.length;a{if(!(a+c>=o))return s[a+c]};e.some(({parse:c})=>c(l,t))}}),t}var s8=Y({"src/lib/utils/task-parser.ts"(){"use strict";Xd()}}),TC={};St(TC,{ExitCodes:()=>_v,GitOutputStreams:()=>Wd,LineParser:()=>_e,NOOP:()=>$a,NULL:()=>wl,RemoteLineParser:()=>Bs,append:()=>Ei,appendTaskOptions:()=>Ov,asArray:()=>yn,asCamelCase:()=>yC,asFunction:()=>mC,asNumber:()=>Qe,asStringArray:()=>yl,bufferToString:()=>xu,callTaskParser:()=>yv,createInstanceConfig:()=>AC,delay:()=>vv,filterArray:()=>Au,filterFunction:()=>EC,filterHasLength:()=>Jd,filterNumber:()=>SC,filterPlainObject:()=>Qd,filterPrimitives:()=>bv,filterString:()=>mt,filterStringOrStringArray:()=>zd,filterType:()=>lr,first:()=>wC,folderExists:()=>Mv,forEachLineWithContent:()=>Iv,getTrailingOptions:()=>xr,including:()=>_C,isUserFunction:()=>gC,last:()=>Ra,objectToString:()=>ku,orVoid:()=>wv,parseStringResponse:()=>Hr,pick:()=>xC,prefixedArray:()=>yu,remove:()=>Kd,splitOn:()=>vC,toLinesWithContent:()=>Su,trailingFunctionArgument:()=>st,trailingOptionsArgument:()=>Lv});var ve=Y({"src/lib/utils/index.ts"(){"use strict";Dv(),Q3(),J3(),t8(),r8(),n8(),s8(),Xd()}}),PC={};St(PC,{CheckRepoActions:()=>xv,checkIsBareRepoTask:()=>$C,checkIsRepoRootTask:()=>RC,checkIsRepoTask:()=>a8});function a8(t){switch(t){case"bare":return $C();case"root":return RC()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:eh,parser:Nv}}function RC(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:eh,parser(e){return/^\.(git)?$/.test(e.trim())}}}function $C(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:eh,parser:Nv}}function o8(t){return/(Not a git repository|Kein Git-Repository)/i.test(String(t))}var xv,eh,Nv,FC=Y({"src/lib/tasks/check-is-repo.ts"(){"use strict";ve(),xv=(t=>(t.BARE="bare",t.IN_TREE="tree",t.IS_REPO_ROOT="root",t))(xv||{}),eh=({exitCode:t},e,r,i)=>{if(t===128&&o8(e))return r(E.from("false"));i(e)},Nv=t=>t.trim()==="true"}});function l8(t,e){let r=new IC(t),i=t?DC:MC;return Su(e).forEach(n=>{let s=n.replace(i,"");r.paths.push(s),(OC.test(s)?r.folders:r.files).push(s)}),r}var IC,MC,DC,OC,c8=Y({"src/lib/responses/CleanSummary.ts"(){"use strict";ve(),IC=class{constructor(t){this.dryRun=t,this.paths=[],this.files=[],this.folders=[]}},MC=/^[a-z]+\s*/i,DC=/^[a-z]+\s+[a-z]+\s*/i,OC=/\/$/}}),Ev={};St(Ev,{EMPTY_COMMANDS:()=>th,adhocExecTask:()=>LC,configurationErrorTask:()=>Nr,isBufferTask:()=>BC,isEmptyTask:()=>HC,straightThroughBufferTask:()=>NC,straightThroughStringTask:()=>Er});function LC(t){return{commands:th,format:"empty",parser:t}}function Nr(t){return{commands:th,format:"empty",parser(){throw typeof t=="string"?new hC(t):t}}}function Er(t,e=!1){return{commands:t,format:"utf-8",parser(r){return e?String(r).trim():r}}}function NC(t){return{commands:t,format:"buffer",parser(e){return e}}}function BC(t){return t.format==="buffer"}function HC(t){return t.format==="empty"||!t.commands.length}var th,yt=Y({"src/lib/tasks/task.ts"(){"use strict";pC(),th=[]}}),UC={};St(UC,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Bv,CONFIG_ERROR_MODE_REQUIRED:()=>Hv,CONFIG_ERROR_UNKNOWN_OPTION:()=>Uv,CleanOptions:()=>Pa,cleanTask:()=>GC,cleanWithOptionsTask:()=>u8,isCleanOptionsArray:()=>f8});function u8(t,e){let{cleanMode:r,options:i,valid:n}=d8(t);return r?n.options?(i.push(...e),i.some(m8)?Nr(Bv):GC(r,i)):Nr(Uv+JSON.stringify(t)):Nr(Hv)}function GC(t,e){return{commands:["clean",`-${t}`,...e],format:"utf-8",parser(i){return l8(t==="n",i)}}}function f8(t){return Array.isArray(t)&&t.every(e=>Gv.has(e))}function d8(t){let e,r=[],i={cleanMode:!1,options:!0};return t.replace(/[^a-z]i/g,"").split("").forEach(n=>{h8(n)?(e=n,i.cleanMode=!0):i.options=i.options&&p8(r[r.length]=`-${n}`)}),{cleanMode:e,options:r,valid:i}}function h8(t){return t==="f"||t==="n"}function p8(t){return/^-[a-z]$/i.test(t)&&Gv.has(t.charAt(1))}function m8(t){return/^-[^\-]/.test(t)?t.indexOf("i")>0:t==="--interactive"}var Bv,Hv,Uv,Pa,Gv,jC=Y({"src/lib/tasks/clean.ts"(){"use strict";c8(),ve(),yt(),Bv="Git clean interactive mode is not supported",Hv='Git clean mode parameter ("n" or "f") is required',Uv="Git clean unknown option found in: ",Pa=(t=>(t.DRY_RUN="n",t.FORCE="f",t.IGNORED_INCLUDED="x",t.IGNORED_ONLY="X",t.EXCLUDING="e",t.QUIET="q",t.RECURSIVE="d",t))(Pa||{}),Gv=new Set(["i",...yl(Object.values(Pa))])}});function g8(t){let e=new zC;for(let r of VC(t))e.addValue(r.file,String(r.key),r.value);return e}function v8(t,e){let r=null,i=[],n=new Map;for(let s of VC(t,e))s.key===e&&(i.push(r=s.value),n.has(s.file)||n.set(s.file,[]),n.get(s.file).push(r));return{key:e,paths:Array.from(n.keys()),scopes:n,value:r,values:i}}function w8(t){return t.replace(/^(file):/,"")}function*VC(t,e=null){let r=t.split("\0");for(let i=0,n=r.length-1;iObject.assign(t,this.values[e]),{})),this._all}addFile(t){if(!(t in this.values)){let e=Ra(this.files);this.values[t]=e?Object.create(this.values[e]):{},this.files.push(t)}return this.values[t]}addValue(t,e,r){let i=this.addFile(t);Object.hasOwn(i,e)?Array.isArray(i[e])?i[e].push(r):i[e]=[i[e],r]:i[e]=r,this._all=void 0}}}});function fv(t,e){return typeof t=="string"&&Object.hasOwn(Sv,t)?t:e}function _8(t,e,r,i){let n=["config",`--${i}`];return r&&n.push("--add"),n.push(t,e),{commands:n,format:"utf-8",parser(s){return s}}}function y8(t,e){let r=["config","--null","--show-origin","--get-all",t];return e&&r.splice(1,0,`--${e}`),{commands:r,format:"utf-8",parser(i){return v8(i,t)}}}function x8(t){let e=["config","--list","--show-origin","--null"];return t&&e.push(`--${t}`),{commands:e,format:"utf-8",parser(r){return g8(r)}}}function E8(){return{addConfig(t,e,...r){return this._runTask(_8(t,e,r[0]===!0,fv(r[1],"local")),st(arguments))},getConfig(t,e){return this._runTask(y8(t,fv(e,void 0)),st(arguments))},listConfig(...t){return this._runTask(x8(fv(t[0],void 0)),st(arguments))}}}var Sv,WC=Y({"src/lib/tasks/config.ts"(){"use strict";b8(),ve(),Sv=(t=>(t.system="system",t.global="global",t.local="local",t.worktree="worktree",t))(Sv||{})}});function S8(t){return qC.has(t)}var dv,qC,YC=Y({"src/lib/tasks/diff-name-status.ts"(){"use strict";dv=(t=>(t.ADDED="A",t.COPIED="C",t.DELETED="D",t.MODIFIED="M",t.RENAMED="R",t.CHANGED="T",t.UNMERGED="U",t.UNKNOWN="X",t.BROKEN="B",t))(dv||{}),qC=new Set(Object.values(dv))}});function k8(...t){return new KC().param(...t)}function A8(t){let e=new Set,r={};return Iv(t,i=>{let[n,s,a]=i.split(wl);e.add(n),(r[n]=r[n]||[]).push({line:Qe(s),path:n,preview:a})}),{paths:e,results:r}}function C8(){return{grep(t){let e=st(arguments),r=xr(arguments);for(let n of ZC)if(r.includes(n))return this._runTask(Nr(`git.grep: use of "${n}" is not supported.`),e);typeof t=="string"&&(t=k8().param(t));let i=["grep","--null","-n","--full-name",...r,...t];return this._runTask({commands:i,format:"utf-8",parser(n){return A8(n)}},e)}}}var ZC,_u,OA,KC,XC=Y({"src/lib/tasks/grep.ts"(){"use strict";ve(),yt(),ZC=["-h"],_u=Symbol("grepQuery"),KC=class{constructor(){this[OA]=[]}*[(OA=_u,Symbol.iterator)](){for(let t of this[_u])yield t}and(...t){return t.length&&this[_u].push("--and","(",...yu(t,"-e"),")"),this}param(...t){return this[_u].push(...yu(t,"-e")),this}}}}),QC={};St(QC,{ResetMode:()=>Gd,getResetMode:()=>P8,resetTask:()=>T8});function T8(t,e){let r=["reset"];return JC(t)&&r.push(`--${t}`),r.push(...e),Er(r)}function P8(t){if(JC(t))return t;switch(typeof t){case"string":case"undefined":return"soft"}}function JC(t){return typeof t=="string"&&eT.includes(t)}var Gd,eT,tT=Y({"src/lib/tasks/reset.ts"(){"use strict";ve(),yt(),Gd=(t=>(t.MIXED="mixed",t.SOFT="soft",t.HARD="hard",t.MERGE="merge",t.KEEP="keep",t))(Gd||{}),eT=yl(Object.values(Gd))}});function R8(){return(0,qd.default)("simple-git")}function LA(t,e,r){return!e||!String(e).replace(/\s*/,"")?r?(i,...n)=>{t(i,...n),r(i,...n)}:t:(i,...n)=>{t(`%s ${i}`,e,...n),r&&r(i,...n)}}function $8(t,e,{namespace:r}){if(typeof t=="string")return t;let i=e&&e.namespace||"";return i.startsWith(r)?i.substr(r.length+1):i||r}function jv(t,e,r,i=R8()){let n=t&&`[${t}]`||"",s=[],a=typeof e=="string"?i.extend(e):e,o=$8(lr(e,mt),a,i);return c(r);function l(u,f){return Ei(s,jv(t,o.replace(/^[^:]+/,u),f,i))}function c(u){let f=u&&`[${u}]`||"",d=a&&LA(a,f)||$a,h=LA(i,`${n} ${f}`,d);return Object.assign(a?d:h,{label:t,sibling:l,info:h,step:c})}}var rT=Y({"src/lib/git-logger.ts"(){"use strict";ve(),qd.default.formatters.L=t=>String(Jd(t)?t.length:"-"),qd.default.formatters.B=t=>E.isBuffer(t)?t.toString("utf8"):ku(t)}}),iT,F8=Y({"src/lib/runners/tasks-pending-queue.ts"(){"use strict";var t;Hs(),rT(),iT=(t=class{constructor(r="GitExecutor"){this.logLabel=r,this._queue=new Map}withProgress(r){return this._queue.get(r)}createProgress(r){let i=t.getName(r.commands[0]),n=jv(this.logLabel,i);return{task:r,logger:n,name:i}}push(r){let i=this.createProgress(r);return i.logger("Adding task to the queue, commands = %o",r.commands),this._queue.set(r,i),i}fatal(r){for(let[i,{logger:n}]of Array.from(this._queue.entries()))i===r.task?(n.info("Failed %o",r),n("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted")):n.info("A fatal exception occurred in a previous task, the queue has been purged: %o",r.message),this.complete(i);if(this._queue.size!==0)throw new Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete(r){this.withProgress(r)&&this._queue.delete(r)}attempt(r){let i=this.withProgress(r);if(!i)throw new Br(void 0,"TasksPendingQueue: attempt called for an unknown task");return i.logger("Starting task"),i}static getName(r="empty"){return`task:${r}:${++t.counter}`}},t.counter=0,t)}});function Ta(t,e){return{method:wC(t.commands)||"",commands:e}}function I8(t,e){return r=>{e("[ERROR] child process exception %o",r),t.push(E.from(String(r.stack),"ascii"))}}function NA(t,e,r,i){return n=>{r("%s received %L bytes",e,n),i("%B",n),t.push(n)}}var kv,M8=Y({"src/lib/runners/git-executor-chain.ts"(){"use strict";Hs(),yt(),ve(),F8(),kv=class{constructor(t,e,r){this._executor=t,this._scheduler=e,this._plugins=r,this._chain=Promise.resolve(),this._queue=new iT}get cwd(){return this._cwd||this._executor.cwd}set cwd(t){this._cwd=t}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(t){return this._queue.push(t),this._chain=this._chain.then(()=>this.attemptTask(t))}async attemptTask(t){let e=await this._scheduler.next(),r=()=>this._queue.complete(t);try{let{logger:i}=this._queue.attempt(t);return await(HC(t)?this.attemptEmptyTask(t,i):this.attemptRemoteTask(t,i))}catch(i){throw this.onFatalException(t,i)}finally{r(),e()}}onFatalException(t,e){let r=e instanceof Br?Object.assign(e,{task:t}):new Br(t,e&&String(e));return this._chain=Promise.resolve(),this._queue.fatal(r),r}async attemptRemoteTask(t,e){let r=this._plugins.exec("spawn.binary","",Ta(t,t.commands)),i=this._plugins.exec("spawn.args",[...t.commands],{...Ta(t,t.commands),env:{...this.env}}),n=await this.gitResponse(t,r,i,this.outputHandler,e.step("SPAWN")),s=await this.handleTaskData(t,i,n,e.step("HANDLE"));return e("passing response to task's parser as a %s",t.format),BC(t)?yv(t.parser,s):yv(t.parser,s.asStrings())}async attemptEmptyTask(t,e){return e("empty task bypassing child process to call to task's parser"),t.parser(this)}handleTaskData(t,e,r,i){let{exitCode:n,rejection:s,stdOut:a,stdErr:o}=r;return new Promise((l,c)=>{i("Preparing to handle process response exitCode=%d stdOut=",n);let{error:u}=this._plugins.exec("task.error",{error:s},{...Ta(t,e),...r});if(u&&t.onError)return i.info("exitCode=%s handling with custom error handler"),t.onError(r,u,f=>{i.info("custom error handler treated as success"),i("custom error returned a %s",ku(f)),l(new Wd(Array.isArray(f)?E.concat(f):f,E.concat(o)))},c);if(u)return i.info("handling as error: exitCode=%s stdErr=%s rejection=%o",n,o.length,s),c(u);i.info("retrieving task output complete"),l(new Wd(E.concat(a),E.concat(o)))})}async gitResponse(t,e,r,i,n){let s=n.sibling("output"),a=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},Ta(t,t.commands));return new Promise(o=>{let l=[],c=[];n.info("%s %o",e,r),n("%O",a);let u=this._beforeSpawn(t,r);if(u)return o({stdOut:l,stdErr:c,exitCode:9901,rejection:u});this._plugins.exec("spawn.before",void 0,{...Ta(t,r),kill(d){u=d||u}});let f=(0,nT.spawn)(e,r,a);f.stdout.on("data",NA(l,"stdOut",n,s.step("stdOut"))),f.stderr.on("data",NA(c,"stdErr",n,s.step("stdErr"))),f.on("error",I8(c,n)),i&&(n("Passing child process stdOut/stdErr to custom outputHandler"),i(e,f.stdout,f.stderr,[...r])),this._plugins.exec("spawn.after",void 0,{...Ta(t,r),spawned:f,close(d,h){o({stdOut:l,stdErr:c,exitCode:d,rejection:u||h})},kill(d){f.killed||(u=d,f.kill("SIGINT"))}})})}_beforeSpawn(t,e){let r;return this._plugins.exec("spawn.before",void 0,{...Ta(t,e),kill(i){r=i||r}}),r}}}}),sT={};St(sT,{GitExecutor:()=>aT});var aT,D8=Y({"src/lib/runners/git-executor.ts"(){"use strict";M8(),aT=class{constructor(t,e,r){this.cwd=t,this._scheduler=e,this._plugins=r,this._chain=new kv(this,this._scheduler,this._plugins)}chain(){return new kv(this,this._scheduler,this._plugins)}push(t){return this._chain.push(t)}}}});function O8(t,e,r=$a){let i=s=>{r(null,s)},n=s=>{(s==null?void 0:s.task)===t&&r(s instanceof Eu?L8(s):s,void 0)};e.then(i,n)}function L8(t){let e=i=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${i} should be GitResponseError.git.${i}, this will no longer be available in version 3`),e=$a};return Object.create(t,Object.getOwnPropertyNames(t.git).reduce(r,{}));function r(i,n){return n in t||(i[n]={enumerable:!1,configurable:!1,get(){return e(n),t.git[n]}}),i}}var N8=Y({"src/lib/task-callback.ts"(){"use strict";_l(),ve()}});function BA(t,e){return LC(r=>{if(!Mv(t))throw new Error(`Git.cwd: cannot change to non-directory "${t}"`);return(e||r).cwd=t})}var B8=Y({"src/lib/tasks/change-working-directory.ts"(){"use strict";ve(),yt()}});function hv(t){let e=["checkout",...t];return e[1]==="-b"&&e.includes("-B")&&(e[1]=Kd(e,"-B")),Er(e)}function H8(){return{checkout(){return this._runTask(hv(xr(arguments,1)),st(arguments))},checkoutBranch(t,e){return this._runTask(hv(["-b",t,e,...xr(arguments)]),st(arguments))},checkoutLocalBranch(t){return this._runTask(hv(["-b",t,...xr(arguments)]),st(arguments))}}}var U8=Y({"src/lib/tasks/checkout.ts"(){"use strict";ve(),yt()}});function G8(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function j8(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(t){return Hr(G8(),[oT],t)}})}}}var oT,V8=Y({"src/lib/tasks/count-objects.ts"(){"use strict";ve(),oT=new _e(/([a-z-]+): (\d+)$/,(t,[e,r])=>{let i=yC(e);Object.hasOwn(t,i)&&(t[i]=Qe(r))})}});function z8(t){return Hr({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},lT,t)}var lT,W8=Y({"src/lib/parsers/parse-commit.ts"(){"use strict";ve(),lT=[new _e(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(t,[e,r,i])=>{t.branch=e,t.commit=i,t.root=!!r}),new _e(/\s*Author:\s(.+)/i,(t,[e])=>{let r=e.split("<"),i=r.pop();!i||!i.includes("@")||(t.author={email:i.substr(0,i.length-1),name:r.join("<").trim()})}),new _e(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0,t.summary.insertions=parseInt(r,10)||0,t.summary.deletions=parseInt(i,10)||0}),new _e(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(t,[e,r,i])=>{t.summary.changes=parseInt(e,10)||0;let n=parseInt(r,10)||0;i==="-"?t.summary.deletions=n:i==="+"&&(t.summary.insertions=n)})]}});function q8(t,e,r){return{commands:["-c","core.abbrev=40","commit",...yu(t,"-m"),...e,...r],format:"utf-8",parser:z8}}function Y8(){return{commit(e,...r){let i=st(arguments),n=t(e)||q8(yn(e),yn(lr(r[0],zd,[])),[...yl(lr(r[1],Au,[])),...xr(arguments,0,!0)]);return this._runTask(n,i)}};function t(e){return!zd(e)&&Nr("git.commit: requires the commit message to be supplied as a string/string[]")}}var Z8=Y({"src/lib/tasks/commit.ts"(){"use strict";W8(),ve(),yt()}});function K8(){return{firstCommit(){return this._runTask(Er(["rev-list","--max-parents=0","HEAD"],!0),st(arguments))}}}var X8=Y({"src/lib/tasks/first-commit.ts"(){"use strict";ve(),yt()}});function Q8(t,e){let r=["hash-object",t];return e&&r.push("-w"),Er(r,!0)}var J8=Y({"src/lib/tasks/hash-object.ts"(){"use strict";yt()}});function eH(t,e,r){let i=String(r).trim(),n;if(n=cT.exec(i))return new jd(t,e,!1,n[1]);if(n=uT.exec(i))return new jd(t,e,!0,n[1]);let s="",a=i.split(" ");for(;a.length;)if(a.shift()==="in"){s=a.join(" ");break}return new jd(t,e,/^re/i.test(i),s)}var jd,cT,uT,tH=Y({"src/lib/responses/InitSummary.ts"(){"use strict";jd=class{constructor(t,e,r,i){this.bare=t,this.path=e,this.existing=r,this.gitDir=i}},cT=/^Init.+ repository in (.+)$/,uT=/^Rein.+ in (.+)$/}});function rH(t){return t.includes(Vv)}function iH(t=!1,e,r){let i=["init",...r];return t&&!rH(i)&&i.splice(1,0,Vv),{commands:i,format:"utf-8",parser(n){return eH(i.includes("--bare"),e,n)}}}var Vv,nH=Y({"src/lib/tasks/init.ts"(){"use strict";tH(),Vv="--bare"}});function zv(t){for(let e=0;eHr(new fT,e,r,!1)}var pv,HA,UA,GA,hT,pT=Y({"src/lib/parsers/parse-diff-summary.ts"(){"use strict";Cu(),aH(),YC(),ve(),pv=[new _e(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(t,[e,r,i=""])=>{t.files.push({file:e.trim(),changes:Qe(r),insertions:i.replace(/[^+]/g,"").length,deletions:i.replace(/[^-]/g,"").length,binary:!1})}),new _e(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(t,[e,r,i])=>{t.files.push({file:e.trim(),before:Qe(r),after:Qe(i),binary:!0})}),new _e(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(t,[e,r])=>{let i=/(\d+) i/.exec(r),n=/(\d+) d/.exec(r);t.changed=Qe(e),t.insertions=Qe(i==null?void 0:i[1]),t.deletions=Qe(n==null?void 0:n[1])})],HA=[new _e(/(\d+)\t(\d+)\t(.+)$/,(t,[e,r,i])=>{let n=Qe(e),s=Qe(r);t.changed++,t.insertions+=n,t.deletions+=s,t.files.push({file:i,changes:n+s,insertions:n,deletions:s,binary:!1})}),new _e(/-\t-\t(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,after:0,before:0,binary:!0})})],UA=[new _e(/(.+)$/,(t,[e])=>{t.changed++,t.files.push({file:e,changes:0,insertions:0,deletions:0,binary:!1})})],GA=[new _e(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(t,[e,r,i,n,s])=>{t.changed++,t.files.push({file:s!=null?s:i,changes:0,insertions:0,deletions:0,binary:!1,status:wv(S8(e)&&e),from:wv(!!s&&i!==s&&i),similarity:Qe(r)})})],hT={"":pv,"--stat":pv,"--numstat":HA,"--name-status":GA,"--name-only":UA}}});function oH(t,e){return e.reduce((r,i,n)=>(r[i]=t[n]||"",r),Object.create({diff:null}))}function mT(t=Zv,e=gT,r=""){let i=dT(r);return function(n){let s=Su(n.trim(),!1,qv).map(function(a){let o=a.split(Yv),l=oH(o[0].split(t),e);return o.length>1&&o[1].trim()&&(l.diff=i(o[1])),l});return{all:s,latest:s.length&&s[0]||null,total:s.length}}}var qv,Yv,Zv,gT,vT=Y({"src/lib/parsers/parse-list-log-summary.ts"(){"use strict";ve(),pT(),Cu(),qv="\xF2\xF2\xF2\xF2\xF2\xF2 ",Yv=" \xF2\xF2",Zv=" \xF2 ",gT=["hash","date","message","refs","author_name","author_email"]}}),wT={};St(wT,{diffSummaryTask:()=>lH,validateLogFormatConfig:()=>rh});function lH(t){let e=zv(t),r=["diff"];return e===""&&(e="--stat",r.push("--stat=4096")),r.push(...t),rh(r)||{commands:r,format:"utf-8",parser:dT(e)}}function rh(t){let e=t.filter(sH);if(e.length>1)return Nr(`Summary flags are mutually exclusive - pick one of ${e.join(",")}`);if(e.length&&t.includes("-z"))return Nr(`Summary flag ${e} parsing is not compatible with null termination option '-z'`)}var Kv=Y({"src/lib/tasks/diff.ts"(){"use strict";Cu(),pT(),yt()}});function cH(t,e){let r=[],i=[];return Object.keys(t).forEach(n=>{r.push(n),i.push(String(t[n]))}),[r,i.join(e)]}function uH(t){return Object.keys(t).reduce((e,r)=>(r in Av||(e[r]=t[r]),e),{})}function bT(t={},e=[]){let r=lr(t.splitter,mt,Zv),i=Qd(t.format)?t.format:{hash:"%H",date:t.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:t.multiLine?"%B":"%b",author_name:t.mailMap!==!1?"%aN":"%an",author_email:t.mailMap!==!1?"%aE":"%ae"},[n,s]=cH(i,r),a=[],o=[`--pretty=format:${qv}${s}${Yv}`,...e],l=t.n||t["max-count"]||t.maxCount;if(l&&o.push(`--max-count=${l}`),t.from||t.to){let c=t.symmetric!==!1?"...":"..";a.push(`${t.from||""}${c}${t.to||""}`)}return mt(t.file)&&o.push("--follow",pl(t.file)),Ov(uH(t),o),{fields:n,splitter:r,commands:[...o,...a]}}function fH(t,e,r){let i=mT(t,e,zv(r));return{commands:["log",...r],format:"utf-8",parser:i}}function dH(){return{log(...r){let i=st(arguments),n=bT(Lv(arguments),yl(lr(arguments[0],Au,[]))),s=e(...r)||rh(n.commands)||t(n);return this._runTask(s,i)}};function t(r){return fH(r.splitter,r.fields,r.commands)}function e(r,i){return mt(r)&&mt(i)&&Nr("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}var Av,_T=Y({"src/lib/tasks/log.ts"(){"use strict";Cu(),vT(),ve(),yt(),Kv(),Av=(t=>(t[t["--pretty"]=0]="--pretty",t[t["max-count"]=1]="max-count",t[t.maxCount=2]="maxCount",t[t.n=3]="n",t[t.file=4]="file",t[t.format=5]="format",t[t.from=6]="from",t[t.to=7]="to",t[t.splitter=8]="splitter",t[t.symmetric=9]="symmetric",t[t.mailMap=10]="mailMap",t[t.multiLine=11]="multiLine",t[t.strictDate=12]="strictDate",t))(Av||{})}}),Vd,yT,hH=Y({"src/lib/responses/MergeSummary.ts"(){"use strict";Vd=class{constructor(t,e=null,r){this.reason=t,this.file=e,this.meta=r}toString(){return`${this.file}:${this.reason}`}},yT=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"}}}}),Cv,xT,pH=Y({"src/lib/responses/PullSummary.ts"(){"use strict";Cv=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},xT=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});function mv(t){return t.objects=t.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function jA(t){let e=/^\s*(\d+)/.exec(t),r=/delta (\d+)/i.exec(t);return{count:Qe(e&&e[1]||"0"),delta:Qe(r&&r[1]||"0")}}var ET,mH=Y({"src/lib/parsers/parse-remote-objects.ts"(){"use strict";ve(),ET=[new Bs(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=mv(t.remoteMessages);Object.assign(n,{[i]:Qe(r)})}),new Bs(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(t,[e,r])=>{let i=e.toLowerCase(),n=mv(t.remoteMessages);Object.assign(n,{[i]:Qe(r)})}),new Bs(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(t,[e,r,i])=>{let n=mv(t.remoteMessages);n.total=jA(e),n.reused=jA(r),n.packReused=Qe(i)})]}});function ST(t,e){return Hr({remoteMessages:new AT},kT,e)}var kT,AT,CT=Y({"src/lib/parsers/parse-remote-messages.ts"(){"use strict";ve(),mH(),kT=[new Bs(/^remote:\s*(.+)$/,(t,[e])=>(t.remoteMessages.all.push(e.trim()),!1)),...ET,new Bs([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(t,[e])=>{t.remoteMessages.pullRequestUrl=e}),new Bs([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(t,[e,r,i])=>{t.remoteMessages.vulnerabilities={count:Qe(e),summary:r,url:i}})],AT=class{constructor(){this.all=[]}}}});function gH(t,e){let r=Hr(new xT,TT,[t,e]);return r.message&&r}var VA,zA,WA,qA,TT,YA,Xv,PT=Y({"src/lib/parsers/parse-pull.ts"(){"use strict";pH(),ve(),CT(),VA=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,zA=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,WA=/^(create|delete) mode \d+ (.+)/,qA=[new _e(VA,(t,[e,r,i])=>{t.files.push(e),r&&(t.insertions[e]=r.length),i&&(t.deletions[e]=i.length)}),new _e(zA,(t,[e,,r,,i])=>r!==void 0||i!==void 0?(t.summary.changes=+e||0,t.summary.insertions=+r||0,t.summary.deletions=+i||0,!0):!1),new _e(WA,(t,[e,r])=>{Ei(t.files,r),Ei(e==="create"?t.created:t.deleted,r)})],TT=[new _e(/^from\s(.+)$/i,(t,[e])=>{t.remote=e}),new _e(/^fatal:\s(.+)$/,(t,[e])=>{t.message=e}),new _e(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(t,[e,r,i,n])=>{t.branch.local=i,t.hash.local=e,t.branch.remote=n,t.hash.remote=r})],YA=(t,e)=>Hr(new Cv,qA,[t,e]),Xv=(t,e)=>Object.assign(new Cv,YA(t,e),ST(t,e))}}),ZA,RT,KA,vH=Y({"src/lib/parsers/parse-merge.ts"(){"use strict";hH(),ve(),PT(),ZA=[new _e(/^Auto-merging\s+(.+)$/,(t,[e])=>{t.merges.push(e)}),new _e(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(t,[e,r])=>{t.conflicts.push(new Vd(e,r))}),new _e(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(t,[e,r,i])=>{t.conflicts.push(new Vd(e,r,{deleteRef:i}))}),new _e(/^CONFLICT\s+\((.+)\):/,(t,[e])=>{t.conflicts.push(new Vd(e,null))}),new _e(/^Automatic merge failed;\s+(.+)$/,(t,[e])=>{t.result=e})],RT=(t,e)=>Object.assign(KA(t,e),Xv(t,e)),KA=t=>Hr(new yT,ZA,t)}});function XA(t){return t.length?{commands:["merge",...t],format:"utf-8",parser(e,r){let i=RT(e,r);if(i.failed)throw new Eu(i);return i}}:Nr("Git.merge requires at least one option")}var wH=Y({"src/lib/tasks/merge.ts"(){"use strict";_l(),vH(),yt()}});function bH(t,e,r){let i=r.includes("deleted"),n=r.includes("tag")||/^refs\/tags/.test(t),s=!r.includes("new");return{deleted:i,tag:n,branch:!n,new:!s,alreadyUpdated:s,local:t,remote:e}}var QA,$T,JA,_H=Y({"src/lib/parsers/parse-push.ts"(){"use strict";ve(),CT(),QA=[new _e(/^Pushing to (.+)$/,(t,[e])=>{t.repo=e}),new _e(/^updating local tracking ref '(.+)'/,(t,[e])=>{t.ref={...t.ref||{},local:e}}),new _e(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(t,[e,r,i])=>{t.pushed.push(bH(e,r,i))}),new _e(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(t,[e,r,i])=>{t.branch={...t.branch||{},local:e,remote:r,remoteName:i}}),new _e(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(t,[e,r,i,n])=>{t.update={head:{local:e,remote:r},hash:{from:i,to:n}}})],$T=(t,e)=>{let r=JA(t,e),i=ST(t,e);return{...r,...i}},JA=(t,e)=>Hr({pushed:[]},QA,[t,e])}}),FT={};St(FT,{pushTagsTask:()=>yH,pushTask:()=>Qv});function yH(t={},e){return Ei(e,"--tags"),Qv(t,e)}function Qv(t={},e){let r=["push",...e];return t.branch&&r.splice(1,0,t.branch),t.remote&&r.splice(1,0,t.remote),Kd(r,"-v"),Ei(r,"--verbose"),Ei(r,"--porcelain"),{commands:r,format:"utf-8",parser:$T}}var IT=Y({"src/lib/tasks/push.ts"(){"use strict";_H(),ve()}});function xH(){return{showBuffer(){let t=["show",...xr(arguments,1)];return t.includes("--binary")||t.splice(1,0,"--binary"),this._runTask(NC(t),st(arguments))},show(){let t=["show",...xr(arguments,1)];return this._runTask(Er(t),st(arguments))}}}var EH=Y({"src/lib/tasks/show.ts"(){"use strict";ve(),yt()}}),eC,MT,SH=Y({"src/lib/responses/FileStatusSummary.ts"(){"use strict";eC=/^(.+)\0(.+)$/,MT=class{constructor(t,e,r){if(this.path=t,this.index=e,this.working_dir=r,e==="R"||r==="R"){let i=eC.exec(t)||[null,t,t];this.from=i[2]||"",this.path=i[1]||""}}}}});function tC(t){let[e,r]=t.split(wl);return{from:r||e,to:e}}function ei(t,e,r){return[`${t}${e}`,r]}function gv(t,...e){return e.map(r=>ei(t,r,(i,n)=>i.conflicted.push(n)))}function kH(t,e){let r=e.trim();switch(" "){case r.charAt(2):return i(r.charAt(0),r.charAt(1),r.slice(3));case r.charAt(1):return i(" ",r.charAt(0),r.slice(2));default:return}function i(n,s,a){let o=`${n}${s}`,l=DT.get(o);l&&l(t,a),o!=="##"&&o!=="!!"&&t.files.push(new MT(a,n,s))}}var rC,DT,OT,AH=Y({"src/lib/responses/StatusSummary.ts"(){"use strict";ve(),SH(),rC=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}},DT=new Map([ei(" ","A",(t,e)=>t.created.push(e)),ei(" ","D",(t,e)=>t.deleted.push(e)),ei(" ","M",(t,e)=>t.modified.push(e)),ei("A"," ",(t,e)=>{t.created.push(e),t.staged.push(e)}),ei("A","M",(t,e)=>{t.created.push(e),t.staged.push(e),t.modified.push(e)}),ei("D"," ",(t,e)=>{t.deleted.push(e),t.staged.push(e)}),ei("M"," ",(t,e)=>{t.modified.push(e),t.staged.push(e)}),ei("M","M",(t,e)=>{t.modified.push(e),t.staged.push(e)}),ei("R"," ",(t,e)=>{t.renamed.push(tC(e))}),ei("R","M",(t,e)=>{let r=tC(e);t.renamed.push(r),t.modified.push(r.to)}),ei("!","!",(t,e)=>{(t.ignored=t.ignored||[]).push(e)}),ei("?","?",(t,e)=>t.not_added.push(e)),...gv("A","A","U"),...gv("D","D","U"),...gv("U","A","D","U"),["##",(t,e)=>{let r=/ahead (\d+)/,i=/behind (\d+)/,n=/^(.+?(?=(?:\.{3}|\s|$)))/,s=/\.{3}(\S*)/,a=/\son\s(\S+?)(?=\.{3}|$)/,o=r.exec(e);t.ahead=o&&+o[1]||0,o=i.exec(e),t.behind=o&&+o[1]||0,o=n.exec(e),t.current=lr(o==null?void 0:o[1],mt,null),o=s.exec(e),t.tracking=lr(o==null?void 0:o[1],mt,null),o=a.exec(e),o&&(t.current=lr(o==null?void 0:o[1],mt,t.current)),t.detached=/\(no branch\)/.test(e)}]]),OT=function(t){let e=t.split(wl),r=new rC;for(let i=0,n=e.length;i!LT.includes(r))],parser(r){return OT(r)}}}var LT,TH=Y({"src/lib/tasks/status.ts"(){"use strict";AH(),LT=["--null","-z"]}});function Yd(t=0,e=0,r=0,i="",n=!0){return Object.defineProperty({major:t,minor:e,patch:r,agent:i,installed:n},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function PH(){return Yd(0,0,0,"",!1)}function RH(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:$H,onError(t,e,r,i){if(t.exitCode===-2)return r(E.from(Jv));i(e)}})}}}function $H(t){return t===Jv?PH():Hr(Yd(0,0,0,t),NT,t)}var Jv,NT,FH=Y({"src/lib/tasks/version.ts"(){"use strict";ve(),Jv="installed=false",NT=[new _e(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(t,[e,r,i,n=""])=>{Object.assign(t,Yd(Qe(e),Qe(r),Qe(i),n))}),new _e(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(t,[e,r,i,n=""])=>{Object.assign(t,Yd(Qe(e),Qe(r),i,n))})]}});function iC(t,e,r,...i){return mt(r)?e(r,lr(i[0],mt),xr(arguments)):Nr(`git.${t}() requires a string 'repoPath'`)}function IH(){return{clone(t,...e){return this._runTask(iC("clone",Tv,lr(t,mt),...e),st(arguments))},mirror(t,...e){return this._runTask(iC("mirror",BT,lr(t,mt),...e),st(arguments))}}}var Tv,BT,MH=Y({"src/lib/tasks/clone.ts"(){"use strict";yt(),ve(),Tv=(t,e,r)=>{let i=["clone",...r];return mt(t)&&i.push(pl(t)),mt(e)&&i.push(pl(e)),Er(i)},BT=(t,e,r)=>(Ei(r,"--mirror"),Tv(t,e,r))}}),HT={};St(HT,{SimpleGitApi:()=>Pv});var Pv,DH=Y({"src/lib/simple-git-api.ts"(){"use strict";N8(),B8(),U8(),V8(),Z8(),WC(),X8(),XC(),J8(),nH(),_T(),wH(),IT(),EH(),TH(),yt(),FH(),ve(),MH(),Pv=class{constructor(t){this._executor=t}_runTask(t,e){let r=this._executor.chain(),i=r.push(t);return e&&O8(t,i,e),Object.create(this,{then:{value:i.then.bind(i)},catch:{value:i.catch.bind(i)},_executor:{value:r}})}add(t){return this._runTask(Er(["add",...yn(t)]),st(arguments))}cwd(t){let e=st(arguments);return typeof t=="string"?this._runTask(BA(t,this._executor),e):typeof(t==null?void 0:t.path)=="string"?this._runTask(BA(t.path,t.root&&this._executor||void 0),e):this._runTask(Nr("Git.cwd: workingDirectory must be supplied as a string"),e)}hashObject(t,e){return this._runTask(Q8(t,e===!0),st(arguments))}init(t){return this._runTask(iH(t===!0,this._executor.cwd,xr(arguments)),st(arguments))}merge(){return this._runTask(XA(xr(arguments)),st(arguments))}mergeFromTo(t,e){return mt(t)&&mt(e)?this._runTask(XA([t,e,...xr(arguments)]),st(arguments,!1)):this._runTask(Nr("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"))}outputHandler(t){return this._executor.outputHandler=t,this}push(){let t=Qv({remote:lr(arguments[0],mt),branch:lr(arguments[1],mt)},xr(arguments));return this._runTask(t,st(arguments))}stash(){return this._runTask(Er(["stash",...xr(arguments)]),st(arguments))}status(){return this._runTask(CH(xr(arguments)),st(arguments))}},Object.assign(Pv.prototype,H8(),IH(),Y8(),E8(),j8(),K8(),C8(),dH(),xH(),RH())}}),UT={};St(UT,{Scheduler:()=>jT});var nC,jT,OH=Y({"src/lib/runners/scheduler.ts"(){"use strict";ve(),rT(),nC=(()=>{let t=0;return()=>{t++;let{promise:e,done:r}=(0,GT.createDeferred)();return{promise:e,done:r,id:t}}})(),jT=class{constructor(t=2){this.concurrency=t,this.logger=jv("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",t)}schedule(){if(!this.pending.length||this.running.length>=this.concurrency){this.logger("Schedule attempt ignored, pending=%s running=%s concurrency=%s",this.pending.length,this.running.length,this.concurrency);return}let t=Ei(this.running,this.pending.shift());this.logger("Attempting id=%s",t.id),t.done(()=>{this.logger("Completing id=",t.id),Kd(this.running,t),this.schedule()})}next(){let{promise:t,id:e}=Ei(this.pending,nC());return this.logger("Scheduling id=%s",e),this.schedule(),t}}}}),VT={};St(VT,{applyPatchTask:()=>LH});function LH(t,e){return Er(["apply",...e,...t])}var NH=Y({"src/lib/tasks/apply-patch.ts"(){"use strict";yt()}});function BH(t,e){return{branch:t,hash:e,success:!0}}function HH(t){return{branch:t,hash:null,success:!1}}var zT,UH=Y({"src/lib/responses/BranchDeleteSummary.ts"(){"use strict";zT=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});function WT(t,e){return e===1&&Rv.test(t)}var sC,Rv,aC,ih,GH=Y({"src/lib/parsers/parse-branch-delete.ts"(){"use strict";UH(),ve(),sC=/(\S+)\s+\(\S+\s([^)]+)\)/,Rv=/^error[^']+'([^']+)'/m,aC=[new _e(sC,(t,[e,r])=>{let i=BH(e,r);t.all.push(i),t.branches[e]=i}),new _e(Rv,(t,[e])=>{let r=HH(e);t.errors.push(r),t.all.push(r),t.branches[e]=r})],ih=(t,e)=>Hr(new zT,aC,[t,e])}}),qT,jH=Y({"src/lib/responses/BranchSummary.ts"(){"use strict";qT=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(t,e,r,i,n){t==="*"&&(this.detached=e,this.current=r),this.all.push(r),this.branches[r]={current:t==="*",linkedWorkTree:t==="+",name:r,commit:i,label:n}}}}});function oC(t){return t?t.charAt(0):""}function YT(t,e=!1){return Hr(new qT,e?[KT]:ZT,t)}var ZT,KT,VH=Y({"src/lib/parsers/parse-branch.ts"(){"use strict";jH(),ve(),ZT=[new _e(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(t,[e,r,i,n])=>{t.push(oC(e),!0,r,i,n)}),new _e(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(t,[e,r,i,n])=>{t.push(oC(e),!1,r,i,n)})],KT=new _e(/^(\S+)$/s,(t,[e])=>{t.push("*",!1,e,"","")})}}),XT={};St(XT,{branchLocalTask:()=>WH,branchTask:()=>zH,containsDeleteBranchCommand:()=>QT,deleteBranchTask:()=>YH,deleteBranchesTask:()=>qH});function QT(t){let e=["-d","-D","--delete"];return t.some(r=>e.includes(r))}function zH(t){let e=QT(t),r=t.includes("--show-current"),i=["branch",...t];return i.length===1&&i.push("-a"),i.includes("-v")||i.splice(1,0,"-v"),{format:"utf-8",commands:i,parser(n,s){return e?ih(n,s).all[0]:YT(n,r)}}}function WH(){return{format:"utf-8",commands:["branch","-v"],parser(t){return YT(t)}}}function qH(t,e=!1){return{format:"utf-8",commands:["branch","-v",e?"-D":"-d",...t],parser(r,i){return ih(r,i)},onError({exitCode:r,stdOut:i},n,s,a){if(!WT(String(n),r))return a(n);s(i)}}}function YH(t,e=!1){let r={format:"utf-8",commands:["branch","-v",e?"-D":"-d",t],parser(i,n){return ih(i,n).branches[t]},onError({exitCode:i,stdErr:n,stdOut:s},a,o,l){if(!WT(String(a),i))return l(a);throw new Eu(r.parser(xu(s),xu(n)),String(a))}};return r}var ZH=Y({"src/lib/tasks/branch.ts"(){"use strict";_l(),GH(),VH(),ve()}});function KH(t){let e=t.trim().replace(/^["']|["']$/g,"");return e&&(0,JT.normalize)(e)}var e2,XH=Y({"src/lib/responses/CheckIgnore.ts"(){"use strict";e2=t=>t.split(/\n/g).map(KH).filter(Boolean)}}),t2={};St(t2,{checkIgnoreTask:()=>QH});function QH(t){return{commands:["check-ignore",...t],format:"utf-8",parser:e2}}var JH=Y({"src/lib/tasks/check-ignore.ts"(){"use strict";XH()}});function e6(t,e){return Hr({raw:t,remote:null,branches:[],tags:[],updated:[],deleted:[]},r2,[t,e])}var r2,t6=Y({"src/lib/parsers/parse-fetch.ts"(){"use strict";ve(),r2=[new _e(/From (.+)$/,(t,[e])=>{t.remote=e}),new _e(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.branches.push({name:e,tracking:r})}),new _e(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(t,[e,r])=>{t.tags.push({name:e,tracking:r})}),new _e(/- \[deleted]\s+\S+\s*-> (.+)$/,(t,[e])=>{t.deleted.push({tracking:e})}),new _e(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(t,[e,r,i,n])=>{t.updated.push({name:i,tracking:n,to:r,from:e})})]}}),i2={};St(i2,{fetchTask:()=>i6});function r6(t){return/^--upload-pack(=|$)/.test(t)}function i6(t,e,r){let i=["fetch",...r];return t&&e&&i.push(t,e),i.find(r6)?Nr("git.fetch: potential exploit argument blocked."):{commands:i,format:"utf-8",parser:e6}}var n6=Y({"src/lib/tasks/fetch.ts"(){"use strict";t6(),yt()}});function s6(t){return Hr({moves:[]},n2,t)}var n2,a6=Y({"src/lib/parsers/parse-move.ts"(){"use strict";ve(),n2=[new _e(/^Renaming (.+) to (.+)$/,(t,[e,r])=>{t.moves.push({from:e,to:r})})]}}),s2={};St(s2,{moveTask:()=>o6});function o6(t,e){return{commands:["mv","-v",...yn(t),e],format:"utf-8",parser:s6}}var l6=Y({"src/lib/tasks/move.ts"(){"use strict";a6(),ve()}}),a2={};St(a2,{pullTask:()=>c6});function c6(t,e,r){let i=["pull",...r];return t&&e&&i.splice(1,0,t,e),{commands:i,format:"utf-8",parser(n,s){return Xv(n,s)},onError(n,s,a,o){let l=gH(xu(n.stdOut),xu(n.stdErr));if(l)return o(new Eu(l));o(s)}}}var u6=Y({"src/lib/tasks/pull.ts"(){"use strict";_l(),PT(),ve()}});function f6(t){let e={};return o2(t,([r])=>e[r]={name:r}),Object.values(e)}function d6(t){let e={};return o2(t,([r,i,n])=>{Object.hasOwn(e,r)||(e[r]={name:r,refs:{fetch:"",push:""}}),n&&i&&(e[r].refs[n.replace(/[^a-z]/g,"")]=i)}),Object.values(e)}function o2(t,e){Iv(t,r=>e(r.split(/\s+/)))}var h6=Y({"src/lib/responses/GetRemoteSummary.ts"(){"use strict";ve()}}),l2={};St(l2,{addRemoteTask:()=>p6,getRemotesTask:()=>m6,listRemotesTask:()=>g6,remoteTask:()=>v6,removeRemoteTask:()=>w6});function p6(t,e,r){return Er(["remote","add",...r,t,e])}function m6(t){let e=["remote"];return t&&e.push("-v"),{commands:e,format:"utf-8",parser:t?d6:f6}}function g6(t){let e=[...t];return e[0]!=="ls-remote"&&e.unshift("ls-remote"),Er(e)}function v6(t){let e=[...t];return e[0]!=="remote"&&e.unshift("remote"),Er(e)}function w6(t){return Er(["remote","remove",t])}var b6=Y({"src/lib/tasks/remote.ts"(){"use strict";h6(),yt()}}),c2={};St(c2,{stashListTask:()=>_6});function _6(t={},e){let r=bT(t),i=["stash","list",...r.commands,...e],n=mT(r.splitter,r.fields,zv(i));return rh(i)||{commands:i,format:"utf-8",parser:n}}var y6=Y({"src/lib/tasks/stash-list.ts"(){"use strict";Cu(),vT(),Kv(),_T()}}),u2={};St(u2,{addSubModuleTask:()=>x6,initSubModuleTask:()=>E6,subModuleTask:()=>nh,updateSubModuleTask:()=>S6});function x6(t,e){return nh(["add",t,e])}function E6(t){return nh(["init",...t])}function nh(t){let e=[...t];return e[0]!=="submodule"&&e.unshift("submodule"),Er(e)}function S6(t){return nh(["update",...t])}var k6=Y({"src/lib/tasks/sub-module.ts"(){"use strict";yt()}});function A6(t,e){let r=Number.isNaN(t),i=Number.isNaN(e);return r!==i?r?1:-1:r?f2(t,e):0}function f2(t,e){return t===e?0:t>e?1:-1}function C6(t){return t.trim()}function Ud(t){return typeof t=="string"&&parseInt(t.replace(/^\D+/g,""),10)||0}var lC,d2,T6=Y({"src/lib/responses/TagList.ts"(){"use strict";lC=class{constructor(t,e){this.all=t,this.latest=e}},d2=function(t,e=!1){let r=t.split(` +`).map(C6).filter(Boolean);e||r.sort(function(n,s){let a=n.split("."),o=s.split(".");if(a.length===1||o.length===1)return A6(Ud(a[0]),Ud(o[0]));for(let l=0,c=Math.max(a.length,o.length);ln.indexOf(".")>=0);return new lC(r,i)}}}),h2={};St(h2,{addAnnotatedTagTask:()=>$6,addTagTask:()=>R6,tagListTask:()=>P6});function P6(t=[]){let e=t.some(r=>/^--sort=/.test(r));return{format:"utf-8",commands:["tag","-l",...t],parser(r){return d2(r,e)}}}function R6(t){return{format:"utf-8",commands:["tag",t],parser(){return{name:t}}}}function $6(t,e){return{format:"utf-8",commands:["tag","-a","-m",e,t],parser(){return{name:t}}}}var F6=Y({"src/lib/tasks/tag.ts"(){"use strict";T6()}}),I6=K3({"src/git.js"(t,e){"use strict";var{GitExecutor:r}=(D8(),_t(sT)),{SimpleGitApi:i}=(DH(),_t(HT)),{Scheduler:n}=(OH(),_t(UT)),{adhocExecTask:s,configurationErrorTask:a}=(yt(),_t(Ev)),{asArray:o,filterArray:l,filterPrimitives:c,filterString:u,filterStringOrStringArray:f,filterType:d,getTrailingOptions:h,trailingFunctionArgument:p,trailingOptionsArgument:g}=(ve(),_t(TC)),{applyPatchTask:w}=(NH(),_t(VT)),{branchTask:y,branchLocalTask:b,deleteBranchesTask:S,deleteBranchTask:C}=(ZH(),_t(XT)),{checkIgnoreTask:A}=(JH(),_t(t2)),{checkIsRepoTask:k}=(FC(),_t(PC)),{cleanWithOptionsTask:v,isCleanOptionsArray:x}=(jC(),_t(UC)),{diffSummaryTask:_}=(Kv(),_t(wT)),{fetchTask:P}=(n6(),_t(i2)),{moveTask:T}=(l6(),_t(s2)),{pullTask:M}=(u6(),_t(a2)),{pushTagsTask:$}=(IT(),_t(FT)),{addRemoteTask:D,getRemotesTask:Q,listRemotesTask:ye,remoteTask:de,removeRemoteTask:J}=(b6(),_t(l2)),{getResetMode:X,resetTask:he}=(tT(),_t(QC)),{stashListTask:z}=(y6(),_t(c2)),{addSubModuleTask:K,initSubModuleTask:G,subModuleTask:Me,updateSubModuleTask:Et}=(k6(),_t(u2)),{addAnnotatedTagTask:Ht,addTagTask:De,tagListTask:Rt}=(F6(),_t(h2)),{straightThroughBufferTask:$t,straightThroughStringTask:Xe}=(yt(),_t(Ev));function re(B,N){this._plugins=N,this._executor=new r(B.baseDir,new n(B.maxConcurrentProcesses),N),this._trimmed=B.trimmed}(re.prototype=Object.create(i.prototype)).constructor=re,re.prototype.customBinary=function(B){return this._plugins.reconfigure("binary",B),this},re.prototype.env=function(B,N){return arguments.length===1&&typeof B=="object"?this._executor.env=B:(this._executor.env=this._executor.env||{})[B]=N,this},re.prototype.stashList=function(B){return this._runTask(z(g(arguments)||{},l(B)&&B||[]),p(arguments))},re.prototype.mv=function(B,N){return this._runTask(T(B,N),p(arguments))},re.prototype.checkoutLatestTag=function(B){var N=this;return this.pull(function(){N.tags(function(ue,Re){N.checkout(Re.latest,B)})})},re.prototype.pull=function(B,N,ue,Re){return this._runTask(M(d(B,u),d(N,u),h(arguments)),p(arguments))},re.prototype.fetch=function(B,N){return this._runTask(P(d(B,u),d(N,u),h(arguments)),p(arguments))},re.prototype.silent=function(B){return this._runTask(s(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},re.prototype.tags=function(B,N){return this._runTask(Rt(h(arguments)),p(arguments))},re.prototype.rebase=function(){return this._runTask(Xe(["rebase",...h(arguments)]),p(arguments))},re.prototype.reset=function(B){return this._runTask(he(X(B),h(arguments)),p(arguments))},re.prototype.revert=function(B){let N=p(arguments);return typeof B!="string"?this._runTask(a("Commit must be a string"),N):this._runTask(Xe(["revert",...h(arguments,0,!0),B]),N)},re.prototype.addTag=function(B){let N=typeof B=="string"?De(B):a("Git.addTag requires a tag name");return this._runTask(N,p(arguments))},re.prototype.addAnnotatedTag=function(B,N){return this._runTask(Ht(B,N),p(arguments))},re.prototype.deleteLocalBranch=function(B,N,ue){return this._runTask(C(B,typeof N=="boolean"?N:!1),p(arguments))},re.prototype.deleteLocalBranches=function(B,N,ue){return this._runTask(S(B,typeof N=="boolean"?N:!1),p(arguments))},re.prototype.branch=function(B,N){return this._runTask(y(h(arguments)),p(arguments))},re.prototype.branchLocal=function(B){return this._runTask(b(),p(arguments))},re.prototype.raw=function(B){let N=!Array.isArray(B),ue=[].slice.call(N?arguments:B,0);for(let Ut=0;Utconsole.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},re.prototype.checkIgnore=function(B,N){return this._runTask(A(o(d(B,f,[]))),p(arguments))},re.prototype.checkIsRepo=function(B,N){return this._runTask(k(d(B,u)),p(arguments))},e.exports=re}});Hs();var M6=class extends Br{constructor(t,e){super(void 0,e),this.config=t}};Hs();Hs();var bl=class extends Br{constructor(t,e,r){super(t,r),this.task=t,this.plugin=e,Object.setPrototypeOf(this,new.target.prototype)}};_l();pC();FC();jC();WC();YC();XC();tT();function D6(t){return t?[{type:"spawn.before",action(i,n){t.aborted&&n.kill(new bl(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(i,n){function s(){n.kill(new bl(void 0,"abort","Abort signal received"))}t.addEventListener("abort",s),n.spawned.on("close",()=>t.removeEventListener("abort",s))}}]:void 0}function O6(t={}){return{type:"spawn.args",action(e,{env:r}){for(let i of DA(e,r))if(t[i.category]!==!0)throw new bl(void 0,"unsafe",i.message);return e}}}ve();function L6(t){let e=yu(t,"-c");return{type:"spawn.args",action(r){return[...e,...r]}}}ve();var cC=(0,vl.deferred)().promise;function N6({onClose:t=!0,onExit:e=50}={}){function r(){let n=-1,s={close:(0,vl.deferred)(),closeTimeout:(0,vl.deferred)(),exit:(0,vl.deferred)(),exitTimeout:(0,vl.deferred)()},a=Promise.race([t===!1?cC:s.closeTimeout.promise,e===!1?cC:s.exitTimeout.promise]);return i(t,s.close,s.closeTimeout),i(e,s.exit,s.exitTimeout),{close(o){n=o,s.close.done()},exit(o){n=o,s.exit.done()},get exitCode(){return n},result:a}}function i(n,s,a){n!==!1&&(n===!0?s.promise:s.promise.then(()=>vv(n))).then(a.done)}return{type:"spawn.after",async action(n,{spawned:s,close:a}){var u,f;let o=r(),l=!0,c=()=>{l=!1};(u=s.stdout)==null||u.on("data",c),(f=s.stderr)==null||f.on("data",c),s.on("error",c),s.on("close",d=>o.close(d)),s.on("exit",d=>o.exit(d));try{await o.result,l&&await vv(50),a(o.exitCode)}catch(d){a(o.exitCode,d)}}}}ve();var B6="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",uC="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";function H6(t){return!t||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(t)}function fC(t,e){if(t.length<1||t.length>2)throw new bl(void 0,"binary",B6);if(t.some(H6))if(e)console.warn(uC);else throw new bl(void 0,"binary",uC);let[i,n]=t;return{binary:i,prefix:n}}function U6(t,e=["git"],r=!1){let i=fC(yn(e),r);t.on("binary",n=>{i=fC(yn(n),r)}),t.append("spawn.binary",()=>i.binary),t.append("spawn.args",n=>i.prefix?[i.prefix,...n]:n)}Hs();function G6(t){return!!(t.exitCode&&t.stdErr.length)}function j6(t){return E.concat([...t.stdOut,...t.stdErr])}function V6(t=!1,e=G6,r=j6){return(i,n)=>!t&&i||!e(n)?i:r(n)}function dC(t){return{type:"task.error",action(e,r){let i=t(e.error,{stdErr:r.stdErr,stdOut:r.stdOut,exitCode:r.exitCode});return E.isBuffer(i)?{error:new Br(void 0,i.toString("utf-8"))}:{error:i}}}}ve();var z6=class{constructor(){this.plugins=new Set,this.events=new p2.EventEmitter}on(t,e){this.events.on(t,e)}reconfigure(t,e){this.events.emit(t,e)}append(t,e){let r=Ei(this.plugins,{type:t,action:e});return()=>this.plugins.delete(r)}add(t){let e=[];return yn(t).forEach(r=>r&&this.plugins.add(Ei(e,r))),()=>{e.forEach(r=>this.plugins.delete(r))}}exec(t,e,r){let i=e,n=Object.freeze(Object.create(r));for(let s of this.plugins)s.type===t&&(i=s.action(i,n));return i}};ve();function W6(t){let e="--progress",r=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(s,a){return r.includes(a.method)?_C(s,e):s}},{type:"spawn.after",action(s,a){var o;a.commands.includes(e)&&((o=a.spawned.stderr)==null||o.on("data",l=>{let c=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(l.toString("utf8"));c&&t({method:a.method,stage:q6(c[1]),progress:Qe(c[2]),processed:Qe(c[3]),total:Qe(c[4])})}))}}]}function q6(t){return String(t.toLowerCase().split(" ",1))||"unknown"}ve();function Y6(t){let e=xC(t,["uid","gid"]);return{type:"spawn.options",action(r){return{...e,...r}}}}function Z6({block:t,stdErr:e=!0,stdOut:r=!0}){if(t>0)return{type:"spawn.after",action(i,n){var c,u;let s;function a(){s&&clearTimeout(s),s=setTimeout(l,t)}function o(){var f,d;(f=n.spawned.stdout)==null||f.off("data",a),(d=n.spawned.stderr)==null||d.off("data",a),n.spawned.off("exit",o),n.spawned.off("close",o),s&&clearTimeout(s)}function l(){o(),n.kill(new bl(void 0,"timeout","block timeout reached"))}r&&((c=n.spawned.stdout)==null||c.on("data",a)),e&&((u=n.spawned.stderr)==null||u.on("data",a)),n.spawned.on("exit",o),n.spawned.on("close",o),a()}}}function K6(){return{type:"spawn.args",action(t){let e=[],r;function i(n){(r=r||[]).push(...n)}for(let n=0;n_i(a)&&ml(a)||a));break}e.push(s)}return r?[...e,"--",...r.map(String)]:e}}}ve();var X6=I6();function Q6(t,e){var n;let r=new z6,i=AC(t&&(typeof t=="string"?{baseDir:t}:t)||{},e);if(!Mv(i.baseDir))throw new M6(i,"Cannot use simple-git on a directory that does not exist");return Array.isArray(i.config)&&r.add(L6(i.config)),r.add(O6(i.unsafe)),r.add(N6(i.completion)),i.abort&&r.add(D6(i.abort)),i.progress&&r.add(W6(i.progress)),i.timeout&&r.add(Z6(i.timeout)),i.spawnOptions&&r.add(Y6(i.spawnOptions)),r.add(K6()),r.add(dC(V6(!0))),i.errors&&r.add(dC(i.errors)),U6(r,i.binary,(n=i.unsafe)==null?void 0:n.allowUnsafeCustomBinary),new X6(i,r)}_l();var m2=Q6;var Ce=class extends cl{constructor(r){super(r);this.useDefaultWindowsGitPath=!1}async setGitInstance(r=!1){var i;if(await this.isGitInstalled()){let n=this.app.vault.adapter,s=n.getBasePath(),a=s;this.plugin.settings.basePath&&(await n.exists((0,Zn.normalizePath)(this.plugin.settings.basePath))?a=We.join(s,this.plugin.settings.basePath):r||new Zn.Notice("ObsidianGit: Base path does not exist")),this.absoluteRepoPath=a,this.git=m2({baseDir:a,binary:this.plugin.localStorage.getGitPath()||(this.useDefaultWindowsGitPath?Rd:void 0),config:["core.quotepath=off"],unsafe:{allowUnsafeCustomBinary:!0,allowUnsafeEditor:!0,allowUnsafeAskPass:!0,allowUnsafeConfigEnvCount:!0,allowUnsafeConfigPaths:!0,allowUnsafeCredentialHelper:!0,allowUnsafeGitProxy:!0,allowUnsafeGpgProgram:!0,allowUnsafeHooksPath:!0,allowUnsafeMergeDriver:!0,allowUnsafeSshCommand:!0,allowUnsafePager:!0}});let o=this.plugin.localStorage.getPATHPaths(),l=this.plugin.localStorage.getEnvVars(),c=this.plugin.settings.gitDir,u={...process.env};if(o.length>0){let y=o.join(":")+":"+u.PATH;u.PATH=y}c&&(u.GIT_DIR=c,u.GIT_WORK_TREE=a);for(let y of l){let[b,S]=y.split("=");u[b]=S}let f="simple-git",d=",",p=((i=localStorage.debug)!=null?i:"").split(d);if(!p.includes(f)&&!p.includes(`-${f}`)&&(p.push(f),w2.default.enable(p.join(d))),await this.git.env(u).checkIsRepo()){let y=await this.git.revparse("--show-cdup"),b=(0,Tu.resolve)(a+Tu.sep+y);this.absoluteRepoPath=b,await this.git.cwd(b)}let g=We.join(s,this.app.vault.configDir,"plugins","obsidian-git"),w=We.join(g,Sa);u.SSH_ASKPASS==null&&(u.SSH_ASKPASS=w),u.SSH_ASKPASS_REQUIRE="force",u.OBSIDIAN_GIT_CREDENTIALS_INPUT=We.join(g,$d),u.SSH_ASKPASS==w&&this.askpass().catch(y=>this.plugin.displayError(y)),u.OBSIDIAN_GIT="1",this.git=this.git.env(u),this.watchFileChanges()}}watchFileChanges(){var i;(i=this.fileWatcherAbortController)==null||i.abort(),this.fileWatcherAbortController=new AbortController;let r=Ur.watch(this.absoluteRepoPath,{recursive:!0,signal:this.fileWatcherAbortController.signal,maxQueue:1});(async()=>{var n,s;try{for await(let a of r)a.filename&&!a.filename.startsWith(".git/")&&!await this.isIgnored(a.filename)&&(this.plugin.debRefresh(),(s=(n=this.plugin).autoCommitDebouncer)==null||s.call(n))}catch(a){if(a.name==="AbortError")return;throw a}})().catch(n=>this.plugin.displayError(n))}getRelativeVaultPath(r){let n=this.app.vault.adapter.getBasePath(),s=We.join(this.absoluteRepoPath,r),a=We.relative(n,s);return Zn.Platform.isWin&&(a=a.replace(/\\/g,"/")),a}getRelativeRepoPath(r,i=!0){if(i){let s=this.plugin.app.vault.adapter.getBasePath(),a=this.absoluteRepoPath,o=We.join(s,r),l=We.relative(a,o);return Zn.Platform.isWin&&(l=l.replace(/\\/g,"/")),l}return r}get absPluginConfigPath(){let i=this.app.vault.adapter.getBasePath();return We.join(i,this.app.vault.configDir,"plugins","obsidian-git")}get relPluginConfigPath(){return We.join(this.app.vault.configDir,"plugins","obsidian-git")}async askpass(){let r=this.app.vault.adapter,i=this.app.vault.configDir+"/plugins/obsidian-git/";await this.addAskPassScriptToExclude(),await Ur.writeFile(We.join(this.absPluginConfigPath,Sa),Nk),await Ur.chmod(We.join(this.absPluginConfigPath,Sa),493),this.askPassWatchAbortController=new AbortController;let{signal:n}=this.askPassWatchAbortController;try{let s=Ur.watch(this.absPluginConfigPath,{signal:n});for await(let a of s){if(a.filename!=$d)continue;let o=i+$d;if(await new Promise(d=>window.setTimeout(d,200)),!await r.exists(o))continue;let l=await r.read(o),c;l.length>60&&(c=new Zn.Notice(l,999999));let u=!0;l.contains("Username for")&&(u=!1);let f=await new tt(this.plugin,{allowEmpty:!0,obscure:u,placeholder:l.length>60?"Enter a response to the message.":l}).openAndGetResult();c==null||c.hide(),await r.exists(o)&&await r.write(`${o}.response`,f!=null?f:"")}}catch(s){this.plugin.displayError(s),await Ur.rm(We.join(this.absPluginConfigPath,Sa),{force:!0}),await Ur.rm(We.join(this.absPluginConfigPath,`${Sa}.response`),{force:!0}),await new Promise(a=>window.setTimeout(a,5e3)),this.plugin.log("Retry watch for ask pass"),await this.askpass()}}async addAskPassScriptToExclude(){try{if(!await this.git.checkIsRepo())return;let r=await this.git.revparse(["--path-format=absolute","--git-path","info/exclude"]),i=We.join(this.app.vault.configDir,"plugins","obsidian-git",Sa),n=this.getRelativeRepoPath(i,!0);(await Ur.readFile(r,"utf-8")).split(` +`).some(l=>l.contains(n))||await Ur.appendFile(r,n+` +`)}catch(r){console.error("Error while adding askpass script to exclude file:",r)}}unload(){var r,i;(r=this.askPassWatchAbortController)==null||r.abort(),(i=this.fileWatcherAbortController)==null||i.abort()}async status(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=await this.git.status(i!=null?["--",i]:[]);this.plugin.setPluginState({gitAction:0});let s=n.files.map(a=>{let o=this.formatPath(a);return{path:o.path,from:o.from,index:a.index==="?"?"U":a.index,workingDir:a.working_dir==="?"?"U":a.working_dir,vaultPath:this.getRelativeVaultPath(o.path)}});return{all:s,changed:s.filter(a=>a.workingDir!==" "),staged:s.filter(a=>a.index!==" "&&a.index!="U"),conflicted:n.conflicted.map(a=>this.formatPath({path:a}).path)}}async submoduleAwareHeadRevisonInContainingDirectory(r){let i=this.getRelativeRepoPath(r),s=["-C",We.dirname(i),"rev-parse","HEAD"],a=this.git.raw(s);return a.catch(o=>console.warn("obsidian-git: rev-parse error:",o)),(await a).trim()}async getSubmodulePaths(){return new Promise(r=>{this.git.outputHandler((i,n,s,a)=>{if(!(a.contains("submodule")&&a.contains("foreach")))return;let o="",l=this.app.vault.adapter.getBasePath()+(this.plugin.settings.basePath?"/"+this.plugin.settings.basePath:"");n.on("data",c=>{o+=c.toString("utf8")}),n.on("end",()=>{let u=o.split(` +`).map(f=>{let d=f.match(/'([^']*)'/);if(d!=null)return l+"/"+d[1]+Tu.sep}).filter(f=>!!f);u.reverse(),r(u)})}),this.git.subModule(["foreach","--recursive",""]).then(()=>{this.git.outputHandler(()=>{})},i=>this.plugin.displayError(i))})}formatPath(r){function i(n){if(n!=null)return n.startsWith('"')&&n.endsWith('"')?n.substring(1,n.length-1):n}return r.from!=null?{from:i(r.from),path:i(r.path)}:{path:i(r.path)}}async blame(r,i,n){if(r=this.getRelativeRepoPath(r),!await this.isTracked(r))return"untracked";let s=await this.getSubmoduleOfFile(r),a=s?["-C",s.submodule]:[],o=s?s.relativeFilepath:r;a.push("blame","--porcelain"),n&&a.push("-w");let l=`-C${Pd}`;switch(i){case"inactive":break;case"same-commit":a.push("-C",l);break;case"all-commits":a.push("-C","-C",l);break;default:Ls(i)}a.push("--",o);let c=await this.git.raw(a);return J6(c)}async isTracked(r){let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("ls-files","--",s),this.git.raw(n).then(a=>a.trim()!=="")}async commitAll({message:r}){if(this.plugin.settings.updateSubmodules){this.plugin.setPluginState({gitAction:4});let n=await this.getSubmodulePaths();for(let s of n)await this.git.cwd({path:s,root:!1}).add("-A"),await this.git.cwd({path:s,root:!1}).commit(await this.formatCommitMessage(r))}this.plugin.setPluginState({gitAction:3}),await this.git.add("-A"),this.plugin.setPluginState({gitAction:4});let i=await this.git.commit(await this.formatCommitMessage(r));return this.app.workspace.trigger("obsidian-git:head-change"),i.summary.changes}async commit({message:r,amend:i}){this.plugin.setPluginState({gitAction:4});let n=(await this.git.commit(await this.formatCommitMessage(r),i?["--amend"]:[])).summary.changes;return this.app.workspace.trigger("obsidian-git:head-change"),this.plugin.setPluginState({gitAction:0}),n}async stage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.add(["--",r]),this.plugin.setPluginState({gitAction:0})}async stageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.add(r!=null?r:"-A"),this.plugin.setPluginState({gitAction:0})}async unstageAll({dir:r}){this.plugin.setPluginState({gitAction:3}),await this.git.reset(r!=null?["--",r]:[]),this.plugin.setPluginState({gitAction:0})}async unstage(r,i){this.plugin.setPluginState({gitAction:3}),r=this.getRelativeRepoPath(r,i),await this.git.reset(["--",r]),this.plugin.setPluginState({gitAction:0})}async discard(r){this.plugin.setPluginState({gitAction:3}),await this.isTracked(r)&&await this.git.checkout(["--",r]),this.plugin.setPluginState({gitAction:0})}async applyPatch(r){let i=We.join(this.relPluginConfigPath,"patch");await this.app.vault.adapter.write(i,r),await this.git.applyPatch(i,{"--cached":null,"--unidiff-zero":null,"--whitespace":"nowarn"}),await this.app.vault.adapter.remove(i)}async getUntrackedPaths(r){let i=r==null?void 0:r.path;this.plugin.setPluginState({gitAction:1});let n=[];i!=null&&n.push("--",i);let s=await this.git.clean(Pa.RECURSIVE+Pa.DRY_RUN,n);return this.plugin.setPluginState({gitAction:0}),s.paths}async hashObject(r){r=this.getRelativeRepoPath(r);let i=await this.getSubmoduleOfFile(r),n=i?["-C",i.submodule]:[],s=i?i.relativeFilepath:r;return n.push("hash-object","--",s),this.git.raw(n)}async discardAll({dir:r}){return this.discard(r!=null?r:".")}async pull(){this.plugin.setPluginState({gitAction:2});try{this.plugin.settings.updateSubmodules&&await this.git.subModule(["update","--remote","--merge","--recursive"]);let r=await this.branchInfo(),i=await this.git.revparse([r.current]);if(!r.tracking&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring pull of main repo and updating submodules only.");return}await this.git.fetch();let n=await this.git.revparse([r.tracking]);if(i!==n){if(this.plugin.settings.syncMethod==="merge"||this.plugin.settings.syncMethod==="rebase")try{let o=[r.tracking];switch(this.plugin.settings.mergeStrategy!=="none"&&o.push(`--strategy-option=${this.plugin.settings.mergeStrategy}`),this.plugin.settings.syncMethod){case"merge":await this.git.merge(o);break;case"rebase":await this.git.rebase(o)}}catch(o){this.plugin.displayError(`Pull failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`);return}else if(this.plugin.settings.syncMethod==="reset")try{await this.git.raw(["update-ref",`refs/heads/${r.current}`,n]),await this.unstageAll({})}catch(o){this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${"message"in o?o.message:o}`)}this.app.workspace.trigger("obsidian-git:head-change");let s=await this.git.revparse([r.current]);return(await this.git.diff([`${i}..${s}`,"--name-only"])).split(/\r\n|\r|\n/).filter(o=>o.length>0).map(o=>({path:o,workingDir:"P",vaultPath:this.getRelativeVaultPath(o)}))}else return[]}catch(r){this.convertErrors(r)}}async push(){this.plugin.setPluginState({gitAction:5});try{if(this.plugin.settings.updateSubmodules){let a=await this.git.subModule(["foreach","--recursive",`tracking=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"); echo $tracking; if [ ! -z "$(git diff --shortstat $tracking)" ]; then git push; fi`]);console.log(a)}let r=await this.git.status(),i=r.tracking,n=r.current;if(!i&&this.plugin.settings.updateSubmodules){this.plugin.log("No tracking branch found. Ignoring push of main repo and updating submodules only.");return}let s=null;return i&&(s=(await this.git.diffSummary([n,i,"--"])).changed),await this.git.push(),s}catch(r){this.convertErrors(r)}}async getUnpushedCommits(){let r=await this.git.status(),i=r.tracking,n=r.current;if(i==null||n==null)return 0;let[s]=Yn(i);return(await this.getRemoteBranches(s)).includes(i)?(await this.git.diffSummary([n,i,"--"])).changed:(this.plugin.log(`Tracking branch ${i} does not exist on remote ${s}.`),0)}async canPush(){if(this.plugin.settings.updateSubmodules===!0)return!0;let r=await this.git.status(),i=r.tracking,n=r.current;return i?(await this.git.diffSummary([n,i,"--"])).changed!==0:!1}async checkRequirements(){return await this.isGitInstalled()?await this.git.checkIsRepo()?"valid":"missing-repo":"missing-git"}async branchInfo(){let r=await this.git.status(),i=await this.git.branch(["--no-color"]);return{current:r.current||void 0,tracking:r.tracking||void 0,branches:i.all}}async getRemoteUrl(r){try{return await this.git.remote(["get-url",r])||void 0}catch(i){if(String(i).contains(r))return;throw i}}async log(r,i=!0,n,s){let a;r&&(a=this.getRelativeRepoPath(r,i));let o={file:a,maxCount:n,"--diff-merges":"first-parent","--name-status":null};return s&&(o[s]=null),(await this.git.log(o)).all.map(c=>{var u,f,d,h;return{...c,author:{name:c.author_name,email:c.author_email},refs:c.refs.split(", ").filter(p=>p.length>0),diff:{...c.diff,files:(f=(u=c.diff)==null?void 0:u.files.map(p=>({...p,status:p.status,path:p.file,hash:c.hash,vaultPath:this.getRelativeVaultPath(p.file),fromPath:p.from,fromVaultPath:p.from!=null?this.getRelativeVaultPath(p.from):void 0,binary:p.binary})))!=null?f:[]},fileName:(h=(d=c.diff)==null?void 0:d.files.first())==null?void 0:h.file}})}async show(r,i,n=!0){let s=this.getRelativeRepoPath(i,n);return this.git.show([r+":"+s])}async getLocalBranchUpstream(r){try{let n=(await this.git.raw(["rev-parse","--abbrev-ref",`${r}@{upstream}`])).trim();return n.length>0?n:void 0}catch(i){return}}getAvailableLocalBranchName(r,i,n){let s=r;if(!n.includes(s))return s;let a=`${r}-${i}`,o=a,l=0;for(;n.includes(o);)l+=1,o=`${a}-${l}`;return o}async checkout(r,i){if(i){let n=`${i}/${r}`,s=await this.branchInfo();if(s.branches.includes(r)&&await this.getLocalBranchUpstream(r)===n)await this.git.checkout(r);else{let l=this.getAvailableLocalBranchName(r,i,s.branches);await this.git.checkout(["-b",l,n])}}else await this.git.checkout(r);if(this.plugin.settings.submoduleRecurseCheckout){let n=await this.getSubmodulePaths();for(let s of n){let a=await this.git.cwd({path:s,root:!1}).branch();Object.keys(a.branches).includes(r)&&await this.git.cwd({path:s,root:!1}).checkout(r)}}}async createBranch(r){await this.git.checkout(["-b",r])}async deleteBranch(r,i){await this.git.branch([i?"-D":"-d",r])}async branchIsMerged(r){return!(await this.git.branch(["--no-merged"])).all.contains(r)}async init(){await this.git.init(!1)}async clone(r,i,n){await this.git.clone(r,We.join(this.app.vault.adapter.getBasePath(),i),n?["--depth",`${n}`]:[]),await this.setGitInstance()}async setConfig(r,i){i==null?await this.git.raw(["config","--local","--unset",r]):await this.git.addConfig(r,i)}async getConfig(r,i="local"){var s;return(s=(await this.git.getConfig(r.toLowerCase(),i=="all"?void 0:i)).value)!=null?s:void 0}async fetch(r){await this.git.fetch(r!=null?[r]:[])}async setRemote(r,i){(await this.getRemotes()).includes(r)?await this.git.remote(["set-url",r,i]):await this.git.remote(["add",r,i])}async getRemoteBranches(r){let i=await this.git.branch(["-r","--list",`${r}*`]),n=[];for(let s in i.branches)n.push(i.branches[s].name);return n}async getRemotes(){let r=await this.git.remote([]);return r?r.trim().split(` +`):[]}async removeRemote(r){await this.git.removeRemote(r)}async updateUpstreamBranch(r){try{await this.git.branch(["--set-upstream-to",r])}catch(i){try{await this.git.branch(["--set-upstream",r])}catch(n){let[s,a]=Yn(r),o=await this.branchInfo();await this.git.push(["--set-upstream",s,`${o.current}:${a}`])}}}updateGitPath(r){return this.setGitInstance()}updateBasePath(r){return this.setGitInstance(!0)}async getDiffString(r,i=!1,n){return i?await this.git.diff(["--cached","--",r]):n?await this.git.show([`${n}`,"--",r]):await this.git.diff(["--",r])}async diff(r,i,n){return await this.git.diff([`${i}..${n}`,"--",r])}async rawCommand(r){let i=r.split(" ");return await this.git.raw(i[0],...i.slice(1))}async isIgnored(r){return(await this.git.checkIgnore(r)).length>0}async getSubmoduleOfFile(r){if(!await this.app.vault.adapter.exists(We.dirname(r)))return;let i=await this.git.raw(["-C",We.dirname(r),"rev-parse","--show-toplevel"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message));if(i=i.trim(),(await this.git.raw(["-C",We.dirname(r),"rev-parse","--show-superproject-working-tree"],l=>l&&console.warn("get-submodule-of-file",l==null?void 0:l.message))).trim()==="")return;let a=this.app.vault.adapter.getFullPath(We.normalize(r)),o=We.relative(i,a);return{submodule:i,relativeFilepath:o}}async getLastCommitTime(){try{let r=await this.git.log({n:1});if(r!=null&&r.latest!=null)return new Date(r.latest.date)}catch(r){if(r instanceof Br){if(r.message.contains("does not have any commits yet"))return}else throw r}}async isGitInstalled(){let r=this.plugin.localStorage.getGitPath(),i=await wu(r||"git",["--version"],{});if(i.error)if(Zn.Platform.isWin&&!r){this.plugin.log(`Git not found in PATH. Checking standard installation path(${Rd}) of Git for Windows.`);let n=await wu(Rd,["--version"]);if(n.error)return console.error(n.error),!1;this.useDefaultWindowsGitPath=!0}else return console.error(i.error),!1;else this.useDefaultWindowsGitPath=!1;return!0}convertErrors(r){if(r instanceof Br){let i=String(r.message);if(i.contains("Could not resolve host")||i.contains("Unable to resolve host")||i.contains("Unable to open connection")||i.match(/ssh: connect to host .*? port .*?: Operation timed out/)!=null||i.match(/ssh: connect to host .*? port .*?: Network is unreachable/)!=null||i.match(/ssh: connect to host .*? port .*?: Undefined error: 0/)!=null)throw new nl(i)}throw r}async isFileTrackedByLFS(r){try{return(await this.git.raw(["check-attr","filter",r])).includes("filter: lfs")}catch(i){let n=i instanceof Error?i.message:String(i);return this.plugin.displayError(`Error checking LFS status: ${n}`),!1}}},b2={hash:"000000",isZeroCommit:!0,summary:""};function J6(t){let r=t.replace(`\r +`,` +`).split(` +`),i={commits:new Map,hashPerLine:[void 0],originalFileLineNrPerLine:[void 0],finalFileLineNrPerLine:[void 0],groupSizePerStartingLine:new Map},n=1;for(let s=0;s=4&&r.groupSizePerStartingLine.set(e,parseInt(t[3])),parseInt(t[2])!==e)throw Error(`git-blame output is out of order: ${e} vs ${t[2]}`);return i}function t5(t,e,r){let i=t[0],n=t.slice(1).join(" "),s=e.hashPerLine[r],a=e.commits.get(s)||{hash:s,author:{},committer:{},previous:{}};switch(i){case"summary":a.summary=n;break;case"author":a.author.name=n;break;case"author-mail":a.author.email=v2(n);break;case"author-time":a.author.epochSeconds=parseInt(n);break;case"author-tz":a.author.tz=n;break;case"committer":a.committer.name=n;break;case"committer-mail":a.committer.email=v2(n);break;case"committer-time":a.committer.epochSeconds=parseInt(n);break;case"committer-tz":a.committer.tz=n;break;case"previous":a.previous.commitHash=n;break;case"filename":a.previous.filename=n;break}e.commits.set(s,a)}function r5(t){if(t.summary===void 0)throw Error(`Summary not provided for commit: ${t.hash}`);ew(t.author)&&(t.author=void 0),ew(t.committer)&&(t.committer=void 0),ew(t.previous)&&(t.previous=void 0),t.isZeroCommit=!!t.hash.match(/^0*$/)}function ew(t){return!t||Object.keys(t).length===0}function g2(t){return t.length>0&&t[0].trim()===t[0]}function v2(t){let e=t.startsWith("<")?t.substring(1):t;return e.endsWith(">")?e.substring(0,e.length-1):e}m();var q2=require("@codemirror/state");m();var tw=class{constructor(){this.eventsPerFilepath=new Map;this.startRemoveStalesSubscribersInterval()}ifFilepathDefinedTransformSubscribers(e,r){if(e)return this.ensureInitialized(e),r(this.eventsPerFilepath.get(e))}forEachSubscriber(e){this.eventsPerFilepath.forEach(r=>r.forEach(e))}ensureInitialized(e){this.eventsPerFilepath.get(e)||this.eventsPerFilepath.set(e,new Set)}startRemoveStalesSubscribersInterval(){this.removeStalesSubscribersTimer=window.setInterval(()=>this==null?void 0:this.forEachSubscriber(e=>e==null?void 0:e.removeIfStale()),6e4)}clear(){window.clearInterval(this.removeStalesSubscribersTimer),this.eventsPerFilepath.clear()}},Kn=new tw;m();var ah=require("@codemirror/state"),x2=Gt(rw(),1);function E2(t,e,r){if(!(t===void 0||e===void 0||r===void 0))return`head${t}-obj${e}-path${r}`}var S2=ah.StateEffect.define();function k2(t,e,r){return r.update({effects:S2.of({key:t,la:e,lineOffsetsFromUnsavedChanges:new Map})})}var xl=ah.StateField.define({create:t=>{},update:(t,e)=>{for(let r of e.effects)if(r.is(S2))return r.value;return i5(e,t)},compare:(t,e)=>(t==null?void 0:t.key)===(e==null?void 0:e.key)});function oh(t){var s;let e=x2.sha256.create();if(!t)return e;let{la:r,key:i,lineOffsetsFromUnsavedChanges:n}=t;e.update(r==="untracked"?"t":"f"),e.update(i);for(let[a,o]of(s=n.entries())!=null?s:[])e.update([a,o]);return e}var Pu={get:void 0,save:void 0};function A2(t,e){Pu.get=t,Pu.save=e}function lh(t){var e,r;return(r=(e=Ru(t.coloringMaxAge))==null?void 0:e.asDays())!=null?r:Ru(pt.lineAuthor.coloringMaxAge).asDays()}function i5(t,e){if(e)return t.changes.empty||t.changes.iterChanges((r,i,n,s)=>{var p;let a=t.startState.doc,{newDoc:o}=t,l=a.lineAt(r).number,c=a.lineAt(i).number,u=o.lineAt(n).number,f=o.lineAt(s).number,d=c-l+1,h=f-u+1;for(let g=u;g<=f;g++){let w=(p=e.lineOffsetsFromUnsavedChanges.get(g))!=null?p:0,y=f===g,b=h-d;y&&(w+=b),e.lineOffsetsFromUnsavedChanges.set(g,w)}}),e}m();function C2(){El=void 0,iw=[],ch=0,fh.clear(),dh.clear(),Sl.clear()}var El,uh=()=>El;function T2(t,e){var n;let r=e.length;if(r<((n=El==null?void 0:El.length)!=null?n:0))return;El={gutter:t,length:r,text:e};let i=zt.plugin.localStorage.getGutterSpacingFallbackLength();r!==i&&zt.plugin.localStorage.setGutterSpacingFallbackLength(r)}var iw=[],n5=15,ch=0;function P2(t){iw[ch]=t,ch=(ch+1)%n5}function R2(){return fA(iw)}var fh=new Map,dh=new Map,Sl=new Set;m();var V2=require("@codemirror/state"),z2=require("@codemirror/view");m();var ow=require("@codemirror/view"),B2=Gt(rw(),1),kl=require("obsidian");m();m();var hh={x:-10,y:-10};function $2(){hh.x===-10&&window.addEventListener("mousedown",t=>{hh.x=t.clientX,hh.y=t.clientY})}function F2(){for(let t of Sl)if(s5(t,hh))return t}function s5(t,e){let{x:r,y:i,width:n,height:s}=t.getBoundingClientRect();return r<=e.x&&e.x<=r+n&&i<=e.y&&e.y<=i+s}var I2="data-commit";function M2(t,e,r){if(e.hasFocus())return;let i=F2();if(!i)return;let n=o5(i);n&&(!n.isZeroCommit&&!n.isWaitingGutter&&a5(n,t),nw("showCommitHash",t),nw("authorDisplay",t),nw("dateTimeFormatOptions",t))}function a5(t,e){e.addItem(r=>r.setTitle("Copy commit hash").setIcon("copy").setSection("obs-git-line-author-copy").onClick(i=>navigator.clipboard.writeText(t.hash)))}function nw(t,e){var l,c;let r,i,n=zt.plugin.settings.lineAuthor,s=n[t],a=typeof s=="boolean"?s:s!=="hide",o=pt.lineAuthor[t];if(t==="showCommitHash")r="Show commit hash",i=s;else if(t==="authorDisplay"){let u=(l=n.lastShownAuthorDisplay)!=null?l:o;r="Show author "+(a?s:u),i=a?"hide":u}else if(t==="dateTimeFormatOptions"){let u=(c=n.lastShownDateTimeFormatOptions)!=null?c:o;r="Show "+(a?s:u),r+=r.contains("date")?"":" date",i=a?"hide":u}else Ls(t);e.addItem(u=>u.setTitle(r).setSection("obs-git-line-author-configure").setChecked(a).onClick(f=>{var d,h;return(h=(d=zt.plugin)==null?void 0:d.settingsTab)==null?void 0:h.lineAuthorSettingHandler(t,i)}))}function D2(t,e,r){r.setAttr(I2,JSON.stringify({hash:t.hash,isZeroCommit:t.isZeroCommit,isWaitingGutter:e}))}function o5(t){let e=t.getAttr(I2);return e?JSON.parse(e):void 0}m();function mh(t,e){return t==="oldest"?ph(0,!1,e).color:ph(void 0,!0,e).color}function ph(t,e,r){let i=lh(r),n=Date.now()/1e3,s=t!=null?t:0,o=(e?0:n-s)/60/60/24,l=Math.pow(Math.clamp(o/i,0,1),1/2.3),c=l5(),u=r.colorNew,f=r.colorOld,d=c?.4:1,h=sw(u.r,f.r,l)*d,p=sw(u.g,f.g,l)*d,g=sw(u.b,f.b,l)*d;return{color:`rgba(${h},${p},${g},${c?.75:.25})`,daysSinceCommit:o}}function sw(t,e,r){return t+(e-t)*r}function l5(){var t;return((t=window.app)==null?void 0:t.getTheme())==="obsidian"}function O2(t){activeDocument.body.style.setProperty("--obs-git-gutter-text",t.textColorCss)}m();function L2(t,e,r){let i;for(let n=e;n<=r;n++){let s=t.hashPerLine[n],a=t.commits.get(s);(!i||a.isZeroCommit||c5(a,i))&&(i=a)}return i}function c5(t,e){var n,s,a,o;let r=(s=(n=t.author)==null?void 0:n.epochSeconds)!=null?s:0,i=(o=(a=e.author)==null?void 0:a.epochSeconds)!=null?o:0;return r>i}var H2=require("node:util");var N2="-",u5="+",f5=3,d5="*",h5=/\S/g,p5="%",Al=class t extends ow.GutterMarker{constructor(r){super();this.text=r}eq(r){return r instanceof t&&this.text===r.text}toDOM(){return activeDocument.createTextNode(this.text)}destroy(r){}},aw=class extends ow.GutterMarker{constructor(r,i,n,s,a,o){super();this.lineAuthoring=r;this.startLine=i;this.endLine=n;this.key=s;this.settings=a;this.options=o;this.point=!1;this.elementClass="obs-git-blame-gutter"}eq(r){return this.key===(r==null?void 0:r.key)&&this.startLine===(r==null?void 0:r.startLine)&&this.endLine===(r==null?void 0:r.endLine)&&(this==null?void 0:this.options)===(r==null?void 0:r.options)}toDOM(){var r;return this.precomputedDomProvider=(r=this.precomputedDomProvider)!=null?r:this.computeDom(),this.precomputedDomProvider()}destroy(r){r&&(activeDocument.body.contains(r)||Sl.delete(r))}computeDom(){let r=L2(this.lineAuthoring,this.startLine,this.endLine),i=r.isZeroCommit?"":this.renderNonZeroCommit(r);return!r.isZeroCommit&&this.options!=="waiting-for-result"?T2(this,i):i=this.adaptTextForFakeCommit(r,i,this.options),this.createHtmlNode(r,i,this.options==="waiting-for-result")}createHtmlNode(r,i,n){var c,u,f,d,h,p;let s=window.createDiv();s.setText(i);let{color:a,daysSinceCommit:o}=ph((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds,r==null?void 0:r.isZeroCommit,this.settings);s.style.backgroundColor=a,s.setAttribute("data-author",(f=(u=r==null?void 0:r.author)==null?void 0:u.name)!=null?f:""),s.setAttribute("data-author-email",(h=(d=r==null?void 0:r.author)==null?void 0:d.email)!=null?h:""),(0,kl.setTooltip)(s,(p=r==null?void 0:r.summary)!=null?p:""),D2(r,n,s);function l(){let g=s.cloneNode(!0);return Sl.add(g),n||P2(o),g}return l}renderNonZeroCommit(r){let i=this.settings.showCommitHash?this.renderHash(r):"",n=this.settings.authorDisplay==="hide"?"":`${this.renderAuthorName(r,this.settings.authorDisplay)}`,s=this.settings.dateTimeFormatOptions==="hide"?"":`${this.renderAuthoringDate(r,this.settings.dateTimeFormatOptions,this.settings.dateTimeFormatCustomString,this.settings.dateTimeTimezone)}`;return[i,n,s].filter(o=>o.length>=1).join(" ")}renderHash(r){return r.hash.substring(0,6)}renderAuthorName(r,i){var o,l,c,u;let n=(l=(o=r==null?void 0:r.author)==null?void 0:o.name)!=null?l:"",s=n.split(" ").filter(f=>f.length>=1),a;switch(i){case"initials":a=s.map(f=>f[0].toUpperCase()).join("");break;case"first name":a=(c=s.first())!=null?c:N2;break;case"last name":a=(u=s.last())!=null?u:N2;break;case"full":a=n;break;default:return Ls(i)}return(0,H2.isDeepStrictEqual)(r==null?void 0:r.author,r==null?void 0:r.committer)||(a=a+d5),a}renderAuthoringDate(r,i,n,s){var c;if(((c=r==null?void 0:r.author)==null?void 0:c.epochSeconds)===void 0)return"?";let o;switch(i){case"date":o=Td;break;case"datetime":o=Zg;break;case"custom":o=n;break;case"natural language":o=u=>{let f=u.diff((0,kl.moment)());return kl.moment.duration(f).humanize(!0)};break;default:return Ls(i)}let l=kl.moment.unix(r.author.epochSeconds);switch(s){case"viewer-local":break;case"author-local":l=l.utcOffset(r.author.tz),typeof o=="string"&&(o+=" Z");break;case"utc0000":l=l.utc(),typeof o=="string"&&(o+="[Z]");break;default:return Ls(s)}return typeof o=="string"?l.format(o):o(l)}adaptTextForFakeCommit(r,i,n){var l,c,u;let s=(c=(l=uh())==null?void 0:l.text)!=null?c:i,a=n!=="waiting-for-result"&&r.isZeroCommit?u5:p5;i=s.replace(h5,a);let o=(u=zt.plugin.localStorage.getGutterSpacingFallbackLength())!=null?u:i.length;if(i=dA(i,o,a),n!=="waiting-for-result"&&r.isZeroCommit){let f=Math.min(o,f5);i=hA(i,o-f)}return i}};function Fa(t,e,r,i,n,s){let a=B2.sha256.create();a.update(JSON.stringify(n)),a.update(`s${e}-e${r}-k${i}-o${s}`);let o=a.hex(),l=fh.get(o);if(l)return l;let c=new aw(t,e,r,i,n,s);return fh.set(o,c),c}m();var U2=require("obsidian");function lw(){let t=zt.plugin.localStorage.getGutterSpacingFallbackLength();return new Al(Array(t).fill("-").join(""))}function cw(t){let{lineAuthoring:e,ageForInitialRender:r}=m5(t);return Fa(e,1,1,"initialGutter"+r,t,"waiting-for-result")}function m5(t){var s;let e=(s=R2())!=null?s:lh(t)*.25,r=(0,U2.moment)().add(-e,"days"),i={name:"",epochSeconds:uA(r),tz:"+0000"},n={hash:"waiting-for-result",author:i,committer:i,isZeroCommit:!1};return{lineAuthoring:{hashPerLine:[void 0,"waiting-for-result"],commits:new Map([["waiting-for-result",n]])},ageForInitialRender:e}}m();function G2(t,e){return Fa({hashPerLine:[void 0,"000000"],commits:new Map([["000000",b2]])},1,1,t,e)}var uw=new Al(""),W2=(0,z2.gutter)({class:"line-author-gutter-container",markers(t){let e=t.state.field(xl,!1);return g5(t,e)},lineMarkerChange(t){let e=oh(t.state.field(xl));return oh(t.startState.field(xl))!==e},renderEmptyElements:!0,initialSpacer:t=>(j2(t),lw()),updateSpacer:(t,e)=>{var r,i;return j2(e.view),(i=(r=uh())==null?void 0:r.gutter)!=null?i:lw()}});function g5(t,e){let r=oh(e),i=t.state.doc,n=new Map;for(let u=1;u<=i.lines;u++){let f=i.line(u).from,d=t.lineBlockAt(f).to;n.set(u,[f,d]),r.update([f,d,0])}let s=Pu.get();r.update("s"+Object.values(Pu).join(","));let a=r.hex(),o=dh.get(a);if(o)return o;let{result:l,allowCache:c}=v5(i,n,s,e);return c&&dh.set(a,l),l}function v5(t,e,r,i){let n=!0,s=t.lines,a=[];function o(f,d,h){return a.push(h.range(f,d))}let l=w5(s,i),c=t.length===0,u=t.iterLines(s,s+1).next().value==="";for(let f=1;f<=s;f++){let[d,h]=e.get(f),p=t.lineAt(h).number;if(c){o(d,h,uw);continue}if(f===s&&u){o(d,h,uw);continue}if(i===void 0){o(d,h,cw(r)),n=!1;continue}let{key:g,la:w}=i;if(w==="untracked"){o(d,h,G2(w,r));continue}let y=w.hashPerLine.length-1,b=l[f],S=l[p];if(S&&S>y&&o(d,h,uw),b!==void 0&&sv(1,b,y)&&S!==void 0&&sv(1,S,y)){o(d,h,Fa(w,b,S,g,r));continue}if(y<1){o(d,h,cw(r)),n=!1;continue}let C=Math.clamp(b!=null?b:f,1,y),A=Math.clamp(S!=null?S:p,1,y);o(d,h,Fa(w,C,A,g+"computing",r,"waiting-for-result"))}return{result:V2.RangeSet.of(a,!0),allowCache:n}}function w5(t,e){if(!(e!=null&&e.lineOffsetsFromUnsavedChanges))return Array.from(new Array(t+1),n=>n);let r=[void 0],i=0;for(let n=1;n<=t;n++){let s=e.lineOffsetsFromUnsavedChanges.get(n);i+=s!=null?s:0,r[n]=s===void 0?n-i:void 0}return r}function j2(t){t.dom.querySelectorAll(".cm-gutters").forEach(r=>{r!=null&&r.style&&(r.style.marginLeft||(r.style.marginLeft="unset"))})}var gh=class{constructor(e){this.plugin=e;this.lineAuthorings=new Map}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeLineAuthorInfo(e.path)}}destroy(){this.lineAuthorings.clear(),C2()}async computeLineAuthorInfo(e){let r=this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager,i=await r.submoduleAwareHeadRevisonInContainingDirectory(e),n=await r.hashObject(e),s=E2(i,n,e);if(s!==void 0){if(!this.lineAuthorings.has(s)){let a=await r.blame(e,this.plugin.settings.lineAuthor.followMovement,this.plugin.settings.lineAuthor.ignoreWhitespace);this.lineAuthorings.set(s,a)}this.notifyComputationResultToSubscribers(e,s)}}notifyComputationResultToSubscribers(e,r){Kn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyLineAuthoring(r,this.lineAuthorings.get(r))))}},Y2=q2.Prec.high([xl,W2]);var Z2="https://momentjs.com/docs/#/parsing/string-format/",b5="https://publish.obsidian.md/git-doc/Line+Authoring",vh=class extends j.PluginSettingTab{constructor(r,i){super(r,i);this.plugin=i;this.lineAuthorColorSettings=new Map;this.icon="git-pull-request"}get settings(){return this.plugin.settings}display(){let{containerEl:r}=this,i=this.plugin,n;i.settings.differentIntervalCommitAndPush?n="commit":n="commit-and-sync";let s=i.gitReady;r.empty(),s||(r.createEl("p",{text:"Git is not ready. When all settings are correct you can configure commit-sync, etc."}),r.createEl("br"));let a;if(s){new j.Setting(r).setName("Automatic").setHeading(),new j.Setting(r).setName("Split timers for automatic commit and sync").setDesc("Enable to use one interval for commit and another for sync.").addToggle(f=>f.setValue(i.settings.differentIntervalCommitAndPush).onChange(async d=>{i.settings.differentIntervalCommitAndPush=d,await i.saveSettings(),i.automaticsManager.reload("commit","push"),this.refreshDisplayWithDelay()})),new j.Setting(r).setName(`Auto ${n} interval (minutes)`).setDesc(`${i.settings.differentIntervalCommitAndPush?"Commit":"Commit and sync"} changes every X minutes. Set to 0 (default) to disable. (See below setting for further configuration!)`).addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoSaveInterval"}),f.setPlaceholder(String(pt.autoSaveInterval)),f.onChange(async d=>{d!==""?i.settings.autoSaveInterval=Number(d):i.settings.autoSaveInterval=pt.autoSaveInterval,await i.saveSettings(),i.automaticsManager.reload("commit")})}),a=new j.Setting(r).setName(`Auto ${n} after stopping file edits`).setDesc(`Requires the ${n} interval not to be 0. + If turned on, do auto ${n} every ${pA(i.settings.autoSaveInterval)} after stopping file edits. + This also prevents auto ${n} while editing a file. If turned off, it's independent from the last file edit.`).addToggle(f=>f.setValue(i.settings.autoBackupAfterFileChange).onChange(async d=>{i.settings.autoBackupAfterFileChange=d,this.refreshDisplayWithDelay(),await i.saveSettings(),i.automaticsManager.reload("commit")})),this.mayDisableSetting(a,i.settings.setLastSaveToLastCommit),a=new j.Setting(r).setName(`Auto ${n} after latest commit`).setDesc(`If turned on, sets last auto ${n} timestamp to the latest commit timestamp. This reduces the frequency of auto ${n} when doing manual commits.`).addToggle(f=>f.setValue(i.settings.setLastSaveToLastCommit).onChange(async d=>{i.settings.setLastSaveToLastCommit=d,await i.saveSettings(),i.automaticsManager.reload("commit"),this.refreshDisplayWithDelay()})),this.mayDisableSetting(a,i.settings.autoBackupAfterFileChange),a=new j.Setting(r).setName("Auto push interval (minutes)").setDesc("Push commits every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPushInterval"}),f.setPlaceholder(String(pt.autoPushInterval)),f.onChange(async d=>{d!==""?i.settings.autoPushInterval=Number(d):i.settings.autoPushInterval=pt.autoPushInterval,await i.saveSettings(),i.automaticsManager.reload("push")})}),this.mayDisableSetting(a,!i.settings.differentIntervalCommitAndPush),new j.Setting(r).setName("Auto pull interval (minutes)").setDesc("Pull changes every X minutes. Set to 0 (default) to disable.").addText(f=>{f.inputEl.type="number",this.setNonDefaultValue({text:f,settingsProperty:"autoPullInterval"}),f.setPlaceholder(String(pt.autoPullInterval)),f.onChange(async d=>{d!==""?i.settings.autoPullInterval=Number(d):i.settings.autoPullInterval=pt.autoPullInterval,await i.saveSettings(),i.automaticsManager.reload("pull")})}),new j.Setting(r).setName(`Auto ${n} only staged files`).setDesc(`If turned on, only staged files are committed on ${n}. If turned off, all changed files are committed.`).addToggle(f=>f.setValue(i.settings.autoCommitOnlyStaged).onChange(async d=>{i.settings.autoCommitOnlyStaged=d,await i.saveSettings()})),new j.Setting(r).setName(`Specify custom commit message on auto ${n}`).setDesc("You will get a pop up to specify your message.").addToggle(f=>f.setValue(i.settings.customMessageOnAutoBackup).onChange(async d=>{i.settings.customMessageOnAutoBackup=d,await i.saveSettings(),this.refreshDisplayWithDelay()})),a=new j.Setting(r).setName(`Commit message on auto ${n}`).setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message).").addTextArea(f=>{f.setPlaceholder(pt.autoCommitMessage).onChange(async d=>{d===""?i.settings.autoCommitMessage=pt.autoCommitMessage:i.settings.autoCommitMessage=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"autoCommitMessage"})}),this.mayDisableSetting(a,i.settings.customMessageOnAutoBackup),new j.Setting(r).setName("Commit message").setHeading();let c=new j.Setting(r).setName("Commit message on manual commit").setDesc("Available placeholders: {{date}} (see below), {{hostname}} (see below), {{numFiles}} (number of changed files in the commit) and {{files}} (changed files in commit message). Leave empty to require manual input on each commit.");c.addTextArea(f=>{c.addButton(d=>{d.setIcon("reset").setTooltip(`Set to default: "${pt.commitMessage}"`).onClick(()=>{f.setValue(pt.commitMessage),f.onChanged()})}),f.setValue(i.settings.commitMessage),f.onChange(async d=>{i.settings.commitMessage=d,await i.saveSettings()})}),j.Platform.isDesktopApp&&new j.Setting(r).setName("Commit message script").setDesc("A script that is run using 'sh -c' to generate the commit message. May be used to generate commit messages using AI tools. Available placeholders: {{hostname}}, {{date}}.").addText(f=>{f.onChange(async d=>{d===""?i.settings.commitMessageScript=pt.commitMessageScript:i.settings.commitMessageScript=d,await i.saveSettings()}),this.setNonDefaultValue({text:f,settingsProperty:"commitMessageScript"})});let u=new j.Setting(r).setName("{{date}} placeholder format").addMomentFormat(f=>f.setDefaultFormat(i.settings.commitDateFormat).setValue(i.settings.commitDateFormat).onChange(async d=>{i.settings.commitDateFormat=d,await i.saveSettings()}));u.descEl.createSpan({text:` Specify custom date format. E.g. "${Kg}. See `}),u.descEl.createEl("a",{text:"Moment.js documentation",href:Z2,attr:{target:"_blank"}}),u.descEl.createSpan({text:" for more formats."}),new j.Setting(r).setName("{{hostname}} placeholder replacement").setDesc("Specify custom hostname for every device. Defaults to the OS hostname if not set on desktop.").addText(f=>{var d;return f.setValue((d=i.localStorage.getHostname())!=null?d:"").onChange(h=>{i.localStorage.setHostname(h)})}),new j.Setting(r).setName("Preview commit message").addButton(f=>f.setButtonText("Preview").onClick(async()=>{let d=await i.gitManager.formatCommitMessage(i.settings.commitMessage);new j.Notice(`${d}`)})),new j.Setting(r).setName("List filenames affected by commit in the commit body").addToggle(f=>f.setValue(i.settings.listChangedFilesInMessageBody).onChange(async d=>{i.settings.listChangedFilesInMessageBody=d,await i.saveSettings()})),new j.Setting(r).setName("Pull").setHeading(),i.gitManager instanceof Ce&&new j.Setting(r).setName("Merge strategy").setDesc("Decide how to integrate commits from your remote branch into your local branch.").addDropdown(f=>{let d={merge:"Merge",rebase:"Rebase",reset:"Other sync service (Only updates the HEAD without touching the working directory)"};f.addOptions(d),f.setValue(i.settings.syncMethod),f.onChange(async h=>{i.settings.syncMethod=h,await i.saveSettings()})}),new j.Setting(r).setName("Merge strategy on conflicts").setDesc("Decide how to solve conflicts when pulling remote changes. This can be used to favor your local changes or the remote changes automatically.").addDropdown(f=>{let d={none:"None (git default)",ours:"Our changes",theirs:"Their changes"};f.addOptions(d),f.setValue(i.settings.mergeStrategy),f.onChange(async h=>{i.settings.mergeStrategy=h,await i.saveSettings()})}),new j.Setting(r).setName("Pull on startup").setDesc("Automatically pull commits when Obsidian starts.").addToggle(f=>f.setValue(i.settings.autoPullOnBoot).onChange(async d=>{i.settings.autoPullOnBoot=d,await i.saveSettings()})),new j.Setting(r).setName("Commit-and-sync").setDesc("Commit-and-sync with default settings means staging everything -> committing -> pulling -> pushing. Ideally this is a single action that you do regularly to keep your local and remote repository in sync.").setHeading(),a=new j.Setting(r).setName("Push on commit-and-sync").setDesc(`Most of the time you want to push after committing. Turning this off turns a commit-and-sync action into commit ${i.settings.pullBeforePush?"and pull ":""}only. It will still be called commit-and-sync.`).addToggle(f=>f.setValue(!i.settings.disablePush).onChange(async d=>{i.settings.disablePush=!d,this.refreshDisplayWithDelay(),await i.saveSettings()})),new j.Setting(r).setName("Pull on commit-and-sync").setDesc(`On commit-and-sync, pull commits as well. Turning this off turns a commit-and-sync action into commit ${i.settings.disablePush?"":"and push "}only.`).addToggle(f=>f.setValue(i.settings.pullBeforePush).onChange(async d=>{i.settings.pullBeforePush=d,this.refreshDisplayWithDelay(),await i.saveSettings()})),i.gitManager instanceof Ce&&(new j.Setting(r).setName("Hunk management").setDesc("Hunks are sections of grouped line changes right in your editor.").setHeading(),new j.Setting(r).setName("Signs").setDesc("This allows you to see your changes right in your editor via colored markers and stage/reset/preview individual hunks.").addToggle(f=>f.setValue(i.settings.hunks.showSigns).onChange(async d=>{i.settings.hunks.showSigns=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new j.Setting(r).setName("Hunk commands").setDesc("Adds commands to stage/reset individual Git diff hunks and navigate between them via 'Go to next/prev hunk' commands.").addToggle(f=>f.setValue(i.settings.hunks.hunkCommands).onChange(async d=>{i.settings.hunks.hunkCommands=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new j.Setting(r).setName("Status bar with summary of line changes").addDropdown(f=>f.addOptions({disabled:"Disabled",colored:"Colored",monochrome:"Monochrome"}).setValue(i.settings.hunks.statusBar).onChange(async d=>{i.settings.hunks.statusBar=d,await i.saveSettings(),i.editorIntegration.refreshSignsSettings()})),new j.Setting(r).setName("Line author information").setHeading(),this.addLineAuthorInfoSettings())}new j.Setting(r).setName("History view").setHeading(),new j.Setting(r).setName("Show Author").setDesc("Show the author of the commit in the history view.").addDropdown(c=>{let u={hide:"Hide",full:"Full",initials:"Initials"};c.addOptions(u),c.setValue(i.settings.authorInHistoryView),c.onChange(async f=>{i.settings.authorInHistoryView=f,await i.saveSettings(),await i.refresh()})}),new j.Setting(r).setName("Show Date").setDesc("Show the date of the commit in the history view. The {{date}} placeholder format is used to display the date.").addToggle(c=>c.setValue(i.settings.dateInHistoryView).onChange(async u=>{i.settings.dateInHistoryView=u,await i.saveSettings(),await i.refresh()})),new j.Setting(r).setName("Source control view").setHeading(),new j.Setting(r).setName("Automatically refresh source control view on file changes").setDesc("On slower machines this may cause lags. If so, just disable this option.").addToggle(c=>c.setValue(i.settings.refreshSourceControl).onChange(async u=>{i.settings.refreshSourceControl=u,await i.saveSettings()})),new j.Setting(r).setName("Source control view refresh interval").setDesc("Milliseconds to wait after file change before refreshing the Source Control View.").addText(c=>{c.inputEl.type="number",this.setNonDefaultValue({text:c,settingsProperty:"refreshSourceControlTimer"}),c.setPlaceholder(String(pt.refreshSourceControlTimer)),c.onChange(async f=>{f!==""&&Number.isInteger(Number(f))?i.settings.refreshSourceControlTimer=Math.max(Number(f),500):i.settings.refreshSourceControlTimer=pt.refreshSourceControlTimer,await i.saveSettings(),i.setRefreshDebouncer()})}),new j.Setting(r).setName("Miscellaneous").setHeading(),i.gitManager instanceof Ce&&new j.Setting(r).setName("Diff view style").setDesc('Set the style for the diff view. Note that the actual diff in "Split" mode is not generated by Git, but the editor itself instead so it may differ from the diff generated by Git. One advantage of this is that you can edit the text in that view.').addDropdown(c=>{let u={split:"Split",git_unified:"Unified"};c.addOptions(u),c.setValue(i.settings.diffStyle),c.onChange(async f=>{i.settings.diffStyle=f,await i.saveSettings()})}),new j.Setting(r).setName("Disable informative notifications").setDesc("Disable informative notifications for git operations to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(i.settings.disablePopups).onChange(async u=>{i.settings.disablePopups=u,this.refreshDisplayWithDelay(),await i.saveSettings()})),new j.Setting(r).setName("Disable error notifications").setDesc("Disable error notifications of any kind to minimize distraction (refer to status bar for updates).").addToggle(c=>c.setValue(!i.settings.showErrorNotices).onChange(async u=>{i.settings.showErrorNotices=!u,await i.saveSettings()})),i.settings.disablePopups||new j.Setting(r).setName("Hide notifications for no changes").setDesc("Don't show notifications when there are no changes to commit or push.").addToggle(c=>c.setValue(i.settings.disablePopupsForNoChanges).onChange(async u=>{i.settings.disablePopupsForNoChanges=u,await i.saveSettings()})),new j.Setting(r).setName("Show status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showStatusBar).onChange(async u=>{i.settings.showStatusBar=u,await i.saveSettings()})),new j.Setting(r).setName("File menu integration").setDesc('Add "Stage", "Unstage" and "Add to .gitignore" actions to the file menu.').addToggle(c=>c.setValue(i.settings.showFileMenu).onChange(async u=>{i.settings.showFileMenu=u,await i.saveSettings()})),new j.Setting(r).setName("Show branch status bar").setDesc("Obsidian must be restarted for the changes to take affect.").addToggle(c=>c.setValue(i.settings.showBranchStatusBar).onChange(async u=>{i.settings.showBranchStatusBar=u,await i.saveSettings()})),new j.Setting(r).setName("Show the count of modified files in the status bar").addToggle(c=>c.setValue(i.settings.changedFilesInStatusBar).onChange(async u=>{i.settings.changedFilesInStatusBar=u,await i.saveSettings()})),i.gitManager instanceof Vi?new j.Setting(r).setName("Authentication/commit author").setHeading():new j.Setting(r).setName("Commit author").setHeading(),i.gitManager instanceof Vi&&new j.Setting(r).setName("Username on your git server. E.g. your username on GitHub").addText(c=>{var u;c.setValue((u=i.localStorage.getUsername())!=null?u:""),c.onChange(f=>{i.localStorage.setUsername(f)})}),i.gitManager instanceof Vi&&new j.Setting(r).setName("Password/Personal access token").setDesc("Type in your password. You won't be able to see it again.").addText(c=>{c.inputEl.autocapitalize="off",c.inputEl.autocomplete="off",c.inputEl.spellcheck=!1,c.onChange(u=>{i.localStorage.setPassword(u)})}),i.gitReady&&new j.Setting(r).setName("Author name for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.name"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.name",f==""?void 0:f)})}),i.gitReady&&new j.Setting(r).setName("Author email for commit").addText(async c=>{var u;c.setValue((u=await i.gitManager.getConfig("user.email"))!=null?u:""),c.onChange(async f=>{await i.gitManager.setConfig("user.email",f==""?void 0:f)})}),new j.Setting(r).setName("Advanced").setDesc("These settings usually don't need to be changed, but may be required for special setups.").setHeading(),i.gitManager instanceof Ce&&(new j.Setting(r).setName("Update submodules").setDesc('"Commit-and-sync" and "pull" takes care of submodules. Missing features: Conflicted files, count of pulled/pushed/committed files. Tracking branch needs to be set for each submodule.').addToggle(c=>c.setValue(i.settings.updateSubmodules).onChange(async u=>{i.settings.updateSubmodules=u,await i.saveSettings()})),i.settings.updateSubmodules&&new j.Setting(r).setName("Submodule recurse checkout/switch").setDesc("Whenever a checkout happens on the root repository, recurse the checkout on the submodules (if the branches exist).").addToggle(c=>c.setValue(i.settings.submoduleRecurseCheckout).onChange(async u=>{i.settings.submoduleRecurseCheckout=u,await i.saveSettings()}))),i.gitManager instanceof Ce&&new j.Setting(r).setName("Custom Git binary path").setDesc("Specify the path to the Git binary/executable. Git should already be in your PATH. Should only be necessary for a custom Git installation.").addText(c=>{var u;c.setValue((u=i.localStorage.getGitPath())!=null?u:""),c.setPlaceholder("git"),c.onChange(f=>{i.localStorage.setGitPath(f),i.gitManager.updateGitPath(f||"git").catch(d=>i.displayError(d))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Additional environment variables").setDesc("Use each line for a new environment variable in the format KEY=VALUE .").addTextArea(c=>{c.setPlaceholder("GIT_DIR=/path/to/git/dir"),c.setValue(i.localStorage.getEnvVars().join(` +`)),c.onChange(u=>{i.localStorage.setEnvVars(u.split(` +`))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Additional PATH environment variable paths").setDesc("Use each line for one path").addTextArea(c=>{c.setValue(i.localStorage.getPATHPaths().join(` +`)),c.onChange(u=>{i.localStorage.setPATHPaths(u.split(` +`))})}),i.gitManager instanceof Ce&&new j.Setting(r).setName("Reload with new environment variables").setDesc("Removing previously added environment variables will not take effect until Obsidian is restarted.").addButton(c=>{c.setButtonText("Reload"),c.setCta(),c.onClick(async()=>{await i.gitManager.setGitInstance()})}),new j.Setting(r).setName("Custom base path (Git repository path)").setDesc(` + Sets the relative path to the vault from which the Git binary should be executed. + Mostly used to set the path to the Git repository, which is only required if the Git repository is below the vault root directory. Use "\\" instead of "/" on Windows. + `).addText(c=>{c.setValue(i.settings.basePath),c.setPlaceholder("directory/directory-with-git-repo"),c.onChange(async u=>{i.settings.basePath=u,await i.saveSettings(),i.gitManager.updateBasePath(u||"").catch(f=>i.displayError(f))})}),new j.Setting(r).setName("Custom Git directory path (Instead of '.git')").setDesc('Corresponds to the GIT_DIR environment variable. Requires restart of Obsidian to take effect. Use "\\" instead of "/" on Windows.').addText(c=>{c.setValue(i.settings.gitDir),c.setPlaceholder(".git"),c.onChange(async u=>{i.settings.gitDir=u,await i.saveSettings()})}),new j.Setting(r).setName("Disable on this device").setDesc("Disables the plugin on this device. This setting is not synced.").addToggle(c=>c.setValue(i.localStorage.getPluginDisabled()).onChange(u=>{i.localStorage.setPluginDisabled(u),u?i.unloadPlugin():i.init({fromReload:!0}).catch(f=>i.displayError(f)),new j.Notice("Obsidian must be restarted for the changes to take affect.")})),new j.Setting(r).setName("Support").setHeading(),new j.Setting(r).setName("Donate").setDesc("If you like this Plugin, consider donating to support continued development.").addButton(c=>{var f;let u=(f=c.buttonEl.parentElement)==null?void 0:f.createEl("a",{href:"https://ko-fi.com/F1F195IQ5",attr:{target:"_blank"}});u&&(u.createEl("img",{attr:{height:"36",style:"border:0px;height:36px;",src:"https://cdn.ko-fi.com/cdn/kofi3.png?v=3",border:"0",alt:"Buy Me a Coffee at ko-fi.com"}}),c.buttonEl.remove())});let o=r.createDiv();o.setAttr("align","center"),o.setAttr("style","margin: var(--size-4-2)");let l=o.createEl("button");if(l.setText("Copy Debug Information"),l.onclick=async()=>{await window.navigator.clipboard.writeText(JSON.stringify({settings:this.plugin.settings,pluginVersion:this.plugin.manifest.version},null,4)),new j.Notice("Debug information copied to clipboard. May contain sensitive information!")},j.Platform.isDesktopApp){let c=r.createDiv();c.setAttr("align","center"),c.setText(`Debugging and logging: +You can always see the logs of this and every other plugin by opening the console with`);let u=r.createDiv();u.setAttr("align","center"),u.addClass("obsidian-git-shortcuts"),j.Platform.isMacOS===!0?u.createEl("kbd",{text:"CMD (\u2318) + OPTION (\u2325) + I"}):u.createEl("kbd",{text:"CTRL + SHIFT + I"})}}mayDisableSetting(r,i){i&&(r.setDisabled(i),r.setClass("obsidian-git-disabled"))}configureLineAuthorShowStatus(r){this.settings.lineAuthor.show=r,this.plugin.saveSettings(),r?this.plugin.editorIntegration.activateLineAuthoring():this.plugin.editorIntegration.deactiveLineAuthoring()}async lineAuthorSettingHandler(r,i){this.settings.lineAuthor[r]=i,await this.plugin.saveSettings(),this.plugin.editorIntegration.lineAuthoringFeature.refreshLineAuthorViews()}beforeSaveSettings(){let r=this.settings.lineAuthor;r.authorDisplay!=="hide"&&(r.lastShownAuthorDisplay=r.authorDisplay),r.dateTimeFormatOptions!=="hide"&&(r.lastShownDateTimeFormatOptions=r.dateTimeFormatOptions)}addLineAuthorInfoSettings(){let r=new j.Setting(this.containerEl).setName("Show commit authoring information next to each line");if(this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform()||r.setDesc("Only available on desktop currently.").setDisabled(!0),r.descEl.createEl("a",{href:b5,text:"Feature guide and quick examples",attr:{target:"_blank"}}),r.descEl.createEl("br"),r.descEl.createSpan({text:" The commit hash, author name and authoring date can all be individually toggled."}),r.descEl.createEl("br"),r.descEl.createSpan({text:"Hide everything, to only show the age-colored sidebar."}),r.addToggle(i=>i.setValue(this.settings.lineAuthor.show).onChange(n=>{this.configureLineAuthorShowStatus(n),this.refreshDisplayWithDelay()})),this.settings.lineAuthor.show){let i=new j.Setting(this.containerEl).setName("Follow movement and copies across files and commits").addDropdown(l=>{l.addOptions({inactive:"Do not follow (default)","same-commit":"Follow within same commit","all-commits":"Follow within all commits (maybe slow)"}),l.setValue(this.settings.lineAuthor.followMovement),l.onChange(c=>this.lineAuthorSettingHandler("followMovement",c))});if(i.descEl.createSpan({text:"By default (deactivated), each line only shows the newest commit where it was changed."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"same commit"}),i.descEl.createSpan({text:", cut-copy-paste-ing of text is followed within the same commit and the original commit of authoring will be shown."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"With "}),i.descEl.createEl("i",{text:"all commits"}),i.descEl.createSpan({text:", cut-copy-paste-ing text inbetween multiple commits will be detected."}),i.descEl.createEl("br"),i.descEl.createSpan({text:"It uses "}),i.descEl.createEl("a",{href:"https://git-scm.com/docs/git-blame",text:"git-blame",attr:{target:"_blank"}}),i.descEl.createSpan({text:` and for matches (at least ${Pd} characters) within the same (or all) commit(s), `}),i.descEl.createEl("em",{text:"the originating"}),i.descEl.createSpan({text:" commit's information is shown."}),new j.Setting(this.containerEl).setName("Show commit hash").addToggle(l=>{l.setValue(this.settings.lineAuthor.showCommitHash),l.onChange(c=>this.lineAuthorSettingHandler("showCommitHash",c))}),new j.Setting(this.containerEl).setName("Author name display").setDesc("If and how the author is displayed").addDropdown(l=>{let c={hide:"Hide",initials:"Initials (default)","first name":"First name","last name":"Last name",full:"Full name"};l.addOptions(c),l.setValue(this.settings.lineAuthor.authorDisplay),l.onChange(async u=>this.lineAuthorSettingHandler("authorDisplay",u))}),new j.Setting(this.containerEl).setName("Authoring date display").setDesc("If and how the date and time of authoring the line is displayed").addDropdown(l=>{let c={hide:"Hide",date:"Date (default)",datetime:"Date and time","natural language":"Natural language",custom:"Custom"};l.addOptions(c),l.setValue(this.settings.lineAuthor.dateTimeFormatOptions),l.onChange(async u=>{await this.lineAuthorSettingHandler("dateTimeFormatOptions",u),this.refreshDisplayWithDelay()})}),this.settings.lineAuthor.dateTimeFormatOptions==="custom"){let l=new j.Setting(this.containerEl);l.setName("Custom authoring date format").addText(c=>{c.setValue(this.settings.lineAuthor.dateTimeFormatCustomString),c.setPlaceholder("YYYY-MM-DD HH:mm"),c.onChange(async u=>{await this.lineAuthorSettingHandler("dateTimeFormatCustomString",u),this.setCustomDateTimeDescription(l.descEl,u)})}),this.setCustomDateTimeDescription(l.descEl,this.settings.lineAuthor.dateTimeFormatCustomString)}let n=new j.Setting(this.containerEl).setName("Authoring date display timezone").addDropdown(l=>{let c={"viewer-local":"My local (default)","author-local":"Author's local",utc0000:"UTC+0000/Z"};l.addOptions(c),l.setValue(this.settings.lineAuthor.dateTimeTimezone),l.onChange(async u=>this.lineAuthorSettingHandler("dateTimeTimezone",u))});n.descEl.empty(),n.descEl.createSpan({text:`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 +`}),n.descEl.createEl("a",{text:"UTC\xB100:00",href:"https://en.wikipedia.org/wiki/UTC%C2%B100:00"}),n.descEl.createSpan({text:"."});let s=new j.Setting(this.containerEl).setName("Oldest age in coloring");this.setOldestAgeDescription(s.descEl,this.settings.lineAuthor.coloringMaxAge),s.addText(l=>{l.setPlaceholder("1y"),l.setValue(this.settings.lineAuthor.coloringMaxAge),l.onChange(async c=>{let f=Ru(c)!==void 0;this.setOldestAgeDescription(s.descEl,c),f&&(await this.lineAuthorSettingHandler("coloringMaxAge",c),this.refreshColorSettingsName("oldest"))})}),this.createColorSetting("newest"),this.createColorSetting("oldest");let a=new j.Setting(this.containerEl).setName("Text color").addText(l=>{l.setValue(this.settings.lineAuthor.textColorCss),l.onChange(async c=>{await this.lineAuthorSettingHandler("textColorCss",c)})});a.descEl.empty(),a.descEl.createSpan({text:"The CSS color of the gutter text."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"It is highly recommended to use "}),a.descEl.createEl("a",{text:"CSS variables",href:"https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties"}),a.descEl.createSpan({text:" defined by themes (e.g. "}),a.descEl.createEl("pre",{text:"var(--text-muted)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:" or "}),a.descEl.createEl("pre",{text:"var(--text-on-accent)",attr:{style:"display:inline"}}),a.descEl.createSpan({text:"), because they automatically adapt to theme changes."}),a.descEl.createEl("br"),a.descEl.createEl("br"),a.descEl.createSpan({text:"See: "}),a.descEl.createEl("a",{text:"List of available CSS variables in Obsidian",href:"https://github.com/obsidian-community/obsidian-theme-template/blob/main/obsidian.css"});let o=new j.Setting(this.containerEl).setName("Ignore whitespace and newlines in changes").addToggle(l=>{l.setValue(this.settings.lineAuthor.ignoreWhitespace),l.onChange(c=>this.lineAuthorSettingHandler("ignoreWhitespace",c))});o.descEl.empty(),o.descEl.createSpan({text:"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."}),o.descEl.createEl("br"),o.descEl.createSpan({text:"If you don't care about purely-whitespace changes (e.g. list nesting / quote indentation changes), then activating this will provide more meaningful change detection."})}}createColorSetting(r){let i=new j.Setting(this.containerEl).setName("").addText(n=>{let s=fw(r,this.settings.lineAuthor),a=fw(r,pt.lineAuthor);n.setPlaceholder(nv(a)),n.setValue(nv(s)),n.onChange(async o=>{let l=cA(o);if(l!==void 0){let c=r==="newest"?"colorNew":"colorOld";await this.lineAuthorSettingHandler(c,l)}this.refreshColorSettingsDesc(r,l)})});this.lineAuthorColorSettings.set(r,i),this.refreshColorSettingsName(r),this.refreshColorSettingsDesc(r,fw(r,this.settings.lineAuthor))}refreshColorSettingsName(r){let i=this.lineAuthorColorSettings.get(r);if(i){let n=r==="oldest"?`oldest (${this.settings.lineAuthor.coloringMaxAge} or older)`:"newest";i.nameEl.setText(`Color for ${n} commits`)}}refreshColorSettingsDesc(r,i){let n=this.lineAuthorColorSettings.get(r);n&&this.colorSettingPreviewDesc(n.descEl,r,this.settings.lineAuthor,i!==void 0)}colorSettingPreviewDesc(r,i,n,s){r.empty(),r.createSpan({text:"Supports 'rgb(r,g,b)', 'hsl(h,s,l)', hex (#) and named colors (e.g. 'black', 'purple'). Color preview: "});let a=s?mh(i,n):"rgba(127,127,127,0.3)",o=j.moment.unix(j.moment.now()/1e3).format("YYYY-MM-DD"),l=s?`abcdef Author Name ${o}`:"invalid color";r.createEl("div",{text:l,attr:{class:"line-author-settings-preview",style:`background-color: ${a}; width: 30ch;`}})}setCustomDateTimeDescription(r,i){r.empty(),r.createEl("a",{text:"Format string",href:Z2}),r.createSpan({text:" to display the authoring date."}),r.createEl("br");let n=(0,j.moment)().format(i);r.createSpan({text:`Currently: ${n}`})}setOldestAgeDescription(r,i){let n=Ru(i),s=n!==void 0?`${n.asDays()} days`:"invalid!";r.empty(),r.createSpan({text:`The oldest age in the line author coloring. Everything older will have the same color. +Smallest valid age is "1d". Currently: ${s}`})}setNonDefaultValue({settingsProperty:r,text:i}){let n=this.plugin.settings[r];pt[r]!==n&&(typeof n=="string"||typeof n=="number"||typeof n=="boolean"?i.setValue(String(n)):i.setValue(JSON.stringify(n)))}refreshDisplayWithDelay(r=80){window.setTimeout(()=>this.display(),r)}};function fw(t,e){return t==="oldest"?e.colorOld:e.colorNew}function Ru(t){let e=j.moment.duration("P"+t.toUpperCase());return e.isValid()&&e.asDays()&&e.asDays()>=1?e:void 0}m();var ti=require("obsidian");var wh=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.messages=[];this.base="obsidian-git-statusbar-";this.statusBarEl.setAttribute("data-tooltip-position","top"),r.registerEvent(r.app.workspace.on("obsidian-git:refreshed",()=>{this.refreshCommitTimestamp().catch(console.error)}))}displayMessage(e,r){this.messages.push({message:`Git: ${e.slice(0,100)}`,timeout:r}),this.display()}display(){this.messages.length>0&&!this.currentMessage?(this.currentMessage=this.messages.shift(),this.statusBarEl.addClass(this.base+"message"),this.statusBarEl.ariaLabel="",this.statusBarEl.setText(this.currentMessage.message),this.lastMessageTimestamp=Date.now()):this.currentMessage?Date.now()-this.lastMessageTimestamp>=this.currentMessage.timeout&&(this.currentMessage=null,this.lastMessageTimestamp=null):this.displayState()}displayState(){switch((this.statusBarEl.getText().length>3||!this.statusBarEl.hasChildNodes())&&(this.statusBarEl.empty(),this.conflictEl=this.statusBarEl.createDiv(),this.conflictEl.setAttribute("data-tooltip-position","top"),this.conflictEl.style.float="left",this.pausedEl=this.statusBarEl.createDiv(),this.pausedEl.setAttribute("data-tooltip-position","top"),this.pausedEl.style.float="left",this.iconEl=this.statusBarEl.createDiv(),this.iconEl.style.float="left",this.textEl=this.statusBarEl.createDiv(),this.textEl.style.float="right",this.textEl.style.marginLeft="5px"),this.plugin.localStorage.getConflict()?((0,ti.setIcon)(this.conflictEl,"alert-circle"),this.conflictEl.ariaLabel="You have merge conflicts. Resolve them and commit afterwards.",this.conflictEl.style.marginRight="5px",this.conflictEl.addClass(this.base+"conflict")):(this.conflictEl.empty(),this.conflictEl.style.marginRight=""),this.plugin.localStorage.getPausedAutomatics()?((0,ti.setIcon)(this.pausedEl,"pause-circle"),this.pausedEl.ariaLabel="Automatic routines are currently paused.",this.pausedEl.style.marginRight="5px",this.pausedEl.addClass(this.base+"paused")):(this.pausedEl.empty(),this.pausedEl.style.marginRight=""),this.plugin.state.gitAction){case 0:this.displayFromNow();break;case 1:this.statusBarEl.ariaLabel="Checking repository status...",(0,ti.setIcon)(this.iconEl,"refresh-cw"),this.statusBarEl.addClass(this.base+"status");break;case 3:this.statusBarEl.ariaLabel="Adding files...",(0,ti.setIcon)(this.iconEl,"archive"),this.statusBarEl.addClass(this.base+"add");break;case 4:this.statusBarEl.ariaLabel="Committing changes...",(0,ti.setIcon)(this.iconEl,"git-commit"),this.statusBarEl.addClass(this.base+"commit");break;case 5:this.statusBarEl.ariaLabel="Pushing changes...",(0,ti.setIcon)(this.iconEl,"upload"),this.statusBarEl.addClass(this.base+"push");break;case 2:this.statusBarEl.ariaLabel="Pulling changes...",(0,ti.setIcon)(this.iconEl,"download"),this.statusBarEl.addClass(this.base+"pull");break;default:this.statusBarEl.ariaLabel="Failed on initialization!",(0,ti.setIcon)(this.iconEl,"alert-triangle"),this.statusBarEl.addClass(this.base+"failed-init");break}}displayFromNow(){var i;let e=this.lastCommitTimestamp,r=this.plugin.state.offlineMode;if(e){let n=(0,ti.moment)(e).fromNow();this.statusBarEl.ariaLabel=`${r?"Offline: ":""}Last Commit: ${n}`,((i=this.unPushedCommits)!=null?i:0)>0&&(this.statusBarEl.ariaLabel+=` +(${this.unPushedCommits} unpushed commits)`)}else this.statusBarEl.ariaLabel=r?"Git is offline":"Git is ready";r?(0,ti.setIcon)(this.iconEl,"globe"):(0,ti.setIcon)(this.iconEl,"check"),this.plugin.settings.changedFilesInStatusBar&&this.plugin.cachedStatus&&this.textEl.setText(this.plugin.cachedStatus.changed.length.toString()),this.statusBarEl.addClass(this.base+"idle")}async refreshCommitTimestamp(){this.lastCommitTimestamp=await this.plugin.gitManager.getLastCommitTime(),this.unPushedCommits=await this.plugin.gitManager.getUnpushedCommits()}remove(){this.statusBarEl.remove()}};m();var _h=require("obsidian"),bh=class extends _h.SuggestModal{constructor(r){super(r.app);this.plugin=r;this.resolve=null;this.setPlaceholder("Type your message and select optional the version with the added date.")}openAndGetResult(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>window.setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}getSuggestions(r){let i=(0,_h.moment)().format(this.plugin.settings.commitDateFormat);return r==""&&(r="..."),[r,`${i}: ${r}`,`${r}: ${i}`]}renderSuggestion(r,i){i.innerText=r}onChooseSuggestion(r,i){this.resolve&&this.resolve(r)}};m();var K2=require("obsidian"),$u=class{constructor(e){this.plugin=e}saveLastAuto(e,r){r==="backup"?this.plugin.localStorage.setLastAutoBackup(e.toString()):r==="pull"?this.plugin.localStorage.setLastAutoPull(e.toString()):r==="push"&&this.plugin.localStorage.setLastAutoPush(e.toString())}loadLastAuto(){var e,r,i;return{backup:new Date((e=this.plugin.localStorage.getLastAutoBackup())!=null?e:""),pull:new Date((r=this.plugin.localStorage.getLastAutoPull())!=null?r:""),push:new Date((i=this.plugin.localStorage.getLastAutoPush())!=null?i:"")}}async init(){await this.setUpAutoCommitAndSync();let e=this.loadLastAuto();if(this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0){let r=this.diff(this.plugin.settings.autoPushInterval,e.push);this.startAutoPush(r)}if(this.plugin.settings.autoPullInterval>0){let r=this.diff(this.plugin.settings.autoPullInterval,e.pull);this.startAutoPull(r)}}unload(){this.clearAutoPull(),this.clearAutoPush(),this.clearAutoCommitAndSync()}reload(...e){this.plugin.localStorage.getPausedAutomatics()||(e.contains("commit")&&(this.clearAutoCommitAndSync(),this.plugin.settings.autoSaveInterval>0&&this.startAutoCommitAndSync(this.plugin.settings.autoSaveInterval)),e.contains("push")&&(this.clearAutoPush(),this.plugin.settings.differentIntervalCommitAndPush&&this.plugin.settings.autoPushInterval>0&&this.startAutoPush(this.plugin.settings.autoPushInterval)),e.contains("pull")&&(this.clearAutoPull(),this.plugin.settings.autoPullInterval>0&&this.startAutoPull(this.plugin.settings.autoPullInterval)))}async setUpAutoCommitAndSync(){if(this.plugin.settings.setLastSaveToLastCommit){this.clearAutoCommitAndSync();let e=await this.plugin.gitManager.getLastCommitTime();e&&this.saveLastAuto(e,"backup")}if(!this.timeoutIDCommitAndSync&&!this.plugin.autoCommitDebouncer){let e=this.loadLastAuto();if(this.plugin.settings.autoSaveInterval>0){let r=this.diff(this.plugin.settings.autoSaveInterval,e.backup);this.startAutoCommitAndSync(r)}}}startAutoCommitAndSync(e){let r=(e!=null?e:this.plugin.settings.autoSaveInterval)*6e4;this.plugin.settings.autoBackupAfterFileChange?e===0?this.doAutoCommitAndSync():this.plugin.autoCommitDebouncer=(0,K2.debounce)(()=>this.doAutoCommitAndSync(),r,!0):(r>2147483647&&(r=2147483647),this.timeoutIDCommitAndSync=window.setTimeout(()=>this.doAutoCommitAndSync(),r))}doAutoCommitAndSync(){this.plugin.promiseQueue.addTask(async()=>{if(this.plugin.settings.setLastSaveToLastCommit){let r=await this.plugin.gitManager.getLastCommitTime();if(r){this.saveLastAuto(r,"backup");let i=this.diff(this.plugin.settings.autoSaveInterval,r);if(i>0)return this.startAutoCommitAndSync(i),!1}}let e=this.plugin.settings.autoCommitOnlyStaged;return this.plugin.settings.differentIntervalCommitAndPush?await this.plugin.commit({fromAuto:!0,onlyStaged:e}):await this.plugin.commitAndSync({fromAutoBackup:!0,onlyStaged:e}),!0},e=>{e!==!1&&(this.saveLastAuto(new Date,"backup"),this.startAutoCommitAndSync())})}startAutoPull(e){let r=(e!=null?e:this.plugin.settings.autoPullInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPull=window.setTimeout(()=>this.doAutoPull(),r)}doAutoPull(){this.plugin.promiseQueue.addTask(()=>this.plugin.pullChangesFromRemote(),()=>{this.saveLastAuto(new Date,"pull"),this.startAutoPull()})}startAutoPush(e){let r=(e!=null?e:this.plugin.settings.autoPushInterval)*6e4;r>2147483647&&(r=2147483647),this.timeoutIDPush=window.setTimeout(()=>this.doAutoPush(),r)}doAutoPush(){this.plugin.promiseQueue.addTask(()=>this.plugin.push(),()=>{this.saveLastAuto(new Date,"push"),this.startAutoPush()})}clearAutoCommitAndSync(){var r;let e=!1;return this.timeoutIDCommitAndSync&&(window.clearTimeout(this.timeoutIDCommitAndSync),this.timeoutIDCommitAndSync=void 0,e=!0),this.plugin.autoCommitDebouncer&&((r=this.plugin.autoCommitDebouncer)==null||r.cancel(),this.plugin.autoCommitDebouncer=void 0,e=!0),e}clearAutoPull(){return this.timeoutIDPull?(window.clearTimeout(this.timeoutIDPull),this.timeoutIDPull=void 0,!0):!1}clearAutoPush(){return this.timeoutIDPush?(window.clearTimeout(this.timeoutIDPush),this.timeoutIDPush=void 0,!0):!1}diff(e,r){let n=e-Math.round((new Date().getTime()-r.getTime())/1e3/60);return Math.max(0,n)}};m();var Wi=require("obsidian");m();var Fu=require("obsidian");async function X2(t,e,r){let i=await J2(e,r);if(i.result==="failure"){new Fu.Notice(i.reason);return}let{isGitHub:n,branch:s,repo:a,user:o,filePath:l}=i;if(n){let c=t.getCursor("from").line+1,u=t.getCursor("to").line+1;c===u?window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}`):window.open(`https://github.com/${o}/${a}/blob/${s}/${l}?plain=1#L${c}-L${u}`)}else new Fu.Notice("It seems like you are not using GitHub")}async function Q2(t,e){let r=await J2(t,e);if(r.result==="failure"){new Fu.Notice(r.reason);return}let{isGitHub:i,branch:n,repo:s,user:a,filePath:o}=r;i?window.open(`https://github.com/${a}/${s}/commits/${n}/${o}`):new Fu.Notice("It seems like you are not using GitHub")}async function J2(t,e){let r=await e.branchInfo(),i=r.tracking,n=r.current,s,a=e.getRelativeRepoPath(t.path);if(e instanceof Ce){let l=await e.getSubmoduleOfFile(e.getRelativeRepoPath(t.path));if(l){a=l.relativeFilepath;let c=await e.git.cwd({path:l.submodule,root:!1}).status();if(i=c.tracking||void 0,n=c.current||void 0,i){let u=i.substring(0,i.indexOf("/")),f=await e.git.cwd({path:l.submodule,root:!1}).getConfig(`remote.${u}.url`,"local");if(f.value!=null)s=f.value;else return{result:"failure",reason:"Failed to get remote url of submodule"}}}}if(i==null)return{result:"failure",reason:"Remote branch is not configured"};if(n==null)return{result:"failure",reason:"Failed to get current branch name"};if(s==null){let l=i.substring(0,i.indexOf("/"));if(s=await e.getConfig(`remote.${l}.url`),s==null)return{result:"failure",reason:"Failed to get remote url"}}let o=s.match(/(?:^https:\/\/github\.com\/(.+)\/(.+?)(?:\.git)?$)|(?:^[a-zA-Z]+@github\.com:(.+)\/(.+?)(?:\.git)?$)/);if(o==null)return{result:"failure",reason:"Could not parse remote url"};{let[l,c,u,f,d]=o;return{result:"success",isGitHub:!!l,repo:u||d,user:c||f,branch:n,filePath:a}}}m();var eP=require("obsidian"),yh=class extends eP.FuzzySuggestModal{constructor(e,r){super(e.app),this.plugin=e,this.changedFiles=r,this.setPlaceholder("Not supported files will be opened by default app!")}getItems(){return this.changedFiles}getItemText(e){if(e.index=="U"&&e.workingDir=="U")return`Untracked | ${e.vaultPath}`;let r="",i="";return e.workingDir!=" "&&(r=`Working Dir: ${e.workingDir} `),e.index!=" "&&(i=`Index: ${e.index}`),`${r}${i} | ${e.vaultPath}`}onChooseItem(e,r){this.plugin.app.metadataCache.getFirstLinkpathDest(e.vaultPath,"")==null?this.app.openWithDefaultApp(e.vaultPath):this.plugin.app.workspace.openLinkText(e.vaultPath,"/")}};m();var tP=require("obsidian"),xh=class extends tP.Modal{constructor(r,i){super(r);this.content=i;this.resolve=null}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onOpen(){let{contentEl:r,titleEl:i}=this;i.setText("Edit .gitignore");let n=r.createDiv(),s=n.createEl("textarea",{text:this.content,cls:["obsidian-git-textarea"],attr:{rows:10,cols:30,wrap:"off"}});n.createEl("button",{cls:["mod-cta","obsidian-git-center-button"],text:"Save"}).addEventListener("click",()=>{this.resolve(s.value),this.close()})}onClose(){let{contentEl:r}=this;r.empty(),this.resolve&&this.resolve(void 0)}};m();var ju=require("@codemirror/state"),Uh=require("@codemirror/view");m();var Pl=require("@codemirror/state");m();var Wt=class t{static createHunk(e,r,i,n){return{removed:{start:e,count:r,lines:[]},added:{start:i,count:n,lines:[]},head:`@@ -${e}${r>0?`,${r}`:""} +${i}${n>0?`,${n}`:""} @@`,vend:i+Math.max(n-1,0),type:n===0?"delete":r===0?"add":"change"}}static createPartialHunk(e,r,i){let n=r,s=i-r+1,a=0;for(let o of e){let l=o.added.count-o.removed.count,c=0;if(o.added.start>=r&&o.vend<=i)c=l;else{let u=Math.max(0,i+1-(o.added.start+o.removed.count)),f=Math.max(0,r-(o.added.start+o.removed.count));o.added.start>=r&&o.added.start<=i?c=u:o.vend>=r&&o.vend<=i?(c=l-f,n=n-f):o.added.start<=r&&o.vend>=i?(c=u-f,n=n-f):a++,r>o.vend&&(n=n-l)}s=s-c}if(a!==e.length)return s===0&&(n=n-1),this.createHunk(n,s,r,i-r+1)}patchLines(e,r=!1){let i=[];for(let n of e.removed.lines)i.push("-"+n);for(let n of e.added.lines)i.push("+"+n);return r?i.map(n=>n.replace(/\r$/,"")):i}static parseDiffLine(e){let n=e.split("@@")[1].trim().split(" "),s=n[0].substring(1).split(","),a=n[1].substring(1).split(","),o=this.createHunk(parseInt(s[0]),parseInt(s[1]||"1"),parseInt(a[0]),parseInt(a[1]||"1"));return o.head=e,o}static changeEnd(e){return e.added.count===0?e.added.start:e.removed.count===0?e.added.start+e.added.count-1:e.added.start+Math.min(e.added.count,e.removed.count)-1}static calcSigns(e,r,i,n=1,s=1/0,a){if(a&&r.type!=="add")return console.error(`Invalid hunk with untracked=${a} hunk="${r.head}"`),[];n=Math.max(1,n);let{start:o,added:l,removed:c}={start:r.added.start,added:r.added.count,removed:r.removed.count},u=this.changeEnd(r),f=r.type==="delete"&&(o===0||e&&this.changeEnd(e)===o)&&(!i||i.added.start!==o+1);f&&n===1&&(n=0);let d=[];for(let h=Math.max(o,n);h<=Math.min(u,s);h++){let p=r.type==="change"&&(c>l&&h===u||e&&e.added.start===0);d.push({type:f?"topdelete":p?"changedelete":a?"untracked":r.type,count:h===o?r.type==="add"?l:c:void 0,lnum:h+(f?1:0)})}if(r.type==="change"&&l>c&&r.vend>=n&&u<=s)for(let h=Math.max(u,n);h<=Math.min(r.vend,s);h++)d.push({type:"add",count:h===r.vend?l-c:void 0,lnum:h});return d}static createPatch(e,r,i,n=!1){let s=[`diff --git a/${e} b/${e}`,`index 000000..000000 ${i}`,`--- a/${e}`,`+++ b/${e}`],a=0;r=structuredClone(r);for(let o of r){let l=o.removed.start,c=o.removed.count,u=o.added.count;o.type==="add"&&(l=l+1);let f=o.removed.lines,d=o.added.lines;n&&([c,u]=[u,c],[f,d]=[d,f]),s.push(`@@ -${l},${c} +${l+a},${u} @@`);for(let h of f)s.push("-"+h);(n?o.added:o.removed).no_nl_at_eof&&s.push("\\ No newline at end of file");for(let h of d)s.push("+"+h);(n?o.removed:o.added).no_nl_at_eof&&s.push("\\ No newline at end of file"),o.removed.start=l+a,a=a+(u-c)}return s}getSummary(e){let r={added:0,changed:0,removed:0};for(let i of e)if(i.type==="add")r.added+=i.added.count;else if(i.type==="delete")r.removed+=i.removed.count;else if(i.type==="change"){let n=i.added.count,s=i.removed.count,a=Math.min(n,s);r.changed+=a,r.added+=n-a,r.removed+=s-a}return r}static findHunk(e,r){if(!r)return[void 0,void 0];for(let i=0;i=e)return[n,i]}return[void 0,void 0]}static findNearestHunk(e,r,i,n){if(r.length!==0){if(i==="first")return 0;if(i==="last")return r.length-1;if(i==="next"){if(r[0].added.start>e)return 0;for(let s=r.length-1;s>=0;s--)if(r[s].added.start<=e){if(s+1e)return s+1;if(n)return 0}}else if(i==="prev"){if(Math.max(r[r.length-1].vend)0&&Math.max(r[s-1].vend,1)l.added.start?n++:o.added.starta.map(w=>g.replace(/&/,w))).reduce((g,w)=>g.concat(w)),p,l);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(n(h),p,u,d)}else p!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(u.length||d)&&l.push((i&&!f&&!c?a.map(i):a).join(", ")+" {"+u.join(" ")+"}")}for(let a in e)s(n(a),e[a],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=iP[rP]||1;return iP[rP]=e+1,"\u037C"+e.toString(36)}static mount(e,r,i){let n=e[dw],s=i&&i.nonce;n?s&&n.setNonce(s):n=new hw(e,s),n.mount(Array.isArray(r)?r:[r],e)}},nP=new Map,hw=class{constructor(e,r){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let s=nP.get(i);if(s)return e[dw]=s;this.sheet=new n.CSSStyleSheet,nP.set(i,this)}else this.styleTag=i.createElement("style"),r&&this.styleTag.setAttribute("nonce",r);this.modules=[],e[dw]=this}mount(e,r){let i=this.sheet,n=0,s=0;for(let a=0;a-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,o),i)for(let c=0;cc){let f=t.slice(e,r).indexOf(i.slice(n,s));if(f>-1)return[new kt(e,e+f,n,n),new kt(e+f+c,r,s,s)]}else if(c>l){let f=i.slice(n,s).indexOf(t.slice(e,r));if(f>-1)return[new kt(e,e,n,n+f),new kt(r,r,n+f+l,s)]}if(l==1||c==1)return[new kt(e,r,n,s)];let u=SP(t,e,r,i,n,s);if(u){let[f,d,h]=u;return Ma(t,e,f,i,n,d).concat(Ma(t,f+h,r,i,d+h,s))}return y5(t,e,r,i,n,s)}var Iu=1e9,Mu=0,_w=!1;function y5(t,e,r,i,n,s){let a=r-e,o=s-n;if(Iu<1e9&&Math.min(a,o)>Iu*16||Mu>0&&Date.now()>Mu)return Math.min(a,o)>Iu*64?[new kt(e,r,n,s)]:sP(t,e,r,i,n,s);let l=Math.ceil((a+o)/2);pw.reset(l),mw.reset(l);let c=(h,p)=>t.charCodeAt(e+h)==i.charCodeAt(n+p),u=(h,p)=>t.charCodeAt(r-h-1)==i.charCodeAt(s-p-1),f=(a-o)%2!=0?mw:null,d=f?null:pw;for(let h=0;hIu||Mu>0&&!(h&63)&&Date.now()>Mu)return sP(t,e,r,i,n,s);let p=pw.advance(h,a,o,l,f,!1,c)||mw.advance(h,a,o,l,d,!0,u);if(p)return x5(t,e,r,e+p[0],i,n,s,n+p[1])}return[new kt(e,r,n,s)]}var Th=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let r=0;rr)this.end+=2;else if(f>i)this.start+=2;else if(s){let d=n+(r-i)-l;if(d>=0&&d=r-u)return[h,n+h-d]}else{let h=r-s.vec[d];if(u>=h)return[u,f]}}}return null}},pw=new Th,mw=new Th;function x5(t,e,r,i,n,s,a,o){let l=!1;return!Tl(t,i)&&++i==r&&(l=!0),!Tl(n,o)&&++o==a&&(l=!0),l?[new kt(e,r,s,a)]:Ma(t,e,i,n,s,o).concat(Ma(t,i,r,n,o,a))}function EP(t,e){let r=1,i=Math.min(t,e);for(;rr||u>s||t.slice(o,c)!=i.slice(l,u)){if(a==1)return o-e-(Tl(t,o)?0:1);a=a>>1}else{if(c==r||u==s)return c-e;o=c,l=u}}}function xw(t,e,r,i,n,s){if(e==r||n==s||t.charCodeAt(r-1)!=i.charCodeAt(s-1))return 0;let a=EP(r-e,s-n);for(let o=r,l=s;;){let c=o-a,u=l-a;if(c>1}else{if(c==e||u==n)return r-c;o=c,l=u}}}function gw(t,e,r,i,n,s,a,o){let l=i.slice(n,s),c=null;for(;;){if(c||a=r)break;let d=t.slice(u,f),h=-1;for(;(h=l.indexOf(d,h+1))!=-1;){let p=yw(t,f,r,i,n+h+d.length,s),g=xw(t,e,u,i,n,n+h),w=d.length+p+g;(!c||c[2]>1}}function SP(t,e,r,i,n,s){let a=r-e,o=s-n;if(an.fromA-e&&i.toB>n.fromB-e&&(t[r-1]=new kt(i.fromA,n.toA,i.fromB,n.toB),t.splice(r--,1))}}function E5(t,e,r){for(;;){kP(r,1);let i=!1;for(let n=0;n3||o>3){let l=n==t.length-1?e.length:t[n+1].fromA,c=s.fromA-i,u=l-s.toA,f=oP(e,s.fromA,c),d=aP(e,s.toA,u),h=s.fromA-f,p=d-s.toA;if((!a||!o)&&h&&p){let g=Math.max(a,o),[w,y,b]=a?[e,s.fromA,s.toA]:[r,s.fromB,s.toB];g>h&&e.slice(f,s.fromA)==w.slice(b-h,b)?(s=t[n]=new kt(f,f+a,s.fromB-h,s.toB-h),f=s.fromA,d=aP(e,s.toA,l-s.toA)):g>p&&e.slice(s.toA,d)==w.slice(y,y+p)&&(s=t[n]=new kt(d-a,d,s.fromB+p,s.toB+p),d=s.toA,f=oP(e,s.fromA,s.fromA-i)),h=s.fromA-f,p=d-s.toA}if(h||p)s=t[n]=new kt(s.fromA-h,s.toA+p,s.fromB-h,s.toB+p);else if(a){if(!o){let g=cP(e,s.fromA,s.toA),w,y=g<0?-1:lP(e,s.toA,s.fromA);g>-1&&(w=g-s.fromA)<=u&&e.slice(s.fromA,g)==e.slice(s.toA,s.toA+w)?s=t[n]=s.offset(w):y>-1&&(w=s.toA-y)<=c&&e.slice(s.fromA-w,s.fromA)==e.slice(y,s.toA)&&(s=t[n]=s.offset(-w))}}else{let g=cP(r,s.fromB,s.toB),w,y=g<0?-1:lP(r,s.toB,s.fromB);g>-1&&(w=g-s.fromB)<=u&&r.slice(s.fromB,g)==r.slice(s.toB,s.toB+w)?s=t[n]=s.offset(w):y>-1&&(w=s.toB-y)<=c&&r.slice(s.fromB-w,s.fromB)==r.slice(y,s.toB)&&(s=t[n]=s.offset(-w))}}i=s.toA}return kP(t,3),t}var Ia;try{Ia=new RegExp("[\\p{Alphabetic}\\p{Number}]","u")}catch(t){}function AP(t){return t>48&&t<58||t>64&&t<91||t>96&&t<123}function CP(t,e){if(e==t.length)return 0;let r=t.charCodeAt(e);return r<192?AP(r)?1:0:Ia?!RP(r)||e==t.length-1?Ia.test(String.fromCharCode(r))?1:0:Ia.test(t.slice(e,e+2))?2:0:0}function TP(t,e){if(!e)return 0;let r=t.charCodeAt(e-1);return r<192?AP(r)?1:0:Ia?!$P(r)||e==1?Ia.test(String.fromCharCode(r))?1:0:Ia.test(t.slice(e-2,e))?2:0:0}var PP=8;function aP(t,e,r){if(e==t.length||!TP(t,e))return e;for(let i=e,n=e+r,s=0;sn)return i;i+=a}return e}function oP(t,e,r){if(!e||!CP(t,e))return e;for(let i=e,n=e-r,s=0;st>=55296&&t<=56319,$P=t=>t>=56320&&t<=57343;function Tl(t,e){return!e||e==t.length||!RP(t.charCodeAt(e-1))||!$P(t.charCodeAt(e))}function k5(t,e,r){var i;let n=r==null?void 0:r.override;return n?n(t,e):(Iu=((i=r==null?void 0:r.scanLimit)!==null&&i!==void 0?i:1e9)>>1,Mu=r!=null&&r.timeout?Date.now()+r.timeout:0,_w=!1,E5(t,e,Ma(t,0,t.length,e,0,e.length)))}function FP(){return!_w}function IP(t,e,r){return S5(k5(t,e,r),t,e)}var Si=Ie.Facet.define({combine:t=>t[0]}),vw=Ie.StateEffect.define(),A5=Ie.Facet.define(),xn=Ie.StateField.define({create(t){return null},update(t,e){for(let r of e.effects)r.is(vw)&&(t=r.value);for(let r of e.state.facet(A5))t=r(t,e);return t}});function Ew(t){let e=t.field(xn,!1);if(!e)return null;let r=t.facet(Si);return{chunks:e,side:r?r.side:null}}var Xn=class t{constructor(e,r,i,n,s,a=!0){this.changes=e,this.fromA=r,this.toA=i,this.fromB=n,this.toB=s,this.precise=a}offset(e,r){return e||r?new t(this.changes,this.fromA+e,this.toA+e,this.fromB+r,this.toB+r,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,r,i){let n=IP(e.toString(),r.toString(),i);return MP(n,e,r,0,0,FP())}static updateA(e,r,i,n,s){return pP(hP(e,n,!0,i.length),e,r,i,s)}static updateB(e,r,i,n,s){return pP(hP(e,n,!1,r.length),e,r,i,s)}};function uP(t,e,r,i){let n=r.lineAt(t),s=i.lineAt(e);return n.to==t&&s.to==e&&tf+1&&w>d+1)break;h.push(p.offset(-c+i,-u+n)),[f,d]=fP(p.toA+i,p.toB+n,e,r),o++}a.push(new Xn(h,c,Math.max(c,f),u,Math.max(u,d),s))}return a}var Sh=1e3;function dP(t,e,r,i){let n=0,s=t.length;for(;;){if(n==s){let u=0,f=0;n&&({toA:u,toB:f}=t[n-1]);let d=e-(r?u:f);return[u+d,f+d]}let a=n+s>>1,o=t[a],[l,c]=r?[o.fromA,o.toA]:[o.fromB,o.toB];if(l>e)s=a;else if(c<=e)n=a+1;else return i?[o.fromA,o.fromB]:[o.toA,o.toB]}}function hP(t,e,r,i){let n=[];return e.iterChangedRanges((s,a,o,l)=>{let c=0,u=r?e.length:i,f=0,d=r?i:e.length;s>Sh&&([c,f]=dP(t,s-Sh,r,!0)),a=c?n[n.length-1]={fromA:p.fromA,fromB:p.fromB,toA:u,toB:d,diffA:p.diffA+g,diffB:p.diffB+w}:n.push({fromA:c,toA:u,fromB:f,toB:d,diffA:g,diffB:w})}),n}function pP(t,e,r,i,n){if(!t.length)return e;let s=[];for(let a=0,o=0,l=0,c=0;;a++){let u=a==t.length?null:t[a],f=u?u.fromA+o:r.length,d=u?u.fromB+l:i.length;for(;cf||w.toB+l>d))break;s.push(w.offset(o,l)),c++}if(!u)break;let h=u.toA+o+u.diffA,p=u.toB+l+u.diffB,g=IP(r.sliceString(f,h),i.sliceString(d,p),n);for(let w of MP(g,r,i,f,d,FP()))s.push(w);for(o+=u.diffA,l+=u.diffB;ch&&w.fromB+l>p)break;c++}}return s}var C5={scanLimit:500},DP=Le.ViewPlugin.fromClass(class{constructor(t){({deco:this.deco,gutter:this.gutter}=vP(t))}update(t){(t.docChanged||t.viewportChanged||T5(t.startState,t.state)||P5(t.startState,t.state))&&({deco:this.deco,gutter:this.gutter}=vP(t.view))}},{decorations:t=>t.deco}),kh=Ie.Prec.low((0,Le.gutter)({class:"cm-changeGutter",markers:t=>{var e;return((e=t.plugin(DP))===null||e===void 0?void 0:e.gutter)||Ie.RangeSet.empty}}));function T5(t,e){return t.field(xn,!1)!=e.field(xn,!1)}function P5(t,e){return t.facet(Si)!=e.facet(Si)}var mP=Le.Decoration.line({class:"cm-changedLine"}),R5=Le.Decoration.mark({class:"cm-changedText"}),$5=Le.Decoration.mark({tagName:"ins",class:"cm-insertedLine"}),F5=Le.Decoration.mark({tagName:"del",class:"cm-deletedLine"}),gP=new class extends Le.GutterMarker{constructor(){super(...arguments),this.elementClass="cm-changedLineGutter"}};function I5(t,e,r,i,n,s){let a=r?t.fromA:t.fromB,o=r?t.toA:t.toB,l=0;if(a!=o){n.add(a,a,mP),n.add(a,o,r?F5:$5),s&&s.add(a,a,gP);for(let c=e.iterRange(a,o-1),u=a;!c.next().done;){if(c.lineBreak){u++,n.add(u,u,mP),s&&s.add(u,u,gP);continue}let f=u+c.value.length;if(i)for(;l=u)break;(a?f.toA:f.toB)>c&&(!s||!s(t.state,f,o,l))&&I5(f,t.state.doc,a,i,o,l)}return{deco:o.finish(),gutter:l&&l.finish()}}var Cl=class extends Le.WidgetType{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement("div");return e.className="cm-mergeSpacer",e.style.height=this.height+"px",e}updateDOM(e){return e.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},Ph=Ie.StateEffect.define({map:(t,e)=>t.map(e)}),Du=Ie.StateField.define({create:()=>Le.Decoration.none,update:(t,e)=>{for(let r of e.effects)if(r.is(Ph))return r.value;return t.map(e.changes)},provide:t=>Le.EditorView.decorations.from(t)}),Ah=.01;function wP(t,e){if(t.size!=e.size)return!1;let r=t.iter(),i=e.iter();for(;r.value;){if(r.from!=i.from||Math.abs(r.value.spec.widget.height-i.value.spec.widget.height)>1)return!1;r.next(),i.next()}return!0}function M5(t,e,r){let i=new Ie.RangeSetBuilder,n=new Ie.RangeSetBuilder,s=t.state.field(Du).iter(),a=e.state.field(Du).iter(),o=0,l=0,c=0,u=0,f=t.viewport,d=e.viewport;for(let w=0;;w++){let y=wAh&&(u+=k,n.add(l,l,Le.Decoration.widget({widget:new Cl(k),block:!0,side:-1})))}if(b>o+1e3&&of.from&&ld.from){let C=Math.min(f.from-o,d.from-l);o+=C,l+=C,w--}else if(y)o=y.toA,l=y.toB;else break;for(;s.value&&s.fromAh&&n.add(e.state.doc.length,e.state.doc.length,Le.Decoration.widget({widget:new Cl(h),block:!0,side:1}));let p=i.finish(),g=n.finish();wP(p,t.state.field(Du))||t.dispatch({effects:Ph.of(p)}),wP(g,e.state.field(Du))||e.dispatch({effects:Ph.of(g)})}var ww=Ie.StateEffect.define({map:(t,e)=>e.mapPos(t)});var bw=class extends Le.WidgetType{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let r=document.createElement("div");return r.className="cm-collapsedLines",r.textContent=e.state.phrase("$ unchanged lines",this.lines),r.addEventListener("click",i=>{let n=e.posAtDOM(i.target);e.dispatch({effects:ww.of(n)});let{side:s,sibling:a}=e.state.facet(Si);a&&a().dispatch({effects:ww.of(D5(n,e.state.field(xn),s=="a"))})}),r}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return"collapsed-unchanged-code"}};function D5(t,e,r){let i=0,n=0;for(let s=0;;s++){let a=s=t)return n+(t-i);[i,n]=r?[a.toA,a.toB]:[a.toB,a.toA]}}var O5=Ie.StateField.define({create(t){return Le.Decoration.none},update(t,e){t=t.map(e.changes);for(let r of e.effects)r.is(ww)&&(t=t.update({filter:i=>i!=r.value}));if(t.size&&e.state.field(xn)!=e.startState.field(xn,!1)){let r=e.state.facet(Si).side=="a",i=[];for(let n of e.state.field(xn))t.between(r?n.fromA:n.fromB,r?n.toA:n.toB,s=>{i.push(s)});i.length&&(t=t.update({filter:n=>i.indexOf(n)<0}))}return t},provide:t=>Le.EditorView.decorations.from(t)});function bP({margin:t=3,minSize:e=4}){return O5.init(r=>L5(r,t,e))}function L5(t,e,r){let i=new Ie.RangeSetBuilder,n=t.facet(Si).side=="a",s=t.field(xn),a=1;for(let o=0;;o++){let l=o=r&&i.add(t.doc.line(c).from,t.doc.line(u).to,Le.Decoration.replace({widget:new bw(f),block:!0})),!l)break;a=t.doc.lineAt(Math.min(t.doc.length,n?l.toA:l.toB)).number}return i.finish()}var N5=Le.EditorView.styleModule.of(new Eh({".cm-mergeView":{overflowY:"auto"},".cm-mergeViewEditors":{display:"flex",alignItems:"stretch"},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:"hidden"},".cm-merge-revert":{width:"1.6em",flexGrow:0,flexShrink:0,position:"relative"},".cm-merge-revert button":{position:"absolute",display:"block",width:"100%",boxSizing:"border-box",textAlign:"center",background:"none",border:"none",font:"inherit",cursor:"pointer"}})),B5=Le.EditorView.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:"auto !important",overflowY:"visible !important"},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:"rgba(160, 128, 100, .08)"},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:"rgba(100, 160, 128, .08)"},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat"},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:"linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat"},"&light.cm-merge-b .cm-changedText":{background:"linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat"},"&dark.cm-merge-b .cm-changedText":{background:"linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat"},"&.cm-merge-b .cm-deletedText":{background:"#ff000033"},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:"none"},".cm-deletedChunk":{paddingLeft:"6px","& .cm-chunkButtons":{position:"absolute",insetInlineEnd:"5px"},"& button":{border:"none",cursor:"pointer",color:"white",margin:"0 2px",borderRadius:"3px","&[name=accept]":{background:"#2a2"},"&[name=reject]":{background:"#d43"}}},".cm-collapsedLines":{padding:"5px 5px 5px 10px",cursor:"pointer","&:before":{content:'"\u299A"',marginInlineEnd:"7px"},"&:after":{content:'"\u299A"',marginInlineStart:"7px"}},"&light .cm-collapsedLines":{color:"#444",background:"linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)"},"&dark .cm-collapsedLines":{color:"#ddd",background:"linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)"},".cm-changeGutter":{width:"3px",paddingLeft:"1px"},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:"#e43"},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:"#fa9"},"&light.cm-merge-b .cm-changedLineGutter":{background:"#2b2"},"&dark.cm-merge-b .cm-changedLineGutter":{background:"#8f8"},".cm-inlineChangedLineGutter":{background:"#75d"}}),_P=new Ie.Compartment,Ch=new Ie.Compartment,Rh=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||C5;let r=[Ie.Prec.low(DP),B5,N5,Du,Le.EditorView.updateListener.of(f=>{this.measuring<0&&(f.heightChanged||f.viewportChanged)&&!f.transactions.some(d=>d.effects.some(h=>h.is(Ph)))&&this.measure()})],i=[Si.of({side:"a",sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(kh);let n=Ie.EditorState.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],Le.EditorView.editorAttributes.of({class:"cm-merge-a"}),Ch.of(i),r]}),s=[Si.of({side:"b",sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&s.push(kh);let a=Ie.EditorState.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],Le.EditorView.editorAttributes.of({class:"cm-merge-b"}),Ch.of(s),r]});this.chunks=Xn.build(n.doc,a.doc,this.diffConf);let o=[xn.init(()=>this.chunks),_P.of(e.collapseUnchanged?bP(e.collapseUnchanged):[])];n=n.update({effects:Ie.StateEffect.appendConfig.of(o)}).state,a=a.update({effects:Ie.StateEffect.appendConfig.of(o)}).state,this.dom=document.createElement("div"),this.dom.className="cm-mergeView",this.editorDOM=this.dom.appendChild(document.createElement("div")),this.editorDOM.className="cm-mergeViewEditors";let l=e.orientation||"a-b",c=document.createElement("div");c.className="cm-mergeViewEditor";let u=document.createElement("div");u.className="cm-mergeViewEditor",this.editorDOM.appendChild(l=="a-b"?c:u),this.editorDOM.appendChild(l=="a-b"?u:c),this.a=new Le.EditorView({state:n,parent:c,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.a)}),this.b=new Le.EditorView({state:a,parent:u,root:e.root,dispatchTransactions:f=>this.dispatch(f,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls=="b-to-a",e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,r){if(e.some(i=>i.docChanged)){let i=e[e.length-1],n=e.reduce((a,o)=>a.compose(o.changes),Ie.ChangeSet.empty(e[0].startState.doc.length));this.chunks=r==this.a?Xn.updateA(this.chunks,i.newDoc,this.b.state.doc,n,this.diffConf):Xn.updateB(this.chunks,this.a.state.doc,i.newDoc,n,this.diffConf),r.update([...e,i.state.update({effects:vw.of(this.chunks)})]);let s=r==this.a?this.b:this.a;s.update([s.state.update({effects:vw.of(this.chunks)})]),this.scheduleMeasure()}else r.update(e)}reconfigure(e){if("diffConfig"in e&&(this.diffConf=e.diffConfig),"orientation"in e){let s=e.orientation!="b-a";if(s!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let a=this.a.dom.parentNode,o=this.b.dom.parentNode;a.remove(),o.remove(),this.editorDOM.insertBefore(s?a:o,this.editorDOM.firstChild),this.editorDOM.appendChild(s?o:a),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent="")}}if("revertControls"in e||"renderRevertControl"in e){let s=!!this.revertDOM,a=this.revertToA,o=this.renderRevert;"revertControls"in e&&(s=!!e.revertControls,a=e.revertControls=="b-to-a"),"renderRevertControl"in e&&(o=e.renderRevertControl),this.setupRevertControls(s,a,o)}let r="highlightChanges"in e,i="gutter"in e,n="collapseUnchanged"in e;if(r||i||n){let s=[],a=[];if(r||i){let o=this.a.state.facet(Si),l=i?e.gutter!==!1:o.markGutter,c=r?e.highlightChanges!==!1:o.highlightChanges;s.push(Ch.reconfigure([Si.of({side:"a",sibling:()=>this.b,highlightChanges:c,markGutter:l}),l?kh:[]])),a.push(Ch.reconfigure([Si.of({side:"b",sibling:()=>this.a,highlightChanges:c,markGutter:l}),l?kh:[]]))}if(n){let o=_P.reconfigure(e.collapseUnchanged?bP(e.collapseUnchanged):[]);s.push(o),a.push(o)}this.a.dispatch({effects:s}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,r,i){this.revertToA=r,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=i,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement("div"),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener("mousedown",n=>this.revertClicked(n)),this.revertDOM.className="cm-merge-revert"):this.revertDOM&&(this.revertDOM.textContent="")}scheduleMeasure(){if(this.measuring<0){let e=this.dom.ownerDocument.defaultView||window;this.measuring=e.requestAnimationFrame(()=>{this.measuring=-1,this.measure()})}}measure(){M5(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,r=e.firstChild,i=this.a.viewport,n=this.b.viewport;for(let s=0;si.to||a.fromB>n.to)break;if(a.fromA-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function yP(t){let e=t.nextSibling;return t.remove(),e}var Sw=require("@codemirror/state");function kw(t,e,r){let i=[],n=t.split(` +`),s=e.split(` +`);for(let a of r){let{oldStart:o,oldLines:l,newStart:c,newLines:u}=a,f=Wt.createHunk(o,l,c,u);if(a.oldLines>0){for(let d=o;dn.length&&n.last()!=""&&(f.removed.no_nl_at_eof=!0)}if(a.newLines>0){for(let d=c;ds.length&&s.last()!=""&&(f.added.no_nl_at_eof=!0)}i.push(f)}return i}function Aw(t,e,r){let i=e.lineAt(t.fromA).number,n=t.fromA==t.toA?0:$h(e,t.endA)-i+1,s=r.lineAt(t.fromB).number,a=t.fromB==t.toB?0:$h(r,t.endB)-s+1,o={oldStart:i,oldLines:n,newStart:s,newLines:a};return o.oldLines==0&&(o.oldStart-=1),o.newLines==0&&(o.newStart-=1),o}var OP={scanLimit:1e3,timeout:200};function H5(t,e,r,i){let n=Sw.Text.of(t.split(` +`)),s=Sw.Text.of(e.split(` +`)),a=r&&i?Xn.updateB(r,n,s,i,OP):Xn.build(n,s,OP),o=[];for(let l=0;lh.vend&&(f=f-(h.added.count-h.removed.count)),o>h.vend&&(d=d-(h.added.count-h.removed.count));c.added.lines=u.compareText.split(` +`).slice(f-1,d),u.compareTextHead?c.removed.lines=u.compareTextHead.split(` +`).slice(c.removed.start-1,c.removed.start-1+c.removed.count):c.removed.lines=[]}else c.added.lines=e.doc.toString().split(` +`).slice(a-1,o),o===e.doc.lines&&!e.doc.toString().endsWith(` +`)&&(c.added.no_nl_at_eof=!0),c.removed.lines=u.compareText.split(` +`).slice(c.removed.start-1,c.removed.start-1+c.removed.count),c.removed.start+c.removed.count-1===u.compareText.split(` +`).length&&!u.compareText.endsWith(` +`)&&(c.removed.no_nl_at_eof=!0);return c}},Gr=Pl.StateField.define({create:t=>{},update:(t,e)=>{let r=t?{...t}:{maxDiffTimeMs:0,hunks:[],stagedHunks:[],chunks:void 0,isDirty:!1},i=!1;for(let n of e.effects)n.is($l)&&(r.compareText=n.value.compareText,r.compareTextHead=n.value.compareTextHead,i=(t==null?void 0:t.compareText)!==n.value.compareText,i&&(r.chunks=void 0)),n.is(Ou)&&NP(r,n.value,e.state);if(r.compareText!==void 0){if(i||e.docChanged){r.isDirty=!0;let n=U5(e,r.compareText,r.chunks,r.maxDiffTimeMs);n&&NP(r,n,e.state)}}else r.compareText=void 0,r.compareTextHead=void 0,r.chunks=void 0,r.hunks=[],r.stagedHunks=[],r.isDirty=!1;return r}});function NP(t,e,r){var n,s;t.hunks=e.hunks,t.chunks=e.chunks,t.isDirty=!1,t.maxDiffTimeMs=Math.max(.95*t.maxDiffTimeMs,e.diffDuration);let i=r.field(Rl.editorInfoField).file;(s=(n=zt.plugin)==null?void 0:n.editorIntegration.signsFeature.changeStatusBar)==null||s.display(t.hunks,i)}var Cw=Pl.StateField.define({create:()=>({debouncer:(0,Rl.debounce)(t=>{let{state:e,compareText:r,previousChunks:i,changeDesc:n}=t,s=BP(e,r,i,n);e.field(Rl.editorEditorField).dispatch({effects:Ou.of(s)})},1e3,!0),maxDiffTimeMs:0}),update:(t,e)=>{var r;for(let i of e.effects)if(i.is(Ou))return t.changeDesc=void 0,t;return!t.changeDesc&&e.changes?t.changeDesc=e.changes:t.changeDesc=(r=t.changeDesc)==null?void 0:r.composeDesc(e.changes),t}});function BP(t,e,r,i){let n=t.doc.toString(),s=performance.now(),{hunks:a,chunks:o}=LP(e,n,r,i),l=performance.now()-s;return{hunks:a,chunks:o,diffDuration:l}}function U5(t,e,r,i){let n=t.state,s=Math.abs(t.changes.length-t.changes.newLength),a=n.field(Cw);if(s>1e3||i>16)a.debouncer({state:n,compareText:e,previousChunks:r,changeDesc:a.changeDesc});else return a.changeDesc=void 0,BP(n,e,r,t.changes)}var $l=Pl.StateEffect.define(),Ou=Pl.StateEffect.define();function HP(t,e){return e.update({effects:$l.of(t)})}m();m();m();var at;(function(t){t.INSERT="insert",t.DELETE="delete",t.CONTEXT="context"})(at||(at={}));var UP={LINE_BY_LINE:"line-by-line",SIDE_BY_SIDE:"side-by-side"},GP={LINES:"lines",WORDS:"words",NONE:"none"},jP={WORD:"word",CHAR:"char"},Da;(function(t){t.AUTO="auto",t.DARK="dark",t.LIGHT="light"})(Da||(Da={}));m();var G5=["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"],j5=RegExp("["+G5.join("\\")+"]","g");function VP(t){return t.replace(j5,"\\$&")}function Tw(t){return t&&t.replace(/\\/g,"/")}function zP(t){let e,r,i,n=0;for(e=0,i=t.length;e1?r[r.length-1]:e}function qP(t,e){return e.reduce((r,i)=>r||t.startsWith(i),!1)}var YP=["a/","b/","i/","w/","c/","o/"];function Us(t,e,r){let i=r!==void 0?[...YP,r]:YP,n=e?new RegExp(`^${VP(e)} "?(.+?)"?$`):new RegExp('^"?(.+?)"?$'),[,s=""]=n.exec(t)||[],a=i.find(l=>s.indexOf(l)===0);return(a?s.slice(a.length):s).replace(/\s+\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(?:\.\d+)? [+-]\d{4}.*$/,"")}function V5(t,e){return Us(t,"---",e)}function z5(t,e){return Us(t,"+++",e)}function ZP(t,e={}){let r=[],i=null,n=null,s=null,a=null,o=null,l=null,c=null,u="--- ",f="+++ ",d="@@",h=/^old mode (\d{6})/,p=/^new mode (\d{6})/,g=/^deleted file mode (\d{6})/,w=/^new file mode (\d{6})/,y=/^copy from "?(.+)"?/,b=/^copy to "?(.+)"?/,S=/^rename from "?(.+)"?/,C=/^rename to "?(.+)"?/,A=/^similarity index (\d+)%/,k=/^dissimilarity index (\d+)%/,v=/^index ([\da-z]+)\.\.([\da-z]+)\s*(\d{6})?/,x=/^Binary files (.*) and (.*) differ/,_=/^GIT binary patch/,P=/^index ([\da-z]+),([\da-z]+)\.\.([\da-z]+)/,T=/^mode (\d{6}),(\d{6})\.\.(\d{6})/,M=/^new file mode (\d{6})/,$=/^deleted file mode (\d{6}),(\d{6})/,D=t.replace(/\\ No newline at end of file/g,"").replace(/\r\n?/g,` +`).split(` +`);function Q(){n!==null&&i!==null&&(i.blocks.push(n),n=null)}function ye(){i!==null&&(!i.oldName&&l!==null&&(i.oldName=l),!i.newName&&c!==null&&(i.newName=c),i.newName&&(r.push(i),i=null)),l=null,c=null}function de(){Q(),ye(),i={blocks:[],deletedLines:0,addedLines:0}}function J(z){Q();let K;i!==null&&((K=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@.*/.exec(z))?(i.isCombined=!1,s=parseInt(K[1],10),o=parseInt(K[2],10)):(K=/^@@@ -(\d+)(?:,\d+)? -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@@.*/.exec(z))?(i.isCombined=!0,s=parseInt(K[1],10),a=parseInt(K[2],10),o=parseInt(K[3],10)):(z.startsWith(d)&&console.error("Failed to parse lines, starting in 0!"),s=0,o=0,i.isCombined=!1)),n={lines:[],oldStartLine:s,oldStartLine2:a,newStartLine:o,header:z}}function X(z){if(i===null||n===null||s===null||o===null)return;let K={content:z},G=i.isCombined?["+ "," +","++"]:["+"],Me=i.isCombined?["- "," -","--"]:["-"];qP(z,G)?(i.addedLines++,K.type=at.INSERT,K.oldNumber=void 0,K.newNumber=o++):qP(z,Me)?(i.deletedLines++,K.type=at.DELETE,K.oldNumber=s++,K.newNumber=void 0):(K.type=at.CONTEXT,K.oldNumber=s++,K.newNumber=o++),n.lines.push(K)}function he(z,K){let G=K;for(;G{if(!z||z.startsWith("*"))return;let G,Me=D[K-1],Et=D[K+1],Ht=D[K+2];if(z.startsWith("diff --git")||z.startsWith("diff --combined")){if(de(),(G=/^diff --git "?([a-ciow]\/.+)"? "?([a-ciow]\/.+)"?/.exec(z))&&(l=Us(G[1],void 0,e.dstPrefix),c=Us(G[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isGitDiff=!0;return}if(z.startsWith("Binary files")&&!(i!=null&&i.isGitDiff)){if(de(),(G=/^Binary files "?([a-ciow]\/.+)"? and "?([a-ciow]\/.+)"? differ/.exec(z))&&(l=Us(G[1],void 0,e.dstPrefix),c=Us(G[2],void 0,e.srcPrefix)),i===null)throw new Error("Where is my file !!!");i.isBinary=!0;return}if((!i||!i.isGitDiff&&i&&z.startsWith(u)&&Et.startsWith(f)&&Ht.startsWith(d))&&de(),i!=null&&i.isTooBig)return;if(i&&(typeof e.diffMaxChanges=="number"&&i.addedLines+i.deletedLines>e.diffMaxChanges||typeof e.diffMaxLineLength=="number"&&z.length>e.diffMaxLineLength)){i.isTooBig=!0,i.addedLines=0,i.deletedLines=0,i.blocks=[],n=null;let Rt=typeof e.diffTooBigMessage=="function"?e.diffTooBigMessage(r.length):"Diff too big to be displayed";J(Rt);return}if(z.startsWith(u)&&Et.startsWith(f)||z.startsWith(f)&&Me.startsWith(u)){if(i&&!i.oldName&&z.startsWith("--- ")&&(G=V5(z,e.srcPrefix))){i.oldName=G,i.language=WP(i.oldName,i.language);return}if(i&&!i.newName&&z.startsWith("+++ ")&&(G=z5(z,e.dstPrefix))){i.newName=G,i.language=WP(i.newName,i.language);return}}if(i&&(z.startsWith(d)||i.isGitDiff&&i.oldName&&i.newName&&!n)){J(z);return}if(n&&(z.startsWith("+")||z.startsWith("-")||z.startsWith(" "))){X(z);return}let De=!he(z,K);if(i===null)throw new Error("Where is my file !!!");(G=h.exec(z))?i.oldMode=G[1]:(G=p.exec(z))?i.newMode=G[1]:(G=g.exec(z))?(i.deletedFileMode=G[1],i.isDeleted=!0):(G=w.exec(z))?(i.newFileMode=G[1],i.isNew=!0):(G=y.exec(z))?(De&&(i.oldName=G[1]),i.isCopy=!0):(G=b.exec(z))?(De&&(i.newName=G[1]),i.isCopy=!0):(G=S.exec(z))?(De&&(i.oldName=G[1]),i.isRename=!0):(G=C.exec(z))?(De&&(i.newName=G[1]),i.isRename=!0):(G=x.exec(z))?(i.isBinary=!0,i.oldName=Us(G[1],void 0,e.srcPrefix),i.newName=Us(G[2],void 0,e.dstPrefix),J("Binary file")):_.test(z)?(i.isBinary=!0,J(z)):(G=A.exec(z))?i.unchangedPercentage=parseInt(G[1],10):(G=k.exec(z))?i.changedPercentage=parseInt(G[1],10):(G=v.exec(z))?(i.checksumBefore=G[1],i.checksumAfter=G[2],G[3]&&(i.mode=G[3])):(G=P.exec(z))?(i.checksumBefore=[G[2],G[3]],i.checksumAfter=G[1]):(G=T.exec(z))?(i.oldMode=[G[2],G[3]],i.newMode=G[1]):(G=M.exec(z))?(i.newFileMode=G[1],i.isNew=!0):(G=$.exec(z))&&(i.deletedFileMode=G[1],i.isDeleted=!0)}),Q(),ye(),r}m();m();m();m();var Gs=class{diff(e,r,i={}){let n;typeof i=="function"?(n=i,i={}):"callback"in i&&(n=i.callback);let s=this.castInput(e,i),a=this.castInput(r,i),o=this.removeEmpty(this.tokenize(s,i)),l=this.removeEmpty(this.tokenize(a,i));return this.diffWithOptionsObj(o,l,i,n)}diffWithOptionsObj(e,r,i,n){var s;let a=b=>{if(b=this.postProcess(b,i),n){setTimeout(function(){n(b)},0);return}else return b},o=r.length,l=e.length,c=1,u=o+l;i.maxEditLength!=null&&(u=Math.min(u,i.maxEditLength));let f=(s=i.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,h=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(h[0],r,e,0,i);if(h[0].oldPos+1>=l&&p+1>=o)return a(this.buildValues(h[0].lastComponent,r,e));let g=-1/0,w=1/0,y=()=>{for(let b=Math.max(g,-c);b<=Math.min(w,c);b+=2){let S,C=h[b-1],A=h[b+1];C&&(h[b-1]=void 0);let k=!1;if(A){let x=A.oldPos-b;k=A&&0<=x&&x=l&&p+1>=o)return a(this.buildValues(S.lastComponent,r,e))||!0;h[b]=S,S.oldPos+1>=l&&(w=Math.min(w,b-1)),p+1>=o&&(g=Math.max(g,b+1))}c++};if(n)(function b(){setTimeout(function(){if(c>u||Date.now()>d)return n(void 0);y()||b()},0)})();else for(;c<=u&&Date.now()<=d;){let b=y();if(b)return b}}addToPath(e,r,i,n,s){let a=e.lastComponent;return a&&!s.oneChangePerToken&&a.added===r&&a.removed===i?{oldPos:e.oldPos+n,lastComponent:{count:a.count+1,added:r,removed:i,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+n,lastComponent:{count:1,added:r,removed:i,previousComponent:a}}}extractCommon(e,r,i,n,s){let a=r.length,o=i.length,l=e.oldPos,c=l-n,u=0;for(;c+1d.length?p:d}),u.value=this.join(f)}else u.value=this.join(r.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return n}};m();var Pw=class extends Gs{},KP=new Pw;function Rw(t,e,r){return KP.diff(t,e,r)}m();m();function $w(t,e){let r;for(r=0;re.length&&(r=t.length-e.length);let i=e.length;t.length0&&e[a]!=e[s];)s=n[s];e[a]==e[s]&&s++}s=0;for(let a=r;a0&&t[a]!=e[s];)s=n[s];t[a]==e[s]&&s++}return s}function Mw(t,e){let r=[];for(let i of Array.from(e.segment(t))){let n=i.segment;r.length&&/\s/.test(r[r.length-1])&&/\s/.test(n)?r[r.length-1]+=n:r.push(n)}return r}function Dh(t,e){if(e)return Il(t,e)[1];let r;for(r=t.length-1;r>=0&&t[r].match(/\s/);r--);return t.substring(r+1)}function Oa(t,e){if(e)return Il(t,e)[0];let r=t.match(/^\s*/);return r?r[0]:""}function Il(t,e){if(!e)return[Oa(t),Dh(t)];if(e.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');let r=Mw(t,e),i=r[0],n=r[r.length-1],s=/\s/.test(i)?i:"",a=/\s/.test(n)?n:"";return[s,a]}var Oh="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Y5=new RegExp(`[${Oh}]+|\\s+|[^${Oh}]`,"ug"),Dw=class extends Gs{equals(e,r,i){return i.ignoreCase&&(e=e.toLowerCase(),r=r.toLowerCase()),e.trim()===r.trim()}tokenize(e,r={}){let i;if(r.intlSegmenter){let a=r.intlSegmenter;if(a.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');i=Mw(e,a)}else i=e.match(Y5)||[];let n=[],s=null;return i.forEach(a=>{/\s/.test(a)?s==null?n.push(a):n.push(n.pop()+a):s!=null&&/\s/.test(s)?n[n.length-1]==s?n.push(n.pop()+a):n.push(s+a):n.push(a),s=a}),n}join(e){return e.map((r,i)=>i==0?r:r.replace(/^\s+/,"")).join("")}postProcess(e,r){if(!e||r.oneChangePerToken)return e;let i=null,n=null,s=null;return e.forEach(a=>{a.added?n=a:a.removed?s=a:((n||s)&&XP(i,s,n,a,r.intlSegmenter),i=a,n=null,s=null)}),(n||s)&&XP(i,s,n,null,r.intlSegmenter),e}},Z5=new Dw;function XP(t,e,r,i,n){if(e&&r){let[s,a]=Il(e.value,n),[o,l]=Il(r.value,n);if(t){let c=$w(s,o);t.value=Mh(t.value,o,c),e.value=Fl(e.value,c),r.value=Fl(r.value,c)}if(i){let c=Fw(a,l);i.value=Ih(i.value,l,c),e.value=Lu(e.value,c),r.value=Lu(r.value,c)}}else if(r){if(t){let s=Oa(r.value,n);r.value=r.value.substring(s.length)}if(i){let s=Oa(i.value,n);i.value=i.value.substring(s.length)}}else if(t&&i){let s=Oa(i.value,n),[a,o]=Il(e.value,n),l=$w(s,a);e.value=Fl(e.value,l);let c=Fw(Fl(s,l),o);e.value=Lu(e.value,c),i.value=Ih(i.value,s,c),t.value=Mh(t.value,s,s.slice(0,s.length-c.length))}else if(i){let s=Oa(i.value,n),a=Dh(e.value,n),o=Iw(a,s);e.value=Lu(e.value,o)}else if(t){let s=Dh(t.value,n),a=Oa(e.value,n),o=Iw(s,a);e.value=Fl(e.value,o)}}var Ow=class extends Gs{tokenize(e){let r=new RegExp(`(\\r?\\n)|[${Oh}]+|[^\\S\\n\\r]+|[^${Oh}]`,"ug");return e.match(r)||[]}},QP=new Ow;function Lw(t,e,r){return QP.diff(t,e,r)}m();function X5(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],i;for(i=0;i<=e.length;i++)r[i]=[i];let n;for(n=0;n<=t.length;n++)r[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?r[i][n]=r[i-1][n-1]:r[i][n]=Math.min(r[i-1][n-1]+1,Math.min(r[i][n-1]+1,r[i-1][n]+1));return r[e.length][t.length]}function Ml(t){return(e,r)=>{let i=t(e).trim(),n=t(r).trim();return X5(i,n)/(i.length+n.length)}}function Dl(t){function e(i,n,s=new Map){let a=1/0,o;for(let l=0;l0||o.indexB>0)&&(S=w.concat(S)),(i.length>d||n.length>h)&&(S=S.concat(b)),S}return r}var Jt={INSERTS:"d2h-ins",DELETES:"d2h-del",CONTEXT:"d2h-cntx",INFO:"d2h-info",INSERT_CHANGES:"d2h-ins d2h-change",DELETE_CHANGES:"d2h-del d2h-change"},La={matching:GP.NONE,matchWordsThreshold:.25,maxLineLengthHighlight:1e4,diffStyle:jP.WORD,colorScheme:Da.LIGHT},En="/",JP=Ml(t=>t.value),Q5=Dl(JP);function Bw(t){return t.indexOf("dev/null")!==-1}function J5(t){return t.replace(/(]*>((.|\n)*?)<\/ins>)/g,"")}function e4(t){return t.replace(/(]*>((.|\n)*?)<\/del>)/g,"")}function Ol(t){switch(t){case at.CONTEXT:return Jt.CONTEXT;case at.INSERT:return Jt.INSERTS;case at.DELETE:return Jt.DELETES}}function Ll(t){switch(t){case Da.DARK:return"d2h-dark-color-scheme";case Da.AUTO:return"d2h-auto-color-scheme";case Da.LIGHT:default:return"d2h-light-color-scheme"}}function t4(t){return t?2:1}function js(t){return t.slice(0).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")}function ki(t,e,r=!0){let i=t4(e);return{prefix:t.substring(0,i),content:r?js(t.substring(i)):t.substring(i)}}function Na(t){let e=Tw(t.oldName),r=Tw(t.newName);if(e!==r&&!Bw(e)&&!Bw(r)){let i=[],n=[],s=e.split(En),a=r.split(En),o=s.length,l=a.length,c=0,u=o-1,f=l-1;for(;cc&&f>c&&s[u]===a[f];)n.unshift(a[f]),u-=1,f-=1;let d=i.join(En),h=n.join(En),p=s.slice(c,u+1).join(En),g=a.slice(c,f+1).join(En);return d.length&&h.length?d+En+"{"+p+" \u2192 "+g+"}"+En+h:d.length?d+En+"{"+p+" \u2192 "+g+"}":h.length?"{"+p+" \u2192 "+g+"}"+En+h:e+" \u2192 "+r}else return Bw(r)?e:r}function Nl(t){return`d2h-${zP(Na(t)).toString().slice(-6)}`}function Bl(t){let e="file-changed";return t.isRename||t.isCopy?e="file-renamed":t.isNew?e="file-added":t.isDeleted?e="file-deleted":t.newName!==t.oldName&&(e="file-renamed"),e}function Lh(t,e,r,i={}){let{matching:n,maxLineLengthHighlight:s,matchWordsThreshold:a,diffStyle:o}=Object.assign(Object.assign({},La),i),l=ki(t,r,!1),c=ki(e,r,!1);if(l.content.length>s||c.content.length>s)return{oldLine:{prefix:l.prefix,content:js(l.content)},newLine:{prefix:c.prefix,content:js(c.content)}};let u=o==="char"?Rw(l.content,c.content):Lw(l.content,c.content),f=[];if(o==="word"&&n==="words"){let h=u.filter(w=>w.removed),p=u.filter(w=>w.added);Q5(p,h).forEach(w=>{w[0].length===1&&w[1].length===1&&JP(w[0][0],w[1][0]){let g=p.added?"ins":p.removed?"del":null,w=f.indexOf(p)>-1?' class="d2h-change"':"",y=js(p.value);return g!==null?`${h}<${g}${w}>${y}`:`${h}${y}`},"");return{oldLine:{prefix:l.prefix,content:J5(d)},newLine:{prefix:c.prefix,content:e4(d)}}}var eR="file-summary",r4="icon",i4={colorScheme:La.colorScheme},Nh=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},i4),r)}render(e){let r=e.map(i=>this.hoganUtils.render(eR,"line",{fileHtmlId:Nl(i),oldName:i.oldName,newName:i.newName,fileName:Na(i),deletedLines:"-"+i.deletedLines,addedLines:"+"+i.addedLines},{fileIcon:this.hoganUtils.template(r4,Bl(i))})).join(` +`);return this.hoganUtils.render(eR,"wrapper",{colorScheme:Ll(this.config.colorScheme),filesNumber:e.length,files:r})}};m();var Uw=Object.assign(Object.assign({},La),{renderNothingWhenEmpty:!1,matchingMaxComparisons:2500,maxLineSizeInBlockForComparison:200}),Nu="generic",tR="line-by-line",n4="icon",s4="tag",Bu=class{constructor(e,r={}){this.hoganUtils=e,this.config=Object.assign(Object.assign({},Uw),r)}render(e){let r=e.map(i=>{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(Nu,"wrapper",{colorScheme:Ll(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(tR,"file-diff"),n=this.hoganUtils.template(Nu,"file-path"),s=this.hoganUtils.template(n4,"file"),a=this.hoganUtils.template(s4,Bl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Na(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return this.hoganUtils.render(Nu,"empty-diff",{contentClass:"d2h-code-line",CSSLineClass:Jt})}generateFileHtml(e){let r=Dl(Ml(i=>ki(i.content,e.isCombined).content));return e.blocks.map(i=>{let n=this.hoganUtils.render(Nu,"block-header",{CSSLineClass:Jt,blockHeader:e.isTooBig?i.header:js(i.header),lineClass:"d2h-code-linenumber",contentClass:"d2h-code-line"});return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e,e.isCombined,l,c);n+=u,n+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ki(l.content,e.isCombined);n+=this.generateSingleLineHtml(e,{type:Jt.CONTEXT,prefix:c,content:u,oldNumber:l.oldNumber,newNumber:l.newNumber})});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e,e.isCombined,a,o);n+=l,n+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).join(` +`)}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===at.CONTEXT?r.push([[a],[],[]]):a.type===at.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===at.INSERT&&i.length>0?n.push(a):a.type===at.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=Fh(e.concat(r).map(o=>o.content.length));return n{let n;return i.blocks.length?n=this.generateFileHtml(i):n=this.generateEmptyDiff(),this.makeFileDiffHtml(i,n)}).join(` +`);return this.hoganUtils.render(Hu,"wrapper",{colorScheme:Ll(this.config.colorScheme),content:r})}makeFileDiffHtml(e,r){if(this.config.renderNothingWhenEmpty&&Array.isArray(e.blocks)&&e.blocks.length===0)return"";let i=this.hoganUtils.template(a4,"file-diff"),n=this.hoganUtils.template(Hu,"file-path"),s=this.hoganUtils.template(o4,"file"),a=this.hoganUtils.template(l4,Bl(e));return i.render({file:e,fileHtmlId:Nl(e),diffs:r,filePath:n.render({fileDiffName:Na(e)},{fileIcon:s,fileTag:a})})}generateEmptyDiff(){return{right:"",left:this.hoganUtils.render(Hu,"empty-diff",{contentClass:"d2h-code-side-line",CSSLineClass:Jt})}}generateFileHtml(e){let r=Dl(Ml(i=>ki(i.content,e.isCombined).content));return e.blocks.map(i=>{let n={left:this.makeHeaderHtml(i.header,e),right:this.makeHeaderHtml("")};return this.applyLineGroupping(i).forEach(([s,a,o])=>{if(a.length&&o.length&&!s.length)this.applyRematchMatching(a,o,r).map(([l,c])=>{let{left:u,right:f}=this.processChangedLines(e.isCombined,l,c);n.left+=u,n.right+=f});else if(s.length)s.forEach(l=>{let{prefix:c,content:u}=ki(l.content,e.isCombined),{left:f,right:d}=this.generateLineHtml({type:Jt.CONTEXT,prefix:c,content:u,number:l.oldNumber},{type:Jt.CONTEXT,prefix:c,content:u,number:l.newNumber});n.left+=f,n.right+=d});else if(a.length||o.length){let{left:l,right:c}=this.processChangedLines(e.isCombined,a,o);n.left+=l,n.right+=c}else console.error("Unknown state reached while processing groups of lines",s,a,o)}),n}).reduce((i,n)=>({left:i.left+n.left,right:i.right+n.right}),{left:"",right:""})}applyLineGroupping(e){let r=[],i=[],n=[];for(let s=0;s0)&&(r.push([[],i,n]),i=[],n=[]),a.type===at.CONTEXT?r.push([[a],[],[]]):a.type===at.INSERT&&i.length===0?r.push([[],[],[a]]):a.type===at.INSERT&&i.length>0?n.push(a):a.type===at.DELETE&&i.push(a)}return(i.length||n.length)&&(r.push([[],i,n]),i=[],n=[]),r}applyRematchMatching(e,r,i){let n=e.length*r.length,s=Fh(e.concat(r).map(o=>o.content.length));return n'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileName",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("addedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(' '),i.b(i.v(i.f("deletedLines",t,e,0))),i.b(""),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{"'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' Files changed ('),i.b(i.v(i.f("filesNumber",t,e,0))),i.b(")"),i.b(` +`+r),i.b(' hide'),i.b(` +`+r),i.b(' show'),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
    '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("files",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-block-header"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.s(i.f("blockHeader",t,e,1),t,e,0,156,173,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(a.t(a.f("blockHeader",n,s,0)))}),t.pop()),i.s(i.f("blockHeader",t,e,1),t,e,1,0,0,"")||i.b(" "),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-empty-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" File without changes"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-file-path"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b(''),i.b(` +`+r),i.b(i.rp("'),i.b(i.v(i.f("fileDiffName",t,e,0))),i.b(""),i.b(` +`+r),i.b(i.rp(""),i.b(` +`+r),i.b('"),i.fl()},partials:{""),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("lineNumber",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.s(i.f("prefix",t,e,1),t,e,0,162,238,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("prefix",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("prefix",t,e,1),t,e,1,0,0,"")||(i.b('  '),i.b(` +`+r)),i.s(i.f("content",t,e,1),t,e,0,371,445,"{{ }}")&&(i.rs(t,e,function(n,s,a){a.b(' '),a.b(a.t(a.f("content",n,s,0))),a.b(""),a.b(` +`+r)}),t.pop()),i.s(i.f("content",t,e,1),t,e,1,0,0,"")||(i.b('
'),i.b(` +`+r)),i.b("
"),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b(""),i.fl()},partials:{},subs:{}});xt["generic-wrapper"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("content",t,e,0))),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});xt["icon-file-added"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file-changed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file-deleted"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file-renamed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["icon-file"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('"),i.fl()},partials:{},subs:{}});xt["line-by-line-file-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("diffs",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});xt["line-by-line-numbers"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(i.v(i.f("oldNumber",t,e,0))),i.b("
"),i.b(` +`+r),i.b('
'),i.b(i.v(i.f("newNumber",t,e,0))),i.b("
"),i.fl()},partials:{},subs:{}});xt["side-by-side-file-diff"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(" "),i.b(i.t(i.f("filePath",t,e,0))),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.left",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b('
'),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(' '),i.b(` +`+r),i.b(" "),i.b(i.t(i.d("diffs.right",t,e,0))),i.b(` +`+r),i.b(" "),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.b(` +`+r),i.b("
"),i.fl()},partials:{},subs:{}});xt["tag-file-added"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('ADDED'),i.fl()},partials:{},subs:{}});xt["tag-file-changed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('CHANGED'),i.fl()},partials:{},subs:{}});xt["tag-file-deleted"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('DELETED'),i.fl()},partials:{},subs:{}});xt["tag-file-renamed"]=new At.Template({code:function(t,e,r){var i=this;return i.b(r=r||""),i.b('RENAMED'),i.fl()},partials:{},subs:{}});var Gu=class{constructor({compiledTemplates:e={},rawTemplates:r={}}){let i=Object.entries(r).reduce((n,[s,a])=>{let o=Ww.compile(a,{asString:!1});return Object.assign(Object.assign({},n),{[s]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},xt),e),i)}static compile(e){return Ww.compile(e,{asString:!1})}render(e,r,i,n,s){let a=this.templateKey(e,r);try{return this.preCompiledTemplates[a].render(i,n,s)}catch(o){throw new Error(`Could not find template to render '${a}'`)}}template(e,r){return this.preCompiledTemplates[this.templateKey(e,r)]}templateKey(e,r){return`${e}-${r}`}};var u4=Object.assign(Object.assign(Object.assign({},Uw),Gw),{outputFormat:UP.LINE_BY_LINE,drawFileList:!0});function Hh(t,e={}){let r=Object.assign(Object.assign({},u4),e),i=typeof t=="string"?ZP(t,r):t,n=new Gu(r),{colorScheme:s}=r,a={colorScheme:s},o=r.drawFileList?new Nh(n,a).render(i):"",l=r.outputFormat==="side-by-side"?new Uu(n,r).render(i):new Bu(n,r).render(i);return o+l}var cR=Gt(oR(),1);var Ba=require("obsidian"),qw=ju.StateEffect.define();function Vs(t,e){let r=t.state,i=r.field(Gh),n=r.field(Gr),s=r.doc.lineAt(e!=null?e:r.selection.main.head).number,a=Wt.findHunk(s,n==null?void 0:n.hunks)[0];if(!a)return;let o=r.doc.line(Math.max(1,a.added.start)).from,l=i.has(o);return r.field(Ba.editorEditorField).dispatch({effects:qw.of({pos:o,add:!l})})}var Gh=ju.StateField.define({create:()=>new Set,update(t,e){let r=new Set;for(let i of e.effects)i.is(qw)&&(i.value.add?t.add(i.value.pos):t.delete(i.value.pos));for(let i of t)r.add(e.changes.mapPos(i));return r}}),uR=ju.StateField.define({create:t=>lR(t),update(t,e){return e.docChanged||e.effects.some(r=>r.is($l)||r.is(qw))?lR(e.state):t},provide:t=>Uh.showTooltip.computeN([t],e=>e.field(t))}),fR=Uh.EditorView.baseTheme({".cm-tooltip.git-diff-tooltip":{"z-index":"var(--layer-popover)",backgroundColor:"var(--background-primary-alt)",border:"var(--border-width) solid var(--background-primary-alt)",borderRadius:"var(--radius-s)"},".cm-tooltip.git-diff-tooltip .tooltip-toolbar":{display:"flex",padding:"var(--size-2-1)"}});function lR(t){let e=t.field(Gr);return e?[...t.field(Gh)].map(i=>{let n=t.doc.lineAt(i),s=Wt.findHunk(n.number,e.hunks)[0];if(s)return{pos:i,above:!1,arrow:!1,strictSide:!0,clip:!1,create:()=>f4(s,t,i)}}).filter(i=>i!==void 0):[]}function f4(t,e,r){var g,w;let i=Wt.createPatch("file",[t],"10064",!1).join(` +`)+` +`,n=Hh(i,{colorScheme:cR.ColorSchemeType.AUTO,diffStyle:"word",drawFileList:!1}),s=new DOMParser().parseFromString(n,"text/html").querySelector(".d2h-file-diff"),a=createDiv();a.addClass("tooltip-toolbar");let o=(y,b)=>{let S=createDiv();return(0,Ba.setIcon)(S,y),S.setAttr("aria-label",b),S.addClass("clickable-icon"),S},l=o("x","Close hunk"),c=o("plus","Stage hunk"),u=o("undo","Reset hunk");a.appendChild(l),a.appendChild(c),a.appendChild(u);let f=createDiv();f.appendChild(a),f.appendChild(s),f.addClass("git-diff-tooltip","git-diff");let d=e.field(Ba.editorEditorField);l.onclick=()=>{Vs(d,r)},c.onclick=()=>{let y=zt.plugin;y&&(y.promiseQueue.addTask(()=>y.hunkActions.stageHunk(r)),Vs(d,r))},u.onclick=()=>{let y=zt.plugin;y&&(y.hunkActions.resetHunk(r),Vs(d,r))};let h=(w=(g=zt.plugin)==null?void 0:g.app.workspace.getActiveViewOfType(Ba.MarkdownView))==null?void 0:w.scope,p=h==null?void 0:h.register(null,"Escape",(y,b)=>{Vs(d,r)});return{dom:f,destroy:()=>{p&&(h==null||h.unregister(p))},update:y=>{r=y.changes.mapPos(r)}}}function dR(t){let e=t.app;t.addCommand({id:"edit-gitignore",name:"Edit .gitignore",callback:async()=>{let r=t.gitManager.getRelativeVaultPath(".gitignore");await e.vault.adapter.exists(r)||await e.vault.adapter.write(r,"");let i=await e.vault.adapter.read(r),s=await new xh(e,i).openAndGetReslt();s!==void 0&&(await e.vault.adapter.write(r,s),await t.refresh())}}),t.addCommand({id:"open-git-view",name:"Open source control view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(Qt.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:Qt.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-history-view",name:"Open history view",callback:async()=>{var n;let r=e.workspace.getLeavesOfType(bi.type),i;r.length===0?(i=(n=e.workspace.getRightLeaf(!1))!=null?n:e.workspace.getLeaf(),await i.setViewState({type:bi.type})):i=r.first(),await e.workspace.revealLeaf(i),e.workspace.trigger("obsidian-git:refresh")}}),t.addCommand({id:"open-diff-view",name:"Open diff view",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;{let n=t.gitManager.getRelativeRepoPath(i.path,!0);t.tools.openDiff({aFile:n,aRef:""})}}}),t.addCommand({id:"view-file-on-github",name:"Open file on GitHub",editorCallback:(r,{file:i})=>{if(i)return X2(r,i,t.gitManager)}}),t.addCommand({id:"view-history-on-github",name:"Open file history on GitHub",editorCallback:(r,{file:i})=>{if(i)return Q2(i,t.gitManager)}}),t.addCommand({id:"pull",name:"Pull",callback:()=>t.promiseQueue.addTask(()=>t.pullChangesFromRemote())}),t.addCommand({id:"fetch",name:"Fetch",callback:()=>t.promiseQueue.addTask(()=>t.fetch())}),t.addCommand({id:"switch-to-remote-branch",name:"Switch to remote branch",callback:()=>t.promiseQueue.addTask(()=>t.switchRemoteBranch())}),t.addCommand({id:"add-to-gitignore",name:"Add file to .gitignore",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.addFileToGitignore(i.path,i instanceof Wi.TFolder).catch(n=>t.displayError(n))}}),t.addCommand({id:"push",name:"Commit-and-sync",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1}))}),t.addCommand({id:"backup-and-close",name:"Commit-and-sync and then close Obsidian",callback:()=>t.promiseQueue.addTask(async()=>{await t.commitAndSync({fromAutoBackup:!1}),window.close()})}),t.addCommand({id:"commit-push-specified-message",name:"Commit-and-sync with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commitAndSync({fromAutoBackup:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit",name:"Commit all changes",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1}))}),t.addCommand({id:"commit-specified-message",name:"Commit all changes with specific message",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0}))}),t.addCommand({id:"commit-smart",name:"Commit",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!1,onlyStaged:i})})}),t.addCommand({id:"commit-staged",name:"Commit staged",checkCallback:function(r){if(r)return!1;t.promiseQueue.addTask(async()=>t.commit({fromAuto:!1,requestCustomMessage:!1}))}}),Wi.Platform.isDesktopApp&&t.addCommand({id:"commit-amend-staged-specified-message",name:"Amend staged",callback:()=>t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0,amend:!0}))}),t.addCommand({id:"commit-smart-specified-message",name:"Commit with specific message",callback:()=>t.promiseQueue.addTask(async()=>{let i=(await t.updateCachedStatus()).staged.length>0;return t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:i})})}),t.addCommand({id:"commit-staged-specified-message",name:"Commit staged with specific message",checkCallback:function(r){return r?!1:t.promiseQueue.addTask(()=>t.commit({fromAuto:!1,requestCustomMessage:!0,onlyStaged:!0}))}}),t.addCommand({id:"push2",name:"Push",callback:()=>t.promiseQueue.addTask(()=>t.push())}),t.addCommand({id:"stage-current-file",name:"Stage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.stageFile(i))}}),t.addCommand({id:"unstage-current-file",name:"Unstage current file",checkCallback:r=>{let i=e.workspace.getActiveFile();if(r)return i!==null;t.promiseQueue.addTask(()=>t.unstageFile(i))}}),t.addCommand({id:"edit-remotes",name:"Edit remotes",callback:()=>t.editRemotes().catch(r=>t.displayError(r))}),t.addCommand({id:"remove-remote",name:"Remove remote",callback:()=>t.removeRemote().catch(r=>t.displayError(r))}),t.addCommand({id:"set-upstream-branch",name:"Set upstream branch",callback:()=>t.setUpstreamBranch().catch(r=>t.displayError(r))}),t.addCommand({id:"delete-repo",name:"CAUTION: Delete repository",callback:async()=>{await e.vault.adapter.exists(`${t.settings.basePath}/.git`)?await new tt(t,{options:["NO","YES"],placeholder:"Do you really want to delete the repository (.git directory)? plugin action cannot be undone.",onlySelection:!0}).openAndGetResult()==="YES"&&(await e.vault.adapter.rmdir(`${t.settings.basePath}/.git`,!0),new Wi.Notice("Successfully deleted repository. Reloading plugin..."),t.unloadPlugin(),await t.init({fromReload:!0})):new Wi.Notice("No repository found")}}),t.addCommand({id:"init-repo",name:"Initialize a new repo",callback:()=>t.createNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"clone-repo",name:"Clone an existing remote repo",callback:()=>t.cloneNewRepo().catch(r=>t.displayError(r))}),t.addCommand({id:"list-changed-files",name:"List changed files",callback:async()=>{if(await t.isAllInitialized())try{let r=await t.updateCachedStatus();if(r.changed.length+r.staged.length>500){t.displayError("Too many changes to display");return}new yh(t,r.all).open()}catch(r){t.displayError(r)}}}),t.addCommand({id:"switch-branch",name:"Switch branch",callback:()=>{t.switchBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"create-branch",name:"Create new branch",callback:()=>{t.createBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"delete-branch",name:"Delete branch",callback:()=>{t.deleteBranch().catch(r=>t.displayError(r))}}),t.addCommand({id:"discard-all",name:"CAUTION: Discard all changes",callback:async()=>{let r=await t.discardAll();switch(r){case"discard":new Wi.Notice("Discarded all changes in tracked files.");break;case"delete":new Wi.Notice("Discarded all files.");break;case!1:break;default:Md(r)}}}),t.addCommand({id:"pause-automatic-routines",name:"Pause/Resume automatic routines",callback:()=>{let r=!t.localStorage.getPausedAutomatics();t.localStorage.setPausedAutomatics(r),r?(t.automaticsManager.unload(),new Wi.Notice("Paused automatic routines.")):(t.automaticsManager.reload("commit","push","pull"),new Wi.Notice("Resumed automatic routines."))}}),t.addCommand({id:"raw-command",name:"Raw command",checkCallback:r=>{let i=t.gitManager;if(r)return i instanceof Ce;t.tools.runRawCommand().catch(n=>t.displayError(n))}}),t.addCommand({id:"toggle-line-author-info",name:"Toggle line author information",callback:()=>{var r;return(r=t.settingsTab)==null?void 0:r.configureLineAuthorShowStatus(!t.settings.lineAuthor.show)}}),t.addCommand({id:"reset-hunk",name:"Reset hunk",editorCheckCallback(r,i,n){if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.resetHunk()}}),t.addCommand({id:"stage-hunk",name:"Stage hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.promiseQueue.addTask(()=>t.hunkActions.stageHunk())}}),t.addCommand({id:"preview-hunk",name:"Preview hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;let s=t.hunkActions.editor.editor;Vs(s)}}),t.addCommand({id:"next-hunk",name:"Go to next hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("next")}}),t.addCommand({id:"prev-hunk",name:"Go to previous hunk",editorCheckCallback:(r,i,n)=>{if(r)return t.settings.hunks.hunkCommands&&t.hunkActions.editor!==void 0;t.hunkActions.goToHunk("prev")}})}m();var jh=class{constructor(e){this.plugin=e;this.prefix=this.plugin.manifest.id+":",this.app=e.app}migrate(){let e=["password","hostname","conflict","lastAutoPull","lastAutoBackup","lastAutoPush","gitPath","pluginDisabled"];for(let r of e){let i=localStorage.getItem(this.prefix+r);this.app.loadLocalStorage(this.prefix+r)==null&&i!=null&&i!=null&&(this.app.saveLocalStorage(this.prefix+r,i),localStorage.removeItem(this.prefix+r))}}getPassword(){return this.app.loadLocalStorage(this.prefix+"password")}setPassword(e){return this.app.saveLocalStorage(this.prefix+"password",e)}getUsername(){return this.app.loadLocalStorage(this.prefix+"username")}setUsername(e){return this.app.saveLocalStorage(this.prefix+"username",e)}getHostname(){return this.app.loadLocalStorage(this.prefix+"hostname")}setHostname(e){return this.app.saveLocalStorage(this.prefix+"hostname",e)}getConflict(){return this.app.loadLocalStorage(this.prefix+"conflict")=="true"}setConflict(e){return this.app.saveLocalStorage(this.prefix+"conflict",`${e}`)}getLastAutoPull(){return this.app.loadLocalStorage(this.prefix+"lastAutoPull")}setLastAutoPull(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPull",e)}getLastAutoBackup(){return this.app.loadLocalStorage(this.prefix+"lastAutoBackup")}setLastAutoBackup(e){return this.app.saveLocalStorage(this.prefix+"lastAutoBackup",e)}getLastAutoPush(){return this.app.loadLocalStorage(this.prefix+"lastAutoPush")}setLastAutoPush(e){return this.app.saveLocalStorage(this.prefix+"lastAutoPush",e)}getGitPath(){return this.app.loadLocalStorage(this.prefix+"gitPath")}setGitPath(e){return this.app.saveLocalStorage(this.prefix+"gitPath",e)}getPATHPaths(){var e,r;return(r=(e=this.app.loadLocalStorage(this.prefix+"PATHPaths"))==null?void 0:e.split(":"))!=null?r:[]}setPATHPaths(e){return this.app.saveLocalStorage(this.prefix+"PATHPaths",e.join(":"))}getEnvVars(){var e;return JSON.parse((e=this.app.loadLocalStorage(this.prefix+"envVars"))!=null?e:"[]")}setEnvVars(e){return this.app.saveLocalStorage(this.prefix+"envVars",JSON.stringify(e))}getPluginDisabled(){return this.app.loadLocalStorage(this.prefix+"pluginDisabled")=="true"}setPluginDisabled(e){return this.app.saveLocalStorage(this.prefix+"pluginDisabled",`${e}`)}getPausedAutomatics(){return this.app.loadLocalStorage(this.prefix+"pausedAutomatics")=="true"}setPausedAutomatics(e){return this.app.saveLocalStorage(this.prefix+"pausedAutomatics",`${e}`)}getGutterSpacingFallbackLength(){var e;return(e=this.app.loadLocalStorage(this.prefix+"gutterSpacingFallbackLength"))!=null?e:5}setGutterSpacingFallbackLength(e){return this.app.saveLocalStorage(this.prefix+"gutterSpacingFallbackLength",e)}};m();var Hl=require("obsidian");var Vu=class{constructor(e){this.plugin=e}async hasTooBigFiles(e){let r=await this.plugin.gitManager.branchInfo(),i=r.tracking?Yn(r.tracking)[0]:null;if(!i)return!1;let n=await this.plugin.gitManager.getRemoteUrl(i);if(n!=null&&n.includes("github.com")){let s=[],a=this.plugin.gitManager;for(let o of e){let l=this.plugin.app.vault.getAbstractFileByPath(o.vaultPath),c=!1;if(l instanceof Hl.TFile)l.stat.size>=1e8&&(c=!0);else{let u=await this.plugin.app.vault.adapter.stat(o.vaultPath);u&&u.size>=1e8&&(c=!0)}if(c){let u=!1;a instanceof Ce&&(u=await a.isFileTrackedByLFS(o.path)),u||s.push(o)}}if(s.length>0)return this.plugin.displayError(`Aborted commit, because the following files are too big: +- ${s.map(o=>o.vaultPath).join(` +- `)} +Please remove them or add to .gitignore.`),!0}return!1}async writeAndOpenFile(e){e!==void 0&&await this.plugin.app.vault.adapter.write(il,e);let r=!1;this.plugin.app.workspace.iterateAllLeaves(i=>{i.getDisplayText()!=""&&il.startsWith(i.getDisplayText())&&(r=!0)}),r||await this.plugin.app.workspace.openLinkText(il,"/",!0)}openDiff({aFile:e,bFile:r,aRef:i,bRef:n,event:s}){var l,c;let a=this.plugin.settings.diffStyle;Hl.Platform.isMobileApp&&(a="git_unified");let o={aFile:e,bFile:r!=null?r:e,aRef:i,bRef:n};a=="split"?(l=ji(this.plugin.app,s))==null||l.setViewState({type:Ms.type,active:!0,state:o}):a=="git_unified"&&((c=ji(this.plugin.app,s))==null||c.setViewState({type:Ds.type,active:!0,state:o}))}async runRawCommand(){let e=this.plugin.gitManager;if(!(e instanceof Ce))return;let i=await new tt(this.plugin,{placeholder:"push origin master",allowEmpty:!1}).openAndGetResult();i!==void 0&&this.plugin.promiseQueue.addTask(async()=>{let n=new Hl.Notice(`Running '${i}'...`,999999);try{let s=await e.rawCommand(i);s?(n.setMessage(s),window.setTimeout(()=>n.hide(),5e3)):n.hide()}catch(s){throw n.hide(),s}})}};m();var Vh=require("obsidian");var Ha=class extends Vh.ItemView{constructor(r,i){super(r);this.plugin=i;this.gettingDiff=!1;this.parser=new DOMParser,this.navigation=!0,this.contentEl.addClass("git-diff"),this.gitRefreshRef=this.app.workspace.on("obsidian-git:status-changed",()=>{this.refresh().catch(console.error)})}getViewType(){return Ds.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();return i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3)),`Diff: ${i}`}return Ds.name}getIcon(){return Ds.icon}async setState(r,i){this.state=r,Vh.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await this.refresh()}getState(){return this.state}onClose(){return this.app.workspace.offref(this.gitRefreshRef),this.app.workspace.offref(this.gitViewRefreshRef),super.onClose()}async onOpen(){return await this.refresh(),super.onOpen()}async refresh(){var r;if((r=this.state)!=null&&r.bFile&&!this.gettingDiff&&this.plugin.gitManager){this.gettingDiff=!0;try{let i=await this.plugin.gitManager.getDiffString(this.state.bFile,this.state.aRef=="HEAD",this.state.bRef);this.contentEl.empty();let n=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);if(!i){if(this.plugin.gitManager instanceof Ce&&await this.plugin.gitManager.isTracked(this.state.bFile))i=[`--- ${this.state.aFile}`,`+++ ${this.state.bFile}`,""].join(` +`);else if(await this.app.vault.adapter.exists(n)){let s=await this.app.vault.adapter.read(n);i=[...`--- /dev/null ++++ ${this.state.bFile} +@@ -0,0 +1,${s.split(` +`).length} @@`.split(` +`),...s.split(` +`).map(o=>`+${o}`)].join(` +`)}}if(i){let s=this.parser.parseFromString(Hh(i),"text/html").querySelector(".d2h-file-diff");this.contentEl.append(s)}else{let s=this.contentEl.createDiv({cls:"obsidian-git-center"});s.createSpan({text:"\u26A0\uFE0F",attr:{style:"font-size: 2em"}}),s.createEl("br"),s.createSpan({text:"File not found: "+this.state.bFile})}}finally{this.gettingDiff=!1}}}};m();var Qn=require("obsidian");var Gl=require("@codemirror/commands");var zh=require("@codemirror/search"),Ul=require("@codemirror/state"),Ci=require("@codemirror/view");var Ua=class extends Qn.ItemView{constructor(r,i){super(r);this.plugin=i;this.refreshing=!1;this.ignoreNextModification=!1;this.navigation=!0,this.registerEvent(this.app.workspace.on("obsidian-git:status-changed",()=>{this.mergeView?this.updateRefEditors().catch(console.error):this.createMergeView().catch(console.error)})),this.intervalRef=window.setInterval(()=>{this.mergeView&&this.updateRefEditors().catch(console.error)},30*1e3),this.registerEvent(this.app.vault.on("modify",n=>{this.state.bRef==null&&n.path===this.state.bFile&&(this.ignoreNextModification?this.ignoreNextModification=!1:this.updateModifiableEditor().catch(console.error))})),this.registerEvent(this.app.vault.on("delete",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("create",n=>{this.state.bRef==null&&n.path===this.state.bFile&&this.createMergeView().catch(console.error)})),this.registerEvent(this.app.vault.on("rename",(n,s)=>{this.state.bRef==null&&(n.path===this.state.bFile||s===this.state.bFile)&&this.createMergeView().catch(console.error)})),this.fileSaveDebouncer=(0,Qn.debounce)(n=>{let s=this.state.bFile;s&&(this.ignoreNextModification=!0,this.plugin.app.vault.adapter.write(this.plugin.gitManager.getRelativeVaultPath(s),n).catch(a=>this.plugin.displayError(a)))},1e3,!1)}getViewType(){return Ms.type}getDisplayText(){var r;if(((r=this.state)==null?void 0:r.bFile)!=null){let i=this.state.bFile.split("/").last();i!=null&&i.endsWith(".md")&&(i=i.slice(0,-3));let n;return this.state.bRef==null?n=" (Working Tree)":this.state.bRef==""?n=" (Index)":n="("+this.state.bRef.substring(0,7)+")",`Diff: ${i} ${n}`}return Ms.name}getIcon(){return Ms.icon}async setState(r,i){this.state=r,Qn.Platform.isMobile&&(this.leaf.view.titleEl.textContent=this.getDisplayText()),await super.setState(r,i),await this.createMergeView()}getState(){return this.state}onClose(){return window.clearInterval(this.intervalRef),super.onClose()}async onOpen(){return await this.createMergeView(),super.onOpen()}async gitShow(r,i){try{return await this.plugin.gitManager.show(r,i,!1)}catch(n){if(n instanceof Br&&(n.message.includes("does not exist")||n.message.includes("unknown revision or path")||n.message.includes("exists on disk, but not in")||n.message.includes("fatal: bad object")))return n.message.includes("fatal: bad object")&&this.plugin.displayError(n.message),"";throw n}}async bShouldBeEditable(){if(this.state.bRef!=null)return!1;let r=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);return await this.app.vault.adapter.exists(r)}async updateModifiableEditor(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.b;this.refreshing=!0;let i=await this.app.vault.adapter.read(this.state.bFile);if(i!=r.state.doc.toString()){let n=r.state.update({changes:{from:0,to:r.state.doc.length,insert:i},annotations:[Ul.Transaction.remote.of(!0)]});r.dispatch(n)}this.refreshing=!1}async updateRefEditors(){if(!this.mergeView||this.refreshing)return;let r=this.mergeView.a,i=this.mergeView.b;this.refreshing=!0;let n=await this.gitShow(this.state.aRef,this.state.aFile),s;if(this.state.bRef!=null&&(s=await this.gitShow(this.state.bRef,this.state.bFile)),n!=r.state.doc.toString()){let a=r.state.update({changes:{from:0,to:r.state.doc.length,insert:n}});r.dispatch(a)}if(s!=null&&s!=i.state.doc.toString()){let a=i.state.update({changes:{from:0,to:i.state.doc.length,insert:s}});i.dispatch(a)}this.refreshing=!1}renderButtons(r){let i=r.createDiv(),n=i.createDiv();if(n.addClass("clickable-icon"),n.setAttr("aria-label",this.state.bRef==null?"Stage hunk":"Unstage hunk"),(0,Qn.setIcon)(n,this.state.bRef==null?"plus":"minus"),n.onmousedown=async s=>{var p;let a=this.mergeView.b,o=this.mergeView.a,l=Ew(a.state),c=(p=i.parentElement)==null?void 0:p.indexOf(i),u=l.chunks[c],f=Aw(u,o.state.doc,a.state.doc),d=kw(this.mergeView.a.state.doc.toString(),this.mergeView.b.state.doc.toString(),[f])[0],h=Wt.createPatch(this.state.bFile,[d],"100644",this.state.bRef!=null).join(` +`)+` +`;await this.plugin.gitManager.applyPatch(h),this.plugin.app.workspace.trigger("obsidian-git:refresh")},this.state.bRef==null){let s=i.createDiv();s.addClass("clickable-icon"),s.setAttr("aria-label","Reset hunk"),(0,Qn.setIcon)(s,"undo"),s.onmousedown=a=>{var d;let o=this.mergeView.a,l=this.mergeView.b,c=Ew(l.state),u=(d=i.parentElement)==null?void 0:d.indexOf(i),f=c.chunks[u];if(f){let h=f.fromA,p=f.toA,g=f.fromB,w=f.toB,y=o.state.sliceDoc(h,Math.max(h,p-1));h!=p&&w<=l.state.doc.length&&(y+=o.state.lineBreak),l.dispatch({changes:{from:g,to:Math.min(l.state.doc.length,w),insert:y},userEvent:"revert"})}}}return i.onmousedown=s=>{s.preventDefault(),s.stopPropagation()},i}async createMergeView(){var r,i,n;if((r=this.state)!=null&&r.aFile&&((i=this.state)!=null&&i.bFile)&&!this.refreshing&&this.plugin.gitManager){this.refreshing=!0,(n=this.mergeView)==null||n.destroy();let s=this.containerEl.children[1];s.empty(),this.contentEl.addClass("git-split-diff-view","git-diff"),this.bIsEditable=await this.bShouldBeEditable();let a=await this.gitShow(this.state.aRef,this.state.aFile),o;if(this.state.bRef!=null)o=await this.gitShow(this.state.bRef,this.state.bFile);else{let g=this.plugin.gitManager.getRelativeVaultPath(this.state.bFile);await this.app.vault.adapter.exists(g)?o=await this.app.vault.adapter.read(g):o=""}let l=[(0,Ci.lineNumbers)(),(0,zh.highlightSelectionMatches)(),(0,Ci.drawSelection)(),Ci.keymap.of([...Gl.standardKeymap,Gl.indentWithTab]),(0,Gl.history)(),(0,zh.search)(),Ci.EditorView.lineWrapping],c=this,u=Ci.ViewPlugin.define(g=>({update(w){if(w.docChanged&&!w.transactions.some(y=>y.annotation(Ul.Transaction.remote))){let y=g.state.doc.toString();c.fileSaveDebouncer(y)}}})),f={doc:a,extensions:[...l,Ci.EditorView.editable.of(!1),Ul.EditorState.readOnly.of(!0)]},d=[...l];this.bIsEditable?d.push(u):d.push(Ci.EditorView.editable.of(!1),Ul.EditorState.readOnly.of(!0));let h={doc:o,extensions:d};s.addClasses(["cm-s-obsidian","mod-cm6","markdown-source-view","cm-content"]);let p=this.plugin.gitManager instanceof Ce&&(this.state.bRef===void 0||this.state.bRef==="");this.mergeView=new Rh({b:h,a:f,collapseUnchanged:{minSize:6,margin:4},renderRevertControl:p?()=>this.renderButtons(s):void 0,revertControls:p?"a-to-b":void 0,diffConfig:{scanLimit:this.bIsEditable?1e3:1e4},parent:s}),this.refreshing=!1}}};m();var rF=require("obsidian");m();m();m();var hR,pR,mR;typeof window!="undefined"&&((mR=(pR=(hR=window.__svelte)!=null?hR:window.__svelte={}).v)!=null?mR:pR.v=new Set).add("5");m();m();m();var Jn={};var qe=Symbol("uninitialized"),Ti=Symbol("filename");var Wh="http://www.w3.org/1999/xhtml";m();m();m();m();var qh=!0;m();var L=!1;m();var es=Array.isArray,gR=Array.prototype.indexOf,zs=Array.prototype.includes,jl=Array.from,Yw=Object.keys,cr=Object.defineProperty,jr=Object.getOwnPropertyDescriptor,Zw=Object.getOwnPropertyDescriptors,Kw=Object.prototype,vR=Array.prototype,Vl=Object.getPrototypeOf,Xw=Object.isExtensible;function Qw(t){return typeof t=="function"}var ur=()=>{};function Yh(t){for(var e=0;e{t=i,e=n});return{promise:r,resolve:t,reject:e}}m();m();var er=Symbol("$state"),zu=Symbol("legacy props"),bR=Symbol(""),Kh=Symbol("proxy path"),Xh=Symbol("attributes"),Wu=Symbol("class"),Jw=Symbol("style"),qu=Symbol("text"),Ga=Symbol("form reset"),e0=Symbol("hmr anchor"),Ws=new class extends Error{constructor(){super(...arguments);He(this,"name","StaleReactionError");He(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},wR,t0=!!((wR=globalThis.document)!=null&&wR.contentType)&&globalThis.document.contentType.includes("xml");var zl=3,Pi=8;m();m();function _R(t){if(L){let e=new Error(`invariant_violation +An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app \u2014 please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${t}" +https://svelte.dev/e/invariant_violation`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/invariant_violation")}function Qh(t){if(L){let e=new Error(`lifecycle_outside_component +\`${t}(...)\` can only be used during component initialisation +https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function xR(){if(L){let t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function r0(){if(L){let t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function ER(){if(L){let t=new Error(`derived_references_self +A derived value cannot reference itself recursively +https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function i0(t,e,r){if(L){let i=new Error(`each_key_duplicate +${r?`Keyed each block has duplicate key \`${r}\` at indexes ${t} and ${e}`:`Keyed each block has duplicate key at indexes ${t} and ${e}`} +https://svelte.dev/e/each_key_duplicate`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_duplicate")}function SR(t,e,r){if(L){let i=new Error(`each_key_volatile +Keyed each block has key that is not idempotent \u2014 the key for item at index ${t} was \`${e}\` but is now \`${r}\`. Keys must be the same each time for a given item +https://svelte.dev/e/each_key_volatile`);throw i.name="Svelte error",i}else throw new Error("https://svelte.dev/e/each_key_volatile")}function kR(t){if(L){let e=new Error(`effect_in_teardown +\`${t}\` cannot be used inside an effect cleanup function +https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function AR(){if(L){let t=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function CR(t){if(L){let e=new Error(`effect_orphan +\`${t}\` can only be used inside an effect (e.g. during component initialisation) +https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function TR(){if(L){let t=new Error(`effect_update_depth_exceeded +Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state +https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function PR(){if(L){let t=new Error(`hydration_failed +Failed to hydrate the application +https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function RR(t){if(L){let e=new Error(`props_invalid_value +Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value +https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function $R(t){if(L){let e=new Error(`rune_outside_svelte +The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files +https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function FR(){if(L){let t=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function IR(){if(L){let t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function MR(){if(L){let t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function DR(){if(L){let t=new Error("svelte_boundary_reset_onerror\nA `` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}m();m();m();var Sn="font-weight: bold",kn="font-weight: normal";function OR(t){L?console.warn(`%c[svelte] await_reactivity_loss +%cDetected reactivity loss when reading \`${t}\`. This happens when state is read in an async function after an earlier \`await\` +https://svelte.dev/e/await_reactivity_loss`,Sn,kn):console.warn("https://svelte.dev/e/await_reactivity_loss")}function LR(t,e){L?console.warn(`%c[svelte] await_waterfall +%cAn async derived, \`${t}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app +https://svelte.dev/e/await_waterfall`,Sn,kn):console.warn("https://svelte.dev/e/await_waterfall")}function NR(){L?console.warn(`%c[svelte] derived_inert +%cReading a derived belonging to a now-destroyed effect may result in stale values +https://svelte.dev/e/derived_inert`,Sn,kn):console.warn("https://svelte.dev/e/derived_inert")}function BR(t,e,r){L?console.warn(`%c[svelte] hydration_attribute_changed +%cThe \`${t}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value +https://svelte.dev/e/hydration_attribute_changed`,Sn,kn):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function ja(t){L?console.warn(`%c[svelte] hydration_mismatch +%c${t?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${t}`:"Hydration failed because the initial UI does not match what was rendered on the server"} +https://svelte.dev/e/hydration_mismatch`,Sn,kn):console.warn("https://svelte.dev/e/hydration_mismatch")}function HR(){L?console.warn(`%c[svelte] lifecycle_double_unmount +%cTried to unmount a component that was not mounted +https://svelte.dev/e/lifecycle_double_unmount`,Sn,kn):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Jh(t){L?console.warn(`%c[svelte] state_proxy_equality_mismatch +%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results +https://svelte.dev/e/state_proxy_equality_mismatch`,Sn,kn):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function UR(){L?console.warn(`%c[svelte] state_proxy_unmount +%cTried to unmount a state proxy, rather than a component +https://svelte.dev/e/state_proxy_unmount`,Sn,kn):console.warn("https://svelte.dev/e/state_proxy_unmount")}function GR(){L?console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",Sn,kn):console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function jR(t){L?console.warn(`%c[svelte] transition_slide_display +%cThe \`slide\` transition does not work correctly for elements with \`display: ${t}\` +https://svelte.dev/e/transition_slide_display`,Sn,kn):console.warn("https://svelte.dev/e/transition_slide_display")}var ae=!1;function It(t){ae=t}var be;function je(t){if(t===null)throw ja(),Jn;return be=t}function fr(){return je(rr(be))}function V(t){if(ae){if(rr(be)!==null)throw ja(),Jn;be=t}}function Va(t=1){if(ae){for(var e=t,r=be;e--;)r=rr(r);be=r}}function An(t=!0){for(var e=0,r=be;;){if(r.nodeType===Pi){var i=r.data;if(i==="]"){if(e===0)return r;e-=1}else(i==="["||i==="[!"||i[0]==="["&&!isNaN(Number(i.slice(1))))&&(e+=1)}var n=rr(r);t&&r.remove(),r=n}}function Zu(t){if(!t||t.nodeType!==Pi)throw ja(),Jn;return t.data}m();m();m();m();function ep(t){return t===this.v}function n0(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function tp(t){return!n0(t,this.v)}m();var Ct=!1,ts=!1,qi=!1;m();m();m();var Ku=null;function dr(t,e){return t.label=e,ip(t.v,e),t}function ip(t,e){var r;return(r=t==null?void 0:t[Kh])==null||r.call(t,e),t}m();function Yi(t){let e=new Error,r=h4();return r.length===0?null:(r.unshift(` +`),cr(e,"stack",{value:r.join(` +`)}),cr(e,"name",{value:t}),e)}function h4(){let t=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let e=new Error().stack;if(Error.stackTraceLimit=t,!e)return[];let r=e.split(` +`),i=[];for(let n=0;n{e===za&&WR()})}za.push(t)}function qR(){for(;za.length>0;)WR()}m();var a0=new WeakMap;function sp(t){var e=ee;if(e===null)return le.f|=8388608,t;if(L&&t instanceof Error&&!a0.has(t)&&a0.set(t,p4(t,e)),(e.f&32768)===0&&(e.f&4)===0)throw L&&!e.parent&&t instanceof Error&&YR(t),t;Xi(t,e)}function Xi(t,e){if(!(e!==null&&(e.f&16384)!==0)){for(;e!==null;){if((e.f&128)!==0){if((e.f&32768)===0)throw t;try{e.b.error(t);return}catch(r){t=r}}e=e.parent}throw L&&t instanceof Error&&YR(t),t}}function p4(t,e){var a,o,l;let r=jr(t,"message");if(!(r&&!r.configurable)){for(var i=Qu?" ":" ",n=` +${i}in ${((a=e.fn)==null?void 0:a.name)||""}`,s=e.ctx;s!==null;)n+=` +${i}in ${(o=s.function)==null?void 0:o[Ti].split("/").pop()}`,s=s.p;return{message:t.message+` +${n} +`,stack:(l=t.stack)==null?void 0:l.split(` +`).filter(c=>!c.includes("svelte/src/internal")).join(` +`)}}}function YR(t){let e=a0.get(t);e&&(cr(t,"message",{value:e.message}),cr(t,"stack",{value:e.stack}))}m();m();var m4=-7169;function Ve(t,e){t.f=t.f&m4|e}function Zl(t){(t.f&512)!==0||t.deps===null?Ve(t,1024):Ve(t,4096)}function ZR(t){if(t!==null)for(let e of t)(e.f&2)===0||(e.f&65536)===0||(e.f^=65536,ZR(e.deps))}function ap(t,e,r){(t.f&2048)!==0?e.add(t):(t.f&4096)!==0&&r.add(t),ZR(t.deps),Ve(t,1024)}m();m();m();var KR=!1,op=!1;function o0(t){var e=op;try{return op=!1,[t(),op]}finally{op=e}}m();m();m();m();m();function XR(t){let e=0,r=pr(0),i;return L&&dr(r,"createSubscriber version"),()=>{qs()&&(I(r),ar(()=>(e===0&&(i=Ye(()=>t(()=>Za(r)))),e+=1,()=>{Mt(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Za(r))})})))}}var v4=589824;function d0(t,e,r,i){new l0(t,e,r,i)}var ii,Ju,Fi,Ka,Vr,Ii,kr,ni,ns,Xa,Ys,Xl,ef,tf,Pn,up,it,JR,e$,t$,c0,lp,cp,u0,f0,l0=class{constructor(e,r,i,n){ge(this,it);He(this,"parent");He(this,"is_pending",!1);He(this,"transform_error");ge(this,ii);ge(this,Ju,ae?be:null);ge(this,Fi);ge(this,Ka);ge(this,Vr);ge(this,Ii,null);ge(this,kr,null);ge(this,ni,null);ge(this,ns,null);ge(this,Xa,0);ge(this,Ys,0);ge(this,Xl,!1);ge(this,ef,new Set);ge(this,tf,new Set);ge(this,Pn,null);ge(this,up,XR(()=>(pe(this,Pn,pr(F(this,Xa))),L&&dr(F(this,Pn),"$effect.pending()"),()=>{pe(this,Pn,null)})));var s,a;pe(this,ii,e),pe(this,Fi,r),pe(this,Ka,o=>{var l=ee;l.b=this,l.f|=128,i(o)}),this.parent=ee.b,this.transform_error=(a=n!=null?n:(s=this.parent)==null?void 0:s.transform_error)!=null?a:(o=>o),pe(this,Vr,ai(()=>{if(ae){let o=F(this,Ju);fr();let l=o.data==="[!";if(o.data.startsWith("[?")){let u=JSON.parse(o.data.slice("[?".length));Ae(this,it,e$).call(this,u)}else l?Ae(this,it,t$).call(this):Ae(this,it,JR).call(this)}else Ae(this,it,c0).call(this)},v4)),ae&&pe(this,ii,be)}defer_effect(e){ap(e,F(this,ef),F(this,tf))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!F(this,Fi).pending}update_pending_count(e,r){Ae(this,it,u0).call(this,e,r),pe(this,Xa,F(this,Xa)+e),!(!F(this,Pn)||F(this,Xl))&&(pe(this,Xl,!0),Mt(()=>{pe(this,Xl,!1),F(this,Pn)&&Qi(F(this,Pn),F(this,Xa))}))}get_effect_pending(){return F(this,up).call(this),I(F(this,Pn))}error(e){var r;if(!F(this,Fi).onerror&&!F(this,Fi).failed)throw e;(r=ce)!=null&&r.is_fork?(F(this,Ii)&&ce.skip_effect(F(this,Ii)),F(this,kr)&&ce.skip_effect(F(this,kr)),F(this,ni)&&ce.skip_effect(F(this,ni)),ce.oncommit(()=>{Ae(this,it,f0).call(this,e)})):Ae(this,it,f0).call(this,e)}};ii=new WeakMap,Ju=new WeakMap,Fi=new WeakMap,Ka=new WeakMap,Vr=new WeakMap,Ii=new WeakMap,kr=new WeakMap,ni=new WeakMap,ns=new WeakMap,Xa=new WeakMap,Ys=new WeakMap,Xl=new WeakMap,ef=new WeakMap,tf=new WeakMap,Pn=new WeakMap,up=new WeakMap,it=new WeakSet,JR=function(){try{pe(this,Ii,Ot(()=>F(this,Ka).call(this,F(this,ii))))}catch(e){this.error(e)}},e$=function(e){let r=F(this,Fi).failed;r&&pe(this,ni,Ot(()=>{r(F(this,ii),()=>e,()=>()=>{})}))},t$=function(){let e=F(this,Fi).pending;e&&(this.is_pending=!0,pe(this,kr,Ot(()=>e(F(this,ii)))),Mt(()=>{var r=pe(this,ns,document.createDocumentFragment()),i=Bt();r.append(i),pe(this,Ii,Ae(this,it,cp).call(this,()=>Ot(()=>F(this,Ka).call(this,i)))),F(this,Ys)===0&&(F(this,ii).before(r),pe(this,ns,null),Rn(F(this,kr),()=>{pe(this,kr,null)}),Ae(this,it,lp).call(this,ce))}))},c0=function(){try{if(this.is_pending=this.has_pending_snippet(),pe(this,Ys,0),pe(this,Xa,0),pe(this,Ii,Ot(()=>{F(this,Ka).call(this,F(this,ii))})),F(this,Ys)>0){var e=pe(this,ns,document.createDocumentFragment());Ql(F(this,Ii),e);let r=F(this,Fi).pending;pe(this,kr,Ot(()=>r(F(this,ii))))}else Ae(this,it,lp).call(this,ce)}catch(r){this.error(r)}},lp=function(e){this.is_pending=!1,e.transfer_effects(F(this,ef),F(this,tf))},cp=function(e){var r=ee,i=le,n=Ee;Nt(F(this,Vr)),Lt(F(this,Vr)),rs(F(this,Vr).ctx);try{return si.ensure(),e()}catch(s){return sp(s),null}finally{Nt(r),Lt(i),rs(n)}},u0=function(e,r){var i;if(!this.has_pending_snippet()){this.parent&&Ae(i=this.parent,it,u0).call(i,e,r);return}pe(this,Ys,F(this,Ys)+e),F(this,Ys)===0&&(Ae(this,it,lp).call(this,r),F(this,kr)&&Rn(F(this,kr),()=>{pe(this,kr,null)}),F(this,ns)&&(F(this,ii).before(F(this,ns)),pe(this,ns,null)))},f0=function(e){F(this,Ii)&&(vt(F(this,Ii)),pe(this,Ii,null)),F(this,kr)&&(vt(F(this,kr)),pe(this,kr,null)),F(this,ni)&&(vt(F(this,ni)),pe(this,ni,null)),ae&&(je(F(this,Ju)),Va(),je(An()));var r=F(this,Fi).onerror;let i=F(this,Fi).failed;var n=!1,s=!1;let a=()=>{if(n){GR();return}n=!0,s&&DR(),F(this,ni)!==null&&Rn(F(this,ni),()=>{pe(this,ni,null)}),Ae(this,it,cp).call(this,()=>{Ae(this,it,c0).call(this)})},o=l=>{try{s=!0,r==null||r(l,a),s=!1}catch(c){Xi(c,F(this,Vr)&&F(this,Vr).parent)}i&&pe(this,ni,Ae(this,it,cp).call(this,()=>{try{return Ot(()=>{var c=ee;c.b=this,c.f|=128,i(F(this,ii),()=>l,()=>a)})}catch(c){return Xi(c,F(this,Vr).parent),null}}))};Mt(()=>{var l;try{l=this.transform_error(e)}catch(c){Xi(c,F(this,Vr)&&F(this,Vr).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,c=>Xi(c,F(this,Vr)&&F(this,Vr).parent)):o(l)})};function fp(t,e,r,i){let n=Tn()?Zs:Qa;var s=t.filter(h=>!h.settled),a=e.map(n);if(L&&a.forEach((h,p)=>{h.label=e[p].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(g,w)=>w)}),r.length===0&&s.length===0){i(a);return}var o=ee,l=r$(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(h=>h.promise)):null;function u(h){if((o.f&16384)===0){l();try{i([...a,...h])}catch(p){Xi(p,o)}Jl()}}var f=h0();if(r.length===0){c.then(()=>u([])).finally(f);return}function d(){Promise.all(r.map(h=>m0(h))).then(u).catch(h=>Xi(h,o)).finally(f)}c?c.then(()=>{l(),d(),Jl()}):d()}function r$(){var t=ee,e=le,r=Ee,i=ce;if(L)var n=Cn;return function(a=!0){Nt(t),Lt(e),rs(r),a&&(t.f&16384)===0&&(i==null||i.activate(),i==null||i.apply()),L&&(p0(null),Yl(n))}}function Jl(t=!0){var e;Nt(null),Lt(null),rs(null),t&&((e=ce)==null||e.deactivate()),L&&(p0(null),Yl(null))}function h0(){var t=ee,e=t.b,r=ce,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,r),r.increment(i,t),()=>{e==null||e.update_pending_count(-1,r),r.decrement(i,t)}}var Wr=null;function p0(t){Wr=t}var rf=new Set;function Zs(t){var e=2050;ee!==null&&(ee.f|=524288);let r={ctx:Ee,deps:null,effects:null,equals:ep,f:e,fn:t,reactions:null,rv:0,v:qe,wv:0,parent:ee,ac:null};return L&&qi&&(r.created=Yi("created at")),r}var ec=Symbol("obsolete");function m0(t,e,r){let i=ee;i===null&&xR();var n=void 0,s=pr(qe);L&&(s.label=e!=null?e:t.toString());var a=!le,o=new Set;return s$(()=>{var h,p;var l=ee;L&&(Wr={effect:l,effect_deps:new Set,warned:!1});var c=Zh();n=c.promise;try{Promise.resolve(t()).then(c.resolve,g=>{g!==Ws&&c.reject(g)}).finally(Jl)}catch(g){c.reject(g),Jl()}if(L){if(Wr){if(l.deps!==null)for(let g=0;g{L&&(Wr=null),f==null||f(),o.delete(c),w!==ec&&(u.activate(),w?(s.f|=8388608,Qi(s,w)):((s.f&8388608)!==0&&(s.f^=8388608),L&&r!==void 0&&!s.equals(g)&&(rf.add(s),setTimeout(()=>{rf.has(s)&&(l.f&16384)===0&&(LR(s.label,r),rf.delete(s))})),Qi(s,g)),u.deactivate())};c.promise.then(d,g=>d(null,g||"unknown"))}),nr(()=>{for(let l of o)l.reject(ec)}),L&&(s.f|=4194304),new Promise(l=>{function c(u){function f(){u===n?l(s):c(n)}u.then(f,f)}c(n)})}function ft(t){let e=Zs(t);return Ct||pp(e),e}function Qa(t){let e=Zs(t);return e.equals=tp,e}function i$(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;rthis.schedule(i)){var i=F(this,Fn).get(e);if(i){F(this,Fn).delete(e);for(var n of i.d)Ve(n,2048),r(n);for(n of i.m)Ve(n,4096),r(n)}F(this,cc).add(e)}capture(e,r,i=!1){e.v!==qe&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&8388608)===0&&(this.current.set(e,[r,i]),Tt==null||Tt.set(e,r)),this.is_fork||(e.v=r)}activate(){ce=this}deactivate(){ce=null,Tt=null}flush(){try{L&&_0.clear(),b0=!0,ce=this,Ae(this,Be,af).call(this)}finally{if(a$=0,y0=null,to=null,lf=null,b0=!1,ce=null,Tt=null,fs.clear(),L)for(let e of _0)e.updated=null}}discard(){var e;for(let r of F(this,ac))r(this);F(this,ac).clear();for(let r of this.async_deriveds.values())r.reject(ec);Ae(this,Be,of).call(this),(e=F(this,lc))==null||e.resolve()}register_created_effect(e){F(this,cf).push(e)}increment(e,r){var i;if(pe(this,oc,F(this,oc)+1),e){let n=(i=F(this,cs).get(r))!=null?i:0;F(this,cs).set(r,n+1)}}decrement(e,r){var i;if(pe(this,oc,F(this,oc)-1),e){let n=(i=F(this,cs).get(r))!=null?i:0;n===1?F(this,cs).delete(r):F(this,cs).set(r,n-1)}F(this,Ks)||(pe(this,Ks,!0),Mt(()=>{pe(this,Ks,!1),this.linked&&this.flush()}))}transfer_effects(e,r){for(let i of e)F(this,us).add(i);for(let i of r)F(this,Ji).add(i);e.clear(),r.clear()}oncommit(e){F(this,sc).add(e)}ondiscard(e){F(this,ac).add(e)}settled(){var e;return((e=F(this,lc))!=null?e:pe(this,lc,Zh())).promise}static ensure(){if(ce===null){let e=ce=new gp;!b0&&!Wa&&Mt(()=>{F(e,nc)||e.flush()})}return ce}apply(){if(!Ct||!this.is_fork&&F(this,os)===null&&F(this,ls)===null){Tt=null;return}Tt=new Map;for(let[r,[i]]of this.current)Tt.set(r,i);for(let r=mp;r!==null;r=F(r,ls))if(!(r===this||r.is_fork)){var e=!1;if(r.id1e3&&(Ae(this,Be,of).call(this),y4()),L)for(let d of this.current.keys())_0.add(d);for(let d of F(this,us))F(this,Ji).delete(d),Ve(d,2048),this.schedule(d);for(let d of F(this,Ji))Ve(d,4096),this.schedule(d);let e=F(this,Cr);pe(this,Cr,[]),this.apply();var r=to=[],i=[],n=lf=[];for(let d of e)try{Ae(this,Be,E0).call(this,d,r,i)}catch(h){throw h$(d),Ae(this,Be,x0).call(this)||this.discard(),h}if(ce=null,n.length>0){var s=gp.ensure();for(let d of n)s.schedule(d)}if(to=null,lf=null,Ae(this,Be,x0).call(this)){Ae(this,Be,ic).call(this,i),Ae(this,Be,ic).call(this,r);for(let[d,h]of F(this,Fn))d$(d,h);n.length>0&&Ae(l=ce,Be,af).call(l);return}let a=Ae(this,Be,l$).call(this);if(a){Ae(this,Be,ic).call(this,i),Ae(this,Be,ic).call(this,r),Ae(c=a,Be,c$).call(c,this);return}F(this,us).clear(),F(this,Ji).clear();for(let d of F(this,sc))d(this);F(this,sc).clear(),as=this,o$(i),o$(r),as=null,(u=F(this,lc))==null||u.resolve();var o=ce;if(F(this,oc)===0&&(F(this,Cr).length===0||o!==null)&&(Ae(this,Be,of).call(this),Ct&&(Ae(this,Be,u$).call(this),ce=o)),F(this,Cr).length>0)if(o!==null){let d=o;F(d,Cr).push(...F(this,Cr).filter(h=>!F(d,Cr).includes(h)))}else o=this;o!==null&&Ae(f=o,Be,af).call(f)},E0=function(e,r,i){e.f^=1024;for(var n=e.first;n!==null;){var s=n.f,a=(s&96)!==0,o=a&&(s&1024)!==0,l=o||(s&8192)!==0||F(this,Fn).has(n);if(!l&&n.fn!==null){a?n.f^=1024:(s&4)!==0?r.push(n):Ct&&(s&16777224)!==0?i.push(n):Xs(n)&&((s&16)!==0&&F(this,Ji).add(n),$n(n));var c=n.first;if(c!==null){n=c;continue}}for(;n!==null;){var u=n.next;if(u!==null){n=u;break}n=n.parent}}},l$=function(){for(var e=F(this,os);e!==null;){if(!e.is_fork){for(let[r,[,i]]of this.current)if(e.current.has(r)&&!i)return e}e=F(e,os)}return null},c$=function(e){var i;for(let[n,s]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,s);for(let[n,s]of e.async_deriveds){let a=this.async_deriveds.get(n);a&&s.promise.then(a.resolve).catch(a.reject)}e.async_deriveds.clear(),this.transfer_effects(F(e,us),F(e,Ji));let r=n=>{var s=n.reactions;if(s!==null)for(let l of s){var a=l.f;if((a&2)!==0)r(l);else{var o=l;a&4194320&&!this.async_deriveds.has(o)&&(F(this,Ji).delete(o),Ve(o,2048),this.schedule(o))}}};for(let n of this.current.keys())r(n);this.oncommit(()=>e.discard()),Ae(i=e,Be,of).call(i),ce=this,Ae(this,Be,af).call(this)},ic=function(e){for(var r=0;r!d.current.get(h)[1]);if(!(!F(d,nc)||n.length===0)){var s=n.filter(h=>!this.current.has(h));if(s.length===0)e&&d.discard();else if(r.length>0){if(L&&!F(d,Ks)&&zR(F(d,Cr).length===0,"Batch has scheduled roots"),e)for(let h of F(this,cc))d.unskip_effect(h,p=>{var g;(p.f&4194320)!==0?d.schedule(p):Ae(g=d,Be,ic).call(g,[p])});d.activate();var a=new Set,o=new Map;for(var l of r)f$(l,s,a,o);o=new Map;var c=[...d.current].filter(([h,p])=>{let g=this.current.get(h);return g?g[0]!==p[0]||g[1]!==p[1]:!0}).map(([h])=>h);if(c.length>0)for(let h of F(this,cf))(h.f&155648)===0&&S0(h,c,o)&&((h.f&4194320)!==0?(Ve(h,2048),d.schedule(h)):F(d,us).add(h));if(F(d,Cr).length>0&&!F(d,Ks)){d.apply();for(var u of F(d,Cr))Ae(f=d,Be,E0).call(f,u,[],[]);pe(d,Cr,[])}d.deactivate()}}}},of=function(){if(this.linked){var e=F(this,os),r=F(this,ls);e===null?mp=r:pe(e,ls,r),r===null?rc=e:pe(r,os,e),this.linked=!1}};var si=gp;function io(t){var e=Wa;Wa=!0;try{var r;for(t&&(ce!==null&&!ce.is_fork&&ce.flush(),r=t());;){if(qR(),ce===null)return r;ce.flush()}}finally{Wa=e}}function y4(){var r;if(L){var t=new Map;for(let i of ce.current.keys())for(let[n,s]of(r=i.updated)!=null?r:[]){var e=t.get(n);e||(e={error:s.error,count:0},t.set(n,e)),e.count+=s.count}for(let i of t.values())i.error&&console.error(i.error)}try{TR()}catch(i){L&&cr(i,"stack",{value:""}),Xi(i,y0)}}var qr=null;function o$(t){var e=t.length;if(e!==0){for(var r=0;r0)){fs.clear();for(let n of qr){if((n.f&24576)!==0)continue;let s=[n],a=n.parent;for(;a!==null;)qr.has(a)&&(qr.delete(a),s.push(a)),a=a.parent;for(let o=s.length-1;o>=0;o--){let l=s[o];(l.f&24576)===0&&$n(l)}}qr.clear()}}qr=null}}function f$(t,e,r,i){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(let n of t.reactions){let s=n.f;(s&2)!==0?f$(n,e,r,i):(s&4194320)!==0&&(s&2048)===0&&S0(n,e,i)&&(Ve(n,2048),ff(n))}}function S0(t,e,r){let i=r.get(t);if(i!==void 0)return i;if(t.deps!==null)for(let n of t.deps){if(zs.call(e,n))return!0;if((n.f&2)!==0&&S0(n,e,r))return r.set(n,!0),!0}return r.set(t,!1),!1}function ff(t){ce.schedule(t)}function d$(t,e){if(!((t.f&32)!==0&&(t.f&1024)!==0)){(t.f&2048)!==0?e.d.push(t):(t.f&4096)!==0&&e.m.push(t),Ve(t,1024);for(var r=t.first;r!==null;)d$(r,e),r=r.next}}function h$(t){Ve(t,1024);for(var e=t.first;e!==null;)h$(e),e=e.next}var Ja=new Set,fs=new Map;function dp(t){Ja=t}var A0=!1;function m$(){A0=!0}function pr(t,e){var r={f:0,v:t,reactions:null,equals:ep,rv:0,wv:0};return L&&qi&&(r.created=e!=null?e:Yi("created at"),r.updated=null,r.set_during_effect=!1,r.trace=null),r}function Ne(t,e){let r=pr(t,e);return pp(r),r}function qa(t,e=!1,r=!0){var n,s;let i=pr(t);return e||(i.equals=tp),ts&&r&&Ee!==null&&Ee.l!==null&&((s=(n=Ee.l).s)!=null?s:n.s=[]).push(i),i}function oe(t,e,r=!1){le!==null&&(!Tr||(le.f&131072)!==0)&&Tn()&&(le.f&4325394)!==0&&(li===null||!li.has(t))&&MR();let i=r?Je(e):e;return L&&ip(i,t.label),Qi(t,i,lf)}function Qi(t,e,r=null){var n,s,a;if(!t.equals(e)){fs.set(t,oi?e:t.v);var i=si.ensure();if(i.capture(t,e),L){if(qi||ee!==null){(n=t.updated)!=null||(t.updated=new Map);let o=((a=(s=t.updated.get(""))==null?void 0:s.count)!=null?a:0)+1;if(t.updated.set("",{error:null,count:o}),qi||o>5){let l=Yi("updated at");if(l!==null){let c=t.updated.get(l.stack);c||(c={error:l,count:0},t.updated.set(l.stack,c)),c.count++}}}ee!==null&&(t.set_during_effect=!0)}if((t.f&2)!==0){let o=t;(t.f&2048)!==0&&nf(o),Tt===null&&Zl(o)}t.wv=tc(),g$(t,2048,r),Tn()&&ee!==null&&(ee.f&1024)!==0&&(ee.f&96)===0&&(ci===null?v$([t]):ci.push(t)),!i.is_fork&&Ja.size>0&&!A0&&vp()}return e}function vp(){A0=!1;for(let t of Ja){(t.f&1024)!==0&&Ve(t,4096);let e;try{e=Xs(t)}catch(r){e=!0}e&&$n(t)}Ja.clear()}function Za(t){oe(t,t.v+1)}function g$(t,e,r){var d;var i=t.reactions;if(i!==null)for(var n=Tn(),s=i.length,a=0;a{if(Qs===a)return f();var d=le,h=Qs;Lt(null),C0(a);var p=f();return Lt(d),C0(h),p};i&&(r.set("length",Ne(t.length,s)),L&&(t=k4(t)));var l="";let c=!1;function u(f){if(!c){c=!0,l=f,dr(n,`${l} version`);for(let[d,h]of r)dr(h,no(l,d));c=!1}}return new Proxy(t,{defineProperty(f,d,h){(!("value"in h)||h.configurable===!1||h.enumerable===!1||h.writable===!1)&&FR();var p=r.get(d);return p===void 0?o(()=>{var g=Ne(h.value,s);return r.set(d,g),L&&typeof d=="string"&&dr(g,no(l,d)),g}):oe(p,h.value,!0),!0},deleteProperty(f,d){var h=r.get(d);if(h===void 0){if(d in f){let p=o(()=>Ne(qe,s));r.set(d,p),Za(n),L&&dr(p,no(l,d))}}else oe(h,qe),Za(n);return!0},get(f,d,h){var y;if(d===er)return t;if(L&&d===Kh)return u;var p=r.get(d),g=d in f;if(p===void 0&&(!g||(y=jr(f,d))!=null&&y.writable)&&(p=o(()=>{var b=Je(g?f[d]:qe),S=Ne(b,s);return L&&dr(S,no(l,d)),S}),r.set(d,p)),p!==void 0){var w=I(p);return w===qe?void 0:w}return Reflect.get(f,d,h)},getOwnPropertyDescriptor(f,d){var h=Reflect.getOwnPropertyDescriptor(f,d);if(h&&"value"in h){var p=r.get(d);p&&(h.value=I(p))}else if(h===void 0){var g=r.get(d),w=g==null?void 0:g.v;if(g!==void 0&&w!==qe)return{enumerable:!0,configurable:!0,value:w,writable:!0}}return h},has(f,d){var w;if(d===er)return!0;var h=r.get(d),p=h!==void 0&&h.v!==qe||Reflect.has(f,d);if(h!==void 0||ee!==null&&(!p||(w=jr(f,d))!=null&&w.writable)){h===void 0&&(h=o(()=>{var y=p?Je(f[d]):qe,b=Ne(y,s);return L&&dr(b,no(l,d)),b}),r.set(d,h));var g=I(h);if(g===qe)return!1}return p},set(f,d,h,p){var v;var g=r.get(d),w=d in f;if(i&&d==="length")for(var y=h;yNe(qe,s)),r.set(y+"",b),L&&dr(b,no(l,y)))}if(g===void 0)(!w||(v=jr(f,d))!=null&&v.writable)&&(g=o(()=>Ne(void 0,s)),L&&dr(g,no(l,d)),oe(g,Je(h)),r.set(d,g));else{w=g.v!==qe;var S=o(()=>Je(h));oe(g,S)}var C=Reflect.getOwnPropertyDescriptor(f,d);if(C!=null&&C.set&&C.set.call(p,h),!w){if(i&&typeof d=="string"){var A=r.get("length"),k=Number(d);Number.isInteger(k)&&k>=A.v&&oe(A,k+1)}Za(n)}return!0},ownKeys(f){I(n);var d=Reflect.ownKeys(f).filter(g=>{var w=r.get(g);return w===void 0||w.v!==qe});for(var[h,p]of r)p.v!==qe&&!(h in f)&&d.push(h);return d},setPrototypeOf(){IR()}})}function no(t,e){var r;return typeof e=="symbol"?`${t}[Symbol(${(r=e.description)!=null?r:""})]`:E4.test(e)?`${t}.${e}`:/^\d+$/.test(e)?`${t}[${e}]`:`${t}['${e}']`}function wp(t){try{if(t!==null&&typeof t=="object"&&er in t)return t[er]}catch(e){}return t}var S4=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function k4(t){return new Proxy(t,{get(e,r,i){var n=Reflect.get(e,r,i);return S4.has(r)?function(...s){m$();var a=n.apply(this,s);return vp(),a}:n}})}function w$(){let t=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:r,lastIndexOf:i,includes:n}=t;t.indexOf=function(s,a){let o=r.call(this,s,a);if(o===-1){for(let l=a!=null?a:0;l{t.indexOf=r,t.lastIndexOf=i,t.includes=n}}var T0,b$,Qu,_$,y$;function bp(){if(T0===void 0){T0=window,b$=document,Qu=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;_$=jr(e,"firstChild").get,y$=jr(e,"nextSibling").get,Xw(t)&&(t[Wu]=void 0,t[Xh]=null,t[Jw]=void 0,t.__e=void 0),Xw(r)&&(r[qu]=void 0),L&&(t.__svelte_meta=null,w$())}}function Bt(t=""){return document.createTextNode(t)}function or(t){return _$.call(t)}function rr(t){return y$.call(t)}function W(t,e){if(!ae)return or(t);var r=or(be);if(r===null)r=be.appendChild(Bt());else if(e&&r.nodeType!==zl){var i=Bt();return r==null||r.before(i),je(i),i}return e&&yp(r),je(r),r}function Mi(t,e=!1){var n,s;if(!ae){var r=or(t);return r instanceof Comment&&r.data===""?rr(r):r}if(e){if(((n=be)==null?void 0:n.nodeType)!==zl){var i=Bt();return(s=be)==null||s.before(i),je(i),i}yp(be)}return be}function ne(t,e=1,r=!1){let i=ae?be:t;for(var n;e--;)n=i,i=rr(i);if(!ae)return i;if(r){if((i==null?void 0:i.nodeType)!==zl){var s=Bt();return i===null?n==null||n.after(s):i.before(s),je(s),s}yp(i)}return je(i),i}function fc(t){t.textContent=""}function _p(){if(!Ct||qr!==null)return!1;var t=ee.f;return(t&32768)!==0}function In(t,e,r){return e==null||e===Wh?r?document.createElement(t,{is:r}):document.createElement(t):r?document.createElementNS(e,t,{is:r}):document.createElementNS(e,t)}function yp(t){if(t.nodeValue.length<65536)return;let e=t.nextSibling;for(;e!==null&&e.nodeType===zl;)e.remove(),t.nodeValue+=e.nodeValue,e=t.nextSibling}m();m();function P0(t){ae&&or(t)!==null&&fc(t)}var x$=!1;function R0(){x$||(x$=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(let r of t.target.elements)(e=r[Ga])==null||e.call(r)})},{capture:!0}))}function en(t){var e=le,r=ee;Lt(null),Nt(null);try{return t()}finally{Lt(e),Nt(r)}}function $0(t,e,r,i=r){t.addEventListener(e,()=>en(r));let n=t[Ga];n?t[Ga]=()=>{n(),i(!0)}:t[Ga]=()=>i(!0),R0()}function S$(t){ee===null&&(le===null&&CR(t),AR()),oi&&kR(t)}function C4(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Mn(t,e){var a,o;var r=ee;if(L)for(;r!==null&&(r.f&131072)!==0;)r=r.parent;r!==null&&(r.f&8192)!==0&&(t|=8192);var i={ctx:Ee,deps:null,nodes:null,f:t|2048|512,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};L&&(i.component_function=Zi),(a=ce)==null||a.register_created_effect(i);var n=i;if((t&4)!==0)to!==null?to.push(i):si.ensure().schedule(i);else if(e!==null){try{$n(i)}catch(l){throw vt(i),l}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&524288)===0&&(n=n.first,(t&16)!==0&&(t&65536)!==0&&n!==null&&(n.f|=65536))}if(n!==null&&(n.parent=r,r!==null&&C4(n,r),le!==null&&(le.f&2)!==0&&(t&64)===0)){var s=le;((o=s.effects)!=null?o:s.effects=[]).push(n)}return i}function qs(){return le!==null&&!Tr}function nr(t){let e=Mn(8,null);return Ve(e,1024),e.teardown=t,e}function mr(t){var n;S$("$effect"),L&&cr(t,"name",{value:"$effect"});var e=ee.f,r=!le&&(e&32)!==0&&Ee!==null&&!Ee.i;if(r){var i=Ee;((n=i.e)!=null?n:i.e=[]).push(t)}else return s0(t)}function s0(t){return Mn(1048580,t)}function I0(t){si.ensure();let e=Mn(524352,t);return()=>{vt(e)}}function k$(t){si.ensure();let e=Mn(524352,t);return(r={})=>new Promise(i=>{r.outro?Rn(e,()=>{vt(e),i(void 0)}):(vt(e),i(void 0))})}function Yr(t){return Mn(4,t)}function s$(t){return Mn(4718592,t)}function ar(t,e=0){return Mn(8|e,t)}function Ue(t,e=[],r=[],i=[]){fp(i,e,r,n=>{Mn(8,()=>{t(...n.map(I))})})}function ai(t,e=0){var r=Mn(16|e,t);return L&&(r.dev_stack=Cn),r}function Ot(t){return Mn(524320,t)}function M0(t){var e=t.teardown;if(e!==null){let r=oi,i=le;F0(!0),Lt(null);try{e.call(null)}finally{F0(r),Lt(i)}}}function sf(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){let n=r.ac;n!==null&&en(()=>{n.abort(Ws)});var i=r.next;(r.f&64)!==0?r.parent=null:vt(r,e),r=i}}function A$(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&32)===0&&vt(e),e=r}}function vt(t,e=!0){var r=!1;(e||(t.f&262144)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(C$(t.nodes.start,t.nodes.end),r=!0),t.f|=33554432,sf(t,e&&!r),eo(t,0);var i=t.nodes&&t.nodes.t;if(i!==null)for(let s of i)s.stop();M0(t),t.f^=33554432,t.f|=16384;var n=t.parent;n!==null&&n.first!==null&&k0(t),L&&(t.component_function=null),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function C$(t,e){for(;t!==null;){var r=t===e?null:rr(t);t.remove(),t=r}}function k0(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function Rn(t,e,r=!0){var i=[];T$(t,i,!0);var n=()=>{r&&vt(t),e&&e()},s=i.length;if(s>0){var a=()=>--s||n();for(var o of i)o.out(a)}else n()}function T$(t,e,r){if((t.f&8192)===0){t.f^=8192;var i=t.nodes&&t.nodes.t;if(i!==null)for(let o of i)(o.is_global||r)&&e.push(o);for(var n=t.first;n!==null;){var s=n.next;if((n.f&64)===0){var a=(n.f&65536)!==0||(n.f&32)!==0&&(t.f&16)!==0;T$(n,e,a?r:!1)}n=s}}}function dc(t){P$(t,!0)}function P$(t,e){if((t.f&8192)!==0){t.f^=8192,(t.f&1024)===0&&(Ve(t,2048),si.ensure().schedule(t));for(var r=t.first;r!==null;){var i=r.next,n=(r.f&65536)!==0||(r.f&32)!==0;P$(r,n?e:!1),r=i}var s=t.nodes&&t.nodes.t;if(s!==null)for(let a of s)(a.is_global||e)&&a.in()}}function Ql(t,e){if(t.nodes)for(var r=t.nodes.start,i=t.nodes.end;r!==null;){var n=r===i?null:rr(r);e.append(r),r=n}}m();var R$=null;var xp=!1,oi=!1;function F0(t){oi=t}var le=null,Tr=!1;function Lt(t){le=t}var ee=null;function Nt(t){ee=t}var li=null;function pp(t){le!==null&&(!Ct||(le.f&2)!==0)&&(li!=null?li:li=new Set).add(t)}var Zt=null,Ar=0,ci=null;function v$(t){ci=t}var $$=1,so=0,Qs=so;function C0(t){Qs=t}function tc(){return++$$}function Xs(t){var e=t.f;if((e&2048)!==0)return!0;if(e&2&&(t.f&=-65537),(e&4096)!==0){for(var r=t.deps,i=r.length,n=0;nt.wv)return!0}(e&512)!==0&&Tt===null&&Ve(t,1024)}return!1}function F$(t,e,r=!0){var i=t.reactions;if(i!==null&&!(!Ct&&li!==null&&li.has(t)))for(var n=0;n{t.ac.abort(Ws)}),t.ac=null);try{t.f|=2097152;var u=t.fn,f=u();t.f|=32768;var d=t.deps,h=(g=ce)==null?void 0:g.is_fork;if(Zt!==null){var p;if(h||eo(t,Ar),d!==null&&Ar>0)for(d.length=Ar+Zt.length,p=0;p{requestAnimationFrame(()=>t()),setTimeout(()=>t())});await Promise.resolve(),io()}function I(t){var h,p,g;var e=t.f,r=(e&2)!==0;if((h=R$)==null||h.add(t),le!==null&&!Tr){var i=ee!==null&&(ee.f&16384)!==0;if(!i&&(li===null||!li.has(t))){var n=le.deps;if((le.f&2097152)!==0)t.rvr==null?void 0:r.call(this,s))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Mt(()=>{e.addEventListener(t,n,i)}):e.addEventListener(t,n,i),n}function ui(t,e,r,i,n){var s={capture:i,passive:n},a=O$(t,e,r,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&nr(()=>{e.removeEventListener(t,a,s)})}function we(t,e,r){var i;((i=e[ao])!=null?i:e[ao]={})[t]=r}function Pt(t){for(var e=0;e{throw y});throw d}}finally{t[ao]=e,delete t.currentTarget,Lt(u),Nt(f)}}}m();m();var L$,O0=((L$=globalThis==null?void 0:globalThis.window)==null?void 0:L$.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function N$(t){var e;return(e=O0==null?void 0:O0.createHTML(t))!=null?e:t}function L0(t){var e=In("template");return e.innerHTML=N$(t.replaceAll("","")),e.content}function tn(t,e){var r=ee;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function xe(t,e){var r=(e&1)!==0,i=(e&2)!==0,n,s=!t.startsWith("");return()=>{if(ae)return tn(be,null),be;n===void 0&&(n=L0(s?t:""+t),r||(n=or(n)));var a=i||Qu?document.importNode(n,!0):n.cloneNode(!0);if(r){var o=or(a),l=a.lastChild;tn(o,l)}else tn(a,a);return a}}function oo(){if(ae)return tn(be,null),be;var t=document.createDocumentFragment(),e=document.createComment(""),r=Bt();return t.append(e,r),tn(e,r),t}function fe(t,e){if(ae){var r=ee;((r.f&32768)===0||r.nodes.end===null)&&(r.nodes.end=be),fr();return}t!==null&&t.before(e)}m();var M4=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var Jee=[...M4,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var D4=["touchstart","touchmove"];function B$(t){return D4.includes(t)}var O4=["$state","$state.raw","$derived","$derived.by"],ete=[...O4,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var Cp=!0;function ze(t,e){var i,n;var r=e==null?"":typeof e=="object"?`${e}`:e;r!==((n=t[i=qu])!=null?n:t[i]=t.nodeValue)&&(t[qu]=r,t.nodeValue=`${r}`)}function Js(t,e){return H$(t,e)}function H0(t,e){var a;bp(),e.intro=(a=e.intro)!=null?a:!1;let r=e.target,i=ae,n=be;try{for(var s=or(r);s&&(s.nodeType!==Pi||s.data!=="[");)s=rr(s);if(!s)throw Jn;It(!0),je(s);let o=H$(t,{...e,anchor:s});return It(!1),o}catch(o){if(o instanceof Error&&o.message.split(` +`).some(l=>l.startsWith("https://svelte.dev/e/")))throw o;return o!==Jn&&console.warn("Failed to hydrate: ",o),e.recover===!1&&PR(),bp(),fc(r),It(!1),Js(t,e)}finally{It(i),je(n)}}var Ap=new Map;function H$(t,{target:e,anchor:r,props:i={},events:n,context:s,intro:a=!0,transformError:o}){bp();var l=void 0,c=k$(()=>{var u=r!=null?r:e.appendChild(Bt());d0(u,{pending:()=>{}},h=>{ct({});var p=Ee;if(s&&(p.c=s),n&&(i.$$events=n),ae&&tn(h,null),Cp=a,l=t(h,i)||{},Cp=!0,ae&&(ee.nodes.end=be,be===null||be.nodeType!==Pi||be.data!=="]"))throw ja(),Jn;ut()},o);var f=new Set,d=h=>{for(var p=0;p{var w;for(var h of f)for(let y of[e,document]){var p=Ap.get(y),g=p.get(h);--g==0?(y.removeEventListener(h,kp),p.delete(h),p.size===0&&Ap.delete(y)):p.set(h,g)}Sp.delete(d),u!==r&&((w=u.parentNode)==null||w.removeChild(u))}});return B0.set(l,c),l}var B0=new WeakMap;function ds(t,e){let r=B0.get(t);return r?(B0.delete(t),r(e)):(L&&(er in t?UR():HR()),Promise.resolve())}m();m();m();var rn,Dn,fi,lo,df,hf,Tp,hs=class{constructor(e,r=!0){He(this,"anchor");ge(this,rn,new Map);ge(this,Dn,new Map);ge(this,fi,new Map);ge(this,lo,new Set);ge(this,df,!0);ge(this,hf,e=>{if(F(this,rn).has(e)){var r=F(this,rn).get(e),i=F(this,Dn).get(r);if(i)dc(i),F(this,lo).delete(r);else{var n=F(this,fi).get(r);n&&(dc(n.effect),F(this,Dn).set(r,n.effect),F(this,fi).delete(r),L&&(n.fragment.lastChild[e0]=this.anchor),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(let[s,a]of F(this,rn)){if(F(this,rn).delete(s),s===e)break;let o=F(this,fi).get(a);o&&(vt(o.effect),F(this,fi).delete(a))}for(let[s,a]of F(this,Dn)){if(s===r||F(this,lo).has(s))continue;let o=()=>{if(Array.from(F(this,rn).values()).includes(s)){var c=document.createDocumentFragment();Ql(a,c),c.append(Bt()),F(this,fi).set(s,{effect:a,fragment:c})}else vt(a);F(this,lo).delete(s),F(this,Dn).delete(s)};F(this,df)||!i?(F(this,lo).add(s),Rn(a,o,!1)):o()}}});ge(this,Tp,e=>{F(this,rn).delete(e);let r=Array.from(F(this,rn).values());for(let[i,n]of F(this,fi))r.includes(i)||(vt(n.effect),F(this,fi).delete(i))});this.anchor=e,pe(this,df,r)}ensure(e,r){var i=ce,n=_p();if(r&&!F(this,Dn).has(e)&&!F(this,fi).has(e))if(n){var s=document.createDocumentFragment(),a=Bt();s.append(a),F(this,fi).set(e,{effect:Ot(()=>r(a)),fragment:s})}else F(this,Dn).set(e,Ot(()=>r(this.anchor)));if(F(this,rn).set(i,e),n){for(let[o,l]of F(this,Dn))o===e?i.unskip_effect(l):i.skip_effect(l);for(let[o,l]of F(this,fi))o===e?i.unskip_effect(l.effect):i.skip_effect(l.effect);i.oncommit(F(this,hf)),i.ondiscard(F(this,Tp))}else ae&&(this.anchor=be),F(this,hf).call(this,i)}};rn=new WeakMap,Dn=new WeakMap,fi=new WeakMap,lo=new WeakMap,df=new WeakMap,hf=new WeakMap,Tp=new WeakMap;if(L){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;$R(e)},set:i=>{r=i}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function co(t){Ee===null&&Qh("onMount"),ts&&Ee.l!==null?B4(Ee).m.push(t):mr(()=>{let e=Ye(t);if(typeof e=="function")return e})}function B4(t){var r;var e=t.l;return(r=e.u)!=null?r:e.u={a:[],b:[],m:[]}}m();m();var j$=new Map;function V$(t,e){var r=j$.get(t);r||(r=new Set,j$.set(t,r)),r.add(e)}m();m();m();m();m();m();m();m();m();function Fe(t,e,r=!1){var i;ae&&(i=be,fr());var n=new hs(t),s=r?65536:0;function a(o,l){if(ae){var c=Zu(i);if(o!==parseInt(c.substring(1))){var u=An();je(u),n.anchor=u,It(!1),n.ensure(o,l),It(!0);return}}n.ensure(o,l)}ai(()=>{var o=!1;e((l,c=0)=>{o=!0,a(c,l)}),o||a(-1,null)},s)}m();m();m();function di(t,e){return e}function q4(t,e,r){var f;for(var i=[],n=e.length,s,a=e.length,o=0;o{if(s){if(s.pending.delete(d),s.done.add(d),s.pending.size===0){var h=t.outrogroups;U0(t,jl(s.done)),h.delete(s),h.size===0&&(t.outrogroups=null)}}else a-=1},!1)}if(a===0){var l=i.length===0&&r!==null;if(l){var c=r,u=c.parentNode;fc(u),u.append(c),t.items.clear()}U0(t,e,!l)}else s={pending:new Set(e),done:new Set},((f=t.outrogroups)!=null?f:t.outrogroups=new Set).add(s)}function U0(t,e,r=!0){var i;if(t.pending.size>0){i=new Set;for(let a of t.pending.values())for(let o of a)i.add(t.items.get(o).e)}for(var n=0;n{var S=r();return es(S)?S:S==null?[]:jl(S)});L&&dr(f,"{#each ...}");var d,h=new Map,p=!0;function g(S){(b.effect.f&16384)===0&&(b.pending.delete(S),b.fallback=u,Y4(b,d,a,e,i),u!==null&&(d.length===0?(u.f&33554432)===0?dc(u):(u.f^=33554432,mf(u,null,a)):Rn(u,()=>{u=null})))}function w(S){b.pending.delete(S)}var y=ai(()=>{d=I(f);var S=d.length;let C=!1;if(ae){var A=Zu(a)==="[!";A!==(S===0)&&(a=An(),je(a),It(!1),C=!0)}for(var k=new Set,v=ce,x=_p(),_=0;_s(a)):(u=Ot(()=>s(hc!=null?hc:hc=Bt())),u.f|=33554432)),S>k.size&&(L?K4(d,i):i0("","","")),ae&&S>0&&je(An()),!p)if(h.set(v,k),x){for(let[D,Q]of o)k.has(D)||v.skip_effect(Q.e);v.oncommit(g),v.ondiscard(w)}else g(v);C&&It(!0),I(f)}),b={effect:y,flags:e,items:o,pending:h,outrogroups:null,fallback:u};p=!1,ae&&(a=be)}function pf(t){for(;t!==null&&(t.f&32)===0;)t=t.next;return t}function Y4(t,e,r,i,n){var P,T,M,$,D,Q,ye,de,J;var s=(i&8)!==0,a=e.length,o=t.items,l=pf(t.effect.first),c,u=null,f,d=[],h=[],p,g,w,y;if(s)for(y=0;y0){var _=(i&4)!==0&&a===0?r:null;if(s){for(y=0;y{var X,he;if(f!==void 0)for(w of f)(he=(X=w.nodes)==null?void 0:X.a)==null||he.apply()})}function Z4(t,e,r,i,n,s,a,o){var l=(a&1)!==0?(a&16)===0?qa(r,!1,!1):pr(r):null,c=(a&2)!==0?pr(n):null;return L&&l&&(l.trace=()=>{var u;o()[(u=c==null?void 0:c.v)!=null?u:n]}),{v:l,i:c,e:Ot(()=>(s(e,l!=null?l:r,c!=null?c:n,o),()=>{t.delete(i)}))}}function mf(t,e,r){if(t.nodes)for(var i=t.nodes.start,n=t.nodes.end,s=e&&(e.f&33554432)===0?e.nodes.start:r;i!==null;){var a=rr(i);if(s.before(i),i===n)return;i=a}}function ea(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function K4(t,e){let r=new Map,i=t.length;for(let n=0;nperformance.now():()=>Date.now(),nn={tick:t=>(qh?requestAnimationFrame:ur)(t),now:()=>X4(),tasks:new Set};function W$(){let t=nn.now();nn.tasks.forEach(e=>{e.c(t)||(nn.tasks.delete(e),e.f())}),nn.tasks.size!==0&&nn.tick(W$)}function q$(t){let e;return nn.tasks.size===0&&nn.tick(W$),{promise:new Promise(r=>{nn.tasks.add(e={c:t,f:r})}),abort(){nn.tasks.delete(e)}}}function Pp(t,e){en(()=>{t.dispatchEvent(new CustomEvent(e))})}function tU(t){if(t==="float")return"cssFloat";if(t==="offset")return"cssOffset";if(t.startsWith("--"))return t;let e=t.split("-");return e.length===1?e[0]:e[0]+e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("")}function Y$(t){let e={},r=t.split(";");for(let i of r){let[n,s]=i.split(":");if(!n||s===void 0)break;let a=tU(n.trim());e[a]=s.trim()}return e}var rU=t=>t;function sn(t,e,r,i){var S,C;var n=(t&1)!==0,s=(t&2)!==0,a=n&&s,o=(t&4)!==0,l=a?"both":n?"in":"out",c,u=e.inert,f=e.style.overflow,d,h;function p(){return en(()=>{var A;return c!=null?c:c=r()(e,(A=i==null?void 0:i())!=null?A:{},{direction:l})})}var g={is_global:o,in(){var A;if(e.inert=u,!n){h==null||h.abort(),(A=h==null?void 0:h.reset)==null||A.call(h);return}s||d==null||d.abort(),d=G0(e,p(),h,1,()=>{Pp(e,"introstart")},()=>{Pp(e,"introend"),d==null||d.abort(),d=c=void 0,e.style.overflow=f})},out(A){if(!s){A==null||A(),c=void 0;return}e.inert=!0,h=G0(e,p(),d,0,()=>{Pp(e,"outrostart")},()=>{Pp(e,"outroend"),A==null||A()})},stop:()=>{d==null||d.abort(),h==null||h.abort()}},w=ee;if(((C=(S=w.nodes).t)!=null?C:S.t=[]).push(g),n&&Cp){var y=o;if(!y){for(var b=w.parent;b&&(b.f&65536)!==0;)for(;(b=b.parent)&&(b.f&16)===0;);y=!b||(b.f&32768)!==0}y&&Yr(()=>{Ye(()=>g.in())})}}function G0(t,e,r,i,n,s){var a=i===1;if(Qw(e)){var o,l=!1;return Mt(()=>{if(!l){var y=e({direction:a?"in":"out"});o=G0(t,y,r,i,n,s)}}),{abort:()=>{l=!0,o==null||o.abort()},deactivate:()=>o.deactivate(),reset:()=>o.reset(),t:()=>o.t()}}if(r==null||r.deactivate(),!(e!=null&&e.duration)&&!(e!=null&&e.delay))return n(),s(),{abort:ur,deactivate:ur,reset:ur,t:()=>i};let{delay:c=0,css:u,tick:f,easing:d=rU}=e;var h=[];if(a&&r===void 0&&(f&&f(0,1),u)){var p=Y$(u(0,1));h.push(p,p)}var g=()=>1-i,w=t.animate(h,{duration:c,fill:"forwards"});return w.onfinish=()=>{var P;w.cancel(),n();var y=(P=r==null?void 0:r.t())!=null?P:1-i;r==null||r.abort();var b=i-y,S=e.duration*Math.abs(b),C=[];if(S>0){var A=!1;if(u)for(var k=Math.ceil(S/16.666666666666668),v=0;v<=k;v+=1){var x=y+b*d(v/k),_=Y$(u(x,1-x));C.push(_),A||(A=_.overflow==="hidden")}A&&(t.style.overflow="hidden"),g=()=>{var T=w.currentTime;return y+b*d(T/S)},f&&q$(()=>{if(w.playState!=="running")return!1;var T=g();return f(T,1-T),!0})}w=t.animate(C,{duration:S,fill:"forwards"}),w.onfinish=()=>{g=()=>i,f==null||f(i,1-i),s()}},{abort:()=>{w&&(w.cancel(),w.effect=null,w.onfinish=ur)},deactivate:()=>{s=ur},reset:()=>{i===0&&(f==null||f(1,0))},t:()=>g()}}m();m();function an(t,e){Yr(()=>{var n;var r=t.getRootNode(),i=r.host?r:(n=r.head)!=null?n:r.ownerDocument.head;if(!i.querySelector("#"+e.hash)){let s=In("style");s.id=e.hash,s.textContent=e.code,i.appendChild(s),L&&V$(e.hash,s)}})}m();m();m();m();m();m();var K$=[...` +\r\f\xA0\v\uFEFF`];function X$(t,e,r){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),r){for(var n of Object.keys(r))if(r[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var o=a+s;(a===0||K$.includes(i[a-1]))&&(o===i.length||K$.includes(i[o]))?i=(a===0?"":i.substring(0,a))+i.substring(o+1):a=o}}return i===""?null:i}m();function wt(t,e,r,i,n,s){var a=t[Wu];if(ae||a!==r||a===void 0){var o=X$(r,i,s);(!ae||o!==t.getAttribute("class"))&&(o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o)),t[Wu]=r}else if(s&&n!==s)for(var l in s){var c=!!s[l];(n==null||c!==!!n[l])&&t.classList.toggle(l,c)}return s}m();m();var uU=Symbol("is custom element"),fU=Symbol("is html"),dU=t0?"link":"LINK";function ke(t,e,r,i){var n=hU(t);if(ae&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName===dU)){i||mU(t,e,r!=null?r:"");return}n[e]!==(n[e]=r)&&(e==="loading"&&(t[bR]=r),r==null?t.removeAttribute(e):typeof r!="string"&&pU(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function hU(t){var e,r;return(r=t[e=Xh])!=null?r:t[e]={[uU]:t.nodeName.includes("-"),[fU]:t.namespaceURI===Wh}}var Q$=new Map;function pU(t){var e=t.getAttribute("is")||t.nodeName,r=Q$.get(e);if(r)return r;Q$.set(e,r=[]);for(var i,n=t,s=Element.prototype;s!==n;){i=Zw(n);for(var a in i)i[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&r.push(a);n=Vl(n)}return r}function mU(t,e,r){var i;L&&(e==="srcset"&&gU(t,r)||j0((i=t.getAttribute(e))!=null?i:"",r)||BR(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function j0(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function J$(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function gU(t,e){var r=J$(t.srcset),i=J$(e);return i.length===r.length&&i.every(([n,s],a)=>s===r[a][1]&&(j0(r[a][0],n)||j0(n,r[a][0])))}m();m();m();function W0(t,e,r=e){var i=new WeakSet;$0(t,"input",async n=>{L&&t.type==="checkbox"&&r0();var s=n?t.defaultValue:t.value;if(s=V0(t)?z0(s):s,r(s),ce!==null&&i.add(ce),await Ep(),s!==(s=e())){var a=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=s!=null?s:"",o!==null){var c=t.value.length;a===o&&o===l&&c>l?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=a,t.selectionEnd=Math.min(o,c))}}}),(ae&&t.defaultValue!==t.value||Ye(e)==null&&t.value)&&(r(V0(t)?z0(t.value):t.value),ce!==null&&i.add(ce)),ar(()=>{L&&t.type==="checkbox"&&r0();var n=e();if(t===document.activeElement){var s=Ct?as:ce;if(i.has(s))return}V0(t)&&n===z0(t.value)||t.type==="date"&&!n&&!t.value||n!==t.value&&(t.value=n!=null?n:"")})}function V0(t){var e=t.type;return e==="number"||e==="range"}function z0(t){return t===""?null:+t}m();m();m();m();m();function q0(t,e){return t===e||(t==null?void 0:t[er])===e}function ot(t={},e,r,i){var n=Ee.r,s=ee;return Yr(()=>{var a,o;return ar(()=>{a=o,o=(i==null?void 0:i())||[],Ye(()=>{q0(r(...o),t)||(e(t,...o),a&&q0(r(...a),t)&&e(null,...a))})}),()=>{let l=s;for(;l!==n&&l.parent!==null&&l.parent.f&33554432;)l=l.parent;let c=()=>{o&&q0(r(...o),t)&&e(null,...o)},u=l.teardown;l.teardown=()=>{c(),u==null||u()}}}),t}m();m();m();m();m();m();function Di(t,e,r,i){var C,A;var n=!ts||(r&2)!==0,s=(r&8)!==0,a=(r&16)!==0,o=i,l=!0,c=void 0,u=()=>a&&n?(c!=null||(c=Zs(i)),I(c)):(l&&(l=!1,o=a?Ye(i):i),o);let f;if(s){var d=er in t||zu in t;f=(A=(C=jr(t,e))==null?void 0:C.set)!=null?A:d&&e in t?k=>t[e]=k:void 0}var h,p=!1;s?[h,p]=o0(()=>t[e]):h=t[e],h===void 0&&i!==void 0&&(h=u(),f&&(n&&RR(e),f(h)));var g;if(n?g=()=>{var k=t[e];return k===void 0?u():(l=!0,k)}:g=()=>{var k=t[e];return k!==void 0&&(o=void 0),k===void 0?o:k},n&&(r&4)===0)return g;if(f){var w=t.$$legacy;return(function(k,v){return arguments.length>0?((!n||!v||w||p)&&f(v?g():k),k):g()})}var y=!1,b=((r&1)!==0?Zs:Qa)(()=>(y=!1,g()));L&&(b.label=e),s&&I(b);var S=ee;return(function(k,v){if(arguments.length>0){let x=v?I(b):n&&s?Je(k):k;return oe(b,x),y=!0,o!==void 0&&(o=x),k}return oi&&y||(S.f&16384)!==0?b.v:I(b)})}m();m();m();function tF(t){return new Z0(t)}var ps,Oi,Z0=class{constructor(e){ge(this,ps);ge(this,Oi);var s,a;var r=new Map,i=(o,l)=>{var c=qa(l,!1,!1);return r.set(o,c),c};let n=new Proxy({...e.props||{},$$events:{}},{get(o,l){var c;return I((c=r.get(l))!=null?c:i(l,Reflect.get(o,l)))},has(o,l){var c;return l===zu?!0:(I((c=r.get(l))!=null?c:i(l,Reflect.get(o,l))),Reflect.has(o,l))},set(o,l,c){var u;return oe((u=r.get(l))!=null?u:i(l,c),c),Reflect.set(o,l,c)}});pe(this,Oi,(e.hydrate?H0:Js)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:(s=e.intro)!=null?s:!1,recover:e.recover,transformError:e.transformError})),!Ct&&(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&io(),pe(this,ps,n.$$events);for(let o of Object.keys(F(this,Oi)))o==="$set"||o==="$destroy"||o==="$on"||cr(this,o,{get(){return F(this,Oi)[o]},set(l){F(this,Oi)[o]=l},enumerable:!0});F(this,Oi).$set=o=>{Object.assign(n,o)},F(this,Oi).$destroy=()=>{ds(F(this,Oi))}}$set(e){F(this,Oi).$set(e)}$on(e,r){F(this,ps)[e]=F(this,ps)[e]||[];let i=(...n)=>r.call(this,...n);return F(this,ps)[e].push(i),()=>{F(this,ps)[e]=F(this,ps)[e].filter(n=>n!==i)}}$destroy(){F(this,Oi).$destroy()}};ps=new WeakMap,Oi=new WeakMap;var PU;typeof HTMLElement=="function"&&(PU=class extends HTMLElement{constructor(e,r,i){super();He(this,"$$ctor");He(this,"$$s");He(this,"$$c");He(this,"$$cn",!1);He(this,"$$d",{});He(this,"$$r",!1);He(this,"$$p_d",{});He(this,"$$l",{});He(this,"$$l_u",new Map);He(this,"$$me");He(this,"$$shadowRoot",null);this.$$ctor=e,this.$$s=r,i&&(this.$$shadowRoot=this.attachShadow(i))}addEventListener(e,r,i){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(r),this.$$c){let n=this.$$c.$on(e,r);this.$$l_u.set(r,n)}super.addEventListener(e,r,i)}removeEventListener(e,r,i){if(super.removeEventListener(e,r,i),this.$$c){let n=this.$$l_u.get(r);n&&(n(),this.$$l_u.delete(r))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(n){return s=>{let a=In("slot");n!=="default"&&(a.name=n),fe(s,a)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let r={},i=RU(this);for(let n of this.$$s)n in i&&(n==="default"&&!this.$$d.children?(this.$$d.children=e(n),r.default=!0):r[n]=e(n));for(let n of this.attributes){let s=this.$$g_p(n.name);s in this.$$d||(this.$$d[s]=K0(s,n.value,this.$$p_d,"toProp"))}for(let n in this.$$p_d)!(n in this.$$d)&&this[n]!==void 0&&(this.$$d[n]=this[n],delete this[n]);this.$$c=tF({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:r,$$host:this}}),this.$$me=I0(()=>{ar(()=>{var n;this.$$r=!0;for(let s of Yw(this.$$c)){if(!((n=this.$$p_d[s])!=null&&n.reflect))continue;this.$$d[s]=this.$$c[s];let a=K0(s,this.$$d[s],this.$$p_d,"toAttribute");a==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,a)}this.$$r=!1})});for(let n in this.$$l)for(let s of this.$$l[n]){let a=this.$$c.$on(n,s);this.$$l_u.set(s,a)}this.$$l={}}}attributeChangedCallback(e,r,i){var n;this.$$r||(e=this.$$g_p(e),this.$$d[e]=K0(e,i,this.$$p_d,"toProp"),(n=this.$$c)==null||n.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Yw(this.$$p_d).find(r=>this.$$p_d[r].attribute===e||!this.$$p_d[r].attribute&&r.toLowerCase()===e)||e}});function K0(t,e,r,i){var s;let n=(s=r[t])==null?void 0:s.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e==null?null:e;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function RU(t){let e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}m();m();function uo(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function o(u){try{c(i.next(u))}catch(f){a(f)}}function l(u){try{c(i.throw(u))}catch(f){a(f)}}function c(u){u.done?s(u.value):n(u.value).then(o,l)}c((i=i.apply(t,e||[])).next())})}var eb=require("obsidian");m();var Q0=require("obsidian");m();function $U(t){let e=t-1;return e*e*e+1}var X0=!1;function Nn(t,{delay:e=0,duration:r=400,easing:i=$U,axis:n="y"}={}){let s=getComputedStyle(t);L&&!X0&&/(contents|inline|table)/.test(s.display)&&(X0=!0,Promise.resolve().then(()=>X0=!1),jR(s.display));let a=+s.opacity,o=n==="y"?"height":"width",l=parseFloat(s[o]),c=n==="y"?["top","bottom"]:["left","right"],u=c.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),f=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),h=parseFloat(s[`margin${u[0]}`]),p=parseFloat(s[`margin${u[1]}`]),g=parseFloat(s[`border${u[0]}Width`]),w=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:r,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*a};${o}: ${y*l}px;padding-${c[0]}: ${y*f}px;padding-${c[1]}: ${y*d}px;margin-${c[0]}: ${y*h}px;margin-${c[1]}: ${y*p}px;border-${c[0]}-width: ${y*g}px;border-${c[1]}-width: ${y*w}px;min-${o}: 0`}}m();var $p=require("obsidian");var FU=xe('
'),IU=xe('
'),MU={hash:"svelte-1c0jiav",code:"main.svelte-1c0jiav .nav-file-title:where(.svelte-1c0jiav) {align-items:center;}"};function gf(t,e){ct(e,!0),an(t,MU);let r=Je([]),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");mr(()=>{for(let b of r)b&&(0,$p.setIcon)(b,b.getAttr("data-icon"))});function n(b){b.stopPropagation(),al(e.diff.path)?s(b):a(b)}function s(b){var S;b.stopPropagation();let C=e.view.app.vault.getAbstractFileByPath(e.diff.vaultPath);C instanceof $p.TFile&&((S=ji(e.view.app,b))===null||S===void 0||S.openFile(C).catch(A=>e.view.plugin.displayError(A)))}function a(b){var S;e.view.plugin.tools.openDiff({event:b,aFile:(S=e.diff.fromPath)!==null&&S!==void 0?S:e.diff.path,aRef:`${e.diff.hash}^`,bFile:e.diff.path,bRef:e.diff.hash})}var o=IU(),l=W(o),c=W(l),u=W(c,!0);V(c);var f=ne(c,2),d=W(f),h=W(d);{var p=b=>{var S=FU();ot(S,C=>r[0]=C,()=>r==null?void 0:r[0]),ui("auxclick",S,s),we("click",S,s),fe(b,S)},g=ft(()=>ol(e.diff.vaultPath,e.view.app));Fe(h,b=>{I(g)&&b(p)})}V(d);var w=ne(d,2),y=W(w,!0);V(w),V(f),V(l),V(o),Ue(b=>{ke(l,"data-path",e.diff.vaultPath),ke(l,"data-tooltip-position",I(i)),ke(l,"aria-label",e.diff.vaultPath),ze(u,b),ke(w,"data-type",e.diff.status),ze(y,e.diff.status)},[()=>_n(e.diff.vaultPath)]),we("click",o,n),ui("auxclick",o,b=>{b.stopPropagation(),b.button==2?bn(e.view.app,b,e.diff.vaultPath,e.view.leaf,"git-history"):n(b)}),fe(t,o),ut()}Pt(["click"]);m();var DU=xe("
"),OU=xe(''),LU=xe('
'),NU=xe("
"),BU={hash:"svelte-d9h7mp",code:"main.svelte-d9h7mp .nav-folder-title-content:where(.svelte-d9h7mp) {display:flex;align-items:center;}"};function vf(t,e){ct(e,!0),an(t,BU);let r=Di(e,"topLevel",3,!1),i=Di(e,"closed",15),n=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(l,c){l.stopPropagation(),i(i()[c.path]=!i()[c.path],!0)}var a=NU();let o;hi(a,21,()=>e.hierarchy.children,di,(l,c)=>{var u=oo(),f=Mi(u);{var d=p=>{var g=DU(),w=W(g);gf(w,{get diff(){return I(c).data},get view(){return e.view}}),V(g),fe(p,g)},h=p=>{var g=LU();let w;var y=W(g),b=ne(W(y),2);let S;var C=ne(b,2),A=W(C,!0);V(C),V(y);var k=ne(y,2);{var v=x=>{var _=OU(),P=W(_);vf(P,{get hierarchy(){return I(c)},get plugin(){return e.plugin},get view(){return e.view},get closed(){return i()},set closed(T){i(T)}}),V(_),sn(3,_,()=>Nn,()=>({duration:150})),fe(x,_)};Fe(k,x=>{i()[I(c).path]||x(v)})}V(g),Ue(()=>{w=wt(g,1,"tree-item nav-folder",null,w,{"is-collapsed":i()[I(c).path]}),ke(y,"data-tooltip-position",I(n)),ke(y,"aria-label",I(c).vaultPath),S=wt(b,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,S,{"is-collapsed":i()[I(c).path]}),ze(A,I(c).title)}),we("click",y,x=>s(x,I(c))),fe(p,g)};Fe(f,p=>{I(c).data?p(d):p(h,-1)})}fe(l,u)}),V(a),Ue(()=>o=wt(a,1,"svelte-d9h7mp",null,o,{topLevel:r()})),fe(t,a),ut()}Pt(["click"]);var HU=xe('
'),UU=xe('
'),GU=xe('
'),jU=xe(''),VU=xe('
'),zU={hash:"svelte-1edsiy5",code:""};function J0(t,e){ct(e,!0),an(t,zU);let r=ft(()=>({title:"",path:"",vaultPath:"",children:e.plugin.gitManager.getTreeStructure(e.log.diff.files)})),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left"),n=Ne(!0),s=Ne(Je({}));function a(x){let _=x.author.name;if(e.plugin.settings.authorInHistoryView=="full")return _;if(e.plugin.settings.authorInHistoryView=="initials")return _.split(" ").filter(T=>T.length>0).map(T=>T[0].toUpperCase()).join("")}var o=VU(),l=W(o);let c;var u=W(l),f=W(u);let d;var h=ne(f,2),p=W(h);{var g=x=>{var _=HU(),P=W(_,!0);V(_),Ue(T=>ze(P,T),[()=>e.log.refs.join(", ")]),fe(x,_)};Fe(p,x=>{e.log.refs.length>0&&x(g)})}var w=ne(p,2);{var y=x=>{var _=UU(),P=W(_,!0);V(_),Ue(T=>ze(P,T),[()=>a(e.log)]),fe(x,_)};Fe(w,x=>{var _;e.plugin.settings.authorInHistoryView!="hide"&&((_=e.log.author)!=null&&_.name)&&x(y)})}var b=ne(w,2);{var S=x=>{var _=GU(),P=W(_,!0);V(_),Ue(T=>ze(P,T),[()=>(0,Q0.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)]),fe(x,_)};Fe(b,x=>{e.plugin.settings.dateInHistoryView&&x(S)})}var C=ne(b,2),A=W(C,!0);V(C),V(h),V(u);var k=ne(u,2);{var v=x=>{var _=jU(),P=W(_);{var T=$=>{vf($,{get hierarchy(){return I(r)},get plugin(){return e.plugin},get view(){return e.view},topLevel:!0,get closed(){return I(s)},set closed(D){oe(s,D,!0)}})},M=$=>{var D=oo(),Q=Mi(D);hi(Q,17,()=>e.log.diff.files,di,(ye,de)=>{gf(ye,{get view(){return e.view},get diff(){return I(de)}})}),fe($,D)};Fe(P,$=>{e.showTree?$(T):$(M,-1)})}V(_),sn(3,_,()=>Nn,()=>({duration:150})),fe(x,_)};Fe(k,x=>{I(n)||x(v)})}V(l),V(o),Ue(x=>{c=wt(l,1,"tree-item nav-folder",null,c,{"is-collapsed":I(n)}),ke(u,"aria-label",x),ke(u,"data-tooltip-position",I(i)),d=wt(f,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,d,{"is-collapsed":I(n)}),ze(A,e.log.message)},[()=>{var x;return`${e.log.refs.length>0?e.log.refs.join(", ")+` +`:""}${(x=e.log.author)==null?void 0:x.name} +${(0,Q0.moment)(e.log.date).format(e.plugin.settings.commitDateFormat)} +${e.log.message}`}]),we("click",u,()=>oe(n,!I(n))),fe(t,o),ut()}Pt(["click"]);var WU=xe(''),qU=xe('
'),YU={hash:"svelte-12n6twc",code:""};function tb(t,e){ct(e,!0),an(t,YU);let r=Di(e,"plugin",15),i=Ne(!1),n=Je([]),s=Ne(void 0),a=Ne(Je(r().settings.treeStructure)),o;mr(()=>{o&&o.empty()}),co(()=>{e.view.registerEvent(e.view.app.workspace.on("obsidian-git:head-change",()=>{c().catch(console.error)}))}),mr(()=>{n.forEach(C=>(0,eb.setIcon)(C,C.getAttr("data-icon")))}),co(()=>{let C=new IntersectionObserver(k=>{k[0].isIntersecting&&!I(i)&&u().catch(console.error)}),A=activeDocument.querySelector("#sentinel");return A&&C.observe(A),()=>{C.disconnect()}}),c().catch(console.error);function l(){c().catch(console.error)}function c(){return uo(this,void 0,void 0,function*(){var C;if(!r().gitReady){oe(s,void 0);return}oe(i,!0);let A=r().gitManager instanceof Ce,k;((C=I(s)===null||I(s)===void 0?void 0:I(s).length)!==null&&C!==void 0?C:0)==0?k=A?50:10:k=I(s).length,oe(s,yield r().gitManager.log(void 0,!1,k),!0),oe(i,!1)})}function u(){return uo(this,void 0,void 0,function*(){var C;if(!r().gitReady||I(s)===void 0)return;oe(i,!0);let k=r().gitManager instanceof Ce?50:10,v=yield r().gitManager.log(void 0,!1,k,(C=I(s).last())===null||C===void 0?void 0:C.hash);I(s).push(...v.slice(1)),oe(i,!1)})}var f=qU(),d=W(f),h=W(d),p=W(h);ot(p,C=>n[0]=C,()=>n==null?void 0:n[0]);var g=ne(p,2);let w;ot(g,C=>n[1]=C,()=>n==null?void 0:n[1]),V(h),V(d);var y=ne(d,2),b=W(y);{var S=C=>{var A=WU();hi(A,21,()=>I(s),di,(k,v)=>{J0(k,{get view(){return e.view},get showTree(){return I(a)},get log(){return I(v)},get plugin(){return r()}})}),V(A),fe(C,A)};Fe(b,C=>{I(s)&&C(S)})}Va(4),V(y),V(f),Ue(()=>{ke(p,"data-icon",I(a)?"list":"folder"),w=wt(g,1,"clickable-icon nav-action-button",null,w,{loading:I(i)})}),we("click",p,()=>{oe(a,!I(a)),(0,eb.setIcon)(n[0],I(a)?"list":"folder"),r(r().settings.treeStructure=I(a),!0),r().saveSettings()}),we("click",g,l),fe(t,f),ut()}Pt(["click"]);var wf=class extends rF.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return bi.type}getDisplayText(){return bi.name}getIcon(){return bi.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=Js(tb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};m();var iF=require("obsidian"),Fp=class extends iF.FuzzySuggestModal{constructor(r,i){super(r.app);this.branches=i;this.setPlaceholder("Select branch to checkout")}getItems(){return this.branches}getItemText(r){return r}onChooseItem(r,i){this.resolve(r)}openAndGetReslt(){return new Promise(r=>{this.resolve=r,this.open()})}onClose(){new Promise(r=>window.setTimeout(r,10)).then(()=>{this.resolve&&this.resolve(void 0)})}};m();var aF=require("obsidian");m();var po=require("obsidian");m();var bf=require("obsidian");m();var nF=require("obsidian");var pc=class extends nF.Modal{constructor({app:r,path:i,filesToDeleteCount:n,filesToDiscardCount:s}){super(r);this.resolve=null;this.path=i,this.deleteCount=n,this.discardCount=s}openAndGetResult(){return this.open(),new Promise(r=>{this.resolve=r})}onOpen(){let r=this.deleteCount+this.discardCount,{contentEl:i,titleEl:n}=this,s="";this.path!=""&&(r>1?s=`files in "${this.path}"`:s=`"${this.path}"`),n.setText(`${this.discardCount==0?"Delete":"Discard"} ${s}`),this.deleteCount>0&&i.createEl("p").setText(`Are you sure you want to DELETE the ${gu(this.deleteCount,"untracked file")}? They are deleted according to your Obsidian trash settting.`),this.discardCount>0&&i.createEl("p").setText(`Are you sure you want to discard ALL changes in ${gu(this.discardCount,"tracked file")}?`);let a=i.createDiv({cls:"modal-button-container"});if(this.deleteCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`${this.discardCount>0?"Discard":"Delete"} all ${gu(r,"file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("delete"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("delete"),this.close()})}if(this.discardCount>0){let l=a.createEl("button",{cls:"mod-warning",text:`Discard all ${gu(this.discardCount,"tracked file")}`});l.addEventListener("click",()=>{this.resolve&&this.resolve("discard"),this.close()}),l.addEventListener("keypress",()=>{this.resolve&&this.resolve("discard"),this.close()})}let o=a.createEl("button",{text:"Cancel"});o.addEventListener("click",()=>(this.resolve&&this.resolve(!1),this.close())),o.addEventListener("keypress",()=>(this.resolve&&this.resolve(!1),this.close()))}onClose(){let{contentEl:r}=this;r.empty()}};var ZU=xe('
'),KU=xe('
');function _f(t,e){ct(e,!0);let r=Je([]),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");mr(()=>{for(let v of r)v&&(0,bf.setIcon)(v,v.getAttr("data-icon"))});function n(v){v.stopPropagation(),al(e.change.path)?a(v):l(v)}function s(v){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&ll(e.view.app,v,e.view,e.change.vaultPath)}function a(v){var x;v.stopPropagation();let _=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);_ instanceof bf.TFile&&((x=ji(e.view.app,v))===null||x===void 0||x.openFile(_).catch(P=>e.view.plugin.displayError(P)))}function o(v){v.stopPropagation(),e.manager.stage(e.change.path,!1).catch(x=>e.view.plugin.displayError(x)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function l(v){v.stopPropagation(),e.view.plugin.tools.openDiff({aFile:e.change.path,aRef:"",event:v})}function c(v){v.stopPropagation();let x=e.change.workingDir=="U";new pc({app:e.view.app,filesToDeleteCount:x?1:0,filesToDiscardCount:x?0:1,path:e.change.vaultPath}).openAndGetResult().then(_=>uo(this,void 0,void 0,function*(){if(_=="delete"){let P=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);P instanceof bf.TFile?yield e.view.app.fileManager.trashFile(P):yield e.view.app.vault.adapter.remove(e.change.vaultPath)}else _=="discard"&&(yield e.manager.discard(e.change.path).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")}));e.view.app.workspace.trigger("obsidian-git:refresh")}),_=>e.view.plugin.displayError(_))}var u=KU(),f=W(u),d=W(f),h=W(d,!0);V(d);var p=ne(d,2),g=W(p),w=W(g);{var y=v=>{var x=ZU();ot(x,_=>r[0]=_,()=>r==null?void 0:r[0]),ui("auxclick",x,a),we("click",x,a),fe(v,x)},b=ft(()=>ol(e.change.vaultPath,e.view.app));Fe(w,v=>{I(b)&&v(y)})}var S=ne(w,2);ot(S,v=>r[1]=v,()=>r==null?void 0:r[1]);var C=ne(S,2);ot(C,v=>r[2]=v,()=>r==null?void 0:r[2]),V(g);var A=ne(g,2),k=W(A,!0);V(A),V(p),V(f),V(u),Ue(v=>{ke(f,"data-path",e.change.vaultPath),ke(f,"data-tooltip-position",I(i)),ke(f,"aria-label",e.change.vaultPath),ze(h,v),ke(A,"data-type",e.change.workingDir),ze(k,e.change.workingDir)},[()=>_n(e.change.vaultPath)]),we("mouseover",u,s),we("click",u,n),ui("auxclick",u,v=>{v.stopPropagation(),v.button==2?bn(e.view.app,v,e.change.vaultPath,e.view.leaf,"git-source-control"):n(v)}),we("click",S,c),we("click",C,o),fe(t,u),ut()}Pt(["mouseover","click"]);m();var sF=require("obsidian");var XU=xe('
');function yf(t,e){ct(e,!0);let r=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function i(d){e.view.app.vault.getAbstractFileByPath(e.change.vaultPath)&&ll(e.view.app,d,e.view,e.change.vaultPath)}function n(d){var h;d.stopPropagation();let p=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);p instanceof sF.TFile&&((h=ji(e.view.app,d))===null||h===void 0||h.openFile(p).catch(g=>e.view.plugin.displayError(g)))}var s=XU(),a=W(s),o=W(a),l=W(o,!0);V(o);var c=ne(o,2),u=W(c),f=W(u,!0);V(u),V(c),V(a),V(s),Ue(d=>{ke(a,"data-path",e.change.vaultPath),ke(a,"data-tooltip-position",I(r)),ke(a,"aria-label",e.change.vaultPath),ze(l,d),ke(u,"data-type",e.change.workingDir),ze(f,e.change.workingDir)},[()=>_n(e.change.vaultPath)]),we("mouseover",s,i),we("click",s,n),ui("auxclick",s,d=>{d.stopPropagation(),d.button==2?bn(e.view.app,d,e.change.vaultPath,e.view.leaf,"git-source-control"):n(d)}),fe(t,s),ut()}Pt(["mouseover","click"]);m();var Ip=require("obsidian");var QU=xe('
'),JU=xe('
');function xf(t,e){ct(e,!0);let r=Je([]),i=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");mr(()=>{for(let A of r)A&&(0,Ip.setIcon)(A,A.getAttr("data-icon"))});function n(A){A.stopPropagation(),al(e.change.path)?a(A):o(A)}function s(A){e.view.app.vault.getFileByPath(e.change.vaultPath)&&ll(e.view.app,A,e.view,e.change.vaultPath)}function a(A){var k;A.stopPropagation();let v=e.view.app.vault.getAbstractFileByPath(e.change.vaultPath);v instanceof Ip.TFile&&((k=ji(e.view.app,A))===null||k===void 0||k.openFile(v).catch(x=>e.view.plugin.displayError(x)))}function o(A){var k;A.stopPropagation(),e.view.plugin.tools.openDiff({aFile:(k=e.change.from)!==null&&k!==void 0?k:e.change.path,bFile:e.change.path,aRef:"HEAD",bRef:"",event:A})}function l(A){A.stopPropagation(),e.manager.unstage(e.change.path,!1).catch(k=>e.view.plugin.displayError(k)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}var c=JU(),u=W(c),f=W(u),d=W(f,!0);V(f);var h=ne(f,2),p=W(h),g=W(p);{var w=A=>{var k=QU();ot(k,v=>r[0]=v,()=>r==null?void 0:r[0]),we("click",k,a),fe(A,k)},y=ft(()=>ol(e.change.vaultPath,e.view.app));Fe(g,A=>{I(y)&&A(w)})}var b=ne(g,2);ot(b,A=>r[1]=A,()=>r==null?void 0:r[1]),V(p);var S=ne(p,2),C=W(S,!0);V(S),V(h),V(u),V(c),Ue(A=>{ke(u,"data-path",e.change.vaultPath),ke(u,"data-tooltip-position",I(i)),ke(u,"aria-label",e.change.vaultPath),ze(d,A),ke(S,"data-type",e.change.index),ze(C,e.change.index)},[()=>_n(e.change.vaultPath)]),we("mouseover",c,s),we("click",c,n),ui("auxclick",c,A=>{A.stopPropagation(),A.button==2?bn(e.view.app,A,e.change.vaultPath,e.view.leaf,"git-source-control"):n(A)}),we("click",b,l),fe(t,c),ut()}Pt(["mouseover","click"]);m();m();var eG=xe(''),tG=xe("
");function fo(t,e){ct(e,!0);var r=tG(),i=W(r);{var n=s=>{var a=eG(),o=W(a),l=W(o),c=W(l,!0);V(l),V(o),V(a),Ue(()=>{ke(o,"aria-label","And "+(e.files.length-500)+" more files"),ze(c,"And "+(e.files.length-500)+" more files")}),fe(s,a)};Fe(i,s=>{e.files.length>500&&s(n)})}V(r),fe(t,r),ut()}var iG=xe("
"),nG=xe('
'),sG=xe('
',1),aG=xe(''),oG=xe('
'),lG=xe("
");function ho(t,e){ct(e,!0);let r=Di(e,"topLevel",3,!1),i=Di(e,"closed",15);co(()=>{var h,p;for(let g of e.hierarchy.children)((p=(h=g.children)===null||h===void 0?void 0:h.length)!==null&&p!==void 0?p:0)>100&&i(i()[g.title]=!0,!0)});let n=ft(()=>e.view.leaf.getRoot().side=="left"?"right":"left");function s(h,p){h.stopPropagation(),e.plugin.gitManager.stageAll({dir:p}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function a(h,p){h.stopPropagation(),e.plugin.gitManager.unstageAll({dir:p}).catch(g=>e.plugin.displayError(g)).finally(()=>{e.view.app.workspace.trigger("obsidian-git:refresh")})}function o(h,p){h.stopPropagation(),e.plugin.discardAll(p.vaultPath)}function l(h,p){h.stopPropagation(),i(i()[p.path]=!i()[p.path],!0)}var c=lG();let u;var f=W(c);hi(f,17,()=>vu(e.hierarchy.children,500),di,(h,p)=>{var g=oo(),w=Mi(g);{var y=S=>{var C=iG(),A=W(C);{var k=_=>{xf(_,{get change(){return I(p).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},v=_=>{_f(_,{get change(){return I(p).data},get manager(){return e.plugin.gitManager},get view(){return e.view}})},x=_=>{yf(_,{get change(){return I(p).data},get view(){return e.view}})};Fe(A,_=>{e.fileType==0?_(k):e.fileType==1?_(v,1):e.fileType==2&&_(x,2)})}V(C),fe(S,C)},b=S=>{var C=oG();let A;var k=W(C),v=ne(W(k),2);let x;var _=ne(v,2),P=W(_,!0);V(_);var T=ne(_,2),M=W(T),$=W(M);{var D=J=>{var X=nG();we("click",X,he=>a(he,I(p).path)),fe(J,X)},Q=J=>{var X=sG(),he=Mi(X),z=ne(he,2);we("click",he,K=>o(K,I(p))),we("click",z,K=>s(K,I(p).path)),fe(J,X)};Fe($,J=>{e.fileType==0?J(D):J(Q,-1)})}Va(2),V(M),V(T),V(k);var ye=ne(k,2);{var de=J=>{var X=aG(),he=W(X);ho(he,{get hierarchy(){return I(p)},get plugin(){return e.plugin},get view(){return e.view},get fileType(){return e.fileType},get closed(){return i()},set closed(z){i(z)}}),V(X),sn(3,X,()=>Nn,()=>({duration:150})),fe(J,X)};Fe(ye,J=>{i()[I(p).path]||J(de)})}V(C),Ue(()=>{A=wt(C,1,"tree-item nav-folder",null,A,{"is-collapsed":i()[I(p).path]}),ke(k,"data-tooltip-position",I(n)),ke(k,"aria-label",I(p).vaultPath),x=wt(v,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,x,{"is-collapsed":i()[I(p).path]}),ze(P,I(p).title)}),ui("auxclick",C,J=>bn(e.view.app,J,I(p).vaultPath,e.view.leaf,"git-source-control")),we("click",k,J=>l(J,I(p))),fe(S,C)};Fe(w,S=>{I(p).data?S(y):S(b,-1)})}fe(h,g)});var d=ne(f,2);fo(d,{get files(){return e.hierarchy.children}}),V(c),Ue(()=>u=wt(c,1,"",null,u,{topLevel:r()})),fe(t,c),ut()}Pt(["click"]);var cG=xe('
'),rb=xe(" ",1),ib=xe(''),uG=xe('
'),fG=xe(''),dG=xe('
'),hG={hash:"svelte-5wq9p",code:`.commit-msg-input.svelte-5wq9p {width:100%;overflow:hidden;resize:none;padding:7px 5px;background-color:var(--background-modifier-form-field);}.git-commit-msg.svelte-5wq9p {position:relative;padding:0;width:calc(100% - var(--size-4-8));margin:4px auto;}main.svelte-5wq9p .git-tools:where(.svelte-5wq9p) .files-count:where(.svelte-5wq9p) {padding-left:var(--size-2-1);width:11px;display:flex;align-items:center;justify-content:center;}.nav-folder-title.svelte-5wq9p {align-items:center;}.git-commit-msg-clear-button.svelte-5wq9p {position:absolute;background:transparent;border-radius:50%;color:var(--search-clear-button-color);cursor:var(--cursor);top:-4px;right:2px;bottom:0px;line-height:0;height:var(--input-height);width:28px;margin:auto;padding:0 0;text-align:center;display:flex;justify-content:center;align-items:center;transition:color 0.15s ease-in-out;}.git-commit-msg-clear-button.svelte-5wq9p:after {content:"";height:var(--search-clear-button-size);width:var(--search-clear-button-size);display:block;background-color:currentColor;mask-image:url("data:image/svg+xml,");mask-repeat:no-repeat;-webkit-mask-image:url("data:image/svg+xml,");-webkit-mask-repeat:no-repeat;}`};function nb(t,e){ct(e,!0),an(t,hG);let r=Di(e,"plugin",7),i=Di(e,"view",7),n=Ne(!1),s=Ne(void 0),a=Ne(Je([])),o=ft(()=>r().settings.commitMessage),l=Je([]),c=Ne(void 0),u=Ne(void 0),f=Ne(void 0),d=Ne(!0),h=Ne(!0),p=Ne(!0),g=Ne(0),w=Ne(Je({})),y=Ne(Je({})),b=Ne(Je({})),S=ft(()=>r().settings.treeStructure);co(()=>{i().registerEvent(i().app.workspace.on("obsidian-git:loading-status",()=>oe(n,!0))),i().registerEvent(i().app.workspace.on("obsidian-git:status-changed",()=>{k().catch(console.error)})),i().plugin.cachedStatus==null?i().plugin.refresh().catch(console.error):k().catch(console.error),i().scope=new po.Scope(r().app.scope),i().scope.register(["Ctrl"],"Enter",N=>A())}),mr(()=>{l.forEach(N=>(0,po.setIcon)(N,N.getAttr("data-icon")))}),mr(()=>{l.forEach(N=>{var ue,Re;!N||N.id!="push"||(po.Platform.isMobile?(N.removeClass("button-border"),I(g)>0&&N.addClass("button-border")):((ue=N.firstElementChild)===null||ue===void 0||ue.removeAttribute("color"),I(g)>0&&((Re=N.firstElementChild)===null||Re===void 0||Re.setAttr("color","var(--text-accent)"))))})});function C(){if(oe(n,!0),I(s)){let N=I(s).staged.length>0;r().promiseQueue.addTask(()=>r().commit({fromAuto:!1,commitMessage:I(o),onlyStaged:N}).then(()=>oe(o,r().settings.commitMessage)).finally(v))}}function A(){if(oe(n,!0),I(s)){let N=I(s).staged.length>0;r().promiseQueue.addTask(()=>r().commitAndSync({fromAutoBackup:!1,commitMessage:I(o),onlyStaged:N}).then(()=>{oe(o,r().settings.commitMessage)}).finally(v))}}function k(){return uo(this,void 0,void 0,function*(){if(!r().gitReady){oe(s,void 0);return}if(oe(g,yield r().gitManager.getUnpushedCommits(),!0),oe(s,r().cachedStatus,!0),oe(n,!1),r().lastPulledFiles&&r().lastPulledFiles!=I(a)&&(oe(a,r().lastPulledFiles,!0),oe(f,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(I(a))},!0)),I(s)){let N=(ue,Re)=>ue.vaultPath.split("/").last().localeCompare(_n(Re.vaultPath));I(s).changed.sort(N),I(s).staged.sort(N),oe(c,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(I(s).changed)},!0),oe(u,{title:"",path:"",vaultPath:"",children:r().gitManager.getTreeStructure(I(s).staged)},!0)}else oe(c,void 0),oe(u,void 0)})}function v(){i().app.workspace.trigger("obsidian-git:refresh")}function x(N){N.stopPropagation(),oe(n,!0),r().promiseQueue.addTask(()=>r().gitManager.stageAll({status:I(s)}).finally(v))}function _(N){N.stopPropagation(),oe(n,!0),r().promiseQueue.addTask(()=>r().gitManager.unstageAll({status:I(s)}).finally(v))}function P(){oe(n,!0),r().promiseQueue.addTask(()=>r().push().finally(v))}function T(){oe(n,!0),r().promiseQueue.addTask(()=>r().pullChangesFromRemote().finally(v))}function M(N){N.stopPropagation(),r().discardAll()}let $=ft(()=>(I(o).match(/\n/g)||[]).length+1||1);var D=dG(),Q=W(D),ye=W(Q),de=W(ye);ot(de,N=>l[0]=N,()=>l==null?void 0:l[0]);var J=ne(de,2);ot(J,N=>l[1]=N,()=>l==null?void 0:l[1]);var X=ne(J,2);ot(X,N=>l[2]=N,()=>l==null?void 0:l[2]);var he=ne(X,2);ot(he,N=>l[3]=N,()=>l==null?void 0:l[3]);var z=ne(he,2);ot(z,N=>l[4]=N,()=>l==null?void 0:l[4]);var K=ne(z,2);ot(K,N=>l[5]=N,()=>l==null?void 0:l[5]);var G=ne(K,2);ot(G,N=>l[6]=N,()=>l==null?void 0:l[6]);var Me=ne(G,2);let Et;ot(Me,N=>l[7]=N,()=>l==null?void 0:l[7]),V(ye),V(Q);var Ht=ne(Q,2),De=W(Ht);P0(De);var Rt=ne(De,2);{var $t=N=>{var ue=cG();ke(ue,"aria-label","Clear"),we("click",ue,()=>oe(o,"")),fe(N,ue)};Fe(Rt,N=>{I(o)&&N($t)})}V(Ht);var Xe=ne(Ht,2),re=W(Xe);{var B=N=>{var ue=fG(),Re=W(ue);let Ut;var Pr=W(Re),vo=W(Pr);let cb;var ub=ne(vo,4),Wp=W(ub),fb=W(Wp);ot(fb,gr=>l[8]=gr,()=>l==null?void 0:l[8]),V(Wp);var db=ne(Wp,2),mF=W(db,!0);V(db),V(ub),V(Pr);var gF=ne(Pr,2);{var vF=gr=>{var Rr=ib(),wo=W(Rr);{var ms=vr=>{ho(vr,{get hierarchy(){return I(u)},get plugin(){return r()},get view(){return i()},get fileType(){return 0},topLevel:!0,get closed(){return I(w)},set closed(Li){oe(w,Li,!0)}})},bo=vr=>{var Li=rb(),ta=Mi(Li);hi(ta,17,()=>vu(I(s).staged,500),di,(gs,gc)=>{xf(gs,{get change(){return I(gc)},get view(){return i()},get manager(){return r().gitManager}})});var ra=ne(ta,2);fo(ra,{get files(){return I(s).staged}}),fe(vr,Li)};Fe(wo,vr=>{I(S)?vr(ms):vr(bo,-1)})}V(Rr),sn(3,Rr,()=>Nn,()=>({duration:150})),fe(gr,Rr)};Fe(gF,gr=>{I(h)&&gr(vF)})}V(Re);var Sf=ne(Re,2);let hb;var kf=W(Sf),pb=W(kf);let mb;var gb=ne(pb,4),qp=W(gb),vb=W(qp),wb=ne(vb,2);ot(wb,gr=>l[9]=gr,()=>l==null?void 0:l[9]),V(qp);var bb=ne(qp,2),wF=W(bb,!0);V(bb),V(gb),V(kf);var bF=ne(kf,2);{var _F=gr=>{var Rr=ib(),wo=W(Rr);{var ms=vr=>{ho(vr,{get hierarchy(){return I(c)},get plugin(){return r()},get view(){return i()},get fileType(){return 1},topLevel:!0,get closed(){return I(y)},set closed(Li){oe(y,Li,!0)}})},bo=vr=>{var Li=rb(),ta=Mi(Li);hi(ta,17,()=>vu(I(s).changed,500),di,(gs,gc)=>{_f(gs,{get change(){return I(gc)},get view(){return i()},get manager(){return r().gitManager}})});var ra=ne(ta,2);fo(ra,{get files(){return I(s).changed}}),fe(vr,Li)};Fe(wo,vr=>{I(S)?vr(ms):vr(bo,-1)})}V(Rr),sn(3,Rr,()=>Nn,()=>({duration:150})),fe(gr,Rr)};Fe(bF,gr=>{I(d)&&gr(_F)})}V(Sf);var yF=ne(Sf,2);{var xF=gr=>{var Rr=uG();let wo;var ms=W(Rr),bo=ne(W(ms),4),vr=W(bo,!0);V(bo),V(ms);var Li=ne(ms,2);{var ta=ra=>{var gs=ib(),gc=W(gs);{var EF=_o=>{ho(_o,{get hierarchy(){return I(f)},get plugin(){return r()},get view(){return i()},get fileType(){return 2},topLevel:!0,get closed(){return I(b)},set closed(Af){oe(b,Af,!0)}})},SF=_o=>{var Af=rb(),_b=Mi(Af);hi(_b,17,()=>I(a),di,(AF,CF)=>{yf(AF,{get change(){return I(CF)},get view(){return i()}})});var kF=ne(_b,2);fo(kF,{get files(){return I(a)}}),fe(_o,Af)};Fe(gc,_o=>{I(S)?_o(EF):_o(SF,-1)})}V(gs),sn(3,gs,()=>Nn,()=>({duration:150})),fe(ra,gs)};Fe(Li,ra=>{I(p)&&ra(ta)})}V(Rr),Ue(()=>{wo=wt(Rr,1,"pulled nav-folder",null,wo,{"is-collapsed":!I(p)}),ze(vr,I(a).length)}),we("click",ms,()=>oe(p,!I(p))),fe(gr,Rr)};Fe(yF,gr=>{I(a).length>0&&I(f)&&gr(xF)})}V(ue),Ue(()=>{Ut=wt(Re,1,"staged tree-item nav-folder",null,Ut,{"is-collapsed":!I(h)}),cb=wt(vo,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,cb,{"is-collapsed":!I(h)}),ze(mF,I(s).staged.length),hb=wt(Sf,1,"changes tree-item nav-folder",null,hb,{"is-collapsed":!I(d)}),mb=wt(pb,1,"tree-item-icon nav-folder-collapse-indicator collapse-icon",null,mb,{"is-collapsed":!I(d)}),ze(wF,I(s).changed.length)}),we("click",Pr,()=>oe(h,!I(h))),we("click",fb,_),we("click",kf,()=>oe(d,!I(d))),we("click",vb,M),we("click",wb,x),fe(N,ue)};Fe(re,N=>{I(s)&&I(u)&&I(c)&&N(B)})}V(Xe),V(D),Ue(()=>{ke(D,"data-type",Qt.type),ke(G,"data-icon",I(S)?"list":"folder"),Et=wt(Me,1,"clickable-icon nav-action-button",null,Et,{loading:I(n)}),ke(De,"rows",I($))}),we("click",de,A),we("click",J,C),we("click",X,x),we("click",he,_),we("click",z,P),we("click",K,T),we("click",G,()=>{oe(S,!I(S)),(0,po.setIcon)(l[6],I(S)?"list":"folder"),r().settings.treeStructure=I(S),r().saveSettings()}),we("click",Me,v),W0(De,()=>I(o),N=>oe(o,N)),fe(t,D),ut()}Pt(["click"]);var Ef=class extends aF.ItemView{constructor(e,r){super(e),this.plugin=r,this.hoverPopover=null}getViewType(){return Qt.type}getDisplayText(){return Qt.name}getIcon(){return Qt.icon}onClose(){return this._view&&ds(this._view),super.onClose()}reload(){this._view&&ds(this._view),this._view=Js(nb,{target:this.contentEl,props:{plugin:this.plugin,view:this}})}onOpen(){return this.reload(),super.onOpen()}};m();var Mp=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;this.statusBarEl.addClass("mod-clickable"),this.statusBarEl.onClickEvent(i=>{this.plugin.switchBranch().catch(n=>r.displayError(n))})}async display(){if(this.plugin.gitReady){let e=await this.plugin.gitManager.branchInfo();e.current!=null?this.statusBarEl.setText(e.current):this.statusBarEl.empty()}else this.statusBarEl.empty()}remove(){this.statusBarEl.remove()}};m();var oF=require("obsidian");var Dp=class{constructor(e){this.plugin=e}get editor(){var i;let e=(i=this.plugin.app.workspace.activeEditor)==null?void 0:i.editor,r=e==null?void 0:e.cm;if(!(!e||!zi.hasHunksData(r.state)))return{editor:r,obEditor:e}}get gitManager(){return this.plugin.gitManager}resetHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=zi.getHunk(r.state,!1,e);if(n){let s,a;n.type==="delete"?(s=n.added.start+1,a=n.added.start+1):(s=n.added.start-0,a=n.added.start-1+n.added.count);let o=r.state.doc.line(s).from,l=n.type==="delete"?r.state.doc.line(a).from:r.state.doc.line(a).to+1,c=n.removed.lines.join(` +`);n.removed.lines.length>0&&!n.removed.no_nl_at_eof&&(c+=` +`),i.replaceRange(c,i.offsetToPos(o),i.offsetToPos(l)),i.setSelection(i.offsetToPos(o))}}async stageHunk(e){if(!await this.plugin.isAllInitialized()||!this.editor)return;let{editor:r}=this.editor,i=zi.getHunk(r.state,!1,e),n=!1;if(i||(i=zi.getHunk(r.state,!0,e),n=!0),!i)return;let s=r.state.field(oF.editorInfoField).file.path,a=Wt.createPatch(s,[i],"100644",n).join(` +`)+` +`;await this.gitManager.applyPatch(a),this.plugin.app.workspace.trigger("obsidian-git:refresh")}goToHunk(e){if(!this.editor)return;let{editor:r,obEditor:i}=this.editor,n=zi.getHunks(r.state,!1),s=i.getCursor().line+1,a=Wt.findNearestHunk(s,n,e,!0);if(a==null)return;let o=n[a];if(o){let l=o.added.start-1;i.setCursor(l,0),i.scrollIntoView({from:{line:l,ch:0},to:{line:l+1,ch:0}},!0)}}};m();m();var mo=require("obsidian");var Op=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.lineAuthorInfoProvider){console.warn("Git: undefined lineAuthorInfoProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof mo.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.lineAuthorInfoProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions),A2(()=>this.plg.settings.lineAuthor,e=>{this.plg.settings.lineAuthor=e,this.plg.saveSettings()})}conditionallyActivateBySettings(){this.plg.settings.lineAuthor.show&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;O2(this.plg.settings.lineAuthor),this.lineAuthorInfoProvider=new gh(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),console.log(this.plg.manifest.name+": Enabled line authoring.")}catch(e){console.warn("Git: Error while loading line authoring feature.",e),this.deactivateFeature()}}deactivateFeature(){var e;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.lineAuthorInfoProvider)==null||e.destroy(),this.lineAuthorInfoProvider=void 0,console.log(this.plg.manifest.name+": Disabled line authoring.")}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&mo.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Ce?this.plg.gitManager:void 0}}refreshLineAuthorViews(){this.plg.settings.lineAuthor.show&&(this.deactivateFeature(),this.activateFeature())}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(Y2),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.gutterContextMenuEvent=this.createGutterContextMenuHandler(),this.fileOpenEvent=this.createFileOpenEvent(),this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileModificationEvent=this.createVaultFileModificationHandler(),this.headChangeEvent=this.createHeadChangeEvent(),this.refreshOnCssChangeEvent=this.createCssRefreshHandler(),this.fileRenameEvent=this.createFileRenameEvent(),$2(),this.plg.registerEvent(this.gutterContextMenuEvent),this.plg.registerEvent(this.refreshOnCssChangeEvent),this.plg.registerEvent(this.fileOpenEvent),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileModificationEvent),this.plg.registerEvent(this.headChangeEvent),this.plg.registerEvent(this.fileRenameEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.gutterContextMenuEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.workspace.offref(this.fileOpenEvent),this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.workspace.offref(this.refreshOnCssChangeEvent),this.plg.app.vault.offref(this.fileModificationEvent),this.plg.app.workspace.offref(this.headChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent)}createFileOpenEvent(){return this.plg.app.workspace.on("file-open",e=>{var r;(r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e).catch(console.error)})}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return e instanceof mo.TFile&&((i=this.lineAuthorInfoProvider)==null?void 0:i.trackChanged(e))})}createVaultFileModificationHandler(){return this.plg.app.vault.on("modify",e=>{var r;return e instanceof mo.TFile&&((r=this.lineAuthorInfoProvider)==null?void 0:r.trackChanged(e))})}createHeadChangeEvent(){return this.plg.app.workspace.on("obsidian-git:head-change",()=>{this.refreshLineAuthorViews()})}createCssRefreshHandler(){return this.plg.app.workspace.on("css-change",()=>this.refreshLineAuthorViews())}createGutterContextMenuHandler(){return this.plg.app.workspace.on("editor-menu",M2)}};m();var mc=require("obsidian");m();m();var go=require("@codemirror/state"),Np=require("@codemirror/view");var Lp=class extends Np.GutterMarker{constructor(r,i){super();this.type=r;this.staged=i}toDOM(r){let i=createDiv();return i.className=`git-gutter-marker git-${this.type} ${this.staged?"staged":"unstaged"}`,this.type=="changedelete"&&i.setText("~"),i}},sb=go.StateField.define({create:()=>go.RangeSet.empty,update:(t,e)=>{let r=e.state.field(Gr,!1);if(!r)return go.RangeSet.empty;let i=e.effects.some(s=>s.is(Ou)),n=e.effects.some(s=>s.is($l));if(i||n||(e.docChanged||t.size==0)&&r.isDirty==!1){let s=new Set,a=lF(e,r.hunks,!1,s),o=lF(e,r.stagedHunks,!0,s);return t=go.RangeSet.of([...a,...o],!0),t}else e.docChanged&&(t=t.map(e.changes));return t}});function lF(t,e,r,i){let n=[];for(let a=0;a0?e[a-1]:void 0,l=a{var e;return(e=t.state.field(sb,!1))!=null?e:go.RangeSet.empty},initialSpacer:t=>new Lp("delete",!1),domEventHandlers:{click:(t,e,r)=>{var n;return((n=zi.getHunkAtPos(t.state,e.from,!1))!=null?n:zi.getHunkAtPos(t.state,e.from,!0))&&(Vs(t,e.from),r.preventDefault()),!1}}});var Bp=class{constructor(e){this.plugin=e}async trackChanged(e){return this.trackChangedHelper(e).catch(r=>(console.warn("Git: Error in trackChanged."+r),Promise.reject(r)))}async trackChangedHelper(e){if(e){if(e.path===void 0){console.warn("Git: Attempted to track change of undefined filepath. Unforeseen situation.");return}return this.computeSigns(e.path)}}destroy(){}async computeSigns(e){let i=await this.plugin.editorIntegration.lineAuthoringFeature.isAvailableOnCurrentPlatform().gitManager.show("",e).catch(()=>{});this.notifySignComputationResultToSubscribers(e,{compareText:i,compareTextHead:void 0})}notifySignComputationResultToSubscribers(e,r){Kn.ifFilepathDefinedTransformSubscribers(e,i=>i.forEach(n=>n.notifyGitCompare(r)))}},uF=[uR,fR,cF,sb,Gh],fF=[Gr,Cw];m();var ab=require("obsidian"),Hp=class{constructor(e,r){this.statusBarEl=e;this.plugin=r;e.addClass("git-changes-status-bar"),r.settings.hunks.statusBar==="colored"&&e.addClass("git-changes-status-bar-colored"),e.setAttr("aria-label","Git diff of the current editor"),this.statusBarEl.setAttribute("data-tooltip-position","top"),r.app.workspace.on("active-leaf-change",i=>{(!i||i.getRoot()==r.app.workspace.rootSplit&&!(i.view instanceof ab.MarkdownView))&&this.statusBarEl.empty()})}display(e,r){var o;let i=this.plugin.app.workspace.getActiveViewOfType(ab.MarkdownView);if(!i||((o=i.file)==null?void 0:o.path)!==(r==null?void 0:r.path))return;let n=0,s=0,a=0;for(let l of e)n+=Math.max(0,l.added.count-l.removed.count),s+=Math.min(l.added.count,l.removed.count),a+=Math.max(0,l.removed.count-l.added.count);this.statusBarEl.empty(),n>0&&this.statusBarEl.createSpan({text:`+${n} `,cls:"git-add"}),s>0&&this.statusBarEl.createSpan({text:`~${s} `,cls:"git-change"}),a>0&&this.statusBarEl.createSpan({text:`-${a}`,cls:"git-delete"})}remove(){this.statusBarEl.remove()}};var Up=class{constructor(e){this.plg=e;this.codeMirrorExtensions=[];this.handleWorkspaceLeaf=e=>{if(!this.signsProvider){console.warn("Git: undefined signsProvider. Unexpected situation.");return}let r=e==null?void 0:e.view;!(r instanceof mc.MarkdownView)||r.file==null||(r==null?void 0:r.allowNoFile)===!0||this.signsProvider.trackChanged(r.file).catch(console.error)}}onLoadPlugin(){this.plg.registerEditorExtension(this.codeMirrorExtensions)}conditionallyActivateBySettings(){(this.plg.settings.hunks.showSigns||this.plg.settings.hunks.statusBar!="disabled"||this.plg.settings.hunks.hunkCommands)&&this.activateFeature()}activateFeature(){try{if(!this.isAvailableOnCurrentPlatform().available)return;if(this.signsProvider=new Bp(this.plg),this.createEventHandlers(),this.activateCodeMirrorExtensions(),this.plg.settings.hunks.statusBar!="disabled"){let e=this.plg.addStatusBarItem();this.changeStatusBar=new Hp(e,this.plg)}}catch(e){console.warn("Git: Error while loading signs feature.",e),this.deactivateFeature()}}deactivateFeature(){var e,r;this.destroyEventHandlers(),this.deactivateCodeMirrorExtensions(),(e=this.signsProvider)==null||e.destroy(),this.signsProvider=void 0,(r=this.changeStatusBar)==null||r.remove(),this.changeStatusBar=void 0}isAvailableOnCurrentPlatform(){return{available:this.plg.useSimpleGit&&mc.Platform.isDesktopApp,gitManager:this.plg.gitManager instanceof Ce?this.plg.gitManager:void 0}}refresh(){this.plg.settings.hunks.showSigns&&this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}activateCodeMirrorExtensions(){this.codeMirrorExtensions.push(fF),this.plg.settings.hunks.showSigns&&this.codeMirrorExtensions.push(...uF),this.plg.app.workspace.updateOptions(),this.plg.app.workspace.iterateAllLeaves(this.handleWorkspaceLeaf)}deactivateCodeMirrorExtensions(){for(let e of this.codeMirrorExtensions)this.codeMirrorExtensions.remove(e);this.plg.app.workspace.updateOptions()}createEventHandlers(){this.workspaceLeafChangeEvent=this.createWorkspaceLeafChangeEvent(),this.fileRenameEvent=this.createFileRenameEvent(),this.pluginRefreshedEvent=this.createPluginRefreshedEvent(),this.intervalRefreshEvent=this.createIntervalRefreshEvent(),this.plg.registerEvent(this.workspaceLeafChangeEvent),this.plg.registerEvent(this.fileRenameEvent),this.plg.registerEvent(this.pluginRefreshedEvent),this.plg.registerInterval(this.intervalRefreshEvent)}destroyEventHandlers(){this.plg.app.workspace.offref(this.workspaceLeafChangeEvent),this.plg.app.vault.offref(this.fileRenameEvent),this.plg.app.workspace.offref(this.pluginRefreshedEvent),this.plg.app.workspace.offref(this.gutterContextMenuEvent),window.clearInterval(this.intervalRefreshEvent)}createWorkspaceLeafChangeEvent(){return this.plg.app.workspace.on("active-leaf-change",this.handleWorkspaceLeaf)}createFileRenameEvent(){return this.plg.app.vault.on("rename",(e,r)=>{var i;return Kn.ifFilepathDefinedTransformSubscribers(r,n=>n.forEach(s=>{s.changeToNewFilepath(e.path)})),e instanceof mc.TFile&&((i=this.signsProvider)==null?void 0:i.trackChanged(e))})}createPluginRefreshedEvent(){return this.plg.app.workspace.on("obsidian-git:refresh",()=>{this.refresh()})}createIntervalRefreshEvent(){return window.setInterval(()=>{var e,r;(e=this.plg.app.workspace.activeEditor)!=null&&e.file&&((r=this.signsProvider)==null||r.trackChanged(this.plg.app.workspace.activeEditor.file).catch(console.error))},10*1e3)}};m();var dF=require("@codemirror/state"),Gp=require("obsidian");var ob=class{constructor(e){this.state=e;this.subscribeMe()}notifyLineAuthoring(e,r){if(this.view===void 0){console.warn(`Git: View is not defined for editor cache key. Unforeseen situation. id: ${e}`);return}let i=this.view.state,n=k2(e,r,i);this.view.dispatch(n)}notifyGitCompare(e){if(this.view===void 0){console.warn("Git: View is not defined for editor cache key. Unforeseen situation. id: ");return}if(this.removeIfStale())return;let r=this.view.state,i=r.field(Gr);if(!i||i.compareText!=e.compareText||i.compareTextHead!=e.compareTextHead){let n=HP(e,r);this.view.dispatch(n)}}updateToNewState(e){return this.state=e,!this.lastSeenPath&&this.filepath&&this.subscribeMe(),this}removeIfStale(){var e;return((e=this.view)==null?void 0:e.state.field(lb,!1))!=this||this.view.destroyed?(this.unsubscribeMe(this.lastSeenPath),!0):!1}changeToNewFilepath(e){this.unsubscribeMe(this.lastSeenPath),this.subscribeMe(e)}subscribeMe(e){e!=null||(e=this.filepath),e!==void 0&&(Kn.ifFilepathDefinedTransformSubscribers(e,r=>r.add(this)),this.lastSeenPath=e)}unsubscribeMe(e){Kn.ifFilepathDefinedTransformSubscribers(e,r=>r.delete(this))}get filepath(){var e,r;return(r=(e=this.state.field(Gp.editorInfoField))==null?void 0:e.file)==null?void 0:r.path}get view(){return this.state.field(Gp.editorEditorField)}},lb=dF.StateField.define({create:t=>new ob(t),update:(t,e)=>t.updateToNewState(e.state),compare:(t,e)=>t===e});var jp=class{constructor(e){this.plg=e;this.lineAuthoringFeature=new Op(this.plg);this.signsFeature=new Up(this.plg)}onUnloadPlugin(){this.lineAuthoringFeature.deactivateFeature(),this.signsFeature.deactivateFeature()}onLoadPlugin(){this.plg.registerEditorExtension(lb),this.lineAuthoringFeature.onLoadPlugin(),this.signsFeature.onLoadPlugin()}onReady(){this.lineAuthoringFeature.conditionallyActivateBySettings(),this.signsFeature.conditionallyActivateBySettings()}activateLineAuthoring(){this.lineAuthoringFeature.activateFeature()}deactiveLineAuthoring(){this.lineAuthoringFeature.deactivateFeature()}refreshSignsSettings(){let e=this.plg.settings.hunks;e.showSigns||e.statusBar!="disabled"||e.hunkCommands?(this.signsFeature.deactivateFeature(),this.signsFeature.activateFeature()):this.signsFeature.deactivateFeature()}};var Vp=class extends Se.Plugin{constructor(){super(...arguments);this.automaticsManager=new $u(this);this.tools=new Vu(this);this.localStorage=new jh(this);this.state={gitAction:0,offlineMode:!1};this.gitReady=!1;this.promiseQueue=new Cd(this);this.intervalsToClear=[];this.editorIntegration=new jp(this);this.hunkActions=new Dp(this)}setPluginState(r){var i;this.state=Object.assign(this.state,r),(i=this.statusBar)==null||i.display()}async updateCachedStatus(){var r,i;return this.app.workspace.trigger("obsidian-git:loading-status"),this.cachedStatus=await this.gitManager.status(),this.cachedStatus.conflicted.length>0?(this.localStorage.setConflict(!0),await((r=this.branchBar)==null?void 0:r.display())):(this.localStorage.setConflict(!1),await((i=this.branchBar)==null?void 0:i.display())),this.app.workspace.trigger("obsidian-git:status-changed",this.cachedStatus),this.cachedStatus}async refresh(){if(!this.gitReady)return;let r=this.app.workspace.getLeavesOfType(Qt.type),i=this.app.workspace.getLeavesOfType(bi.type);(this.settings.changedFilesInStatusBar||r.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)})||i.some(n=>{var s;return!((s=n.isDeferred)!=null&&s)}))&&await this.updateCachedStatus().catch(n=>this.displayError(n)),this.app.workspace.trigger("obsidian-git:refreshed")}refreshUpdatedHead(){}async onload(){console.log("loading "+this.manifest.name+" plugin: v"+this.manifest.version),zt.plugin=this,this.localStorage.migrate(),await this.loadSettings(),await this.migrateSettings(),this.settingsTab=new vh(this.app,this),this.addSettingTab(this.settingsTab),this.localStorage.getPluginDisabled()||(this.registerStuff(),this.app.workspace.onLayoutReady(()=>this.init({fromReload:!1}).catch(r=>this.displayError(r))))}onExternalSettingsChange(){this.reloadSettings().catch(r=>this.displayError(r))}async reloadSettings(){let r=JSON.stringify(this.settings);await this.loadSettings();let i=JSON.stringify(this.settings);r!==i&&(this.log("Reloading settings"),this.unloadPlugin(),await this.init({fromReload:!0}),this.app.workspace.getLeavesOfType(Qt.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}),this.app.workspace.getLeavesOfType(bi.type).forEach(n=>{var s;if(!((s=n.isDeferred)!=null&&s))return n.view.reload()}))}registerStuff(){this.registerEvent(this.app.workspace.on("obsidian-git:refresh",()=>{this.refresh().catch(r=>this.displayError(r))})),this.registerEvent(this.app.workspace.on("obsidian-git:head-change",()=>{this.refreshUpdatedHead()})),this.registerEvent(this.app.workspace.on("file-menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"file-manu")})),this.registerEvent(this.app.workspace.on("obsidian-git:menu",(r,i,n)=>{this.handleFileMenu(r,i,n,"obsidian-git:menu")})),this.registerEvent(this.app.workspace.on("active-leaf-change",r=>{this.onActiveLeafChange(r)})),Se.Platform.isDesktopApp||(this.registerEvent(this.app.vault.on("modify",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("delete",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("create",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)})),this.registerEvent(this.app.vault.on("rename",()=>{var r;this.debRefresh(),(r=this.autoCommitDebouncer)==null||r.call(this)}))),this.registerView(Qt.type,r=>new Ef(r,this)),this.registerView(bi.type,r=>new wf(r,this)),this.registerView(Ds.type,r=>new Ha(r,this)),this.registerView(Ms.type,r=>new Ua(r,this)),this.addRibbonIcon("git-pull-request","Open Git source control",async()=>{var n;let r=this.app.workspace.getLeavesOfType(Qt.type),i;r.length===0?(i=(n=this.app.workspace.getRightLeaf(!1))!=null?n:this.app.workspace.getLeaf(),await i.setViewState({type:Qt.type})):i=r.first(),await this.app.workspace.revealLeaf(i)}),this.registerHoverLinkSource(Qt.type,{display:"Git View",defaultMod:!0}),this.editorIntegration.onLoadPlugin(),this.setRefreshDebouncer(),dR(this)}setRefreshDebouncer(){var r;(r=this.debRefresh)==null||r.cancel(),this.debRefresh=(0,Se.debounce)(()=>{this.settings.refreshSourceControl&&this.refresh().catch(console.error)},this.settings.refreshSourceControlTimer,!0)}async addFileToGitignore(r,i){let n=this.gitManager.getRelativeRepoPath(r,!0),s=mA({isFolder:i,gitRelativePath:n});await this.app.vault.adapter.append(this.gitManager.getRelativeVaultPath(".gitignore"),` +`+s),this.app.workspace.trigger("obsidian-git:refresh")}handleFileMenu(r,i,n,s){if(!this.gitReady||!this.settings.showFileMenu||!i)return;let a;if(typeof i=="string"?a=i:a=i.path,n=="file-explorer-context-menu"&&(r.addItem(o=>{o.setTitle("Git: Stage").setIcon("plus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof Se.TFile?await this.stageFile(i):(await this.gitManager.stageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Unstage").setIcon("minus-circle").setSection("action").onClick(l=>{this.promiseQueue.addTask(async()=>{i instanceof Se.TFile?await this.unstageFile(i):(await this.gitManager.unstageAll({dir:this.gitManager.getRelativeRepoPath(a,!0)}),this.app.workspace.trigger("obsidian-git:refresh"))})})}),r.addItem(o=>{o.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(l=>{this.addFileToGitignore(a,i instanceof Se.TFolder).catch(c=>this.displayError(c))})})),n=="git-source-control"){r.addItem(l=>{l.setTitle("Git: Add to .gitignore").setIcon("file-x").setSection("action").onClick(c=>{this.addFileToGitignore(a,i instanceof Se.TFolder).catch(u=>this.displayError(u))})});let o=this.app.vault.adapter;s==="obsidian-git:menu"&&o instanceof Se.FileSystemAdapter&&(r.addItem(l=>{l.setTitle("Open in default app").setIcon("arrow-up-right").setSection("action").onClick(c=>{this.app.openWithDefaultApp(a)})}),r.addItem(l=>{l.setTitle("Show in system explorer").setIcon("arrow-up-right").setSection("action").onClick(c=>{window.electron.shell.showItemInFolder(pF.join(o.getBasePath(),a))})}))}}async migrateSettings(){this.settings.mergeOnPull!=null&&(this.settings.syncMethod=this.settings.mergeOnPull?"merge":"rebase",this.settings.mergeOnPull=void 0,await this.saveSettings()),this.settings.autoCommitMessage===void 0&&(this.settings.autoCommitMessage=this.settings.commitMessage,await this.saveSettings()),this.settings.gitPath!=null&&(this.localStorage.setGitPath(this.settings.gitPath),this.settings.gitPath=void 0,await this.saveSettings()),this.settings.username!=null&&(this.localStorage.setPassword(this.settings.username),this.settings.username=void 0,await this.saveSettings())}unloadPlugin(){var r,i;this.gitReady=!1,this.editorIntegration.onUnloadPlugin(),this.automaticsManager.unload(),(r=this.branchBar)==null||r.remove(),(i=this.statusBar)==null||i.remove(),this.statusBar=void 0,this.branchBar=void 0,this.gitManager.unload(),this.promiseQueue.clear();for(let n of this.intervalsToClear)window.clearInterval(n);this.intervalsToClear=[],this.debRefresh.cancel()}onunload(){this.unloadPlugin(),console.log("unloading "+this.manifest.name+" plugin")}async loadSettings(){let r=await this.loadData();r==null&&(r={showedMobileNotice:!0}),this.settings=Uk(pt,r)}async saveSettings(){var r;(r=this.settingsTab)==null||r.beforeSaveSettings(),await this.saveData(this.settings)}get useSimpleGit(){return Se.Platform.isDesktopApp}async init({fromReload:r=!1}){var i;if(this.settings.showStatusBar&&!this.statusBar){let n=this.addStatusBarItem();this.statusBar=new wh(n,this),this.intervalsToClear.push(window.setInterval(()=>{var s;return(s=this.statusBar)==null?void 0:s.display()},1e3))}try{this.useSimpleGit?(this.gitManager=new Ce(this),await this.gitManager.setGitInstance()):this.gitManager=new Vi(this);let n=await this.gitManager.checkRequirements(),s=this.localStorage.getPausedAutomatics();switch(n){case"missing-git":this.displayError(`Cannot run git command. Trying to run: '${this.localStorage.getGitPath()||"git"}' .`);break;case"missing-repo":new Se.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}),Se.Platform.isDesktop&&this.settings.showBranchStatusBar&&!this.branchBar){let a=this.addStatusBarItem();this.branchBar=new Mp(a,this),this.intervalsToClear.push(window.setInterval(()=>{var o;(o=this.branchBar)==null?void 0:o.display().catch(console.error)},6e4))}await((i=this.branchBar)==null?void 0:i.display()),this.editorIntegration.onReady(),this.app.workspace.trigger("obsidian-git:refresh"),this.app.workspace.trigger("obsidian-git:head-change"),!r&&this.settings.autoPullOnBoot&&!s&&this.promiseQueue.addTask(()=>this.pullChangesFromRemote()),s||await this.automaticsManager.init(),s&&new Se.Notice("Automatic routines are currently paused.");break;default:this.log("Something weird happened. The 'checkRequirements' result is "+n)}}catch(n){this.displayError(n),console.error(n)}}async createNewRepo(){try{await this.gitManager.init(),new Se.Notice("Initialized new repo"),await this.init({fromReload:!0})}catch(r){this.displayError(r)}}async cloneNewRepo(){let i=await new tt(this,{placeholder:"Enter remote URL"}).openAndGetResult();if(i){let n="Vault Root",s=await new tt(this,{options:this.gitManager instanceof Vi?[n]:[],placeholder:"Enter directory for clone. It needs to be empty or not existent.",allowEmpty:this.gitManager instanceof Vi}).openAndGetResult();if(s==null)return;if(s===n&&(s="."),s=(0,Se.normalizePath)(s),s==="/"&&(s="."),s==="."){let f=await new tt(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 Se.Notice("Aborted clone");return}else if(f==="YES"){let d="DELETE ALL YOUR LOCAL CONFIG AND PLUGINS";if(await new tt(this,{options:["Abort clone",d],placeholder:`To avoid conflicts, the local ${this.app.vault.configDir} directory needs to be deleted.`,onlySelection:!0}).openAndGetResult()===d)await this.app.vault.adapter.rmdir(this.app.vault.configDir,!0);else{new Se.Notice("Aborted clone");return}}}let a=await new tt(this,{placeholder:"Specify depth of clone. Leave empty for full clone.",allowEmpty:!0}).openAndGetResult(),o;if(a===void 0){new Se.Notice("Aborted clone");return}if(a!==""&&(o=parseInt(a),isNaN(o))){new Se.Notice("Invalid depth. Aborting clone.");return}new Se.Notice(`Cloning new repo into "${s}"`);let l=this.settings.basePath,c=s&&s!==".";c&&(this.settings.basePath=s);try{await this.gitManager.clone(av(i),s,o),new Se.Notice("Cloned new repo."),new Se.Notice("Please restart Obsidian"),c&&await this.saveSettings()}catch(u){this.displayError(u),this.settings.basePath=l,await this.saveSettings()}}}async isAllInitialized(){return this.gitReady||await this.init({fromReload:!0}),this.gitReady}async pullChangesFromRemote(){if(!await this.isAllInitialized())return;let r=await this.pull();if(r!==!1){if(r||this.displayMessage("Pull: Everything is up-to-date"),this.gitManager instanceof Ce){let i=await this.updateCachedStatus();i.conflicted.length>0&&(this.displayError(`You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted))}this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0})}}async commitAndSync({fromAutoBackup:r,requestCustomMessage:i=!1,commitMessage:n,onlyStaged:s=!1}){!await this.isAllInitialized()||(this.settings.syncMethod=="reset"&&this.settings.pullBeforePush&&await this.pull(),!await this.commit({fromAuto:r,requestCustomMessage:i,commitMessage:n,onlyStaged:s}))||(this.settings.syncMethod!="reset"&&this.settings.pullBeforePush&&await this.pull(),this.settings.disablePush||(await this.remotesAreSet()&&await this.gitManager.canPush()?await this.push():this.displayMessage("No commits to push")),this.setPluginState({gitAction:0}))}async commit({fromAuto:r,requestCustomMessage:i=!1,onlyStaged:n=!1,commitMessage:s,amend:a=!1}){if(!await this.isAllInitialized())return!1;try{let o=this.localStorage.getConflict(),l,c=[],u=[];if(this.gitManager instanceof Ce){if(await this.mayDeleteConflictFile(),l=await this.updateCachedStatus(),l.conflicted.length==0&&(o=!1),r&&l.conflicted.length>0)return this.displayError(`Did not commit, because you have conflicts in ${l.conflicted.length} ${l.conflicted.length==1?"file":"files"}. Please resolve them and commit per command.`),await this.handleConflict(l.conflicted),!1;c=l.staged,u=l.changed}else{if(r&&o)return this.displayError("Did not commit, because you have conflicts. Please resolve them and commit per command."),!1;{o&&await this.mayDeleteConflictFile();let f=this.gitManager;n?c=await f.getStagedFiles():u=(await f.getUnstagedFiles()).map(({path:h,type:p})=>({vaultPath:this.gitManager.getRelativeVaultPath(h),path:h,type:p}))}}if(await this.tools.hasTooBigFiles(n?c:[...c,...u]))return this.setPluginState({gitAction:0}),!1;if(u.length+c.length!==0||o){let f=s!=null?s:s=r?this.settings.autoCommitMessage:this.settings.commitMessage;if(r&&this.settings.customMessageOnAutoBackup||i){!this.settings.disablePopups&&r&&new Se.Notice("Auto backup: Please enter a custom commit message. Leave empty to abort");let p=await new bh(this).openAndGetResult();if(p!=null&&p!=""&&p!="...")f=p;else return this.setPluginState({gitAction:0}),!1}else if(this.gitManager instanceof Ce&&this.settings.commitMessageScript){let p=this.settings.commitMessageScript,g=this.localStorage.getHostname()||"",w=p.replace("{{hostname}}",g);w=w.replace("{{date}}",(0,Se.moment)().format(this.settings.commitDateFormat));let y="sh";if(Se.Platform.isWin){y=process.env.PROGRAMFILES+"\\Git\\bin\\sh.exe";let S=!1;try{await zp.access(y,zp.constants.X_OK),S=!0}catch(C){S=!1}if(!S)return this.displayError(`Cannot find sh.exe at ${y}. Please make sure Git is properly installed.`),!1}let b=await wu(y,["-c",w],{cwd:this.gitManager.absoluteRepoPath});b.code!=0?this.displayError(b.stderr):b.stdout.trim().length==0?this.displayMessage("Stdout from commit message script is empty. Using default message."):f=b.stdout}if(!f||f.trim()==="")return new Se.Notice("Commit aborted: No commit message provided"),this.setPluginState({gitAction:0}),!1;let d;n?d=await this.gitManager.commit({message:f,amend:a}):d=await this.gitManager.commitAll({message:f,status:l,unstagedFiles:u,amend:a}),this.gitManager instanceof Ce&&await this.updateCachedStatus();let h=!1;d===void 0&&(h=!0,d=u.length+c.length||0),this.displayMessage(`Committed${h?" approx.":""} ${d} ${d==1?"file":"files"}`)}else this.displayMessage("No changes to commit");return this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(o){return this.displayError(o),!1}}async push(){if(!await this.isAllInitialized()||!await this.remotesAreSet())return!1;let r=this.localStorage.getConflict();try{this.gitManager instanceof Ce&&await this.mayDeleteConflictFile();let i;if(this.gitManager instanceof Ce&&(i=await this.updateCachedStatus()).conflicted.length>0)return this.displayError(`Cannot push. You have conflicts in ${i.conflicted.length} ${i.conflicted.length==1?"file":"files"}`),await this.handleConflict(i.conflicted),!1;if(this.gitManager instanceof Vi&&r)return this.displayError("Cannot push. You have conflicts"),!1;this.log("Pushing....");let n=await this.gitManager.push();return n!==void 0&&(n===null?this.displayMessage("Pushed to remote"):n>0?this.displayMessage(`Pushed ${n} ${n==1?"file":"files"} to remote`):this.displayMessage("No commits to push")),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh"),!0}catch(i){return i instanceof nl?this.handleNoNetworkError(i):this.displayError(i),!1}}async pull(){if(!await this.remotesAreSet())return!1;try{this.log("Pulling....");let r=await this.gitManager.pull()||[];return this.setPluginState({offlineMode:!1}),r.length>0&&(this.displayMessage(`Pulled ${r.length} ${r.length==1?"file":"files"} from remote`),this.lastPulledFiles=r),r.length}catch(r){return this.displayError(r),!1}}async fetch(){if(await this.remotesAreSet())try{await this.gitManager.fetch(),this.displayMessage("Fetched from remote"),this.setPluginState({offlineMode:!1}),this.app.workspace.trigger("obsidian-git:refresh")}catch(r){this.displayError(r)}}async mayDeleteConflictFile(){let r=this.app.vault.getAbstractFileByPath(il);r&&(this.app.workspace.iterateAllLeaves(i=>{var n;i.view instanceof Se.MarkdownView&&((n=i.view.file)==null?void 0:n.path)==r.path&&i.detach()}),await this.app.vault.delete(r))}async stageFile(r){return await this.isAllInitialized()?(await this.gitManager.stage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async unstageFile(r){return await this.isAllInitialized()?(await this.gitManager.unstage(r.path,!0),this.app.workspace.trigger("obsidian-git:refresh"),this.setPluginState({gitAction:0}),!0):!1}async switchBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo(),i=await new Fp(this,r.branches).openAndGetReslt();if(i!=null)return await this.gitManager.checkout(i),this.displayMessage(`Switched to ${i}`),this.app.workspace.trigger("obsidian-git:refresh"),await((n=this.branchBar)==null?void 0:n.display()),i}async switchRemoteBranch(){var s;if(!await this.isAllInitialized())return;let r=await this.selectRemoteBranch()||"",[i,n]=Yn(r);if(n!=null&&i!=null)return await this.gitManager.checkout(n,i),this.displayMessage(`Switched to ${r}`),await((s=this.branchBar)==null?void 0:s.display()),r}async createBranch(){var i;if(!await this.isAllInitialized())return;let r=await new tt(this,{placeholder:"Create new branch"}).openAndGetResult();if(r!=null)return await this.gitManager.createBranch(r),this.displayMessage(`Created new branch ${r}`),await((i=this.branchBar)==null?void 0:i.display()),r}async deleteBranch(){var n;if(!await this.isAllInitialized())return;let r=await this.gitManager.branchInfo();r.current&&r.branches.remove(r.current);let i=await new tt(this,{options:r.branches,placeholder:"Delete branch",onlySelection:!0}).openAndGetResult();if(i!=null){let s=!1;if(!await this.gitManager.branchIsMerged(i)){let o=await new tt(this,{options:["YES","NO"],placeholder:"This branch isn't merged into HEAD. Force delete?",onlySelection:!0}).openAndGetResult();if(o!=="YES")return;s=o==="YES"}return await this.gitManager.deleteBranch(i,s),this.displayMessage(`Deleted branch ${i}`),await((n=this.branchBar)==null?void 0:n.display()),i}}async remotesAreSet(){return this.settings.updateSubmodules||this.gitManager instanceof Ce&&await this.gitManager.getConfig("push.autoSetupRemote","all")=="true"||(await this.gitManager.branchInfo()).tracking?!0:(new Se.Notice("No upstream branch is set. Please select one."),await this.setUpstreamBranch())}async setUpstreamBranch(){let r=await this.selectRemoteBranch();return r==null?(this.displayError("Aborted. No upstream-branch is set!",1e4),this.setPluginState({gitAction:0}),!1):(await this.gitManager.updateUpstreamBranch(r),this.displayMessage(`Set upstream branch to ${r}`),this.setPluginState({gitAction:0}),!0)}async discardAll(r){if(!await this.isAllInitialized())return!1;let i=await this.gitManager.status({path:r}),n=0,s=0;for(let o of i.changed)o.workingDir=="U"?n++:s++;if(n+s==0)return!1;let a=await new pc({app:this.app,filesToDeleteCount:n,filesToDiscardCount:s,path:r!=null?r:""}).openAndGetResult();switch(a){case!1:return a;case"discard":await this.gitManager.discardAll({dir:r,status:this.cachedStatus});break;case"delete":{await this.gitManager.discardAll({dir:r,status:this.cachedStatus});let o=await this.gitManager.getUntrackedPaths({path:r,status:this.cachedStatus});for(let l of o){let c=this.gitManager.getRelativeVaultPath(l),u=this.app.vault.getAbstractFileByPath(c);u?await this.app.fileManager.trashFile(u):l.endsWith("/")?await this.app.vault.adapter.rmdir(c,!0):await this.app.vault.adapter.remove(c)}break}default:Md(a)}return this.app.workspace.trigger("obsidian-git:refresh"),a}async handleConflict(r){this.localStorage.setConflict(!0);let i;r!==void 0&&(i=["# Conflicts","Please resolve them and commit them using the commands `Git: Commit all changes` followed by `Git: Push`","(This file will automatically be deleted before commit)","[[#Additional Instructions]] available below file list","",...r.map(n=>{let s=this.app.vault.getAbstractFileByPath(n);return s instanceof Se.TFile?`- [[${this.app.metadataCache.fileToLinktext(s,"/")}]]`:`- Not a file: ${n}`}),` +# Additional Instructions +I strongly recommend to use "Source mode" for viewing the conflicted files. For simple conflicts, in each file listed above replace every occurrence of the following text blocks with the desired text. + +\`\`\`diff +<<<<<<< HEAD + File changes in local repository +======= + File changes in remote repository +>>>>>>> origin/main +\`\`\``]),await this.tools.writeAndOpenFile(i==null?void 0:i.join(` +`))}async editRemotes(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new tt(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}).openAndGetResult();if(n){let s=await this.gitManager.getRemoteUrl(n),o=await new tt(this,{initialValue:s,placeholder:"Enter remote URL"}).openAndGetResult();if(o)return await this.gitManager.setRemote(n,av(o)),n}}async selectRemoteBranch(){let r=await this.gitManager.getRemotes(),i;r.length===0&&(i=await this.editRemotes(),i==null&&(r=await this.gitManager.getRemotes()));let n=new tt(this,{options:r,placeholder:"Select or create a new remote by typing its name and selecting it"}),s=i!=null?i:await n.openAndGetResult();if(s){this.displayMessage("Fetching remote branches"),await this.gitManager.fetch(s);let a=await this.gitManager.getRemoteBranches(s),l=await new tt(this,{options:a,placeholder:"Select or create a new remote branch by typing its name and selecting it"}).openAndGetResult();return l==null?void 0:l.startsWith(s+"/")?l:`${s}/${l}`}}async removeRemote(){if(!await this.isAllInitialized())return;let r=await this.gitManager.getRemotes(),n=await new tt(this,{options:r,placeholder:"Select a remote"}).openAndGetResult();n&&await this.gitManager.removeRemote(n)}onActiveLeafChange(r){var a,o;let i=r==null?void 0:r.view;if(!(i!=null&&i.getState().file)&&!(i instanceof Ha||i instanceof Ua))return;let n=this.app.workspace.getLeavesOfType(Qt.type).first(),s=this.app.workspace.getLeavesOfType(bi.type).first();if((a=n==null?void 0:n.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||a.removeClass("is-active"),(o=s==null?void 0:s.view.containerEl.querySelector("div.tree-item-self.is-active"))==null||o.removeClass("is-active"),(r==null?void 0:r.view)instanceof Ha||(r==null?void 0:r.view)instanceof Ua){let c=r.view.state.bFile.replace(/["\\]/g,"\\$&");this.lastDiffViewState=r.view.getState();let u;n&&r.view.state.aRef=="HEAD"?u=n.view.containerEl.querySelector(`div.staged div.tree-item-self[data-path="${c}"]`):n&&r.view.state.aRef==""?u=n.view.containerEl.querySelector(`div.changes div.tree-item-self[data-path="${c}"]`):s&&(u=s.view.containerEl.querySelector(`div.tree-item-self[data-path='${c}']`)),u==null||u.addClass("is-active")}else this.lastDiffViewState=void 0}handleNoNetworkError(r){this.state.offlineMode?this.log("Encountered network error, but already in offline mode"):this.displayError("Git: Going into offline mode. Future network errors will no longer be displayed.",2e3),this.setPluginState({gitAction:0,offlineMode:!0})}displayMessage(r,i=4*1e3){var n;(n=this.statusBar)==null||n.displayMessage(r.toLowerCase(),i),this.settings.disablePopups||(!this.settings.disablePopupsForNoChanges||!r.startsWith("No changes"))&&new Se.Notice(r,5*1e3),this.log(r)}displayError(r,i=10*1e3){var s;if(r instanceof hF.Errors.UserCanceledError){new Se.Notice("Aborted");return}let n;r instanceof Error?n=r:n=new Error(String(r)),this.setPluginState({gitAction:0}),this.settings.showErrorNotices&&new Se.Notice(n.message,i),console.error(`${this.manifest.id}:`,n.stack),(s=this.statusBar)==null||s.displayMessage(n.message.toLowerCase(),i)}log(...r){console.log(`${this.manifest.id}:`,...r)}}; +/*! Bundled license information: + +ieee754/index.js: + (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) + +buffer/index.js: + (*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + *) + +safe-buffer/index.js: + (*! safe-buffer. MIT License. Feross Aboukhadijeh *) + +crc-32/crc32.js: + (*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com *) + +isomorphic-git/index.cjs: + (*! + * This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements. + * SPDX-License-Identifier: LGPL-3.0-or-later + * Copyright (c) James Prevett and other ZenFS contributors. + *) + +js-sha256/src/sha256.js: + (** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.11.1 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2025 + * @license MIT + *) +*/ + +/* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-git/manifest.json b/.obsidian/plugins/obsidian-git/manifest.json new file mode 100644 index 0000000..a64bcac --- /dev/null +++ b/.obsidian/plugins/obsidian-git/manifest.json @@ -0,0 +1,10 @@ +{ + "author": "Vinzent", + "authorUrl": "https://github.com/Vinzent03", + "id": "obsidian-git", + "name": "Git", + "description": "Integrate Git version control with automatic backup and other advanced features.", + "isDesktopOnly": false, + "fundingUrl": "https://ko-fi.com/vinzent", + "version": "2.38.5" +} diff --git a/.obsidian/plugins/obsidian-git/styles.css b/.obsidian/plugins/obsidian-git/styles.css new file mode 100644 index 0000000..7dee885 --- /dev/null +++ b/.obsidian/plugins/obsidian-git/styles.css @@ -0,0 +1,705 @@ +@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-left: 0; + padding-top: 0; + padding-right: 0; +} + +.workspace-leaf-content[data-type="git-history-view"] .view-content { + padding-left: 0; + padding-top: 0; + padding-right: 0; +} + +.loading { + overflow: hidden; +} + +.loading > svg { + animation: 2s linear infinite loading; + transform-origin: 50% 50%; + display: inline-block; +} + +.obsidian-git-center { + margin: auto; + text-align: center; + width: 50%; +} + +.obsidian-git-textarea { + display: block; + margin-left: auto; + margin-right: auto; +} + +.obsidian-git-disabled { + opacity: 0.5; +} + +.obsidian-git-center-button { + display: block; + margin: 20px auto; +} + +.tooltip.mod-left { + overflow-wrap: break-word; +} + +.tooltip.mod-right { + overflow-wrap: break-word; +} + +/* Limits the scrollbar to the view body */ +.git-view { + display: flex; + flex-direction: column; + position: relative; + height: 100%; +} + +/* Re-enable wrapping of nav buttns to prevent overflow on smaller screens #*/ +.workspace-drawer .git-view .nav-buttons-container { + flex-wrap: wrap; +} + +.git-tools { + display: flex; + margin-left: auto; +} +.git-tools .type { + padding-left: var(--size-2-1); + display: flex; + align-items: center; + justify-content: center; + width: 11px; +} + +.git-tools .type[data-type="M"] { + color: orange; +} +.git-tools .type[data-type="D"] { + color: red; +} +.git-tools .buttons { + display: flex; +} +.git-tools .buttons > * { + padding: 0; + height: auto; +} + +.workspace-leaf-content[data-type="git-view"] .tree-item-self, +.workspace-leaf-content[data-type="git-history-view"] .tree-item-self { + align-items: center; +} + +.workspace-leaf-content[data-type="git-view"] + .tree-item-self:hover + .clickable-icon, +.workspace-leaf-content[data-type="git-history-view"] + .tree-item-self:hover + .clickable-icon { + color: var(--icon-color-hover); +} + +/* Highlight an item as active if it's diff is currently opened */ +.is-active .git-tools .buttons > * { + color: var(--nav-item-color-active); +} + +.git-author { + color: var(--text-accent); +} + +.git-date { + color: var(--text-accent); +} + +.git-ref { + color: var(--text-accent); +} + +/* ====== diff2html ====== +The following styles are adapted from the obsidian-version-history plugin by +@kometenstaub https://github.com/kometenstaub/obsidian-version-history-diff/blob/main/src/styles.scss +which itself is adapted from the diff2html library with the following original license: + + https://github.com/rtfpessoa/diff2html/blob/master/LICENSE.md + + Copyright 2014-2016 Rodrigo Fernandes https://rtfpessoa.github.io/ + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +.theme-dark, +.theme-light { + --git-delete-bg: #ff475040; + --git-delete-hl: #96050a75; + --git-insert-bg: #68d36840; + --git-insert-hl: #23c02350; + --git-change-bg: #ffd55840; + --git-selected: #3572b0; + + --git-delete: #cc3333; + --git-insert: #399839; + --git-change: #d0b44c; + --git-move: #3572b0; +} + +.git-diff { + .d2h-d-none { + display: none; + } + .d2h-wrapper { + text-align: left; + border-radius: 0.25em; + overflow: auto; + } + .d2h-file-header.d2h-file-header { + background-color: var(--background-secondary); + border-bottom: 1px solid var(--background-modifier-border); + font-family: + Source Sans Pro, + Helvetica Neue, + Helvetica, + Arial, + sans-serif; + height: 35px; + padding: 5px 10px; + } + .d2h-file-header, + .d2h-file-stats { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + } + .d2h-file-header { + display: none; + } + .d2h-file-stats { + font-size: 14px; + margin-left: auto; + } + .d2h-lines-added { + border: 1px solid var(--color-green); + border-radius: 5px 0 0 5px; + color: var(--color-green); + padding: 2px; + text-align: right; + vertical-align: middle; + } + .d2h-lines-deleted { + border: 1px solid var(--color-red); + border-radius: 0 5px 5px 0; + color: var(--color-red); + margin-left: 1px; + padding: 2px; + text-align: left; + vertical-align: middle; + } + .d2h-file-name-wrapper { + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 15px; + width: 100%; + } + .d2h-file-name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + color: var(--text-normal); + font-size: var(--h5-size); + } + .d2h-file-wrapper { + border: 1px solid var(--background-secondary-alt); + border-radius: 3px; + margin-bottom: 1em; + max-height: 100%; + } + .d2h-file-collapse { + -webkit-box-pack: end; + -ms-flex-pack: end; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + border: 1px solid var(--background-secondary-alt); + border-radius: 3px; + cursor: pointer; + display: none; + font-size: 12px; + justify-content: flex-end; + padding: 4px 8px; + } + .d2h-file-collapse.d2h-selected { + background-color: var(--git-selected); + } + .d2h-file-collapse-input { + margin: 0 4px 0 0; + } + .d2h-diff-table { + border-collapse: collapse; + font-family: var(--font-monospace); + font-size: var(--code-size); + width: 100%; + } + .d2h-files-diff { + width: 100%; + } + .d2h-file-diff { + /* + overflow-y: scroll; + */ + border-radius: 5px; + font-size: var(--font-text-size); + line-height: var(--line-height-normal); + } + .d2h-file-side-diff { + display: inline-block; + margin-bottom: -8px; + margin-right: -4px; + overflow-x: scroll; + overflow-y: hidden; + width: 50%; + } + .d2h-code-line { + padding-left: 6em; + padding-right: 1.5em; + } + .d2h-code-line, + .d2h-code-side-line { + display: inline-block; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: 100%; + } + .d2h-code-side-line { + /* needed to be changed */ + padding-left: 0.5em; + padding-right: 0.5em; + } + .d2h-code-line-ctn { + word-wrap: normal; + background: none; + display: inline-block; + padding: 0; + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; + vertical-align: middle; + width: 100%; + /* only works for line-by-line */ + white-space: pre-wrap; + } + .d2h-code-line del, + .d2h-code-side-line del { + background-color: var(--git-delete-hl); + color: var(--text-normal); + } + .d2h-code-line del, + .d2h-code-line ins, + .d2h-code-side-line del, + .d2h-code-side-line ins { + border-radius: 0.2em; + display: inline-block; + margin-top: -1px; + text-decoration: none; + vertical-align: middle; + } + .d2h-code-line ins, + .d2h-code-side-line ins { + background-color: var(--git-insert-hl); + text-align: left; + } + .d2h-code-line-prefix { + word-wrap: normal; + background: none; + display: inline; + padding: 0; + white-space: pre; + } + .line-num1 { + float: left; + } + .line-num1, + .line-num2 { + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + /* + padding: 0 0.5em; + */ + text-overflow: ellipsis; + width: 2.5em; + padding-left: 0; + } + .line-num2 { + float: right; + } + .d2h-code-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-faint); + cursor: pointer; + display: inline-block; + position: absolute; + text-align: right; + width: 5.5em; + } + .d2h-code-linenumber:after { + content: "\200b"; + } + .d2h-code-side-linenumber { + background-color: var(--background-primary); + border: solid var(--background-modifier-border); + border-width: 0 1px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + color: var(--text-faint); + cursor: pointer; + overflow: hidden; + padding: 0 0.5em; + text-align: right; + text-overflow: ellipsis; + width: 4em; + /* needed to be changed */ + display: table-cell; + position: relative; + } + .d2h-code-side-linenumber:after { + content: "\200b"; + } + .d2h-code-side-emptyplaceholder, + .d2h-emptyplaceholder { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + } + .d2h-code-line-prefix, + .d2h-code-linenumber, + .d2h-code-side-linenumber, + .d2h-emptyplaceholder { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + .d2h-code-linenumber, + .d2h-code-side-linenumber { + direction: rtl; + } + .d2h-del { + background-color: var(--git-delete-bg); + border-color: var(--git-delete-hl); + } + .d2h-ins { + background-color: var(--git-insert-bg); + border-color: var(--git-insert-hl); + } + .d2h-info { + background-color: var(--background-primary); + border-color: var(--background-modifier-border); + color: var(--text-faint); + } + .d2h-del, + .d2h-ins, + .d2h-file-diff .d2h-change { + color: var(--text-normal); + } + .d2h-file-diff .d2h-del.d2h-change { + background-color: var(--git-change-bg); + } + .d2h-file-diff .d2h-ins.d2h-change { + background-color: var(--git-insert-bg); + } + .d2h-file-list-wrapper { + a { + text-decoration: none; + cursor: default; + -webkit-user-drag: none; + } + + svg { + display: none; + } + } + .d2h-file-list-header { + text-align: left; + } + .d2h-file-list-title { + display: none; + } + .d2h-file-list-line { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + text-align: left; + } + .d2h-file-list { + } + .d2h-file-list > li { + border-bottom: 1px solid var(--background-modifier-border); + margin: 0; + padding: 5px 10px; + } + .d2h-file-list > li:last-child { + border-bottom: none; + } + .d2h-file-switch { + cursor: pointer; + display: none; + font-size: 10px; + } + .d2h-icon { + fill: currentColor; + margin-right: 10px; + vertical-align: middle; + } + .d2h-deleted { + color: var(--git-delete); + } + .d2h-added { + color: var(--git-insert); + } + .d2h-changed { + color: var(--git-change); + } + .d2h-moved { + color: var(--git-move); + } + .d2h-tag { + background-color: var(--background-secondary); + display: -webkit-box; + display: -ms-flexbox; + display: flex; + font-size: 10px; + margin-left: 5px; + padding: 0 2px; + } + .d2h-deleted-tag { + border: 1px solid var(--git-delete); + } + .d2h-added-tag { + border: 1px solid var(--git-insert); + } + .d2h-changed-tag { + border: 1px solid var(--git-change); + } + .d2h-moved-tag { + border: 1px solid var(--git-move); + } + + /* needed for line-by-line*/ + + .d2h-diff-tbody { + position: relative; + } + + /* My additions */ + .cm-merge-revert { + width: 4em; + } + /* Ensure that merge revert markers are positioned correctly */ + .cm-merge-revert > * { + position: absolute; + background-color: var(--background-secondary); + display: flex; + } +} + +/* ====================== 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; + 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; + white-space: pre; /* Keep spaces and do not collapse them. */ +} + +@media (max-width: 800px) { + /* hide git blame gutter not to superpose text */ + .cm-gutterElement.obs-git-blame-gutter { + display: none; + } +} + +.git-unified-diff-view, +.git-split-diff-view .cm-deletedLine .cm-changedText { + background-color: #ee443330; +} + +.git-unified-diff-view, +.git-split-diff-view .cm-insertedLine .cm-changedText { + background-color: #22bb2230; +} + +.git-obscure-prompt[git-is-obscured="true"] #git-show-password:after { + -webkit-mask-image: url('data:image/svg+xml,'); +} + +.git-obscure-prompt[git-is-obscured="false"] #git-show-password:after { + -webkit-mask-image: url('data:image/svg+xml,'); +} + +/* Override styling of Codemirror merge view "collapsed lines" indicator */ +.git-split-diff-view .ͼ2 .cm-collapsedLines { + background: var(--interactive-normal); + border-radius: var(--radius-m); + color: var(--text-accent); + font-size: var(--font-small); + padding: var(--size-4-1) var(--size-4-1); +} +.git-split-diff-view .ͼ2 .cm-collapsedLines:hover { + background: var(--interactive-hover); + color: var(--text-accent-hover); +} + +.git-signs-gutter { + .cm-gutterElement { + display: grid; + + /* Needed to align the sign properly for different line heigts. Such as + * when having a heading or list item. + */ + padding-top: 0 !important; + } +} + +.git-gutter-marker:hover { + border-radius: 2px; +} + +.git-gutter-marker.git-add { + background-color: var(--color-green); + justify-self: center; + height: inherit; + width: 0.2rem; +} + +.git-gutter-marker.git-change { + background-color: var(--color-yellow); + justify-self: center; + height: inherit; + width: 0.2rem; +} + +.git-gutter-marker.git-changedelete { + color: var(--color-yellow); + font-weight: var(--font-bold); + font-size: 1rem; + justify-self: center; + height: inherit; +} + +.git-gutter-marker.git-delete { + background-color: var(--color-red); + height: 0.2rem; + width: 0.8rem; + align-self: end; +} + +.git-gutter-marker.git-topdelete { + background-color: var(--color-red); + height: 0.2rem; + width: 0.8rem; + align-self: start; +} + +div:hover > .git-gutter-marker.git-change { + width: 0.6rem; +} + +div:hover > .git-gutter-marker.git-add { + width: 0.6rem; +} + +div:hover > .git-gutter-marker.git-delete { + height: 0.6rem; +} + +div:hover > .git-gutter-marker.git-topdelete { + height: 0.6rem; +} + +div:hover > .git-gutter-marker.git-changedelete { + font-weight: var(--font-bold); +} + +.git-gutter-marker.staged { + opacity: 0.5; +} + +/* Prevent shifting of the editor when git signs gutter is the only gutter present */ +.cm-gutters.cm-gutters-before:has(> .git-signs-gutter:only-child) { + margin-inline-end: 0; + .git-signs-gutter { + margin-inline-start: -1rem; + } +} + +.git-changes-status-bar-colored { + .git-add { + color: var(--color-green); + } + .git-change { + color: var(--color-yellow); + } + .git-delete { + color: var(--color-red); + } +} + +.git-changes-status-bar .git-add { + margin-right: 0.3em; +} + +.git-changes-status-bar .git-change { + margin-right: 0.3em; +} diff --git a/.obsidian/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