@kumori/kdsl 0.0.54 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +9 -3
- package/dist/build/helpers/deployment.d.ts +13 -13
- package/dist/build/main.js +32 -13
- package/dist/build/main.js.map +1 -1
- package/dist/deployment/gen/deployment-template.kumori +1 -1
- package/dist/deployment/gen/main.d.ts +1 -2
- package/dist/deployment/gen/main.js +7 -14
- package/dist/deployment/gen/main.js.map +1 -1
- package/dist/index/create/main.d.ts +1 -0
- package/dist/index/create/main.js +35 -15
- package/dist/index/create/main.js.map +1 -1
- package/dist/index/create/types.d.ts +1 -1
- package/dist/index/main.js +2 -0
- package/dist/index/main.js.map +1 -1
- package/dist/index/remove/main.d.ts +11 -0
- package/dist/index/remove/main.js +136 -0
- package/dist/index/remove/main.js.map +1 -0
- package/dist/lib/build.js +29 -42
- package/dist/lib/check.js +15 -45
- package/dist/lib/clean.js +1 -39
- package/dist/lib/deployment.d.ts +0 -3
- package/dist/lib/deployment.js +1 -5
- package/dist/lib/deployment.js.map +1 -1
- package/dist/lib/index-cmd.js +151 -60
- package/dist/lib/index.js +260 -54
- package/dist/lib/mod.js +78 -144
- package/dist/lib/registry.js +1 -67
- package/dist/mod/dependency/main.js +3 -4
- package/dist/mod/dependency/main.js.map +1 -1
- package/dist/mod/jsonschema/gen/main.js +3 -5
- package/dist/mod/jsonschema/gen/main.js.map +1 -1
- package/dist/mod/update/main.js +2 -2
- package/dist/mod/update/main.js.map +1 -1
- package/dist/util/git-or-fs-client.d.ts +13 -0
- package/dist/util/git-or-fs-client.js +86 -0
- package/dist/util/git-or-fs-client.js.map +1 -0
- package/out/deployment/gen/deployment-template.kumori +1 -1
- package/package.json +25 -15
- package/dist/lib/io/lib.kumori +0 -3
- package/dist/lib/kumori/builtin/apiserver.h.kumori +0 -19
- package/dist/lib/kumori/builtin/httpinbound.h.kumori +0 -34
- package/dist/lib/kumori/builtin/tcpinbound.h.kumori +0 -23
- package/dist/lib/kumori/builtin.kumori +0 -16
- package/dist/lib/kumori/component.kumori +0 -120
- package/dist/lib/kumori/deployment.kumori +0 -14
- package/dist/lib/kumori/resource.kumori +0 -23
- package/dist/lib/kumori/service.kumori +0 -51
- package/dist/lib/kumori/shared.kumori +0 -18
- package/dist/lib/kumori/sized.kumori +0 -25
- package/dist/lib/sized.kumori +0 -8
- package/dist/lib/std.kumori +0 -8
- package/dist/lib/strconv/lib.kumori +0 -9
- package/out/deployment-template.kumori +0 -33
- package/out/lib/io/lib.kumori +0 -3
- package/out/lib/kumori/builtin/apiserver.h.kumori +0 -19
- package/out/lib/kumori/builtin/httpinbound.h.kumori +0 -34
- package/out/lib/kumori/builtin/tcpinbound.h.kumori +0 -23
- package/out/lib/kumori/builtin.kumori +0 -16
- package/out/lib/kumori/component.kumori +0 -120
- package/out/lib/kumori/deployment.kumori +0 -14
- package/out/lib/kumori/resource.kumori +0 -23
- package/out/lib/kumori/service.kumori +0 -51
- package/out/lib/kumori/shared.kumori +0 -18
- package/out/lib/kumori/sized.kumori +0 -25
- package/out/lib/sized.kumori +0 -8
- package/out/lib/std.kumori +0 -8
- package/out/lib/strconv/lib.kumori +0 -9
- package/out/main.cjs +0 -820
package/dist/lib/index.js
CHANGED
|
@@ -1,54 +1,260 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
*
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
import{createRequire as lk}from"node:module";var gk=Object.create;var{getPrototypeOf:xk,defineProperty:M7,getOwnPropertyNames:nk}=Object;var ck=Object.prototype.hasOwnProperty;var P$=(q,$,K)=>{K=q!=null?gk(xk(q)):{};let P=$||!q||!q.__esModule?M7(K,"default",{value:q,enumerable:!0}):K;for(let _ of nk(q))if(!ck.call(P,_))M7(P,_,{get:()=>q[_],enumerable:!0});return P};var R=(q,$)=>()=>($||q(($={exports:{}}).exports,$),$.exports);var G8=(q,$)=>{for(var K in $)M7(q,K,{get:$[K],enumerable:!0,configurable:!0,set:(P)=>$[K]=()=>P})};var eq=(q,$)=>()=>(q&&($=q(q=0)),$);var fq=lk(import.meta.url),ok=Symbol.dispose||Symbol.for("Symbol.dispose"),ak=Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose"),E9=(q,$,K)=>{if($!=null){if(typeof $!=="object"&&typeof $!=="function")throw TypeError('Object expected to be assigned to "using" declaration');var P;if(K)P=$[ak];if(P===void 0)P=$[ok];if(typeof P!=="function")throw TypeError("Object not disposable");q.push([K,P,$])}else if(K)q.push([K]);return $},p9=(q,$,K)=>{var P=typeof SuppressedError==="function"?SuppressedError:function(Y,w,O,v){return v=Error(O),v.name="SuppressedError",v.error=Y,v.suppressed=w,v},_=(Y)=>$=K?new P(Y,$,"An error was suppressed during disposal"):(K=!0,Y),j=(Y)=>{while(Y=q.pop())try{var w=Y[1]&&Y[1].call(Y[2]);if(Y[0])return Promise.resolve(w).then(j,(O)=>(_(O),j()))}catch(O){_(O)}if(K)throw $};return j()};import{Result as LX}from"@kumori/kdsl-lsp/util/result.js";function j$(q,$){if(LX.isErr($)){for(let K of $.err)q.error(K);process.exit(1)}return $.value}var pP=()=>{};import{ParseQuery as T5}from"@kumori/kdsl-lsp/module/query.js";import{Maybe as DP,None as gX,Some as xX}from"@kumori/kdsl-lsp/util/maybe.js";import{Err as M6,Ok as E7,Result as Q6}from"@kumori/kdsl-lsp/util/result.js";import{Version as O5}from"@kumori/kdsl-lsp/module/version.js";import{ListDependencies as nX}from"@kumori/kdsl-lsp/module/dependency/list.js";import p7 from"assert";import{LocateDependency as H5}from"@kumori/kdsl-lsp/module/dependency/locate.js";import{ModuleContext as cX}from"@kumori/kdsl-lsp/module/context.js";import{MkdirTemp as lX}from"@kumori/kdsl-lsp/util/tmp.js";import{ValidateChecksum as oX}from"@kumori/kdsl-lsp/module/integrity/validate.js";import{URI as aX,UriUtils as rX}from"langium";import{cp as iX,mkdir as tX,rm as z5}from"fs/promises";import{ForURL as BX}from"@kumori/kdsl-lsp/module/remote/factory.js";import{SemVer as W5}from"@kumori/kdsl-lsp/util/semver.js";import{URL as eX}from"@kumori/kdsl-lsp/util/url.js";import{DependencyId as J5}from"@kumori/kdsl-lsp/module/dependency/id.js";async function Z5(q){let $=new Map;return await X5(q,$),$}async function k5(q,$){let K=new Map;console.log($);for(let P of $){let _=T5(P,q.Locations.Config());if(DP.isNone(_)){let O=`invalid download query '${P}': failed to parse`;K.set(P,{...M6(O),required:!0});continue}let j=O5(_.value.Version);if(DP.isNone(j)){let O=`invalid download query '${P}': invalid version specifier '${_.value.Version}': failed to parse`;K.set(P,{...M6(O),required:!0});continue}if(!O5.isSemVer(j.value)){let O=`invalid download query '${P}': invalid version specifier '${_.value.Version}': invalid semver`;K.set(P,{...M6(O),required:!0});continue}let Y=`${_.value.Scheme}://${_.value.Location}`,w=_.value.Version;await f5(q,Y,w,K)}return K}async function X5(q,$){let K=nX(q.Current);for(let P of K.keys()){let _=K.get(P);if(_.length<1)continue;let{target:j,version:Y}=_[0];await f5(q,j,Y,$);let w=_.reduce((v,z)=>v||z.interface===void 0,!1),O=J5(j,Y);p7($.has(O)),$.get(O).required||=w}}async function f5(q,$,K,P){let _=J5($,K);if(P.has(_))return;let j=await UX(q,$,K);if(P.set(_,{...j,required:!1}),Q6.isErr(j))return;let Y=await H5(q,$,K);p7(DP.isSome(Y));let w=await cX.Move(q,q.FS,Y.value.Root);p7(Q6.isOk(w)),q={...q,...w.value},await X5(q,P)}async function UX(q,$,K){let v=[];try{let P=await H5(q,$,K);if(Q6.isOk(P))return E7(gX);const _=E9(v,await lX(),1);let j=await D7(q,$,K,_.Path);if(Q6.isErr(j))return M6(`failed to fetch ${$}@${K}: ${j.err}`);let Y=await oX(q.SumDB,aX.file(_.Path),q,$,j.value);if(Q6.isErr(Y))return Y;let w=`${$}@${K}`;let O=rX.joinPath(q.Locations.Cache(),w);await tX(O.fsPath,{recursive:!0});await z5(O.fsPath,{recursive:!0,force:!0});await iX(_.Path,O.fsPath,{recursive:!0});await z5(_.Path,{recursive:!0,force:!0});return E7(xX(w))}catch(z){var W=z,T=1}finally{var H=p9(v,W,T);H&&await H}}async function D7(q,$,K,P){let _=`${$}@${K}`,j=T5(_,q.Locations.Config());if(DP.isNone(j))return M6(`failed to resolve ${_}: invalid download query`);let Y=W5(j.value.Version),w=new eX(`${j.value.Scheme}://${j.value.Location}`),O=BX(q.Remotes,w);if(Q6.isErr(O))return M6(`failed to resolve ${_}': invalid remote ${w}: ${O.err}`);let v=await O.value.Versions(w);if(Q6.isErr(v))return M6(`failed to read ${w}: ${v.err}`);let z=Y,W=v.value.filter((J)=>W5.Compare(J,z)===0);if(W.length===0)return M6(`no remote matches for ${w}@v${Y}`);if(W.length>1){let J=`[${W.map(String).join(", ")}]`;return M6(`ambiguous match for ${w}@v${Y}: found ${J}`)}let T=W[0],H=await O.value.Get(w,T.toString(),P);if(Q6.isErr(H))return M6(`failed to fetch ${w}@${Y.toString()}: ${H.err}`);return E7(T)}var y7=()=>{};var C5={};G8(C5,{default:()=>jf,Register:()=>h5,Download:()=>C8,Description:()=>V5,Action:()=>M5});import{ModuleContext as FX}from"@kumori/kdsl-lsp/module/context.js";import{SumDB as sX}from"@kumori/kdsl-lsp/module/integrity/sumdb.js";import{RemoteFetcherFactory as A5}from"@kumori/kdsl-lsp/module/remote/factory.js";import{Maybe as QX}from"@kumori/kdsl-lsp/util/maybe.js";import{Err as G5,Ok as qf,Result as OK}from"@kumori/kdsl-lsp/util/result.js";import{URI as $f}from"langium";import{NodeFileSystem as Kf}from"langium/node";import{createKumoriServices as Pf}from"@kumori/kdsl-lsp/language/kumori.js";import{RegistryManager as _f}from"@kumori/kdsl-lsp/module/registry/manager.js";function h5(q,$){return q.command("download").alias("dl").summary(Yf).argument("[module...]").option("-q, --quiet","do not log warnings").description(V5).helpOption(!0).action(M5($))}function M5(q){let $=(K)=>j$(q,K);return async(K,P,_)=>{let j=_?.optsWithGlobals()?.config,Y=Pf(Kf,j).Kumori;await new _f(j).ensureIndexes(),$(await C8(q,Y,process.cwd(),K,P,j))}}var jf,Yf="download modules to local cache",V5,C8=async(q,$,K,P,_,j)=>{let Y=$.shared.workspace.FileSystemProvider,w=await FX(Y,$f.file(K),j);if(OK.isErr(w))return G5([w.err]);let O=await sX.Open(w.value.Locations.Checksum());if(OK.isErr(O))return OK.mapErr(O,(T)=>[T]);let v;if(!P.length)v=await Z5({...w.value,FS:Y,Remotes:A5(),SumDB:O.value});else v=await k5({...w.value,FS:Y,Remotes:A5(),SumDB:O.value},P);let z=[];for(let[T,H]of v){if(OK.isOk(H)){if(QX.isSome(H.value))q.info(`Downloaded dependency ${T}`);continue}if(H.required)z.push(`${T}: ${H.err}`);else if(!_.quiet)q.warn(`${T}: ${H.err}`),q.warn(`${T}: not required - continuing`)}if(Array.from(v.entries()).filter(([,T])=>OK.isErr(T)&&T.required).length>0)return G5(z);return qf(void 0)};var yP=eq(()=>{pP();y7();jf={Register:h5};V5=`
|
|
2
|
+
Downloads the specified modules, which can be module patterns selecting depen-
|
|
3
|
+
dencies of the current module or module queries of the form path@version.
|
|
4
|
+
|
|
5
|
+
With no arguments, download applies to the modules needed to build the packages
|
|
6
|
+
in the current module.
|
|
7
|
+
|
|
8
|
+
The kdsl command will automatically download modules as needed during ordinary
|
|
9
|
+
execution. The "kdsl mod download" command is useful mainly for pre-filling the
|
|
10
|
+
local cache.
|
|
11
|
+
|
|
12
|
+
By default, download writes nothing to standard output. It may print progress
|
|
13
|
+
messages and errors to standard error.
|
|
14
|
+
`.trim()});var E5={};G8(E5,{default:()=>kf,Summary:()=>u5,Register:()=>b5,RawCheck:()=>I5,Description:()=>R5,Check:()=>C6,Action:()=>m5});import{createKumoriServices as wf}from"@kumori/kdsl-lsp/language/kumori.js";import{URI as vf,UriUtils as L7}from"langium";import{NodeFileSystem as Of}from"langium/node";import{DiagnosticSeverity as N5}from"vscode-languageserver";import{Err as d7,Ok as S5,Result as zK}from"@kumori/kdsl-lsp/util/result.js";import{ModuleContext as zf}from"@kumori/kdsl-lsp/module/context.js";import Wf from"node:path";import{RegistryManager as Tf}from"@kumori/kdsl-lsp/module/registry/manager.js";function b5(q,$){return q.command("check").argument("[directory]","directory containing a Kumori module").description(R5).summary(u5).action(m5($))}function m5(q){return async($,K,P)=>{await new Tf(P?.optsWithGlobals()?.config).ensureIndexes();let j=wf(Of).Kumori,Y=j.shared.workspace.FileSystemProvider,w=(z)=>j$(q,z),O=P?.optsWithGlobals()?.config,v=w(zK.mapErr(await zf(Y,vf.file(Wf.resolve($??".")),O),(z)=>[z]));w(await C6(q,j,v))}}function Hf(q,$){return`lexer error: ${L7.relative(process.cwd(),q.uri.fsPath)}:${$.line||1}:${$.column||1}: ${$.message}`}function Jf(q,$){return`parser error: ${L7.relative(process.cwd(),q.uri.fsPath)}:${$.token.startLine||1}:${$.token.startColumn||1}: ${$.message}`}function Zf(q,$){return`diagnostic error: ${L7.relative(process.cwd(),q.uri.fsPath)}:${$.range.start.line+1}:${$.range.start.character+1}: ${$.message}`}var u5="typecheck and validate a module",R5,C6=async(q,$,K)=>{let P=K.Current.Root,_=await C8(q,$,P.fsPath,[],{quiet:!0},K.Locations.Config());if(zK.isErr(_))return _;let j=await I5($,K);if(zK.isErr(j)){let Y=j.err.warnings.concat(j.err.errors);return d7(Y)}return S5(void 0)},I5=async(q,$)=>{let K={errors:[],warnings:[]},P=q.shared.workspace.FileSystemProvider,_=$.Current.Root,j=await zK.tryCatchAsync(()=>P.readDirectory(_));if(zK.isErr(j)){let v=""+j.err;if(j.err instanceof Error)v=j.err.message;return K.errors.push(`failed to read directory '${_.fsPath}': ${v}`),d7(K)}await q.shared.workspace.WorkspaceManager.initializeWorkspace([{name:"root",uri:_.toString()}]);let w=q.shared.workspace.LangiumDocuments;await q.shared.workspace.DocumentBuilder.build(w.all.toArray(),{validation:!0});for(let v of q.shared.workspace.LangiumDocuments.all){for(let z of v.parseResult.lexerErrors)K.errors.push(Hf(v,z));for(let z of v.parseResult.parserErrors)K.errors.push(Jf(v,z));for(let z of v.diagnostics||[]){let W=Zf(v,z);if(z.severity===N5.Error)K.errors.push(W);if(z.severity===N5.Warning)K.warnings.push(W)}}if(K.errors.length>0)return d7(K);return S5(void 0)},kf;var Y$=eq(()=>{yP();pP();R5=`
|
|
15
|
+
`.trim();kf={Register:b5}});var a5={};G8(a5,{default:()=>Bf,Register:()=>n5,ParseModuleIdentifier:()=>x5,NewModule:()=>o5,Description:()=>c5,Action:()=>l5});import{Maybe as cf}from"@kumori/kdsl-lsp/util/maybe.js";import{mkdir as lf,writeFile as of}from"fs/promises";import{URI as af}from"langium";import{NodeFileSystem as rf}from"langium/node";import{LocateModuleManifest as tf,MOD_FILE as L5}from"@kumori/kdsl-lsp/module/locator.js";import x7 from"path";function x5(q){let $=q.trim(),K=$.indexOf("/");if(K<=0||K===$.length-1)return;let P=$.slice(0,K),_=$.slice(K+1);if(!ef.test(P))return;let j=_.split("/");if(j.some((w)=>!Uf.test(w)))return;let Y=j[j.length-1];return{domain:P,module:_,name:Y}}function n5(q,$){return q.command("init").summary(Ff).argument("<name>","module identifier in the form <domain>/<module> (e.g., kumori.systems/my-module or kumori/mymodule)").argument("<version>","module version - defaults to 0.0.1").argument("[path]","location to create the module under - defaults to the current directory").argument("[cacheLocation]","location to store cached modules - default to .kumori/mod").description(c5).helpOption(!0).action(l5($))}function l5(q){return async(...$)=>{await o5(q,process.cwd(),...$)}}var Bf,g5="[a-z0-9](?:[a-z0-9-]*[a-z0-9])?",ef,Uf,Ff="initializes a new kumori module",c5,o5=async(q,$,...[K,P,_,j])=>{if(!x5(K))q.error(`error: invalid module name '${K}'; expected '<domain>/<module>' (e.g. kumori.systems/my-module or kumori/my-module)`),process.exit(1);let Y=rf.fileSystemProvider();if(_=_??$,!x7.isAbsolute(_))_=x7.join($,_);let w=await tf(Y,af.file(_));if(cf.isSome(w)&&w.value.fsPath===_)q.error(`error: module ${_} already exists`),process.exit(1);let O={spec:"kumori/module/v1",kumori:"0.0.1",version:P,module:K,cacheLocation:j,requires:[]},v=x7.join(_,L5);await lf(_,{recursive:!0}),await of(v,JSON.stringify(O,null,4)),q.info(`creating new ${L5}: module ${K}`)};var r5=eq(()=>{Bf={Register:n5},ef=new RegExp(`^${g5}(?:\\.${g5})*$`),Uf=/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;c5=`
|
|
16
|
+
Initializes a new Kumori module, which effectively means to create a new
|
|
17
|
+
kumori.mod.json file or overwrite it in case it already exists.
|
|
18
|
+
It is required to provide a name and a version for the module and optionally
|
|
19
|
+
a location path where the new module is going to be initialized.
|
|
20
|
+
|
|
21
|
+
The module name must be a valid module identifier in the form:
|
|
22
|
+
<domain>/<module>
|
|
23
|
+
|
|
24
|
+
Examples of valid identifiers:
|
|
25
|
+
kumori.systems/my-module
|
|
26
|
+
kumori/mymodule
|
|
27
|
+
example.io/path/to/module
|
|
28
|
+
|
|
29
|
+
kdsl mod init kumori.systems/my-module
|
|
30
|
+
|
|
31
|
+
You could as well provide a custom location for the module's local cache,
|
|
32
|
+
where all the dependencies will be downloaded. By default, the cache location
|
|
33
|
+
is set to ".kumori/mod" under the module location.
|
|
34
|
+
|
|
35
|
+
kdsl mod init kumori.systems/my-module ./my-module
|
|
36
|
+
|
|
37
|
+
`.trim()});var s5={};G8(s5,{default:()=>PA,Register:()=>e5,Description:()=>B5,Dependency:()=>F5,Action:()=>U5});import{URI as sf,UriUtils as n7}from"langium";import{createKumoriServices as Qf}from"@kumori/kdsl-lsp/language/kumori.js";import{NodeFileSystem as qA}from"langium/node";import{Result as WK}from"@kumori/kdsl-lsp/util/result.js";import{ModuleContext as $A}from"@kumori/kdsl-lsp/module/context.js";import{MOD_FILE as c7}from"@kumori/kdsl-lsp/module/locator.js";import{ParseQuery as i5}from"@kumori/kdsl-lsp/module/query.js";import{RegistryManager as t5}from"@kumori/kdsl-lsp/module/registry/manager.js";function e5(q,$){return q.command("dependency").alias("dep").argument("<module>","Module URL with @<tag> (e.g. https://github.com/org/repo@v1.2.3)").option("--alias <alias>","Alias for the dependency").option("--headers <module>","Specify a separate location for the headers module").option("--remove","Remove the dependency").option("--download","Download the dependency after adding it").summary(KA).description(B5).helpOption(!0).showHelpAfterError(!0).action(U5($))}function U5(q){return async($,K,P)=>{let _=P?.optsWithGlobals()?.config;await new t5(_).ensureIndexes();try{await F5(q,sf.file(process.cwd()),$,K,_)}catch(Y){throw q.error(`Failed to manage dependency: ${Y}`),Y}}}var KA="Add, update, or remove a dependency from the module declaration",B5,PA,F5=async(q,$,K,P,_)=>{let j=Qf(qA,_).Kumori,Y=j.shared.workspace.FileSystemProvider,w=await $A(Y,$,_);if(WK.isErr(w))throw Error(w.err);let O=w.value.Current.Manifest,v=i5(K,w.value.Locations.Config());if(WK.isErr(v))throw Error(`invalid query '${K}': invalid format`);let z=null;if(P.headers){if(z=i5(P.headers,w.value.Locations.Config()),WK.isErr(z))throw Error(`invalid query '${P.headers}': invalid format`)}let W=z?z.value:null,T=v.value;if(T.Location.endsWith("/"))T.Location=T.Location.replace(/\/+$/,"");let{alias:H,remove:J}=P,Z=T.Location;if(new t5(_).list().find((N)=>K.startsWith(N.selector))!==void 0)Z=K.slice(0,K.indexOf("@"));if(J){let N=O.requires.findIndex((V)=>V.target===Z&&V.version===T.Version);if(N===-1)throw Error(`Dependency ${T} not found`);O.requires.splice(N,1),await Bun.write(n7.joinPath(w.value.Current.Root,c7).fsPath,JSON.stringify(O,void 0,4)),q.info(`Removed dependency ${T.toString()}`);return}if(H&&O.requires.some((N)=>N.alias===H&&N.target!==Z))throw Error(`Alias '${H}' is already used by another dependency`);let f=O.requires.find((N)=>N.target===Z);if(f){if(H)f.alias=H;else delete f.alias;if(W)f.headers={target:W.Location,version:W.Version};if(P.download){let N=await C8(q,j,$.fsPath,[],{quiet:!0},_);if(WK.isErr(N))throw Error(`Failed to download dependency: ${N.err.join(", ")}`)}f.version=T.Version,await Bun.write(n7.joinPath(w.value.Current.Root,c7).fsPath,JSON.stringify(O,void 0,4)),q.info(`Updated dependency ${T.Location} to version ${T.Version}`+(H?` (alias: ${H})`:"")+(W?` (headers: ${W})`:""))}else{let N=T.Version,V={target:Z,version:N,...H?{alias:H}:{},...W?{headers:{target:W.Location,version:W.Version}}:{}};if(O.requires.push(V),await Bun.write(n7.joinPath(w.value.Current.Root,c7).fsPath,JSON.stringify(O,void 0,4)),P.download){let C=await C8(q,j,$.fsPath,[],{quiet:!0},_);if(WK.isErr(C))throw Error(`Failed to download dependency: ${C.err.join(", ")}`)}q.info(`Added dependency ${T.toString()}`+(H?` (alias: ${H})`:"")+(W?` (headers: ${W})`:"")+" to module manifest")}};var Q5=eq(()=>{yP();B5=`
|
|
38
|
+
Manage dependencies within the current module. It can add, update
|
|
39
|
+
or remove dependencies. Optionally, it can attempt to download the dependency after adding it.
|
|
40
|
+
Dependencies should resolve to a git repository.
|
|
41
|
+
|
|
42
|
+
To add a dependency:
|
|
43
|
+
kdsl mod dep github.com/org/repo@v1.0.0
|
|
44
|
+
|
|
45
|
+
To add a dependency with an alias:
|
|
46
|
+
kdsl mod dep github.com/org/repo@v1.0.0 --alias mydep
|
|
47
|
+
|
|
48
|
+
To update a dependency to a new version:
|
|
49
|
+
kdsl mod dep github.com/org/repo@1.2.0
|
|
50
|
+
|
|
51
|
+
To remove a dependency:
|
|
52
|
+
kdsl mod dep github.com/org/repo --remove
|
|
53
|
+
|
|
54
|
+
To add a dependency and download it immediately:
|
|
55
|
+
kdsl mod dep github.com/org/repo@v1.0.0 --download
|
|
56
|
+
`.trim(),PA={Register:e5}});var j1={};G8(j1,{default:()=>vA,Register:()=>$1,NewModule:()=>_1,Description:()=>K1,Action:()=>P1});import{Maybe as _A}from"@kumori/kdsl-lsp/util/maybe.js";import{mkdir as jA}from"node:fs/promises";import{URI as q1}from"langium";import{NodeFileSystem as YA}from"langium/node";import{LocateModuleManifest as wA,MOD_FILE as l7}from"@kumori/kdsl-lsp/module/locator.js";import dP from"path";function $1(q,$){return q.command("update").summary(OA).option("-v, --version <version>","new module version").option("-p, --path <location>","location where the module to update is located - defaults to the current directory").option("-c, --cacheLocation <cacheLocation>","new cache location").description(K1).helpOption(!0).action(P1($))}function P1(q){return async($)=>{await _1(q,process.cwd(),$)}}var vA,OA="updates an existing kumori module's version or cache location",K1,_1=async(q,$,K)=>{let P=YA.fileSystemProvider(),_=K.path??$;if(!dP.isAbsolute(_))_=dP.join($,_);let j=await wA(P,q1.file(_));if(_A.isSome(j)&&j.value.fsPath===_)q.error(`error: module ${_} already exists`),process.exit(1);let Y=await P.readFile(q1.file(dP.join(_,l7))),w=JSON.parse(Y),O={spec:"kumori/module/v1",kumori:"0.0.1",version:K.version??w.version,module:w.module,cacheLocation:K.cacheLocation??w.cacheLocation,requires:[]},v=dP.join(_,l7);await jA(_,{recursive:!0}),await Bun.write(v,JSON.stringify(O,null,4)),q.info(`updated ${l7}: module ${O.module}`)};var Y1=eq(()=>{vA={Register:$1};K1=`
|
|
57
|
+
This command updates an existing Kumori module's version or cache location in the kumori.mod.json file. It is required to provide the new version and optionally
|
|
58
|
+
a new cache location for the module.
|
|
59
|
+
|
|
60
|
+
kdsl mod update -v 1.0.0
|
|
61
|
+
|
|
62
|
+
You could as well provide a new location for the module's local cache,
|
|
63
|
+
where all the dependencies will be downloaded.
|
|
64
|
+
|
|
65
|
+
kdsl mod update -v 1.0.0 -c ./my-mod-cache
|
|
66
|
+
|
|
67
|
+
If the module is not located in the current directory, you can provide a custom location path.
|
|
68
|
+
|
|
69
|
+
kdsl mod update -v 1.0.0 -p ./my-module
|
|
70
|
+
`.trim()});import{AstUtils as zA,UriUtils as WA}from"langium";function w1(q){let $=q.node.$cstNode?.range??{start:{line:-1,character:-1},end:{line:-1,character:-1}},K=zA.getDocument(q.node);return`${WA.relative(process.cwd(),K.uri.fsPath)}:${$.start.line+1}:${$.start.character+1}: ${q.message}`}var v1=()=>{};var A1={};G8(A1,{default:()=>LA,ToJSONSchemaInternal:()=>N6,ToJSONSchema:()=>f1,Register:()=>J1,LocateModule:()=>X1,GetSchema:()=>LP,Description:()=>Z1,Action:()=>k1});import{createKumoriServices as TA}from"@kumori/kdsl-lsp/language/kumori.js";import{ModuleContext as HA}from"@kumori/kdsl-lsp/module/context.js";import{ParseQuery as JA}from"@kumori/kdsl-lsp/module/query.js";import{Maybe as W1,None as ZA,Some as kA}from"@kumori/kdsl-lsp/util/maybe.js";import{Err as H6,Ok as Uq,Result as Dq}from"@kumori/kdsl-lsp/util/result.js";import{TempCache as XA}from"@kumori/kdsl-lsp/util/tmp.js";import{NodeFileSystem as T1}from"langium/node";import N8 from"path";import{AstUtils as o7,URI as fA,UriUtils as H1}from"langium";import TK from"assert";import{TAny as O1,TBoolean as AA,TEither as GA,TFunction as hA,TList as VA,TNumber as MA,TOptional as z1,TString as CA,TStruct as NA,TTypeDefAlias as SA,TTypeDefNamed as bA,TypeSystemError as uA,TypeToString as RA}from"@kumori/kdsl-lsp/language/type-system/type.js";import{ModuleDescriptor as mA}from"@kumori/kdsl-lsp/module/descriptor.js";import{isBuiltinArtifact as IA,isComponentArtifact as EA,isServiceArtifact as pA}from"@kumori/kdsl-lsp/language/generated/ast.js";import{Scheme as DA}from"@kumori/kdsl-lsp/language/builtin/util.js";import{GatherModuleDocuments as yA}from"@kumori/kdsl-lsp/module/documents.js";import{RemoteFetcherFactory as dA}from"@kumori/kdsl-lsp/module/remote/factory.js";function J1(q,$){return q.command("get").summary(gA).argument("<target>",'Unique path of the kmodule where the artifact is defined. Accepts remote targets (e.g., "github.com/MyOrg/component@v1.2.3") or local paths (e.g. "/abs/path/to/module", "../rel/path/to/module").').argument("<package-path>",`Relative path to the package that contains the artifact (e.g., "internal/service"). For artifacts in the module's root package, use ".".`).argument("<artifact-name>",'Name of the target artifact (e.g., "ExampleService").').description(Z1).helpOption(!0).action(k1($))}function k1(q){return async($,K,P,_,j)=>{let Y=j?.optsWithGlobals()?.config,w=TA(T1,Y).Kumori,O=(H)=>j$(q,H),v=O(await X1($,Y)),z=w.shared.workspace.FileSystemProvider,W=O(Dq.mapErr(await HA(z,fA.file(v.fsPath),Y),(H)=>[H]));O(await C6(q,w,W));let T=O(await LP(w,W,K,P));console.log(JSON.stringify(T,null,4))}}async function X1(q,$){let K=await XA(),P=T1.fileSystemProvider(),_=q;if(q[0]==="."||N8.isAbsolute(q)){let W=N8.isAbsolute(q)?q:N8.resolve(process.cwd(),q);return Uq({$type:"local",fsPath:W})}let Y=JA(q,$);if(W1.isNone(Y))return H6([`invalid remote target '${q}': invalid syntax`]);let w=Y.value.Version,O=`${Y.value.Location}@${w}`,v=H1.joinPath(K,O),z=await mA(P,v);if(Dq.isErr(z)){let W=await D7({Remotes:dA(),Locations:{Config:()=>$}},Y.value.Location,w,v.fsPath);if(Dq.isErr(W))return H6([`failed to fetch ${_}: ${W.err}`])}return Uq({$type:"remote",fsPath:v.fsPath,query:Y.value})}async function LP(q,$,K,P){let _=H1.joinPath($.Current.Root,N8.normalize(K)),j=q.references.KumoriPackages.GetPackage(_);if(Dq.isErr(j))return H6([`error: failed to retrieve package: ${_.toString()}`]);let Y=new Set(j.value.docs.map((Z)=>Z.uri.toString())),w=q.shared.workspace.IndexManager.allElements(void 0,Y).toArray().filter((Z)=>Z.name===P);if(w.length<1)return H6([`error: no artifact named defined in ${_.toString()}`]);if(w.length>2)return H6([`error: too many matches in ${_.toString()}`]);let O=w[0].node;if(!(EA(O)||pA(O)||IA(O)))return H6([`invalid reference to node of type: ${O.$type}`]);if(!o7.getDocument(O).uri.fsPath.endsWith(".h.kumori")){if(!O.name.value.ref)return H6(["no headers found for component"]);O=O.name.value.ref}let z=q.validation.KumoriTypeSystem,W=q.validation.KumoriValidations.ctx(),[T,H]=z.Infer(W,O);if(H.length>0){let Z=[];return H.map((X)=>Z.concat(X.message)),H6([`type inference failed with errors: ${Z}`])}let J=await f1(q,$,T,N8.join($.Current.Manifest.module,K+"@"+P));return Dq.mapErr(J,(Z)=>Z.map(w1))}async function f1(q,$,K,P){return Dq.map(await N6({svcs:q,mod:$},K),(_)=>({$schema:"https://json-schema.org/draft/2020-12/schema",$spec:"kumori/schema/v1",$id:P,..._}))}async function N6(q,$){if(O1.is($))return Uq({});if(hA.is($))return N6(q,$.returns);if(z1.is($))return N6(q,$.inner);if(SA.is($))return N6(q,$.spec);if(MA.is($))if($.literal===void 0)return Uq({type:"number"});else return Uq({const:$.literal});if(CA.is($))if($.literal===void 0)return Uq({type:"string"});else return Uq({const:$.literal});if(AA.is($))if($.literal===void 0)return Uq({type:"boolean"});else return Uq({const:$.literal});if(VA.is($)){let K=await N6(q,$.restriction);if(Dq.isErr(K))return K;return Uq({type:"array",items:K.value})}if(GA.is($)){let K=await Promise.all($.variations.map((j)=>N6(q,j))),P=K.filter(Dq.isErr).map((j)=>j.err).flat();if(P.length>0)return H6(P);let _=K.filter(Dq.isOk).map((j)=>j.value);return TK(_.length===K.length),Uq({oneOf:_})}if(NA.is($)){let K=await Promise.all(Object.entries($.parameters).map(async(Y)=>({key:Y[0],value:Y[1],schema:await N6(q,Y[1].value)}))),P=K.map((Y)=>Y.schema).filter((Y)=>Dq.isErr(Y)).map((Y)=>Y.err).flat(),_=ZA;if($.restriction!==void 0&&!O1.is($.restriction)){let Y=await N6(q,$.restriction);if(Dq.isOk(Y))_=kA(Y.value);else P=P.concat(Y.err)}if(P.length>0)return H6(P);let j={type:"object",properties:Object.fromEntries(K.map((Y)=>{return TK(Dq.isOk(Y.schema)),[Y.key,Y.schema.value]})),required:K.filter((Y)=>Y.value.optional===!1&&!z1.is(Y.value.value)).map((Y)=>Y.key)};if(W1.isSome(_))j={...j,additionalProperties:_.value};return Uq(j)}if(bA.is($)){let K=await N6(q,$.spec);if(Dq.isErr(K))return K;return Uq({type:"object",properties:{$kdsl:{const:{NamedType:await xA(q,$)}},inner:K.value},required:["$kdsl","inner"]})}return H6([uA.create({node:$,message:`cannot convert definition to JSONSchema: ${RA($)}`})])}var LA,gA="extracts jsonschema for a specified module and artifact",Z1,xA=async(q,$)=>{let K=$.node;TK(K);let P=q.svcs.shared.references.KumoriModules,_=o7.getDocument(K).uri,j=q.svcs.references.KumoriPackages.GetPackage(K),Y=q.mod.Current;if(TK(Dq.isOk(j)),_.scheme===DA)return{Import:j.value.uri.path.slice(1),Name:$.meta.name};if(!(await yA(q.svcs.shared,q.mod.Root.Root)).map((T)=>T.fsPath).includes(_.fsPath)){let T=P.getModule(_);TK(Dq.isOk(T)),Y=T.value}let z=Y.Root,W=j.value.uri.fsPath.slice(z.fsPath.length);return{Import:N8.join(Y.Manifest.module,W),Name:$.meta.name}};var a7=eq(()=>{Y$();pP();v1();y7();LA={Register:J1};Z1=`
|
|
71
|
+
Generates and outputs the JSON Schema that describes a particular Kumori DSL
|
|
72
|
+
artifact. This schema defines the artifact's configurable properties, resource
|
|
73
|
+
requirements, and overall structure, making it valuable for programmatic
|
|
74
|
+
interaction, validation, or documentation purposes.
|
|
75
|
+
|
|
76
|
+
The command allows you to specify artifacts from both remote/external modules
|
|
77
|
+
and local modules.
|
|
78
|
+
`.trim()});import{isComponentArtifact as F7,isServiceArtifact as cP,ServiceArtifact as nP,ComponentArtifact as UA}from"@kumori/kdsl-lsp/language/generated/ast.js";import{VStruct as Fq,VNumber as FA,VString as sA,VList as QA}from"@kumori/kdsl-lsp/language/type-system/value.js";import{VAccessor as J6}from"@kumori/kdsl-lsp/language/type-system/eval.js";import{Maybe as Z6}from"@kumori/kdsl-lsp/util/maybe.js";import{Multipliers as G1}from"@kumori/kdsl-lsp/util/sized.js";import{AstUtils as qG}from"langium";import B7 from"node:assert";import Y6 from"node:path";function h1(q,$=new WeakSet){if($.has(q))return[];$.add(q);let K=q.parameters;if(!K||!K.role)return[];let _=K.role.value?.parameters;if(!_)return[];let j=[];for(let[Y,w]of Object.entries(_)){let v=w?.value?.parameters;if(!v)continue;let z=v.artifact?.value,W=cP(z.node)?"service":F7(z.node)?"component":"builtin";if(W==="builtin")continue;else if(W==="component"){j.push({name:Y,type:W,roles:[]});continue}let T=z.parameters;if(!T)return[];let Z=T.role?.value?.parameters;if(!_)return[];if(Z)j.push({name:Y,type:W,roles:h1(z,$)})}return j}function V1(q,$){let _=q.shared.workspace.IndexManager.allElements(nP.$type).toArray().filter((O)=>O.documentUri.path===$&&!O.documentUri.path.endsWith(".h.kumori"))[0];if(!_)return[];let j=_.node;if(!cP(j))return[];B7(j);let[{Value:Y}]=q.validation.KumoriTypeSystem.Eval(q.validation.KumoriValidations.ctx(),j);if(B7(Y.$type==="struct"),B7(Y.parameters.role&&Y.parameters.role.value.$type==="struct"),!Y.parameters.role.value.parameters)return[];return h1(Y)}function M1(q,$,K){if(K.type!=="service")return null;let P=$.Current.Root.path,_=$.Current.Root.fsPath,j=Y6.join(_,Y6.normalize(K.location)),Y=j.endsWith(Y6.sep)?j:j+Y6.sep;return q.shared.workspace.IndexManager.allElements(nP.$type).toArray().find((v)=>{if(v.name!==K.name)return!1;if(!v.documentUri.path.startsWith(P))return!1;if(v.documentUri.path.endsWith(".h.kumori"))return!1;let z=v.documentUri.fsPath;if(z)return Y6.dirname(z)===j||z.startsWith(Y);return!0})?.documentUri?.path??null}function e7(q){if(!q.parameters)return null;let $=J6(q,"size"),K=J6(q,"unit");if(Z6.isNone($)||Z6.isNone(K)||!FA.is($.value)||!sA.is(K.value))return null;return{size:$.value.literal,unit:K.value.literal}}function U7(q){let $=G1.G,K=q.unit==="m"?"M":q.unit,P=G1[K];if(!P)return 0;return q.size*P/$}function C1(q,$,K,P,_){let j=$.Current.Root.fsPath,Y=Y6.join(j,Y6.normalize(P)),w=Y.endsWith(Y6.sep)?Y:Y+Y6.sep,O=_?UA.$type:nP.$type,z=q.shared.workspace.IndexManager.allElements(O).toArray().find((H)=>{if(H.name!==K)return!1;let J=H.documentUri.fsPath;if(!J)return!1;if(_&&H.documentUri.path.endsWith(".h.kumori"))return!1;if(!_&&H.documentUri.path.endsWith(".h.kumori"))return!1;return Y6.dirname(J)===Y||J.startsWith(w)});if(!z)return null;let W=z.node;if(!(_&&F7(W)||!_&&cP(W)))return null;let[{Value:T}]=q.validation.KumoriTypeSystem.Eval(q.validation.KumoriValidations.ctx(),W);if(!Fq.is(T))return null;return T}function s7(q,$,K,P){let _=C1(q,$,K,P,!0);if(!_)return null;let j=J6(_,"size");if(Z6.isNone(j)||!Fq.is(j.value))return null;let Y=J6(j.value,"mincpu");if(Z6.isNone(Y)||!Fq.is(Y.value))return null;let w=e7(Y.value);if(!w)return null;let O=U7(w),v=0,z=J6(_,"code");if(!Z6.isNone(z)&&Fq.is(z.value))for(let T of Object.values(z.value.parameters)){if(!T||!Fq.is(T.value))continue;let H=J6(T.value,"size");if(!Z6.isNone(H)&&Fq.is(H.value)){let J=J6(H.value,"memory");if(!Z6.isNone(J)&&Fq.is(J.value)){let Z=e7(J.value);if(Z)v+=U7(Z)}}}let W=J6(_,"init");if(!Z6.isNone(W)&&QA.is(W.value))for(let T of W.value.items){if(!Fq.is(T.value))continue;let H=J6(T.value,"size");if(!Z6.isNone(H)&&Fq.is(H.value)){let J=J6(H.value,"memory");if(!Z6.isNone(J)&&Fq.is(J.value)){let Z=e7(J.value);if(Z)v+=U7(Z)}}}return{cpu:O,memory:v}}function Q7(q,$,K,P,_=new Set){let j=`${K}@${P}`;if(_.has(j))return{cpu:0,memory:0};_.add(j);let Y=C1(q,$,K,P,!1);if(!Y)return null;let w=0,O=0,v=J6(Y,"role");if(Z6.isNone(v)||!Fq.is(v.value))return{cpu:w,memory:O};let z=v.value.parameters;if(!z)return{cpu:w,memory:O};for(let W of Object.values(z)){if(!W||!Fq.is(W.value))continue;let T=W.value.parameters;if(!T)continue;let H=T.artifact;if(!H||!Fq.is(H.value))continue;let Z=H.value.node;if(!Z)continue;let X=F7(Z),G=cP(Z);if(!X&&!G)continue;let f=Z.name?.value?.$refText||"",N=$.Current.Root.fsPath,V=Z.name?.value?.ref,C=V?Y6.dirname(qG.getDocument(V).uri.fsPath):"";if(!f||!C.startsWith(N))continue;let b=Y6.relative(N,C);if(X){let k=s7(q,$,f,b);if(k)w+=k.cpu,O+=k.memory}else if(G){let k=Q7(q,$,f,b,_);if(k)w+=k.cpu,O+=k.memory}}return{cpu:w,memory:O}}var N1=()=>{};var b1=R((yc,S1)=>{var sq=function(q){if(q=q||{},this.Promise=q.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=q.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw 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)}if(this.timeout=q.timeout||sq.DEFAULT_TIMEOUT,this.maxOccupationTime=q.maxOccupationTime||sq.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=q.maxExecutionTime||sq.DEFAULT_MAX_EXECUTION_TIME,q.maxPending===1/0||Number.isInteger(q.maxPending)&&q.maxPending>=0)this.maxPending=q.maxPending;else this.maxPending=sq.DEFAULT_MAX_PENDING};sq.DEFAULT_TIMEOUT=0;sq.DEFAULT_MAX_OCCUPATION_TIME=0;sq.DEFAULT_MAX_EXECUTION_TIME=0;sq.DEFAULT_MAX_PENDING=1000;sq.prototype.acquire=function(q,$,K,P){if(Array.isArray(q))return this._acquireBatch(q,$,K,P);if(typeof $!=="function")throw Error("You must pass a function to execute");var _=null,j=null,Y=null;if(typeof K!=="function")P=K,K=null,Y=new this.Promise(function(f,N){_=f,j=N});P=P||{};var w=!1,O=null,v=null,z=null,W=this,T=function(f,N,V){if(v)clearTimeout(v),v=null;if(z)clearTimeout(z),z=null;if(f){if(!!W.queues[q]&&W.queues[q].length===0)delete W.queues[q];if(W.domainReentrant)delete W.domains[q]}if(!w){if(!Y){if(typeof K==="function")K(N,V)}else if(N)j(N);else _(V);w=!0}if(f){if(!!W.queues[q]&&W.queues[q].length>0)W.queues[q].shift()()}},H=function(f){if(w)return T(f);if(O)clearTimeout(O),O=null;if(W.domainReentrant&&f)W.domains[q]=process.domain;var N=P.maxExecutionTime||W.maxExecutionTime;if(N)z=setTimeout(function(){if(W.queues[q])T(f,Error("Maximum execution time is exceeded "+q))},N);if($.length===1){var V=!1;try{$(function(C,b){if(!V)V=!0,T(f,C,b)})}catch(C){if(!V)V=!0,T(f,C)}}else W._promiseTry(function(){return $()}).then(function(C){T(f,void 0,C)},function(C){T(f,C)})};if(W.domainReentrant&&!!process.domain)H=process.domain.bind(H);var J=P.maxPending||W.maxPending;if(!W.queues[q])W.queues[q]=[],H(!0);else if(W.domainReentrant&&!!process.domain&&process.domain===W.domains[q])H(!1);else if(W.queues[q].length>=J)T(!1,Error("Too many pending tasks in queue "+q));else{var Z=function(){H(!0)};if(P.skipQueue)W.queues[q].unshift(Z);else W.queues[q].push(Z);var X=P.timeout||W.timeout;if(X)O=setTimeout(function(){O=null,T(!1,Error("async-lock timed out in queue "+q))},X)}var G=P.maxOccupationTime||W.maxOccupationTime;if(G)v=setTimeout(function(){if(W.queues[q])T(!1,Error("Maximum occupation time is exceeded in queue "+q))},G);if(Y)return Y};sq.prototype._acquireBatch=function(q,$,K,P){if(typeof K!=="function")P=K,K=null;var _=this,j=function(w,O){return function(v){_.acquire(w,O,v,P)}},Y=q.reduceRight(function(w,O){return j(O,w)},$);if(typeof K==="function")Y(K);else return new this.Promise(function(w,O){if(Y.length===1)Y(function(v,z){if(v)O(v);else w(z)});else w(Y())})};sq.prototype.isBusy=function(q){if(!q)return Object.keys(this.queues).length>0;else return!!this.queues[q]};sq.prototype._promiseTry=function(q){try{return this.Promise.resolve(q())}catch($){return this.Promise.reject($)}};S1.exports=sq});var u1=R((dc,q_)=>{if(typeof Object.create==="function")q_.exports=function($,K){if(K)$.super_=K,$.prototype=Object.create(K.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})};else q_.exports=function($,K){if(K){$.super_=K;var P=function(){};P.prototype=K.prototype,$.prototype=new P,$.prototype.constructor=$}}});var R1=R((Lc,$_)=>{try{if(lP=fq("util"),typeof lP.inherits!=="function")throw"";$_.exports=lP.inherits}catch(q){$_.exports=u1()}var lP});var aP=R((K_,I1)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var oP=fq("buffer"),S6=oP.Buffer;function m1(q,$){for(var K in q)$[K]=q[K]}if(S6.from&&S6.alloc&&S6.allocUnsafe&&S6.allocUnsafeSlow)I1.exports=oP;else m1(oP,K_),K_.Buffer=S8;function S8(q,$,K){return S6(q,$,K)}S8.prototype=Object.create(S6.prototype);m1(S6,S8);S8.from=function(q,$,K){if(typeof q==="number")throw TypeError("Argument must not be a number");return S6(q,$,K)};S8.alloc=function(q,$,K){if(typeof q!=="number")throw TypeError("Argument must be a number");var P=S6(q);if($!==void 0)if(typeof K==="string")P.fill($,K);else P.fill($);else P.fill(0);return P};S8.allocUnsafe=function(q){if(typeof q!=="number")throw TypeError("Argument must be a number");return S6(q)};S8.allocUnsafeSlow=function(q){if(typeof q!=="number")throw TypeError("Argument must be a number");return oP.SlowBuffer(q)}});var p1=R((gc,E1)=>{var $G={}.toString;E1.exports=Array.isArray||function(q){return $G.call(q)=="[object Array]"}});var z$=R((xc,D1)=>{D1.exports=TypeError});var P_=R((nc,y1)=>{y1.exports=Object});var L1=R((cc,d1)=>{d1.exports=Error});var x1=R((lc,g1)=>{g1.exports=EvalError});var c1=R((oc,n1)=>{n1.exports=RangeError});var o1=R((ac,l1)=>{l1.exports=ReferenceError});var __=R((rc,a1)=>{a1.exports=SyntaxError});var i1=R((ic,r1)=>{r1.exports=URIError});var B1=R((tc,t1)=>{t1.exports=Math.abs});var U1=R((Bc,e1)=>{e1.exports=Math.floor});var s1=R((ec,F1)=>{F1.exports=Math.max});var q2=R((Uc,Q1)=>{Q1.exports=Math.min});var K2=R((Fc,$2)=>{$2.exports=Math.pow});var _2=R((sc,P2)=>{P2.exports=Math.round});var Y2=R((Qc,j2)=>{j2.exports=Number.isNaN||function($){return $!==$}});var v2=R((ql,w2)=>{var KG=Y2();w2.exports=function($){if(KG($)||$===0)return $;return $<0?-1:1}});var z2=R(($l,O2)=>{O2.exports=Object.getOwnPropertyDescriptor});var W$=R((Kl,W2)=>{var rP=z2();if(rP)try{rP([],"length")}catch(q){rP=null}W2.exports=rP});var HK=R((Pl,T2)=>{var iP=Object.defineProperty||!1;if(iP)try{iP({},"a",{value:1})}catch(q){iP=!1}T2.exports=iP});var j_=R((_l,H2)=>{H2.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var $={},K=Symbol("test"),P=Object(K);if(typeof K==="string")return!1;if(Object.prototype.toString.call(K)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;var _=42;$[K]=_;for(var j in $)return!1;if(typeof Object.keys==="function"&&Object.keys($).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames($).length!==0)return!1;var Y=Object.getOwnPropertySymbols($);if(Y.length!==1||Y[0]!==K)return!1;if(!Object.prototype.propertyIsEnumerable.call($,K))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var w=Object.getOwnPropertyDescriptor($,K);if(w.value!==_||w.enumerable!==!0)return!1}return!0}});var k2=R((jl,Z2)=>{var J2=typeof Symbol<"u"&&Symbol,PG=j_();Z2.exports=function(){if(typeof J2!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof J2("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return PG()}});var Y_=R((Yl,X2)=>{X2.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var w_=R((wl,f2)=>{var _G=P_();f2.exports=_G.getPrototypeOf||null});var h2=R((vl,G2)=>{var jG="Function.prototype.bind called on incompatible ",YG=Object.prototype.toString,wG=Math.max,vG="[object Function]",A2=function($,K){var P=[];for(var _=0;_<$.length;_+=1)P[_]=$[_];for(var j=0;j<K.length;j+=1)P[j+$.length]=K[j];return P},OG=function($,K){var P=[];for(var _=K||0,j=0;_<$.length;_+=1,j+=1)P[j]=$[_];return P},zG=function(q,$){var K="";for(var P=0;P<q.length;P+=1)if(K+=q[P],P+1<q.length)K+=$;return K};G2.exports=function($){var K=this;if(typeof K!=="function"||YG.apply(K)!==vG)throw TypeError(jG+K);var P=OG(arguments,1),_,j=function(){if(this instanceof _){var z=K.apply(this,A2(P,arguments));if(Object(z)===z)return z;return this}return K.apply($,A2(P,arguments))},Y=wG(0,K.length-P.length),w=[];for(var O=0;O<Y;O++)w[O]="$"+O;if(_=Function("binder","return function ("+zG(w,",")+"){ return binder.apply(this,arguments); }")(j),K.prototype){var v=function(){};v.prototype=K.prototype,_.prototype=new v,v.prototype=null}return _}});var T$=R((Ol,V2)=>{var WG=h2();V2.exports=Function.prototype.bind||WG});var tP=R((zl,M2)=>{M2.exports=Function.prototype.call});var BP=R((Wl,C2)=>{C2.exports=Function.prototype.apply});var S2=R((Tl,N2)=>{N2.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var v_=R((Hl,b2)=>{var TG=T$(),HG=BP(),JG=tP(),ZG=S2();b2.exports=ZG||TG.call(JG,HG)});var eP=R((Jl,u2)=>{var kG=T$(),XG=z$(),fG=tP(),AG=v_();u2.exports=function($){if($.length<1||typeof $[0]!=="function")throw new XG("a function is required");return AG(kG,fG,$)}});var D2=R((Zl,p2)=>{var GG=eP(),R2=W$(),I2;try{I2=[].__proto__===Array.prototype}catch(q){if(!q||typeof q!=="object"||!("code"in q)||q.code!=="ERR_PROTO_ACCESS")throw q}var O_=!!I2&&R2&&R2(Object.prototype,"__proto__"),E2=Object,m2=E2.getPrototypeOf;p2.exports=O_&&typeof O_.get==="function"?GG([O_.get]):typeof m2==="function"?function($){return m2($==null?$:E2($))}:!1});var z_=R((kl,g2)=>{var y2=Y_(),d2=w_(),L2=D2();g2.exports=y2?function($){return y2($)}:d2?function($){if(!$||typeof $!=="object"&&typeof $!=="function")throw TypeError("getProto: not an object");return d2($)}:L2?function($){return L2($)}:null});var n2=R((Xl,x2)=>{var hG=Function.prototype.call,VG=Object.prototype.hasOwnProperty,MG=T$();x2.exports=MG.call(hG,VG)});var J_=R((fl,r2)=>{var B,CG=P_(),NG=L1(),SG=x1(),bG=c1(),uG=o1(),k$=__(),Z$=z$(),RG=i1(),mG=B1(),IG=U1(),EG=s1(),pG=q2(),DG=K2(),yG=_2(),dG=v2(),o2=Function,W_=function(q){try{return o2('"use strict"; return ('+q+").constructor;")()}catch($){}},JK=W$(),LG=HK(),T_=function(){throw new Z$},gG=JK?function(){try{return arguments.callee,T_}catch(q){try{return JK(arguments,"callee").get}catch($){return T_}}}():T_,H$=k2()(),Cq=z_(),xG=w_(),nG=Y_(),a2=BP(),ZK=tP(),J$={},cG=typeof Uint8Array>"u"||!Cq?B:Cq(Uint8Array),b8={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?B:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?B:ArrayBuffer,"%ArrayIteratorPrototype%":H$&&Cq?Cq([][Symbol.iterator]()):B,"%AsyncFromSyncIteratorPrototype%":B,"%AsyncFunction%":J$,"%AsyncGenerator%":J$,"%AsyncGeneratorFunction%":J$,"%AsyncIteratorPrototype%":J$,"%Atomics%":typeof Atomics>"u"?B:Atomics,"%BigInt%":typeof BigInt>"u"?B:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?B:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?B:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?B:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":NG,"%eval%":eval,"%EvalError%":SG,"%Float16Array%":typeof Float16Array>"u"?B:Float16Array,"%Float32Array%":typeof Float32Array>"u"?B:Float32Array,"%Float64Array%":typeof Float64Array>"u"?B:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?B:FinalizationRegistry,"%Function%":o2,"%GeneratorFunction%":J$,"%Int8Array%":typeof Int8Array>"u"?B:Int8Array,"%Int16Array%":typeof Int16Array>"u"?B:Int16Array,"%Int32Array%":typeof Int32Array>"u"?B:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H$&&Cq?Cq(Cq([][Symbol.iterator]())):B,"%JSON%":typeof JSON==="object"?JSON:B,"%Map%":typeof Map>"u"?B:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H$||!Cq?B:Cq(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":CG,"%Object.getOwnPropertyDescriptor%":JK,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?B:Promise,"%Proxy%":typeof Proxy>"u"?B:Proxy,"%RangeError%":bG,"%ReferenceError%":uG,"%Reflect%":typeof Reflect>"u"?B:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?B:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H$||!Cq?B:Cq(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?B:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H$&&Cq?Cq(""[Symbol.iterator]()):B,"%Symbol%":H$?Symbol:B,"%SyntaxError%":k$,"%ThrowTypeError%":gG,"%TypedArray%":cG,"%TypeError%":Z$,"%Uint8Array%":typeof Uint8Array>"u"?B:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?B:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?B:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?B:Uint32Array,"%URIError%":RG,"%WeakMap%":typeof WeakMap>"u"?B:WeakMap,"%WeakRef%":typeof WeakRef>"u"?B:WeakRef,"%WeakSet%":typeof WeakSet>"u"?B:WeakSet,"%Function.prototype.call%":ZK,"%Function.prototype.apply%":a2,"%Object.defineProperty%":LG,"%Object.getPrototypeOf%":xG,"%Math.abs%":mG,"%Math.floor%":IG,"%Math.max%":EG,"%Math.min%":pG,"%Math.pow%":DG,"%Math.round%":yG,"%Math.sign%":dG,"%Reflect.getPrototypeOf%":nG};if(Cq)try{null.error}catch(q){H_=Cq(Cq(q)),b8["%Error.prototype%"]=H_}var H_,lG=function q($){var K;if($==="%AsyncFunction%")K=W_("async function () {}");else if($==="%GeneratorFunction%")K=W_("function* () {}");else if($==="%AsyncGeneratorFunction%")K=W_("async function* () {}");else if($==="%AsyncGenerator%"){var P=q("%AsyncGeneratorFunction%");if(P)K=P.prototype}else if($==="%AsyncIteratorPrototype%"){var _=q("%AsyncGenerator%");if(_&&Cq)K=Cq(_.prototype)}return b8[$]=K,K},c2={__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"]},kK=T$(),UP=n2(),oG=kK.call(ZK,Array.prototype.concat),aG=kK.call(a2,Array.prototype.splice),l2=kK.call(ZK,String.prototype.replace),FP=kK.call(ZK,String.prototype.slice),rG=kK.call(ZK,RegExp.prototype.exec),iG=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,tG=/\\(\\)?/g,BG=function($){var K=FP($,0,1),P=FP($,-1);if(K==="%"&&P!=="%")throw new k$("invalid intrinsic syntax, expected closing `%`");else if(P==="%"&&K!=="%")throw new k$("invalid intrinsic syntax, expected opening `%`");var _=[];return l2($,iG,function(j,Y,w,O){_[_.length]=w?l2(O,tG,"$1"):Y||j}),_},eG=function($,K){var P=$,_;if(UP(c2,P))_=c2[P],P="%"+_[0]+"%";if(UP(b8,P)){var j=b8[P];if(j===J$)j=lG(P);if(typeof j>"u"&&!K)throw new Z$("intrinsic "+$+" exists, but is not available. Please file an issue!");return{alias:_,name:P,value:j}}throw new k$("intrinsic "+$+" does not exist!")};r2.exports=function($,K){if(typeof $!=="string"||$.length===0)throw new Z$("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof K!=="boolean")throw new Z$('"allowMissing" argument must be a boolean');if(rG(/^%?[^%]*%?$/,$)===null)throw new k$("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var P=BG($),_=P.length>0?P[0]:"",j=eG("%"+_+"%",K),Y=j.name,w=j.value,O=!1,v=j.alias;if(v)_=v[0],aG(P,oG([0,1],v));for(var z=1,W=!0;z<P.length;z+=1){var T=P[z],H=FP(T,0,1),J=FP(T,-1);if((H==='"'||H==="'"||H==="`"||(J==='"'||J==="'"||J==="`"))&&H!==J)throw new k$("property names with quotes must have matching quotes");if(T==="constructor"||!W)O=!0;if(_+="."+T,Y="%"+_+"%",UP(b8,Y))w=b8[Y];else if(w!=null){if(!(T in w)){if(!K)throw new Z$("base intrinsic for "+$+" exists, but the property is not available.");return}if(JK&&z+1>=P.length){var Z=JK(w,T);if(W=!!Z,W&&"get"in Z&&!("originalValue"in Z.get))w=Z.get;else w=w[T]}else W=UP(w,T),w=w[T];if(W&&!O)b8[Y]=w}}return w}});var Z_=R((Al,B2)=>{var i2=J_(),t2=eP(),UG=t2([i2("%String.prototype.indexOf%")]);B2.exports=function($,K){var P=i2($,!!K);if(typeof P==="function"&&UG($,".prototype.")>-1)return t2([P]);return P}});var F2=R((Gl,U2)=>{var e2=Function.prototype.toString,X$=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,X_,sP;if(typeof X$==="function"&&typeof Object.defineProperty==="function")try{X_=Object.defineProperty({},"length",{get:function(){throw sP}}),sP={},X$(function(){throw 42},null,X_)}catch(q){if(q!==sP)X$=null}else X$=null;var FG=/^\s*class\b/,f_=function($){try{var K=e2.call($);return FG.test(K)}catch(P){return!1}},k_=function($){try{if(f_($))return!1;return e2.call($),!0}catch(K){return!1}},QP=Object.prototype.toString,sG="[object Object]",QG="[object Function]",qh="[object GeneratorFunction]",$h="[object HTMLAllCollection]",Kh="[object HTML document.all class]",Ph="[object HTMLCollection]",_h=typeof Symbol==="function"&&!!Symbol.toStringTag,jh=!(0 in[,]),A_=function(){return!1};if(typeof document==="object"){if(G_=document.all,QP.call(G_)===QP.call(document.all))A_=function($){if((jh||!$)&&(typeof $>"u"||typeof $==="object"))try{var K=QP.call($);return(K===$h||K===Kh||K===Ph||K===sG)&&$("")==null}catch(P){}return!1}}var G_;U2.exports=X$?function($){if(A_($))return!0;if(!$)return!1;if(typeof $!=="function"&&typeof $!=="object")return!1;try{X$($,null,X_)}catch(K){if(K!==sP)return!1}return!f_($)&&k_($)}:function($){if(A_($))return!0;if(!$)return!1;if(typeof $!=="function"&&typeof $!=="object")return!1;if(_h)return k_($);if(f_($))return!1;var K=QP.call($);if(K!==QG&&K!==qh&&!/^\[object HTML/.test(K))return!1;return k_($)}});var qY=R((hl,Q2)=>{var Yh=F2(),wh=Object.prototype.toString,s2=Object.prototype.hasOwnProperty,vh=function($,K,P){for(var _=0,j=$.length;_<j;_++)if(s2.call($,_))if(P==null)K($[_],_,$);else K.call(P,$[_],_,$)},Oh=function($,K,P){for(var _=0,j=$.length;_<j;_++)if(P==null)K($.charAt(_),_,$);else K.call(P,$.charAt(_),_,$)},zh=function($,K,P){for(var _ in $)if(s2.call($,_))if(P==null)K($[_],_,$);else K.call(P,$[_],_,$)};function Wh(q){return wh.call(q)==="[object Array]"}Q2.exports=function($,K,P){if(!Yh(K))throw TypeError("iterator must be a function");var _;if(arguments.length>=3)_=P;if(Wh($))vh($,K,_);else if(typeof $==="string")Oh($,K,_);else zh($,K,_)}});var KY=R((Vl,$Y)=>{$Y.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var _Y=R((Ml,PY)=>{var h_=KY(),Th=typeof globalThis>"u"?global:globalThis;PY.exports=function(){var $=[];for(var K=0;K<h_.length;K++)if(typeof Th[h_[K]]==="function")$[$.length]=h_[K];return $}});var vY=R((Cl,wY)=>{var jY=HK(),Hh=__(),f$=z$(),YY=W$();wY.exports=function($,K,P){if(!$||typeof $!=="object"&&typeof $!=="function")throw new f$("`obj` must be an object or a function`");if(typeof K!=="string"&&typeof K!=="symbol")throw new f$("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new f$("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new f$("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new f$("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new f$("`loose`, if provided, must be a boolean");var _=arguments.length>3?arguments[3]:null,j=arguments.length>4?arguments[4]:null,Y=arguments.length>5?arguments[5]:null,w=arguments.length>6?arguments[6]:!1,O=!!YY&&YY($,K);if(jY)jY($,K,{configurable:Y===null&&O?O.configurable:!Y,enumerable:_===null&&O?O.enumerable:!_,value:P,writable:j===null&&O?O.writable:!j});else if(w||!_&&!j&&!Y)$[K]=P;else throw new Hh("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var WY=R((Nl,zY)=>{var V_=HK(),OY=function(){return!!V_};OY.hasArrayLengthDefineBug=function(){if(!V_)return null;try{return V_([],"length",{value:1}).length!==1}catch($){return!0}};zY.exports=OY});var kY=R((Sl,ZY)=>{var Jh=J_(),TY=vY(),Zh=WY()(),HY=W$(),JY=z$(),kh=Jh("%Math.floor%");ZY.exports=function($,K){if(typeof $!=="function")throw new JY("`fn` is not a function");if(typeof K!=="number"||K<0||K>4294967295||kh(K)!==K)throw new JY("`length` must be a positive 32-bit integer");var P=arguments.length>2&&!!arguments[2],_=!0,j=!0;if("length"in $&&HY){var Y=HY($,"length");if(Y&&!Y.configurable)_=!1;if(Y&&!Y.writable)j=!1}if(_||j||!P)if(Zh)TY($,"length",K,!0,!0);else TY($,"length",K);return $}});var fY=R((bl,XY)=>{var Xh=T$(),fh=BP(),Ah=v_();XY.exports=function(){return Ah(Xh,fh,arguments)}});var hY=R((ul,q4)=>{var Gh=kY(),AY=HK(),hh=eP(),GY=fY();q4.exports=function($){var K=hh(arguments),P=$.length-(arguments.length-1);return Gh(K,1+(P>0?P:0),!0)};if(AY)AY(q4.exports,"apply",{value:GY});else q4.exports.apply=GY});var MY=R((Rl,VY)=>{var Vh=j_();VY.exports=function(){return Vh()&&!!Symbol.toStringTag}});var uY=R((ml,bY)=>{var P4=qY(),Mh=_Y(),CY=hY(),C_=Z_(),K4=W$(),$4=z_(),Ch=C_("Object.prototype.toString"),SY=MY()(),NY=typeof globalThis>"u"?global:globalThis,M_=Mh(),N_=C_("String.prototype.slice"),Nh=C_("Array.prototype.indexOf",!0)||function($,K){for(var P=0;P<$.length;P+=1)if($[P]===K)return P;return-1},_4={__proto__:null};if(SY&&K4&&$4)P4(M_,function(q){var $=new NY[q];if(Symbol.toStringTag in $&&$4){var K=$4($),P=K4(K,Symbol.toStringTag);if(!P&&K){var _=$4(K);P=K4(_,Symbol.toStringTag)}if(P&&P.get){var j=CY(P.get);_4["$"+q]=j}}});else P4(M_,function(q){var $=new NY[q],K=$.slice||$.set;if(K){var P=CY(K);_4["$"+q]=P}});var Sh=function($){var K=!1;return P4(_4,function(P,_){if(!K)try{if("$"+P($)===_)K=N_(_,1)}catch(j){}}),K},bh=function($){var K=!1;return P4(_4,function(P,_){if(!K)try{P($),K=N_(_,1)}catch(j){}}),K};bY.exports=function($){if(!$||typeof $!=="object")return!1;if(!SY){var K=N_(Ch($),8,-1);if(Nh(M_,K)>-1)return K;if(K!=="Object")return!1;return bh($)}if(!K4)return null;return Sh($)}});var mY=R((Il,RY)=>{var uh=uY();RY.exports=function($){return!!uh($)}});var EY=R((El,IY)=>{var Rh=z$(),mh=Z_(),Ih=mh("TypedArray.prototype.buffer",!0),Eh=mY();IY.exports=Ih||function($){if(!Eh($))throw new Rh("Not a Typed Array");return $.buffer}});var yY=R((pl,DY)=>{var k6=aP().Buffer,ph=p1(),Dh=EY(),yh=ArrayBuffer.isView||function($){try{return Dh($),!0}catch(K){return!1}},dh=typeof Uint8Array<"u",pY=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Lh=pY&&(k6.prototype instanceof Uint8Array||k6.TYPED_ARRAY_SUPPORT);DY.exports=function($,K){if(k6.isBuffer($)){if($.constructor&&!("isBuffer"in $))return k6.from($);return $}if(typeof $==="string")return k6.from($,K);if(pY&&yh($)){if($.byteLength===0)return k6.alloc(0);if(Lh){var P=k6.from($.buffer,$.byteOffset,$.byteLength);if(P.byteLength===$.byteLength)return P}var _=$ instanceof Uint8Array?$:new Uint8Array($.buffer,$.byteOffset,$.byteLength),j=k6.from(_);if(j.length===$.byteLength)return j}if(dh&&$ instanceof Uint8Array)return k6.from($);var Y=ph($);if(Y)for(var w=0;w<$.length;w+=1){var O=$[w];if(typeof O!=="number"||O<0||O>255||~~O!==O)throw RangeError("Array items must be numbers in the range 0-255.")}if(Y||k6.isBuffer($)&&$.constructor&&typeof $.constructor.isBuffer==="function"&&$.constructor.isBuffer($))return k6.from($);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}});var LY=R((Dl,dY)=>{var gh=aP().Buffer,xh=yY();function j4(q,$){this._block=gh.alloc(q),this._finalSize=$,this._blockSize=q,this._len=0}j4.prototype.update=function(q,$){q=xh(q,$||"utf8");var K=this._block,P=this._blockSize,_=q.length,j=this._len;for(var Y=0;Y<_;){var w=j%P,O=Math.min(_-Y,P-w);for(var v=0;v<O;v++)K[w+v]=q[Y+v];if(j+=O,Y+=O,j%P===0)this._update(K)}return this._len+=_,this};j4.prototype.digest=function(q){var $=this._len%this._blockSize;if(this._block[$]=128,this._block.fill(0,$+1),$>=this._finalSize)this._update(this._block),this._block.fill(0);var K=this._len*8;if(K<=4294967295)this._block.writeUInt32BE(K,this._blockSize-4);else{var P=(K&4294967295)>>>0,_=(K-P)/4294967296;this._block.writeUInt32BE(_,this._blockSize-8),this._block.writeUInt32BE(P,this._blockSize-4)}this._update(this._block);var j=this._hash();return q?j.toString(q):j};j4.prototype._update=function(){throw Error("_update must be implemented by subclass")};dY.exports=j4});var nY=R((yl,xY)=>{var nh=R1(),gY=LY(),ch=aP().Buffer,lh=[1518500249,1859775393,-1894007588,-899497514],oh=Array(80);function XK(){this.init(),this._w=oh,gY.call(this,64,56)}nh(XK,gY);XK.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function ah(q){return q<<1|q>>>31}function rh(q){return q<<5|q>>>27}function ih(q){return q<<30|q>>>2}function th(q,$,K,P){if(q===0)return $&K|~$&P;if(q===2)return $&K|$&P|K&P;return $^K^P}XK.prototype._update=function(q){var $=this._w,K=this._a|0,P=this._b|0,_=this._c|0,j=this._d|0,Y=this._e|0;for(var w=0;w<16;++w)$[w]=q.readInt32BE(w*4);for(;w<80;++w)$[w]=ah($[w-3]^$[w-8]^$[w-14]^$[w-16]);for(var O=0;O<80;++O){var v=~~(O/20),z=rh(K)+th(v,P,_,j)+Y+$[O]+lh[v]|0;Y=j,j=_,_=ih(P),P=K,K=z}this._a=K+this._a|0,this._b=P+this._b|0,this._c=_+this._c|0,this._d=j+this._d|0,this._e=Y+this._e|0};XK.prototype._hash=function(){var q=ch.allocUnsafe(20);return q.writeInt32BE(this._a|0,0),q.writeInt32BE(this._b|0,4),q.writeInt32BE(this._c|0,8),q.writeInt32BE(this._d|0,12),q.writeInt32BE(this._e|0,16),q};xY.exports=XK});var lY=R((S_)=>{/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */var cY;(function(q){if(typeof DO_NOT_EXPORT_CRC>"u")if(typeof S_==="object")q(S_);else if(typeof define==="function"&&define.amd)define(function(){var $={};return q($),$});else q(cY={});else q(cY={})})(function(q){q.version="1.2.2";function $(){var k=0,M=Array(256);for(var A=0;A!=256;++A)k=A,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,M[A]=k;return typeof Int32Array<"u"?new Int32Array(M):M}var K=$();function P(k){var M=0,A=0,u=0,S=typeof Int32Array<"u"?new Int32Array(4096):Array(4096);for(u=0;u!=256;++u)S[u]=k[u];for(u=0;u!=256;++u){A=k[u];for(M=256+u;M<4096;M+=256)A=S[M]=A>>>8^k[A&255]}var p=[];for(u=1;u!=16;++u)p[u-1]=typeof Int32Array<"u"?S.subarray(u*256,u*256+256):S.slice(u*256,u*256+256);return p}var _=P(K),j=_[0],Y=_[1],w=_[2],O=_[3],v=_[4],z=_[5],W=_[6],T=_[7],H=_[8],J=_[9],Z=_[10],X=_[11],G=_[12],f=_[13],N=_[14];function V(k,M){var A=M^-1;for(var u=0,S=k.length;u<S;)A=A>>>8^K[(A^k.charCodeAt(u++))&255];return~A}function C(k,M){var A=M^-1,u=k.length-15,S=0;for(;S<u;)A=N[k[S++]^A&255]^f[k[S++]^A>>8&255]^G[k[S++]^A>>16&255]^X[k[S++]^A>>>24]^Z[k[S++]]^J[k[S++]]^H[k[S++]]^T[k[S++]]^W[k[S++]]^z[k[S++]]^v[k[S++]]^O[k[S++]]^w[k[S++]]^Y[k[S++]]^j[k[S++]]^K[k[S++]];u+=15;while(S<u)A=A>>>8^K[(A^k[S++])&255];return~A}function b(k,M){var A=M^-1;for(var u=0,S=k.length,p=0,L=0;u<S;)if(p=k.charCodeAt(u++),p<128)A=A>>>8^K[(A^p)&255];else if(p<2048)A=A>>>8^K[(A^(192|p>>6&31))&255],A=A>>>8^K[(A^(128|p&63))&255];else if(p>=55296&&p<57344)p=(p&1023)+64,L=k.charCodeAt(u++)&1023,A=A>>>8^K[(A^(240|p>>8&7))&255],A=A>>>8^K[(A^(128|p>>2&63))&255],A=A>>>8^K[(A^(128|L>>6&15|(p&3)<<4))&255],A=A>>>8^K[(A^(128|L&63))&255];else A=A>>>8^K[(A^(224|p>>12&15))&255],A=A>>>8^K[(A^(128|p>>6&63))&255],A=A>>>8^K[(A^(128|p&63))&255];return~A}q.table=K,q.bstr=V,q.buf=C,q.str=b})});var c6=R((b_)=>{var Fh=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function sh(q,$){return Object.prototype.hasOwnProperty.call(q,$)}b_.assign=function(q){var $=Array.prototype.slice.call(arguments,1);while($.length){var K=$.shift();if(!K)continue;if(typeof K!=="object")throw TypeError(K+"must be non-object");for(var P in K)if(sh(K,P))q[P]=K[P]}return q};b_.shrinkBuf=function(q,$){if(q.length===$)return q;if(q.subarray)return q.subarray(0,$);return q.length=$,q};var Qh={arraySet:function(q,$,K,P,_){if($.subarray&&q.subarray){q.set($.subarray(K,K+P),_);return}for(var j=0;j<P;j++)q[_+j]=$[K+j]},flattenChunks:function(q){var $,K,P,_,j,Y;P=0;for($=0,K=q.length;$<K;$++)P+=q[$].length;Y=new Uint8Array(P),_=0;for($=0,K=q.length;$<K;$++)j=q[$],Y.set(j,_),_+=j.length;return Y}},qV={arraySet:function(q,$,K,P,_){for(var j=0;j<P;j++)q[_+j]=$[K+j]},flattenChunks:function(q){return[].concat.apply([],q)}};b_.setTyped=function(q){if(q)b_.Buf8=Uint8Array,b_.Buf16=Uint16Array,b_.Buf32=Int32Array,b_.assign(b_,Qh);else b_.Buf8=Array,b_.Buf16=Array,b_.Buf32=Array,b_.assign(b_,qV)};b_.setTyped(Fh)});var Tw=R((MV)=>{var KV=c6(),PV=4,aY=0,rY=1,_V=2;function G$(q){var $=q.length;while(--$>=0)q[$]=0}var jV=0,FY=1,YV=2,wV=3,vV=258,y_=29,MK=256,AK=MK+1+y_,A$=30,d_=19,sY=2*AK+1,u8=15,R_=16,OV=7,L_=256,QY=16,qw=17,$w=18,p_=[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],Y4=[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],zV=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Kw=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],WV=512,l6=Array((AK+2)*2);G$(l6);var fK=Array(A$*2);G$(fK);var GK=Array(WV);G$(GK);var hK=Array(vV-wV+1);G$(hK);var g_=Array(y_);G$(g_);var w4=Array(A$);G$(w4);function m_(q,$,K,P,_){this.static_tree=q,this.extra_bits=$,this.extra_base=K,this.elems=P,this.max_length=_,this.has_stree=q&&q.length}var Pw,_w,jw;function I_(q,$){this.dyn_tree=q,this.max_code=0,this.stat_desc=$}function Yw(q){return q<256?GK[q]:GK[256+(q>>>7)]}function VK(q,$){q.pending_buf[q.pending++]=$&255,q.pending_buf[q.pending++]=$>>>8&255}function lq(q,$,K){if(q.bi_valid>R_-K)q.bi_buf|=$<<q.bi_valid&65535,VK(q,q.bi_buf),q.bi_buf=$>>R_-q.bi_valid,q.bi_valid+=K-R_;else q.bi_buf|=$<<q.bi_valid&65535,q.bi_valid+=K}function b6(q,$,K){lq(q,K[$*2],K[$*2+1])}function ww(q,$){var K=0;do K|=q&1,q>>>=1,K<<=1;while(--$>0);return K>>>1}function TV(q){if(q.bi_valid===16)VK(q,q.bi_buf),q.bi_buf=0,q.bi_valid=0;else if(q.bi_valid>=8)q.pending_buf[q.pending++]=q.bi_buf&255,q.bi_buf>>=8,q.bi_valid-=8}function HV(q,$){var{dyn_tree:K,max_code:P}=$,_=$.stat_desc.static_tree,j=$.stat_desc.has_stree,Y=$.stat_desc.extra_bits,w=$.stat_desc.extra_base,O=$.stat_desc.max_length,v,z,W,T,H,J,Z=0;for(T=0;T<=u8;T++)q.bl_count[T]=0;K[q.heap[q.heap_max]*2+1]=0;for(v=q.heap_max+1;v<sY;v++){if(z=q.heap[v],T=K[K[z*2+1]*2+1]+1,T>O)T=O,Z++;if(K[z*2+1]=T,z>P)continue;if(q.bl_count[T]++,H=0,z>=w)H=Y[z-w];if(J=K[z*2],q.opt_len+=J*(T+H),j)q.static_len+=J*(_[z*2+1]+H)}if(Z===0)return;do{T=O-1;while(q.bl_count[T]===0)T--;q.bl_count[T]--,q.bl_count[T+1]+=2,q.bl_count[O]--,Z-=2}while(Z>0);for(T=O;T!==0;T--){z=q.bl_count[T];while(z!==0){if(W=q.heap[--v],W>P)continue;if(K[W*2+1]!==T)q.opt_len+=(T-K[W*2+1])*K[W*2],K[W*2+1]=T;z--}}}function vw(q,$,K){var P=Array(u8+1),_=0,j,Y;for(j=1;j<=u8;j++)P[j]=_=_+K[j-1]<<1;for(Y=0;Y<=$;Y++){var w=q[Y*2+1];if(w===0)continue;q[Y*2]=ww(P[w]++,w)}}function JV(){var q,$,K,P,_,j=Array(u8+1);K=0;for(P=0;P<y_-1;P++){g_[P]=K;for(q=0;q<1<<p_[P];q++)hK[K++]=P}hK[K-1]=P,_=0;for(P=0;P<16;P++){w4[P]=_;for(q=0;q<1<<Y4[P];q++)GK[_++]=P}_>>=7;for(;P<A$;P++){w4[P]=_<<7;for(q=0;q<1<<Y4[P]-7;q++)GK[256+_++]=P}for($=0;$<=u8;$++)j[$]=0;q=0;while(q<=143)l6[q*2+1]=8,q++,j[8]++;while(q<=255)l6[q*2+1]=9,q++,j[9]++;while(q<=279)l6[q*2+1]=7,q++,j[7]++;while(q<=287)l6[q*2+1]=8,q++,j[8]++;vw(l6,AK+1,j);for(q=0;q<A$;q++)fK[q*2+1]=5,fK[q*2]=ww(q,5);Pw=new m_(l6,p_,MK+1,AK,u8),_w=new m_(fK,Y4,0,A$,u8),jw=new m_([],zV,0,d_,OV)}function Ow(q){var $;for($=0;$<AK;$++)q.dyn_ltree[$*2]=0;for($=0;$<A$;$++)q.dyn_dtree[$*2]=0;for($=0;$<d_;$++)q.bl_tree[$*2]=0;q.dyn_ltree[L_*2]=1,q.opt_len=q.static_len=0,q.last_lit=q.matches=0}function zw(q){if(q.bi_valid>8)VK(q,q.bi_buf);else if(q.bi_valid>0)q.pending_buf[q.pending++]=q.bi_buf;q.bi_buf=0,q.bi_valid=0}function ZV(q,$,K,P){if(zw(q),P)VK(q,K),VK(q,~K);KV.arraySet(q.pending_buf,q.window,$,K,q.pending),q.pending+=K}function iY(q,$,K,P){var _=$*2,j=K*2;return q[_]<q[j]||q[_]===q[j]&&P[$]<=P[K]}function E_(q,$,K){var P=q.heap[K],_=K<<1;while(_<=q.heap_len){if(_<q.heap_len&&iY($,q.heap[_+1],q.heap[_],q.depth))_++;if(iY($,P,q.heap[_],q.depth))break;q.heap[K]=q.heap[_],K=_,_<<=1}q.heap[K]=P}function tY(q,$,K){var P,_,j=0,Y,w;if(q.last_lit!==0)do if(P=q.pending_buf[q.d_buf+j*2]<<8|q.pending_buf[q.d_buf+j*2+1],_=q.pending_buf[q.l_buf+j],j++,P===0)b6(q,_,$);else{if(Y=hK[_],b6(q,Y+MK+1,$),w=p_[Y],w!==0)_-=g_[Y],lq(q,_,w);if(P--,Y=Yw(P),b6(q,Y,K),w=Y4[Y],w!==0)P-=w4[Y],lq(q,P,w)}while(j<q.last_lit);b6(q,L_,$)}function D_(q,$){var K=$.dyn_tree,P=$.stat_desc.static_tree,_=$.stat_desc.has_stree,j=$.stat_desc.elems,Y,w,O=-1,v;q.heap_len=0,q.heap_max=sY;for(Y=0;Y<j;Y++)if(K[Y*2]!==0)q.heap[++q.heap_len]=O=Y,q.depth[Y]=0;else K[Y*2+1]=0;while(q.heap_len<2)if(v=q.heap[++q.heap_len]=O<2?++O:0,K[v*2]=1,q.depth[v]=0,q.opt_len--,_)q.static_len-=P[v*2+1];$.max_code=O;for(Y=q.heap_len>>1;Y>=1;Y--)E_(q,K,Y);v=j;do Y=q.heap[1],q.heap[1]=q.heap[q.heap_len--],E_(q,K,1),w=q.heap[1],q.heap[--q.heap_max]=Y,q.heap[--q.heap_max]=w,K[v*2]=K[Y*2]+K[w*2],q.depth[v]=(q.depth[Y]>=q.depth[w]?q.depth[Y]:q.depth[w])+1,K[Y*2+1]=K[w*2+1]=v,q.heap[1]=v++,E_(q,K,1);while(q.heap_len>=2);q.heap[--q.heap_max]=q.heap[1],HV(q,$),vw(K,O,q.bl_count)}function BY(q,$,K){var P,_=-1,j,Y=$[1],w=0,O=7,v=4;if(Y===0)O=138,v=3;$[(K+1)*2+1]=65535;for(P=0;P<=K;P++){if(j=Y,Y=$[(P+1)*2+1],++w<O&&j===Y)continue;else if(w<v)q.bl_tree[j*2]+=w;else if(j!==0){if(j!==_)q.bl_tree[j*2]++;q.bl_tree[QY*2]++}else if(w<=10)q.bl_tree[qw*2]++;else q.bl_tree[$w*2]++;if(w=0,_=j,Y===0)O=138,v=3;else if(j===Y)O=6,v=3;else O=7,v=4}}function eY(q,$,K){var P,_=-1,j,Y=$[1],w=0,O=7,v=4;if(Y===0)O=138,v=3;for(P=0;P<=K;P++){if(j=Y,Y=$[(P+1)*2+1],++w<O&&j===Y)continue;else if(w<v)do b6(q,j,q.bl_tree);while(--w!==0);else if(j!==0){if(j!==_)b6(q,j,q.bl_tree),w--;b6(q,QY,q.bl_tree),lq(q,w-3,2)}else if(w<=10)b6(q,qw,q.bl_tree),lq(q,w-3,3);else b6(q,$w,q.bl_tree),lq(q,w-11,7);if(w=0,_=j,Y===0)O=138,v=3;else if(j===Y)O=6,v=3;else O=7,v=4}}function kV(q){var $;BY(q,q.dyn_ltree,q.l_desc.max_code),BY(q,q.dyn_dtree,q.d_desc.max_code),D_(q,q.bl_desc);for($=d_-1;$>=3;$--)if(q.bl_tree[Kw[$]*2+1]!==0)break;return q.opt_len+=3*($+1)+5+5+4,$}function XV(q,$,K,P){var _;lq(q,$-257,5),lq(q,K-1,5),lq(q,P-4,4);for(_=0;_<P;_++)lq(q,q.bl_tree[Kw[_]*2+1],3);eY(q,q.dyn_ltree,$-1),eY(q,q.dyn_dtree,K-1)}function fV(q){var $=4093624447,K;for(K=0;K<=31;K++,$>>>=1)if($&1&&q.dyn_ltree[K*2]!==0)return aY;if(q.dyn_ltree[18]!==0||q.dyn_ltree[20]!==0||q.dyn_ltree[26]!==0)return rY;for(K=32;K<MK;K++)if(q.dyn_ltree[K*2]!==0)return rY;return aY}var UY=!1;function AV(q){if(!UY)JV(),UY=!0;q.l_desc=new I_(q.dyn_ltree,Pw),q.d_desc=new I_(q.dyn_dtree,_w),q.bl_desc=new I_(q.bl_tree,jw),q.bi_buf=0,q.bi_valid=0,Ow(q)}function Ww(q,$,K,P){lq(q,(jV<<1)+(P?1:0),3),ZV(q,$,K,!0)}function GV(q){lq(q,FY<<1,3),b6(q,L_,l6),TV(q)}function hV(q,$,K,P){var _,j,Y=0;if(q.level>0){if(q.strm.data_type===_V)q.strm.data_type=fV(q);if(D_(q,q.l_desc),D_(q,q.d_desc),Y=kV(q),_=q.opt_len+3+7>>>3,j=q.static_len+3+7>>>3,j<=_)_=j}else _=j=K+5;if(K+4<=_&&$!==-1)Ww(q,$,K,P);else if(q.strategy===PV||j===_)lq(q,(FY<<1)+(P?1:0),3),tY(q,l6,fK);else lq(q,(YV<<1)+(P?1:0),3),XV(q,q.l_desc.max_code+1,q.d_desc.max_code+1,Y+1),tY(q,q.dyn_ltree,q.dyn_dtree);if(Ow(q),P)zw(q)}function VV(q,$,K){if(q.pending_buf[q.d_buf+q.last_lit*2]=$>>>8&255,q.pending_buf[q.d_buf+q.last_lit*2+1]=$&255,q.pending_buf[q.l_buf+q.last_lit]=K&255,q.last_lit++,$===0)q.dyn_ltree[K*2]++;else q.matches++,$--,q.dyn_ltree[(hK[K]+MK+1)*2]++,q.dyn_dtree[Yw($)*2]++;return q.last_lit===q.lit_bufsize-1}MV._tr_init=AV;MV._tr_stored_block=Ww;MV._tr_flush_block=hV;MV._tr_tally=VV;MV._tr_align=GV});var x_=R((xl,Hw)=>{function RV(q,$,K,P){var _=q&65535|0,j=q>>>16&65535|0,Y=0;while(K!==0){Y=K>2000?2000:K,K-=Y;do _=_+$[P++]|0,j=j+_|0;while(--Y);_%=65521,j%=65521}return _|j<<16|0}Hw.exports=RV});var n_=R((nl,Jw)=>{function mV(){var q,$=[];for(var K=0;K<256;K++){q=K;for(var P=0;P<8;P++)q=q&1?3988292384^q>>>1:q>>>1;$[K]=q}return $}var IV=mV();function EV(q,$,K,P){var _=IV,j=P+K;q^=-1;for(var Y=P;Y<j;Y++)q=q>>>8^_[(q^$[Y])&255];return q^-1}Jw.exports=EV});var v4=R((cl,Zw)=>{Zw.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 Cw=R((WM)=>{var yq=c6(),w6=Tw(),Aw=x_(),$8=n_(),pV=v4(),E8=0,DV=1,yV=3,Y8=4,kw=5,R6=0,Xw=1,v6=-2,dV=-3,c_=-5,LV=-1,gV=1,O4=2,xV=3,nV=4,cV=0,lV=2,H4=8,oV=9,aV=15,rV=8,iV=29,tV=256,o_=tV+1+iV,BV=30,eV=19,UV=2*o_+1,FV=15,U=3,_8=258,X6=_8+U+1,sV=32,J4=42,a_=69,z4=73,W4=91,T4=103,R8=113,NK=666,hq=1,SK=2,m8=3,M$=4,QV=3;function j8(q,$){return q.msg=pV[$],$}function fw(q){return(q<<1)-(q>4?9:0)}function P8(q){var $=q.length;while(--$>=0)q[$]=0}function K8(q){var $=q.state,K=$.pending;if(K>q.avail_out)K=q.avail_out;if(K===0)return;if(yq.arraySet(q.output,$.pending_buf,$.pending_out,K,q.next_out),q.next_out+=K,$.pending_out+=K,q.total_out+=K,q.avail_out-=K,$.pending-=K,$.pending===0)$.pending_out=0}function Sq(q,$){w6._tr_flush_block(q,q.block_start>=0?q.block_start:-1,q.strstart-q.block_start,$),q.block_start=q.strstart,K8(q.strm)}function F(q,$){q.pending_buf[q.pending++]=$}function CK(q,$){q.pending_buf[q.pending++]=$>>>8&255,q.pending_buf[q.pending++]=$&255}function qM(q,$,K,P){var _=q.avail_in;if(_>P)_=P;if(_===0)return 0;if(q.avail_in-=_,yq.arraySet($,q.input,q.next_in,_,K),q.state.wrap===1)q.adler=Aw(q.adler,$,_,K);else if(q.state.wrap===2)q.adler=$8(q.adler,$,_,K);return q.next_in+=_,q.total_in+=_,_}function Gw(q,$){var{max_chain_length:K,strstart:P}=q,_,j,Y=q.prev_length,w=q.nice_match,O=q.strstart>q.w_size-X6?q.strstart-(q.w_size-X6):0,v=q.window,z=q.w_mask,W=q.prev,T=q.strstart+_8,H=v[P+Y-1],J=v[P+Y];if(q.prev_length>=q.good_match)K>>=2;if(w>q.lookahead)w=q.lookahead;do{if(_=$,v[_+Y]!==J||v[_+Y-1]!==H||v[_]!==v[P]||v[++_]!==v[P+1])continue;P+=2,_++;do;while(v[++P]===v[++_]&&v[++P]===v[++_]&&v[++P]===v[++_]&&v[++P]===v[++_]&&v[++P]===v[++_]&&v[++P]===v[++_]&&v[++P]===v[++_]&&v[++P]===v[++_]&&P<T);if(j=_8-(T-P),P=T-_8,j>Y){if(q.match_start=$,Y=j,j>=w)break;H=v[P+Y-1],J=v[P+Y]}}while(($=W[$&z])>O&&--K!==0);if(Y<=q.lookahead)return Y;return q.lookahead}function I8(q){var $=q.w_size,K,P,_,j,Y;do{if(j=q.window_size-q.lookahead-q.strstart,q.strstart>=$+($-X6)){yq.arraySet(q.window,q.window,$,$,0),q.match_start-=$,q.strstart-=$,q.block_start-=$,P=q.hash_size,K=P;do _=q.head[--K],q.head[K]=_>=$?_-$:0;while(--P);P=$,K=P;do _=q.prev[--K],q.prev[K]=_>=$?_-$:0;while(--P);j+=$}if(q.strm.avail_in===0)break;if(P=qM(q.strm,q.window,q.strstart+q.lookahead,j),q.lookahead+=P,q.lookahead+q.insert>=U){Y=q.strstart-q.insert,q.ins_h=q.window[Y],q.ins_h=(q.ins_h<<q.hash_shift^q.window[Y+1])&q.hash_mask;while(q.insert)if(q.ins_h=(q.ins_h<<q.hash_shift^q.window[Y+U-1])&q.hash_mask,q.prev[Y&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=Y,Y++,q.insert--,q.lookahead+q.insert<U)break}}while(q.lookahead<X6&&q.strm.avail_in!==0)}function $M(q,$){var K=65535;if(K>q.pending_buf_size-5)K=q.pending_buf_size-5;for(;;){if(q.lookahead<=1){if(I8(q),q.lookahead===0&&$===E8)return hq;if(q.lookahead===0)break}q.strstart+=q.lookahead,q.lookahead=0;var P=q.block_start+K;if(q.strstart===0||q.strstart>=P){if(q.lookahead=q.strstart-P,q.strstart=P,Sq(q,!1),q.strm.avail_out===0)return hq}if(q.strstart-q.block_start>=q.w_size-X6){if(Sq(q,!1),q.strm.avail_out===0)return hq}}if(q.insert=0,$===Y8){if(Sq(q,!0),q.strm.avail_out===0)return m8;return M$}if(q.strstart>q.block_start){if(Sq(q,!1),q.strm.avail_out===0)return hq}return hq}function l_(q,$){var K,P;for(;;){if(q.lookahead<X6){if(I8(q),q.lookahead<X6&&$===E8)return hq;if(q.lookahead===0)break}if(K=0,q.lookahead>=U)q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+U-1])&q.hash_mask,K=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart;if(K!==0&&q.strstart-K<=q.w_size-X6)q.match_length=Gw(q,K);if(q.match_length>=U)if(P=w6._tr_tally(q,q.strstart-q.match_start,q.match_length-U),q.lookahead-=q.match_length,q.match_length<=q.max_lazy_match&&q.lookahead>=U){q.match_length--;do q.strstart++,q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+U-1])&q.hash_mask,K=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart;while(--q.match_length!==0);q.strstart++}else q.strstart+=q.match_length,q.match_length=0,q.ins_h=q.window[q.strstart],q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+1])&q.hash_mask;else P=w6._tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++;if(P){if(Sq(q,!1),q.strm.avail_out===0)return hq}}if(q.insert=q.strstart<U-1?q.strstart:U-1,$===Y8){if(Sq(q,!0),q.strm.avail_out===0)return m8;return M$}if(q.last_lit){if(Sq(q,!1),q.strm.avail_out===0)return hq}return SK}function h$(q,$){var K,P,_;for(;;){if(q.lookahead<X6){if(I8(q),q.lookahead<X6&&$===E8)return hq;if(q.lookahead===0)break}if(K=0,q.lookahead>=U)q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+U-1])&q.hash_mask,K=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart;if(q.prev_length=q.match_length,q.prev_match=q.match_start,q.match_length=U-1,K!==0&&q.prev_length<q.max_lazy_match&&q.strstart-K<=q.w_size-X6){if(q.match_length=Gw(q,K),q.match_length<=5&&(q.strategy===gV||q.match_length===U&&q.strstart-q.match_start>4096))q.match_length=U-1}if(q.prev_length>=U&&q.match_length<=q.prev_length){_=q.strstart+q.lookahead-U,P=w6._tr_tally(q,q.strstart-1-q.prev_match,q.prev_length-U),q.lookahead-=q.prev_length-1,q.prev_length-=2;do if(++q.strstart<=_)q.ins_h=(q.ins_h<<q.hash_shift^q.window[q.strstart+U-1])&q.hash_mask,K=q.prev[q.strstart&q.w_mask]=q.head[q.ins_h],q.head[q.ins_h]=q.strstart;while(--q.prev_length!==0);if(q.match_available=0,q.match_length=U-1,q.strstart++,P){if(Sq(q,!1),q.strm.avail_out===0)return hq}}else if(q.match_available){if(P=w6._tr_tally(q,0,q.window[q.strstart-1]),P)Sq(q,!1);if(q.strstart++,q.lookahead--,q.strm.avail_out===0)return hq}else q.match_available=1,q.strstart++,q.lookahead--}if(q.match_available)P=w6._tr_tally(q,0,q.window[q.strstart-1]),q.match_available=0;if(q.insert=q.strstart<U-1?q.strstart:U-1,$===Y8){if(Sq(q,!0),q.strm.avail_out===0)return m8;return M$}if(q.last_lit){if(Sq(q,!1),q.strm.avail_out===0)return hq}return SK}function KM(q,$){var K,P,_,j,Y=q.window;for(;;){if(q.lookahead<=_8){if(I8(q),q.lookahead<=_8&&$===E8)return hq;if(q.lookahead===0)break}if(q.match_length=0,q.lookahead>=U&&q.strstart>0){if(_=q.strstart-1,P=Y[_],P===Y[++_]&&P===Y[++_]&&P===Y[++_]){j=q.strstart+_8;do;while(P===Y[++_]&&P===Y[++_]&&P===Y[++_]&&P===Y[++_]&&P===Y[++_]&&P===Y[++_]&&P===Y[++_]&&P===Y[++_]&&_<j);if(q.match_length=_8-(j-_),q.match_length>q.lookahead)q.match_length=q.lookahead}}if(q.match_length>=U)K=w6._tr_tally(q,1,q.match_length-U),q.lookahead-=q.match_length,q.strstart+=q.match_length,q.match_length=0;else K=w6._tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++;if(K){if(Sq(q,!1),q.strm.avail_out===0)return hq}}if(q.insert=0,$===Y8){if(Sq(q,!0),q.strm.avail_out===0)return m8;return M$}if(q.last_lit){if(Sq(q,!1),q.strm.avail_out===0)return hq}return SK}function PM(q,$){var K;for(;;){if(q.lookahead===0){if(I8(q),q.lookahead===0){if($===E8)return hq;break}}if(q.match_length=0,K=w6._tr_tally(q,0,q.window[q.strstart]),q.lookahead--,q.strstart++,K){if(Sq(q,!1),q.strm.avail_out===0)return hq}}if(q.insert=0,$===Y8){if(Sq(q,!0),q.strm.avail_out===0)return m8;return M$}if(q.last_lit){if(Sq(q,!1),q.strm.avail_out===0)return hq}return SK}function u6(q,$,K,P,_){this.good_length=q,this.max_lazy=$,this.nice_length=K,this.max_chain=P,this.func=_}var V$;V$=[new u6(0,0,0,0,$M),new u6(4,4,8,4,l_),new u6(4,5,16,8,l_),new u6(4,6,32,32,l_),new u6(4,4,16,16,h$),new u6(8,16,32,32,h$),new u6(8,16,128,128,h$),new u6(8,32,128,256,h$),new u6(32,128,258,1024,h$),new u6(32,258,258,4096,h$)];function _M(q){q.window_size=2*q.w_size,P8(q.head),q.max_lazy_match=V$[q.level].max_lazy,q.good_match=V$[q.level].good_length,q.nice_match=V$[q.level].nice_length,q.max_chain_length=V$[q.level].max_chain,q.strstart=0,q.block_start=0,q.lookahead=0,q.insert=0,q.match_length=q.prev_length=U-1,q.match_available=0,q.ins_h=0}function jM(){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=H4,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 yq.Buf16(UV*2),this.dyn_dtree=new yq.Buf16((2*BV+1)*2),this.bl_tree=new yq.Buf16((2*eV+1)*2),P8(this.dyn_ltree),P8(this.dyn_dtree),P8(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new yq.Buf16(FV+1),this.heap=new yq.Buf16(2*o_+1),P8(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new yq.Buf16(2*o_+1),P8(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 hw(q){var $;if(!q||!q.state)return j8(q,v6);if(q.total_in=q.total_out=0,q.data_type=lV,$=q.state,$.pending=0,$.pending_out=0,$.wrap<0)$.wrap=-$.wrap;return $.status=$.wrap?J4:R8,q.adler=$.wrap===2?0:1,$.last_flush=E8,w6._tr_init($),R6}function Vw(q){var $=hw(q);if($===R6)_M(q.state);return $}function YM(q,$){if(!q||!q.state)return v6;if(q.state.wrap!==2)return v6;return q.state.gzhead=$,R6}function Mw(q,$,K,P,_,j){if(!q)return v6;var Y=1;if($===LV)$=6;if(P<0)Y=0,P=-P;else if(P>15)Y=2,P-=16;if(_<1||_>oV||K!==H4||P<8||P>15||$<0||$>9||j<0||j>nV)return j8(q,v6);if(P===8)P=9;var w=new jM;return q.state=w,w.strm=q,w.wrap=Y,w.gzhead=null,w.w_bits=P,w.w_size=1<<w.w_bits,w.w_mask=w.w_size-1,w.hash_bits=_+7,w.hash_size=1<<w.hash_bits,w.hash_mask=w.hash_size-1,w.hash_shift=~~((w.hash_bits+U-1)/U),w.window=new yq.Buf8(w.w_size*2),w.head=new yq.Buf16(w.hash_size),w.prev=new yq.Buf16(w.w_size),w.lit_bufsize=1<<_+6,w.pending_buf_size=w.lit_bufsize*4,w.pending_buf=new yq.Buf8(w.pending_buf_size),w.d_buf=1*w.lit_bufsize,w.l_buf=3*w.lit_bufsize,w.level=$,w.strategy=j,w.method=K,Vw(q)}function wM(q,$){return Mw(q,$,H4,aV,rV,cV)}function vM(q,$){var K,P,_,j;if(!q||!q.state||$>kw||$<0)return q?j8(q,v6):v6;if(P=q.state,!q.output||!q.input&&q.avail_in!==0||P.status===NK&&$!==Y8)return j8(q,q.avail_out===0?c_:v6);if(P.strm=q,K=P.last_flush,P.last_flush=$,P.status===J4)if(P.wrap===2)if(q.adler=0,F(P,31),F(P,139),F(P,8),!P.gzhead)F(P,0),F(P,0),F(P,0),F(P,0),F(P,0),F(P,P.level===9?2:P.strategy>=O4||P.level<2?4:0),F(P,QV),P.status=R8;else{if(F(P,(P.gzhead.text?1:0)+(P.gzhead.hcrc?2:0)+(!P.gzhead.extra?0:4)+(!P.gzhead.name?0:8)+(!P.gzhead.comment?0:16)),F(P,P.gzhead.time&255),F(P,P.gzhead.time>>8&255),F(P,P.gzhead.time>>16&255),F(P,P.gzhead.time>>24&255),F(P,P.level===9?2:P.strategy>=O4||P.level<2?4:0),F(P,P.gzhead.os&255),P.gzhead.extra&&P.gzhead.extra.length)F(P,P.gzhead.extra.length&255),F(P,P.gzhead.extra.length>>8&255);if(P.gzhead.hcrc)q.adler=$8(q.adler,P.pending_buf,P.pending,0);P.gzindex=0,P.status=a_}else{var Y=H4+(P.w_bits-8<<4)<<8,w=-1;if(P.strategy>=O4||P.level<2)w=0;else if(P.level<6)w=1;else if(P.level===6)w=2;else w=3;if(Y|=w<<6,P.strstart!==0)Y|=sV;if(Y+=31-Y%31,P.status=R8,CK(P,Y),P.strstart!==0)CK(P,q.adler>>>16),CK(P,q.adler&65535);q.adler=1}if(P.status===a_)if(P.gzhead.extra){_=P.pending;while(P.gzindex<(P.gzhead.extra.length&65535)){if(P.pending===P.pending_buf_size){if(P.gzhead.hcrc&&P.pending>_)q.adler=$8(q.adler,P.pending_buf,P.pending-_,_);if(K8(q),_=P.pending,P.pending===P.pending_buf_size)break}F(P,P.gzhead.extra[P.gzindex]&255),P.gzindex++}if(P.gzhead.hcrc&&P.pending>_)q.adler=$8(q.adler,P.pending_buf,P.pending-_,_);if(P.gzindex===P.gzhead.extra.length)P.gzindex=0,P.status=z4}else P.status=z4;if(P.status===z4)if(P.gzhead.name){_=P.pending;do{if(P.pending===P.pending_buf_size){if(P.gzhead.hcrc&&P.pending>_)q.adler=$8(q.adler,P.pending_buf,P.pending-_,_);if(K8(q),_=P.pending,P.pending===P.pending_buf_size){j=1;break}}if(P.gzindex<P.gzhead.name.length)j=P.gzhead.name.charCodeAt(P.gzindex++)&255;else j=0;F(P,j)}while(j!==0);if(P.gzhead.hcrc&&P.pending>_)q.adler=$8(q.adler,P.pending_buf,P.pending-_,_);if(j===0)P.gzindex=0,P.status=W4}else P.status=W4;if(P.status===W4)if(P.gzhead.comment){_=P.pending;do{if(P.pending===P.pending_buf_size){if(P.gzhead.hcrc&&P.pending>_)q.adler=$8(q.adler,P.pending_buf,P.pending-_,_);if(K8(q),_=P.pending,P.pending===P.pending_buf_size){j=1;break}}if(P.gzindex<P.gzhead.comment.length)j=P.gzhead.comment.charCodeAt(P.gzindex++)&255;else j=0;F(P,j)}while(j!==0);if(P.gzhead.hcrc&&P.pending>_)q.adler=$8(q.adler,P.pending_buf,P.pending-_,_);if(j===0)P.status=T4}else P.status=T4;if(P.status===T4)if(P.gzhead.hcrc){if(P.pending+2>P.pending_buf_size)K8(q);if(P.pending+2<=P.pending_buf_size)F(P,q.adler&255),F(P,q.adler>>8&255),q.adler=0,P.status=R8}else P.status=R8;if(P.pending!==0){if(K8(q),q.avail_out===0)return P.last_flush=-1,R6}else if(q.avail_in===0&&fw($)<=fw(K)&&$!==Y8)return j8(q,c_);if(P.status===NK&&q.avail_in!==0)return j8(q,c_);if(q.avail_in!==0||P.lookahead!==0||$!==E8&&P.status!==NK){var O=P.strategy===O4?PM(P,$):P.strategy===xV?KM(P,$):V$[P.level].func(P,$);if(O===m8||O===M$)P.status=NK;if(O===hq||O===m8){if(q.avail_out===0)P.last_flush=-1;return R6}if(O===SK){if($===DV)w6._tr_align(P);else if($!==kw){if(w6._tr_stored_block(P,0,0,!1),$===yV){if(P8(P.head),P.lookahead===0)P.strstart=0,P.block_start=0,P.insert=0}}if(K8(q),q.avail_out===0)return P.last_flush=-1,R6}}if($!==Y8)return R6;if(P.wrap<=0)return Xw;if(P.wrap===2)F(P,q.adler&255),F(P,q.adler>>8&255),F(P,q.adler>>16&255),F(P,q.adler>>24&255),F(P,q.total_in&255),F(P,q.total_in>>8&255),F(P,q.total_in>>16&255),F(P,q.total_in>>24&255);else CK(P,q.adler>>>16),CK(P,q.adler&65535);if(K8(q),P.wrap>0)P.wrap=-P.wrap;return P.pending!==0?R6:Xw}function OM(q){var $;if(!q||!q.state)return v6;if($=q.state.status,$!==J4&&$!==a_&&$!==z4&&$!==W4&&$!==T4&&$!==R8&&$!==NK)return j8(q,v6);return q.state=null,$===R8?j8(q,dV):R6}function zM(q,$){var K=$.length,P,_,j,Y,w,O,v,z;if(!q||!q.state)return v6;if(P=q.state,Y=P.wrap,Y===2||Y===1&&P.status!==J4||P.lookahead)return v6;if(Y===1)q.adler=Aw(q.adler,$,K,0);if(P.wrap=0,K>=P.w_size){if(Y===0)P8(P.head),P.strstart=0,P.block_start=0,P.insert=0;z=new yq.Buf8(P.w_size),yq.arraySet(z,$,K-P.w_size,P.w_size,0),$=z,K=P.w_size}w=q.avail_in,O=q.next_in,v=q.input,q.avail_in=K,q.next_in=0,q.input=$,I8(P);while(P.lookahead>=U){_=P.strstart,j=P.lookahead-(U-1);do P.ins_h=(P.ins_h<<P.hash_shift^P.window[_+U-1])&P.hash_mask,P.prev[_&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=_,_++;while(--j);P.strstart=_,P.lookahead=U-1,I8(P)}return P.strstart+=P.lookahead,P.block_start=P.strstart,P.insert=P.lookahead,P.lookahead=0,P.match_length=P.prev_length=U-1,P.match_available=0,q.next_in=O,q.input=v,q.avail_in=w,P.wrap=Y,R6}WM.deflateInit=wM;WM.deflateInit2=Mw;WM.deflateReset=Vw;WM.deflateResetKeep=hw;WM.deflateSetHeader=YM;WM.deflate=vM;WM.deflateEnd=OM;WM.deflateSetDictionary=zM;WM.deflateInfo="pako deflate (from Nodeca project)"});var r_=R((hM)=>{var Z4=c6(),Nw=!0,Sw=!0;try{String.fromCharCode.apply(null,[0])}catch(q){Nw=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(q){Sw=!1}var bK=new Z4.Buf8(256);for(m6=0;m6<256;m6++)bK[m6]=m6>=252?6:m6>=248?5:m6>=240?4:m6>=224?3:m6>=192?2:1;var m6;bK[254]=bK[254]=1;hM.string2buf=function(q){var $,K,P,_,j,Y=q.length,w=0;for(_=0;_<Y;_++){if(K=q.charCodeAt(_),(K&64512)===55296&&_+1<Y){if(P=q.charCodeAt(_+1),(P&64512)===56320)K=65536+(K-55296<<10)+(P-56320),_++}w+=K<128?1:K<2048?2:K<65536?3:4}$=new Z4.Buf8(w);for(j=0,_=0;j<w;_++){if(K=q.charCodeAt(_),(K&64512)===55296&&_+1<Y){if(P=q.charCodeAt(_+1),(P&64512)===56320)K=65536+(K-55296<<10)+(P-56320),_++}if(K<128)$[j++]=K;else if(K<2048)$[j++]=192|K>>>6,$[j++]=128|K&63;else if(K<65536)$[j++]=224|K>>>12,$[j++]=128|K>>>6&63,$[j++]=128|K&63;else $[j++]=240|K>>>18,$[j++]=128|K>>>12&63,$[j++]=128|K>>>6&63,$[j++]=128|K&63}return $};function bw(q,$){if($<65534){if(q.subarray&&Sw||!q.subarray&&Nw)return String.fromCharCode.apply(null,Z4.shrinkBuf(q,$))}var K="";for(var P=0;P<$;P++)K+=String.fromCharCode(q[P]);return K}hM.buf2binstring=function(q){return bw(q,q.length)};hM.binstring2buf=function(q){var $=new Z4.Buf8(q.length);for(var K=0,P=$.length;K<P;K++)$[K]=q.charCodeAt(K);return $};hM.buf2string=function(q,$){var K,P,_,j,Y=$||q.length,w=Array(Y*2);for(P=0,K=0;K<Y;){if(_=q[K++],_<128){w[P++]=_;continue}if(j=bK[_],j>4){w[P++]=65533,K+=j-1;continue}_&=j===2?31:j===3?15:7;while(j>1&&K<Y)_=_<<6|q[K++]&63,j--;if(j>1){w[P++]=65533;continue}if(_<65536)w[P++]=_;else _-=65536,w[P++]=55296|_>>10&1023,w[P++]=56320|_&1023}return bw(w,P)};hM.utf8border=function(q,$){var K;if($=$||q.length,$>q.length)$=q.length;K=$-1;while(K>=0&&(q[K]&192)===128)K--;if(K<0)return $;if(K===0)return $;return K+bK[q[K]]>$?K:$}});var i_=R((al,uw)=>{function bM(){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}uw.exports=bM});var Ew=R((yM)=>{var uK=Cw(),RK=c6(),B_=r_(),e_=v4(),uM=i_(),Iw=Object.prototype.toString,RM=0,t_=4,C$=0,Rw=1,mw=2,mM=-1,IM=0,EM=8;function p8(q){if(!(this instanceof p8))return new p8(q);this.options=RK.assign({level:mM,method:EM,chunkSize:16384,windowBits:15,memLevel:8,strategy:IM,to:""},q||{});var $=this.options;if($.raw&&$.windowBits>0)$.windowBits=-$.windowBits;else if($.gzip&&$.windowBits>0&&$.windowBits<16)$.windowBits+=16;this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new uM,this.strm.avail_out=0;var K=uK.deflateInit2(this.strm,$.level,$.method,$.windowBits,$.memLevel,$.strategy);if(K!==C$)throw Error(e_[K]);if($.header)uK.deflateSetHeader(this.strm,$.header);if($.dictionary){var P;if(typeof $.dictionary==="string")P=B_.string2buf($.dictionary);else if(Iw.call($.dictionary)==="[object ArrayBuffer]")P=new Uint8Array($.dictionary);else P=$.dictionary;if(K=uK.deflateSetDictionary(this.strm,P),K!==C$)throw Error(e_[K]);this._dict_set=!0}}p8.prototype.push=function(q,$){var K=this.strm,P=this.options.chunkSize,_,j;if(this.ended)return!1;if(j=$===~~$?$:$===!0?t_:RM,typeof q==="string")K.input=B_.string2buf(q);else if(Iw.call(q)==="[object ArrayBuffer]")K.input=new Uint8Array(q);else K.input=q;K.next_in=0,K.avail_in=K.input.length;do{if(K.avail_out===0)K.output=new RK.Buf8(P),K.next_out=0,K.avail_out=P;if(_=uK.deflate(K,j),_!==Rw&&_!==C$)return this.onEnd(_),this.ended=!0,!1;if(K.avail_out===0||K.avail_in===0&&(j===t_||j===mw))if(this.options.to==="string")this.onData(B_.buf2binstring(RK.shrinkBuf(K.output,K.next_out)));else this.onData(RK.shrinkBuf(K.output,K.next_out))}while((K.avail_in>0||K.avail_out===0)&&_!==Rw);if(j===t_)return _=uK.deflateEnd(this.strm),this.onEnd(_),this.ended=!0,_===C$;if(j===mw)return this.onEnd(C$),K.avail_out=0,!0;return!0};p8.prototype.onData=function(q){this.chunks.push(q)};p8.prototype.onEnd=function(q){if(q===C$)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=RK.flattenChunks(this.chunks);this.chunks=[],this.err=q,this.msg=this.strm.msg};function U_(q,$){var K=new p8($);if(K.push(q,!0),K.err)throw K.msg||e_[K.err];return K.result}function pM(q,$){return $=$||{},$.raw=!0,U_(q,$)}function DM(q,$){return $=$||{},$.gzip=!0,U_(q,$)}yM.Deflate=p8;yM.deflate=U_;yM.deflateRaw=pM;yM.gzip=DM});var Dw=R((il,pw)=>{var k4=30,nM=12;pw.exports=function($,K){var P,_,j,Y,w,O,v,z,W,T,H,J,Z,X,G,f,N,V,C,b,k,M,A,u,S;P=$.state,_=$.next_in,u=$.input,j=_+($.avail_in-5),Y=$.next_out,S=$.output,w=Y-(K-$.avail_out),O=Y+($.avail_out-257),v=P.dmax,z=P.wsize,W=P.whave,T=P.wnext,H=P.window,J=P.hold,Z=P.bits,X=P.lencode,G=P.distcode,f=(1<<P.lenbits)-1,N=(1<<P.distbits)-1;q:do{if(Z<15)J+=u[_++]<<Z,Z+=8,J+=u[_++]<<Z,Z+=8;V=X[J&f];$:for(;;){if(C=V>>>24,J>>>=C,Z-=C,C=V>>>16&255,C===0)S[Y++]=V&65535;else if(C&16){if(b=V&65535,C&=15,C){if(Z<C)J+=u[_++]<<Z,Z+=8;b+=J&(1<<C)-1,J>>>=C,Z-=C}if(Z<15)J+=u[_++]<<Z,Z+=8,J+=u[_++]<<Z,Z+=8;V=G[J&N];K:for(;;){if(C=V>>>24,J>>>=C,Z-=C,C=V>>>16&255,C&16){if(k=V&65535,C&=15,Z<C){if(J+=u[_++]<<Z,Z+=8,Z<C)J+=u[_++]<<Z,Z+=8}if(k+=J&(1<<C)-1,k>v){$.msg="invalid distance too far back",P.mode=k4;break q}if(J>>>=C,Z-=C,C=Y-w,k>C){if(C=k-C,C>W){if(P.sane){$.msg="invalid distance too far back",P.mode=k4;break q}}if(M=0,A=H,T===0){if(M+=z-C,C<b){b-=C;do S[Y++]=H[M++];while(--C);M=Y-k,A=S}}else if(T<C){if(M+=z+T-C,C-=T,C<b){b-=C;do S[Y++]=H[M++];while(--C);if(M=0,T<b){C=T,b-=C;do S[Y++]=H[M++];while(--C);M=Y-k,A=S}}}else if(M+=T-C,C<b){b-=C;do S[Y++]=H[M++];while(--C);M=Y-k,A=S}while(b>2)S[Y++]=A[M++],S[Y++]=A[M++],S[Y++]=A[M++],b-=3;if(b){if(S[Y++]=A[M++],b>1)S[Y++]=A[M++]}}else{M=Y-k;do S[Y++]=S[M++],S[Y++]=S[M++],S[Y++]=S[M++],b-=3;while(b>2);if(b){if(S[Y++]=S[M++],b>1)S[Y++]=S[M++]}}}else if((C&64)===0){V=G[(V&65535)+(J&(1<<C)-1)];continue K}else{$.msg="invalid distance code",P.mode=k4;break q}break}}else if((C&64)===0){V=X[(V&65535)+(J&(1<<C)-1)];continue $}else if(C&32){P.mode=nM;break q}else{$.msg="invalid literal/length code",P.mode=k4;break q}break}}while(_<j&&Y<O);b=Z>>3,_-=b,Z-=b<<3,J&=(1<<Z)-1,$.next_in=_,$.next_out=Y,$.avail_in=_<j?5+(j-_):5-(_-j),$.avail_out=Y<O?257+(O-Y):257-(Y-O),P.hold=J,P.bits=Z;return}});var cw=R((tl,nw)=>{var yw=c6(),N$=15,dw=852,Lw=592,gw=0,F_=1,xw=2,cM=[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],lM=[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],oM=[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],aM=[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];nw.exports=function($,K,P,_,j,Y,w,O){var v=O.bits,z=0,W=0,T=0,H=0,J=0,Z=0,X=0,G=0,f=0,N=0,V,C,b,k,M,A=null,u=0,S,p=new yw.Buf16(N$+1),L=new yw.Buf16(N$+1),c=null,d=0,Q,Vq,Rq;for(z=0;z<=N$;z++)p[z]=0;for(W=0;W<_;W++)p[K[P+W]]++;J=v;for(H=N$;H>=1;H--)if(p[H]!==0)break;if(J>H)J=H;if(H===0)return j[Y++]=20971520,j[Y++]=20971520,O.bits=1,0;for(T=1;T<H;T++)if(p[T]!==0)break;if(J<T)J=T;G=1;for(z=1;z<=N$;z++)if(G<<=1,G-=p[z],G<0)return-1;if(G>0&&($===gw||H!==1))return-1;L[1]=0;for(z=1;z<N$;z++)L[z+1]=L[z]+p[z];for(W=0;W<_;W++)if(K[P+W]!==0)w[L[K[P+W]]++]=W;if($===gw)A=c=w,S=19;else if($===F_)A=cM,u-=257,c=lM,d-=257,S=256;else A=oM,c=aM,S=-1;if(N=0,W=0,z=T,M=Y,Z=J,X=0,b=-1,f=1<<J,k=f-1,$===F_&&f>dw||$===xw&&f>Lw)return 1;for(;;){if(Q=z-X,w[W]<S)Vq=0,Rq=w[W];else if(w[W]>S)Vq=c[d+w[W]],Rq=A[u+w[W]];else Vq=96,Rq=0;V=1<<z-X,C=1<<Z,T=C;do C-=V,j[M+(N>>X)+C]=Q<<24|Vq<<16|Rq|0;while(C!==0);V=1<<z-1;while(N&V)V>>=1;if(V!==0)N&=V-1,N+=V;else N=0;if(W++,--p[z]===0){if(z===H)break;z=K[P+w[W]]}if(z>J&&(N&k)!==b){if(X===0)X=J;M+=T,Z=z-X,G=1<<Z;while(Z+X<H){if(G-=p[Z+X],G<=0)break;Z++,G<<=1}if(f+=1<<Z,$===F_&&f>dw||$===xw&&f>Lw)return 1;b=N&k,j[b]=J<<24|Z<<16|M-Y|0}}if(N!==0)j[M+N]=z-X<<24|4194304|0;return O.bits=J,0}});var Vv=R((OC)=>{var Qq=c6(),P3=x_(),I6=n_(),rM=Dw(),mK=cw(),iM=0,Hv=1,Jv=2,lw=4,tM=5,X4=6,D8=0,BM=1,eM=2,O6=-2,Zv=-3,_3=-4,UM=-5,ow=8,kv=1,aw=2,rw=3,iw=4,tw=5,Bw=6,ew=7,Uw=8,Fw=9,sw=10,G4=11,o6=12,s_=13,Qw=14,Q_=15,qv=16,$v=17,Kv=18,Pv=19,f4=20,A4=21,_v=22,jv=23,Yv=24,wv=25,vv=26,q3=27,Ov=28,zv=29,jq=30,j3=31,FM=32,sM=852,QM=592,qC=15,$C=qC;function Wv(q){return(q>>>24&255)+(q>>>8&65280)+((q&65280)<<8)+((q&255)<<24)}function KC(){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 Qq.Buf16(320),this.work=new Qq.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Xv(q){var $;if(!q||!q.state)return O6;if($=q.state,q.total_in=q.total_out=$.total=0,q.msg="",$.wrap)q.adler=$.wrap&1;return $.mode=kv,$.last=0,$.havedict=0,$.dmax=32768,$.head=null,$.hold=0,$.bits=0,$.lencode=$.lendyn=new Qq.Buf32(sM),$.distcode=$.distdyn=new Qq.Buf32(QM),$.sane=1,$.back=-1,D8}function fv(q){var $;if(!q||!q.state)return O6;return $=q.state,$.wsize=0,$.whave=0,$.wnext=0,Xv(q)}function Av(q,$){var K,P;if(!q||!q.state)return O6;if(P=q.state,$<0)K=0,$=-$;else if(K=($>>4)+1,$<48)$&=15;if($&&($<8||$>15))return O6;if(P.window!==null&&P.wbits!==$)P.window=null;return P.wrap=K,P.wbits=$,fv(q)}function Gv(q,$){var K,P;if(!q)return O6;if(P=new KC,q.state=P,P.window=null,K=Av(q,$),K!==D8)q.state=null;return K}function PC(q){return Gv(q,$C)}var Tv=!0,$3,K3;function _C(q){if(Tv){var $;$3=new Qq.Buf32(512),K3=new Qq.Buf32(32),$=0;while($<144)q.lens[$++]=8;while($<256)q.lens[$++]=9;while($<280)q.lens[$++]=7;while($<288)q.lens[$++]=8;mK(Hv,q.lens,0,288,$3,0,q.work,{bits:9}),$=0;while($<32)q.lens[$++]=5;mK(Jv,q.lens,0,32,K3,0,q.work,{bits:5}),Tv=!1}q.lencode=$3,q.lenbits=9,q.distcode=K3,q.distbits=5}function hv(q,$,K,P){var _,j=q.state;if(j.window===null)j.wsize=1<<j.wbits,j.wnext=0,j.whave=0,j.window=new Qq.Buf8(j.wsize);if(P>=j.wsize)Qq.arraySet(j.window,$,K-j.wsize,j.wsize,0),j.wnext=0,j.whave=j.wsize;else{if(_=j.wsize-j.wnext,_>P)_=P;if(Qq.arraySet(j.window,$,K-P,_,j.wnext),P-=_,P)Qq.arraySet(j.window,$,K-P,P,0),j.wnext=P,j.whave=j.wsize;else{if(j.wnext+=_,j.wnext===j.wsize)j.wnext=0;if(j.whave<j.wsize)j.whave+=_}}return 0}function jC(q,$){var K,P,_,j,Y,w,O,v,z,W,T,H,J,Z,X=0,G,f,N,V,C,b,k,M,A=new Qq.Buf8(4),u,S,p=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!q||!q.state||!q.output||!q.input&&q.avail_in!==0)return O6;if(K=q.state,K.mode===o6)K.mode=s_;Y=q.next_out,_=q.output,O=q.avail_out,j=q.next_in,P=q.input,w=q.avail_in,v=K.hold,z=K.bits,W=w,T=O,M=D8;q:for(;;)switch(K.mode){case kv:if(K.wrap===0){K.mode=s_;break}while(z<16){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(K.wrap&2&&v===35615){K.check=0,A[0]=v&255,A[1]=v>>>8&255,K.check=I6(K.check,A,2,0),v=0,z=0,K.mode=aw;break}if(K.flags=0,K.head)K.head.done=!1;if(!(K.wrap&1)||(((v&255)<<8)+(v>>8))%31){q.msg="incorrect header check",K.mode=jq;break}if((v&15)!==ow){q.msg="unknown compression method",K.mode=jq;break}if(v>>>=4,z-=4,k=(v&15)+8,K.wbits===0)K.wbits=k;else if(k>K.wbits){q.msg="invalid window size",K.mode=jq;break}K.dmax=1<<k,q.adler=K.check=1,K.mode=v&512?sw:o6,v=0,z=0;break;case aw:while(z<16){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(K.flags=v,(K.flags&255)!==ow){q.msg="unknown compression method",K.mode=jq;break}if(K.flags&57344){q.msg="unknown header flags set",K.mode=jq;break}if(K.head)K.head.text=v>>8&1;if(K.flags&512)A[0]=v&255,A[1]=v>>>8&255,K.check=I6(K.check,A,2,0);v=0,z=0,K.mode=rw;case rw:while(z<32){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(K.head)K.head.time=v;if(K.flags&512)A[0]=v&255,A[1]=v>>>8&255,A[2]=v>>>16&255,A[3]=v>>>24&255,K.check=I6(K.check,A,4,0);v=0,z=0,K.mode=iw;case iw:while(z<16){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(K.head)K.head.xflags=v&255,K.head.os=v>>8;if(K.flags&512)A[0]=v&255,A[1]=v>>>8&255,K.check=I6(K.check,A,2,0);v=0,z=0,K.mode=tw;case tw:if(K.flags&1024){while(z<16){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(K.length=v,K.head)K.head.extra_len=v;if(K.flags&512)A[0]=v&255,A[1]=v>>>8&255,K.check=I6(K.check,A,2,0);v=0,z=0}else if(K.head)K.head.extra=null;K.mode=Bw;case Bw:if(K.flags&1024){if(H=K.length,H>w)H=w;if(H){if(K.head){if(k=K.head.extra_len-K.length,!K.head.extra)K.head.extra=Array(K.head.extra_len);Qq.arraySet(K.head.extra,P,j,H,k)}if(K.flags&512)K.check=I6(K.check,P,H,j);w-=H,j+=H,K.length-=H}if(K.length)break q}K.length=0,K.mode=ew;case ew:if(K.flags&2048){if(w===0)break q;H=0;do if(k=P[j+H++],K.head&&k&&K.length<65536)K.head.name+=String.fromCharCode(k);while(k&&H<w);if(K.flags&512)K.check=I6(K.check,P,H,j);if(w-=H,j+=H,k)break q}else if(K.head)K.head.name=null;K.length=0,K.mode=Uw;case Uw:if(K.flags&4096){if(w===0)break q;H=0;do if(k=P[j+H++],K.head&&k&&K.length<65536)K.head.comment+=String.fromCharCode(k);while(k&&H<w);if(K.flags&512)K.check=I6(K.check,P,H,j);if(w-=H,j+=H,k)break q}else if(K.head)K.head.comment=null;K.mode=Fw;case Fw:if(K.flags&512){while(z<16){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(v!==(K.check&65535)){q.msg="header crc mismatch",K.mode=jq;break}v=0,z=0}if(K.head)K.head.hcrc=K.flags>>9&1,K.head.done=!0;q.adler=K.check=0,K.mode=o6;break;case sw:while(z<32){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}q.adler=K.check=Wv(v),v=0,z=0,K.mode=G4;case G4:if(K.havedict===0)return q.next_out=Y,q.avail_out=O,q.next_in=j,q.avail_in=w,K.hold=v,K.bits=z,eM;q.adler=K.check=1,K.mode=o6;case o6:if($===tM||$===X4)break q;case s_:if(K.last){v>>>=z&7,z-=z&7,K.mode=q3;break}while(z<3){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}switch(K.last=v&1,v>>>=1,z-=1,v&3){case 0:K.mode=Qw;break;case 1:if(_C(K),K.mode=f4,$===X4){v>>>=2,z-=2;break q}break;case 2:K.mode=$v;break;case 3:q.msg="invalid block type",K.mode=jq}v>>>=2,z-=2;break;case Qw:v>>>=z&7,z-=z&7;while(z<32){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if((v&65535)!==(v>>>16^65535)){q.msg="invalid stored block lengths",K.mode=jq;break}if(K.length=v&65535,v=0,z=0,K.mode=Q_,$===X4)break q;case Q_:K.mode=qv;case qv:if(H=K.length,H){if(H>w)H=w;if(H>O)H=O;if(H===0)break q;Qq.arraySet(_,P,j,H,Y),w-=H,j+=H,O-=H,Y+=H,K.length-=H;break}K.mode=o6;break;case $v:while(z<14){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(K.nlen=(v&31)+257,v>>>=5,z-=5,K.ndist=(v&31)+1,v>>>=5,z-=5,K.ncode=(v&15)+4,v>>>=4,z-=4,K.nlen>286||K.ndist>30){q.msg="too many length or distance symbols",K.mode=jq;break}K.have=0,K.mode=Kv;case Kv:while(K.have<K.ncode){while(z<3){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}K.lens[p[K.have++]]=v&7,v>>>=3,z-=3}while(K.have<19)K.lens[p[K.have++]]=0;if(K.lencode=K.lendyn,K.lenbits=7,u={bits:K.lenbits},M=mK(iM,K.lens,0,19,K.lencode,0,K.work,u),K.lenbits=u.bits,M){q.msg="invalid code lengths set",K.mode=jq;break}K.have=0,K.mode=Pv;case Pv:while(K.have<K.nlen+K.ndist){for(;;){if(X=K.lencode[v&(1<<K.lenbits)-1],G=X>>>24,f=X>>>16&255,N=X&65535,G<=z)break;if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(N<16)v>>>=G,z-=G,K.lens[K.have++]=N;else{if(N===16){S=G+2;while(z<S){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(v>>>=G,z-=G,K.have===0){q.msg="invalid bit length repeat",K.mode=jq;break}k=K.lens[K.have-1],H=3+(v&3),v>>>=2,z-=2}else if(N===17){S=G+3;while(z<S){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}v>>>=G,z-=G,k=0,H=3+(v&7),v>>>=3,z-=3}else{S=G+7;while(z<S){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}v>>>=G,z-=G,k=0,H=11+(v&127),v>>>=7,z-=7}if(K.have+H>K.nlen+K.ndist){q.msg="invalid bit length repeat",K.mode=jq;break}while(H--)K.lens[K.have++]=k}}if(K.mode===jq)break;if(K.lens[256]===0){q.msg="invalid code -- missing end-of-block",K.mode=jq;break}if(K.lenbits=9,u={bits:K.lenbits},M=mK(Hv,K.lens,0,K.nlen,K.lencode,0,K.work,u),K.lenbits=u.bits,M){q.msg="invalid literal/lengths set",K.mode=jq;break}if(K.distbits=6,K.distcode=K.distdyn,u={bits:K.distbits},M=mK(Jv,K.lens,K.nlen,K.ndist,K.distcode,0,K.work,u),K.distbits=u.bits,M){q.msg="invalid distances set",K.mode=jq;break}if(K.mode=f4,$===X4)break q;case f4:K.mode=A4;case A4:if(w>=6&&O>=258){if(q.next_out=Y,q.avail_out=O,q.next_in=j,q.avail_in=w,K.hold=v,K.bits=z,rM(q,T),Y=q.next_out,_=q.output,O=q.avail_out,j=q.next_in,P=q.input,w=q.avail_in,v=K.hold,z=K.bits,K.mode===o6)K.back=-1;break}K.back=0;for(;;){if(X=K.lencode[v&(1<<K.lenbits)-1],G=X>>>24,f=X>>>16&255,N=X&65535,G<=z)break;if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(f&&(f&240)===0){V=G,C=f,b=N;for(;;){if(X=K.lencode[b+((v&(1<<V+C)-1)>>V)],G=X>>>24,f=X>>>16&255,N=X&65535,V+G<=z)break;if(w===0)break q;w--,v+=P[j++]<<z,z+=8}v>>>=V,z-=V,K.back+=V}if(v>>>=G,z-=G,K.back+=G,K.length=N,f===0){K.mode=vv;break}if(f&32){K.back=-1,K.mode=o6;break}if(f&64){q.msg="invalid literal/length code",K.mode=jq;break}K.extra=f&15,K.mode=_v;case _v:if(K.extra){S=K.extra;while(z<S){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}K.length+=v&(1<<K.extra)-1,v>>>=K.extra,z-=K.extra,K.back+=K.extra}K.was=K.length,K.mode=jv;case jv:for(;;){if(X=K.distcode[v&(1<<K.distbits)-1],G=X>>>24,f=X>>>16&255,N=X&65535,G<=z)break;if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if((f&240)===0){V=G,C=f,b=N;for(;;){if(X=K.distcode[b+((v&(1<<V+C)-1)>>V)],G=X>>>24,f=X>>>16&255,N=X&65535,V+G<=z)break;if(w===0)break q;w--,v+=P[j++]<<z,z+=8}v>>>=V,z-=V,K.back+=V}if(v>>>=G,z-=G,K.back+=G,f&64){q.msg="invalid distance code",K.mode=jq;break}K.offset=N,K.extra=f&15,K.mode=Yv;case Yv:if(K.extra){S=K.extra;while(z<S){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}K.offset+=v&(1<<K.extra)-1,v>>>=K.extra,z-=K.extra,K.back+=K.extra}if(K.offset>K.dmax){q.msg="invalid distance too far back",K.mode=jq;break}K.mode=wv;case wv:if(O===0)break q;if(H=T-O,K.offset>H){if(H=K.offset-H,H>K.whave){if(K.sane){q.msg="invalid distance too far back",K.mode=jq;break}}if(H>K.wnext)H-=K.wnext,J=K.wsize-H;else J=K.wnext-H;if(H>K.length)H=K.length;Z=K.window}else Z=_,J=Y-K.offset,H=K.length;if(H>O)H=O;O-=H,K.length-=H;do _[Y++]=Z[J++];while(--H);if(K.length===0)K.mode=A4;break;case vv:if(O===0)break q;_[Y++]=K.length,O--,K.mode=A4;break;case q3:if(K.wrap){while(z<32){if(w===0)break q;w--,v|=P[j++]<<z,z+=8}if(T-=O,q.total_out+=T,K.total+=T,T)q.adler=K.check=K.flags?I6(K.check,_,T,Y-T):P3(K.check,_,T,Y-T);if(T=O,(K.flags?v:Wv(v))!==K.check){q.msg="incorrect data check",K.mode=jq;break}v=0,z=0}K.mode=Ov;case Ov:if(K.wrap&&K.flags){while(z<32){if(w===0)break q;w--,v+=P[j++]<<z,z+=8}if(v!==(K.total&4294967295)){q.msg="incorrect length check",K.mode=jq;break}v=0,z=0}K.mode=zv;case zv:M=BM;break q;case jq:M=Zv;break q;case j3:return _3;case FM:default:return O6}if(q.next_out=Y,q.avail_out=O,q.next_in=j,q.avail_in=w,K.hold=v,K.bits=z,K.wsize||T!==q.avail_out&&K.mode<jq&&(K.mode<q3||$!==lw)){if(hv(q,q.output,q.next_out,T-q.avail_out))return K.mode=j3,_3}if(W-=q.avail_in,T-=q.avail_out,q.total_in+=W,q.total_out+=T,K.total+=T,K.wrap&&T)q.adler=K.check=K.flags?I6(K.check,_,T,q.next_out-T):P3(K.check,_,T,q.next_out-T);if(q.data_type=K.bits+(K.last?64:0)+(K.mode===o6?128:0)+(K.mode===f4||K.mode===Q_?256:0),(W===0&&T===0||$===lw)&&M===D8)M=UM;return M}function YC(q){if(!q||!q.state)return O6;var $=q.state;if($.window)$.window=null;return q.state=null,D8}function wC(q,$){var K;if(!q||!q.state)return O6;if(K=q.state,(K.wrap&2)===0)return O6;return K.head=$,$.done=!1,D8}function vC(q,$){var K=$.length,P,_,j;if(!q||!q.state)return O6;if(P=q.state,P.wrap!==0&&P.mode!==G4)return O6;if(P.mode===G4){if(_=1,_=P3(_,$,K,0),_!==P.check)return Zv}if(j=hv(q,$,K,K),j)return P.mode=j3,_3;return P.havedict=1,D8}OC.inflateReset=fv;OC.inflateReset2=Av;OC.inflateResetKeep=Xv;OC.inflateInit=PC;OC.inflateInit2=Gv;OC.inflate=jC;OC.inflateEnd=YC;OC.inflateGetHeader=wC;OC.inflateSetDictionary=vC;OC.inflateInfo="pako inflate (from Nodeca project)"});var Y3=R((el,Mv)=>{Mv.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 Nv=R((Ul,Cv)=>{function GC(){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}Cv.exports=GC});var bv=R((CC)=>{var S$=Vv(),IK=c6(),h4=r_(),Hq=Y3(),w3=v4(),hC=i_(),VC=Nv(),Sv=Object.prototype.toString;function y8(q){if(!(this instanceof y8))return new y8(q);this.options=IK.assign({chunkSize:16384,windowBits:0,to:""},q||{});var $=this.options;if($.raw&&$.windowBits>=0&&$.windowBits<16){if($.windowBits=-$.windowBits,$.windowBits===0)$.windowBits=-15}if($.windowBits>=0&&$.windowBits<16&&!(q&&q.windowBits))$.windowBits+=32;if($.windowBits>15&&$.windowBits<48){if(($.windowBits&15)===0)$.windowBits|=15}this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new hC,this.strm.avail_out=0;var K=S$.inflateInit2(this.strm,$.windowBits);if(K!==Hq.Z_OK)throw Error(w3[K]);if(this.header=new VC,S$.inflateGetHeader(this.strm,this.header),$.dictionary){if(typeof $.dictionary==="string")$.dictionary=h4.string2buf($.dictionary);else if(Sv.call($.dictionary)==="[object ArrayBuffer]")$.dictionary=new Uint8Array($.dictionary);if($.raw){if(K=S$.inflateSetDictionary(this.strm,$.dictionary),K!==Hq.Z_OK)throw Error(w3[K])}}}y8.prototype.push=function(q,$){var K=this.strm,P=this.options.chunkSize,_=this.options.dictionary,j,Y,w,O,v,z=!1;if(this.ended)return!1;if(Y=$===~~$?$:$===!0?Hq.Z_FINISH:Hq.Z_NO_FLUSH,typeof q==="string")K.input=h4.binstring2buf(q);else if(Sv.call(q)==="[object ArrayBuffer]")K.input=new Uint8Array(q);else K.input=q;K.next_in=0,K.avail_in=K.input.length;do{if(K.avail_out===0)K.output=new IK.Buf8(P),K.next_out=0,K.avail_out=P;if(j=S$.inflate(K,Hq.Z_NO_FLUSH),j===Hq.Z_NEED_DICT&&_)j=S$.inflateSetDictionary(this.strm,_);if(j===Hq.Z_BUF_ERROR&&z===!0)j=Hq.Z_OK,z=!1;if(j!==Hq.Z_STREAM_END&&j!==Hq.Z_OK)return this.onEnd(j),this.ended=!0,!1;if(K.next_out){if(K.avail_out===0||j===Hq.Z_STREAM_END||K.avail_in===0&&(Y===Hq.Z_FINISH||Y===Hq.Z_SYNC_FLUSH))if(this.options.to==="string"){if(w=h4.utf8border(K.output,K.next_out),O=K.next_out-w,v=h4.buf2string(K.output,w),K.next_out=O,K.avail_out=P-O,O)IK.arraySet(K.output,K.output,w,O,0);this.onData(v)}else this.onData(IK.shrinkBuf(K.output,K.next_out))}if(K.avail_in===0&&K.avail_out===0)z=!0}while((K.avail_in>0||K.avail_out===0)&&j!==Hq.Z_STREAM_END);if(j===Hq.Z_STREAM_END)Y=Hq.Z_FINISH;if(Y===Hq.Z_FINISH)return j=S$.inflateEnd(this.strm),this.onEnd(j),this.ended=!0,j===Hq.Z_OK;if(Y===Hq.Z_SYNC_FLUSH)return this.onEnd(Hq.Z_OK),K.avail_out=0,!0;return!0};y8.prototype.onData=function(q){this.chunks.push(q)};y8.prototype.onEnd=function(q){if(q===Hq.Z_OK)if(this.options.to==="string")this.result=this.chunks.join("");else this.result=IK.flattenChunks(this.chunks);this.chunks=[],this.err=q,this.msg=this.strm.msg};function v3(q,$){var K=new y8($);if(K.push(q,!0),K.err)throw K.msg||w3[K.err];return K.result}function MC(q,$){return $=$||{},$.raw=!0,v3(q,$)}CC.Inflate=y8;CC.inflate=v3;CC.inflateRaw=MC;CC.ungzip=v3});var mv=R((sl,Rv)=>{var RC=c6().assign,mC=Ew(),IC=bv(),EC=Y3(),uv={};RC(uv,mC,IC,EC);Rv.exports=uv});var pv=R((Ql,Ev)=>{var Iv=(q,$)=>function(...K){return new $.promiseModule((_,j)=>{if($.multiArgs)K.push((...Y)=>{if($.errorFirst)if(Y[0])j(Y);else Y.shift(),_(Y);else _(Y)});else if($.errorFirst)K.push((Y,w)=>{if(Y)j(Y);else _(w)});else K.push(_);q.apply(this,K)})};Ev.exports=(q,$)=>{$=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},$);let K=typeof q;if(!(q!==null&&(K==="object"||K==="function")))throw TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${q===null?"null":K}\``);let P=(j)=>{let Y=(w)=>typeof w==="string"?j===w:w.test(j);return $.include?$.include.some(Y):!$.exclude.some(Y)},_;if(K==="function")_=function(...j){return $.excludeMain?q(...j):Iv(q,$).apply(this,j)};else _=Object.create(Object.getPrototypeOf(q));for(let j in q){let Y=q[j];_[j]=typeof Y==="function"&&P(j)?Iv(Y,$):Y}return _}});var av=R((qo,ov)=>{function Dv(q){return Array.isArray(q)?q:[q]}var W3="",yv=" ",O3="\\",pC=/^\s+$/,DC=/(?:[^\\]|^)\\$/,yC=/^\\!/,dC=/^\\#/,LC=/\r?\n/g,gC=/^\.*\/|^\.+$/,z3="/",gv="node-ignore";if(typeof Symbol<"u")gv=Symbol.for("node-ignore");var dv=gv,xC=(q,$,K)=>Object.defineProperty(q,$,{value:K}),nC=/([0-z])-([0-z])/g,xv=()=>!1,cC=(q)=>q.replace(nC,($,K,P)=>K.charCodeAt(0)<=P.charCodeAt(0)?$:W3),lC=(q)=>{let{length:$}=q;return q.slice(0,$-$%2)},oC=[[/^\uFEFF/,()=>W3],[/((?:\\\\)*?)(\\?\s+)$/,(q,$,K)=>$+(K.indexOf("\\")===0?yv:W3)],[/(\\+?)\s/g,(q,$)=>{let{length:K}=$;return $.slice(0,K-K%2)+yv}],[/[\\$.|*+(){^]/g,(q)=>`\\${q}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return!/\/(?!$)/.test(this)?"(?:^|\\/)":"^"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(q,$,K)=>$+6<K.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(q,$,K)=>{let P=K.replace(/\\\*/g,"[^\\/]*");return $+P}],[/\\\\\\(?=[$.|*+(){^])/g,()=>O3],[/\\\\/g,()=>O3],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(q,$,K,P,_)=>$===O3?`\\[${K}${lC(P)}${_}`:_==="]"?P.length%2===0?`[${cC(K)}${P}]`:"[]":"[]"],[/(?:[^*])$/,(q)=>/\/$/.test(q)?`${q}$`:`${q}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(q,$)=>{return`${$?`${$}[^/]+`:"[^/]*"}(?=$|\\/$)`}]],Lv=Object.create(null),aC=(q,$)=>{let K=Lv[q];if(!K)K=oC.reduce((P,[_,j])=>P.replace(_,j.bind(q)),q),Lv[q]=K;return $?new RegExp(K,"i"):new RegExp(K)},T3=(q)=>typeof q==="string",rC=(q)=>q&&T3(q)&&!pC.test(q)&&!DC.test(q)&&q.indexOf("#")!==0,iC=(q)=>q.split(LC);class nv{constructor(q,$,K,P){this.origin=q,this.pattern=$,this.negative=K,this.regex=P}}var tC=(q,$)=>{let K=q,P=!1;if(q.indexOf("!")===0)P=!0,q=q.substr(1);q=q.replace(yC,"!").replace(dC,"#");let _=aC(q,$);return new nv(K,q,P,_)},BC=(q,$)=>{throw new $(q)},a6=(q,$,K)=>{if(!T3(q))return K(`path must be a string, but got \`${$}\``,TypeError);if(!q)return K("path must not be empty",TypeError);if(a6.isNotRelative(q))return K(`path should be a \`path.relative()\`d string, but got "${$}"`,RangeError);return!0},cv=(q)=>gC.test(q);a6.isNotRelative=cv;a6.convert=(q)=>q;class lv{constructor({ignorecase:q=!0,ignoreCase:$=q,allowRelativePaths:K=!1}={}){xC(this,dv,!0),this._rules=[],this._ignoreCase=$,this._allowRelativePaths=K,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(q){if(q&&q[dv]){this._rules=this._rules.concat(q._rules),this._added=!0;return}if(rC(q)){let $=tC(q,this._ignoreCase);this._added=!0,this._rules.push($)}}add(q){if(this._added=!1,Dv(T3(q)?iC(q):q).forEach(this._addPattern,this),this._added)this._initCache();return this}addPattern(q){return this.add(q)}_testOne(q,$){let K=!1,P=!1;return this._rules.forEach((_)=>{let{negative:j}=_;if(P===j&&K!==P||j&&!K&&!P&&!$)return;if(_.regex.test(q))K=!j,P=j}),{ignored:K,unignored:P}}_test(q,$,K,P){let _=q&&a6.convert(q);return a6(_,q,this._allowRelativePaths?xv:BC),this._t(_,$,K,P)}_t(q,$,K,P){if(q in $)return $[q];if(!P)P=q.split(z3);if(P.pop(),!P.length)return $[q]=this._testOne(q,K);let _=this._t(P.join(z3)+z3,$,K,P);return $[q]=_.ignored?_:this._testOne(q,K)}ignores(q){return this._test(q,this._ignoreCache,!1).ignored}createFilter(){return(q)=>!this.ignores(q)}filter(q){return Dv(q).filter(this.createFilter())}test(q){return this._test(q,this._testCache,!0)}}var V4=(q)=>new lv(q),eC=(q)=>a6(q&&a6.convert(q),q,xv);V4.isPathValid=eC;V4.default=V4;ov.exports=V4;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let q=(K)=>/^\\\\\?\\/.test(K)||/["<>|\u0000-\u001F]+/u.test(K)?K:K.replace(/\\/g,"/");a6.convert=q;let $=/^[a-z]:\//i;a6.isNotRelative=(K)=>$.test(K)||cv(K)}});var iv=R(($o,rv)=>{function UC(q){return q.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E6(q,$,K){return $=$ instanceof RegExp?$:new RegExp(UC($),"g"),q.replace($,K)}var FC={clean:function($){if(typeof $!=="string")throw Error("Expected a string, received: "+$);return $=E6($,"./","/"),$=E6($,"..","."),$=E6($," ","-"),$=E6($,/^[~^:?*\\\-]/g,""),$=E6($,/[~^:?*\\]/g,"-"),$=E6($,/[~^:?*\\\-]$/g,""),$=E6($,"@{","-"),$=E6($,/\.$/g,""),$=E6($,/\/$/g,""),$=E6($,/\.lock$/g,""),$}};rv.exports=FC});var Bv=R((Ko,tv)=>{tv.exports=function(q,$){var K=q,P=$,_=K.length,j=P.length,Y=!1,w=null,O=_+1,v=[],z=[],W=[],T="",H=-1,J=0,Z=1,X,G,f=function(){if(_>=j)X=K,G=_,K=P,P=X,_=j,j=G,Y=!0,O=_+1},N=function(k,M,A){return{x:k,y:M,k:A}},V=function(k,M){return{elem:k,t:M}},C=function(k,M,A){var u,S,p;if(M>A)u=v[k-1+O];else u=v[k+1+O];p=Math.max(M,A),S=p-k;while(S<_&&p<j&&K[S]===P[p])++S,++p;return v[k+O]=z.length,z[z.length]=new N(S,p,u),p},b=function(k){var M,A,u,S,p;M=A=1,u=S=0;for(p=k.length-1;p>=0;--p)while(u<k[p].x||S<k[p].y)if(k[p].y-k[p].x>S-u){if(Y)W[W.length]=new V(P[S],H);else W[W.length]=new V(P[S],Z);++A,++S}else if(k[p].y-k[p].x<S-u){if(Y)W[W.length]=new V(K[u],Z);else W[W.length]=new V(K[u],H);++M,++u}else W[W.length]=new V(K[u],J),T+=K[u],++M,++A,++u,++S};return f(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:function(){return w},getlcs:function(){return T},getses:function(){return W},compose:function(){var k,M,A,u,S,p,L,c;k=j-_,M=_+j+3,A={};for(L=0;L<M;++L)A[L]=-1,v[L]=-1;u=-1;do{++u;for(c=-u;c<=k-1;++c)A[c+O]=C(c,A[c-1+O]+1,A[c+1+O]);for(c=k+u;c>=k+1;--c)A[c+O]=C(c,A[c-1+O]+1,A[c+1+O]);A[k+O]=C(k,A[k-1+O]+1,A[k+1+O])}while(A[k+O]!==j);w=k+2*u,S=v[k+O],p=[];while(S!==-1)p[p.length]=new N(z[S].x,z[S].y,null),S=z[S].k;b(p)}}}});var Fv=R((Po,Uv)=>{var sC=Bv();function QC(q,$){var K=new sC(q,$);K.compose();var P=K.getses(),_,j,Y=q.length-1,w=$.length-1;for(var O=P.length-1;O>=0;--O)if(P[O].t===K.SES_COMMON){if(j)j.chain={file1index:Y,file2index:w,chain:null},j=j.chain;else _={file1index:Y,file2index:w,chain:null},j=_;Y--,w--}else if(P[O].t===K.SES_DELETE)Y--;else if(P[O].t===K.SES_ADD)w--;var v={file1index:-1,file2index:-1,chain:null};if(!j)return v;return j.chain=v,_}function ev(q,$){var K=[],P=q.length,_=$.length;for(var j=QC(q,$);j!==null;j=j.chain){var Y=P-j.file1index-1,w=_-j.file2index-1;if(P=j.file1index,_=j.file2index,Y||w)K.push({file1:[P+1,Y],file2:[_+1,w]})}return K.reverse(),K}function qN(q,$,K){var P,_=ev($,q),j=ev($,K),Y=[];function w(L,c){Y.push([L.file1[0],c,L.file1[1],L.file2[0],L.file2[1]])}for(P=0;P<_.length;P++)w(_[P],0);for(P=0;P<j.length;P++)w(j[P],2);Y.sort(function(L,c){return L[0]-c[0]});var O=[],v=0;function z(L){if(L>v)O.push([1,v,L-v]),v=L}for(var W=0;W<Y.length;W++){var T=W,H=Y[W],J=H[0],Z=J+H[2];while(W<Y.length-1){var X=Y[W+1],G=X[0];if(G>Z)break;Z=Math.max(Z,G+X[2]),W++}if(z(J),T==W){if(H[4]>0)O.push([H[1],H[3],H[4]])}else{var f={0:[q.length,-1,$.length,-1],2:[K.length,-1,$.length,-1]};for(P=T;P<=W;P++){H=Y[P];var N=H[1],V=f[N],C=H[0],b=C+H[2],k=H[3],M=k+H[4];V[0]=Math.min(k,V[0]),V[1]=Math.max(M,V[1]),V[2]=Math.min(C,V[2]),V[3]=Math.max(b,V[3])}var A=f[0][0]+(J-f[0][2]),u=f[0][1]+(Z-f[0][3]),S=f[2][0]+(J-f[2][2]),p=f[2][1]+(Z-f[2][3]);O.push([-1,A,u-A,J,Z-J,S,p-S])}v=Z}return z($.length),O}function $N(q,$,K){var P=[],_=[q,$,K],j=qN(q,$,K),Y=[];function w(){if(Y.length)P.push({ok:Y});Y=[]}function O(H){for(var J=0;J<H.length;J++)Y.push(H[J])}function v(H){if(H[2]!=H[6])return!0;var J=H[1],Z=H[5];for(var X=0;X<H[2];X++)if(q[X+J]!=K[X+Z])return!0;return!1}for(var z=0;z<j.length;z++){var W=j[z],T=W[0];if(T==-1)if(!v(W))O(_[0].slice(W[1],W[1]+W[2]));else w(),P.push({conflict:{a:q.slice(W[1],W[1]+W[2]),aIndex:W[1],o:$.slice(W[3],W[3]+W[4]),oIndex:W[3],b:K.slice(W[5],W[5]+W[6]),bIndex:W[5]}});else O(_[T].slice(W[1],W[1]+W[2]))}return w(),P}Uv.exports=$N});var CW=R((MW)=>{Object.defineProperty(MW,"__esModule",{value:!0});function H8(q){return q&&typeof q==="object"&&"default"in q?q.default:q}var DK=H8(b1()),hO=H8(nY()),KN=H8(lY()),m3=H8(mv()),M4=H8(pv()),PN=H8(av()),yK=H8(iv()),_N=H8(Fv());class e extends Error{constructor(q){super(q);this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(q){let $=new e(q.message);return $.code=q.code,$.data=q.data,$.caller=q.caller,$.stack=q.stack,$}get isIsomorphicGitError(){return!0}}class xK extends e{constructor(q){super(`Modifying the index is not possible because you have unmerged files: ${q.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=xK.code,this.data={filepaths:q}}}xK.code="UnmergedPathsError";class o extends e{constructor(q){super(`An internal error caused this command to fail.
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
|
|
82
|
+
Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${q}`);this.code=this.name=o.code,this.data={message:q}}}o.code="InternalError";class D$ extends e{constructor(q){super(`The filepath "${q}" contains unsafe character sequences`);this.code=this.name=D$.code,this.data={filepath:q}}}D$.code="UnsafeFilepathError";class f6{constructor(q){this.buffer=q,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(q){this._start=q}slice(q){let $=this.buffer.slice(this._start,this._start+q);return this._start+=q,$}toString(q,$){let K=this.buffer.toString(q,this._start,this._start+$);return this._start+=$,K}write(q,$,K){let P=this.buffer.write(q,this._start,$,K);return this._start+=$,P}copy(q,$,K){let P=q.copy(this.buffer,this._start,$,K);return this._start+=P,P}readUInt8(){let q=this.buffer.readUInt8(this._start);return this._start+=1,q}writeUInt8(q){let $=this.buffer.writeUInt8(q,this._start);return this._start+=1,$}readUInt16BE(){let q=this.buffer.readUInt16BE(this._start);return this._start+=2,q}writeUInt16BE(q){let $=this.buffer.writeUInt16BE(q,this._start);return this._start+=2,$}readUInt32BE(){let q=this.buffer.readUInt32BE(this._start);return this._start+=4,q}writeUInt32BE(q){let $=this.buffer.writeUInt32BE(q,this._start);return this._start+=4,$}}function D4(q,$){return-(q<$)||+(q>$)}function VO(q,$){return D4(q.path,$.path)}function MO(q){let $=q>0?q>>12:0;if($!==4&&$!==8&&$!==10&&$!==14)$=8;let K=q&511;if(K&73)K=493;else K=420;if($!==8)K=0;return($<<12)+K}var p6=4294967296;function sv(q,$,K,P){if(q!==void 0&&$!==void 0)return[q,$];if(K===void 0)K=P.valueOf();let _=Math.floor(K/1000),j=(K-_*1000)*1e6;return[_,j]}function b$(q){let[$,K]=sv(q.ctimeSeconds,q.ctimeNanoseconds,q.ctimeMs,q.ctime),[P,_]=sv(q.mtimeSeconds,q.mtimeNanoseconds,q.mtimeMs,q.mtime);return{ctimeSeconds:$%p6,ctimeNanoseconds:K%p6,mtimeSeconds:P%p6,mtimeNanoseconds:_%p6,dev:q.dev%p6,ino:q.ino%p6,mode:MO(q.mode%p6),uid:q.uid%p6,gid:q.gid%p6,size:q.size>-1?q.size%p6:0}}function jN(q){let $="";for(let K of new Uint8Array(q)){if(K<16)$+="0";$+=K.toString(16)}return $}var H3=null;async function y6(q){if(H3===null)H3=await wN();return H3?CO(q):YN(q)}function YN(q){return new hO().update(q).digest("hex")}async function CO(q){let $=await crypto.subtle.digest("SHA-1",q);return jN($)}async function wN(){try{return await CO(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch(q){}return!1}function vN(q){return{assumeValid:Boolean(q&32768),extended:Boolean(q&16384),stage:(q&12288)>>12,nameLength:q&4095}}function ON(q){let $=q.flags;return $.extended=!1,$.nameLength=Math.min(Buffer.from(q.path).length,4095),($.assumeValid?32768:0)+($.extended?16384:0)+(($.stage&3)<<12)+($.nameLength&4095)}class L8{constructor(q,$){this._dirty=!1,this._unmergedPaths=$||new Set,this._entries=q||new Map}_addEntry(q){if(q.flags.stage===0)q.stages=[q],this._entries.set(q.path,q),this._unmergedPaths.delete(q.path);else{let $=this._entries.get(q.path);if(!$)this._entries.set(q.path,q),$=q;$.stages[q.flags.stage]=q,this._unmergedPaths.add(q.path)}}static async from(q){if(Buffer.isBuffer(q))return L8.fromBuffer(q);else if(q===null)return new L8(null);else throw new o("invalid type passed to GitIndex.from")}static async fromBuffer(q){if(q.length===0)throw new o("Index file is empty (.git/index)");let $=new L8,K=new f6(q),P=K.toString("utf8",4);if(P!=="DIRC")throw new o(`Invalid dircache magic file number: ${P}`);let _=await y6(q.slice(0,-20)),j=q.slice(-20).toString("hex");if(j!==_)throw new o(`Invalid checksum in GitIndex buffer: expected ${j} but saw ${_}`);let Y=K.readUInt32BE();if(Y!==2)throw new o(`Unsupported dircache version: ${Y}`);let w=K.readUInt32BE(),O=0;while(!K.eof()&&O<w){let v={};v.ctimeSeconds=K.readUInt32BE(),v.ctimeNanoseconds=K.readUInt32BE(),v.mtimeSeconds=K.readUInt32BE(),v.mtimeNanoseconds=K.readUInt32BE(),v.dev=K.readUInt32BE(),v.ino=K.readUInt32BE(),v.mode=K.readUInt32BE(),v.uid=K.readUInt32BE(),v.gid=K.readUInt32BE(),v.size=K.readUInt32BE(),v.oid=K.slice(20).toString("hex");let z=K.readUInt16BE();v.flags=vN(z);let W=q.indexOf(0,K.tell()+1)-K.tell();if(W<1)throw new o(`Got a path length of: ${W}`);if(v.path=K.toString("utf8",W),v.path.includes("..\\")||v.path.includes("../"))throw new D$(v.path);let T=8-(K.tell()-12)%8;if(T===0)T=8;while(T--){let H=K.readUInt8();if(H!==0)throw new o(`Expected 1-8 null characters but got '${H}' after ${v.path}`);else if(K.eof())throw new o("Unexpected end of file")}v.stages=[],$._addEntry(v),O++}return $}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(VO)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap((q)=>{return q.stages.length>1?q.stages.filter(($)=>$):q})}*[Symbol.iterator](){for(let q of this.entries)yield q}insert({filepath:q,stats:$,oid:K,stage:P=0}){if(!$)$={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0};$=b$($);let _=Buffer.from(q),j={ctimeSeconds:$.ctimeSeconds,ctimeNanoseconds:$.ctimeNanoseconds,mtimeSeconds:$.mtimeSeconds,mtimeNanoseconds:$.mtimeNanoseconds,dev:$.dev,ino:$.ino,mode:$.mode||33188,uid:$.uid,gid:$.gid,size:$.size,path:q,oid:K,flags:{assumeValid:!1,extended:!1,stage:P,nameLength:_.length<4095?_.length:4095},stages:[]};this._addEntry(j),this._dirty=!0}delete({filepath:q}){if(this._entries.has(q))this._entries.delete(q);else for(let $ of this._entries.keys())if($.startsWith(q+"/"))this._entries.delete($);if(this._unmergedPaths.has(q))this._unmergedPaths.delete(q);this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:q}){return this._entries.has(q)}render(){return this.entries.map((q)=>`${q.mode.toString(8)} ${q.oid} ${q.path}`).join(`
|
|
83
|
+
`)}static async _entryToBuffer(q){let $=Buffer.from(q.path),K=Math.ceil((62+$.length+1)/8)*8,P=Buffer.alloc(K),_=new f6(P),j=b$(q);return _.writeUInt32BE(j.ctimeSeconds),_.writeUInt32BE(j.ctimeNanoseconds),_.writeUInt32BE(j.mtimeSeconds),_.writeUInt32BE(j.mtimeNanoseconds),_.writeUInt32BE(j.dev),_.writeUInt32BE(j.ino),_.writeUInt32BE(j.mode),_.writeUInt32BE(j.uid),_.writeUInt32BE(j.gid),_.writeUInt32BE(j.size),_.write(q.oid,20,"hex"),_.writeUInt16BE(ON(q)),_.write(q.path,$.length,"utf8"),P}async toObject(){let q=Buffer.alloc(12),$=new f6(q);$.write("DIRC",4,"utf8"),$.writeUInt32BE(2),$.writeUInt32BE(this.entriesFlat.length);let K=[];for(let Y of this.entries)if(K.push(L8._entryToBuffer(Y)),Y.stages.length>1){for(let w of Y.stages)if(w&&w!==Y)K.push(L8._entryToBuffer(w))}K=await Promise.all(K);let P=Buffer.concat(K),_=Buffer.concat([q,P]),j=await y6(_);return Buffer.concat([_,Buffer.from(j,"hex")])}}function S4(q,$,K=!0,P=!0){let _=b$(q),j=b$($);return K&&_.mode!==j.mode||_.mtimeSeconds!==j.mtimeSeconds||_.ctimeSeconds!==j.ctimeSeconds||_.uid!==j.uid||_.gid!==j.gid||P&&_.ino!==j.ino||_.size!==j.size}var J3=null,Z3=Symbol("IndexCache");function zN(){return{map:new Map,stats:new Map}}async function WN(q,$,K){let[P,_]=await Promise.all([q.lstat($),q.read($)]),j=await L8.from(_);K.map.set($,j),K.stats.set($,P)}async function TN(q,$,K){let P=K.stats.get($);if(P===void 0)return!0;if(P===null)return!1;let _=await q.lstat($);if(_===null)return!1;return S4(P,_)}class Jq{static async acquire({fs:q,gitdir:$,cache:K,allowUnmerged:P=!0},_){if(!K[Z3])K[Z3]=zN();let j=`${$}/index`;if(J3===null)J3=new DK({maxPending:1/0});let Y,w=[];return await J3.acquire(j,async()=>{let O=K[Z3];if(await TN(q,j,O))await WN(q,j,O);let v=O.map.get(j);if(w=v.unmergedPaths,w.length&&!P)throw new xK(w);if(Y=await _(v),v._dirty){let z=await v.toObject();await q.write(j,z),O.stats.set(j,await q.lstat(j)),v._dirty=!1}}),Y}}function b4(q){let $=Math.max(q.lastIndexOf("/"),q.lastIndexOf("\\"));if($>-1)q=q.slice($+1);return q}function x8(q){let $=Math.max(q.lastIndexOf("/"),q.lastIndexOf("\\"));if($===-1)return".";if($===0)return"/";return q.slice(0,$)}function NO(q){let $=new Map,K=function(_){if(!$.has(_)){let j={type:"tree",fullpath:_,basename:b4(_),metadata:{},children:[]};if($.set(_,j),j.parent=K(x8(_)),j.parent&&j.parent!==j)j.parent.children.push(j)}return $.get(_)},P=function(_,j){if(!$.has(_)){let Y={type:"blob",fullpath:_,basename:b4(_),metadata:j,parent:K(x8(_)),children:[]};if(Y.parent)Y.parent.children.push(Y);$.set(_,Y)}return $.get(_)};K(".");for(let _ of q)P(_.path,_);return $}function HN(q){switch(q){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new o(`Unexpected GitTree entry mode: ${q.toString(8)}`)}class SO{constructor({fs:q,gitdir:$,cache:K}){this.treePromise=Jq.acquire({fs:q,gitdir:$,cache:K},async function(_){return NO(_.entries)});let P=this;this.ConstructEntry=class{constructor(j){this._fullpath=j,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return P.type(this)}async mode(){return P.mode(this)}async stat(){return P.stat(this)}async content(){return P.content(this)}async oid(){return P.oid(this)}}}async readdir(q){let $=q._fullpath,P=(await this.treePromise).get($);if(!P)return null;if(P.type==="blob")return null;if(P.type!=="tree")throw Error(`ENOTDIR: not a directory, scandir '${$}'`);let _=P.children.map((j)=>j.fullpath);return _.sort(D4),_}async type(q){if(q._type===!1)await q.stat();return q._type}async mode(q){if(q._mode===!1)await q.stat();return q._mode}async stat(q){if(q._stat===!1){let K=(await this.treePromise).get(q._fullpath);if(!K)throw Error(`ENOENT: no such file or directory, lstat '${q._fullpath}'`);let P=K.type==="tree"?{}:b$(K.metadata);if(q._type=K.type==="tree"?"tree":HN(P.mode),q._mode=P.mode,K.type==="tree")q._stat=void 0;else q._stat=P}return q._stat}async content(q){}async oid(q){if(q._oid===!1){let K=(await this.treePromise).get(q._fullpath);q._oid=K.metadata.oid}return q._oid}}var y4=Symbol("GitWalkSymbol");function c8(){let q=Object.create(null);return Object.defineProperty(q,y4,{value:function({fs:$,gitdir:K,cache:P}){return new SO({fs:$,gitdir:K,cache:P})}}),Object.freeze(q),q}class s extends e{constructor(q){super(`Could not find ${q}.`);this.code=this.name=s.code,this.data={what:q}}}s.code="NotFoundError";class Lq extends e{constructor(q,$,K,P){super(`Object ${q} ${P?`at ${P}`:""}was anticipated to be a ${K} but it is a ${$}.`);this.code=this.name=Lq.code,this.data={oid:q,actual:$,expected:K,filepath:P}}}Lq.code="ObjectTypeError";class O8 extends e{constructor(q){super(`Expected a 40-char hex object id but saw "${q}".`);this.code=this.name=O8.code,this.data={value:q}}}O8.code="InvalidOidError";class nK extends e{constructor(q){super(`Could not find a fetch refspec for remote "${q}". Make sure the config file has an entry like the following:
|
|
84
|
+
[remote "${q}"]
|
|
85
|
+
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
86
|
+
`);this.code=this.name=nK.code,this.data={remote:q}}}nK.code="NoRefspecError";class u4{constructor(q){if(this.refs=new Map,this.parsedConfig=[],q){let $=null;this.parsedConfig=q.trim().split(`
|
|
87
|
+
`).map((K)=>{if(/^\s*#/.test(K))return{line:K,comment:!0};let P=K.indexOf(" ");if(K.startsWith("^")){let _=K.slice(1);return this.refs.set($+"^{}",_),{line:K,ref:$,peeled:_}}else{let _=K.slice(0,P);return $=K.slice(P+1),this.refs.set($,_),{line:K,ref:$,oid:_}}})}return this}static from(q){return new u4(q)}delete(q){this.parsedConfig=this.parsedConfig.filter(($)=>$.ref!==q),this.refs.delete(q)}toString(){return this.parsedConfig.map(({line:q})=>q).join(`
|
|
88
|
+
`)+`
|
|
89
|
+
`}}class R4{constructor({remotePath:q,localPath:$,force:K,matchPrefix:P}){Object.assign(this,{remotePath:q,localPath:$,force:K,matchPrefix:P})}static from(q){let[$,K,P,_,j]=q.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),Y=$==="+",w=P==="*";if(w!==(j==="*"))throw new o("Invalid refspec");return new R4({remotePath:K,localPath:_,force:Y,matchPrefix:w})}translate(q){if(this.matchPrefix){if(q.startsWith(this.remotePath))return this.localPath+q.replace(this.remotePath,"")}else if(q===this.remotePath)return this.localPath;return null}reverseTranslate(q){if(this.matchPrefix){if(q.startsWith(this.localPath))return this.remotePath+q.replace(this.localPath,"")}else if(q===this.localPath)return this.remotePath;return null}}class I3{constructor(q=[]){this.rules=q}static from(q){let $=[];for(let K of q)$.push(R4.from(K));return new I3($)}add(q){let $=R4.from(q);this.rules.push($)}translate(q){let $=[];for(let K of this.rules)for(let P of q){let _=K.translate(P);if(_)$.push([P,_])}return $}translateOne(q){let $=null;for(let K of this.rules){let P=K.translate(q);if(P)$=P}return $}localNamespaces(){return this.rules.filter((q)=>q.matchPrefix).map((q)=>q.localPath.replace(/\/$/,""))}}function JN(q,$){let K=q.replace(/\^\{\}$/,""),P=$.replace(/\^\{\}$/,""),_=-(K<P)||+(K>P);if(_===0)return q.endsWith("^{}")?1:-1;return _}/*!
|
|
90
|
+
* This code for `path.join` is directly copied from @zenfs/core/path for bundle size improvements.
|
|
91
|
+
* SPDX-License-Identifier: LGPL-3.0-or-later
|
|
92
|
+
* Copyright (c) James Prevett and other ZenFS contributors.
|
|
93
|
+
*/function ZN(q,$){let K="",P=0,_=-1,j=0,Y="\x00";for(let w=0;w<=q.length;++w){if(w<q.length)Y=q[w];else if(Y==="/")break;else Y="/";if(Y==="/"){if(_===w-1||j===1);else if(j===2){if(K.length<2||P!==2||K.at(-1)!=="."||K.at(-2)!=="."){if(K.length>2){let O=K.lastIndexOf("/");if(O===-1)K="",P=0;else K=K.slice(0,O),P=K.length-1-K.lastIndexOf("/");_=w,j=0;continue}else if(K.length!==0){K="",P=0,_=w,j=0;continue}}if($)K+=K.length>0?"/..":"..",P=2}else{if(K.length>0)K+="/"+q.slice(_+1,w);else K=q.slice(_+1,w);P=w-_-1}_=w,j=0}else if(Y==="."&&j!==-1)++j;else j=-1}return K}function kN(q){if(!q.length)return".";let $=q[0]==="/",K=q.at(-1)==="/";if(q=ZN(q,!$),!q.length){if($)return"/";return K?"./":"."}if(K)q+="/";return $?`/${q}`:q}function m(...q){if(q.length===0)return".";let $;for(let K=0;K<q.length;++K){let P=q[K];if(P.length>0)if($===void 0)$=P;else $+="/"+P}if($===void 0)return".";return kN($)}var XN=(q)=>{if(typeof q==="number")return q;q=q.toLowerCase();let $=parseInt(q);if(q.endsWith("k"))$*=1024;if(q.endsWith("m"))$*=1048576;if(q.endsWith("g"))$*=1073741824;return $},EK=(q)=>{if(typeof q==="boolean")return q;if(q=q.trim().toLowerCase(),q==="true"||q==="yes"||q==="on")return!0;if(q==="false"||q==="no"||q==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${q}`)},Qv={core:{filemode:EK,bare:EK,logallrefupdates:EK,symlinks:EK,ignorecase:EK,bigFileThreshold:XN}},fN=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,AN=/^[A-Za-z0-9-.]+$/,GN=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,hN=/^[A-Za-z][A-Za-z-]*$/,VN=/^(.*?)( *[#;].*)$/,MN=(q)=>{let $=fN.exec(q);if($!=null){let[K,P]=$.slice(1);return[K,P]}return null},CN=(q)=>{let $=GN.exec(q);if($!=null){let[K,P="true"]=$.slice(1),_=NN(P),j=SN(_);return[K,j]}return null},NN=(q)=>{let $=VN.exec(q);if($==null)return q;let[K,P]=$.slice(1);if(qO(K)&&qO(P))return`${K}${P}`;return K},qO=(q)=>{return(q.match(/(?:^|[^\\])"/g)||[]).length%2!==0},SN=(q)=>{return q.split("").reduce(($,K,P,_)=>{let j=K==='"'&&_[P-1]!=="\\",Y=K==="\\"&&_[P+1]==='"';if(j||Y)return $;return $+K},"")},$O=(q)=>{return q!=null?q.toLowerCase():null},N3=(q,$,K)=>{return[$O(q),$,$O(K)].filter((P)=>P!=null).join(".")},KO=(q)=>{let $=q.split("."),K=$.shift(),P=$.pop(),_=$.length?$.join("."):void 0;return{section:K,subsection:_,name:P,path:N3(K,_,P),sectionPath:N3(K,_,null),isSection:!!K}},bN=(q,$)=>{return q.reduce((K,P,_)=>{return $(P)?_:K},-1)};class E3{constructor(q){let $=null,K=null;this.parsedConfig=q?q.split(`
|
|
94
|
+
`).map((P)=>{let _=null,j=null,Y=P.trim(),w=MN(Y),O=w!=null;if(O)[$,K]=w;else{let z=CN(Y);if(z!=null)[_,j]=z}let v=N3($,K,_);return{line:P,isSection:O,section:$,subsection:K,name:_,value:j,path:v}}):[]}static from(q){return new E3(q)}async get(q,$=!1){let K=KO(q).path,P=this.parsedConfig.filter((_)=>_.path===K).map(({section:_,name:j,value:Y})=>{let w=Qv[_]&&Qv[_][j];return w?w(Y):Y});return $?P:P.pop()}async getall(q){return this.get(q,!0)}async getSubsections(q){return this.parsedConfig.filter(($)=>$.isSection&&$.section===q).map(($)=>$.subsection)}async deleteSection(q,$){this.parsedConfig=this.parsedConfig.filter((K)=>!(K.section===q&&K.subsection===$))}async append(q,$){return this.set(q,$,!0)}async set(q,$,K=!1){let{section:P,subsection:_,name:j,path:Y,sectionPath:w,isSection:O}=KO(q),v=bN(this.parsedConfig,(z)=>z.path===Y);if($==null){if(v!==-1)this.parsedConfig.splice(v,1)}else if(v!==-1){let z=this.parsedConfig[v],W=Object.assign({},z,{name:j,value:$,modified:!0});if(K)this.parsedConfig.splice(v+1,0,W);else this.parsedConfig[v]=W}else{let z=this.parsedConfig.findIndex((T)=>T.path===w),W={section:P,subsection:_,name:j,value:$,modified:!0,path:Y};if(AN.test(P)&&hN.test(j))if(z>=0)this.parsedConfig.splice(z+1,0,W);else{let T={isSection:O,section:P,subsection:_,modified:!0,path:w};this.parsedConfig.push(T,W)}}}toString(){return this.parsedConfig.map(({line:q,section:$,subsection:K,name:P,value:_,modified:j=!1})=>{if(!j)return q;if(P!=null&&_!=null){if(typeof _==="string"&&/[#;]/.test(_))return` ${P} = "${_}"`;return` ${P} = ${_}`}if(K!=null)return`[${$} "${K}"]`;return`[${$}]`}).join(`
|
|
95
|
+
`)}}class Zq{static async get({fs:q,gitdir:$}){let K=await q.read(`${$}/config`,{encoding:"utf8"});return E3.from(K)}static async save({fs:q,gitdir:$,config:K}){await q.write(`${$}/config`,K.toString(),{encoding:"utf8"})}}var C4=(q)=>[`${q}`,`refs/${q}`,`refs/tags/${q}`,`refs/heads/${q}`,`refs/remotes/${q}`,`refs/remotes/${q}/HEAD`],uN=["config","description","index","shallow","commondir"],k3;async function w8(q,$){if(k3===void 0)k3=new DK;return k3.acquire(q,$)}class E{static async updateRemoteRefs({fs:q,gitdir:$,remote:K,refs:P,symrefs:_,tags:j,refspecs:Y=void 0,prune:w=!1,pruneTags:O=!1}){for(let Z of P.values())if(!Z.match(/[0-9a-f]{40}/))throw new O8(Z);let v=await Zq.get({fs:q,gitdir:$});if(!Y){if(Y=await v.getall(`remote.${K}.fetch`),Y.length===0)throw new nK(K);Y.unshift(`+HEAD:refs/remotes/${K}/HEAD`)}let z=I3.from(Y),W=new Map;if(O){let Z=await E.listRefs({fs:q,gitdir:$,filepath:"refs/tags"});await E.deleteRefs({fs:q,gitdir:$,refs:Z.map((X)=>`refs/tags/${X}`)})}if(j){for(let Z of P.keys())if(Z.startsWith("refs/tags")&&!Z.endsWith("^{}")){if(!await E.exists({fs:q,gitdir:$,ref:Z})){let X=P.get(Z);W.set(Z,X)}}}let T=z.translate([...P.keys()]);for(let[Z,X]of T){let G=P.get(Z);W.set(X,G)}let H=z.translate([..._.keys()]);for(let[Z,X]of H){let G=_.get(Z),f=z.translateOne(G);if(f)W.set(X,`ref: ${f}`)}let J=[];if(w){for(let Z of z.localNamespaces()){let X=(await E.listRefs({fs:q,gitdir:$,filepath:Z})).map((G)=>`${Z}/${G}`);for(let G of X)if(!W.has(G))J.push(G)}if(J.length>0)await E.deleteRefs({fs:q,gitdir:$,refs:J})}for(let[Z,X]of W)await w8(Z,async()=>q.write(m($,Z),`${X.trim()}
|
|
96
|
+
`,"utf8"));return{pruned:J}}static async writeRef({fs:q,gitdir:$,ref:K,value:P}){if(!P.match(/[0-9a-f]{40}/))throw new O8(P);await w8(K,async()=>q.write(m($,K),`${P.trim()}
|
|
97
|
+
`,"utf8"))}static async writeSymbolicRef({fs:q,gitdir:$,ref:K,value:P}){await w8(K,async()=>q.write(m($,K),`ref: ${P.trim()}
|
|
98
|
+
`,"utf8"))}static async deleteRef({fs:q,gitdir:$,ref:K}){return E.deleteRefs({fs:q,gitdir:$,refs:[K]})}static async deleteRefs({fs:q,gitdir:$,refs:K}){await Promise.all(K.map((Y)=>q.rm(m($,Y))));let P=await w8("packed-refs",async()=>q.read(`${$}/packed-refs`,{encoding:"utf8"})),_=u4.from(P),j=_.refs.size;for(let Y of K)if(_.refs.has(Y))_.delete(Y);if(_.refs.size<j)P=_.toString(),await w8("packed-refs",async()=>q.write(`${$}/packed-refs`,P,{encoding:"utf8"}))}static async resolve({fs:q,gitdir:$,ref:K,depth:P=void 0}){if(P!==void 0){if(P--,P===-1)return K}if(K.startsWith("ref: "))return K=K.slice(5),E.resolve({fs:q,gitdir:$,ref:K,depth:P});if(K.length===40&&/[0-9a-f]{40}/.test(K))return K;let _=await E.packedRefs({fs:q,gitdir:$}),j=C4(K).filter((Y)=>!uN.includes(Y));for(let Y of j){let w=await w8(Y,async()=>await q.read(`${$}/${Y}`,{encoding:"utf8"})||_.get(Y));if(w)return E.resolve({fs:q,gitdir:$,ref:w.trim(),depth:P})}throw new s(K)}static async exists({fs:q,gitdir:$,ref:K}){try{return await E.expand({fs:q,gitdir:$,ref:K}),!0}catch(P){return!1}}static async expand({fs:q,gitdir:$,ref:K}){if(K.length===40&&/[0-9a-f]{40}/.test(K))return K;let P=await E.packedRefs({fs:q,gitdir:$}),_=C4(K);for(let j of _){if(await w8(j,async()=>q.exists(`${$}/${j}`)))return j;if(P.has(j))return j}throw new s(K)}static async expandAgainstMap({ref:q,map:$}){let K=C4(q);for(let P of K)if(await $.has(P))return P;throw new s(q)}static resolveAgainstMap({ref:q,fullref:$=q,depth:K=void 0,map:P}){if(K!==void 0){if(K--,K===-1)return{fullref:$,oid:q}}if(q.startsWith("ref: "))return q=q.slice(5),E.resolveAgainstMap({ref:q,fullref:$,depth:K,map:P});if(q.length===40&&/[0-9a-f]{40}/.test(q))return{fullref:$,oid:q};let _=C4(q);for(let j of _){let Y=P.get(j);if(Y)return E.resolveAgainstMap({ref:Y.trim(),fullref:j,depth:K,map:P})}throw new s(q)}static async packedRefs({fs:q,gitdir:$}){let K=await w8("packed-refs",async()=>q.read(`${$}/packed-refs`,{encoding:"utf8"}));return u4.from(K).refs}static async listRefs({fs:q,gitdir:$,filepath:K}){let P=E.packedRefs({fs:q,gitdir:$}),_=null;try{_=await q.readdirDeep(`${$}/${K}`),_=_.map((j)=>j.replace(`${$}/${K}/`,""))}catch(j){_=[]}for(let j of(await P).keys())if(j.startsWith(K)){if(j=j.replace(K+"/",""),!_.includes(j))_.push(j)}return _.sort(JN),_}static async listBranches({fs:q,gitdir:$,remote:K}){if(K)return E.listRefs({fs:q,gitdir:$,filepath:`refs/remotes/${K}`});else return E.listRefs({fs:q,gitdir:$,filepath:"refs/heads"})}static async listTags({fs:q,gitdir:$}){return(await E.listRefs({fs:q,gitdir:$,filepath:"refs/tags"})).filter((P)=>!P.endsWith("^{}"))}}function RN(q,$){return D4(PO(q),PO($))}function PO(q){return q.mode==="040000"?q.path+"/":q.path}function bO(q){switch(q){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new o(`Unexpected GitTree entry mode: ${q}`)}function mN(q){let $=[],K=0;while(K<q.length){let P=q.indexOf(32,K);if(P===-1)throw new o(`GitTree: Error parsing buffer at byte location ${K}: Could not find the next space character.`);let _=q.indexOf(0,K);if(_===-1)throw new o(`GitTree: Error parsing buffer at byte location ${K}: Could not find the next null character.`);let j=q.slice(K,P).toString("utf8");if(j==="40000")j="040000";let Y=bO(j),w=q.slice(P+1,_).toString("utf8");if(w.includes("\\")||w.includes("/"))throw new D$(w);let O=q.slice(_+1,_+21).toString("hex");K=_+21,$.push({mode:j,path:w,oid:O,type:Y})}return $}function IN(q){if(typeof q==="number")q=q.toString(8);if(q.match(/^0?4.*/))return"040000";if(q.match(/^1006.*/))return"100644";if(q.match(/^1007.*/))return"100755";if(q.match(/^120.*/))return"120000";if(q.match(/^160.*/))return"160000";throw new o(`Could not understand file mode: ${q}`)}function EN(q){if(!q.oid&&q.sha)q.oid=q.sha;if(q.mode=IN(q.mode),!q.type)q.type=bO(q.mode);return q}class aq{constructor(q){if(Buffer.isBuffer(q))this._entries=mN(q);else if(Array.isArray(q))this._entries=q.map(EN);else throw new o("invalid type passed to GitTree constructor");this._entries.sort(VO)}static from(q){return new aq(q)}render(){return this._entries.map((q)=>`${q.mode} ${q.type} ${q.oid} ${q.path}`).join(`
|
|
99
|
+
`)}toObject(){let q=[...this._entries];return q.sort(RN),Buffer.concat(q.map(($)=>{let K=Buffer.from($.mode.replace(/^0/,"")),P=Buffer.from(" "),_=Buffer.from($.path,"utf8"),j=Buffer.from([0]),Y=Buffer.from($.oid,"hex");return Buffer.concat([K,P,_,j,Y])}))}entries(){return this._entries}*[Symbol.iterator](){for(let q of this._entries)yield q}}class l8{static wrap({type:q,object:$}){let K=`${q} ${$.length}\x00`,P=K.length,_=P+$.length,j=new Uint8Array(_);for(let Y=0;Y<P;Y++)j[Y]=K.charCodeAt(Y);return j.set($,P),j}static unwrap(q){let $=q.indexOf(32),K=q.indexOf(0),P=q.slice(0,$).toString("utf8"),_=q.slice($+1,K).toString("utf8"),j=q.length-(K+1);if(parseInt(_)!==j)throw new o(`Length mismatch: expected ${_} bytes but got ${j} instead.`);return{type:P,object:Buffer.from(q.slice(K+1))}}}async function uO({fs:q,gitdir:$,oid:K}){let P=`objects/${K.slice(0,2)}/${K.slice(2)}`,_=await q.read(`${$}/${P}`);if(!_)return null;return{object:_,format:"deflated",source:P}}function pN(q,$){let K=new f6(q),P=_O(K);if(P!==$.byteLength)throw new o(`applyDelta expected source buffer to be ${P} bytes but the provided buffer was ${$.length} bytes`);let _=_O(K),j,Y=YO(K,$);if(Y.byteLength===_)j=Y;else{j=Buffer.alloc(_);let w=new f6(j);w.copy(Y);while(!K.eof())w.copy(YO(K,$));let O=w.tell();if(_!==O)throw new o(`applyDelta expected target buffer to be ${_} bytes but the resulting buffer was ${O} bytes`)}return j}function _O(q){let $=0,K=0,P=null;do P=q.readUInt8(),$|=(P&127)<<K,K+=7;while(P&128);return $}function jO(q,$,K){let P=0,_=0;while(K--){if($&1)P|=q.readUInt8()<<_;$>>=1,_+=8}return P}function YO(q,$){let K=q.readUInt8(),P=128,_=15,j=112;if(K&128){let Y=jO(q,K&15,4),w=jO(q,(K&112)>>4,3);if(w===0)w=65536;return $.slice(Y,Y+w)}else return q.slice(K)}function DN(q){let $=[q];return{next(){return Promise.resolve({done:$.length===0,value:$.pop()})},return(){return $=[],{}},[Symbol.asyncIterator](){return this}}}function RO(q){if(q[Symbol.asyncIterator])return q[Symbol.asyncIterator]();if(q[Symbol.iterator])return q[Symbol.iterator]();if(q.next)return q;return DN(q)}class p3{constructor(q){if(typeof Buffer>"u")throw Error("Missing Buffer dependency");this.stream=RO(q),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())return;if(!this.started)await this._init();if(this.cursor===this.buffer.length){if(await this._loadnext(),this._ended)return}return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(this.eof())return;if(!this.started)await this._init();if(this.cursor===this.buffer.length){if(await this._loadnext(),this._ended)return}return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(q){if(this.eof())return;if(!this.started)await this._init();if(this.cursor+q>this.buffer.length)this._trim(),await this._accumulate(q);return this._moveCursor(q),this.buffer.slice(this.undoCursor,this.cursor)}async skip(q){if(this.eof())return;if(!this.started)await this._init();if(this.cursor+q>this.buffer.length)this._trim(),await this._accumulate(q);this._moveCursor(q)}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:q,value:$}=await this.stream.next();if(q){if(this._ended=!0,!$)return Buffer.alloc(0)}if($)$=Buffer.from($);return $}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(q){if(this.undoCursor=this.cursor,this.cursor+=q,this.cursor>this.buffer.length)this.cursor=this.buffer.length}async _accumulate(q){if(this._ended)return;let $=[this.buffer];while(this.cursor+q>yN($)){let K=await this._next();if(this._ended)break;$.push(K)}this.buffer=Buffer.concat($)}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 yN(q){return q.reduce(($,K)=>$+K.length,0)}async function dN(q,$){let K=new p3(q),P=await K.read(4);if(P=P.toString("utf8"),P!=="PACK")throw new o(`Invalid PACK header '${P}'`);let _=await K.read(4);if(_=_.readUInt32BE(0),_!==2)throw new o(`Invalid packfile version: ${_}`);let j=await K.read(4);if(j=j.readUInt32BE(0),j<1)return;while(!K.eof()&&j--){let Y=K.tell(),{type:w,length:O,ofs:v,reference:z}=await LN(K),W=new m3.Inflate;while(!W.result){let T=await K.chunk();if(!T)break;if(W.push(T,!1),W.err)throw new o(`Pako error: ${W.msg}`);if(W.result){if(W.result.length!==O)throw new o("Inflated object size is different from that stated in packfile.");await K.undo(),await K.read(T.length-W.strm.avail_in);let H=K.tell();await $({data:W.result,type:w,num:j,offset:Y,end:H,reference:z,ofs:v})}}}}async function LN(q){let $=await q.byte(),K=$>>4&7,P=$&15;if($&128){let Y=4;do $=await q.byte(),P|=($&127)<<Y,Y+=7;while($&128)}let _,j;if(K===6){let Y=0;_=0;let w=[];do $=await q.byte(),_|=($&127)<<Y,Y+=7,w.push($);while($&128);j=Buffer.from(w)}if(K===7)j=await q.read(20);return{type:K,length:P,ofs:_,reference:j}}var X3=!1;async function mO(q){if(X3===null)X3=xN();return X3?gN(q):m3.inflate(q)}async function gN(q){let $=new DecompressionStream("deflate"),K=new Blob([q]).stream().pipeThrough($);return new Uint8Array(await new Response(K).arrayBuffer())}function xN(){try{if(new DecompressionStream("deflate"))return!0}catch(q){}return!1}function nN(q){let $=[],K=0,P=0;do{K=q.readUInt8();let _=K&127;$.push(_),P=K&128}while(P);return $.reduce((_,j)=>_+1<<7|j,-1)}function cN(q,$){let K=$,P=4,_=null;do _=q.readUInt8(),K|=(_&127)<<P,P+=7;while(_&128);return K}class u${constructor(q){Object.assign(this,q),this.offsetCache={}}static async fromIdx({idx:q,getExternalRefDelta:$}){let K=new f6(q);if(K.slice(4).toString("hex")!=="ff744f63")return;let _=K.readUInt32BE();if(_!==2)throw new o(`Unable to read version ${_} packfile IDX. (Only version 2 supported)`);if(q.byteLength>2147483648)throw new o("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");K.seek(K.tell()+1020);let j=K.readUInt32BE(),Y=[];for(let v=0;v<j;v++){let z=K.slice(20).toString("hex");Y[v]=z}K.seek(K.tell()+4*j);let w=new Map;for(let v=0;v<j;v++)w.set(Y[v],K.readUInt32BE());let O=K.slice(20).toString("hex");return new u$({hashes:Y,crcs:{},offsets:w,packfileSha:O,getExternalRefDelta:$})}static async fromPack({pack:q,getExternalRefDelta:$,onProgress:K}){let P={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},_={},j=q.slice(-20).toString("hex"),Y=[],w={},O=new Map,v=null,z=null;await dN([q],async({data:Z,type:X,reference:G,offset:f,num:N})=>{if(v===null)v=N;let V=Math.floor((v-N)*100/v);if(V!==z){if(K)await K({phase:"Receiving objects",loaded:v-N,total:v})}if(z=V,X=P[X],["commit","tree","blob","tag"].includes(X))_[f]={type:X,offset:f};else if(X==="ofs-delta")_[f]={type:X,offset:f};else if(X==="ref-delta")_[f]={type:X,offset:f}});let W=Object.keys(_).map(Number);for(let[Z,X]of W.entries()){let G=Z+1===W.length?q.byteLength-20:W[Z+1],f=_[X],N=KN.buf(q.slice(X,G))>>>0;f.end=G,f.crc=N}let T=new u$({pack:Promise.resolve(q),packfileSha:j,crcs:w,hashes:Y,offsets:O,getExternalRefDelta:$});z=null;let H=0,J=[0,0,0,0,0,0,0,0,0,0,0,0];for(let Z in _){Z=Number(Z);let X=Math.floor(H*100/v);if(X!==z){if(K)await K({phase:"Resolving deltas",loaded:H,total:v})}H++,z=X;let G=_[Z];if(G.oid)continue;try{T.readDepth=0,T.externalReadDepth=0;let{type:f,object:N}=await T.readSlice({start:Z});J[T.readDepth]+=1;let V=await y6(l8.wrap({type:f,object:N}));G.oid=V,Y.push(V),O.set(V,Z),w[V]=G.crc}catch(f){continue}}return Y.sort(),T}async toBuffer(){let q=[],$=(O,v)=>{q.push(Buffer.from(O,v))};$("ff744f63","hex"),$("00000002","hex");let K=new f6(Buffer.alloc(1024));for(let O=0;O<256;O++){let v=0;for(let z of this.hashes)if(parseInt(z.slice(0,2),16)<=O)v++;K.writeUInt32BE(v)}q.push(K.buffer);for(let O of this.hashes)$(O,"hex");let P=new f6(Buffer.alloc(this.hashes.length*4));for(let O of this.hashes)P.writeUInt32BE(this.crcs[O]);q.push(P.buffer);let _=new f6(Buffer.alloc(this.hashes.length*4));for(let O of this.hashes)_.writeUInt32BE(this.offsets.get(O));q.push(_.buffer),$(this.packfileSha,"hex");let j=Buffer.concat(q),Y=await y6(j),w=Buffer.alloc(20);return w.write(Y,"hex"),Buffer.concat([j,w])}async load({pack:q}){this.pack=q}async unload(){this.pack=null}async read({oid:q}){if(!this.offsets.get(q))if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(q);else throw new o(`Could not read object ${q} from packfile`);let $=this.offsets.get(q);return this.readSlice({start:$})}async readSlice({start:q}){if(this.offsetCache[q])return Object.assign({},this.offsetCache[q]);this.readDepth++;let $={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"},K=await this.pack;if(!K)throw new o("Could not read packfile data. The packfile may be missing, corrupted, or too large to read into memory.");let P=K.slice(q),_=new f6(P),j=_.readUInt8(),Y=j&112,w=$[Y];if(w===void 0)throw new o("Unrecognized type: 0b"+Y.toString(2));let O=j&15,v=O;if(j&128)v=cN(_,O);let W=null,T=null;if(w==="ofs_delta"){let J=nN(_),Z=q-J;({object:W,type:w}=await this.readSlice({start:Z}))}if(w==="ref_delta"){let J=_.slice(20).toString("hex");({object:W,type:w}=await this.read({oid:J}))}let H=P.slice(_.tell());if(T=Buffer.from(await mO(H)),T.byteLength!==v)throw new o(`Packfile told us object would have length ${v} but it had length ${T.byteLength}`);if(W)T=Buffer.from(pN(T,W));if(this.readDepth>3)this.offsetCache[q]={type:w,object:T};return{type:w,format:"content",object:T}}}var N4=Symbol("PackfileCache");async function lN({fs:q,filename:$,getExternalRefDelta:K,emitter:P,emitterPrefix:_}){let j=await q.read($);return u$.fromIdx({idx:j,getExternalRefDelta:K})}function D3({fs:q,cache:$,filename:K,getExternalRefDelta:P,emitter:_,emitterPrefix:j}){if(!$[N4])$[N4]=new Map;let Y=$[N4].get(K);if(!Y)Y=lN({fs:q,filename:K,getExternalRefDelta:P,emitter:_,emitterPrefix:j}),$[N4].set(K,Y);return Y}async function oN({fs:q,cache:$,gitdir:K,oid:P,format:_="content",getExternalRefDelta:j}){let Y=await q.readdir(m(K,"objects/pack"));Y=Y.filter((w)=>w.endsWith(".idx"));for(let w of Y){let O=`${K}/objects/pack/${w}`,v=await D3({fs:q,cache:$,filename:O,getExternalRefDelta:j});if(v.error)throw new o(v.error);if(v.offsets.has(P)){let z=O.replace(/idx$/,"pack");if(!v.pack)v.pack=q.read(z);let W=await v.pack;if(!W)throw v.pack=null,new o(`Could not read packfile at ${z}. The file may be missing, corrupted, or too large to read into memory.`);if(!v._checksumVerified){let H=v.packfileSha,J=W.subarray(-20),Z=Array.from(J).map((f)=>f.toString(16).padStart(2,"0")).join("");if(Z!==H)throw new o(`Packfile trailer mismatch: expected ${H}, got ${Z}. The packfile may be corrupted.`);let X=W.subarray(0,-20),G=await y6(X);if(G!==H)throw new o(`Packfile payload corrupted: calculated ${G} but expected ${H}. The packfile may have been tampered with.`);v._checksumVerified=!0}let T=await v.read({oid:P,getExternalRefDelta:j});return T.format="content",T.source=`objects/pack/${w.replace(/idx$/,"pack")}`,T}}return null}async function Kq({fs:q,cache:$,gitdir:K,oid:P,format:_="content"}){let j=(z)=>Kq({fs:q,cache:$,gitdir:K,oid:z}),Y;if(P==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")Y={format:"wrapped",object:Buffer.from("tree 0\x00")};if(!Y)Y=await uO({fs:q,gitdir:K,oid:P});if(!Y){if(Y=await oN({fs:q,cache:$,gitdir:K,oid:P,getExternalRefDelta:j}),!Y)throw new s(P);return Y}if(_==="deflated")return Y;if(Y.format==="deflated")Y.object=Buffer.from(await mO(Y.object)),Y.format="wrapped";if(_==="wrapped")return Y;let w=await y6(Y.object);if(w!==P)throw new o(`SHA check failed! Expected ${P}, computed ${w}`);let{object:O,type:v}=l8.unwrap(Y.object);if(Y.type=v,Y.object=O,Y.format="content",_==="content")return Y;throw new o(`invalid requested format "${_}"`)}class G6 extends e{constructor(q,$,K=!0){super(`Failed to create ${q} at ${$} because it already exists.${K?` (Hint: use 'force: true' parameter to overwrite existing ${q}.)`:""}`);this.code=this.name=G6.code,this.data={noun:q,where:$,canForce:K}}}G6.code="AlreadyExistsError";class cK extends e{constructor(q,$,K){super(`Found multiple ${q} matching "${$}" (${K.join(", ")}). Use a longer abbreviation length to disambiguate them.`);this.code=this.name=cK.code,this.data={nouns:q,short:$,matches:K}}}cK.code="AmbiguousError";class lK extends e{constructor(q){super(`Your local changes to the following files would be overwritten by checkout: ${q.join(", ")}`);this.code=this.name=lK.code,this.data={filepaths:q}}}lK.code="CheckoutConflictError";class oK extends e{constructor(q,$){super(`Cannot cherry-pick merge commit ${q}. Merge commits have ${$} parents and require specifying which parent to use as the base.`);this.code=this.name=oK.code,this.data={oid:q,parentCount:$}}}oK.code="CherryPickMergeCommitError";class aK extends e{constructor(q){super(`Cannot cherry-pick root commit ${q}. Root commits have no parents.`);this.code=this.name=aK.code,this.data={oid:q}}}aK.code="CherryPickRootCommitError";class rK extends e{constructor(q,$){super(`Failed to checkout "${q}" because commit ${$} is not available locally. Do a git fetch to make the branch available locally.`);this.code=this.name=rK.code,this.data={ref:q,oid:$}}}rK.code="CommitNotFetchedError";class iK extends e{constructor(){super("Empty response from git server.");this.code=this.name=iK.code,this.data={}}}iK.code="EmptyServerResponseError";class tK extends e{constructor(){super("A simple fast-forward merge was not possible.");this.code=this.name=tK.code,this.data={}}}tK.code="FastForwardError";class BK extends e{constructor(q,$){super(`One or more branches were not updated: ${q}`);this.code=this.name=BK.code,this.data={prettyDetails:q,result:$}}}BK.code="GitPushError";class R$ extends e{constructor(q,$,K){super(`HTTP Error: ${q} ${$}`);this.code=this.name=R$.code,this.data={statusCode:q,statusMessage:$,response:K}}}R$.code="HttpError";class z8 extends e{constructor(q){let $="invalid filepath";if(q==="leading-slash"||q==="trailing-slash")$='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.';else if(q==="directory")$='"filepath" should not be a directory.';super($);this.code=this.name=z8.code,this.data={reason:q}}}z8.code="InvalidFilepathError";class A6 extends e{constructor(q,$){super(`"${q}" would be an invalid git reference. (Hint: a valid alternative would be "${$}".)`);this.code=this.name=A6.code,this.data={ref:q,suggestion:$}}}A6.code="InvalidRefNameError";class eK extends e{constructor(q){super(`Maximum search depth of ${q} exceeded.`);this.code=this.name=eK.code,this.data={depth:q}}}eK.code="MaxDepthError";class y$ extends e{constructor(){super("Merges with conflicts are not supported yet.");this.code=this.name=y$.code,this.data={}}}y$.code="MergeNotSupportedError";class o8 extends e{constructor(q,$,K,P){super(`Automatic merge failed with one or more merge conflicts in the following files: ${q.toString()}. Fix conflicts then commit the result.`);this.code=this.name=o8.code,this.data={filepaths:q,bothModified:$,deleteByUs:K,deleteByTheirs:P}}}o8.code="MergeConflictError";class bq extends e{constructor(q){super(`No name was provided for ${q} in the argument or in the .git/config file.`);this.code=this.name=bq.code,this.data={role:q}}}bq.code="MissingNameError";class oq extends e{constructor(q){super(`The function requires a "${q}" parameter but none was provided.`);this.code=this.name=oq.code,this.data={parameter:q}}}oq.code="MissingParameterError";class UK extends e{constructor(q){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more');this.code=this.name=UK.code,this.data={errors:q},this.errors=q}}UK.code="MultipleGitError";class a8 extends e{constructor(q,$){super(`Expected "${q}" but received "${$}".`);this.code=this.name=a8.code,this.data={expected:q,actual:$}}}a8.code="ParseError";class m$ extends e{constructor(q){let $="";if(q==="not-fast-forward")$=" because it was not a simple fast-forward";else if(q==="tag-exists")$=" because tag already exists";super(`Push rejected${$}. Use "force: true" to override.`);this.code=this.name=m$.code,this.data={reason:q}}}m$.code="PushRejectedError";class v8 extends e{constructor(q,$){super(`Remote does not support the "${q}" so the "${$}" parameter cannot be used.`);this.code=this.name=v8.code,this.data={capability:q,parameter:$}}}v8.code="RemoteCapabilityError";class FK extends e{constructor(q,$){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${q}`);this.code=this.name=FK.code,this.data={preview:q,response:$}}}FK.code="SmartHttpError";class sK extends e{constructor(q,$,K){super(`Git remote "${q}" uses an unrecognized transport protocol: "${$}"`);this.code=this.name=sK.code,this.data={url:q,transport:$,suggestion:K}}}sK.code="UnknownTransportError";class QK extends e{constructor(q){super(`Cannot parse remote URL: "${q}"`);this.code=this.name=QK.code,this.data={url:q}}}QK.code="UrlParseError";class d$ extends e{constructor(){super("The operation was canceled.");this.code=this.name=d$.code,this.data={}}}d$.code="UserCanceledError";class qP extends e{constructor(q){super(`Could not merge index: Entry for '${q}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`);this.code=this.name=qP.code,this.data={filepath:q}}}qP.code="IndexResetError";class $P extends e{constructor(q){super(`"${q}" does not point to any commit. You're maybe working on a repository with no commits yet. `);this.code=this.name=$P.code,this.data={ref:q}}}$P.code="NoCommitError";var IO=Object.freeze({__proto__:null,AlreadyExistsError:G6,AmbiguousError:cK,CheckoutConflictError:lK,CherryPickMergeCommitError:oK,CherryPickRootCommitError:aK,CommitNotFetchedError:rK,EmptyServerResponseError:iK,FastForwardError:tK,GitPushError:BK,HttpError:R$,InternalError:o,InvalidFilepathError:z8,InvalidOidError:O8,InvalidRefNameError:A6,MaxDepthError:eK,MergeNotSupportedError:y$,MergeConflictError:o8,MissingNameError:bq,MissingParameterError:oq,MultipleGitError:UK,NoRefspecError:nK,NotFoundError:s,ObjectTypeError:Lq,ParseError:a8,PushRejectedError:m$,RemoteCapabilityError:v8,SmartHttpError:FK,UnknownTransportError:sK,UnsafeFilepathError:D$,UrlParseError:QK,UserCanceledError:d$,UnmergedPathsError:xK,IndexResetError:qP,NoCommitError:$P});function S3({name:q,email:$,timestamp:K,timezoneOffset:P}){return P=aN(P),`${q} <${$}> ${K} ${P}`}function aN(q){let $=rN(iN(q));q=Math.abs(q);let K=Math.floor(q/60);q-=K*60;let P=String(K),_=String(q);if(P.length<2)P="0"+P;if(_.length<2)_="0"+_;return($===-1?"-":"+")+P+_}function rN(q){return Math.sign(q)||(Object.is(q,-0)?-1:1)}function iN(q){return q===0?q:-q}function r6(q){return q=q.replace(/\r/g,""),q=q.replace(/^\n+/,""),q=q.replace(/\n+$/,"")+`
|
|
100
|
+
`,q}function m4(q){let[,$,K,P,_]=q.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:$,email:K,timestamp:Number(P),timezoneOffset:tN(_)}}function tN(q){let[,$,K,P]=q.match(/(\+|-)(\d\d)(\d\d)/);return P=($==="+"?1:-1)*(Number(K)*60+Number(P)),BN(P)}function BN(q){return q===0?q:-q}class dq{constructor(q){if(typeof q==="string")this._tag=q;else if(Buffer.isBuffer(q))this._tag=q.toString("utf8");else if(typeof q==="object")this._tag=dq.render(q);else throw new o("invalid type passed to GitAnnotatedTag constructor")}static from(q){return new dq(q)}static render(q){return`object ${q.object}
|
|
101
|
+
type ${q.type}
|
|
102
|
+
tag ${q.tag}
|
|
103
|
+
tagger ${S3(q.tagger)}
|
|
104
|
+
|
|
105
|
+
${q.message}
|
|
106
|
+
${q.gpgsig?q.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
|
107
|
+
|
|
108
|
+
`))}message(){let q=this.withoutSignature();return q.slice(q.indexOf(`
|
|
109
|
+
|
|
110
|
+
`)+2)}parse(){return Object.assign(this.headers(),{message:this.message(),gpgsig:this.gpgsig()})}render(){return this._tag}headers(){let q=this.justHeaders().split(`
|
|
111
|
+
`),$=[];for(let P of q)if(P[0]===" ")$[$.length-1]+=`
|
|
112
|
+
`+P.slice(1);else $.push(P);let K={};for(let P of $){let _=P.slice(0,P.indexOf(" ")),j=P.slice(P.indexOf(" ")+1);if(Array.isArray(K[_]))K[_].push(j);else K[_]=j}if(K.tagger)K.tagger=m4(K.tagger);if(K.committer)K.committer=m4(K.committer);return K}withoutSignature(){let q=r6(this._tag);if(q.indexOf(`
|
|
113
|
+
-----BEGIN PGP SIGNATURE-----`)===-1)return q;return q.slice(0,q.lastIndexOf(`
|
|
114
|
+
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
|
115
|
+
-----BEGIN PGP SIGNATURE-----`)===-1)return;let q=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return r6(q)}payload(){return this.withoutSignature()+`
|
|
116
|
+
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(q,$,K){let P=q.payload(),{signature:_}=await $({payload:P,secretKey:K});_=r6(_);let j=P+_;return dq.from(j)}}function f3(q){return q.trim().split(`
|
|
117
|
+
`).map(($)=>" "+$).join(`
|
|
118
|
+
`)+`
|
|
119
|
+
`}function eN(q){return q.split(`
|
|
120
|
+
`).map(($)=>$.replace(/^ /,"")).join(`
|
|
121
|
+
`)}class Yq{constructor(q){if(typeof q==="string")this._commit=q;else if(Buffer.isBuffer(q))this._commit=q.toString("utf8");else if(typeof q==="object")this._commit=Yq.render(q);else throw new o("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:q,signature:$}){let K=Yq.justHeaders(q),P=Yq.justMessage(q),_=r6(K+`
|
|
122
|
+
gpgsig`+f3($)+`
|
|
123
|
+
`+P);return new Yq(_)}static from(q){return new Yq(q)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return Yq.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(q){return r6(q.slice(q.indexOf(`
|
|
124
|
+
|
|
125
|
+
`)+2))}static justHeaders(q){return q.slice(0,q.indexOf(`
|
|
126
|
+
|
|
127
|
+
`))}parseHeaders(){let q=Yq.justHeaders(this._commit).split(`
|
|
128
|
+
`),$=[];for(let P of q)if(P[0]===" ")$[$.length-1]+=`
|
|
129
|
+
`+P.slice(1);else $.push(P);let K={parent:[]};for(let P of $){let _=P.slice(0,P.indexOf(" ")),j=P.slice(P.indexOf(" ")+1);if(Array.isArray(K[_]))K[_].push(j);else K[_]=j}if(K.author)K.author=m4(K.author);if(K.committer)K.committer=m4(K.committer);return K}static renderHeaders(q){let $="";if(q.tree)$+=`tree ${q.tree}
|
|
130
|
+
`;else $+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
131
|
+
`;if(q.parent){if(q.parent.length===void 0)throw new o("commit 'parent' property should be an array");for(let _ of q.parent)$+=`parent ${_}
|
|
132
|
+
`}let K=q.author;$+=`author ${S3(K)}
|
|
133
|
+
`;let P=q.committer||q.author;if($+=`committer ${S3(P)}
|
|
134
|
+
`,q.gpgsig)$+="gpgsig"+f3(q.gpgsig);return $}static render(q){return Yq.renderHeaders(q)+`
|
|
135
|
+
`+r6(q.message)}render(){return this._commit}withoutSignature(){let q=r6(this._commit);if(q.indexOf(`
|
|
136
|
+
gpgsig`)===-1)return q;let $=q.slice(0,q.indexOf(`
|
|
137
|
+
gpgsig`)),K=q.slice(q.indexOf(`-----END PGP SIGNATURE-----
|
|
138
|
+
`)+28);return r6($+`
|
|
139
|
+
`+K)}isolateSignature(){let q=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return eN(q)}static async sign(q,$,K){let P=q.withoutSignature(),_=Yq.justMessage(q._commit),{signature:j}=await $({payload:P,secretKey:K});j=r6(j);let w=Yq.justHeaders(q._commit)+`
|
|
140
|
+
gpgsig`+f3(j)+`
|
|
141
|
+
`+_;return Yq.from(w)}}async function I$({fs:q,cache:$,gitdir:K,oid:P}){if(P==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:aq.from([]),oid:P};let{type:_,object:j}=await Kq({fs:q,cache:$,gitdir:K,oid:P});if(_==="tag")return P=dq.from(j).parse().object,I$({fs:q,cache:$,gitdir:K,oid:P});if(_==="commit")return P=Yq.from(j).parse().tree,I$({fs:q,cache:$,gitdir:K,oid:P});if(_!=="tree")throw new Lq(P,_,"tree");return{tree:aq.from(j),oid:P}}class EO{constructor({fs:q,gitdir:$,ref:K,cache:P}){this.fs=q,this.cache=P,this.gitdir=$,this.mapPromise=(async()=>{let j=new Map,Y;try{Y=await E.resolve({fs:q,gitdir:$,ref:K})}catch(O){if(O instanceof s)Y="4b825dc642cb6eb9a060e54bf8d69288fbee4904"}let w=await I$({fs:q,cache:this.cache,gitdir:$,oid:Y});return w.type="tree",w.mode="40000",j.set(".",w),j})();let _=this;this.ConstructEntry=class{constructor(Y){this._fullpath=Y,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return _.type(this)}async mode(){return _.mode(this)}async stat(){return _.stat(this)}async content(){return _.content(this)}async oid(){return _.oid(this)}}}async readdir(q){let $=q._fullpath,{fs:K,cache:P,gitdir:_}=this,j=await this.mapPromise,Y=j.get($);if(!Y)throw Error(`No obj for ${$}`);let w=Y.oid;if(!w)throw Error(`No oid for obj ${JSON.stringify(Y)}`);if(Y.type!=="tree")return null;let{type:O,object:v}=await Kq({fs:K,cache:P,gitdir:_,oid:w});if(O!==Y.type)throw new Lq(w,O,Y.type);let z=aq.from(v);for(let W of z)j.set(m($,W.path),W);return z.entries().map((W)=>m($,W.path))}async type(q){if(q._type===!1){let $=await this.mapPromise,{type:K}=$.get(q._fullpath);q._type=K}return q._type}async mode(q){if(q._mode===!1){let $=await this.mapPromise,{mode:K}=$.get(q._fullpath);q._mode=MO(parseInt(K,8))}return q._mode}async stat(q){}async content(q){if(q._content===!1){let $=await this.mapPromise,{fs:K,cache:P,gitdir:_}=this,Y=$.get(q._fullpath).oid,{type:w,object:O}=await Kq({fs:K,cache:P,gitdir:_,oid:Y});if(w!=="blob")q._content=void 0;else q._content=new Uint8Array(O)}return q._content}async oid(q){if(q._oid===!1){let K=(await this.mapPromise).get(q._fullpath);q._oid=K.oid}return q._oid}}function q6({ref:q="HEAD"}={}){let $=Object.create(null);return Object.defineProperty($,y4,{value:function({fs:K,gitdir:P,cache:_}){return new EO({fs:K,gitdir:P,ref:q,cache:_})}}),Object.freeze($),$}class pO{constructor({fs:q,dir:$,gitdir:K,cache:P}){this.fs=q,this.cache=P,this.dir=$,this.gitdir=K,this.config=null;let _=this;this.ConstructEntry=class{constructor(Y){this._fullpath=Y,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return _.type(this)}async mode(){return _.mode(this)}async stat(){return _.stat(this)}async content(){return _.content(this)}async oid(){return _.oid(this)}}}async readdir(q){let $=q._fullpath,{fs:K,dir:P}=this,_=await K.readdir(m(P,$));if(_===null)return null;return _.map((j)=>m($,j))}async type(q){if(q._type===!1)await q.stat();return q._type}async mode(q){if(q._mode===!1)await q.stat();return q._mode}async stat(q){if(q._stat===!1){let{fs:$,dir:K}=this,P=await $.lstat(`${K}/${q._fullpath}`);if(!P)throw Error(`ENOENT: no such file or directory, lstat '${q._fullpath}'`);let _=P.isDirectory()?"tree":"blob";if(_==="blob"&&!P.isFile()&&!P.isSymbolicLink())_="special";if(q._type=_,P=b$(P),q._mode=P.mode,P.size===-1&&q._actualSize)P.size=q._actualSize;q._stat=P}return q._stat}async content(q){if(q._content===!1){let{fs:$,dir:K,gitdir:P}=this;if(await q.type()==="tree")q._content=void 0;else{let _;if(await q.mode()>>12===10)_=await $.readlink(`${K}/${q._fullpath}`);else{let Y=await(await this._getGitConfig($,P)).get("core.autocrlf");_=await $.read(`${K}/${q._fullpath}`,{autocrlf:Y})}if(q._actualSize=_.length,q._stat&&q._stat.size===-1)q._stat.size=q._actualSize;q._content=new Uint8Array(_)}}return q._content}async oid(q){if(q._oid===!1){let $=this,{fs:K,gitdir:P,cache:_}=this,j;await Jq.acquire({fs:K,gitdir:P,cache:_},async function(Y){let w=Y.entriesMap.get(q._fullpath),O=await q.stat(),z=await(await $._getGitConfig(K,P)).get("core.filemode"),W=typeof process<"u"?process.platform!=="win32":!0;if(!w||S4(O,w,z,W)){let T=await q.content();if(T===void 0)j=void 0;else if(j=await y6(l8.wrap({type:"blob",object:T})),w&&j===w.oid&&(!z||O.mode===w.mode)&&S4(O,w,z,W))Y.insert({filepath:q._fullpath,stats:O,oid:j})}else j=w.oid}),q._oid=j}return q._oid}async _getGitConfig(q,$){if(this.config)return this.config;return this.config=await Zq.get({fs:q,gitdir:$}),this.config}}function L$(){let q=Object.create(null);return Object.defineProperty(q,y4,{value:function({fs:$,dir:K,gitdir:P,cache:_}){return new pO({fs:$,dir:K,gitdir:P,cache:_})}}),Object.freeze(q),q}function UN(q,$){let K=$-q;return Array.from({length:K},(P,_)=>q+_)}var DO=typeof Array.prototype.flat>"u"?(q)=>q.reduce(($,K)=>$.concat(K),[]):(q)=>q.flat();class yO{constructor(){this.value=null}consider(q){if(q===null||q===void 0)return;if(this.value===null)this.value=q;else if(q<this.value)this.value=q}reset(){this.value=null}}function*FN(q){let $=new yO,K,P=[],_=q.length;for(let j=0;j<_;j++)if(P[j]=q[j].next().value,P[j]!==void 0)$.consider(P[j]);if($.value===null)return;while(!0){let j=[];K=$.value,$.reset();for(let Y=0;Y<_;Y++){if(P[Y]!==void 0&&P[Y]===K)j[Y]=P[Y],P[Y]=q[Y].next().value;else j[Y]=null;if(P[Y]!==void 0)$.consider(P[Y])}if(yield j,$.value===null)return}}async function W8({fs:q,cache:$,dir:K,gitdir:P,trees:_,map:j=async(O,v)=>v,reduce:Y=async(O,v)=>{let z=DO(v);if(O!==void 0)z.unshift(O);return z},iterate:w=(O,v)=>Promise.all([...v].map(O))}){let O=_.map((H)=>H[y4]({fs:q,dir:K,gitdir:P,cache:$})),v=Array(O.length).fill("."),z=UN(0,O.length),W=async(H)=>{z.forEach((X)=>{let G=H[X];H[X]=G&&new O[X].ConstructEntry(G)});let Z=(await Promise.all(z.map((X)=>{let G=H[X];return G?O[X].readdir(G):[]}))).map((X)=>{return(X===null?[]:X)[Symbol.iterator]()});return{entries:H,children:FN(Z)}},T=async(H)=>{let{entries:J,children:Z}=await W(H),X=J.find((f)=>f&&f._fullpath)._fullpath,G=await j(X,J);if(G!==null){let f=await w(T,Z);return f=f.filter((N)=>N!==void 0),Y(G,f)}};return T(v)}async function b3(q,$){let K=await q.readdir($);if(K==null)await q.rm($);else if(K.length)await Promise.all(K.map((P)=>{let _=m($,P);return q.lstat(_).then((j)=>{if(!j)return;return j.isDirectory()?b3(q,_):q.rm(_)})})).then(()=>q.rmdir($));else await q.rmdir($)}function sN(q){return QN(q)&&wO(q.then)&&wO(q.catch)}function QN(q){return q&&typeof q==="object"}function wO(q){return typeof q==="function"}function vO(q){return sN(((K)=>{try{return K.readFile().catch((P)=>P)}catch(P){return P}})(q))}var OO=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function zO(q,$){if(vO($))for(let K of OO)q[`_${K}`]=$[K].bind($);else for(let K of OO)q[`_${K}`]=M4($[K].bind($));if(vO($)){if($.cp)q._cp=$.cp.bind($);if($.rm)q._rm=$.rm.bind($);else if($.rmdir.length>1)q._rm=$.rmdir.bind($);else q._rm=b3.bind(null,q)}else{if($.cp)q._cp=M4($.cp.bind($));if($.rm)q._rm=M4($.rm.bind($));else if($.rmdir.length>2)q._rm=M4($.rmdir.bind($));else q._rm=b3.bind(null,q)}}class g{constructor(q){if(typeof q._original_unwrapped_fs<"u")return q;let $=Object.getOwnPropertyDescriptor(q,"promises");if($&&$.enumerable)zO(this,q.promises);else zO(this,q);this._original_unwrapped_fs=q}async exists(q,$={}){try{return await this._stat(q),!0}catch(K){if(K.code==="ENOENT"||K.code==="ENOTDIR"||(K.code||"").includes("ENS"))return!1;else throw console.log('Unhandled error in "FileSystem.exists()" function',K),K}}async read(q,$={}){try{let K=await this._readFile(q,$);if($.autocrlf==="true")try{K=new TextDecoder("utf8",{fatal:!0}).decode(K),K=K.replace(/\r\n/g,`
|
|
142
|
+
`),K=new TextEncoder().encode(K)}catch(P){}if(typeof K!=="string")K=Buffer.from(K);return K}catch(K){return null}}async write(q,$,K={}){try{await this._writeFile(q,$,K)}catch(P){await this.mkdir(x8(q)),await this._writeFile(q,$,K)}}async mkdir(q,$=!1){try{await this._mkdir(q)}catch(K){if(K===null)return;if(K.code==="EEXIST")return;if($)throw K;if(K.code==="ENOENT"){let P=x8(q);if(P==="."||P==="/"||P===q)throw K;await this.mkdir(P),await this.mkdir(q,!0)}}}async rm(q){try{await this._unlink(q)}catch($){if($.code!=="ENOENT")throw $}}async rmdir(q,$){try{if($&&$.recursive)await this._rm(q,$);else await this._rmdir(q)}catch(K){if(K.code!=="ENOENT")throw K}}async readdir(q){try{let $=await this._readdir(q);return $.sort(D4),$}catch($){if($.code==="ENOTDIR")return null;return[]}}async readdirDeep(q){let $=await this._readdir(q);return(await Promise.all($.map(async(P)=>{let _=q+"/"+P;return(await this._stat(_)).isDirectory()?this.readdirDeep(_):_}))).reduce((P,_)=>P.concat(_),[])}async lstat(q){try{return await this._lstat(q)}catch($){if($.code==="ENOENT"||($.code||"").includes("ENS"))return null;throw $}}async readlink(q,$={encoding:"buffer"}){try{let K=await this._readlink(q,$);return Buffer.isBuffer(K)?K:Buffer.from(K)}catch(K){if(K.code==="ENOENT"||(K.code||"").includes("ENS"))return null;throw K}}async writelink(q,$){return this._symlink($.toString("utf8"),q)}}function h(q,$){if($===void 0)throw new oq(q)}function qS(q){return q.startsWith("/")||/^[a-zA-Z]:[\\/]/.test(q)}async function n({fsp:q,dotgit:$}){h("fsp",q),h("dotgit",$);let K=await q._stat($).catch(()=>({isFile:()=>!1,isDirectory:()=>!1}));if(K.isDirectory())return $;else if(K.isFile())return q._readFile($,"utf8").then((P)=>P.trimRight().substr(8)).then((P)=>{if(qS(P))return P;return m(x8($),P)});else return $}async function I4(q,$){if(!q&&!$)return!1;if(q&&!$)return!0;if(!q&&$)return!0;if(await q.type()==="tree"&&await $.type()==="tree")return!1;if(await q.type()===await $.type()&&await q.mode()===await $.mode()&&await q.oid()===await $.oid())return!1;return!0}async function dO({fs:q,dir:$,gitdir:K=m($,".git"),commit:P="HEAD",cache:_={}}){try{h("fs",q),h("dir",$),h("gitdir",K);let j=new g(q),Y=[q6({ref:P}),L$(),c8()],w=[],O=await n({fsp:j,dotgit:K});await Jq.acquire({fs:j,gitdir:O,cache:_},async function(z){w=z.unmergedPaths});let v=await W8({fs:j,cache:_,dir:$,gitdir:O,trees:Y,map:async function(z,[W,T,H]){let J=!await I4(T,H),Z=w.includes(z),X=!await I4(H,W);if(J||Z)return W?{path:z,mode:await W.mode(),oid:await W.oid(),type:await W.type(),content:await W.content()}:void 0;if(X)return!1;else throw new qP(z)}});await Jq.acquire({fs:j,gitdir:O,cache:_},async function(z){for(let W of v){if(W===!1)continue;if(!W){await j.rmdir(`${$}/${W.path}`,{recursive:!0}),z.delete({filepath:W.path});continue}if(W.type==="blob"){let T=new TextDecoder().decode(W.content);await j.write(`${$}/${W.path}`,T,{mode:W.mode}),z.insert({filepath:W.path,oid:W.oid,stage:0})}}})}catch(j){throw j.caller="git.abortMerge",j}}class r8{static async isIgnored({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P}){if(b4(P)===".git")return!0;if(P===".")return!1;let _="",j=m(K,"info","exclude");if(await q.exists(j))_=await q.read(j,"utf8");let Y=[{gitignore:m($,".gitignore"),filepath:P}],w=P.split("/").filter(Boolean);for(let v=1;v<w.length;v++){let z=w.slice(0,v).join("/"),W=w.slice(v).join("/");Y.push({gitignore:m($,z,".gitignore"),filepath:W})}let O=!1;for(let v of Y){let z;try{z=await q.read(v.gitignore,"utf8")}catch(H){if(H.code==="NOENT")continue}let W=PN().add(_);W.add(z);let T=x8(v.filepath);if(T!=="."&&W.ignores(T))return!0;if(O)O=!W.test(v.filepath).unignored;else O=W.test(v.filepath).ignored}return O}}async function $S({fs:q,gitdir:$,object:K,format:P,oid:_}){if(P!=="deflated")throw new o("GitObjectStoreLoose expects objects to write to be in deflated format");let j=`objects/${_.slice(0,2)}/${_.slice(2)}`,Y=`${$}/${j}`;if(!await q.exists(Y))await q.write(Y,K)}var A3=null;async function LO(q){if(A3===null)A3=PS();return A3?KS(q):m3.deflate(q)}async function KS(q){let $=new CompressionStream("deflate"),K=new Blob([q]).stream().pipeThrough($);return new Uint8Array(await new Response(K).arrayBuffer())}function PS(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch(q){return!1}}async function rq({fs:q,gitdir:$,type:K,object:P,format:_="content",oid:j=void 0,dryRun:Y=!1}){if(_!=="deflated"){if(_!=="wrapped")P=l8.wrap({type:K,object:P});j=await y6(P),P=Buffer.from(await LO(P))}if(!Y)await $S({fs:q,gitdir:$,object:P,format:"deflated",oid:j});return j}function gO(q){let $;while(~($=q.indexOf(92)))q[$]=47;return q}async function xO({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P,cache:_={},force:j=!1,parallel:Y=!0}){try{h("fs",q),h("dir",$),h("gitdir",K),h("filepath",P);let w=new g(q),O=await n({fsp:w,dotgit:K});await Jq.acquire({fs:w,gitdir:O,cache:_},async(v)=>{let W=await(await Zq.get({fs:w,gitdir:O})).get("core.autocrlf");return u3({dir:$,gitdir:O,fs:w,filepath:P,index:v,force:j,parallel:Y,autocrlf:W})})}catch(w){throw w.caller="git.add",w}}async function u3({dir:q,gitdir:$,fs:K,filepath:P,index:_,force:j,parallel:Y,autocrlf:w}){P=Array.isArray(P)?P:[P];let O=P.map(async(T)=>{if(!j){if(await r8.isIgnored({fs:K,dir:q,gitdir:$,filepath:T}))return}let H=await K.lstat(m(q,T));if(!H)throw new s(T);if(H.isDirectory()){let J=await K.readdir(m(q,T));if(Y){let Z=J.map((X)=>u3({dir:q,gitdir:$,fs:K,filepath:[m(T,X)],index:_,force:j,parallel:Y,autocrlf:w}));await Promise.all(Z)}else for(let Z of J)await u3({dir:q,gitdir:$,fs:K,filepath:[m(T,Z)],index:_,force:j,parallel:Y,autocrlf:w})}else{let J=H.isSymbolicLink()?await K.readlink(m(q,T)).then(gO):await K.read(m(q,T),{autocrlf:w});if(J===null)throw new s(T);let Z=await rq({fs:K,gitdir:$,type:"blob",object:J});_.insert({filepath:T,stats:H,oid:Z})}}),v=await Promise.allSettled(O),z=v.filter((T)=>T.status==="rejected").map((T)=>T.reason);if(z.length>1)throw new UK(z);if(z.length===1)throw z[0];return v.filter((T)=>T.status==="fulfilled"&&T.value).map((T)=>T.value)}async function dK({fs:q,gitdir:$,path:K}){return(await Zq.get({fs:q,gitdir:$})).get(K)}function nO(q,...$){for(let K of $)if(K)for(let P of Object.keys(K)){let _=K[P];if(_!==void 0)q[P]=_}return q}async function T8({fs:q,gitdir:$,author:K,commit:P}){let _=Math.floor(Date.now()/1000),j={name:await dK({fs:q,gitdir:$,path:"user.name"}),email:await dK({fs:q,gitdir:$,path:"user.email"})||"",timestamp:_,timezoneOffset:new Date(_*1000).getTimezoneOffset()},Y=nO({},j,P?P.author:void 0,K);if(Y.name===void 0)return;return Y}async function n8({fs:q,gitdir:$,author:K,committer:P,commit:_}){let j=Math.floor(Date.now()/1000),Y={name:await dK({fs:q,gitdir:$,path:"user.name"}),email:await dK({fs:q,gitdir:$,path:"user.email"})||"",timestamp:j,timezoneOffset:new Date(j*1000).getTimezoneOffset()},w=nO({},Y,_?_.committer:void 0,K,P);if(w.name===void 0)return;return w}async function cO({fs:q,cache:$,gitdir:K,oid:P}){let{type:_,object:j}=await Kq({fs:q,cache:$,gitdir:K,oid:P});if(_==="tag")return P=dq.from(j).parse().object,cO({fs:q,cache:$,gitdir:K,oid:P});if(_!=="commit")throw new Lq(P,_,"commit");return{commit:Yq.from(j),oid:P}}async function D6({fs:q,cache:$,gitdir:K,oid:P}){let{commit:_,oid:j}=await cO({fs:q,cache:$,gitdir:K,oid:P});return{oid:j,commit:_.parse(),payload:_.withoutSignature()}}async function KP({fs:q,cache:$,onSign:K,gitdir:P,message:_,author:j,committer:Y,signingKey:w,amend:O=!1,dryRun:v=!1,noUpdateBranch:z=!1,ref:W,parent:T,tree:H}){let J=!1,Z=!1;if(!W)Z=!(await q.read(`${P}/HEAD`,{encoding:"utf8"})).startsWith("ref:"),W=await E.resolve({fs:q,gitdir:P,ref:"HEAD",depth:2});let X,G;try{X=await E.resolve({fs:q,gitdir:P,ref:W}),G=await D6({fs:q,gitdir:P,oid:X,cache:{}})}catch{J=!0}if(O&&J)throw new $P(W);let f=!O?await T8({fs:q,gitdir:P,author:j}):await T8({fs:q,gitdir:P,author:j,commit:G.commit});if(!f)throw new bq("author");let N=!O?await n8({fs:q,gitdir:P,author:f,committer:Y}):await n8({fs:q,gitdir:P,author:f,committer:Y,commit:G.commit});if(!N)throw new bq("committer");return Jq.acquire({fs:q,gitdir:P,cache:$,allowUnmerged:!1},async function(V){let b=NO(V.entries).get(".");if(!H)H=await lO({fs:q,gitdir:P,inode:b,dryRun:v});if(!T)if(!O)T=X?[X]:[];else T=G.commit.parent;else T=await Promise.all(T.map((A)=>{return E.resolve({fs:q,gitdir:P,ref:A})}));if(!_)if(!O)throw new oq("message");else _=G.commit.message;let k=Yq.from({tree:H,parent:T,author:f,committer:N,message:_});if(w)k=await Yq.sign(k,K,w);let M=await rq({fs:q,gitdir:P,type:"commit",object:k.toObject(),dryRun:v});if(!z&&!v)await E.writeRef({fs:q,gitdir:P,ref:Z?"HEAD":W,value:M});return M})}async function lO({fs:q,gitdir:$,inode:K,dryRun:P}){let _=K.children;for(let O of _)if(O.type==="tree")O.metadata.mode="040000",O.metadata.oid=await lO({fs:q,gitdir:$,inode:O,dryRun:P});let j=_.map((O)=>({mode:O.metadata.mode,path:O.basename,oid:O.metadata.oid,type:O.type})),Y=aq.from(j);return await rq({fs:q,gitdir:$,type:"tree",object:Y.toObject(),dryRun:P})}async function PP({fs:q,cache:$,gitdir:K,oid:P,filepath:_}){if(_.startsWith("/"))throw new z8("leading-slash");else if(_.endsWith("/"))throw new z8("trailing-slash");let j=P,Y=await I$({fs:q,cache:$,gitdir:K,oid:P}),w=Y.tree;if(_==="")P=Y.oid;else{let O=_.split("/");P=await oO({fs:q,cache:$,gitdir:K,tree:w,pathArray:O,oid:j,filepath:_})}return P}async function oO({fs:q,cache:$,gitdir:K,tree:P,pathArray:_,oid:j,filepath:Y}){let w=_.shift();for(let O of P)if(O.path===w)if(_.length===0)return O.oid;else{let{type:v,object:z}=await Kq({fs:q,cache:$,gitdir:K,oid:O.oid});if(v!=="tree")throw new Lq(j,v,"tree",Y);return P=aq.from(z),oO({fs:q,cache:$,gitdir:K,tree:P,pathArray:_,oid:j,filepath:Y})}throw new s(`file or directory found at "${j}:${Y}"`)}async function g$({fs:q,cache:$,gitdir:K,oid:P,filepath:_=void 0}){if(_!==void 0)P=await PP({fs:q,cache:$,gitdir:K,oid:P,filepath:_});let{tree:j,oid:Y}=await I$({fs:q,cache:$,gitdir:K,oid:P});return{oid:Y,tree:j.entries()}}async function _P({fs:q,gitdir:$,tree:K}){let P=aq.from(K).toObject();return await rq({fs:q,gitdir:$,type:"tree",object:P,format:"content"})}async function _S({fs:q,cache:$,onSign:K,gitdir:P,ref:_,oid:j,note:Y,force:w,author:O,committer:v,signingKey:z}){let W;try{W=await E.resolve({gitdir:P,fs:q,ref:_})}catch(G){if(!(G instanceof s))throw G}let H=(await g$({fs:q,cache:$,gitdir:P,oid:W||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(w)H=H.filter((G)=>G.path!==j);else for(let G of H)if(G.path===j)throw new G6("note",j);if(typeof Y==="string")Y=Buffer.from(Y,"utf8");let J=await rq({fs:q,gitdir:P,type:"blob",object:Y,format:"content"});H.push({mode:"100644",path:j,oid:J,type:"blob"});let Z=await _P({fs:q,gitdir:P,tree:H});return await KP({fs:q,cache:$,onSign:K,gitdir:P,ref:_,tree:Z,parent:W&&[W],message:`Note added by 'isomorphic-git addNote'
|
|
143
|
+
`,author:O,committer:v,signingKey:z})}async function aO({fs:q,onSign:$,dir:K,gitdir:P=m(K,".git"),ref:_="refs/notes/commits",oid:j,note:Y,force:w,author:O,committer:v,signingKey:z,cache:W={}}){try{if(h("fs",q),h("gitdir",P),h("oid",j),h("note",Y),z)h("onSign",$);let T=new g(q),H=await T8({fs:T,gitdir:P,author:O});if(!H)throw new bq("author");let J=await n8({fs:T,gitdir:P,author:H,committer:v});if(!J)throw new bq("committer");let Z=await n({fsp:T,dotgit:P});return await _S({fs:T,cache:W,onSign:$,gitdir:Z,ref:_,oid:j,note:Y,force:w,author:H,committer:J,signingKey:z})}catch(T){throw T.caller="git.addNote",T}}var jS=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;function LK(q,$){if(typeof q!=="string")throw TypeError("Reference name must be a string");return!jS.test(q)&&(!!$||q.includes("/"))}async function rO({fs:q,gitdir:$,remote:K,url:P,force:_}){if(!LK(K,!0))throw new A6(K,yK.clean(K));let j=await Zq.get({fs:q,gitdir:$});if(!_){if((await j.getSubsections("remote")).includes(K)){if(P!==await j.get(`remote.${K}.url`))throw new G6("remote",K)}}await j.set(`remote.${K}.url`,P),await j.set(`remote.${K}.fetch`,`+refs/heads/*:refs/remotes/${K}/*`),await Zq.save({fs:q,gitdir:$,config:j})}async function iO({fs:q,dir:$,gitdir:K=m($,".git"),remote:P,url:_,force:j=!1}){try{h("fs",q),h("gitdir",K),h("remote",P),h("url",_);let Y=new g(q),w=await n({fsp:Y,dotgit:K});return await rO({fs:Y,gitdir:w,remote:P,url:_,force:j})}catch(Y){throw Y.caller="git.addRemote",Y}}async function YS({fs:q,cache:$,onSign:K,gitdir:P,ref:_,tagger:j,message:Y=_,gpgsig:w,object:O,signingKey:v,force:z=!1}){if(_=_.startsWith("refs/tags/")?_:`refs/tags/${_}`,!z&&await E.exists({fs:q,gitdir:P,ref:_}))throw new G6("tag",_);let W=await E.resolve({fs:q,gitdir:P,ref:O||"HEAD"}),{type:T}=await Kq({fs:q,cache:$,gitdir:P,oid:W}),H=dq.from({object:W,type:T,tag:_.replace("refs/tags/",""),tagger:j,message:Y,gpgsig:w});if(v)H=await dq.sign(H,K,v);let J=await rq({fs:q,gitdir:P,type:"tag",object:H.toObject()});await E.writeRef({fs:q,gitdir:P,ref:_,value:J})}async function tO({fs:q,onSign:$,dir:K,gitdir:P=m(K,".git"),ref:_,tagger:j,message:Y=_,gpgsig:w,object:O,signingKey:v,force:z=!1,cache:W={}}){try{if(h("fs",q),h("gitdir",P),h("ref",_),v)h("onSign",$);let T=new g(q),H=await n({fsp:T,dotgit:P}),J=await T8({fs:T,gitdir:H,author:j});if(!J)throw new bq("tagger");return await YS({fs:T,cache:W,onSign:$,gitdir:H,ref:_,tagger:J,message:Y,gpgsig:w,object:O,signingKey:v,force:z})}catch(T){throw T.caller="git.annotatedTag",T}}async function wS({fs:q,gitdir:$,ref:K,object:P,checkout:_=!1,force:j=!1}){if(!LK(K,!0))throw new A6(K,yK.clean(K));let Y=`refs/heads/${K}`;if(!j){if(await E.exists({fs:q,gitdir:$,ref:Y}))throw new G6("branch",K,!1)}let w;try{w=await E.resolve({fs:q,gitdir:$,ref:P||"HEAD"})}catch(O){}if(w)await E.writeRef({fs:q,gitdir:$,ref:Y,value:w});if(_)await E.writeSymbolicRef({fs:q,gitdir:$,ref:"HEAD",value:Y})}async function BO({fs:q,dir:$,gitdir:K=m($,".git"),ref:P,object:_,checkout:j=!1,force:Y=!1}){try{h("fs",q),h("gitdir",K),h("ref",P);let w=new g(q),O=await n({fsp:w,dotgit:K});return await wS({fs:w,gitdir:O,ref:P,object:_,checkout:j,force:Y})}catch(w){throw w.caller="git.branch",w}}var eO=(q,$)=>{if(q==="."||$==null||$.length===0||$===".")return!0;if($.length>=q.length)return $.startsWith(q);else return q.startsWith($)};async function y3({fs:q,cache:$,onProgress:K,onPostCheckout:P,dir:_,gitdir:j,remote:Y,ref:w,filepaths:O,noCheckout:v,noUpdateHead:z,dryRun:W,force:T,track:H=!0,nonBlocking:J=!1,batchSize:Z=100}){let X;if(P)try{X=await E.resolve({fs:q,gitdir:j,ref:"HEAD"})}catch(f){X="0000000000000000000000000000000000000000"}let G;try{G=await E.resolve({fs:q,gitdir:j,ref:w})}catch(f){if(w==="HEAD")throw f;let N=`${Y}/${w}`;if(G=await E.resolve({fs:q,gitdir:j,ref:N}),H){let V=await Zq.get({fs:q,gitdir:j});await V.set(`branch.${w}.remote`,Y),await V.set(`branch.${w}.merge`,`refs/heads/${w}`),await Zq.save({fs:q,gitdir:j,config:V})}await E.writeRef({fs:q,gitdir:j,ref:`refs/heads/${w}`,value:G})}if(!v){let f;try{f=await vS({fs:q,cache:$,onProgress:K,dir:_,gitdir:j,ref:w,force:T,filepaths:O})}catch(k){if(k instanceof s&&k.data.what===G)throw new rK(w,G);else throw k}let N=f.filter(([k])=>k==="conflict").map(([k,M])=>M);if(N.length>0)throw new lK(N);let V=f.filter(([k])=>k==="error").map(([k,M])=>M);if(V.length>0)throw new o(V.join(", "));if(W){if(P)await P({previousHead:X,newHead:G,type:O!=null&&O.length>0?"file":"branch"});return}let C=0,b=f.length;if(await Jq.acquire({fs:q,gitdir:j,cache:$},async function(k){await Promise.all(f.filter(([M])=>M==="delete"||M==="delete-index").map(async function([M,A]){let u=`${_}/${A}`;if(M==="delete")await q.rm(u);if(k.delete({filepath:A}),K)await K({phase:"Updating workdir",loaded:++C,total:b})}))}),await Jq.acquire({fs:q,gitdir:j,cache:$},async function(k){for(let[M,A]of f)if(M==="rmdir"||M==="rmdir-index"){let u=`${_}/${A}`;try{if(M==="rmdir")await q.rmdir(u);if(k.delete({filepath:A}),K)await K({phase:"Updating workdir",loaded:++C,total:b})}catch(S){if(S.code==="ENOTEMPTY")console.log(`Did not delete ${A} because directory is not empty`);else throw S}}}),await Promise.all(f.filter(([k])=>k==="mkdir"||k==="mkdir-index").map(async function([k,M]){let A=`${_}/${M}`;if(await q.mkdir(A),K)await K({phase:"Updating workdir",loaded:++C,total:b})})),J){let k=f.filter(([A])=>A==="create"||A==="create-index"||A==="update"||A==="mkdir-index"),M=await WO("Update Working Dir",k.map(([A,u,S,p,L])=>()=>zS({fs:q,cache:$,gitdir:j,dir:_},[A,u,S,p,L])),K,Z);await Jq.acquire({fs:q,gitdir:j,cache:$,allowUnmerged:!0},async function(A){await WO("Update Index",M.map(([u,S,p])=>()=>OS({index:A,fullpath:u,oid:S,stats:p})),K,Z)})}else await Jq.acquire({fs:q,gitdir:j,cache:$,allowUnmerged:!0},async function(k){await Promise.all(f.filter(([M])=>M==="create"||M==="create-index"||M==="update"||M==="mkdir-index").map(async function([M,A,u,S,p]){let L=`${_}/${A}`;try{if(M!=="create-index"&&M!=="mkdir-index"){let{object:d}=await Kq({fs:q,cache:$,gitdir:j,oid:u});if(p)await q.rm(L);if(S===33188)await q.write(L,d);else if(S===33261)await q.write(L,d,{mode:511});else if(S===40960)await q.writelink(L,d);else throw new o(`Invalid mode 0o${S.toString(8)} detected in blob ${u}`)}let c=await q.lstat(L);if(S===33261)c.mode=493;if(M==="mkdir-index")c.mode=57344;if(k.insert({filepath:A,stats:c,oid:u}),K)await K({phase:"Updating workdir",loaded:++C,total:b})}catch(c){console.log(c)}}))});if(P)await P({previousHead:X,newHead:G,type:O!=null&&O.length>0?"file":"branch"})}if(!z){let f=await E.expand({fs:q,gitdir:j,ref:w});if(f.startsWith("refs/heads"))await E.writeSymbolicRef({fs:q,gitdir:j,ref:"HEAD",value:f});else await E.writeRef({fs:q,gitdir:j,ref:"HEAD",value:G})}}async function vS({fs:q,cache:$,onProgress:K,dir:P,gitdir:_,ref:j,force:Y,filepaths:w}){let O=0;return W8({fs:q,cache:$,dir:P,gitdir:_,trees:[q6({ref:j}),L$(),c8()],map:async function(v,[z,W,T]){if(v===".")return;if(w&&!w.some((J)=>eO(v,J)))return null;if(K)await K({phase:"Analyzing workdir",loaded:++O});switch([!!T,!!z,!!W].map(Number).join("")){case"000":return;case"001":if(Y&&w&&w.includes(v))return["delete",v];return;case"010":switch(await z.type()){case"tree":return["mkdir",v];case"blob":return["create",v,await z.oid(),await z.mode()];case"commit":return["mkdir-index",v,await z.oid(),await z.mode()];default:return["error",`new entry Unhandled type ${await z.type()}`]}case"011":switch(`${await z.type()}-${await W.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",v];case"blob-blob":if(await z.oid()!==await W.oid())if(Y)return["update",v,await z.oid(),await z.mode(),await z.mode()!==await W.mode()];else return["conflict",v];else if(await z.mode()!==await W.mode())if(Y)return["update",v,await z.oid(),await z.mode(),!0];else return["conflict",v];else return["create-index",v,await z.oid(),await z.mode()];case"commit-tree":return;case"commit-blob":return["conflict",v];default:return["error",`new entry Unhandled type ${z.type}`]}case"100":return["delete-index",v];case"101":switch(await T.type()){case"tree":return["rmdir-index",v];case"blob":if(await T.oid()!==await W.oid())if(Y)return["delete",v];else return["conflict",v];else return["delete",v];case"commit":return["rmdir-index",v];default:return["error",`delete entry Unhandled type ${await T.type()}`]}case"110":case"111":switch(`${await T.type()}-${await z.type()}`){case"tree-tree":return;case"blob-blob":{if(await T.oid()===await z.oid()&&await T.mode()===await z.mode()&&!Y)return;if(W){if(await W.oid()!==await T.oid()&&await W.oid()!==await z.oid())if(Y)return["update",v,await z.oid(),await z.mode(),await z.mode()!==await W.mode()];else return["conflict",v]}else if(Y)return["update",v,await z.oid(),await z.mode(),await z.mode()!==await T.mode()];if(await z.mode()!==await T.mode())return["update",v,await z.oid(),await z.mode(),!0];if(await z.oid()!==await T.oid())return["update",v,await z.oid(),await z.mode(),!1];else return}case"tree-blob":return["update-dir-to-blob",v,await z.oid()];case"blob-tree":return["update-blob-to-tree",v];case"commit-commit":return["mkdir-index",v,await z.oid(),await z.mode()];default:return["error",`update entry Unhandled type ${await T.type()}-${await z.type()}`]}}},reduce:async function(v,z){if(z=DO(z),!v)return z;else if(v&&v[0]==="rmdir")return z.push(v),z;else return z.unshift(v),z}})}async function OS({index:q,fullpath:$,stats:K,oid:P}){try{q.insert({filepath:$,stats:K,oid:P})}catch(_){console.warn(`Error inserting ${$} into index:`,_)}}async function zS({fs:q,cache:$,gitdir:K,dir:P},[_,j,Y,w,O]){let v=`${P}/${j}`;if(_!=="create-index"&&_!=="mkdir-index"){let{object:W}=await Kq({fs:q,cache:$,gitdir:K,oid:Y});if(O)await q.rm(v);if(w===33188)await q.write(v,W);else if(w===33261)await q.write(v,W,{mode:511});else if(w===40960)await q.writelink(v,W);else throw new o(`Invalid mode 0o${w.toString(8)} detected in blob ${Y}`)}let z=await q.lstat(v);if(w===33261)z.mode=493;if(_==="mkdir-index")z.mode=57344;return[j,Y,z]}async function WO(q,$,K,P){let _=[];try{for(let j=0;j<$.length;j+=P){let Y=$.slice(j,j+P).map((O)=>O());if((await Promise.allSettled(Y)).forEach((O)=>{if(O.status==="fulfilled")_.push(O.value)}),K)await K({phase:"Updating workdir",loaded:j+Y.length,total:$.length})}return _}catch(j){console.error(`Error during ${q}: ${j}`)}return _}async function d3({fs:q,onProgress:$,onPostCheckout:K,dir:P,gitdir:_=m(P,".git"),remote:j="origin",ref:Y,filepaths:w,noCheckout:O=!1,noUpdateHead:v=Y===void 0,dryRun:z=!1,force:W=!1,track:T=!0,cache:H={},nonBlocking:J=!1,batchSize:Z=100}){try{h("fs",q),h("dir",P),h("gitdir",_);let X=Y||"HEAD",G=new g(q),f=await n({fsp:G,dotgit:_});return await y3({fs:G,cache:H,onProgress:$,onPostCheckout:K,dir:P,gitdir:f,remote:j,ref:X,filepaths:w,noCheckout:O,noUpdateHead:v,dryRun:z,force:W,track:T,nonBlocking:J,batchSize:Z})}catch(X){throw X.caller="git.checkout",X}}var G3=/^.*(\r?\n|$)/gm;function WS({branches:q,contents:$}){let K=q[1],P=q[2],_=$[0],j=$[1],Y=$[2],w=j.match(G3),O=_.match(G3),v=Y.match(G3),z=_N(w,O,v),W=7,T="",H=!0;for(let J of z){if(J.ok)T+=J.ok.join("");if(J.conflict)H=!1,T+=`${"<".repeat(7)} ${K}
|
|
144
|
+
`,T+=J.conflict.a.join(""),T+=`${"=".repeat(7)}
|
|
145
|
+
`,T+=J.conflict.b.join(""),T+=`${">".repeat(7)} ${P}
|
|
146
|
+
`}return{cleanMerge:H,mergedText:T}}async function UO({fs:q,cache:$,dir:K,gitdir:P=m(K,".git"),index:_,ourOid:j,baseOid:Y,theirOid:w,ourName:O="ours",baseName:v="base",theirName:z="theirs",dryRun:W=!1,abortOnConflict:T=!0,mergeDriver:H}){let J=q6({ref:j}),Z=q6({ref:Y}),X=q6({ref:w}),G=[],f=[],N=[],V=[],C=await W8({fs:q,cache:$,dir:K,gitdir:P,trees:[J,Z,X],map:async function(b,[k,M,A]){let u=b4(b),S=await I4(k,M),p=await I4(A,M);switch(`${S}-${p}`){case"false-false":return{mode:await M.mode(),path:u,oid:await M.oid(),type:await M.type()};case"false-true":{if(!A&&await k.type()==="tree")return{mode:await k.mode(),path:u,oid:await k.oid(),type:await k.type()};return A?{mode:await A.mode(),path:u,oid:await A.oid(),type:await A.type()}:void 0}case"true-false":{if(!k&&await A.type()==="tree")return{mode:await A.mode(),path:u,oid:await A.oid(),type:await A.type()};return k?{mode:await k.mode(),path:u,oid:await k.oid(),type:await k.type()}:void 0}case"true-true":{if(k&&A&&await k.type()==="tree"&&await A.type()==="tree")return{mode:await k.mode(),path:u,oid:await k.oid(),type:"tree"};if(k&&A&&await k.type()==="blob"&&await A.type()==="blob")return TS({fs:q,gitdir:P,path:u,ours:k,base:M,theirs:A,ourName:O,baseName:v,theirName:z,mergeDriver:H}).then(async(L)=>{if(!L.cleanMerge){if(G.push(b),f.push(b),!T){let c="";if(M&&await M.type()==="blob")c=await M.oid();let d=await k.oid(),Q=await A.oid();if(_.delete({filepath:b}),c)_.insert({filepath:b,oid:c,stage:1});_.insert({filepath:b,oid:d,stage:2}),_.insert({filepath:b,oid:Q,stage:3})}}else if(!T)_.insert({filepath:b,oid:L.mergeResult.oid,stage:0});return L.mergeResult});if(M&&!k&&A&&await M.type()==="blob"&&await A.type()==="blob"){if(G.push(b),N.push(b),!T){let L=await M.oid(),c=await A.oid();_.delete({filepath:b}),_.insert({filepath:b,oid:L,stage:1}),_.insert({filepath:b,oid:c,stage:3})}return{mode:await A.mode(),oid:await A.oid(),type:"blob",path:u}}if(M&&k&&!A&&await M.type()==="blob"&&await k.type()==="blob"){if(G.push(b),V.push(b),!T){let L=await M.oid(),c=await k.oid();_.delete({filepath:b}),_.insert({filepath:b,oid:L,stage:1}),_.insert({filepath:b,oid:c,stage:2})}return{mode:await k.mode(),oid:await k.oid(),type:"blob",path:u}}if(M&&!k&&!A&&(await M.type()==="blob"||await M.type()==="tree"))return;throw new y$}}},reduce:G.length!==0&&(!K||T)?void 0:async(b,k)=>{let M=k.filter(Boolean);if(!b)return;if(b&&b.type==="tree"&&M.length===0&&b.path!==".")return;if(M.length>0||b.path==="."&&M.length===0){let u=new aq(M).toObject(),S=await rq({fs:q,gitdir:P,type:"tree",object:u,dryRun:W});b.oid=S}return b}});if(G.length!==0){if(K&&!T)await W8({fs:q,cache:$,dir:K,gitdir:P,trees:[q6({ref:C.oid})],map:async function(b,[k]){let M=`${K}/${b}`;if(await k.type()==="blob"){let A=await k.mode(),u=new TextDecoder().decode(await k.content());await q.write(M,u,{mode:A})}return!0}});return new o8(G,f,N,V)}return C.oid}async function TS({fs:q,gitdir:$,path:K,ours:P,base:_,theirs:j,ourName:Y,theirName:w,baseName:O,dryRun:v,mergeDriver:z=WS}){let T="100755",H="",J="";if(_&&await _.type()==="blob")T=await _.mode(),H=await _.oid(),J=Buffer.from(await _.content()).toString("utf8");let Z=T===await P.mode()?await j.mode():await P.mode();if(await P.oid()===await j.oid())return{cleanMerge:!0,mergeResult:{mode:Z,path:K,oid:await P.oid(),type:"blob"}};if(await P.oid()===H)return{cleanMerge:!0,mergeResult:{mode:Z,path:K,oid:await j.oid(),type:"blob"}};if(await j.oid()===H)return{cleanMerge:!0,mergeResult:{mode:Z,path:K,oid:await P.oid(),type:"blob"}};let X=Buffer.from(await P.content()).toString("utf8"),G=Buffer.from(await j.content()).toString("utf8"),{mergedText:f,cleanMerge:N}=await z({branches:[O,Y,w],contents:[J,X,G],path:K}),V=await rq({fs:q,gitdir:$,type:"blob",object:Buffer.from(f,"utf8"),dryRun:v});return{cleanMerge:N,mergeResult:{mode:Z,path:K,oid:V,type:"blob"}}}var HS={stage:c8,workdir:L$},h3;async function E$(q,$){if(h3===void 0)h3=new DK;return h3.acquire(q,$)}async function JS(q,$,K,P,_=null){let j=m(K,P),Y=await q.lstat(j);if(!Y)throw new s(j);if(Y.isDirectory())throw new o(`${j}: file expected, but found directory`);let w=_?await uO({fs:q,gitdir:$,oid:_}):void 0,O=w?_:void 0;if(!w)await E$({fs:q,gitdir:$,currentFilepath:j},async()=>{let v=Y.isSymbolicLink()?await q.readlink(j).then(gO):await q.read(j);if(v===null)throw new s(j);O=await rq({fs:q,gitdir:$,type:"blob",object:v})});return O}async function ZS({fs:q,dir:$,gitdir:K,entries:P}){async function _(j){if(j.type==="tree"){if(!j.oid){let Y=await Promise.all(j.children.map(_));j.oid=await _P({fs:q,gitdir:K,tree:Y}),j.mode=16384}}else if(j.type==="blob")j.oid=await JS(q,K,$,j.path,j.oid),j.mode=33188;return j.path=j.path.split("/").pop(),j}return Promise.all(P.map(_))}async function TO({fs:q,dir:$,gitdir:K,treePair:P}){let _=P[1]==="stage",j=P.map((H)=>typeof H==="string"?HS[H]():H),Y=[],z=await W8({fs:q,cache:{},dir:$,gitdir:K,trees:j,map:async(H,[J,Z])=>{if(H==="."||await r8.isIgnored({fs:q,dir:$,gitdir:K,filepath:H}))return;if(Z){if(!J||await J.oid()!==await Z.oid()&&await Z.oid()!==void 0)Y.push([J,Z]);return{mode:await Z.mode(),path:H,oid:await Z.oid(),type:await Z.type()}}},reduce:async(H,J)=>{if(J=J.filter(Boolean),!H)return J.length>0?J:void 0;else return H.children=J,H},iterate:async(H,J)=>{let Z=[];for(let X of J){let[G,f]=X;if(_){if(f)if(await q.exists(`${$}/${f.toString()}`))Z.push(X);else Y.push([null,f])}else if(G)if(!f)Y.push([G,null]);else Z.push(X)}return Z.length?Promise.all(Z.map(H)):[]}});if(Y.length===0||z.length===0)return null;let T=(await ZS({fs:q,dir:$,gitdir:K,entries:z})).filter(Boolean).map((H)=>({mode:H.mode,path:H.path,oid:H.oid,type:H.type}));return _P({fs:q,gitdir:K,tree:T})}async function FO({fs:q,dir:$,gitdir:K,stashCommit:P,parentCommit:_,wasStaged:j}){let Y=[],w=[],O=await W8({fs:q,cache:{},dir:$,gitdir:K,trees:[q6({ref:_}),q6({ref:P})],map:async(v,[z,W])=>{if(v==="."||await r8.isIgnored({fs:q,dir:$,gitdir:K,filepath:v}))return;let T=W?await W.type():await z.type();if(T!=="tree"&&T!=="blob")return;if(!W&&z){let J=T==="tree"?"rmdir":"rm";if(T==="tree")Y.push(v);if(T==="blob"&&j)w.push({filepath:v,oid:await z.oid()});return{method:J,filepath:v}}let H=await W.oid();if(!z||await z.oid()!==H)if(T==="tree")return{method:"mkdir",filepath:v};else{if(j)w.push({filepath:v,oid:H,stats:await q.lstat(m($,v))});return{method:"write",filepath:v,oid:H}}}});await E$({fs:q,gitdir:K,dirRemoved:Y,ops:O},async()=>{for(let v of O){let z=m($,v.filepath);switch(v.method){case"rmdir":await q.rmdir(z);break;case"mkdir":await q.mkdir(z);break;case"rm":await q.rm(z);break;case"write":if(!Y.some((W)=>z.startsWith(W))){let{object:W}=await Kq({fs:q,cache:{},gitdir:K,oid:v.oid});if(await q.exists(z))await q.rm(z);await q.write(z,W)}break}}}),await Jq.acquire({fs:q,gitdir:K,cache:{}},async(v)=>{w.forEach(({filepath:z,stats:W,oid:T})=>{v.insert({filepath:z,stats:W,oid:T})})})}async function HO({fs:q,cache:$,dir:K,gitdir:P,oid:_,dryRun:j=!1,noUpdateBranch:Y=!1,abortOnConflict:w=!0,committer:O,mergeDriver:v}){let{commit:z,oid:W}=await D6({fs:q,cache:$,gitdir:P,oid:_});if(z.parent.length>1)throw new oK(W,z.parent.length);if(z.parent.length===0)throw new aK(W);let T=await E.resolve({fs:q,gitdir:P,ref:"HEAD"}),{commit:H}=await D6({fs:q,cache:$,gitdir:P,oid:T}),J=z.parent[0],{commit:Z}=await D6({fs:q,cache:$,gitdir:P,oid:J}),X=await Jq.acquire({fs:q,gitdir:P,cache:$,allowUnmerged:!1},async(f)=>{return UO({fs:q,cache:$,dir:K,gitdir:P,index:f,ourOid:H.tree,baseOid:Z.tree,theirOid:z.tree,ourName:"HEAD",baseName:`parent of ${W.slice(0,7)}`,theirName:W.slice(0,7),dryRun:j,abortOnConflict:w,mergeDriver:v})});if(X instanceof o8)throw X;let G=await KP({fs:q,cache:$,gitdir:P,message:z.message,tree:X,parent:[T],author:z.author,committer:O,dryRun:j,noUpdateBranch:Y});if(K&&!j&&!Y)await FO({fs:q,dir:K,gitdir:P,stashCommit:G,parentCommit:T,wasStaged:!0});return G}async function sO({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,cache:_={},committer:j,dryRun:Y=!1,noUpdateBranch:w=!1,abortOnConflict:O=!0,mergeDriver:v}){try{h("fs",q),h("gitdir",K),h("oid",P);let z=new g(q),W=await n({fsp:z,dotgit:K}),{commit:T}=await D6({fs:z,cache:_,gitdir:W,oid:P});if(T.parent&&T.parent.length>1)return await HO({fs:z,cache:_,dir:$,gitdir:W,oid:P,dryRun:Y,noUpdateBranch:w,abortOnConflict:O,committer:void 0,mergeDriver:v});let H=await n8({fs:z,gitdir:W,committer:j});if(!H)throw new bq("committer");return await HO({fs:z,cache:_,dir:$,gitdir:W,oid:P,dryRun:Y,noUpdateBranch:w,abortOnConflict:O,committer:H,mergeDriver:v})}catch(z){throw z.caller="git.cherryPick",z}}var kS=/^refs\/(heads\/|tags\/|remotes\/)?(.*)/;function g8(q){let $=kS.exec(q);if($)if($[1]==="remotes/"&&q.endsWith("/HEAD"))return $[2].slice(0,-5);else return $[2];return q}async function J8({fs:q,gitdir:$,fullname:K=!1,test:P=!1}){let _=await E.resolve({fs:q,gitdir:$,ref:"HEAD",depth:2});if(P)try{await E.resolve({fs:q,gitdir:$,ref:_})}catch(j){return}if(!_.startsWith("refs/"))return;return K?_:g8(_)}function XS(q){return q=q.replace(/^git@([^:]+):/,"https://$1/"),q=q.replace(/^ssh:\/\//,"https://"),q}function QO({username:q="",password:$=""}){return`Basic ${Buffer.from(`${q}:${$}`).toString("base64")}`}async function jP(q,$){let K=RO(q);while(!0){let{value:P,done:_}=await K.next();if(P)await $(P);if(_)break}if(K.return)K.return()}async function E4(q){let $=0,K=[];await jP(q,(j)=>{K.push(j),$+=j.byteLength});let P=new Uint8Array($),_=0;for(let j of K)P.set(j,_),_+=j.byteLength;return P}function JO(q){let $=q.match(/^https?:\/\/([^/]+)@/);if($==null)return{url:q,auth:{}};$=$[1];let[K,P]=$.split(":");return q=q.replace(`${$}@`,""),{url:q,auth:{username:K,password:P}}}function R3(q,$){let K=$.toString(16);return"0".repeat(q-K.length)+K}class vq{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(q){if(typeof q==="string")q=Buffer.from(q);let $=q.length+4,K=R3(4,$);return Buffer.concat([Buffer.from(K,"utf8"),q])}static streamReader(q){let $=new p3(q);return async function(){try{let P=await $.read(4);if(P==null)return!0;if(P=parseInt(P.toString("utf8"),16),P===0)return null;if(P===1)return null;let _=await $.read(P-4);if(_==null)return!0;return _}catch(P){return q.error=P,!0}}}}async function ZO(q){let $={},K;while(!0){if(K=await q(),K===!0)break;if(K===null)continue;K=K.toString("utf8").replace(/\n$/,"");let P=K.indexOf("=");if(P>-1){let _=K.slice(0,P),j=K.slice(P+1);$[_]=j}else $[K]=!0}return{protocolVersion:2,capabilities2:$}}async function kO(q,{service:$}){let K=new Set,P=new Map,_=new Map,j=vq.streamReader(q),Y=await j();while(Y===null)Y=await j();if(Y===!0)throw new iK;if(Y.includes("version 2"))return ZO(j);if(Y.toString("utf8").replace(/\n$/,"")!==`# service=${$}`)throw new a8(`# service=${$}\\n`,Y.toString("utf8"));let w=await j();while(w===null)w=await j();if(w===!0)return{capabilities:K,refs:P,symrefs:_};if(w=w.toString("utf8"),w.includes("version 2"))return ZO(j);let[O,v]=V3(w,"\x00","\\x00");if(v.split(" ").map((z)=>K.add(z)),O!=="0000000000000000000000000000000000000000 capabilities^{}"){let[z,W]=V3(O," "," ");P.set(W,z);while(!0){let T=await j();if(T===!0)break;if(T!==null){let[H,J]=V3(T.toString("utf8")," "," ");P.set(J,H)}}}for(let z of K)if(z.startsWith("symref=")){let W=z.match(/symref=([^:]+):(.*)/);if(W.length===3)_.set(W[1],W[2])}return{protocolVersion:1,capabilities:K,refs:P,symrefs:_}}function V3(q,$,K){let P=q.trim().split($);if(P.length!==2)throw new a8(`Two strings separated by '${K}'`,q.toString("utf8"));return P}var XO=(q,$)=>q.endsWith("?")?`${q}${$}`:`${q}/${$.replace(/^https?:\/\//,"")}`,fO=(q,$)=>{if($.username||$.password)q.Authorization=QO($);if($.headers)Object.assign(q,$.headers)},M3=async(q)=>{try{let $=Buffer.from(await E4(q.body)),K=$.toString("utf8");return{preview:K.length<256?K:K.slice(0,256)+"...",response:K,data:$}}catch($){return{}}};class gK{static async capabilities(){return["discover","connect"]}static async discover({http:q,onProgress:$,onAuth:K,onAuthSuccess:P,onAuthFailure:_,corsProxy:j,service:Y,url:w,headers:O,protocolVersion:v}){let{url:z,auth:W}=JO(w),T=j?XO(j,z):z;if(W.username||W.password)O.Authorization=QO(W);if(v===2)O["Git-Protocol"]="version=2";let H,J,Z=!1;do if(H=await q.request({onProgress:$,method:"GET",url:`${T}/info/refs?service=${Y}`,headers:O}),J=!1,H.statusCode===401||H.statusCode===203){let X=Z?_:K;if(X){if(W=await X(z,{...W,headers:{...O}}),W&&W.cancel)throw new d$;else if(W)fO(O,W),Z=!0,J=!0}}else if(H.statusCode===200&&Z&&P)await P(z,W);while(J);if(H.statusCode!==200){let{response:X}=await M3(H);throw new R$(H.statusCode,H.statusMessage,X)}if(H.headers["content-type"]===`application/x-${Y}-advertisement`){let X=await kO(H.body,{service:Y});return X.auth=W,X}else{let{preview:X,response:G,data:f}=await M3(H);try{let N=await kO([f],{service:Y});return N.auth=W,N}catch(N){throw new FK(X,G)}}}static async connect({http:q,onProgress:$,corsProxy:K,service:P,url:_,auth:j,body:Y,headers:w}){let O=JO(_);if(O)_=O.url;if(K)_=XO(K,_);w["content-type"]=`application/x-${P}-request`,w.accept=`application/x-${P}-result`,fO(w,j);let v=await q.request({onProgress:$,method:"POST",url:`${_}/${P}`,body:Y,headers:w});if(v.statusCode!==200){let{response:z}=M3(v);throw new R$(v.statusCode,v.statusMessage,z)}return v}}class YP{static getRemoteHelperFor({url:q}){let $=new Map;$.set("http",gK),$.set("https",gK);let K=fS({url:q});if(!K)throw new QK(q);if($.has(K.transport))return $.get(K.transport);throw new sK(q,K.transport,K.transport==="ssh"?XS(q):void 0)}}function fS({url:q}){if(q.startsWith("git@"))return{transport:"ssh",address:q};let $=q.match(/(\w+)(:\/\/|::)(.*)/);if($===null)return;if($[2]==="://")return{transport:$[1],address:$[0]};if($[2]==="::")return{transport:$[1],address:$[3]}}var d8=null;class p${static async read({fs:q,gitdir:$}){if(d8===null)d8=new DK;let K=m($,"shallow"),P=new Set;return await d8.acquire(K,async function(){let _=await q.read(K,{encoding:"utf8"});if(_===null)return P;if(_.trim()==="")return P;_.trim().split(`
|
|
147
|
+
`).map((j)=>P.add(j))}),P}static async write({fs:q,gitdir:$,oids:K}){if(d8===null)d8=new DK;let P=m($,"shallow");if(K.size>0){let _=[...K].join(`
|
|
148
|
+
`)+`
|
|
149
|
+
`;await d8.acquire(P,async function(){await q.write(P,_,{encoding:"utf8"})})}else await d8.acquire(P,async function(){await q.rm(P)})}}async function AS({fs:q,gitdir:$,oid:K}){let P=`objects/${K.slice(0,2)}/${K.slice(2)}`;return q.exists(`${$}/${P}`)}async function GS({fs:q,cache:$,gitdir:K,oid:P,getExternalRefDelta:_}){let j=await q.readdir(m(K,"objects/pack"));j=j.filter((Y)=>Y.endsWith(".idx"));for(let Y of j){let w=`${K}/objects/pack/${Y}`,O=await D3({fs:q,cache:$,filename:w,getExternalRefDelta:_});if(O.error)throw new o(O.error);if(O.offsets.has(P))return!0}return!1}async function AO({fs:q,cache:$,gitdir:K,oid:P,format:_="content"}){let j=(w)=>Kq({fs:q,cache:$,gitdir:K,oid:w}),Y=await AS({fs:q,gitdir:K,oid:P});if(!Y)Y=await GS({fs:q,cache:$,gitdir:K,oid:P,getExternalRefDelta:j});return Y}function hS(q){let _="5041434b0000000200000000";return q.slice(0,12).toString("hex")===_}function qz(q,$){let K=q.map((P)=>P.split("=",1)[0]);return $.filter((P)=>{let _=P.split("=",1)[0];return K.includes(_)})}var d4={name:"isomorphic-git",version:"1.37.4",agent:"git/isomorphic-git@1.37.4"};class pK{constructor(){this._queue=[]}write(q){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let $=this._waiting;this._waiting=null,$({value:q})}else this._queue.push(q)}end(){if(this._ended=!0,this._waiting){let q=this._waiting;this._waiting=null,q({done:!0})}}destroy(q){this.error=q,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((q)=>{this._waiting=q})}}function VS(q){let $=q.indexOf("\r"),K=q.indexOf(`
|
|
150
|
+
`);if($===-1&&K===-1)return-1;if($===-1)return K+1;if(K===-1)return $+1;if(K===$+1)return K+1;return Math.min($,K)+1}function $z(q){let $=new pK,K="";return(async()=>{if(await jP(q,(P)=>{P=P.toString("utf8"),K+=P;while(!0){let _=VS(K);if(_===-1)break;$.write(K.slice(0,_)),K=K.slice(_)}}),K.length>0)$.write(K);$.end()})(),$}class L3{static demux(q){let $=vq.streamReader(q),K=new pK,P=new pK,_=new pK,j=async function(){let Y=await $();if(Y===null)return j();if(Y===!0){K.end(),_.end(),q.error?P.destroy(q.error):P.end();return}switch(Y[0]){case 1:{P.write(Y.slice(1));break}case 2:{_.write(Y.slice(1));break}case 3:{let w=Y.slice(1);_.write(w),K.end(),_.end(),P.destroy(Error(w.toString("utf8")));return}default:K.write(Y)}j()};return j(),{packetlines:K,packfile:P,progress:_}}}async function MS(q){let{packetlines:$,packfile:K,progress:P}=L3.demux(q),_=[],j=[],Y=[],w=!1,O=!1;return new Promise((v,z)=>{jP($,(W)=>{let T=W.toString("utf8").trim();if(T.startsWith("shallow")){let H=T.slice(-41).trim();if(H.length!==40)z(new O8(H));_.push(H)}else if(T.startsWith("unshallow")){let H=T.slice(-41).trim();if(H.length!==40)z(new O8(H));j.push(H)}else if(T.startsWith("ACK")){let[,H,J]=T.split(" ");if(Y.push({oid:H,status:J}),!J)O=!0}else if(T.startsWith("NAK"))w=!0,O=!0;else O=!0,w=!0;if(O)q.error?z(q.error):v({shallows:_,unshallows:j,acks:Y,nak:w,packfile:K,progress:P})}).finally(()=>{if(!O)q.error?z(q.error):v({shallows:_,unshallows:j,acks:Y,nak:w,packfile:K,progress:P})})})}function CS({capabilities:q=[],wants:$=[],haves:K=[],shallows:P=[],depth:_=null,since:j=null,exclude:Y=[]}){let w=[];$=[...new Set($)];let O=` ${q.join(" ")}`;for(let v of $)w.push(vq.encode(`want ${v}${O}
|
|
151
|
+
`)),O="";for(let v of P)w.push(vq.encode(`shallow ${v}
|
|
152
|
+
`));if(_!==null)w.push(vq.encode(`deepen ${_}
|
|
153
|
+
`));if(j!==null)w.push(vq.encode(`deepen-since ${Math.floor(j.valueOf()/1000)}
|
|
154
|
+
`));for(let v of Y)w.push(vq.encode(`deepen-not ${v}
|
|
155
|
+
`));w.push(vq.flush());for(let v of K)w.push(vq.encode(`have ${v}
|
|
156
|
+
`));return w.push(vq.encode(`done
|
|
157
|
+
`)),w}async function g3({fs:q,cache:$,http:K,onProgress:P,onMessage:_,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,gitdir:O,ref:v,remoteRef:z,remote:W,url:T,corsProxy:H,depth:J=null,since:Z=null,exclude:X=[],relative:G=!1,tags:f=!1,singleBranch:N=!1,headers:V={},prune:C=!1,pruneTags:b=!1}){let k=v||await J8({fs:q,gitdir:O,test:!0}),M=await Zq.get({fs:q,gitdir:O}),A=W||k&&await M.get(`branch.${k}.remote`)||"origin",u=T||await M.get(`remote.${A}.url`);if(typeof u>"u")throw new oq("remote OR url");let S=z||k&&await M.get(`branch.${k}.merge`)||v||"HEAD";if(H===void 0)H=await M.get("http.corsProxy");let p=YP.getRemoteHelperFor({url:u}),L=await p.discover({http:K,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,corsProxy:H,service:"git-upload-pack",url:u,headers:V,protocolVersion:1}),c=L.auth,d=L.refs;if(d.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(J!==null&&!L.capabilities.has("shallow"))throw new v8("shallow","depth");if(Z!==null&&!L.capabilities.has("deepen-since"))throw new v8("deepen-since","since");if(X.length>0&&!L.capabilities.has("deepen-not"))throw new v8("deepen-not","exclude");if(G===!0&&!L.capabilities.has("deepen-relative"))throw new v8("deepen-relative","relative");let{oid:Q,fullref:Vq}=E.resolveAgainstMap({ref:S,map:d});for(let I of d.keys()){if(I===Vq||I==="HEAD"||I.startsWith("refs/heads/")||f&&I.startsWith("refs/tags/"))continue;d.delete(I)}let Rq=qz([...L.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${d4.agent}`]);if(G)Rq.push("deepen-relative");let _K=N?[Q]:d.values(),jK=N?[k]:await E.listRefs({fs:q,gitdir:O,filepath:"refs"}),Eq=[];for(let I of jK)try{I=await E.expand({fs:q,gitdir:O,ref:I});let y=await E.resolve({fs:q,gitdir:O,ref:I});if(await AO({fs:q,cache:$,gitdir:O,oid:y}))Eq.push(y)}catch(y){}Eq=[...new Set(Eq)];let $q=await p$.read({fs:q,gitdir:O}),j6=L.capabilities.has("shallow")?[...$q]:[],Mq=CS({capabilities:Rq,wants:_K,haves:Eq,shallows:j6,depth:J,since:Z,exclude:X}),A8=Buffer.from(await E4(Mq)),x6=await p.connect({http:K,onProgress:P,corsProxy:H,service:"git-upload-pack",url:u,auth:c,body:[A8],headers:V}),Wq=await MS(x6.body);if(x6.headers)Wq.headers=x6.headers;for(let I of Wq.shallows)if(!$q.has(I))try{let{object:y}=await Kq({fs:q,cache:$,gitdir:O,oid:I}),t=new Yq(y),_q=await Promise.all(t.headers().parent.map((n6)=>AO({fs:q,cache:$,gitdir:O,oid:n6})));if(!(_q.length===0||_q.every((n6)=>n6)))$q.add(I)}catch(y){$q.add(I)}for(let I of Wq.unshallows)$q.delete(I);if(await p$.write({fs:q,gitdir:O,oids:$q}),N){let I=new Map([[Vq,Q]]),y=new Map,t=10,_q=Vq;while(t--){let V7=L.symrefs.get(_q);if(V7===void 0)break;y.set(_q,V7),_q=V7}let pq=d.get(_q);if(pq)I.set(_q,pq);let{pruned:n6}=await E.updateRemoteRefs({fs:q,gitdir:O,remote:A,refs:I,symrefs:y,tags:f,prune:C});if(C)Wq.pruned=n6}else{let{pruned:I}=await E.updateRemoteRefs({fs:q,gitdir:O,remote:A,refs:d,symrefs:L.symrefs,tags:f,prune:C,pruneTags:b});if(C)Wq.pruned=I}if(Wq.HEAD=L.symrefs.get("HEAD"),Wq.HEAD===void 0){let{oid:I}=E.resolveAgainstMap({ref:"HEAD",map:d});for(let[y,t]of d.entries())if(y!=="HEAD"&&t===I){Wq.HEAD=y;break}}let h7=Vq.startsWith("refs/tags")?"tag":"branch";if(Wq.FETCH_HEAD={oid:Q,description:`${h7} '${g8(Vq)}' of ${u}`},P||_){let I=$z(Wq.progress);jP(I,async(y)=>{if(_)await _(y);if(P){let t=y.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);if(t)await P({phase:t[1].trim(),loaded:parseInt(t[2],10),total:parseInt(t[3],10)})}})}let K$=Buffer.from(await E4(Wq.packfile));if(x6.body.error)throw x6.body.error;let Bq=K$.slice(-20).toString("hex"),l={defaultBranch:Wq.HEAD,fetchHead:Wq.FETCH_HEAD.oid,fetchHeadDescription:Wq.FETCH_HEAD.description};if(Wq.headers)l.headers=Wq.headers;if(C)l.pruned=Wq.pruned;if(Bq!==""&&!hS(K$)){l.packfile=`objects/pack/pack-${Bq}.pack`;let I=m(O,l.packfile);await q.write(I,K$);let y=(_q)=>Kq({fs:q,cache:$,gitdir:O,oid:_q}),t=await u$.fromPack({pack:K$,getExternalRefDelta:y,onProgress:P});await q.write(I.replace(/\.pack$/,".idx"),await t.toBuffer())}return l}async function Kz({fs:q,bare:$=!1,dir:K,gitdir:P=$?K:m(K,".git"),defaultBranch:_="master"}){if(await q.exists(P+"/config"))return;let j=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];j=j.map((Y)=>P+"/"+Y);for(let Y of j)await q.mkdir(Y);await q.write(P+"/config",`[core]
|
|
158
|
+
repositoryformatversion = 0
|
|
159
|
+
filemode = false
|
|
160
|
+
bare = ${$}
|
|
161
|
+
`+($?"":` logallrefupdates = true
|
|
162
|
+
`)+` symlinks = false
|
|
163
|
+
ignorecase = true
|
|
164
|
+
`),await q.write(P+"/HEAD",`ref: refs/heads/${_}
|
|
165
|
+
`)}async function NS({fs:q,cache:$,http:K,onProgress:P,onMessage:_,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,onPostCheckout:O,dir:v,gitdir:z,url:W,corsProxy:T,ref:H,remote:J,depth:Z,since:X,exclude:G,relative:f,singleBranch:N,noCheckout:V,noTags:C,headers:b,nonBlocking:k,batchSize:M=100}){try{if(await Kz({fs:q,gitdir:z}),await rO({fs:q,gitdir:z,remote:J,url:W,force:!1}),T){let S=await Zq.get({fs:q,gitdir:z});await S.set("http.corsProxy",T),await Zq.save({fs:q,gitdir:z,config:S})}let{defaultBranch:A,fetchHead:u}=await g3({fs:q,cache:$,http:K,onProgress:P,onMessage:_,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,gitdir:z,ref:H,remote:J,corsProxy:T,depth:Z,since:X,exclude:G,relative:f,singleBranch:N,headers:b,tags:!C});if(u===null)return;H=H||A,H=H.replace("refs/heads/",""),await y3({fs:q,cache:$,onProgress:P,onPostCheckout:O,dir:v,gitdir:z,ref:H,remote:J,noCheckout:V,nonBlocking:k,batchSize:M})}catch(A){throw await q.rmdir(z,{recursive:!0,maxRetries:10}).catch(()=>{return}),A}}async function Pz({fs:q,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,onPostCheckout:w,dir:O,gitdir:v=m(O,".git"),url:z,corsProxy:W=void 0,ref:T=void 0,remote:H="origin",depth:J=void 0,since:Z=void 0,exclude:X=[],relative:G=!1,singleBranch:f=!1,noCheckout:N=!1,noTags:V=!1,headers:C={},cache:b={},nonBlocking:k=!1,batchSize:M=100}){try{if(h("fs",q),h("http",$),h("gitdir",v),!N)h("dir",O);h("url",z);let A=new g(q),u=await n({fsp:A,dotgit:v});return await NS({fs:A,cache:b,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,onPostCheckout:w,dir:O,gitdir:u,url:z,corsProxy:W,ref:T,remote:H,depth:J,since:Z,exclude:X,relative:G,singleBranch:f,noCheckout:N,noTags:V,headers:C,nonBlocking:k,batchSize:M})}catch(A){throw A.caller="git.clone",A}}async function _z({fs:q,onSign:$,dir:K,gitdir:P=m(K,".git"),message:_,author:j,committer:Y,signingKey:w,amend:O=!1,dryRun:v=!1,noUpdateBranch:z=!1,ref:W,parent:T,tree:H,cache:J={}}){try{if(h("fs",q),!O)h("message",_);if(w)h("onSign",$);let Z=new g(q),X=await n({fsp:Z,dotgit:P});return await KP({fs:Z,cache:J,onSign:$,gitdir:X,message:_,author:j,committer:Y,signingKey:w,amend:O,dryRun:v,noUpdateBranch:z,ref:W,parent:T,tree:H})}catch(Z){throw Z.caller="git.commit",Z}}async function jz({fs:q,dir:$,gitdir:K=m($,".git"),fullname:P=!1,test:_=!1}){try{h("fs",q),h("gitdir",K);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await J8({fs:j,gitdir:Y,fullname:P,test:_})}catch(j){throw j.caller="git.currentBranch",j}}async function SS({fs:q,gitdir:$,ref:K}){if(K=K.startsWith("refs/heads/")?K:`refs/heads/${K}`,!await E.exists({fs:q,gitdir:$,ref:K}))throw new s(K);let _=await E.expand({fs:q,gitdir:$,ref:K}),j=await J8({fs:q,gitdir:$,fullname:!0});if(_===j){let O=await E.resolve({fs:q,gitdir:$,ref:_});await E.writeRef({fs:q,gitdir:$,ref:"HEAD",value:O})}await E.deleteRef({fs:q,gitdir:$,ref:_});let Y=g8(K),w=await Zq.get({fs:q,gitdir:$});await w.deleteSection("branch",Y),await Zq.save({fs:q,gitdir:$,config:w})}async function Yz({fs:q,dir:$,gitdir:K=m($,".git"),ref:P}){try{h("fs",q),h("ref",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await SS({fs:_,gitdir:j,ref:P})}catch(_){throw _.caller="git.deleteBranch",_}}async function wz({fs:q,dir:$,gitdir:K=m($,".git"),ref:P}){try{h("fs",q),h("ref",P);let _=new g(q),j=await n({fsp:_,dotgit:K});await E.deleteRef({fs:_,gitdir:j,ref:P})}catch(_){throw _.caller="git.deleteRef",_}}async function bS({fs:q,gitdir:$,remote:K}){let P=await Zq.get({fs:q,gitdir:$});await P.deleteSection("remote",K),await Zq.save({fs:q,gitdir:$,config:P})}async function vz({fs:q,dir:$,gitdir:K=m($,".git"),remote:P}){try{h("fs",q),h("remote",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await bS({fs:_,gitdir:j,remote:P})}catch(_){throw _.caller="git.deleteRemote",_}}async function uS({fs:q,gitdir:$,ref:K}){K=K.startsWith("refs/tags/")?K:`refs/tags/${K}`,await E.deleteRef({fs:q,gitdir:$,ref:K})}async function Oz({fs:q,dir:$,gitdir:K=m($,".git"),ref:P}){try{h("fs",q),h("ref",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await uS({fs:_,gitdir:j,ref:P})}catch(_){throw _.caller="git.deleteTag",_}}async function RS({fs:q,gitdir:$,oid:K}){let P=K.slice(0,2);return(await q.readdir(`${$}/objects/${P}`)).map((j)=>`${P}${j}`).filter((j)=>j.startsWith(K))}async function mS({fs:q,cache:$,gitdir:K,oid:P,getExternalRefDelta:_}){let j=[],Y=await q.readdir(m(K,"objects/pack"));Y=Y.filter((w)=>w.endsWith(".idx"));for(let w of Y){let O=`${K}/objects/pack/${w}`,v=await D3({fs:q,cache:$,filename:O,getExternalRefDelta:_});if(v.error)throw new o(v.error);for(let z of v.offsets.keys())if(z.startsWith(P))j.push(z)}return j}async function IS({fs:q,cache:$,gitdir:K,oid:P}){let _=(w)=>Kq({fs:q,cache:$,gitdir:K,oid:w}),j=await RS({fs:q,gitdir:K,oid:P}),Y=await mS({fs:q,cache:$,gitdir:K,oid:P,getExternalRefDelta:_});for(let w of Y)if(j.indexOf(w)===-1)j.push(w);if(j.length===1)return j[0];if(j.length>1)throw new cK("oids",P,j);throw new s(`an object matching "${P}"`)}async function zz({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,cache:_={}}){try{h("fs",q),h("gitdir",K),h("oid",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await IS({fs:j,cache:_,gitdir:Y,oid:P})}catch(j){throw j.caller="git.expandOid",j}}async function Wz({fs:q,dir:$,gitdir:K=m($,".git"),ref:P}){try{h("fs",q),h("gitdir",K),h("ref",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await E.expand({fs:_,gitdir:j,ref:P})}catch(_){throw _.caller="git.expandRef",_}}async function x3({fs:q,cache:$,gitdir:K,oids:P}){let _={},j=P.length,Y=P.map((w,O)=>({index:O,oid:w}));while(Y.length){let w=new Set;for(let{oid:v,index:z}of Y){if(!_[v])_[v]=new Set;if(_[v].add(z),_[v].size===j)w.add(v)}if(w.size>0)return[...w];let O=new Map;for(let{oid:v,index:z}of Y)try{let{object:W}=await Kq({fs:q,cache:$,gitdir:K,oid:v}),T=Yq.from(W),{parent:H}=T.parseHeaders();for(let J of H)if(!_[J]||!_[J].has(z))O.set(J+":"+z,{oid:J,index:z})}catch(W){}Y=Array.from(O.values())}return[]}async function Tz({fs:q,cache:$,dir:K,gitdir:P,ours:_,theirs:j,fastForward:Y=!0,fastForwardOnly:w=!1,dryRun:O=!1,noUpdateBranch:v=!1,abortOnConflict:z=!0,message:W,author:T,committer:H,signingKey:J,onSign:Z,mergeDriver:X,allowUnrelatedHistories:G=!1}){if(_===void 0)_=await J8({fs:q,gitdir:P,fullname:!0});_=await E.expand({fs:q,gitdir:P,ref:_}),j=await E.expand({fs:q,gitdir:P,ref:j});let f=await E.resolve({fs:q,gitdir:P,ref:_}),N=await E.resolve({fs:q,gitdir:P,ref:j}),V=await x3({fs:q,cache:$,gitdir:P,oids:[f,N]});if(V.length!==1)if(V.length===0&&G)V.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new y$;let C=V[0];if(C===N)return{oid:f,alreadyMerged:!0};if(Y&&C===f){if(!O&&!v)await E.writeRef({fs:q,gitdir:P,ref:_,value:N});return{oid:N,fastForward:!0}}else{if(w)throw new tK;let b=await Jq.acquire({fs:q,gitdir:P,cache:$,allowUnmerged:!1},async(M)=>{return UO({fs:q,cache:$,dir:K,gitdir:P,index:M,ourOid:f,theirOid:N,baseOid:C,ourName:g8(_),baseName:"base",theirName:g8(j),dryRun:O,abortOnConflict:z,mergeDriver:X})});if(b instanceof o8)throw b;if(!W)W=`Merge branch '${g8(j)}' into ${g8(_)}`;return{oid:await KP({fs:q,cache:$,gitdir:P,message:W,ref:_,tree:b,parent:[f,N],author:T,committer:H,signingKey:J,onSign:Z,dryRun:O,noUpdateBranch:v}),tree:b,mergeCommit:!0}}}async function Hz({fs:q,cache:$,http:K,onProgress:P,onMessage:_,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,dir:O,gitdir:v,ref:z,url:W,remote:T,remoteRef:H,prune:J,pruneTags:Z,fastForward:X,fastForwardOnly:G,corsProxy:f,singleBranch:N,headers:V,author:C,committer:b,signingKey:k}){try{if(!z){let u=await J8({fs:q,gitdir:v});if(!u)throw new oq("ref");z=u}let{fetchHead:M,fetchHeadDescription:A}=await g3({fs:q,cache:$,http:K,onProgress:P,onMessage:_,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,gitdir:v,corsProxy:f,ref:z,url:W,remote:T,remoteRef:H,singleBranch:N,headers:V,prune:J,pruneTags:Z});await Tz({fs:q,cache:$,gitdir:v,ours:z,theirs:M,fastForward:X,fastForwardOnly:G,message:`Merge ${A}`,author:C,committer:b,signingKey:k,dryRun:!1,noUpdateBranch:!1}),await y3({fs:q,cache:$,onProgress:P,dir:O,gitdir:v,ref:z,remote:T,noCheckout:!1})}catch(M){throw M.caller="git.pull",M}}async function Jz({fs:q,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,dir:w,gitdir:O=m(w,".git"),ref:v,url:z,remote:W,remoteRef:T,corsProxy:H,singleBranch:J,headers:Z={},cache:X={}}){try{h("fs",q),h("http",$),h("gitdir",O);let G={name:"",email:"",timestamp:Date.now(),timezoneOffset:0},f=new g(q),N=await n({fsp:f,dotgit:O});return await Hz({fs:f,cache:X,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,dir:w,gitdir:N,ref:v,url:z,remote:W,remoteRef:T,fastForwardOnly:!0,corsProxy:H,singleBranch:J,headers:Z,author:G,committer:G})}catch(G){throw G.caller="git.fastForward",G}}async function Zz({fs:q,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,dir:w,gitdir:O=m(w,".git"),ref:v,remote:z,remoteRef:W,url:T,corsProxy:H,depth:J=null,since:Z=null,exclude:X=[],relative:G=!1,tags:f=!1,singleBranch:N=!1,headers:V={},prune:C=!1,pruneTags:b=!1,cache:k={}}){try{h("fs",q),h("http",$),h("gitdir",O);let M=new g(q),A=await n({fsp:M,dotgit:O});return await g3({fs:M,cache:k,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,gitdir:A,ref:v,remote:z,remoteRef:W,url:T,corsProxy:H,depth:J,since:Z,exclude:X,relative:G,tags:f,singleBranch:N,headers:V,prune:C,pruneTags:b})}catch(M){throw M.caller="git.fetch",M}}async function kz({fs:q,dir:$,gitdir:K=m($,".git"),oids:P,cache:_={}}){try{h("fs",q),h("gitdir",K),h("oids",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await x3({fs:j,cache:_,gitdir:Y,oids:P})}catch(j){throw j.caller="git.findMergeBase",j}}async function Xz({fs:q,filepath:$}){if(await q.exists(m($,".git")))return $;else{let K=x8($);if(K===$)throw new s(`git root for ${$}`);return Xz({fs:q,filepath:K})}}async function fz({fs:q,filepath:$}){try{return h("fs",q),h("filepath",$),await Xz({fs:new g(q),filepath:$})}catch(K){throw K.caller="git.findRoot",K}}async function Az({fs:q,dir:$,gitdir:K=m($,".git"),path:P}){try{h("fs",q),h("gitdir",K),h("path",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await dK({fs:_,gitdir:j,path:P})}catch(_){throw _.caller="git.getConfig",_}}async function ES({fs:q,gitdir:$,path:K}){return(await Zq.get({fs:q,gitdir:$})).getall(K)}async function Gz({fs:q,dir:$,gitdir:K=m($,".git"),path:P}){try{h("fs",q),h("gitdir",K),h("path",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await ES({fs:_,gitdir:j,path:P})}catch(_){throw _.caller="git.getConfigAll",_}}async function hz({http:q,onAuth:$,onAuthSuccess:K,onAuthFailure:P,corsProxy:_,url:j,headers:Y={},forPush:w=!1}){try{h("http",q),h("url",j);let v=await YP.getRemoteHelperFor({url:j}).discover({http:q,onAuth:$,onAuthSuccess:K,onAuthFailure:P,corsProxy:_,service:w?"git-receive-pack":"git-upload-pack",url:j,headers:Y,protocolVersion:1}),z={capabilities:[...v.capabilities]};for(let[W,T]of v.refs){let H=W.split("/"),J=H.pop(),Z=z;for(let X of H)Z[X]=Z[X]||{},Z=Z[X];Z[J]=T}for(let[W,T]of v.symrefs){let H=W.split("/"),J=H.pop(),Z=z;for(let X of H)Z[X]=Z[X]||{},Z=Z[X];Z[J]=T}return z}catch(O){throw O.caller="git.getRemoteInfo",O}}function Vz(q,$,K,P){let _=[];for(let[j,Y]of q.refs){if($&&!j.startsWith($))continue;if(j.endsWith("^{}")){if(P){let O=j.replace("^{}",""),v=_[_.length-1],z=v.ref===O?v:_.find((W)=>W.ref===O);if(z===void 0)throw Error("I did not expect this to happen");z.peeled=Y}continue}let w={ref:j,oid:Y};if(K){if(q.symrefs.has(j))w.target=q.symrefs.get(j)}_.push(w)}return _}async function Mz({http:q,onAuth:$,onAuthSuccess:K,onAuthFailure:P,corsProxy:_,url:j,headers:Y={},forPush:w=!1,protocolVersion:O=2}){try{h("http",q),h("url",j);let z=await YP.getRemoteHelperFor({url:j}).discover({http:q,onAuth:$,onAuthSuccess:K,onAuthFailure:P,corsProxy:_,service:w?"git-receive-pack":"git-upload-pack",url:j,headers:Y,protocolVersion:O});if(z.protocolVersion===2)return{protocolVersion:z.protocolVersion,capabilities:z.capabilities2};let W={};for(let T of z.capabilities){let[H,J]=T.split("=");if(J)W[H]=J;else W[H]=!0}return{protocolVersion:1,capabilities:W,refs:Vz(z,void 0,!0,!0)}}catch(v){throw v.caller="git.getRemoteInfo2",v}}async function pS({type:q,object:$,format:K="content",oid:P=void 0}){if(K!=="deflated"){if(K!=="wrapped")$=l8.wrap({type:q,object:$});P=await y6($)}return{oid:P,object:$}}async function Cz({object:q}){try{if(h("object",q),typeof q==="string")q=Buffer.from(q,"utf8");else if(!(q instanceof Uint8Array))q=new Uint8Array(q);let $="blob",{oid:K,object:P}=await pS({type:$,format:"content",object:q});return{oid:K,type:$,object:P,format:"wrapped"}}catch($){throw $.caller="git.hashBlob",$}}async function DS({fs:q,cache:$,onProgress:K,dir:P,gitdir:_,filepath:j}){try{j=m(P,j);let Y=await q.read(j),w=(v)=>Kq({fs:q,cache:$,gitdir:_,oid:v}),O=await u$.fromPack({pack:Y,getExternalRefDelta:w,onProgress:K});return await q.write(j.replace(/\.pack$/,".idx"),await O.toBuffer()),{oids:[...O.hashes]}}catch(Y){throw Y.caller="git.indexPack",Y}}async function Nz({fs:q,onProgress:$,dir:K,gitdir:P=m(K,".git"),filepath:_,cache:j={}}){try{h("fs",q),h("dir",K),h("gitdir",K),h("filepath",_);let Y=new g(q),w=await n({fsp:Y,dotgit:P});return await DS({fs:Y,cache:j,onProgress:$,dir:K,gitdir:w,filepath:_})}catch(Y){throw Y.caller="git.indexPack",Y}}async function Sz({fs:q,bare:$=!1,dir:K,gitdir:P=$?K:m(K,".git"),defaultBranch:_="master"}){try{if(h("fs",q),h("gitdir",P),!$)h("dir",K);let j=new g(q),Y=await n({fsp:j,dotgit:P});return await Kz({fs:j,bare:$,dir:K,gitdir:Y,defaultBranch:_})}catch(j){throw j.caller="git.init",j}}async function bz({fs:q,cache:$,gitdir:K,oid:P,ancestor:_,depth:j}){let Y=await p$.read({fs:q,gitdir:K});if(!P)throw new oq("oid");if(!_)throw new oq("ancestor");if(P===_)return!1;let w=[P],O=new Set,v=0;while(w.length){if(v++===j)throw new eK(j);let z=w.shift(),{type:W,object:T}=await Kq({fs:q,cache:$,gitdir:K,oid:z});if(W!=="commit")throw new Lq(z,W,"commit");let H=Yq.from(T).parse();for(let J of H.parent)if(J===_)return!0;if(!Y.has(z)){for(let J of H.parent)if(!O.has(J))w.push(J),O.add(J)}}return!1}async function uz({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,ancestor:_,depth:j=-1,cache:Y={}}){try{h("fs",q),h("gitdir",K),h("oid",P),h("ancestor",_);let w=new g(q),O=await n({fsp:w,dotgit:K});return await bz({fs:w,cache:Y,gitdir:O,oid:P,ancestor:_,depth:j})}catch(w){throw w.caller="git.isDescendent",w}}async function Rz({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P}){try{h("fs",q),h("dir",$),h("gitdir",K),h("filepath",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return r8.isIgnored({fs:_,dir:$,gitdir:j,filepath:P})}catch(_){throw _.caller="git.isIgnored",_}}async function mz({fs:q,dir:$,gitdir:K=m($,".git"),remote:P}){try{h("fs",q),h("gitdir",K);let _=new g(q),j=await n({fsp:_,dotgit:K});return E.listBranches({fs:_,gitdir:j,remote:P})}catch(_){throw _.caller="git.listBranches",_}}async function yS({fs:q,gitdir:$,ref:K,cache:P}){if(K){let _=await E.resolve({gitdir:$,fs:q,ref:K}),j=[];return await Iz({fs:q,cache:P,gitdir:$,oid:_,filenames:j,prefix:""}),j}else return Jq.acquire({fs:q,gitdir:$,cache:P},async function(_){return _.entries.map((j)=>j.path)})}async function Iz({fs:q,cache:$,gitdir:K,oid:P,filenames:_,prefix:j}){let{tree:Y}=await g$({fs:q,cache:$,gitdir:K,oid:P});for(let w of Y)if(w.type==="tree")await Iz({fs:q,cache:$,gitdir:K,oid:w.oid,filenames:_,prefix:m(j,w.path)});else _.push(m(j,w.path))}async function Ez({fs:q,dir:$,gitdir:K=m($,".git"),ref:P,cache:_={}}){try{h("fs",q),h("gitdir",K);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await yS({fs:j,cache:_,gitdir:Y,ref:P})}catch(j){throw j.caller="git.listFiles",j}}async function dS({fs:q,cache:$,gitdir:K,ref:P}){let _;try{_=await E.resolve({gitdir:K,fs:q,ref:P})}catch(w){if(w instanceof s)return[]}return(await g$({fs:q,cache:$,gitdir:K,oid:_})).tree.map((w)=>({target:w.path,note:w.oid}))}async function pz({fs:q,dir:$,gitdir:K=m($,".git"),ref:P="refs/notes/commits",cache:_={}}){try{h("fs",q),h("gitdir",K),h("ref",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await dS({fs:j,cache:_,gitdir:Y,ref:P})}catch(j){throw j.caller="git.listNotes",j}}async function Dz({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P}){try{h("fs",q),h("gitdir",K);let _=new g(q),j=await n({fsp:_,dotgit:K});return E.listRefs({fs:_,gitdir:j,filepath:P})}catch(_){throw _.caller="git.listRefs",_}}async function LS({fs:q,gitdir:$}){let K=await Zq.get({fs:q,gitdir:$}),P=await K.getSubsections("remote");return Promise.all(P.map(async(j)=>{let Y=await K.get(`remote.${j}.url`);return{remote:j,url:Y}}))}async function yz({fs:q,dir:$,gitdir:K=m($,".git")}){try{h("fs",q),h("gitdir",K);let P=new g(q),_=await n({fsp:P,dotgit:K});return await LS({fs:P,gitdir:_})}catch(P){throw P.caller="git.listRemotes",P}}async function gS(q){let $=vq.streamReader(q),K=[],P;while(!0){if(P=await $(),P===!0)break;if(P===null)continue;P=P.toString("utf8").replace(/\n$/,"");let[_,j,...Y]=P.split(" "),w={ref:j,oid:_};for(let O of Y){let[v,z]=O.split(":");if(v==="symref-target")w.target=z;else if(v==="peeled")w.peeled=z}K.push(w)}return K}async function xS({prefix:q,symrefs:$,peelTags:K}){let P=[];if(P.push(vq.encode(`command=ls-refs
|
|
166
|
+
`)),P.push(vq.encode(`agent=${d4.agent}
|
|
167
|
+
`)),K||$||q)P.push(vq.delim());if(K)P.push(vq.encode("peel"));if($)P.push(vq.encode("symrefs"));if(q)P.push(vq.encode(`ref-prefix ${q}`));return P.push(vq.flush()),P}async function dz({http:q,onAuth:$,onAuthSuccess:K,onAuthFailure:P,corsProxy:_,url:j,headers:Y={},forPush:w=!1,protocolVersion:O=2,prefix:v,symrefs:z,peelTags:W}){try{h("http",q),h("url",j);let T=await gK.discover({http:q,onAuth:$,onAuthSuccess:K,onAuthFailure:P,corsProxy:_,service:w?"git-receive-pack":"git-upload-pack",url:j,headers:Y,protocolVersion:O});if(T.protocolVersion===1)return Vz(T,v,z,W);let H=await xS({prefix:v,symrefs:z,peelTags:W}),J=await gK.connect({http:q,auth:T.auth,headers:Y,corsProxy:_,service:w?"git-receive-pack":"git-upload-pack",url:j,body:H});return gS(J.body)}catch(T){throw T.caller="git.listServerRefs",T}}async function Lz({fs:q,dir:$,gitdir:K=m($,".git")}){try{h("fs",q),h("gitdir",K);let P=new g(q),_=await n({fsp:P,dotgit:K});return E.listTags({fs:P,gitdir:_})}catch(P){throw P.caller="git.listTags",P}}function nS(q,$){return q.committer.timestamp-$.committer.timestamp}var cS="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function GO({fs:q,cache:$,gitdir:K,oid:P,fileId:_}){if(_===cS)return;let j=P,Y,w=await I$({fs:q,cache:$,gitdir:K,oid:P}),O=w.tree;if(_===w.oid)Y=w.path;else if(Y=await gz({fs:q,cache:$,gitdir:K,tree:O,fileId:_,oid:j}),Array.isArray(Y)){if(Y.length===0)Y=void 0;else if(Y.length===1)Y=Y[0]}return Y}async function gz({fs:q,cache:$,gitdir:K,tree:P,fileId:_,oid:j,filepaths:Y=[],parentPath:w=""}){let O=P.entries().map(function(v){let z;if(v.oid===_)z=m(w,v.path),Y.push(z);else if(v.type==="tree")z=Kq({fs:q,cache:$,gitdir:K,oid:v.oid}).then(function({object:W}){return gz({fs:q,cache:$,gitdir:K,tree:aq.from(W),fileId:_,oid:j,filepaths:Y,parentPath:m(w,v.path)})});return z});return await Promise.all(O),Y}async function lS({fs:q,cache:$,gitdir:K,filepath:P,ref:_,depth:j,since:Y,force:w,follow:O}){let v=typeof Y>"u"?void 0:Math.floor(Y.valueOf()/1000),z=[],W=await p$.read({fs:q,gitdir:K}),T=await E.resolve({fs:q,gitdir:K,ref:_}),H=[await D6({fs:q,cache:$,gitdir:K,oid:T})],J,Z,X;function G(f){if(X&&P)z.push(f)}while(H.length>0){let f=H.pop();if(v!==void 0&&f.commit.committer.timestamp<=v)break;if(P){let N;try{if(N=await PP({fs:q,cache:$,gitdir:K,oid:f.commit.tree,filepath:P}),Z&&J!==N)z.push(Z);J=N,Z=f,X=!0}catch(V){if(V instanceof s){let C=O&&J;if(C){if(C=await GO({fs:q,cache:$,gitdir:K,oid:f.commit.tree,fileId:J}),C){if(Array.isArray(C)){if(Z){let b=await GO({fs:q,cache:$,gitdir:K,oid:Z.commit.tree,fileId:J});if(Array.isArray(b))if(C=C.filter((k)=>b.indexOf(k)===-1),C.length===1){if(C=C[0],P=C,Z)z.push(Z)}else{if(C=!1,Z)z.push(Z);break}}}else if(P=C,Z)z.push(Z)}}if(!C){if(X&&J){if(z.push(Z),!w)break}if(!w&&!O)throw V}Z=f,X=!1}else throw V}}else z.push(f);if(j!==void 0&&z.length===j){G(f);break}if(!W.has(f.oid))for(let N of f.commit.parent){let V=await D6({fs:q,cache:$,gitdir:K,oid:N});if(!H.map((C)=>C.oid).includes(V.oid))H.push(V)}if(H.length===0)G(f);H.sort((N,V)=>nS(N.commit,V.commit))}return z}async function xz({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P,ref:_="HEAD",depth:j,since:Y,force:w,follow:O,cache:v={}}){try{h("fs",q),h("gitdir",K),h("ref",_);let z=new g(q),W=await n({fsp:z,dotgit:K});return await lS({fs:z,cache:v,gitdir:W,filepath:P,ref:_,depth:j,since:Y,force:w,follow:O})}catch(z){throw z.caller="git.log",z}}async function nz({fs:q,onSign:$,dir:K,gitdir:P=m(K,".git"),ours:_,theirs:j,fastForward:Y=!0,fastForwardOnly:w=!1,dryRun:O=!1,noUpdateBranch:v=!1,abortOnConflict:z=!0,message:W,author:T,committer:H,signingKey:J,cache:Z={},mergeDriver:X,allowUnrelatedHistories:G=!1}){try{if(h("fs",q),J)h("onSign",$);let f=new g(q),N=await n({fsp:f,dotgit:P}),V=await T8({fs:f,gitdir:N,author:T});if(!V&&(!w||!Y))throw new bq("author");let C=await n8({fs:f,gitdir:N,author:V,committer:H});if(!C&&(!w||!Y))throw new bq("committer");return await Tz({fs:f,cache:Z,dir:K,gitdir:N,ours:_,theirs:j,fastForward:Y,fastForwardOnly:w,dryRun:O,noUpdateBranch:v,abortOnConflict:z,message:W,author:V,committer:C,signingKey:J,onSign:$,mergeDriver:X,allowUnrelatedHistories:G})}catch(f){throw f.caller="git.merge",f}}var oS={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function cz({fs:q,cache:$,dir:K,gitdir:P=m(K,".git"),oids:_}){let j=new hO,Y=[];function w(z,W){let T=Buffer.from(z,W);Y.push(T),j.update(T)}async function O({stype:z,object:W}){let T=oS[z],H=W.length,J=H>15?128:0,Z=H&15;H=H>>>4;let X=(J|T|Z).toString(16);w(X,"hex");while(J)J=H>127?128:0,X=J|H&127,w(R3(2,X),"hex"),H=H>>>7;w(Buffer.from(await LO(W)))}w("PACK"),w("00000002","hex"),w(R3(8,_.length),"hex");for(let z of _){let{type:W,object:T}=await Kq({fs:q,cache:$,gitdir:P,oid:z});await O({write:w,object:T,stype:W})}let v=j.digest();return Y.push(v),Y}async function aS({fs:q,cache:$,gitdir:K,oids:P,write:_}){let j=await cz({fs:q,cache:$,gitdir:K,oids:P}),Y=Buffer.from(await E4(j)),O=`pack-${Y.slice(-20).toString("hex")}.pack`;if(_)return await q.write(m(K,`objects/pack/${O}`),Y),{filename:O};return{filename:O,packfile:new Uint8Array(Y)}}async function lz({fs:q,dir:$,gitdir:K=m($,".git"),oids:P,write:_=!1,cache:j={}}){try{h("fs",q),h("gitdir",K),h("oids",P);let Y=new g(q),w=await n({fsp:Y,dotgit:K});return await aS({fs:Y,cache:j,gitdir:w,oids:P,write:_})}catch(Y){throw Y.caller="git.packObjects",Y}}async function oz({fs:q,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,dir:w,gitdir:O=m(w,".git"),ref:v,url:z,remote:W,remoteRef:T,prune:H=!1,pruneTags:J=!1,fastForward:Z=!0,fastForwardOnly:X=!1,corsProxy:G,singleBranch:f,headers:N={},author:V,committer:C,signingKey:b,cache:k={}}){try{h("fs",q),h("gitdir",O);let M=new g(q),A=await n({fsp:M,dotgit:O}),u=await T8({fs:M,gitdir:A,author:V});if(!u)throw new bq("author");let S=await n8({fs:M,gitdir:A,author:u,committer:C});if(!S)throw new bq("committer");return await Hz({fs:M,cache:k,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,dir:w,gitdir:A,ref:v,url:z,remote:W,remoteRef:T,fastForward:Z,fastForwardOnly:X,corsProxy:G,singleBranch:f,headers:N,author:u,committer:S,signingKey:b,prune:H,pruneTags:J})}catch(M){throw M.caller="git.pull",M}}async function rS({fs:q,cache:$,dir:K,gitdir:P=m(K,".git"),start:_,finish:j}){let Y=await p$.read({fs:q,gitdir:P}),w=new Set,O=new Set;for(let W of _)w.add(await E.resolve({fs:q,gitdir:P,ref:W}));for(let W of j)try{let T=await E.resolve({fs:q,gitdir:P,ref:W});O.add(T)}catch(T){}let v=new Set;async function z(W){v.add(W);let{type:T,object:H}=await Kq({fs:q,cache:$,gitdir:P,oid:W});if(T==="tag"){let Z=dq.from(H).headers().object;return z(Z)}if(T!=="commit")throw new Lq(W,T,"commit");if(!Y.has(W)){let Z=Yq.from(H).headers().parent;for(W of Z)if(!O.has(W)&&!v.has(W))await z(W)}}for(let W of w)await z(W);return v}async function C3({fs:q,cache:$,dir:K,gitdir:P=m(K,".git"),oids:_}){let j=new Set;async function Y(w){if(j.has(w))return;j.add(w);let{type:O,object:v}=await Kq({fs:q,cache:$,gitdir:P,oid:w});if(O==="tag"){let W=dq.from(v).headers().object;await Y(W)}else if(O==="commit"){let W=Yq.from(v).headers().tree;await Y(W)}else if(O==="tree"){let z=aq.from(v);for(let W of z){if(W.type==="blob")j.add(W.oid);if(W.type==="tree")await Y(W.oid)}}}for(let w of _)await Y(w);return j}async function iS(q){let $={},K="",P=vq.streamReader(q),_=await P();while(_!==!0){if(_!==null)K+=_.toString("utf8")+`
|
|
168
|
+
`;_=await P()}let j=K.toString("utf8").split(`
|
|
169
|
+
`);if(_=j.shift(),!_.startsWith("unpack "))throw new a8('unpack ok" or "unpack [error message]',_);if($.ok=_==="unpack ok",!$.ok)$.error=_.slice(7);$.refs={};for(let Y of j){if(Y.trim()==="")continue;let w=Y.slice(0,2),O=Y.slice(3),v=O.indexOf(" ");if(v===-1)v=O.length;let z=O.slice(0,v),W=O.slice(v+1);$.refs[z]={ok:w==="ok",error:W}}return $}async function tS({capabilities:q=[],triplets:$=[]}){let K=[],P=`\x00 ${q.join(" ")}`;for(let _ of $)K.push(vq.encode(`${_.oldoid} ${_.oid} ${_.fullRef}${P}
|
|
170
|
+
`)),P="";return K.push(vq.flush()),K}async function BS({fs:q,cache:$,http:K,onProgress:P,onMessage:_,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,onPrePush:O,gitdir:v,ref:z,remoteRef:W,remote:T,url:H,force:J=!1,delete:Z=!1,corsProxy:X,headers:G={}}){let f=z||await J8({fs:q,gitdir:v});if(typeof f>"u")throw new oq("ref");let N=await Zq.get({fs:q,gitdir:v});T=T||await N.get(`branch.${f}.pushRemote`)||await N.get("remote.pushDefault")||await N.get(`branch.${f}.remote`)||"origin";let V=H||await N.get(`remote.${T}.pushurl`)||await N.get(`remote.${T}.url`);if(typeof V>"u")throw new oq("remote OR url");let C=W||await N.get(`branch.${f}.merge`);if(typeof V>"u")throw new oq("remoteRef");if(X===void 0)X=await N.get("http.corsProxy");let b=await E.expand({fs:q,gitdir:v,ref:f}),k=Z?"0000000000000000000000000000000000000000":await E.resolve({fs:q,gitdir:v,ref:b}),M=YP.getRemoteHelperFor({url:V}),A=await M.discover({http:K,onAuth:j,onAuthSuccess:Y,onAuthFailure:w,corsProxy:X,service:"git-receive-pack",url:V,headers:G,protocolVersion:1}),u=A.auth,S;if(!C)S=b;else try{S=await E.expandAgainstMap({ref:C,map:A.refs})}catch($q){if($q instanceof s)S=C.startsWith("refs/")?C:`refs/heads/${C}`;else throw $q}let p=A.refs.get(S)||"0000000000000000000000000000000000000000";if(O){if(!await O({remote:T,url:V,localRef:{ref:Z?"(delete)":b,oid:k},remoteRef:{ref:S,oid:p}}))throw new d$}let L=!A.capabilities.has("no-thin"),c=new Set;if(!Z){let $q=[...A.refs.values()],j6=new Set;if(p!=="0000000000000000000000000000000000000000"){let Mq=await x3({fs:q,cache:$,gitdir:v,oids:[k,p]});for(let A8 of Mq)$q.push(A8);if(L)j6=await C3({fs:q,cache:$,gitdir:v,oids:Mq})}if(!$q.includes(k)){let Mq=await rS({fs:q,cache:$,gitdir:v,start:[k],finish:$q});c=await C3({fs:q,cache:$,gitdir:v,oids:Mq})}if(L){try{let Mq=await E.resolve({fs:q,gitdir:v,ref:`refs/remotes/${T}/HEAD`,depth:2}),{oid:A8}=await E.resolveAgainstMap({ref:Mq.replace(`refs/remotes/${T}/`,""),fullref:Mq,map:A.refs}),x6=[A8];for(let Wq of await C3({fs:q,cache:$,gitdir:v,oids:x6}))j6.add(Wq)}catch(Mq){}for(let Mq of j6)c.delete(Mq)}if(k===p)J=!0;if(!J){if(b.startsWith("refs/tags")&&p!=="0000000000000000000000000000000000000000")throw new m$("tag-exists");if(k!=="0000000000000000000000000000000000000000"&&p!=="0000000000000000000000000000000000000000"&&!await bz({fs:q,cache:$,gitdir:v,oid:k,ancestor:p,depth:-1}))throw new m$("not-fast-forward")}}let d=qz([...A.capabilities],["report-status","side-band-64k",`agent=${d4.agent}`]),Q=await tS({capabilities:d,triplets:[{oldoid:p,oid:k,fullRef:S}]}),Vq=Z?[]:await cz({fs:q,cache:$,gitdir:v,oids:[...c]}),Rq=await M.connect({http:K,onProgress:P,corsProxy:X,service:"git-receive-pack",url:V,auth:u,headers:G,body:[...Q,...Vq]}),{packfile:_K,progress:jK}=await L3.demux(Rq.body);if(_){let $q=$z(jK);jP($q,async(j6)=>{await _(j6)})}let Eq=await iS(_K);if(Rq.headers)Eq.headers=Rq.headers;if(T&&Eq.ok&&Eq.refs[S].ok&&!b.startsWith("refs/tags")){let $q=`refs/remotes/${T}/${S.replace("refs/heads","")}`;if(Z)await E.deleteRef({fs:q,gitdir:v,ref:$q});else await E.writeRef({fs:q,gitdir:v,ref:$q,value:k})}if(Eq.ok&&Object.values(Eq.refs).every(($q)=>$q.ok))return Eq;else{let $q=Object.entries(Eq.refs).filter(([j6,Mq])=>!Mq.ok).map(([j6,Mq])=>`
|
|
171
|
+
- ${j6}: ${Mq.error}`).join("");throw new BK($q,Eq)}}async function az({fs:q,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,onPrePush:w,dir:O,gitdir:v=m(O,".git"),ref:z,remoteRef:W,remote:T="origin",url:H,force:J=!1,delete:Z=!1,corsProxy:X,headers:G={},cache:f={}}){try{h("fs",q),h("http",$),h("gitdir",v);let N=new g(q),V=await n({fsp:N,dotgit:v});return await BS({fs:N,cache:f,http:$,onProgress:K,onMessage:P,onAuth:_,onAuthSuccess:j,onAuthFailure:Y,onPrePush:w,gitdir:V,ref:z,remoteRef:W,remote:T,url:H,force:J,delete:Z,corsProxy:X,headers:G})}catch(N){throw N.caller="git.push",N}}async function rz({fs:q,cache:$,gitdir:K,oid:P}){let{type:_,object:j}=await Kq({fs:q,cache:$,gitdir:K,oid:P});if(_==="tag")return P=dq.from(j).parse().object,rz({fs:q,cache:$,gitdir:K,oid:P});if(_!=="blob")throw new Lq(P,_,"blob");return{oid:P,blob:new Uint8Array(j)}}async function iz({fs:q,cache:$,gitdir:K,oid:P,filepath:_=void 0}){if(_!==void 0)P=await PP({fs:q,cache:$,gitdir:K,oid:P,filepath:_});return await rz({fs:q,cache:$,gitdir:K,oid:P})}async function tz({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,filepath:_,cache:j={}}){try{h("fs",q),h("gitdir",K),h("oid",P);let Y=new g(q),w=await n({fsp:Y,dotgit:K});return await iz({fs:Y,cache:j,gitdir:w,oid:P,filepath:_})}catch(Y){throw Y.caller="git.readBlob",Y}}async function n3({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,cache:_={}}){try{h("fs",q),h("gitdir",K),h("oid",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await D6({fs:j,cache:_,gitdir:Y,oid:P})}catch(j){throw j.caller="git.readCommit",j}}async function eS({fs:q,cache:$,gitdir:K,ref:P="refs/notes/commits",oid:_}){let j=await E.resolve({gitdir:K,fs:q,ref:P}),{blob:Y}=await iz({fs:q,cache:$,gitdir:K,oid:j,filepath:_});return Y}async function Bz({fs:q,dir:$,gitdir:K=m($,".git"),ref:P="refs/notes/commits",oid:_,cache:j={}}){try{h("fs",q),h("gitdir",K),h("ref",P),h("oid",_);let Y=new g(q),w=await n({fsp:Y,dotgit:K});return await eS({fs:Y,cache:j,gitdir:w,ref:P,oid:_})}catch(Y){throw Y.caller="git.readNote",Y}}async function ez({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,format:_="parsed",filepath:j=void 0,encoding:Y=void 0,cache:w={}}){try{h("fs",q),h("gitdir",K),h("oid",P);let O=new g(q),v=await n({fsp:O,dotgit:K});if(j!==void 0)P=await PP({fs:O,cache:w,gitdir:v,oid:P,filepath:j});let W=await Kq({fs:O,cache:w,gitdir:v,oid:P,format:_==="parsed"?"content":_});if(W.oid=P,_==="parsed")switch(W.format="parsed",W.type){case"commit":W.object=Yq.from(W.object).parse();break;case"tree":W.object=aq.from(W.object).entries();break;case"blob":if(Y)W.object=W.object.toString(Y);else W.object=new Uint8Array(W.object),W.format="content";break;case"tag":W.object=dq.from(W.object).parse();break;default:throw new Lq(W.oid,W.type,"blob|commit|tag|tree")}else if(W.format==="deflated"||W.format==="wrapped")W.type=W.format;return W}catch(O){throw O.caller="git.readObject",O}}async function US({fs:q,cache:$,gitdir:K,oid:P}){let{type:_,object:j}=await Kq({fs:q,cache:$,gitdir:K,oid:P,format:"content"});if(_!=="tag")throw new Lq(P,_,"tag");let Y=dq.from(j);return{oid:P,tag:Y.parse(),payload:Y.payload()}}async function Uz({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,cache:_={}}){try{h("fs",q),h("gitdir",K),h("oid",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await US({fs:j,cache:_,gitdir:Y,oid:P})}catch(j){throw j.caller="git.readTag",j}}async function Fz({fs:q,dir:$,gitdir:K=m($,".git"),oid:P,filepath:_=void 0,cache:j={}}){try{h("fs",q),h("gitdir",K),h("oid",P);let Y=new g(q),w=await n({fsp:Y,dotgit:K});return await g$({fs:Y,cache:j,gitdir:w,oid:P,filepath:_})}catch(Y){throw Y.caller="git.readTree",Y}}async function sz({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P,cache:_={}}){try{h("fs",q),h("gitdir",K),h("filepath",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});await Jq.acquire({fs:j,gitdir:Y,cache:_},async function(w){w.delete({filepath:P})})}catch(j){throw j.caller="git.remove",j}}async function FS({fs:q,cache:$,onSign:K,gitdir:P,ref:_="refs/notes/commits",oid:j,author:Y,committer:w,signingKey:O}){let v;try{v=await E.resolve({gitdir:P,fs:q,ref:_})}catch(J){if(!(J instanceof s))throw J}let W=(await g$({fs:q,cache:$,gitdir:P,oid:v||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;W=W.filter((J)=>J.path!==j);let T=await _P({fs:q,gitdir:P,tree:W});return await KP({fs:q,cache:$,onSign:K,gitdir:P,ref:_,tree:T,parent:v&&[v],message:`Note removed by 'isomorphic-git removeNote'
|
|
172
|
+
`,author:Y,committer:w,signingKey:O})}async function Qz({fs:q,onSign:$,dir:K,gitdir:P=m(K,".git"),ref:_="refs/notes/commits",oid:j,author:Y,committer:w,signingKey:O,cache:v={}}){try{h("fs",q),h("gitdir",P),h("oid",j);let z=new g(q),W=await n({fsp:z,dotgit:P}),T=await T8({fs:z,gitdir:W,author:Y});if(!T)throw new bq("author");let H=await n8({fs:z,gitdir:W,author:T,committer:w});if(!H)throw new bq("committer");return await FS({fs:z,cache:v,onSign:$,gitdir:W,ref:_,oid:j,author:T,committer:H,signingKey:O})}catch(z){throw z.caller="git.removeNote",z}}async function sS({fs:q,gitdir:$,oldref:K,ref:P,checkout:_=!1}){if(!LK(P,!0))throw new A6(P,yK.clean(P));if(!LK(K,!0))throw new A6(K,yK.clean(K));let j=`refs/heads/${K}`,Y=`refs/heads/${P}`;if(await E.exists({fs:q,gitdir:$,ref:Y}))throw new G6("branch",P,!1);let O=await E.resolve({fs:q,gitdir:$,ref:j,depth:1});await E.writeRef({fs:q,gitdir:$,ref:Y,value:O}),await E.deleteRef({fs:q,gitdir:$,ref:j});let z=await J8({fs:q,gitdir:$,fullname:!0})===j;if(_||z)await E.writeSymbolicRef({fs:q,gitdir:$,ref:"HEAD",value:Y})}async function qW({fs:q,dir:$,gitdir:K=m($,".git"),ref:P,oldref:_,checkout:j=!1}){try{h("fs",q),h("gitdir",K),h("ref",P),h("oldref",_);let Y=new g(q),w=await n({fsp:Y,dotgit:K});return await sS({fs:Y,gitdir:w,ref:P,oldref:_,checkout:j})}catch(Y){throw Y.caller="git.renameBranch",Y}}async function $W({gitdir:q,type:$,object:K}){return y6(l8.wrap({type:$,object:K}))}async function KW({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P,ref:_,cache:j={}}){try{h("fs",q),h("gitdir",K),h("filepath",P);let Y=new g(q),w=await n({fsp:Y,dotgit:K}),O,v;try{O=await E.resolve({fs:Y,gitdir:w,ref:_||"HEAD"})}catch(T){if(_)throw T}if(O)try{O=await PP({fs:Y,cache:j,gitdir:w,oid:O,filepath:P})}catch(T){O=null}let z={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},W=$&&await Y.read(m($,P));if(W){if(v=await $W({gitdir:w,type:"blob",object:W}),O===v)z=await Y.lstat(m($,P))}await Jq.acquire({fs:Y,gitdir:w,cache:j},async function(T){if(T.delete({filepath:P}),O)T.insert({filepath:P,stats:z,oid:O})})}catch(Y){throw Y.caller="git.reset",Y}}async function PW({fs:q,dir:$,gitdir:K=m($,".git"),ref:P,depth:_}){try{h("fs",q),h("gitdir",K),h("ref",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});return await E.resolve({fs:j,gitdir:Y,ref:P,depth:_})}catch(j){throw j.caller="git.resolveRef",j}}async function _W({fs:q,dir:$,gitdir:K=m($,".git"),path:P,value:_,append:j=!1}){try{h("fs",q),h("gitdir",K),h("path",P);let Y=new g(q),w=await n({fsp:Y,dotgit:K}),O=await Zq.get({fs:Y,gitdir:w});if(j)await O.append(P,_);else await O.set(P,_);await Zq.save({fs:Y,gitdir:w,config:O})}catch(Y){throw Y.caller="git.setConfig",Y}}async function jW({fs:q,gitdir:$,commit:K}){let P=Yq.from(K).toObject();return await rq({fs:q,gitdir:$,type:"commit",object:P,format:"content"})}class p4{static get timezoneOffsetForRefLogEntry(){let q=new Date().getTimezoneOffset(),$=Math.abs(Math.floor(q/60)),K=Math.abs(q%60).toString().padStart(2,"0");return`${q>0?"-":"+"}${$.toString().padStart(2,"0")}${K}`}static createStashReflogEntry(q,$,K){let P=q.name.replace(/\s/g,""),_="0000000000000000000000000000000000000000",j=Math.floor(Date.now()/1000),Y=p4.timezoneOffsetForRefLogEntry;return`0000000000000000000000000000000000000000 ${$} ${P} ${q.email} ${j} ${Y} ${K}
|
|
173
|
+
`}static getStashReflogEntry(q,$=!1){return q.split(`
|
|
174
|
+
`).filter((_)=>_).reverse().map((_,j)=>$?`stash@{${j}}: ${_.split("\t")[1]}`:_)}}class i6{constructor({fs:q,dir:$,gitdir:K=m($,".git")}){Object.assign(this,{fs:q,dir:$,gitdir:K,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return m(this.gitdir,i6.refStash)}get refLogsStashPath(){return m(this.gitdir,i6.refLogsStash)}async getAuthor(){if(!this._author){if(this._author=await T8({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author)throw new bq("author")}return this._author}async getStashSHA(q,$){if(!await this.fs.exists(this.refStashPath))return null;return($||await this.readStashReflogs({parsed:!1}))[q].split(" ")[1]}async writeStashCommit({message:q,tree:$,parent:K}){return jW({fs:this.fs,gitdir:this.gitdir,commit:{message:q,tree:$,parent:K,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(q){let $=await this.readStashReflogs({parsed:!1});if(q!==0){if(q<0||q>$.length-1)throw new A6(`stash@${q}`,"number that is in range of [0, num of stash pushed]")}let K=await this.getStashSHA(q,$);if(!K)return{};return D6({fs:this.fs,cache:{},gitdir:this.gitdir,oid:K})}async writeStashRef(q){return E.writeRef({fs:this.fs,gitdir:this.gitdir,ref:i6.refStash,value:q})}async writeStashReflogEntry({stashCommit:q,message:$}){let K=await this.getAuthor(),P=p4.createStashReflogEntry(K,q,$),_=this.refLogsStashPath;await E$({filepath:_,entry:P},async()=>{let j=await this.fs.exists(_)?await this.fs.read(_,"utf8"):"";await this.fs.write(_,j+P,"utf8")})}async readStashReflogs({parsed:q=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let $=await this.fs.read(this.refLogsStashPath,"utf8");return p4.getStashReflogEntry($,q)}}async function YW({fs:q,dir:$,gitdir:K,message:P=""}){let _=new i6({fs:q,dir:$,gitdir:K});await _.getAuthor();let j=await J8({fs:q,gitdir:K,fullname:!1}),Y=await E.resolve({fs:q,gitdir:K,ref:"HEAD"}),O=(await n3({fs:q,dir:$,gitdir:K,oid:Y})).commit.message,v=[Y],z=null,W=q6({ref:"HEAD"}),T=await TO({fs:q,dir:$,gitdir:K,treePair:[q6({ref:"HEAD"}),"stage"]});if(T){let X=await _.writeStashCommit({message:`stash-Index: WIP on ${j} - ${new Date().toISOString()}`,tree:T,parent:v});v.push(X),z=T,W=c8()}let H=await TO({fs:q,dir:$,gitdir:K,treePair:[W,"workdir"]});if(H){let X=await _.writeStashCommit({message:`stash-WorkDir: WIP on ${j} - ${new Date().toISOString()}`,tree:H,parent:[v[v.length-1]]});v.push(X),z=H}if(!z||!T&&!H)throw new s("changes, nothing to stash");let J=(P.trim()||`WIP on ${j}`)+`: ${Y.substring(0,7)} ${O}`;return{stashCommit:await _.writeStashCommit({message:J,tree:z,parent:v}),stashMsg:J,branch:j,stashMgr:_}}async function QS({fs:q,dir:$,gitdir:K,message:P=""}){let{stashCommit:_,stashMsg:j,branch:Y,stashMgr:w}=await YW({fs:q,dir:$,gitdir:K,message:P});return await w.writeStashRef(_),await w.writeStashReflogEntry({stashCommit:_,message:j}),await d3({fs:q,dir:$,gitdir:K,ref:Y,track:!1,force:!0}),_}async function qb({fs:q,dir:$,gitdir:K,message:P=""}){let{stashCommit:_}=await YW({fs:q,dir:$,gitdir:K,message:P});return _}async function wW({fs:q,dir:$,gitdir:K,refIdx:P=0}){let j=await new i6({fs:q,dir:$,gitdir:K}).readStashCommit(P),{parent:Y=null}=j.commit?j.commit:{};if(!Y||!Array.isArray(Y))return;for(let w=0;w<Y.length-1;w++){let v=(await D6({fs:q,cache:{},gitdir:K,oid:Y[w+1]})).commit.message.startsWith("stash-Index");await FO({fs:q,dir:$,gitdir:K,stashCommit:Y[w+1],parentCommit:Y[w],wasStaged:v})}}async function vW({fs:q,dir:$,gitdir:K,refIdx:P=0}){let _=new i6({fs:q,dir:$,gitdir:K});if(!(await _.readStashCommit(P)).commit)return;let Y=_.refStashPath;await E$(Y,async()=>{if(await q.exists(Y))await q.rm(Y)});let w=await _.readStashReflogs({parsed:!1});if(!w.length)return;w.splice(P,1);let O=_.refLogsStashPath;await E$({reflogEntries:w,stashReflogPath:O,stashMgr:_},async()=>{if(w.length){await q.write(O,w.reverse().join(`
|
|
175
|
+
`)+`
|
|
176
|
+
`,"utf8");let v=w[w.length-1].split(" ")[1];await _.writeStashRef(v)}else await q.rm(O)})}async function $b({fs:q,dir:$,gitdir:K}){return new i6({fs:q,dir:$,gitdir:K}).readStashReflogs({parsed:!0})}async function Kb({fs:q,dir:$,gitdir:K}){let P=new i6({fs:q,dir:$,gitdir:K}),_=[P.refStashPath,P.refLogsStashPath];await E$(_,async()=>{await Promise.all(_.map(async(j)=>{if(await q.exists(j))return q.rm(j)}))})}async function Pb({fs:q,dir:$,gitdir:K,refIdx:P=0}){await wW({fs:q,dir:$,gitdir:K,refIdx:P}),await vW({fs:q,dir:$,gitdir:K,refIdx:P})}async function OW({fs:q,dir:$,gitdir:K=m($,".git"),op:P="push",message:_="",refIdx:j=0}){h("fs",q),h("dir",$),h("gitdir",K),h("op",P);let Y={push:QS,apply:wW,drop:vW,list:$b,clear:Kb,pop:Pb,create:qb},w=["apply","drop","pop"];try{let O=new g(q),v=await n({fsp:O,dotgit:K});["refs","logs","logs/refs"].map((T)=>m(v,T)).forEach(async(T)=>{if(!await O.exists(T))await O.mkdir(T)});let W=Y[P];if(W){if(w.includes(P)&&j<0)throw new A6(`stash@${j}`,"number that is in range of [0, num of stash pushed]");return await W({fs:O,dir:$,gitdir:v,message:_,refIdx:j})}throw Error(`To be implemented: ${P}`)}catch(O){throw O.caller="git.stash",O}}async function zW({fs:q,dir:$,gitdir:K=m($,".git"),filepath:P,cache:_={}}){try{h("fs",q),h("gitdir",K),h("filepath",P);let j=new g(q),Y=await n({fsp:j,dotgit:K});if(await r8.isIgnored({fs:j,gitdir:Y,dir:$,filepath:P}))return"ignored";let O=await _b({fs:j,cache:_,gitdir:Y}),v=await WW({fs:j,cache:_,gitdir:Y,tree:O,path:P}),z=await Jq.acquire({fs:j,gitdir:Y,cache:_},async function(X){for(let G of X)if(G.path===P)return G;return null}),W=await j.lstat(m($,P)),T=v!==null,H=z!==null,J=W!==null,Z=async()=>{if(H&&!S4(z,W))return z.oid;else{let X=await j.read(m($,P)),G=await $W({gitdir:Y,type:"blob",object:X});if(H&&z.oid===G){if(W.size!==-1)Jq.acquire({fs:j,gitdir:Y,cache:_},async function(f){f.insert({filepath:P,stats:W,oid:G})})}return G}};if(!T&&!J&&!H)return"absent";if(!T&&!J&&H)return"*absent";if(!T&&J&&!H)return"*added";if(!T&&J&&H)return await Z()===z.oid?"added":"*added";if(T&&!J&&!H)return"deleted";if(T&&!J&&H)return v===z.oid?"*deleted":"*deleted";if(T&&J&&!H)return await Z()===v?"*undeleted":"*undeletemodified";if(T&&J&&H){let X=await Z();if(X===v)return X===z.oid?"unmodified":"*unmodified";else return X===z.oid?"modified":"*modified"}}catch(j){throw j.caller="git.status",j}}async function WW({fs:q,cache:$,gitdir:K,tree:P,path:_}){if(typeof _==="string")_=_.split("/");let j=_.shift();for(let Y of P)if(Y.path===j){if(_.length===0)return Y.oid;let{type:w,object:O}=await Kq({fs:q,cache:$,gitdir:K,oid:Y.oid});if(w==="tree"){let v=aq.from(O);return WW({fs:q,cache:$,gitdir:K,tree:v,path:_})}if(w==="blob")throw new Lq(Y.oid,w,"blob",_.join("/"))}return null}async function _b({fs:q,cache:$,gitdir:K}){let P;try{P=await E.resolve({fs:q,gitdir:K,ref:"HEAD"})}catch(j){if(j instanceof s)return[]}let{tree:_}=await g$({fs:q,cache:$,gitdir:K,oid:P});return _}async function TW({fs:q,dir:$,gitdir:K=m($,".git"),ref:P="HEAD",filepaths:_=["."],filter:j,cache:Y={},ignored:w=!1}){try{h("fs",q),h("gitdir",K),h("ref",P);let O=new g(q),v=await n({fsp:O,dotgit:K});return await W8({fs:O,cache:Y,dir:$,gitdir:v,trees:[q6({ref:P}),L$(),c8()],map:async function(z,[W,T,H]){if(!W&&!H&&T){if(!w){if(await r8.isIgnored({fs:O,dir:$,filepath:z}))return null}}if(!_.some((k)=>eO(z,k)))return null;if(j){if(!j(z))return}let[J,Z,X]=await Promise.all([W&&W.type(),T&&T.type(),H&&H.type()]),G=[J,Z,X].includes("blob");if((J==="tree"||J==="special")&&!G)return;if(J==="commit")return null;if((Z==="tree"||Z==="special")&&!G)return;if(X==="commit")return null;if((X==="tree"||X==="special")&&!G)return;let f=J==="blob"?await W.oid():void 0,N=X==="blob"?await H.oid():void 0,V;if(J!=="blob"&&Z==="blob"&&X!=="blob")V="42";else if(Z==="blob")V=await T.oid();let C=[void 0,f,V,N],b=C.map((k)=>C.indexOf(k));return b.shift(),[z,...b]}})}catch(O){throw O.caller="git.statusMatrix",O}}async function HW({fs:q,dir:$,gitdir:K=m($,".git"),ref:P,object:_,force:j=!1}){try{h("fs",q),h("gitdir",K),h("ref",P);let Y=new g(q);if(P===void 0)throw new oq("ref");P=P.startsWith("refs/tags/")?P:`refs/tags/${P}`;let w=await n({fsp:Y,dotgit:K}),O=await E.resolve({fs:Y,gitdir:w,ref:_||"HEAD"});if(!j&&await E.exists({fs:Y,gitdir:w,ref:P}))throw new G6("tag",P);await E.writeRef({fs:Y,gitdir:w,ref:P,value:O})}catch(Y){throw Y.caller="git.tag",Y}}async function JW({fs:q,dir:$,gitdir:K=m($,".git"),cache:P={},filepath:_,oid:j,mode:Y,add:w,remove:O,force:v}){try{h("fs",q),h("gitdir",K),h("filepath",_);let z=new g(q),W=await n({fsp:z,dotgit:K});if(O)return await Jq.acquire({fs:z,gitdir:W,cache:P},async function(H){if(!v){let J=await z.lstat(m($,_));if(J){if(J.isDirectory())throw new z8("directory");return}}if(H.has({filepath:_}))H.delete({filepath:_})});let T;if(!j){if(T=await z.lstat(m($,_)),!T)throw new s(`file at "${_}" on disk and "remove" not set`);if(T.isDirectory())throw new z8("directory")}return await Jq.acquire({fs:z,gitdir:W,cache:P},async function(H){if(!w&&!H.has({filepath:_}))throw new s(`file at "${_}" in index and "add" not set`);let J;if(!j){J=T;let Z=J.isSymbolicLink()?await z.readlink(m($,_)):await z.read(m($,_));j=await rq({fs:z,gitdir:W,type:"blob",format:"content",object:Z})}else J={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:Y,uid:0,gid:0,size:0};return H.insert({filepath:_,oid:j,stats:J}),j})}catch(z){throw z.caller="git.updateIndex",z}}function ZW(){try{return d4.version}catch(q){throw q.caller="git.version",q}}async function kW({fs:q,dir:$,gitdir:K=m($,".git"),trees:P,map:_,reduce:j,iterate:Y,cache:w={}}){try{h("fs",q),h("gitdir",K),h("trees",P);let O=new g(q),v=await n({fsp:O,dotgit:K});return await W8({fs:O,cache:w,dir:$,gitdir:v,trees:P,map:_,reduce:j,iterate:Y})}catch(O){throw O.caller="git.walk",O}}async function XW({fs:q,dir:$,gitdir:K=m($,".git"),blob:P}){try{h("fs",q),h("gitdir",K),h("blob",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await rq({fs:_,gitdir:j,type:"blob",object:P,format:"content"})}catch(_){throw _.caller="git.writeBlob",_}}async function fW({fs:q,dir:$,gitdir:K=m($,".git"),commit:P}){try{h("fs",q),h("gitdir",K),h("commit",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await jW({fs:_,gitdir:j,commit:P})}catch(_){throw _.caller="git.writeCommit",_}}async function AW({fs:q,dir:$,gitdir:K=m($,".git"),type:P,object:_,format:j="parsed",oid:Y,encoding:w=void 0}){try{let O=new g(q),v=await n({fsp:O,dotgit:K});if(j==="parsed"){switch(P){case"commit":_=Yq.from(_).toObject();break;case"tree":_=aq.from(_).toObject();break;case"blob":_=Buffer.from(_,w);break;case"tag":_=dq.from(_).toObject();break;default:throw new Lq(Y||"",P,"blob|commit|tag|tree")}j="content"}return Y=await rq({fs:O,gitdir:v,type:P,object:_,oid:Y,format:j}),Y}catch(O){throw O.caller="git.writeObject",O}}async function GW({fs:q,dir:$,gitdir:K=m($,".git"),ref:P,value:_,force:j=!1,symbolic:Y=!1}){try{h("fs",q),h("gitdir",K),h("ref",P),h("value",_);let w=new g(q);if(!LK(P,!0))throw new A6(P,yK.clean(P));let O=await n({fsp:w,dotgit:K});if(!j&&await E.exists({fs:w,gitdir:O,ref:P}))throw new G6("ref",P);if(Y)await E.writeSymbolicRef({fs:w,gitdir:O,ref:P,value:_});else _=await E.resolve({fs:w,gitdir:O,ref:_}),await E.writeRef({fs:w,gitdir:O,ref:P,value:_})}catch(w){throw w.caller="git.writeRef",w}}async function jb({fs:q,gitdir:$,tag:K}){let P=dq.from(K).toObject();return await rq({fs:q,gitdir:$,type:"tag",object:P,format:"content"})}async function hW({fs:q,dir:$,gitdir:K=m($,".git"),tag:P}){try{h("fs",q),h("gitdir",K),h("tag",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await jb({fs:_,gitdir:j,tag:P})}catch(_){throw _.caller="git.writeTag",_}}async function VW({fs:q,dir:$,gitdir:K=m($,".git"),tree:P}){try{h("fs",q),h("gitdir",K),h("tree",P);let _=new g(q),j=await n({fsp:_,dotgit:K});return await _P({fs:_,gitdir:j,tree:P})}catch(_){throw _.caller="git.writeTree",_}}var Yb={Errors:IO,STAGE:c8,TREE:q6,WORKDIR:L$,add:xO,abortMerge:dO,addNote:aO,addRemote:iO,annotatedTag:tO,branch:BO,cherryPick:sO,checkout:d3,clone:Pz,commit:_z,getConfig:Az,getConfigAll:Gz,setConfig:_W,currentBranch:jz,deleteBranch:Yz,deleteRef:wz,deleteRemote:vz,deleteTag:Oz,expandOid:zz,expandRef:Wz,fastForward:Jz,fetch:Zz,findMergeBase:kz,findRoot:fz,getRemoteInfo:hz,getRemoteInfo2:Mz,hashBlob:Cz,indexPack:Nz,init:Sz,isDescendent:uz,isIgnored:Rz,listBranches:mz,listFiles:Ez,listNotes:pz,listRefs:Dz,listRemotes:yz,listServerRefs:dz,listTags:Lz,log:xz,merge:nz,packObjects:lz,pull:oz,push:az,readBlob:tz,readCommit:n3,readNote:Bz,readObject:ez,readTag:Uz,readTree:Fz,remove:sz,removeNote:Qz,renameBranch:qW,resetIndex:KW,updateIndex:JW,resolveRef:PW,status:zW,statusMatrix:TW,tag:HW,version:ZW,walk:kW,writeBlob:XW,writeCommit:fW,writeObject:AW,writeRef:GW,writeTag:hW,writeTree:VW,stash:OW};MW.Errors=IO;MW.STAGE=c8;MW.TREE=q6;MW.WORKDIR=L$;MW.abortMerge=dO;MW.add=xO;MW.addNote=aO;MW.addRemote=iO;MW.annotatedTag=tO;MW.branch=BO;MW.checkout=d3;MW.cherryPick=sO;MW.clone=Pz;MW.commit=_z;MW.currentBranch=jz;MW.default=Yb;MW.deleteBranch=Yz;MW.deleteRef=wz;MW.deleteRemote=vz;MW.deleteTag=Oz;MW.expandOid=zz;MW.expandRef=Wz;MW.fastForward=Jz;MW.fetch=Zz;MW.findMergeBase=kz;MW.findRoot=fz;MW.getConfig=Az;MW.getConfigAll=Gz;MW.getRemoteInfo=hz;MW.getRemoteInfo2=Mz;MW.hashBlob=Cz;MW.indexPack=Nz;MW.init=Sz;MW.isDescendent=uz;MW.isIgnored=Rz;MW.listBranches=mz;MW.listFiles=Ez;MW.listNotes=pz;MW.listRefs=Dz;MW.listRemotes=yz;MW.listServerRefs=dz;MW.listTags=Lz;MW.log=xz;MW.merge=nz;MW.packObjects=lz;MW.pull=oz;MW.push=az;MW.readBlob=tz;MW.readCommit=n3;MW.readNote=Bz;MW.readObject=ez;MW.readTag=Uz;MW.readTree=Fz;MW.remove=sz;MW.removeNote=Qz;MW.renameBranch=qW;MW.resetIndex=KW;MW.resolveRef=PW;MW.setConfig=_W;MW.stash=OW;MW.status=zW;MW.statusMatrix=TW;MW.tag=HW;MW.updateIndex=JW;MW.version=ZW;MW.walk=kW;MW.writeBlob=XW;MW.writeCommit=fW;MW.writeObject=AW;MW.writeRef=GW;MW.writeTag=hW;MW.writeTree=VW});var SW=R((jo,NW)=>{var x$=1000,n$=x$*60,c$=n$*60,i8=c$*24,N0=i8*7,S0=i8*365.25;NW.exports=function(q,$){$=$||{};var K=typeof q;if(K==="string"&&q.length>0)return b0(q);else if(K==="number"&&isFinite(q))return $.long?R0(q):u0(q);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(q))};function b0(q){if(q=String(q),q.length>100)return;var $=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(q);if(!$)return;var K=parseFloat($[1]),P=($[2]||"ms").toLowerCase();switch(P){case"years":case"year":case"yrs":case"yr":case"y":return K*S0;case"weeks":case"week":case"w":return K*N0;case"days":case"day":case"d":return K*i8;case"hours":case"hour":case"hrs":case"hr":case"h":return K*c$;case"minutes":case"minute":case"mins":case"min":case"m":return K*n$;case"seconds":case"second":case"secs":case"sec":case"s":return K*x$;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return K;default:return}}function u0(q){var $=Math.abs(q);if($>=i8)return Math.round(q/i8)+"d";if($>=c$)return Math.round(q/c$)+"h";if($>=n$)return Math.round(q/n$)+"m";if($>=x$)return Math.round(q/x$)+"s";return q+"ms"}function R0(q){var $=Math.abs(q);if($>=i8)return L4(q,$,i8,"day");if($>=c$)return L4(q,$,c$,"hour");if($>=n$)return L4(q,$,n$,"minute");if($>=x$)return L4(q,$,x$,"second");return q+" ms"}function L4(q,$,K,P){var _=$>=K*1.5;return Math.round(q/K)+" "+P+(_?"s":"")}});var c3=R((Yo,bW)=>{function m0(q){K.debug=K,K.default=K,K.coerce=O,K.disable=Y,K.enable=_,K.enabled=w,K.humanize=SW(),K.destroy=v,Object.keys(q).forEach((z)=>{K[z]=q[z]}),K.names=[],K.skips=[],K.formatters={};function $(z){let W=0;for(let T=0;T<z.length;T++)W=(W<<5)-W+z.charCodeAt(T),W|=0;return K.colors[Math.abs(W)%K.colors.length]}K.selectColor=$;function K(z){let W,T=null,H,J;function Z(...X){if(!Z.enabled)return;let G=Z,f=Number(new Date),N=f-(W||f);if(G.diff=N,G.prev=W,G.curr=f,W=f,X[0]=K.coerce(X[0]),typeof X[0]!=="string")X.unshift("%O");let V=0;X[0]=X[0].replace(/%([a-zA-Z%])/g,(b,k)=>{if(b==="%%")return"%";V++;let M=K.formatters[k];if(typeof M==="function"){let A=X[V];b=M.call(G,A),X.splice(V,1),V--}return b}),K.formatArgs.call(G,X),(G.log||K.log).apply(G,X)}if(Z.namespace=z,Z.useColors=K.useColors(),Z.color=K.selectColor(z),Z.extend=P,Z.destroy=K.destroy,Object.defineProperty(Z,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(T!==null)return T;if(H!==K.namespaces)H=K.namespaces,J=K.enabled(z);return J},set:(X)=>{T=X}}),typeof K.init==="function")K.init(Z);return Z}function P(z,W){let T=K(this.namespace+(typeof W>"u"?":":W)+z);return T.log=this.log,T}function _(z){K.save(z),K.namespaces=z,K.names=[],K.skips=[];let W=(typeof z==="string"?z:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let T of W)if(T[0]==="-")K.skips.push(T.slice(1));else K.names.push(T)}function j(z,W){let T=0,H=0,J=-1,Z=0;while(T<z.length)if(H<W.length&&(W[H]===z[T]||W[H]==="*"))if(W[H]==="*")J=H,Z=T,H++;else T++,H++;else if(J!==-1)H=J+1,Z++,T=Z;else return!1;while(H<W.length&&W[H]==="*")H++;return H===W.length}function Y(){let z=[...K.names,...K.skips.map((W)=>"-"+W)].join(",");return K.enable(""),z}function w(z){for(let W of K.skips)if(j(z,W))return!1;for(let W of K.names)if(j(z,W))return!0;return!1}function O(z){if(z instanceof Error)return z.stack||z.message;return z}function v(){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 K.enable(K.load()),K}bW.exports=m0});var RW=R((uW,g4)=>{uW.formatArgs=E0;uW.save=p0;uW.load=D0;uW.useColors=I0;uW.storage=y0();uW.destroy=(()=>{let q=!1;return()=>{if(!q)q=!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`.")}})();uW.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 I0(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let q;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(q=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(q[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function E0(q){if(q[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+q[0]+(this.useColors?"%c ":" ")+"+"+g4.exports.humanize(this.diff),!this.useColors)return;let $="color: "+this.color;q.splice(1,0,$,"color: inherit");let K=0,P=0;q[0].replace(/%[a-zA-Z%]/g,(_)=>{if(_==="%%")return;if(K++,_==="%c")P=K}),q.splice(P,0,$)}uW.log=console.debug||console.log||(()=>{});function p0(q){try{if(q)uW.storage.setItem("debug",q);else uW.storage.removeItem("debug")}catch($){}}function D0(){let q;try{q=uW.storage.getItem("debug")||uW.storage.getItem("DEBUG")}catch($){}if(!q&&typeof process<"u"&&"env"in process)q=process.env.DEBUG;return q}function y0(){try{return localStorage}catch(q){}}g4.exports=c3()(uW);var{formatters:d0}=g4.exports;d0.j=function(q){try{return JSON.stringify(q)}catch($){return"[UnexpectedJSONParseError]: "+$.message}}});var IW=R((vo,mW)=>{mW.exports=(q,$=process.argv)=>{let K=q.startsWith("-")?"":q.length===1?"-":"--",P=$.indexOf(K+q),_=$.indexOf("--");return P!==-1&&(_===-1||P<_)}});var DW=R((Oo,pW)=>{var a0=fq("os"),EW=fq("tty"),z6=IW(),{env:Nq}=process,Z8;if(z6("no-color")||z6("no-colors")||z6("color=false")||z6("color=never"))Z8=0;else if(z6("color")||z6("colors")||z6("color=true")||z6("color=always"))Z8=1;if("FORCE_COLOR"in Nq)if(Nq.FORCE_COLOR==="true")Z8=1;else if(Nq.FORCE_COLOR==="false")Z8=0;else Z8=Nq.FORCE_COLOR.length===0?1:Math.min(parseInt(Nq.FORCE_COLOR,10),3);function l3(q){if(q===0)return!1;return{level:q,hasBasic:!0,has256:q>=2,has16m:q>=3}}function o3(q,$){if(Z8===0)return 0;if(z6("color=16m")||z6("color=full")||z6("color=truecolor"))return 3;if(z6("color=256"))return 2;if(q&&!$&&Z8===void 0)return 0;let K=Z8||0;if(Nq.TERM==="dumb")return K;if(process.platform==="win32"){let P=a0.release().split(".");if(Number(P[0])>=10&&Number(P[2])>=10586)return Number(P[2])>=14931?3:2;return 1}if("CI"in Nq){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((P)=>(P in Nq))||Nq.CI_NAME==="codeship")return 1;return K}if("TEAMCITY_VERSION"in Nq)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Nq.TEAMCITY_VERSION)?1:0;if(Nq.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Nq){let P=parseInt((Nq.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Nq.TERM_PROGRAM){case"iTerm.app":return P>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(Nq.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Nq.TERM))return 1;if("COLORTERM"in Nq)return 1;return K}function r0(q){let $=o3(q,q&&q.isTTY);return l3($)}pW.exports={supportsColor:r0,stdout:l3(o3(!0,EW.isatty(1))),stderr:l3(o3(!0,EW.isatty(2)))}});var gW=R((dW,n4)=>{var i0=fq("tty"),x4=fq("util");dW.init=Q0;dW.log=U0;dW.formatArgs=B0;dW.save=F0;dW.load=s0;dW.useColors=t0;dW.destroy=x4.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");dW.colors=[6,2,3,4,5,1];try{let q=DW();if(q&&(q.stderr||q).level>=2)dW.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}catch(q){}dW.inspectOpts=Object.keys(process.env).filter((q)=>{return/^debug_/i.test(q)}).reduce((q,$)=>{let K=$.substring(6).toLowerCase().replace(/_([a-z])/g,(_,j)=>{return j.toUpperCase()}),P=process.env[$];if(/^(yes|on|true|enabled)$/i.test(P))P=!0;else if(/^(no|off|false|disabled)$/i.test(P))P=!1;else if(P==="null")P=null;else P=Number(P);return q[K]=P,q},{});function t0(){return"colors"in dW.inspectOpts?Boolean(dW.inspectOpts.colors):i0.isatty(process.stderr.fd)}function B0(q){let{namespace:$,useColors:K}=this;if(K){let P=this.color,_="\x1B[3"+(P<8?P:"8;5;"+P),j=` ${_};1m${$} \x1B[0m`;q[0]=j+q[0].split(`
|
|
177
|
+
`).join(`
|
|
178
|
+
`+j),q.push(_+"m+"+n4.exports.humanize(this.diff)+"\x1B[0m")}else q[0]=e0()+$+" "+q[0]}function e0(){if(dW.inspectOpts.hideDate)return"";return new Date().toISOString()+" "}function U0(...q){return process.stderr.write(x4.formatWithOptions(dW.inspectOpts,...q)+`
|
|
179
|
+
`)}function F0(q){if(q)process.env.DEBUG=q;else delete process.env.DEBUG}function s0(){return process.env.DEBUG}function Q0(q){q.inspectOpts={};let $=Object.keys(dW.inspectOpts);for(let K=0;K<$.length;K++)q.inspectOpts[$[K]]=dW.inspectOpts[$[K]]}n4.exports=c3()(dW);var{formatters:yW}=n4.exports;yW.o=function(q){return this.inspectOpts.colors=this.useColors,x4.inspect(q,this.inspectOpts).split(`
|
|
180
|
+
`).map(($)=>$.trim()).join(" ")};yW.O=function(q){return this.inspectOpts.colors=this.useColors,x4.inspect(q,this.inspectOpts)}});var r3=R((Wo,a3)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)a3.exports=RW();else a3.exports=gW()});var xW=R(($6)=>{var wu=$6&&$6.__importDefault||function(q){return q&&q.__esModule?q:{default:q}};Object.defineProperty($6,"__esModule",{value:!0});var vu=fq("fs"),Ou=wu(r3()),l$=Ou.default("@kwsites/file-exists");function zu(q,$,K){l$("checking %s",q);try{let P=vu.statSync(q);if(P.isFile()&&$)return l$("[OK] path represents a file"),!0;if(P.isDirectory()&&K)return l$("[OK] path represents a directory"),!0;return l$("[FAIL] path represents something other than a file or directory"),!1}catch(P){if(P.code==="ENOENT")return l$("[FAIL] path is not accessible: %o",P),!1;throw l$("[FATAL] %o",P),P}}function Wu(q,$=$6.READABLE){return zu(q,($&$6.FILE)>0,($&$6.FOLDER)>0)}$6.exists=Wu;$6.FILE=1;$6.FOLDER=2;$6.READABLE=$6.FILE+$6.FOLDER});var nW=R((i3)=>{function Tu(q){for(var $ in q)if(!i3.hasOwnProperty($))i3[$]=q[$]}Object.defineProperty(i3,"__esModule",{value:!0});Tu(xW())});var B3=R((cW)=>{Object.defineProperty(cW,"__esModule",{value:!0});cW.createDeferred=cW.deferred=void 0;function t3(){let q,$,K="pending";return{promise:new Promise((_,j)=>{q=_,$=j}),done(_){if(K==="pending")K="resolved",q(_)},fail(_){if(K==="pending")K="rejected",$(_)},get fulfilled(){return K!=="pending"},get status(){return K}}}cW.deferred=t3;cW.createDeferred=t3;cW.default=t3});import{Buffer as Au}from"node:buffer";import{spawn as $R}from"child_process";import{normalize as Am}from"node:path";import{EventEmitter as AI}from"node:events";function $j(...q){let $=new String(q);return U4.set($,q),$}function zP(q){return q instanceof String&&U4.has(q)}function oW(q){return U4.get(q)||[]}function MT(q){if(typeof q!=="function")return U8;return q}function CT(q){return typeof q==="function"&&q!==U8}function NT(q,$){let K=q.indexOf($);if(K<=0)return[q,""];return[q.substr(0,K),q.substr(K+1)]}function ST(q,$=0){return bT(q)&&q.length>$?q[$]:void 0}function e8(q,$=0){if(bT(q)&&q.length>$)return q[q.length-1-$]}function bT(q){return $7(q)}function JP(q="",$=!0,K=`
|
|
181
|
+
`){return q.split(K).reduce((P,_)=>{let j=$?_.trim():_;if(j)P.push(j);return P},[])}function fj(q,$){return JP(q,!0).map((K)=>$(K))}function Aj(q){return F4.exists(q,F4.FOLDER)}function W6(q,$){if(Array.isArray(q)){if(!q.includes($))q.push($)}else q.add($);return $}function uT(q,$){if(Array.isArray(q)&&!q.includes($))q.push($);return q}function s4(q,$){if(Array.isArray(q)){let K=q.indexOf($);if(K>=0)q.splice(K,1)}else q.delete($);return $}function d6(q){return Array.isArray(q)?q:[q]}function RT(q){return q.replace(/[\s-]+(.)/g,($,K)=>{return K.toUpperCase()})}function t$(q){return d6(q).map(($)=>{return $ instanceof String?$:String($)})}function qq(q,$=0){if(q==null)return $;let K=parseInt(q,10);return Number.isNaN(K)?$:K}function WP(q,$){let K=[];for(let P=0,_=q.length;P<_;P++)K.push($,q[P]);return K}function TP(q){return(Array.isArray(q)?Au.concat(q):q).toString("utf-8")}function mT(q,$){let K={};return $.forEach((P)=>{if(q[P]!==void 0)K[P]=q[P]}),K}function Kj(q=0){return new Promise(($)=>setTimeout($,q))}function Pj(q){if(q===!1)return;return q}function Iq(q,$,K){if($(q))return q;return arguments.length>2?K:void 0}function _j(q,$){let K=zP(q)?"string":typeof q;return/number|string|boolean/.test(K)&&(!$||!$.includes(K))}function q7(q){return!!q&&ZP(q)==="[object Object]"}function IT(q){return typeof q==="function"}function Vu(){throw Error("LineParser:useMatches not implemented")}function pT(...q){let $=process.cwd(),K=Object.assign({baseDir:$,...DT},...q.filter((P)=>typeof P==="object"&&P));return K.baseDir=K.baseDir||$,K.trimmed=K.trimmed===!0,K}function hj(q,$=[]){if(!q7(q))return $;return Object.keys(q).reduce((K,P)=>{let _=q[P];if(zP(_))K.push(_);else if(_j(_,["boolean"]))K.push(P+"="+_);else if(Array.isArray(_)){for(let j of _)if(!_j(j,["string","number"]))K.push(P+"="+j)}else K.push(P);return K},$)}function gq(q,$=0,K=!1){let P=[];for(let _=0,j=$<0?q.length:$;_<j;_++)if("string|number".includes(typeof q[_]))P.push(String(q[_]));if(hj(Vj(q),P),!K)P.push(...Nu(q));return P}function Nu(q){let $=typeof e8(q)==="function";return t$(Iq(e8(q,$?1:0),kP,[]))}function Vj(q){let $=IT(e8(q));return Iq(e8(q,$?1:0),q7)}function wq(q,$=!0){let K=MT(e8(q));return $||CT(K)?K:void 0}function Yj(q,$){return q($.stdOut,$.stdErr)}function tq(q,$,K,P=!0){return d6(K).forEach((_)=>{for(let j=JP(_,P),Y=0,w=j.length;Y<w;Y++){let O=(v=0)=>{if(Y+v>=w)return;return j[Y+v]};$.some(({parse:v})=>v(O,q))}}),q}function uu(q){switch(q){case"bare":return gT();case"root":return LT()}return{commands:["rev-parse","--is-inside-work-tree"],format:"utf-8",onError:K7,parser:Mj}}function LT(){return{commands:["rev-parse","--git-dir"],format:"utf-8",onError:K7,parser($){return/^\.(git)?$/.test($.trim())}}}function gT(){return{commands:["rev-parse","--is-bare-repository"],format:"utf-8",onError:K7,parser:Mj}}function Ru(q){return/(Not a git repository|Kein Git-Repository)/i.test(String(q))}function mu(q,$){let K=new nT(q),P=q?lT:cT;return JP($).forEach((_)=>{let j=_.replace(P,"");K.paths.push(j),(oT.test(j)?K.folders:K.files).push(j)}),K}function aT(q){return{commands:P7,format:"empty",parser:q}}function iq(q){return{commands:P7,format:"empty",parser(){throw typeof q==="string"?new hT(q):q}}}function xq(q,$=!1){return{commands:q,format:"utf-8",parser(K){return $?String(K).trim():K}}}function rT(q){return{commands:q,format:"buffer",parser($){return $}}}function iT(q){return q.format==="buffer"}function tT(q){return q.format==="empty"||!q.commands.length}function Eu(q,$){let{cleanMode:K,options:P,valid:_}=Du(q);if(!K)return iq(Nj);if(!_.options)return iq(Sj+JSON.stringify(q));if(P.push(...$),P.some(Lu))return iq(Cj);return eT(K,P)}function eT(q,$){return{commands:["clean",`-${q}`,...$],format:"utf-8",parser(P){return mu(q==="n",P)}}}function pu(q){return Array.isArray(q)&&q.every(($)=>bj.has($))}function Du(q){let $,K=[],P={cleanMode:!1,options:!0};return q.replace(/[^a-z]i/g,"").split("").forEach((_)=>{if(yu(_))$=_,P.cleanMode=!0;else P.options=P.options&&du(K[K.length]=`-${_}`)}),{cleanMode:$,options:K,valid:P}}function yu(q){return q==="f"||q==="n"}function du(q){return/^-[a-z]$/i.test(q)&&bj.has(q.charAt(1))}function Lu(q){if(/^-[^\-]/.test(q))return q.indexOf("i")>0;return q==="--interactive"}function gu(q){let $=new sT;for(let K of FT(q))$.addValue(K.file,String(K.key),K.value);return $}function xu(q,$){let K=null,P=[],_=new Map;for(let j of FT(q,$)){if(j.key!==$)continue;if(P.push(K=j.value),!_.has(j.file))_.set(j.file,[]);_.get(j.file).push(K)}return{key:$,paths:Array.from(_.keys()),scopes:_,value:K,values:P}}function nu(q){return q.replace(/^(file):/,"")}function*FT(q,$=null){let K=q.split("\x00");for(let P=0,_=K.length-1;P<_;){let j=nu(K[P++]),Y=K[P++],w=$;if(Y.includes(`
|
|
182
|
+
`)){let O=NT(Y,`
|
|
183
|
+
`);w=O[0],Y=O[1]}yield{file:j,key:w,value:Y}}}function e3(q,$){if(typeof q==="string"&&Object.hasOwn(Oj,q))return q;return $}function lu(q,$,K,P){let _=["config",`--${P}`];if(K)_.push("--add");return _.push(q,$),{commands:_,format:"utf-8",parser(j){return j}}}function ou(q,$){let K=["config","--null","--show-origin","--get-all",q];if($)K.splice(1,0,`--${$}`);return{commands:K,format:"utf-8",parser(P){return xu(P,q)}}}function au(q){let $=["config","--list","--show-origin","--null"];if(q)$.push(`--${q}`);return{commands:$,format:"utf-8",parser(K){return gu(K)}}}function ru(){return{addConfig(q,$,...K){return this._runTask(lu(q,$,K[0]===!0,e3(K[1],"local")),wq(arguments))},getConfig(q,$){return this._runTask(ou(q,e3($,void 0)),wq(arguments))},listConfig(...q){return this._runTask(au(e3(q[0],void 0)),wq(arguments))}}}function iu(q){return qH.has(q)}function tu(...q){return new PH().param(...q)}function Bu(q){let $=new Set,K={};return fj(q,(P)=>{let[_,j,Y]=P.split(a$);$.add(_),(K[_]=K[_]||[]).push({line:qq(j),path:_,preview:Y})}),{paths:$,results:K}}function eu(){return{grep(q){let $=wq(arguments),K=gq(arguments);for(let _ of KH)if(K.includes(_))return this._runTask(iq(`git.grep: use of "${_}" is not supported.`),$);if(typeof q==="string")q=tu().param(q);let P=["grep","--null","-n","--full-name",...K,...q];return this._runTask({commands:P,format:"utf-8",parser(_){return Bu(_)}},$)}}}function Uu(q,$){let K=["reset"];if(YH(q))K.push(`--${q}`);return K.push(...$),xq(K)}function Fu(q){if(YH(q))return q;switch(typeof q){case"string":case"undefined":return"soft"}return}function YH(q){return typeof q==="string"&&wH.includes(q)}function su(){return B4.default("simple-git")}function rW(q,$,K){if(!$||!String($).replace(/\s*/,""))return!K?q:(P,..._)=>{q(P,..._),K(P,..._)};return(P,..._)=>{if(q(`%s ${P}`,$,..._),K)K(P,..._)}}function Qu(q,$,{namespace:K}){if(typeof q==="string")return q;let P=$&&$.namespace||"";if(P.startsWith(K))return P.substr(K.length+1);return P||K}function uj(q,$,K,P=su()){let _=q&&`[${q}]`||"",j=[],Y=typeof $==="string"?P.extend($):$,w=Qu(Iq($,Oq),Y,P);return v(K);function O(z,W){return W6(j,uj(q,w.replace(/^[^:]+/,z),W,P))}function v(z){let W=z&&`[${z}]`||"",T=Y&&rW(Y,W)||U8,H=rW(P,`${_} ${W}`,T);return Object.assign(Y?T:H,{label:q,sibling:O,info:H,step:v})}}function B8(q,$){return{method:ST(q.commands)||"",commands:$}}function KR(q,$){return(K)=>{$("[ERROR] child process exception %o",K),q.push(Buffer.from(String(K.stack),"ascii"))}}function iW(q,$,K,P){return(_)=>{K("%s received %L bytes",$,_),P("%B",_),q.push(_)}}function jR(q,$,K=U8){let P=(j)=>{K(null,j)},_=(j)=>{if(j?.task===q)K(j instanceof HP?YR(j):j,void 0)};$.then(P,_)}function YR(q){let $=(P)=>{console.warn(`simple-git deprecation notice: accessing GitResponseError.${P} should be GitResponseError.git.${P}, this will no longer be available in version 3`),$=U8};return Object.create(q,Object.getOwnPropertyNames(q.git).reduce(K,{}));function K(P,_){if(_ in q)return P;return P[_]={enumerable:!1,configurable:!1,get(){return $(_),q.git[_]}},P}}function tW(q,$){return aT((K)=>{if(!Aj(q))throw Error(`Git.cwd: cannot change to non-directory "${q}"`);return($||K).cwd=q})}function F3(q){let $=["checkout",...q];if($[1]==="-b"&&$.includes("-B"))$[1]=s4($,"-B");return xq($)}function OR(){return{checkout(){return this._runTask(F3(gq(arguments,1)),wq(arguments))},checkoutBranch(q,$){return this._runTask(F3(["-b",q,$,...gq(arguments)]),wq(arguments))},checkoutLocalBranch(q){return this._runTask(F3(["-b",q,...gq(arguments)]),wq(arguments))}}}function WR(){return{count:0,garbage:0,inPack:0,packs:0,prunePackable:0,size:0,sizeGarbage:0,sizePack:0}}function TR(){return{countObjects(){return this._runTask({commands:["count-objects","--verbose"],format:"utf-8",parser(q){return tq(WR(),[HH],q)}})}}}function JR(q){return tq({author:null,branch:"",commit:"",root:!1,summary:{changes:0,insertions:0,deletions:0}},JH,q)}function kR(q,$,K){return{commands:["-c","core.abbrev=40","commit",...WP(q,"-m"),...$,...K],format:"utf-8",parser:JR}}function XR(){return{commit($,...K){let P=wq(arguments),_=q($)||kR(d6($),d6(Iq(K[0],i4,[])),[...t$(Iq(K[1],kP,[])),...gq(arguments,0,!0)]);return this._runTask(_,P)}};function q($){return!i4($)&&iq("git.commit: requires the commit message to be supplied as a string/string[]")}}function AR(){return{firstCommit(){return this._runTask(xq(["rev-list","--max-parents=0","HEAD"],!0),wq(arguments))}}}function hR(q,$){let K=["hash-object",q];if($)K.push("-w");return xq(K,!0)}function MR(q,$,K){let P=String(K).trim(),_;if(_=ZH.exec(P))return new a4(q,$,!1,_[1]);if(_=kH.exec(P))return new a4(q,$,!0,_[1]);let j="",Y=P.split(" ");while(Y.length)if(Y.shift()==="in"){j=Y.join(" ");break}return new a4(q,$,/^re/i.test(P),j)}function NR(q){return q.includes(Rj)}function SR(q=!1,$,K){let P=["init",...K];if(q&&!NR(P))P.splice(1,0,Rj);return{commands:P,format:"utf-8",parser(_){return MR(P.includes("--bare"),$,_)}}}function mj(q){for(let $=0;$<q.length;$++){let K=Ij.exec(q[$]);if(K)return`--${K[1]}`}return""}function uR(q){return Ij.test(q)}function fH(q=""){let $=AH[q];return(K)=>tq(new XH,$,K,!1)}function mR(q,$){return $.reduce((K,P,_)=>{return K[P]=q[_]||"",K},Object.create({diff:null}))}function hH(q=Dj,$=VH,K=""){let P=fH(K);return function(_){let j=JP(_.trim(),!1,Ej).map(function(Y){let w=Y.split(pj),O=mR(w[0].split(q),$);if(w.length>1&&!!w[1].trim())O.diff=P(w[1]);return O});return{all:j,latest:j.length&&j[0]||null,total:j.length}}}function IR(q){let $=mj(q),K=["diff"];if($==="")$="--stat",K.push("--stat=4096");return K.push(...q),_7(K)||{commands:K,format:"utf-8",parser:fH($)}}function _7(q){let $=q.filter(uR);if($.length>1)return iq(`Summary flags are mutually exclusive - pick one of ${$.join(",")}`);if($.length&&q.includes("-z"))return iq(`Summary flag ${$} parsing is not compatible with null termination option '-z'`)}function ER(q,$){let K=[],P=[];return Object.keys(q).forEach((_)=>{K.push(_),P.push(String(q[_]))}),[K,P.join($)]}function pR(q){return Object.keys(q).reduce(($,K)=>{if(!(K in Wj))$[K]=q[K];return $},{})}function NH(q={},$=[]){let K=Iq(q.splitter,Oq,Dj),P=q7(q.format)?q.format:{hash:"%H",date:q.strictDate===!1?"%ai":"%aI",message:"%s",refs:"%D",body:q.multiLine?"%B":"%b",author_name:q.mailMap!==!1?"%aN":"%an",author_email:q.mailMap!==!1?"%aE":"%ae"},[_,j]=ER(P,K),Y=[],w=[`--pretty=format:${Ej}${j}${pj}`,...$],O=q.n||q["max-count"]||q.maxCount;if(O)w.push(`--max-count=${O}`);if(q.from||q.to){let v=q.symmetric!==!1?"...":"..";Y.push(`${q.from||""}${v}${q.to||""}`)}if(Oq(q.file))w.push("--follow",$j(q.file));return hj(pR(q),w),{fields:_,splitter:K,commands:[...w,...Y]}}function DR(q,$,K){let P=hH(q,$,mj(K));return{commands:["log",...K],format:"utf-8",parser:P}}function yR(){return{log(...K){let P=wq(arguments),_=NH(Vj(arguments),t$(Iq(arguments[0],kP,[]))),j=$(...K)||_7(_.commands)||q(_);return this._runTask(j,P)}};function q(K){return DR(K.splitter,K.fields,K.commands)}function $(K,P){return Oq(K)&&Oq(P)&&iq("git.log(string, string) should be replaced with git.log({ from: string, to: string })")}}function Q3(q){return q.objects=q.objects||{compressing:0,counting:0,enumerating:0,packReused:0,reused:{count:0,delta:0},total:{count:0,delta:0}}}function FW(q){let $=/^\s*(\d+)/.exec(q),K=/delta (\d+)/i.exec(q);return{count:qq($&&$[1]||"0"),delta:qq(K&&K[1]||"0")}}function mH(q,$){return tq({remoteMessages:new EH},IH,$)}function xR(q,$){let K=tq(new uH,DH,[q,$]);return K.message&&K}function jT(q){if(!q.length)return iq("Git.merge requires at least one option");return{commands:["merge",...q],format:"utf-8",parser($,K){let P=dH($,K);if(P.failed)throw new HP(P);return P}}}function lR(q,$,K){let P=K.includes("deleted"),_=K.includes("tag")||/^refs\/tags/.test(q),j=!K.includes("new");return{deleted:P,tag:_,branch:!_,new:!j,alreadyUpdated:j,local:q,remote:$}}function aR(q={},$){return W6($,"--tags"),Lj(q,$)}function Lj(q={},$){let K=["push",...$];if(q.branch)K.splice(1,0,q.branch);if(q.remote)K.splice(1,0,q.remote);return s4(K,"-v"),W6(K,"--verbose"),W6(K,"--porcelain"),{commands:K,format:"utf-8",parser:LH}}function rR(){return{showBuffer(){let q=["show",...gq(arguments,1)];if(!q.includes("--binary"))q.splice(1,0,"--binary");return this._runTask(rT(q),wq(arguments))},show(){let q=["show",...gq(arguments,1)];return this._runTask(xq(q),wq(arguments))}}}function OT(q){let[$,K]=q.split(a$);return{from:K||$,to:$}}function K6(q,$,K){return[`${q}${$}`,K]}function qj(q,...$){return $.map((K)=>K6(q,K,(P,_)=>P.conflicted.push(_)))}function BR(q,$){let K=$.trim();switch(" "){case K.charAt(2):return P(K.charAt(0),K.charAt(1),K.slice(3));case K.charAt(1):return P(" ",K.charAt(0),K.slice(2));default:return}function P(_,j,Y){let w=`${_}${j}`,O=cH.get(w);if(O)O(q,Y);if(w!=="##"&&w!=="!!")q.files.push(new nH(Y,_,j))}}function UR(q){return{format:"utf-8",commands:["status","--porcelain","-b","-u","--null",...q.filter((K)=>!oH.includes(K))],parser(K){return lH(K)}}}function e4(q=0,$=0,K=0,P="",_=!0){return Object.defineProperty({major:q,minor:$,patch:K,agent:P,installed:_},"toString",{value(){return`${this.major}.${this.minor}.${this.patch}`},configurable:!1,enumerable:!1})}function sR(){return e4(0,0,0,"",!1)}function QR(){return{version(){return this._runTask({commands:["--version"],format:"utf-8",parser:qm,onError(q,$,K,P){if(q.exitCode===-2)return K(Buffer.from(gj));P($)}})}}}function qm(q){if(q===gj)return sR();return tq(e4(0,0,0,q),aH,q)}function WT(q,$,K,...P){if(!Oq(K))return iq(`git.${q}() requires a string 'repoPath'`);return $(K,Iq(P[0],Oq),gq(arguments))}function Km(){return{clone(q,...$){return this._runTask(WT("clone",Hj,Iq(q,Oq),...$),wq(arguments))},mirror(q,...$){return this._runTask(WT("mirror",rH,Iq(q,Oq),...$),wq(arguments))}}}function Ym(q,$){return xq(["apply",...$,...q])}function vm(q,$){return{branch:q,hash:$,success:!0}}function Om(q){return{branch:q,hash:null,success:!1}}function sH(q,$){return $===1&&Zj.test(q)}function ZT(q){return q?q.charAt(0):""}function qJ(q,$=!1){return tq(new QH,$?[KJ]:$J,q)}function _J(q){let $=["-d","-D","--delete"];return q.some((K)=>$.includes(K))}function Jm(q){let $=_J(q),K=q.includes("--show-current"),P=["branch",...q];if(P.length===1)P.push("-a");if(!P.includes("-v"))P.splice(1,0,"-v");return{format:"utf-8",commands:P,parser(_,j){if($)return j7(_,j).all[0];return qJ(_,K)}}}function Zm(){return{format:"utf-8",commands:["branch","-v"],parser(q){return qJ(q)}}}function km(q,$=!1){return{format:"utf-8",commands:["branch","-v",$?"-D":"-d",...q],parser(K,P){return j7(K,P)},onError({exitCode:K,stdOut:P},_,j,Y){if(!sH(String(_),K))return Y(_);j(P)}}}function Xm(q,$=!1){let K={format:"utf-8",commands:["branch","-v",$?"-D":"-d",q],parser(P,_){return j7(P,_).branches[q]},onError({exitCode:P,stdErr:_,stdOut:j},Y,w,O){if(!sH(String(Y),P))return O(Y);throw new HP(K.parser(TP(j),TP(_)),String(Y))}};return K}function Gm(q){let $=q.trim().replace(/^["']|["']$/g,"");return $&&Am($)}function Vm(q){return{commands:["check-ignore",...q],format:"utf-8",parser:jJ}}function Cm(q,$){return tq({raw:q,remote:null,branches:[],tags:[],updated:[],deleted:[]},wJ,[q,$])}function Sm(q){return/^--upload-pack(=|$)/.test(q)}function bm(q,$,K){let P=["fetch",...K];if(q&&$)P.push(q,$);if(P.find(Sm))return iq("git.fetch: potential exploit argument blocked.");return{commands:P,format:"utf-8",parser:Cm}}function Rm(q){return tq({moves:[]},OJ,q)}function Im(q,$){return{commands:["mv","-v",...d6(q),$],format:"utf-8",parser:Rm}}function pm(q,$,K){let P=["pull",...K];if(q&&$)P.splice(1,0,q,$);return{commands:P,format:"utf-8",parser(_,j){return dj(_,j)},onError(_,j,Y,w){let O=xR(TP(_.stdOut),TP(_.stdErr));if(O)return w(new HP(O));w(j)}}}function ym(q){let $={};return TJ(q,([K])=>$[K]={name:K}),Object.values($)}function dm(q){let $={};return TJ(q,([K,P,_])=>{if(!Object.hasOwn($,K))$[K]={name:K,refs:{fetch:"",push:""}};if(_&&P)$[K].refs[_.replace(/[^a-z]/g,"")]=P}),Object.values($)}function TJ(q,$){fj(q,(K)=>$(K.split(/\s+/)))}function gm(q,$,K){return xq(["remote","add",...K,q,$])}function xm(q){let $=["remote"];if(q)$.push("-v");return{commands:$,format:"utf-8",parser:q?dm:ym}}function nm(q){let $=[...q];if($[0]!=="ls-remote")$.unshift("ls-remote");return xq($)}function cm(q){let $=[...q];if($[0]!=="remote")$.unshift("remote");return xq($)}function lm(q){return xq(["remote","remove",q])}function am(q={},$){let K=NH(q),P=["stash","list",...K.commands,...$],_=hH(K.splitter,K.fields,mj(P));return _7(P)||{commands:P,format:"utf-8",parser:_}}function im(q,$){return Y7(["add",q,$])}function tm(q){return Y7(["init",...q])}function Y7(q){let $=[...q];if($[0]!=="submodule")$.unshift("submodule");return xq($)}function Bm(q){return Y7(["update",...q])}function Um(q,$){let K=Number.isNaN(q),P=Number.isNaN($);if(K!==P)return K?1:-1;return K?kJ(q,$):0}function kJ(q,$){return q===$?0:q>$?1:-1}function Fm(q){return q.trim()}function c4(q){if(typeof q==="string")return parseInt(q.replace(/^\D+/g,""),10)||0;return 0}function Qm(q=[]){let $=q.some((K)=>/^--sort=/.test(K));return{format:"utf-8",commands:["tag","-l",...q],parser(K){return XJ(K,$)}}}function qI(q){return{format:"utf-8",commands:["tag",q],parser(){return{name:q}}}}function $I(q,$){return{format:"utf-8",commands:["tag","-a","-m",$,q],parser(){return{name:q}}}}function jI(q){if(!q)return;return[{type:"spawn.before",action(P,_){if(q.aborted)_.kill(new t6(void 0,"abort","Abort already signaled"))}},{type:"spawn.after",action(P,_){function j(){_.kill(new t6(void 0,"abort","Abort signal received"))}q.addEventListener("abort",j),_.spawned.on("close",()=>q.removeEventListener("abort",j))}}]}function YI(q){return typeof q==="string"&&q.trim().toLowerCase()==="-c"}function wI(q,$){if(typeof $!=="string"||!$.includes(q))return!1;let K=$.trim().replace(/\0/g,"");return/^(--no)?-{1,2}[\dlsqvnobucj]+(\s|$)/.test(K)}function OP(q,$,K=String(q)){let P=typeof q==="string"?new RegExp(`\\s*${q}`,"i"):q;return function(j,Y,w){if(j[$]!==!0&&YI(Y)&&P.test(w))throw new t6(void 0,"unsafe",`Configuring ${K} is not permitted without enabling ${$}`)}}function OI(q,$){if(/^\s*--(upload|receive)-pack/.test(q))throw new t6(void 0,"unsafe","Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");if($==="clone"&&wI("u",q))throw new t6(void 0,"unsafe","Use of clone with option -u is not permitted without enabling allowUnsafePack");if($==="push"&&/^\s*--exec\b/.test(q))throw new t6(void 0,"unsafe","Use of push with option --exec is not permitted without enabling allowUnsafePack")}function zI({allowUnsafePack:q=!1,...$}={}){return{type:"spawn.args",action(K,P){return K.forEach((_,j)=>{let Y=j<K.length?K[j+1]:"";q||OI(_,P.method),vI.forEach((w)=>w($,_,Y))}),K}}}function WI(q){let $=WP(q,"-c");return{type:"spawn.args",action(K){return[...$,...K]}}}function TI({onClose:q=!0,onExit:$=50}={}){function K(){let _=-1,j={close:o$.deferred(),closeTimeout:o$.deferred(),exit:o$.deferred(),exitTimeout:o$.deferred()},Y=Promise.race([q===!1?XT:j.closeTimeout.promise,$===!1?XT:j.exitTimeout.promise]);return P(q,j.close,j.closeTimeout),P($,j.exit,j.exitTimeout),{close(w){_=w,j.close.done()},exit(w){_=w,j.exit.done()},get exitCode(){return _},result:Y}}function P(_,j,Y){if(_===!1)return;(_===!0?j.promise:j.promise.then(()=>Kj(_))).then(Y.done)}return{type:"spawn.after",async action(_,{spawned:j,close:Y}){let w=K(),O=!0,v=()=>void(O=!1);j.stdout?.on("data",v),j.stderr?.on("data",v),j.on("error",v),j.on("close",(z)=>w.close(z)),j.on("exit",(z)=>w.exit(z));try{if(await w.result,O)await Kj(50);Y(w.exitCode)}catch(z){Y(w.exitCode,z)}}}}function JI(q){return!q||!/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(q)}function AT(q,$){if(q.length<1||q.length>2)throw new t6(void 0,"binary",HI);if(q.some(JI))if($)console.warn(fT);else throw new t6(void 0,"binary",fT);let[P,_]=q;return{binary:P,prefix:_}}function ZI(q,$=["git"],K=!1){let P=AT(d6($),K);q.on("binary",(_)=>{P=AT(d6(_),K)}),q.append("spawn.binary",()=>{return P.binary}),q.append("spawn.args",(_)=>{return P.prefix?[P.prefix,..._]:_})}function kI(q){return!!(q.exitCode&&q.stdErr.length)}function XI(q){return Buffer.concat([...q.stdOut,...q.stdErr])}function fI(q=!1,$=kI,K=XI){return(P,_)=>{if(!q&&P||!$(_))return P;return K(_)}}function GT(q){return{type:"task.error",action($,K){let P=q($.error,{stdErr:K.stdErr,stdOut:K.stdOut,exitCode:K.exitCode});if(Buffer.isBuffer(P))return{error:new B6(void 0,P.toString("utf-8"))};return{error:P}}}}function hI(q){let K=["checkout","clone","fetch","pull","push"];return[{type:"spawn.args",action(j,Y){if(!K.includes(Y.method))return j;return uT(j,"--progress")}},{type:"spawn.after",action(j,Y){if(!Y.commands.includes("--progress"))return;Y.spawned.stderr?.on("data",(w)=>{let O=/^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(w.toString("utf8"));if(!O)return;q({method:Y.method,stage:VI(O[1]),progress:qq(O[2]),processed:qq(O[3]),total:qq(O[4])})})}}]}function VI(q){return String(q.toLowerCase().split(" ",1))||"unknown"}function MI(q){let $=mT(q,["uid","gid"]);return{type:"spawn.options",action(K){return{...$,...K}}}}function CI({block:q,stdErr:$=!0,stdOut:K=!0}){if(q>0)return{type:"spawn.after",action(P,_){let j;function Y(){j&&clearTimeout(j),j=setTimeout(O,q)}function w(){_.spawned.stdout?.off("data",Y),_.spawned.stderr?.off("data",Y),_.spawned.off("exit",w),_.spawned.off("close",w),j&&clearTimeout(j)}function O(){w(),_.kill(new t6(void 0,"timeout","block timeout reached"))}K&&_.spawned.stdout?.on("data",Y),$&&_.spawned.stderr?.on("data",Y),_.spawned.on("exit",w),_.spawned.on("close",w),Y()}}}function NI(){return{type:"spawn.args",action(q){let $=[],K;function P(_){(K=K||[]).push(..._)}for(let _=0;_<q.length;_++){let j=q[_];if(zP(j)){P(oW(j));continue}if(j==="--"){P(q.slice(_+1).flatMap((Y)=>zP(Y)&&oW(Y)||Y));break}$.push(j)}return!K?$:[...$,"--",...K.map(String)]}}}function bI(q,$){let K=new GI,P=pT(q&&(typeof q==="string"?{baseDir:q}:q)||{},$);if(!Aj(P.baseDir))throw new _I(P,"Cannot use simple-git on a directory that does not exist");if(Array.isArray(P.config))K.add(WI(P.config));return K.add(zI(P.unsafe)),K.add(TI(P.completion)),P.abort&&K.add(jI(P.abort)),P.progress&&K.add(hI(P.progress)),P.timeout&&K.add(CI(P.timeout)),P.spawnOptions&&K.add(MI(P.spawnOptions)),K.add(NI()),K.add(GT(fI(!0))),P.errors&&K.add(GT(P.errors)),ZI(K,P.binary,P.unsafe?.allowUnsafeCustomBinary),new SI(P,K)}var F4,B4,BH,o$,kj,Zu,Xj,ku,D=(q,$)=>function(){return q&&($=(0,q[Xj(q)[0]])(q=0)),$},Xu=(q,$)=>function(){return $||(0,q[Xj(q)[0]])(($={exports:{}}).exports,$),$.exports},Aq=(q,$)=>{for(var K in $)kj(q,K,{get:$[K],enumerable:!0})},fu=(q,$,K,P)=>{if($&&typeof $==="object"||typeof $==="function"){for(let _ of Xj($))if(!ku.call(q,_)&&_!==K)kj(q,_,{get:()=>$[_],enumerable:!(P=Zu($,_))||P.enumerable})}return q},kq=(q)=>fu(kj({},"__esModule",{value:!0}),q),U4,r$,B6,X8,HP,i$,hT,VT,a$,U8,ZP,Q4,kP,ET,Oq,i4,$7,Gj,jj,Gu,t4,hu,r,k8,Mu,DT,Cu,Su,bu,yT,a,dT,wj,K7,Mj,xT,nT,cT,lT,oT,Iu,vj,P7,Xq,BT,Cj,Nj,Sj,l4,bj,UT,sT,cu,Oj,QT,U3,qH,$H,KH,vP,aW,PH,_H,jH,o4,wH,vH,OH,zH,qR,zj,PR,WH,TH,_R,wR,vR,zR,HH,HR,JH,ZR,fR,GR,VR,a4,ZH,kH,CR,Rj,bR,Ij,XP,XH,RR,s3,BW,eW,UW,AH,GH,Ej,pj,Dj,VH,MH,CH,yj,Wj,SH,r4,bH,dR,Tj,uH,LR,RH,gR,IH,EH,pH,sW,QW,qT,$T,DH,KT,dj,yH,PT,dH,_T,nR,cR,YT,LH,wT,oR,gH,xH,iR,vT,nH,tR,zT,cH,lH,eR,oH,FR,gj,aH,$m,Hj,rH,Pm,iH,Jj,_m,tH,TT,eH,jm,UH,wm,FH,zm,HT,Zj,JT,j7,Wm,QH,Tm,$J,KJ,Hm,PJ,fm,jJ,hm,YJ,Mm,wJ,Nm,vJ,um,OJ,mm,zJ,Em,WJ,Dm,Lm,HJ,om,JJ,rm,ZJ,em,kT,XJ,sm,fJ,KI,PI,_I,t6,vI,XT,HI="Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings",fT="Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option",GI=class{constructor(){this.plugins=new Set,this.events=new AI}on(q,$){this.events.on(q,$)}reconfigure(q,$){this.events.emit(q,$)}append(q,$){let K=W6(this.plugins,{type:q,action:$});return()=>this.plugins.delete(K)}add(q){let $=[];return d6(q).forEach((K)=>K&&this.plugins.add(W6($,K))),()=>{$.forEach((K)=>this.plugins.delete(K))}}exec(q,$,K){let P=$,_=Object.freeze(Object.create(K));for(let j of this.plugins)if(j.type===q)P=j.action(P,_);return P}},SI,AJ;var GJ=eq(()=>{F4=P$(nW(),1),B4=P$(r3(),1),BH=P$(B3(),1),o$=P$(B3(),1),kj=Object.defineProperty,Zu=Object.getOwnPropertyDescriptor,Xj=Object.getOwnPropertyNames,ku=Object.prototype.hasOwnProperty;r$=D({"src/lib/args/pathspec.ts"(){U4=new WeakMap}}),X8=D({"src/lib/errors/git-error.ts"(){B6=class extends Error{constructor(q,$){super($);this.task=q,Object.setPrototypeOf(this,new.target.prototype)}}}}),i$=D({"src/lib/errors/git-response-error.ts"(){X8(),HP=class extends B6{constructor(q,$){super(void 0,$||String(q));this.git=q}}}}),VT=D({"src/lib/errors/task-configuration-error.ts"(){X8(),hT=class extends B6{constructor(q){super(void 0,q)}}}});Q4=D({"src/lib/utils/util.ts"(){Gj(),a$="\x00",U8=()=>{},ZP=Object.prototype.toString.call.bind(Object.prototype.toString)}});Gj=D({"src/lib/utils/argument-filters.ts"(){r$(),Q4(),kP=(q)=>{return Array.isArray(q)},ET=(q)=>{return typeof q==="number"},Oq=(q)=>{return typeof q==="string"||zP(q)},i4=(q)=>{return Oq(q)||Array.isArray(q)&&q.every(Oq)},$7=(q)=>{if(q==null||"number|boolean|function".includes(typeof q))return!1;return typeof q.length==="number"}}}),Gu=D({"src/lib/utils/exit-codes.ts"(){jj=((q)=>{return q[q.SUCCESS=0]="SUCCESS",q[q.ERROR=1]="ERROR",q[q.NOT_FOUND=-2]="NOT_FOUND",q[q.UNCLEAN=128]="UNCLEAN",q})(jj||{})}}),hu=D({"src/lib/utils/git-output-streams.ts"(){t4=class q{constructor($,K){this.stdOut=$,this.stdErr=K}asStrings(){return new q(this.stdOut.toString("utf8"),this.stdErr.toString("utf8"))}}}});Mu=D({"src/lib/utils/line-parser.ts"(){r=class{constructor(q,$){if(this.matches=[],this.useMatches=Vu,this.parse=(K,P)=>{if(this.resetMatches(),!this._regExp.every((_,j)=>this.addMatch(_,j,K(j))))return!1;return this.useMatches(P,this.prepareMatches())!==!1},this._regExp=Array.isArray(q)?q:[q],$)this.useMatches=$}resetMatches(){this.matches.length=0}prepareMatches(){return this.matches}addMatch(q,$,K){let P=K&&q.exec(K);if(P)this.pushMatch($,P);return!!P}pushMatch(q,$){this.matches.push(...$.slice(1))}},k8=class extends r{addMatch(q,$,K){return/^remote:\s/.test(String(K))&&super.addMatch(q,$,K)}pushMatch(q,$){if(q>0||$.length>1)super.pushMatch(q,$)}}}});Cu=D({"src/lib/utils/simple-git-options.ts"(){DT={binary:"git",maxConcurrentProcesses:5,config:[],trimmed:!1}}});Su=D({"src/lib/utils/task-options.ts"(){Gj(),Q4(),r$()}});bu=D({"src/lib/utils/task-parser.ts"(){Q4()}}),yT={};Aq(yT,{ExitCodes:()=>jj,GitOutputStreams:()=>t4,LineParser:()=>r,NOOP:()=>U8,NULL:()=>a$,RemoteLineParser:()=>k8,append:()=>W6,appendTaskOptions:()=>hj,asArray:()=>d6,asCamelCase:()=>RT,asFunction:()=>MT,asNumber:()=>qq,asStringArray:()=>t$,bufferToString:()=>TP,callTaskParser:()=>Yj,createInstanceConfig:()=>pT,delay:()=>Kj,filterArray:()=>kP,filterFunction:()=>IT,filterHasLength:()=>$7,filterNumber:()=>ET,filterPlainObject:()=>q7,filterPrimitives:()=>_j,filterString:()=>Oq,filterStringOrStringArray:()=>i4,filterType:()=>Iq,first:()=>ST,folderExists:()=>Aj,forEachLineWithContent:()=>fj,getTrailingOptions:()=>gq,including:()=>uT,isUserFunction:()=>CT,last:()=>e8,objectToString:()=>ZP,orVoid:()=>Pj,parseStringResponse:()=>tq,pick:()=>mT,prefixedArray:()=>WP,remove:()=>s4,splitOn:()=>NT,toLinesWithContent:()=>JP,trailingFunctionArgument:()=>wq,trailingOptionsArgument:()=>Vj});a=D({"src/lib/utils/index.ts"(){Gj(),Gu(),hu(),Mu(),Cu(),Su(),bu(),Q4()}}),dT={};Aq(dT,{CheckRepoActions:()=>wj,checkIsBareRepoTask:()=>gT,checkIsRepoRootTask:()=>LT,checkIsRepoTask:()=>uu});xT=D({"src/lib/tasks/check-is-repo.ts"(){a(),wj=((q)=>{return q.BARE="bare",q.IN_TREE="tree",q.IS_REPO_ROOT="root",q})(wj||{}),K7=({exitCode:q},$,K,P)=>{if(q===128&&Ru($))return K(Buffer.from("false"));P($)},Mj=(q)=>{return q.trim()==="true"}}});Iu=D({"src/lib/responses/CleanSummary.ts"(){a(),nT=class{constructor(q){this.dryRun=q,this.paths=[],this.files=[],this.folders=[]}},cT=/^[a-z]+\s*/i,lT=/^[a-z]+\s+[a-z]+\s*/i,oT=/\/$/}}),vj={};Aq(vj,{EMPTY_COMMANDS:()=>P7,adhocExecTask:()=>aT,configurationErrorTask:()=>iq,isBufferTask:()=>iT,isEmptyTask:()=>tT,straightThroughBufferTask:()=>rT,straightThroughStringTask:()=>xq});Xq=D({"src/lib/tasks/task.ts"(){VT(),P7=[]}}),BT={};Aq(BT,{CONFIG_ERROR_INTERACTIVE_MODE:()=>Cj,CONFIG_ERROR_MODE_REQUIRED:()=>Nj,CONFIG_ERROR_UNKNOWN_OPTION:()=>Sj,CleanOptions:()=>l4,cleanTask:()=>eT,cleanWithOptionsTask:()=>Eu,isCleanOptionsArray:()=>pu});UT=D({"src/lib/tasks/clean.ts"(){Iu(),a(),Xq(),Cj="Git clean interactive mode is not supported",Nj='Git clean mode parameter ("n" or "f") is required',Sj="Git clean unknown option found in: ",l4=((q)=>{return q.DRY_RUN="n",q.FORCE="f",q.IGNORED_INCLUDED="x",q.IGNORED_ONLY="X",q.EXCLUDING="e",q.QUIET="q",q.RECURSIVE="d",q})(l4||{}),bj=new Set(["i",...t$(Object.values(l4))])}});cu=D({"src/lib/responses/ConfigList.ts"(){a(),sT=class{constructor(){this.files=[],this.values=Object.create(null)}get all(){if(!this._all)this._all=this.files.reduce((q,$)=>{return Object.assign(q,this.values[$])},{});return this._all}addFile(q){if(!(q in this.values)){let $=e8(this.files);this.values[q]=$?Object.create(this.values[$]):{},this.files.push(q)}return this.values[q]}addValue(q,$,K){let P=this.addFile(q);if(!Object.hasOwn(P,$))P[$]=K;else if(Array.isArray(P[$]))P[$].push(K);else P[$]=[P[$],K];this._all=void 0}}}});QT=D({"src/lib/tasks/config.ts"(){cu(),a(),Oj=((q)=>{return q.system="system",q.global="global",q.local="local",q.worktree="worktree",q})(Oj||{})}});$H=D({"src/lib/tasks/diff-name-status.ts"(){U3=((q)=>{return q.ADDED="A",q.COPIED="C",q.DELETED="D",q.MODIFIED="M",q.RENAMED="R",q.CHANGED="T",q.UNMERGED="U",q.UNKNOWN="X",q.BROKEN="B",q})(U3||{}),qH=new Set(Object.values(U3))}});_H=D({"src/lib/tasks/grep.ts"(){a(),Xq(),KH=["-h"],vP=Symbol("grepQuery"),PH=class{constructor(){this[aW]=[]}*[(aW=vP,Symbol.iterator)](){for(let q of this[vP])yield q}and(...q){return q.length&&this[vP].push("--and","(",...WP(q,"-e"),")"),this}param(...q){return this[vP].push(...WP(q,"-e")),this}}}}),jH={};Aq(jH,{ResetMode:()=>o4,getResetMode:()=>Fu,resetTask:()=>Uu});vH=D({"src/lib/tasks/reset.ts"(){a(),Xq(),o4=((q)=>{return q.MIXED="mixed",q.SOFT="soft",q.HARD="hard",q.MERGE="merge",q.KEEP="keep",q})(o4||{}),wH=t$(Object.values(o4))}});OH=D({"src/lib/git-logger.ts"(){a(),B4.default.formatters.L=(q)=>String($7(q)?q.length:"-"),B4.default.formatters.B=(q)=>{if(Buffer.isBuffer(q))return q.toString("utf8");return ZP(q)}}}),qR=D({"src/lib/runners/tasks-pending-queue.ts"(){X8(),OH(),zH=class q{constructor($="GitExecutor"){this.logLabel=$,this._queue=new Map}withProgress($){return this._queue.get($)}createProgress($){let K=q.getName($.commands[0]),P=uj(this.logLabel,K);return{task:$,logger:P,name:K}}push($){let K=this.createProgress($);return K.logger("Adding task to the queue, commands = %o",$.commands),this._queue.set($,K),K}fatal($){for(let[K,{logger:P}]of Array.from(this._queue.entries())){if(K===$.task)P.info("Failed %o",$),P("Fatal exception, any as-yet un-started tasks run through this executor will not be attempted");else P.info("A fatal exception occurred in a previous task, the queue has been purged: %o",$.message);this.complete(K)}if(this._queue.size!==0)throw Error(`Queue size should be zero after fatal: ${this._queue.size}`)}complete($){if(this.withProgress($))this._queue.delete($)}attempt($){let K=this.withProgress($);if(!K)throw new B6(void 0,"TasksPendingQueue: attempt called for an unknown task");return K.logger("Starting task"),K}static getName($="empty"){return`task:${$}:${++q.counter}`}static{this.counter=0}}}});PR=D({"src/lib/runners/git-executor-chain.ts"(){X8(),Xq(),a(),qR(),zj=class{constructor(q,$,K){this._executor=q,this._scheduler=$,this._plugins=K,this._chain=Promise.resolve(),this._queue=new zH}get cwd(){return this._cwd||this._executor.cwd}set cwd(q){this._cwd=q}get env(){return this._executor.env}get outputHandler(){return this._executor.outputHandler}chain(){return this}push(q){return this._queue.push(q),this._chain=this._chain.then(()=>this.attemptTask(q))}async attemptTask(q){let $=await this._scheduler.next(),K=()=>this._queue.complete(q);try{let{logger:P}=this._queue.attempt(q);return await(tT(q)?this.attemptEmptyTask(q,P):this.attemptRemoteTask(q,P))}catch(P){throw this.onFatalException(q,P)}finally{K(),$()}}onFatalException(q,$){let K=$ instanceof B6?Object.assign($,{task:q}):new B6(q,$&&String($));return this._chain=Promise.resolve(),this._queue.fatal(K),K}async attemptRemoteTask(q,$){let K=this._plugins.exec("spawn.binary","",B8(q,q.commands)),P=this._plugins.exec("spawn.args",[...q.commands],B8(q,q.commands)),_=await this.gitResponse(q,K,P,this.outputHandler,$.step("SPAWN")),j=await this.handleTaskData(q,P,_,$.step("HANDLE"));if($("passing response to task's parser as a %s",q.format),iT(q))return Yj(q.parser,j);return Yj(q.parser,j.asStrings())}async attemptEmptyTask(q,$){return $("empty task bypassing child process to call to task's parser"),q.parser(this)}handleTaskData(q,$,K,P){let{exitCode:_,rejection:j,stdOut:Y,stdErr:w}=K;return new Promise((O,v)=>{P("Preparing to handle process response exitCode=%d stdOut=",_);let{error:z}=this._plugins.exec("task.error",{error:j},{...B8(q,$),...K});if(z&&q.onError)return P.info("exitCode=%s handling with custom error handler"),q.onError(K,z,(W)=>{P.info("custom error handler treated as success"),P("custom error returned a %s",ZP(W)),O(new t4(Array.isArray(W)?Buffer.concat(W):W,Buffer.concat(w)))},v);if(z)return P.info("handling as error: exitCode=%s stdErr=%s rejection=%o",_,w.length,j),v(z);P.info("retrieving task output complete"),O(new t4(Buffer.concat(Y),Buffer.concat(w)))})}async gitResponse(q,$,K,P,_){let j=_.sibling("output"),Y=this._plugins.exec("spawn.options",{cwd:this.cwd,env:this.env,windowsHide:!0},B8(q,q.commands));return new Promise((w)=>{let O=[],v=[];_.info("%s %o",$,K),_("%O",Y);let z=this._beforeSpawn(q,K);if(z)return w({stdOut:O,stdErr:v,exitCode:9901,rejection:z});this._plugins.exec("spawn.before",void 0,{...B8(q,K),kill(T){z=T||z}});let W=$R($,K,Y);if(W.stdout.on("data",iW(O,"stdOut",_,j.step("stdOut"))),W.stderr.on("data",iW(v,"stdErr",_,j.step("stdErr"))),W.on("error",KR(v,_)),P)_("Passing child process stdOut/stdErr to custom outputHandler"),P($,W.stdout,W.stderr,[...K]);this._plugins.exec("spawn.after",void 0,{...B8(q,K),spawned:W,close(T,H){w({stdOut:O,stdErr:v,exitCode:T,rejection:z||H})},kill(T){if(W.killed)return;z=T,W.kill("SIGINT")}})})}_beforeSpawn(q,$){let K;return this._plugins.exec("spawn.before",void 0,{...B8(q,$),kill(P){K=P||K}}),K}}}}),WH={};Aq(WH,{GitExecutor:()=>TH});_R=D({"src/lib/runners/git-executor.ts"(){PR(),TH=class{constructor(q,$,K){this.cwd=q,this._scheduler=$,this._plugins=K,this._chain=new zj(this,this._scheduler,this._plugins)}chain(){return new zj(this,this._scheduler,this._plugins)}push(q){return this._chain.push(q)}}}});wR=D({"src/lib/task-callback.ts"(){i$(),a()}});vR=D({"src/lib/tasks/change-working-directory.ts"(){a(),Xq()}});zR=D({"src/lib/tasks/checkout.ts"(){a(),Xq()}});HR=D({"src/lib/tasks/count-objects.ts"(){a(),HH=new r(/([a-z-]+): (\d+)$/,(q,[$,K])=>{let P=RT($);if(Object.hasOwn(q,P))q[P]=qq(K)})}});ZR=D({"src/lib/parsers/parse-commit.ts"(){a(),JH=[new r(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/,(q,[$,K,P])=>{q.branch=$,q.commit=P,q.root=!!K}),new r(/\s*Author:\s(.+)/i,(q,[$])=>{let K=$.split("<"),P=K.pop();if(!P||!P.includes("@"))return;q.author={email:P.substr(0,P.length-1),name:K.join("<").trim()}}),new r(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,(q,[$,K,P])=>{q.summary.changes=parseInt($,10)||0,q.summary.insertions=parseInt(K,10)||0,q.summary.deletions=parseInt(P,10)||0}),new r(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,(q,[$,K,P])=>{q.summary.changes=parseInt($,10)||0;let _=parseInt(K,10)||0;if(P==="-")q.summary.deletions=_;else if(P==="+")q.summary.insertions=_})]}});fR=D({"src/lib/tasks/commit.ts"(){ZR(),a(),Xq()}});GR=D({"src/lib/tasks/first-commit.ts"(){a(),Xq()}});VR=D({"src/lib/tasks/hash-object.ts"(){Xq()}});CR=D({"src/lib/responses/InitSummary.ts"(){a4=class{constructor(q,$,K,P){this.bare=q,this.path=$,this.existing=K,this.gitDir=P}},ZH=/^Init.+ repository in (.+)$/,kH=/^Rein.+ in (.+)$/}});bR=D({"src/lib/tasks/init.ts"(){CR(),Rj="--bare"}});XP=D({"src/lib/args/log-format.ts"(){Ij=/^--(stat|numstat|name-only|name-status)(=|$)/}}),RR=D({"src/lib/responses/DiffSummary.ts"(){XH=class{constructor(){this.changed=0,this.deletions=0,this.insertions=0,this.files=[]}}}});GH=D({"src/lib/parsers/parse-diff-summary.ts"(){XP(),RR(),$H(),a(),s3=[new r(/^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,(q,[$,K,P=""])=>{q.files.push({file:$.trim(),changes:qq(K),insertions:P.replace(/[^+]/g,"").length,deletions:P.replace(/[^-]/g,"").length,binary:!1})}),new r(/^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,(q,[$,K,P])=>{q.files.push({file:$.trim(),before:qq(K),after:qq(P),binary:!0})}),new r(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,(q,[$,K])=>{let P=/(\d+) i/.exec(K),_=/(\d+) d/.exec(K);q.changed=qq($),q.insertions=qq(P?.[1]),q.deletions=qq(_?.[1])})],BW=[new r(/(\d+)\t(\d+)\t(.+)$/,(q,[$,K,P])=>{let _=qq($),j=qq(K);q.changed++,q.insertions+=_,q.deletions+=j,q.files.push({file:P,changes:_+j,insertions:_,deletions:j,binary:!1})}),new r(/-\t-\t(.+)$/,(q,[$])=>{q.changed++,q.files.push({file:$,after:0,before:0,binary:!0})})],eW=[new r(/(.+)$/,(q,[$])=>{q.changed++,q.files.push({file:$,changes:0,insertions:0,deletions:0,binary:!1})})],UW=[new r(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,(q,[$,K,P,_,j])=>{q.changed++,q.files.push({file:j??P,changes:0,insertions:0,deletions:0,binary:!1,status:Pj(iu($)&&$),from:Pj(!!j&&P!==j&&P),similarity:qq(K)})})],AH={[""]:s3,["--stat"]:s3,["--numstat"]:BW,["--name-status"]:UW,["--name-only"]:eW}}});MH=D({"src/lib/parsers/parse-list-log-summary.ts"(){a(),GH(),XP(),Ej="òòòòòò ",pj=" òò",Dj=" ò ",VH=["hash","date","message","refs","author_name","author_email"]}}),CH={};Aq(CH,{diffSummaryTask:()=>IR,validateLogFormatConfig:()=>_7});yj=D({"src/lib/tasks/diff.ts"(){XP(),GH(),Xq()}});SH=D({"src/lib/tasks/log.ts"(){XP(),r$(),MH(),a(),Xq(),yj(),Wj=((q)=>{return q[q["--pretty"]=0]="--pretty",q[q["max-count"]=1]="max-count",q[q.maxCount=2]="maxCount",q[q.n=3]="n",q[q.file=4]="file",q[q.format=5]="format",q[q.from=6]="from",q[q.to=7]="to",q[q.splitter=8]="splitter",q[q.symmetric=9]="symmetric",q[q.mailMap=10]="mailMap",q[q.multiLine=11]="multiLine",q[q.strictDate=12]="strictDate",q})(Wj||{})}}),dR=D({"src/lib/responses/MergeSummary.ts"(){r4=class{constructor(q,$=null,K){this.reason=q,this.file=$,this.meta=K}toString(){return`${this.file}:${this.reason}`}},bH=class{constructor(){this.conflicts=[],this.merges=[],this.result="success"}get failed(){return this.conflicts.length>0}get reason(){return this.result}toString(){if(this.conflicts.length)return`CONFLICTS: ${this.conflicts.join(", ")}`;return"OK"}}}}),LR=D({"src/lib/responses/PullSummary.ts"(){Tj=class{constructor(){this.remoteMessages={all:[]},this.created=[],this.deleted=[],this.files=[],this.deletions={},this.insertions={},this.summary={changes:0,deletions:0,insertions:0}}},uH=class{constructor(){this.remote="",this.hash={local:"",remote:""},this.branch={local:"",remote:""},this.message=""}toString(){return this.message}}}});gR=D({"src/lib/parsers/parse-remote-objects.ts"(){a(),RH=[new k8(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,(q,[$,K])=>{let P=$.toLowerCase(),_=Q3(q.remoteMessages);Object.assign(_,{[P]:qq(K)})}),new k8(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,(q,[$,K])=>{let P=$.toLowerCase(),_=Q3(q.remoteMessages);Object.assign(_,{[P]:qq(K)})}),new k8(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,(q,[$,K,P])=>{let _=Q3(q.remoteMessages);_.total=FW($),_.reused=FW(K),_.packReused=qq(P)})]}});pH=D({"src/lib/parsers/parse-remote-messages.ts"(){a(),gR(),IH=[new k8(/^remote:\s*(.+)$/,(q,[$])=>{return q.remoteMessages.all.push($.trim()),!1}),...RH,new k8([/create a (?:pull|merge) request/i,/\s(https?:\/\/\S+)$/],(q,[$])=>{q.remoteMessages.pullRequestUrl=$}),new k8([/found (\d+) vulnerabilities.+\(([^)]+)\)/i,/\s(https?:\/\/\S+)$/],(q,[$,K,P])=>{q.remoteMessages.vulnerabilities={count:qq($),summary:K,url:P}})],EH=class{constructor(){this.all=[]}}}});yH=D({"src/lib/parsers/parse-pull.ts"(){LR(),a(),pH(),sW=/^\s*(.+?)\s+\|\s+\d+\s*(\+*)(-*)/,QW=/(\d+)\D+((\d+)\D+\(\+\))?(\D+(\d+)\D+\(-\))?/,qT=/^(create|delete) mode \d+ (.+)/,$T=[new r(sW,(q,[$,K,P])=>{if(q.files.push($),K)q.insertions[$]=K.length;if(P)q.deletions[$]=P.length}),new r(QW,(q,[$,,K,,P])=>{if(K!==void 0||P!==void 0)return q.summary.changes=+$||0,q.summary.insertions=+K||0,q.summary.deletions=+P||0,!0;return!1}),new r(qT,(q,[$,K])=>{W6(q.files,K),W6($==="create"?q.created:q.deleted,K)})],DH=[new r(/^from\s(.+)$/i,(q,[$])=>void(q.remote=$)),new r(/^fatal:\s(.+)$/,(q,[$])=>void(q.message=$)),new r(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,(q,[$,K,P,_])=>{q.branch.local=P,q.hash.local=$,q.branch.remote=_,q.hash.remote=K})],KT=(q,$)=>{return tq(new Tj,$T,[q,$])},dj=(q,$)=>{return Object.assign(new Tj,KT(q,$),mH(q,$))}}}),nR=D({"src/lib/parsers/parse-merge.ts"(){dR(),a(),yH(),PT=[new r(/^Auto-merging\s+(.+)$/,(q,[$])=>{q.merges.push($)}),new r(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/,(q,[$,K])=>{q.conflicts.push(new r4($,K))}),new r(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,(q,[$,K,P])=>{q.conflicts.push(new r4($,K,{deleteRef:P}))}),new r(/^CONFLICT\s+\((.+)\):/,(q,[$])=>{q.conflicts.push(new r4($,null))}),new r(/^Automatic merge failed;\s+(.+)$/,(q,[$])=>{q.result=$})],dH=(q,$)=>{return Object.assign(_T(q,$),dj(q,$))},_T=(q)=>{return tq(new bH,PT,q)}}});cR=D({"src/lib/tasks/merge.ts"(){i$(),nR(),Xq()}});oR=D({"src/lib/parsers/parse-push.ts"(){a(),pH(),YT=[new r(/^Pushing to (.+)$/,(q,[$])=>{q.repo=$}),new r(/^updating local tracking ref '(.+)'/,(q,[$])=>{q.ref={...q.ref||{},local:$}}),new r(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/,(q,[$,K,P])=>{q.pushed.push(lR($,K,P))}),new r(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,(q,[$,K,P])=>{q.branch={...q.branch||{},local:$,remote:K,remoteName:P}}),new r(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,(q,[$,K,P,_])=>{q.update={head:{local:$,remote:K},hash:{from:P,to:_}}})],LH=(q,$)=>{let K=wT(q,$),P=mH(q,$);return{...K,...P}},wT=(q,$)=>{return tq({pushed:[]},YT,[q,$])}}}),gH={};Aq(gH,{pushTagsTask:()=>aR,pushTask:()=>Lj});xH=D({"src/lib/tasks/push.ts"(){oR(),a()}});iR=D({"src/lib/tasks/show.ts"(){a(),Xq()}}),tR=D({"src/lib/responses/FileStatusSummary.ts"(){vT=/^(.+)\0(.+)$/,nH=class{constructor(q,$,K){if(this.path=q,this.index=$,this.working_dir=K,$==="R"||K==="R"){let P=vT.exec(q)||[null,q,q];this.from=P[2]||"",this.path=P[1]||""}}}}});eR=D({"src/lib/responses/StatusSummary.ts"(){a(),tR(),zT=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=()=>{return!this.files.length}}},cH=new Map([K6(" ","A",(q,$)=>q.created.push($)),K6(" ","D",(q,$)=>q.deleted.push($)),K6(" ","M",(q,$)=>q.modified.push($)),K6("A"," ",(q,$)=>{q.created.push($),q.staged.push($)}),K6("A","M",(q,$)=>{q.created.push($),q.staged.push($),q.modified.push($)}),K6("D"," ",(q,$)=>{q.deleted.push($),q.staged.push($)}),K6("M"," ",(q,$)=>{q.modified.push($),q.staged.push($)}),K6("M","M",(q,$)=>{q.modified.push($),q.staged.push($)}),K6("R"," ",(q,$)=>{q.renamed.push(OT($))}),K6("R","M",(q,$)=>{let K=OT($);q.renamed.push(K),q.modified.push(K.to)}),K6("!","!",(q,$)=>{(q.ignored=q.ignored||[]).push($)}),K6("?","?",(q,$)=>q.not_added.push($)),...qj("A","A","U"),...qj("D","D","U"),...qj("U","A","D","U"),["##",(q,$)=>{let K=/ahead (\d+)/,P=/behind (\d+)/,_=/^(.+?(?=(?:\.{3}|\s|$)))/,j=/\.{3}(\S*)/,Y=/\son\s(\S+?)(?=\.{3}|$)/,w=K.exec($);if(q.ahead=w&&+w[1]||0,w=P.exec($),q.behind=w&&+w[1]||0,w=_.exec($),q.current=Iq(w?.[1],Oq,null),w=j.exec($),q.tracking=Iq(w?.[1],Oq,null),w=Y.exec($),w)q.current=Iq(w?.[1],Oq,q.current);q.detached=/\(no branch\)/.test($)}]]),lH=function(q){let $=q.split(a$),K=new zT;for(let P=0,_=$.length;P<_;){let j=$[P++].trim();if(!j)continue;if(j.charAt(0)==="R")j+=a$+($[P++]||"");BR(K,j)}return K}}});FR=D({"src/lib/tasks/status.ts"(){eR(),oH=["--null","-z"]}});$m=D({"src/lib/tasks/version.ts"(){a(),gj="installed=false",aH=[new r(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,(q,[$,K,P,_=""])=>{Object.assign(q,e4(qq($),qq(K),qq(P),_))}),new r(/version (\d+)\.(\d+)\.(\D+)(.+)?$/,(q,[$,K,P,_=""])=>{Object.assign(q,e4(qq($),qq(K),P,_))})]}});Pm=D({"src/lib/tasks/clone.ts"(){Xq(),a(),r$(),Hj=(q,$,K)=>{let P=["clone",...K];return Oq(q)&&P.push($j(q)),Oq($)&&P.push($j($)),xq(P)},rH=(q,$,K)=>{return W6(K,"--mirror"),Hj(q,$,K)}}}),iH={};Aq(iH,{SimpleGitApi:()=>Jj});_m=D({"src/lib/simple-git-api.ts"(){wR(),vR(),zR(),HR(),fR(),QT(),GR(),_H(),VR(),bR(),SH(),cR(),xH(),iR(),FR(),Xq(),$m(),a(),Pm(),Jj=class{constructor(q){this._executor=q}_runTask(q,$){let K=this._executor.chain(),P=K.push(q);if($)jR(q,P,$);return Object.create(this,{then:{value:P.then.bind(P)},catch:{value:P.catch.bind(P)},_executor:{value:K}})}add(q){return this._runTask(xq(["add",...d6(q)]),wq(arguments))}cwd(q){let $=wq(arguments);if(typeof q==="string")return this._runTask(tW(q,this._executor),$);if(typeof q?.path==="string")return this._runTask(tW(q.path,q.root&&this._executor||void 0),$);return this._runTask(iq("Git.cwd: workingDirectory must be supplied as a string"),$)}hashObject(q,$){return this._runTask(hR(q,$===!0),wq(arguments))}init(q){return this._runTask(SR(q===!0,this._executor.cwd,gq(arguments)),wq(arguments))}merge(){return this._runTask(jT(gq(arguments)),wq(arguments))}mergeFromTo(q,$){if(!(Oq(q)&&Oq($)))return this._runTask(iq("Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings"));return this._runTask(jT([q,$,...gq(arguments)]),wq(arguments,!1))}outputHandler(q){return this._executor.outputHandler=q,this}push(){let q=Lj({remote:Iq(arguments[0],Oq),branch:Iq(arguments[1],Oq)},gq(arguments));return this._runTask(q,wq(arguments))}stash(){return this._runTask(xq(["stash",...gq(arguments)]),wq(arguments))}status(){return this._runTask(UR(gq(arguments)),wq(arguments))}},Object.assign(Jj.prototype,OR(),Km(),XR(),ru(),TR(),AR(),eu(),yR(),rR(),QR())}}),tH={};Aq(tH,{Scheduler:()=>eH});jm=D({"src/lib/runners/scheduler.ts"(){a(),OH(),TT=(()=>{let q=0;return()=>{q++;let{promise:$,done:K}=BH.createDeferred();return{promise:$,done:K,id:q}}})(),eH=class{constructor(q=2){this.concurrency=q,this.logger=uj("","scheduler"),this.pending=[],this.running=[],this.logger("Constructed, concurrency=%s",q)}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 q=W6(this.running,this.pending.shift());this.logger("Attempting id=%s",q.id),q.done(()=>{this.logger("Completing id=",q.id),s4(this.running,q),this.schedule()})}next(){let{promise:q,id:$}=W6(this.pending,TT());return this.logger("Scheduling id=%s",$),this.schedule(),q}}}}),UH={};Aq(UH,{applyPatchTask:()=>Ym});wm=D({"src/lib/tasks/apply-patch.ts"(){Xq()}});zm=D({"src/lib/responses/BranchDeleteSummary.ts"(){FH=class{constructor(){this.all=[],this.branches={},this.errors=[]}get success(){return!this.errors.length}}}});Wm=D({"src/lib/parsers/parse-branch-delete.ts"(){zm(),a(),HT=/(\S+)\s+\(\S+\s([^)]+)\)/,Zj=/^error[^']+'([^']+)'/m,JT=[new r(HT,(q,[$,K])=>{let P=vm($,K);q.all.push(P),q.branches[$]=P}),new r(Zj,(q,[$])=>{let K=Om($);q.errors.push(K),q.all.push(K),q.branches[$]=K})],j7=(q,$)=>{return tq(new FH,JT,[q,$])}}}),Tm=D({"src/lib/responses/BranchSummary.ts"(){QH=class{constructor(){this.all=[],this.branches={},this.current="",this.detached=!1}push(q,$,K,P,_){if(q==="*")this.detached=$,this.current=K;this.all.push(K),this.branches[K]={current:q==="*",linkedWorkTree:q==="+",name:K,commit:P,label:_}}}}});Hm=D({"src/lib/parsers/parse-branch.ts"(){Tm(),a(),$J=[new r(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,(q,[$,K,P,_])=>{q.push(ZT($),!0,K,P,_)}),new r(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,(q,[$,K,P,_])=>{q.push(ZT($),!1,K,P,_)})],KJ=new r(/^(\S+)$/s,(q,[$])=>{q.push("*",!1,$,"","")})}}),PJ={};Aq(PJ,{branchLocalTask:()=>Zm,branchTask:()=>Jm,containsDeleteBranchCommand:()=>_J,deleteBranchTask:()=>Xm,deleteBranchesTask:()=>km});fm=D({"src/lib/tasks/branch.ts"(){i$(),Wm(),Hm(),a()}});hm=D({"src/lib/responses/CheckIgnore.ts"(){jJ=(q)=>{return q.split(/\n/g).map(Gm).filter(Boolean)}}}),YJ={};Aq(YJ,{checkIgnoreTask:()=>Vm});Mm=D({"src/lib/tasks/check-ignore.ts"(){hm()}});Nm=D({"src/lib/parsers/parse-fetch.ts"(){a(),wJ=[new r(/From (.+)$/,(q,[$])=>{q.remote=$}),new r(/\* \[new branch]\s+(\S+)\s*-> (.+)$/,(q,[$,K])=>{q.branches.push({name:$,tracking:K})}),new r(/\* \[new tag]\s+(\S+)\s*-> (.+)$/,(q,[$,K])=>{q.tags.push({name:$,tracking:K})}),new r(/- \[deleted]\s+\S+\s*-> (.+)$/,(q,[$])=>{q.deleted.push({tracking:$})}),new r(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,(q,[$,K,P,_])=>{q.updated.push({name:P,tracking:_,to:K,from:$})})]}}),vJ={};Aq(vJ,{fetchTask:()=>bm});um=D({"src/lib/tasks/fetch.ts"(){Nm(),Xq()}});mm=D({"src/lib/parsers/parse-move.ts"(){a(),OJ=[new r(/^Renaming (.+) to (.+)$/,(q,[$,K])=>{q.moves.push({from:$,to:K})})]}}),zJ={};Aq(zJ,{moveTask:()=>Im});Em=D({"src/lib/tasks/move.ts"(){mm(),a()}}),WJ={};Aq(WJ,{pullTask:()=>pm});Dm=D({"src/lib/tasks/pull.ts"(){i$(),yH(),a()}});Lm=D({"src/lib/responses/GetRemoteSummary.ts"(){a()}}),HJ={};Aq(HJ,{addRemoteTask:()=>gm,getRemotesTask:()=>xm,listRemotesTask:()=>nm,remoteTask:()=>cm,removeRemoteTask:()=>lm});om=D({"src/lib/tasks/remote.ts"(){Lm(),Xq()}}),JJ={};Aq(JJ,{stashListTask:()=>am});rm=D({"src/lib/tasks/stash-list.ts"(){XP(),MH(),yj(),SH()}}),ZJ={};Aq(ZJ,{addSubModuleTask:()=>im,initSubModuleTask:()=>tm,subModuleTask:()=>Y7,updateSubModuleTask:()=>Bm});em=D({"src/lib/tasks/sub-module.ts"(){Xq()}});sm=D({"src/lib/responses/TagList.ts"(){kT=class{constructor(q,$){this.all=q,this.latest=$}},XJ=function(q,$=!1){let K=q.split(`
|
|
184
|
+
`).map(Fm).filter(Boolean);if(!$)K.sort(function(_,j){let Y=_.split("."),w=j.split(".");if(Y.length===1||w.length===1)return Um(c4(Y[0]),c4(w[0]));for(let O=0,v=Math.max(Y.length,w.length);O<v;O++){let z=kJ(c4(Y[O]),c4(w[O]));if(z)return z}return 0});let P=$?K[0]:[...K].reverse().find((_)=>_.indexOf(".")>=0);return new kT(K,P)}}}),fJ={};Aq(fJ,{addAnnotatedTagTask:()=>$I,addTagTask:()=>qI,tagListTask:()=>Qm});KI=D({"src/lib/tasks/tag.ts"(){sm()}}),PI=Xu({"src/git.js"(q,$){var{GitExecutor:K}=(_R(),kq(WH)),{SimpleGitApi:P}=(_m(),kq(iH)),{Scheduler:_}=(jm(),kq(tH)),{adhocExecTask:j,configurationErrorTask:Y}=(Xq(),kq(vj)),{asArray:w,filterArray:O,filterPrimitives:v,filterString:z,filterStringOrStringArray:W,filterType:T,getTrailingOptions:H,trailingFunctionArgument:J,trailingOptionsArgument:Z}=(a(),kq(yT)),{applyPatchTask:X}=(wm(),kq(UH)),{branchTask:G,branchLocalTask:f,deleteBranchesTask:N,deleteBranchTask:V}=(fm(),kq(PJ)),{checkIgnoreTask:C}=(Mm(),kq(YJ)),{checkIsRepoTask:b}=(xT(),kq(dT)),{cleanWithOptionsTask:k,isCleanOptionsArray:M}=(UT(),kq(BT)),{diffSummaryTask:A}=(yj(),kq(CH)),{fetchTask:u}=(um(),kq(vJ)),{moveTask:S}=(Em(),kq(zJ)),{pullTask:p}=(Dm(),kq(WJ)),{pushTagsTask:L}=(xH(),kq(gH)),{addRemoteTask:c,getRemotesTask:d,listRemotesTask:Q,remoteTask:Vq,removeRemoteTask:Rq}=(om(),kq(HJ)),{getResetMode:_K,resetTask:jK}=(vH(),kq(jH)),{stashListTask:Eq}=(rm(),kq(JJ)),{addSubModuleTask:$q,initSubModuleTask:j6,subModuleTask:Mq,updateSubModuleTask:A8}=(em(),kq(ZJ)),{addAnnotatedTagTask:x6,addTagTask:Wq,tagListTask:h7}=(KI(),kq(fJ)),{straightThroughBufferTask:K$,straightThroughStringTask:Bq}=(Xq(),kq(vj));function l(I,y){this._plugins=y,this._executor=new K(I.baseDir,new _(I.maxConcurrentProcesses),y),this._trimmed=I.trimmed}(l.prototype=Object.create(P.prototype)).constructor=l,l.prototype.customBinary=function(I){return this._plugins.reconfigure("binary",I),this},l.prototype.env=function(I,y){if(arguments.length===1&&typeof I==="object")this._executor.env=I;else(this._executor.env=this._executor.env||{})[I]=y;return this},l.prototype.stashList=function(I){return this._runTask(Eq(Z(arguments)||{},O(I)&&I||[]),J(arguments))},l.prototype.mv=function(I,y){return this._runTask(S(I,y),J(arguments))},l.prototype.checkoutLatestTag=function(I){var y=this;return this.pull(function(){y.tags(function(t,_q){y.checkout(_q.latest,I)})})},l.prototype.pull=function(I,y,t,_q){return this._runTask(p(T(I,z),T(y,z),H(arguments)),J(arguments))},l.prototype.fetch=function(I,y){return this._runTask(u(T(I,z),T(y,z),H(arguments)),J(arguments))},l.prototype.silent=function(I){return this._runTask(j(()=>console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.")))},l.prototype.tags=function(I,y){return this._runTask(h7(H(arguments)),J(arguments))},l.prototype.rebase=function(){return this._runTask(Bq(["rebase",...H(arguments)]),J(arguments))},l.prototype.reset=function(I){return this._runTask(jK(_K(I),H(arguments)),J(arguments))},l.prototype.revert=function(I){let y=J(arguments);if(typeof I!=="string")return this._runTask(Y("Commit must be a string"),y);return this._runTask(Bq(["revert",...H(arguments,0,!0),I]),y)},l.prototype.addTag=function(I){let y=typeof I==="string"?Wq(I):Y("Git.addTag requires a tag name");return this._runTask(y,J(arguments))},l.prototype.addAnnotatedTag=function(I,y){return this._runTask(x6(I,y),J(arguments))},l.prototype.deleteLocalBranch=function(I,y,t){return this._runTask(V(I,typeof y==="boolean"?y:!1),J(arguments))},l.prototype.deleteLocalBranches=function(I,y,t){return this._runTask(N(I,typeof y==="boolean"?y:!1),J(arguments))},l.prototype.branch=function(I,y){return this._runTask(G(H(arguments)),J(arguments))},l.prototype.branchLocal=function(I){return this._runTask(f(),J(arguments))},l.prototype.raw=function(I){let y=!Array.isArray(I),t=[].slice.call(y?arguments:I,0);for(let pq=0;pq<t.length&&y;pq++)if(!v(t[pq])){t.splice(pq,t.length-pq);break}t.push(...H(arguments,0,!0));var _q=J(arguments);if(!t.length)return this._runTask(Y("Raw: must supply one or more command to execute"),_q);return this._runTask(Bq(t,this._trimmed),_q)},l.prototype.submoduleAdd=function(I,y,t){return this._runTask($q(I,y),J(arguments))},l.prototype.submoduleUpdate=function(I,y){return this._runTask(A8(H(arguments,!0)),J(arguments))},l.prototype.submoduleInit=function(I,y){return this._runTask(j6(H(arguments,!0)),J(arguments))},l.prototype.subModule=function(I,y){return this._runTask(Mq(H(arguments)),J(arguments))},l.prototype.listRemote=function(){return this._runTask(Q(H(arguments)),J(arguments))},l.prototype.addRemote=function(I,y,t){return this._runTask(c(I,y,H(arguments)),J(arguments))},l.prototype.removeRemote=function(I,y){return this._runTask(Rq(I),J(arguments))},l.prototype.getRemotes=function(I,y){return this._runTask(d(I===!0),J(arguments))},l.prototype.remote=function(I,y){return this._runTask(Vq(H(arguments)),J(arguments))},l.prototype.tag=function(I,y){let t=H(arguments);if(t[0]!=="tag")t.unshift("tag");return this._runTask(Bq(t),J(arguments))},l.prototype.updateServerInfo=function(I){return this._runTask(Bq(["update-server-info"]),J(arguments))},l.prototype.pushTags=function(I,y){let t=L({remote:T(I,z)},H(arguments));return this._runTask(t,J(arguments))},l.prototype.rm=function(I){return this._runTask(Bq(["rm","-f",...w(I)]),J(arguments))},l.prototype.rmKeepLocal=function(I){return this._runTask(Bq(["rm","--cached",...w(I)]),J(arguments))},l.prototype.catFile=function(I,y){return this._catFile("utf-8",arguments)},l.prototype.binaryCatFile=function(){return this._catFile("buffer",arguments)},l.prototype._catFile=function(I,y){var t=J(y),_q=["cat-file"],pq=y[0];if(typeof pq==="string")return this._runTask(Y("Git.catFile: options must be supplied as an array of strings"),t);if(Array.isArray(pq))_q.push.apply(_q,pq);let n6=I==="buffer"?K$(_q):Bq(_q);return this._runTask(n6,t)},l.prototype.diff=function(I,y){let t=z(I)?Y("git.diff: supplying options as a single string is no longer supported, switch to an array of strings"):Bq(["diff",...H(arguments)]);return this._runTask(t,J(arguments))},l.prototype.diffSummary=function(){return this._runTask(A(H(arguments,1)),J(arguments))},l.prototype.applyPatch=function(I){let y=!W(I)?Y("git.applyPatch requires one or more string patches as the first argument"):X(w(I),H([].slice.call(arguments,1)));return this._runTask(y,J(arguments))},l.prototype.revparse=function(){let I=["rev-parse",...H(arguments,!0)];return this._runTask(Bq(I,!0),J(arguments))},l.prototype.clean=function(I,y,t){let _q=M(I),pq=_q&&I.join("")||T(I,z)||"",n6=H([].slice.call(arguments,_q?1:0));return this._runTask(k(pq,n6),J(arguments))},l.prototype.exec=function(I){let y={commands:[],format:"utf-8",parser(){if(typeof I==="function")I()}};return this._runTask(y)},l.prototype.clearQueue=function(){return this._runTask(j(()=>console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.")))},l.prototype.checkIgnore=function(I,y){return this._runTask(C(w(T(I,W,[]))),J(arguments))},l.prototype.checkIsRepo=function(I,y){return this._runTask(b(T(I,z)),J(arguments))},$.exports=l}});r$();X8();_I=class extends B6{constructor(q,$){super(void 0,$);this.config=q}};X8();X8();t6=class extends B6{constructor(q,$,K){super(q,K);this.task=q,this.plugin=$,Object.setPrototypeOf(this,new.target.prototype)}};i$();VT();xT();UT();QT();$H();_H();vH();vI=[OP(/^\s*protocol(.[a-z]+)?.allow/i,"allowUnsafeProtocolOverride","protocol.allow"),OP("core.sshCommand","allowUnsafeSshCommand"),OP("core.gitProxy","allowUnsafeGitProxy"),OP("core.hooksPath","allowUnsafeHooksPath"),OP("diff.external","allowUnsafeDiffExternal")];a();a();XT=o$.deferred().promise;a();X8();a();a();a();r$();a();SI=PI();i$();AJ=bI});import*as L6 from"node:fs";import*as w7 from"node:path";import RI from"node:os";class xj{log;tempDir;g;constructor(q){this.log=q?.withPrefix("GitOrLocalFs"),this.tempDir=L6.mkdtempSync(w7.join(RI.tmpdir(),"fs-client-")),this.g=($)=>AJ($).env({...process.env}),process.on("exit",()=>{L6.rmdirSync(this.tempDir,{recursive:!0})})}isGitUri(q){return q.scheme==="git"||q.scheme.startsWith("git+")||q.scheme.startsWith("http")&&q.toString().includes(".git")}parseGitUri(q){let $=q.toString(),K=$.indexOf(".git");if(K!==-1){let P=$.substring(0,K+4);if(P.startsWith("git+"))P=P.substring(4);else if(P.startsWith("git://"))P="https://"+P.substring(6);let _=$.substring(K+4),j=w7.join(this.tempDir,Buffer.from(P).toString("hex"));return{repoUrl:P,repoDir:j,filePath:w7.join(j,_)}}throw Error(`Invalid git URI format: ${$}`)}async ensureRepoUpdated(q,$){if(this.log?.info(`Checking repo status at ${q}`),!L6.existsSync(q))this.log?.info(`${$} is not available - cloning`),await L6.promises.mkdir(q),await this.g(q).clone($,q,["--single-branch","--depth","1"]);else this.log?.info(`refreshing ${$}`),await this.g(q).pull()}async readFile(q){if(this.isGitUri(q)){let{repoUrl:$,repoDir:K,filePath:P}=this.parseGitUri(q);return await this.ensureRepoUpdated(K,$),this.log?.info(`Reading from up-to-date repo path "${P}"`),L6.promises.readFile(P,"utf-8")}else return L6.promises.readFile(q.fsPath,"utf-8")}async write(q,$){if(this.isGitUri(q)){let{repoUrl:K,repoDir:P,filePath:_}=this.parseGitUri(q);await this.ensureRepoUpdated(P,K),this.log?.info(`Writing file to commit at "${_}"`);let j=await Bun.write(_,$);return this.log?.info(`Adding and committing "${_}"`),await this.g(P).add([_]),await this.g(P).commit(`Update ${_.substring(_.lastIndexOf("/")+1)}`,_),this.log?.info(`Pushing "${K}"`),await this.g(P).push(),this.log?.info("Completed push"),j}else return Bun.write(q.fsPath,$)}}var hJ=eq(()=>{GJ()});var bJ={};G8(bJ,{default:()=>LI,Register:()=>NJ,Description:()=>CJ,Action:()=>SJ});import{createKumoriServices as mI}from"@kumori/kdsl-lsp/language/kumori.js";import{NodeFileSystem as II}from"langium/node";import{ModuleContext as EI}from"@kumori/kdsl-lsp/module/context.js";import{URI as fP}from"langium";import nq from"path";import{Result as VJ}from"@kumori/kdsl-lsp/util/result.js";import{RegistryManager as pI}from"@kumori/kdsl-lsp/module/registry/manager.js";import{CalculateChecksum as DI}from"@kumori/kdsl-lsp/module/integrity/checksum.js";import yI from"fs";function NJ(q,$){return q.command("create").option("--module <module>","Path to the module to generate the index entry for. It can be either a relative or absolute path. Defaults to the current directory.").option("--meta <meta>","Path to the metadata file (_index.json). It can be either a relative or absolute path. Defaults to _index.json in the module's root directory.").option("--index <index>","Path to the index file to append the new entry to. It can be either a relative or absolute path. If not provided, the entry will be printed to standard output.").option("--locationOverride <location>","Path to the module's source when included in the index file. Defaults to the module's git remote URL").summary(dI).description(CJ).helpOption(!0).showHelpAfterError(!0).action(SJ($))}function SJ(q){return async($,K)=>{let P=K?.optsWithGlobals()?.config,_=mI(II,P).Kumori,j=_.shared.workspace.FileSystemProvider,Y=process.cwd();if($.module){if($.module[0]==="."||nq.isAbsolute($.module))Y=nq.isAbsolute($.module)?$.module:nq.resolve(process.cwd(),$.module)}let w=await EI(j,fP.file(Y),P);if(VJ.isErr(w))throw Error(w.err);await C6(q,_,w.value);let O=nq.join(Y,"_index.json");if($.meta)if($.meta[0]==="."||nq.isAbsolute($.meta))O=nq.isAbsolute($.meta)?$.meta:nq.resolve(process.cwd(),$.meta);else O=nq.resolve(process.cwd(),$.meta);q.info(`Loading metadata from ${O}`);let v;try{let f=await j.readFile(fP.file(O));if(v=JSON.parse(f),v.location!=null)q.warn("Explicit locations in '_index.json' are deprecated. use the argument '--locationOverride' to manually set");v.location=$.locationOverride||await MJ.default.getConfig({fs:yI,dir:Y,path:"remote.origin.url"})||v.location}catch(f){throw Error(`Failed to read or parse metadata file at ${O}: ${f}`)}if(!v.location)throw Error("Module must be configured as a git repository with a remote URL present or have it specified with '--locationOverride'");if(!v.artifacts||!Array.isArray(v.artifacts))throw Error(`Metadata file at ${O} must contain an "artifacts" array`);for(let f of v.artifacts)if(!f?.type||!f?.name||!f?.location)throw Error(`Each artifact in ${O} must contain "type", "name" and "location" fields`);let z=null,W=new xj(q);if($.index)if(W.isGitUri(fP.parse($.index)))z=fP.parse($.index+"/index.json");else{if($.index[0]==="."||nq.isAbsolute($.index))z=nq.isAbsolute($.index)?$.index:nq.resolve(process.cwd(),$.index);else z=nq.resolve(process.cwd(),$.index);z=fP.parse(z)}let T=null;if(z)try{let f=null;try{f=await W.readFile(z)}catch{f=""}if(f===null||f===""){T={modules:[]},q.info(`Index file at ${z} is either missing or empty. A new one will be created.`);try{await W.write(z,JSON.stringify(T,null,2)),q.info(`Created new index file at ${z}`)}catch(C){q.error(`Failed to create new index file at ${z}: ${C}`);return}}try{f=await W.readFile(z),T=await JSON.parse(f)}catch(C){throw Error(`Failed to parse index file at ${z}: ${C}`)}if(!new pI(K?.optsWithGlobals()?.config).validateIndexSchema(T))throw Error(`Index schema validation failed for ${z}`)}catch(f){q.error(`Failed to read index file at ${z}: ${f}`);return}let H=void 0;if(T?.modules)H=T.modules.find((f)=>f.domain===w.value.Current.Manifest.module&&f.version===w.value.Current.Manifest.version);if(H)q.warn(`Module ${H.domain} version ${H.version} already exists in the index file at ${z}. Proceeding will override the current entry.`),q.warn("Overriding existing entry without prompting.");let J=w.value.Current.Manifest,Z=await DI(Y),X=new Date().toISOString().split("T")[0],G={domain:J.module,version:J.version,location:v.location,checksum:Z,releaseDate:X,artifacts:[]};for(let f of v.artifacts){q.info(`Processing artifact ${f.name} (${f.type})`);let N=await LP(_,w.value,f.location,f.name);if(VJ.isErr(N))throw Error(`Failed to generate JSON Schema for artifact ${f.name} in package ${f.location}: ${N.err}`);let V=M1(_,w.value,f),C=V?V1(_,V):[],b=f.location,k,M;if(f.type==="component"){let d=s7(_,w.value,f.name,f.location);if(d)k=d.cpu,M=d.memory}else if(f.type==="service"){let d=Q7(_,w.value,f.name,f.location);if(d)k=d.cpu,M=d.memory}let A=k??1,u=M??1,S=v.defaults||{},p=f.marketplace??S.marketplace??!0,L=f.categories??S.categories??[],c=f.tags??S.tags??[];G.artifacts.push({name:f.name,description:f.description||"",requirements:{cpu:A,memory:u},location:b,type:f.type,roles:C,marketplace:p,schema:N.value,icon:f.icon||"",categories:L,tags:c})}if(z&&T)if(!H){T.modules.push(G);let f=JSON.stringify(T,null,2);await W.write(z,f),q.info(`Appended new module entry to index file at ${z}`)}else{T.modules=T.modules.map((N)=>{if(N.domain===H.domain&&N.version===H.version)return G;return N});let f=JSON.stringify(T,null,2);await W.write(z,f),q.info(`Updated module entry in index file at ${z}`)}else console.log(JSON.stringify({modules:[G]},null,2))}}var MJ,dI="Creates an index file",CJ,LI;var uJ=eq(()=>{a7();Y$();N1();hJ();MJ=P$(CW(),1),CJ=`
|
|
185
|
+
Creates a new index file entry for the current module using metadata from _index.json.
|
|
186
|
+
|
|
187
|
+
The metadata file (_index.json) should be located in the module's root directory and contains
|
|
188
|
+
pre-filled information about the module and its artifacts, including descriptions, requirements,
|
|
189
|
+
marketplace settings, and more.
|
|
190
|
+
|
|
191
|
+
This command will generate the entry for the current module:
|
|
192
|
+
kdsl index create
|
|
193
|
+
|
|
194
|
+
Or you can provide a module location to generate the entry for:
|
|
195
|
+
kdsl index create --module path/to/module
|
|
196
|
+
|
|
197
|
+
You can specify a custom metadata file location:
|
|
198
|
+
kdsl index create --meta path/to/custom/_index.json
|
|
199
|
+
|
|
200
|
+
The generated index entry will be printed to the standard output. However, you can directly add
|
|
201
|
+
the new entry onto an existing index file by providing the --index option:
|
|
202
|
+
kdsl index create --index path/to/index/file.json
|
|
203
|
+
|
|
204
|
+
If the index file is empty, a new index file will be created with just the new entry. Otherwise,
|
|
205
|
+
if the index file already contains entries, the new entry will be appended to the existing ones.
|
|
206
|
+
`.trim(),LI={Register:NJ}});var cq=R((UI)=>{UI.__esModule=!0;UI.extend=IJ;UI.indexOf=aI;UI.escapeExpression=rI;UI.isEmpty=iI;UI.createFrame=tI;UI.blockParams=BI;UI.appendContextPath=eI;var nI={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},cI=/[&<>"'`=]/g,lI=/[&<>"'`=]/;function oI(q){return nI[q]}function IJ(q){for(var $=1;$<arguments.length;$++)for(var K in arguments[$])if(Object.prototype.hasOwnProperty.call(arguments[$],K))q[K]=arguments[$][K];return q}var cj=Object.prototype.toString;UI.toString=cj;var nj=function($){return typeof $==="function"};if(nj(/x/))UI.isFunction=nj=function(q){return typeof q==="function"&&cj.call(q)==="[object Function]"};UI.isFunction=nj;var EJ=Array.isArray||function(q){return q&&typeof q==="object"?cj.call(q)==="[object Array]":!1};UI.isArray=EJ;function aI(q,$){for(var K=0,P=q.length;K<P;K++)if(q[K]===$)return K;return-1}function rI(q){if(typeof q!=="string"){if(q&&q.toHTML)return q.toHTML();else if(q==null)return"";else if(!q)return q+"";q=""+q}if(!lI.test(q))return q;return q.replace(cI,oI)}function iI(q){if(!q&&q!==0)return!0;else if(EJ(q)&&q.length===0)return!0;else return!1}function tI(q){var $=IJ({},q);return $._parent=q,$}function BI(q,$){return q.path=$,q}function eI(q,$){return(q?q+".":"")+$}});var P6=R((pJ,DJ)=>{pJ.__esModule=!0;var lj=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function oj(q,$){var K=$&&$.loc,P=void 0,_=void 0,j=void 0,Y=void 0;if(K)P=K.start.line,_=K.end.line,j=K.start.column,Y=K.end.column,q+=" - "+P+":"+j;var w=Error.prototype.constructor.call(this,q);for(var O=0;O<lj.length;O++)this[lj[O]]=w[lj[O]];if(Error.captureStackTrace)Error.captureStackTrace(this,oj);try{if(K)if(this.lineNumber=P,this.endLineNumber=_,Object.defineProperty)Object.defineProperty(this,"column",{value:j,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:Y,enumerable:!0});else this.column=j,this.endColumn=Y}catch(v){}}oj.prototype=Error();pJ.default=oj;DJ.exports=pJ.default});var LJ=R((yJ,dJ)=>{yJ.__esModule=!0;var aj=cq();yJ.default=function(q){q.registerHelper("blockHelperMissing",function($,K){var{inverse:P,fn:_}=K;if($===!0)return _(this);else if($===!1||$==null)return P(this);else if(aj.isArray($))if($.length>0){if(K.ids)K.ids=[K.name];return q.helpers.each($,K)}else return P(this);else{if(K.data&&K.ids){var j=aj.createFrame(K.data);j.contextPath=aj.appendContextPath(K.data.contextPath,K.name),K={data:j}}return _($,K)}})};dJ.exports=yJ.default});var nJ=R((gJ,xJ)=>{gJ.__esModule=!0;function TE(q){return q&&q.__esModule?q:{default:q}}var AP=cq(),HE=P6(),JE=TE(HE);gJ.default=function(q){q.registerHelper("each",function($,K){if(!K)throw new JE.default("Must pass iterator to #each");var{fn:P,inverse:_}=K,j=0,Y="",w=void 0,O=void 0;if(K.data&&K.ids)O=AP.appendContextPath(K.data.contextPath,K.ids[0])+".";if(AP.isFunction($))$=$.call(this);if(K.data)w=AP.createFrame(K.data);function v(J,Z,X){if(w){if(w.key=J,w.index=Z,w.first=Z===0,w.last=!!X,O)w.contextPath=O+J}Y=Y+P($[J],{data:w,blockParams:AP.blockParams([$[J],J],[O+J,null])})}if($&&typeof $==="object")if(AP.isArray($)){for(var z=$.length;j<z;j++)if(j in $)v(j,j,j===$.length-1)}else if(typeof Symbol==="function"&&$[Symbol.iterator]){var W=[],T=$[Symbol.iterator]();for(var H=T.next();!H.done;H=T.next())W.push(H.value);$=W;for(var z=$.length;j<z;j++)v(j,j,j===$.length-1)}else(function(){var J=void 0;if(Object.keys($).forEach(function(Z){if(J!==void 0)v(J,j-1);J=Z,j++}),J!==void 0)v(J,j-1,!0)})();if(j===0)Y=_(this);return Y})};xJ.exports=gJ.default});var oJ=R((cJ,lJ)=>{cJ.__esModule=!0;function XE(q){return q&&q.__esModule?q:{default:q}}var fE=P6(),AE=XE(fE);cJ.default=function(q){q.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new AE.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};lJ.exports=cJ.default});var BJ=R((iJ,tJ)=>{iJ.__esModule=!0;function VE(q){return q&&q.__esModule?q:{default:q}}var aJ=cq(),ME=P6(),rJ=VE(ME);iJ.default=function(q){q.registerHelper("if",function($,K){if(arguments.length!=2)throw new rJ.default("#if requires exactly one argument");if(aJ.isFunction($))$=$.call(this);if(!K.hash.includeZero&&!$||aJ.isEmpty($))return K.inverse(this);else return K.fn(this)}),q.registerHelper("unless",function($,K){if(arguments.length!=2)throw new rJ.default("#unless requires exactly one argument");return q.helpers.if.call(this,$,{fn:K.inverse,inverse:K.fn,hash:K.hash})})};tJ.exports=iJ.default});var FJ=R((eJ,UJ)=>{eJ.__esModule=!0;eJ.default=function(q){q.registerHelper("log",function(){var $=[void 0],K=arguments[arguments.length-1];for(var P=0;P<arguments.length-1;P++)$.push(arguments[P]);var _=1;if(K.hash.level!=null)_=K.hash.level;else if(K.data&&K.data.level!=null)_=K.data.level;$[0]=_,q.log.apply(q,$)})};UJ.exports=eJ.default});var qZ=R((sJ,QJ)=>{sJ.__esModule=!0;sJ.default=function(q){q.registerHelper("lookup",function($,K,P){if(!$)return $;return P.lookupProperty($,K)})};QJ.exports=sJ.default});var PZ=R(($Z,KZ)=>{$Z.__esModule=!0;function mE(q){return q&&q.__esModule?q:{default:q}}var GP=cq(),IE=P6(),EE=mE(IE);$Z.default=function(q){q.registerHelper("with",function($,K){if(arguments.length!=2)throw new EE.default("#with requires exactly one argument");if(GP.isFunction($))$=$.call(this);var P=K.fn;if(!GP.isEmpty($)){var _=K.data;if(K.data&&K.ids)_=GP.createFrame(K.data),_.contextPath=GP.appendContextPath(K.data.contextPath,K.ids[0]);return P($,{data:_,blockParams:GP.blockParams([$],[_&&_.contextPath])})}else return K.inverse(this)})};KZ.exports=$Z.default});var rj=R((FE)=>{FE.__esModule=!0;FE.registerDefaultHelpers=eE;FE.moveHelperToHooks=UE;function F8(q){return q&&q.__esModule?q:{default:q}}var yE=LJ(),dE=F8(yE),LE=nJ(),gE=F8(LE),xE=oJ(),nE=F8(xE),cE=BJ(),lE=F8(cE),oE=FJ(),aE=F8(oE),rE=qZ(),iE=F8(rE),tE=PZ(),BE=F8(tE);function eE(q){dE.default(q),gE.default(q),nE.default(q),lE.default(q),aE.default(q),iE.default(q),BE.default(q)}function UE(q,$,K){if(q.helpers[$]){if(q.hooks[$]=q.helpers[$],!K)q.helpers[$]=void 0}}});var YZ=R((_Z,jZ)=>{_Z.__esModule=!0;var $p=cq();_Z.default=function(q){q.registerDecorator("inline",function($,K,P,_){var j=$;if(!K.partials)K.partials={},j=function(Y,w){var O=P.partials;P.partials=$p.extend({},O,K.partials);var v=$(Y,w);return P.partials=O,v};return K.partials[_.args[0]]=_.fn,j})};jZ.exports=_Z.default});var wZ=R((vp)=>{vp.__esModule=!0;vp.registerDefaultDecorators=wp;function _p(q){return q&&q.__esModule?q:{default:q}}var jp=YZ(),Yp=_p(jp);function wp(q){Yp.default(q)}});var ij=R((vZ,OZ)=>{vZ.__esModule=!0;var Wp=cq(),B$={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function($){if(typeof $==="string"){var K=Wp.indexOf(B$.methodMap,$.toLowerCase());if(K>=0)$=K;else $=parseInt($,10)}return $},log:function($){if($=B$.lookupLevel($),typeof console<"u"&&B$.lookupLevel(B$.level)<=$){var K=B$.methodMap[$];if(!console[K])K="log";for(var P=arguments.length,_=Array(P>1?P-1:0),j=1;j<P;j++)_[j-1]=arguments[j];console[K].apply(console,_)}}};vZ.default=B$;OZ.exports=vZ.default});var tj=R((hp)=>{hp.__esModule=!0;hp.createProtoAccessControl=Xp;hp.resultIsAllowed=fp;hp.resetLoggedProperties=Gp;function Jp(q){return q&&q.__esModule?q:{default:q}}var zZ=cq(),Zp=ij(),kp=Jp(Zp),v7=Object.create(null);function Xp(q){var $=Object.create(null);$.__proto__=!1,zZ.extend($,q.allowedProtoProperties);var K=Object.create(null);return K.constructor=!1,K.__defineGetter__=!1,K.__defineSetter__=!1,K.__lookupGetter__=!1,K.__lookupSetter__=!1,zZ.extend(K,q.allowedProtoMethods),{properties:{whitelist:$,defaultValue:q.allowProtoPropertiesByDefault},methods:{whitelist:K,defaultValue:q.allowProtoMethodsByDefault}}}function fp(q,$,K){if(typeof q==="function")return WZ($.methods,K);else return WZ($.properties,K)}function WZ(q,$){if(q.whitelist[$]!==void 0)return q.whitelist[$]===!0;if(q.defaultValue!==void 0)return q.defaultValue;return Ap($),!1}function Ap(q){if(v7[q]!==!0)v7[q]=!0,kp.default.log("error",'Handlebars: Access has been denied to resolve the property "'+q+`" because it is not an "own property" of its parent.
|
|
207
|
+
You can add a runtime option to disable the check or this warning:
|
|
208
|
+
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function Gp(){Object.keys(v7).forEach(function(q){delete v7[q]})}});var z7=R((dp)=>{dp.__esModule=!0;dp.HandlebarsEnvironment=Uj;function TZ(q){return q&&q.__esModule?q:{default:q}}var s8=cq(),Sp=P6(),Bj=TZ(Sp),bp=rj(),up=wZ(),Rp=ij(),O7=TZ(Rp),mp=tj(),Ip="4.7.9";dp.VERSION=Ip;var Ep=8;dp.COMPILER_REVISION=Ep;var pp=7;dp.LAST_COMPATIBLE_COMPILER_REVISION=pp;var Dp={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};dp.REVISION_CHANGES=Dp;var ej="[object Object]";function Uj(q,$,K){this.helpers=q||{},this.partials=$||{},this.decorators=K||{},bp.registerDefaultHelpers(this),up.registerDefaultDecorators(this)}Uj.prototype={constructor:Uj,logger:O7.default,log:O7.default.log,registerHelper:function($,K){if(s8.toString.call($)===ej){if(K)throw new Bj.default("Arg not supported with multiple helpers");s8.extend(this.helpers,$)}else this.helpers[$]=K},unregisterHelper:function($){delete this.helpers[$]},registerPartial:function($,K){if(s8.toString.call($)===ej)s8.extend(this.partials,$);else{if(typeof K>"u")throw new Bj.default('Attempting to register a partial called "'+$+'" as undefined');this.partials[$]=K}},unregisterPartial:function($){delete this.partials[$]},registerDecorator:function($,K){if(s8.toString.call($)===ej){if(K)throw new Bj.default("Arg not supported with multiple decorators");s8.extend(this.decorators,$)}else this.decorators[$]=K},unregisterDecorator:function($){delete this.decorators[$]},resetLoggedPropertyAccesses:function(){mp.resetLoggedProperties()}};var yp=O7.default.log;dp.log=yp;dp.createFrame=s8.createFrame;dp.logger=O7.default});var ZZ=R((HZ,JZ)=>{HZ.__esModule=!0;function Fj(q){this.string=q}Fj.prototype.toString=Fj.prototype.toHTML=function(){return""+this.string};HZ.default=Fj;JZ.exports=HZ.default});var kZ=R((ep)=>{ep.__esModule=!0;ep.wrapHelper=Bp;function Bp(q,$){if(typeof q!=="function")return q;var K=function(){var _=arguments[arguments.length-1];return arguments[arguments.length-1]=$(_),q.apply(this,arguments)};return K}});var VZ=R((OD)=>{OD.__esModule=!0;OD.checkRevision=PD;OD.template=_D;OD.wrapProgram=W7;OD.resolvePartial=jD;OD.invokePartial=YD;OD.noop=GZ;function sp(q){return q&&q.__esModule?q:{default:q}}function Qp(q){if(q&&q.__esModule)return q;else{var $={};if(q!=null){for(var K in q)if(Object.prototype.hasOwnProperty.call(q,K))$[K]=q[K]}return $.default=q,$}}var qD=cq(),e$=Qp(qD),$D=P6(),e6=sp($D),U6=z7(),XZ=rj(),KD=kZ(),fZ=tj();function PD(q){var $=q&&q[0]||1,K=U6.COMPILER_REVISION;if($>=U6.LAST_COMPATIBLE_COMPILER_REVISION&&$<=U6.COMPILER_REVISION)return;if($<U6.LAST_COMPATIBLE_COMPILER_REVISION){var P=U6.REVISION_CHANGES[K],_=U6.REVISION_CHANGES[$];throw new e6.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+P+") or downgrade your runtime to an older version ("+_+").")}else throw new e6.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+q[1]+").")}function _D(q,$){if(!$)throw new e6.default("No environment passed to template");if(!q||!q.main)throw new e6.default("Unknown template object: "+typeof q);q.main.decorator=q.main_d,$.VM.checkRevision(q.compiler);var K=q.compiler&&q.compiler[0]===7;function P(Y,w,O){if(O.hash){if(w=e$.extend({},w,O.hash),O.ids)O.ids[0]=!0}Y=$.VM.resolvePartial.call(this,Y,w,O),O.hooks=this.hooks,O.protoAccessControl=this.protoAccessControl;var v=$.VM.invokePartial.call(this,Y,w,O);if(v==null&&$.compile)O.partials[O.name]=$.compile(Y,q.compilerOptions,$),v=O.partials[O.name](w,O);if(v!=null){if(O.indent){var z=v.split(`
|
|
209
|
+
`);for(var W=0,T=z.length;W<T;W++){if(!z[W]&&W+1===T)break;z[W]=O.indent+z[W]}v=z.join(`
|
|
210
|
+
`)}return v}else throw new e6.default("The partial "+O.name+" could not be compiled when running in runtime-only mode")}var _={strict:function(w,O,v){if(!w||!(O in w))throw new e6.default('"'+O+'" not defined in '+w,{loc:v});return _.lookupProperty(w,O)},lookupProperty:function(w,O){var v=w[O];if(v==null)return v;if(Object.prototype.hasOwnProperty.call(w,O))return v;if(fZ.resultIsAllowed(v,_.protoAccessControl,O))return v;return},lookup:function(w,O){var v=w.length;for(var z=0;z<v;z++){var W=w[z]&&_.lookupProperty(w[z],O);if(W!=null)return W}},lambda:function(w,O){return typeof w==="function"?w.call(O):w},escapeExpression:e$.escapeExpression,invokePartial:P,fn:function(w){var O=q[w];return O.decorator=q[w+"_d"],O},programs:[],program:function(w,O,v,z,W){var T=this.programs[w],H=this.fn(w);if(O||W||z||v)T=W7(this,w,H,O,v,z,W);else if(!T)T=this.programs[w]=W7(this,w,H);return T},data:function(w,O){while(w&&O--)w=w._parent;return w},mergeIfNeeded:function(w,O){var v=w||O;if(w&&O&&w!==O)v=e$.extend({},O,w);return v},nullContext:Object.seal({}),noop:$.VM.noop,compilerInfo:q.compiler};function j(Y){var w=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],O=w.data;if(j._setup(w),!w.partial&&q.useData)O=wD(Y,O);var v=void 0,z=q.useBlockParams?[]:void 0;if(q.useDepths)if(w.depths)v=Y!=w.depths[0]?[Y].concat(w.depths):w.depths;else v=[Y];function W(T){return""+q.main(_,T,_.helpers,_.partials,O,z,v)}return W=hZ(q.main,W,_,w.depths||[],O,z),W(Y,w)}return j.isTop=!0,j._setup=function(Y){if(!Y.partial){var w={};if(AZ(w,$.helpers,_),AZ(w,Y.helpers,_),_.helpers=w,q.usePartial)_.partials=_.mergeIfNeeded(Y.partials,$.partials);if(q.usePartial||q.useDecorators)_.decorators=e$.extend({},$.decorators,Y.decorators);_.hooks={},_.protoAccessControl=fZ.createProtoAccessControl(Y);var O=Y.allowCallsToHelperMissing||K;XZ.moveHelperToHooks(_,"helperMissing",O),XZ.moveHelperToHooks(_,"blockHelperMissing",O)}else _.protoAccessControl=Y.protoAccessControl,_.helpers=Y.helpers,_.partials=Y.partials,_.decorators=Y.decorators,_.hooks=Y.hooks},j._child=function(Y,w,O,v){if(q.useBlockParams&&!O)throw new e6.default("must pass block params");if(q.useDepths&&!v)throw new e6.default("must pass parent depths");return W7(_,Y,q[Y],w,0,O,v)},j}function W7(q,$,K,P,_,j,Y){function w(O){var v=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],z=Y;if(Y&&O!=Y[0]&&!(O===q.nullContext&&Y[0]===null))z=[O].concat(Y);return K(q,O,q.helpers,q.partials,v.data||P,j&&[v.blockParams].concat(j),z)}return w=hZ(K,w,q,Y,P,j),w.program=$,w.depth=Y?Y.length:0,w.blockParams=_||0,w}function jD(q,$,K){if(!q)if(K.name==="@partial-block")q=T7(K.data,"partial-block");else q=T7(K.partials,K.name);else if(!q.call&&!K.name)K.name=q,q=T7(K.partials,q);return q}function YD(q,$,K){var P=T7(K.data,"partial-block");if(K.partial=!0,K.ids)K.data.contextPath=K.ids[0]||K.data.contextPath;var _=void 0;if(K.fn&&K.fn!==GZ)(function(){K.data=U6.createFrame(K.data);var j=K.fn;if(_=K.data["partial-block"]=function(w){var O=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return O.data=U6.createFrame(O.data),O.data["partial-block"]=P,j(w,O)},j.partials)K.partials=e$.extend({},K.partials,j.partials)})();if(q===void 0&&_)q=_;if(q===void 0)throw new e6.default("The partial "+K.name+" could not be found");else if(q instanceof Function)return q($,K)}function GZ(){return""}function T7(q,$){if(q&&Object.prototype.hasOwnProperty.call(q,$))return q[$]}function wD(q,$){if(!$||!("root"in $))$=$?U6.createFrame($):{},$.root=q;return $}function hZ(q,$,K,P,_,j){if(q.decorator){var Y={};$=q.decorator($,Y,K,P&&P[0],_,j,P),e$.extend($,Y)}return $}function AZ(q,$,K){if(!$)return;Object.keys($).forEach(function(P){var _=$[P];q[P]=vD(_,K)})}function vD(q,$){var K=$.lookupProperty;return KD.wrapHelper(q,function(P){return P.lookupProperty=K,P})}});var sj=R((MZ,CZ)=>{MZ.__esModule=!0;MZ.default=function(q){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var $=globalThis.Handlebars;q.noConflict=function(){if(globalThis.Handlebars===q)globalThis.Handlebars=$;return q}};CZ.exports=MZ.default});var mZ=R((uZ,RZ)=>{uZ.__esModule=!0;function q9(q){return q&&q.__esModule?q:{default:q}}function $9(q){if(q&&q.__esModule)return q;else{var $={};if(q!=null){for(var K in q)if(Object.prototype.hasOwnProperty.call(q,K))$[K]=q[K]}return $.default=q,$}}var AD=z7(),NZ=$9(AD),GD=ZZ(),hD=q9(GD),VD=P6(),MD=q9(VD),CD=cq(),Qj=$9(CD),ND=VZ(),SZ=$9(ND),SD=sj(),bD=q9(SD);function bZ(){var q=new NZ.HandlebarsEnvironment;return Qj.extend(q,NZ),q.SafeString=hD.default,q.Exception=MD.default,q.Utils=Qj,q.escapeExpression=Qj.escapeExpression,q.VM=SZ,q.template=function($){return SZ.template($,q)},q}var hP=bZ();hP.create=bZ;bD.default(hP);hP.default=hP;uZ.default=hP;RZ.exports=uZ.default});var K9=R((EZ,pZ)=>{EZ.__esModule=!0;var IZ={helpers:{helperExpression:function($){return $.type==="SubExpression"||($.type==="MustacheStatement"||$.type==="BlockStatement")&&!!($.params&&$.params.length||$.hash)},scopedId:function($){return/^\.|this\b/.test($.original)},simpleId:function($){return $.parts.length===1&&!IZ.helpers.scopedId($)&&!$.depth}}};EZ.default=IZ;pZ.exports=EZ.default});var dZ=R((DZ,yZ)=>{DZ.__esModule=!0;var ED=function(){var q={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(_,j,Y,w,O,v,z){var W=v.length-1;switch(O){case 1:return v[W-1];case 2:this.$=w.prepareProgram(v[W]);break;case 3:this.$=v[W];break;case 4:this.$=v[W];break;case 5:this.$=v[W];break;case 6:this.$=v[W];break;case 7:this.$=v[W];break;case 8:this.$=v[W];break;case 9:this.$={type:"CommentStatement",value:w.stripComment(v[W]),strip:w.stripFlags(v[W],v[W]),loc:w.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:v[W],value:v[W],loc:w.locInfo(this._$)};break;case 11:this.$=w.prepareRawBlock(v[W-2],v[W-1],v[W],this._$);break;case 12:this.$={path:v[W-3],params:v[W-2],hash:v[W-1]};break;case 13:this.$=w.prepareBlock(v[W-3],v[W-2],v[W-1],v[W],!1,this._$);break;case 14:this.$=w.prepareBlock(v[W-3],v[W-2],v[W-1],v[W],!0,this._$);break;case 15:this.$={open:v[W-5],path:v[W-4],params:v[W-3],hash:v[W-2],blockParams:v[W-1],strip:w.stripFlags(v[W-5],v[W])};break;case 16:this.$={path:v[W-4],params:v[W-3],hash:v[W-2],blockParams:v[W-1],strip:w.stripFlags(v[W-5],v[W])};break;case 17:this.$={path:v[W-4],params:v[W-3],hash:v[W-2],blockParams:v[W-1],strip:w.stripFlags(v[W-5],v[W])};break;case 18:this.$={strip:w.stripFlags(v[W-1],v[W-1]),program:v[W]};break;case 19:var T=w.prepareBlock(v[W-2],v[W-1],v[W],v[W],!1,this._$),H=w.prepareProgram([T],v[W-1].loc);H.chained=!0,this.$={strip:v[W-2].strip,program:H,chain:!0};break;case 20:this.$=v[W];break;case 21:this.$={path:v[W-1],strip:w.stripFlags(v[W-2],v[W])};break;case 22:this.$=w.prepareMustache(v[W-3],v[W-2],v[W-1],v[W-4],w.stripFlags(v[W-4],v[W]),this._$);break;case 23:this.$=w.prepareMustache(v[W-3],v[W-2],v[W-1],v[W-4],w.stripFlags(v[W-4],v[W]),this._$);break;case 24:this.$={type:"PartialStatement",name:v[W-3],params:v[W-2],hash:v[W-1],indent:"",strip:w.stripFlags(v[W-4],v[W]),loc:w.locInfo(this._$)};break;case 25:this.$=w.preparePartialBlock(v[W-2],v[W-1],v[W],this._$);break;case 26:this.$={path:v[W-3],params:v[W-2],hash:v[W-1],strip:w.stripFlags(v[W-4],v[W])};break;case 27:this.$=v[W];break;case 28:this.$=v[W];break;case 29:this.$={type:"SubExpression",path:v[W-3],params:v[W-2],hash:v[W-1],loc:w.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:v[W],loc:w.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:w.id(v[W-2]),value:v[W],loc:w.locInfo(this._$)};break;case 32:this.$=w.id(v[W-1]);break;case 33:this.$=v[W];break;case 34:this.$=v[W];break;case 35:this.$={type:"StringLiteral",value:v[W],original:v[W],loc:w.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(v[W]),original:Number(v[W]),loc:w.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:v[W]==="true",original:v[W]==="true",loc:w.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:w.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:w.locInfo(this._$)};break;case 40:this.$=v[W];break;case 41:this.$=v[W];break;case 42:this.$=w.preparePath(!0,v[W],this._$);break;case 43:this.$=w.preparePath(!1,v[W],this._$);break;case 44:v[W-2].push({part:w.id(v[W]),original:v[W],separator:v[W-1]}),this.$=v[W-2];break;case 45:this.$=[{part:w.id(v[W]),original:v[W]}];break;case 46:this.$=[];break;case 47:v[W-1].push(v[W]);break;case 48:this.$=[];break;case 49:v[W-1].push(v[W]);break;case 50:this.$=[];break;case 51:v[W-1].push(v[W]);break;case 58:this.$=[];break;case 59:v[W-1].push(v[W]);break;case 64:this.$=[];break;case 65:v[W-1].push(v[W]);break;case 70:this.$=[];break;case 71:v[W-1].push(v[W]);break;case 78:this.$=[];break;case 79:v[W-1].push(v[W]);break;case 82:this.$=[];break;case 83:v[W-1].push(v[W]);break;case 86:this.$=[];break;case 87:v[W-1].push(v[W]);break;case 90:this.$=[];break;case 91:v[W-1].push(v[W]);break;case 94:this.$=[];break;case 95:v[W-1].push(v[W]);break;case 98:this.$=[v[W]];break;case 99:v[W-1].push(v[W]);break;case 100:this.$=[v[W]];break;case 101:v[W-1].push(v[W]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(_,j){throw Error(_)},parse:function(_){var j=this,Y=[0],w=[null],O=[],v=this.table,z="",W=0,T=0,H=0,J=2,Z=1;if(this.lexer.setInput(_),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u")this.lexer.yylloc={};var X=this.lexer.yylloc;O.push(X);var G=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function f(Q){Y.length=Y.length-2*Q,w.length=w.length-Q,O.length=O.length-Q}function N(){var Q=j.lexer.lex()||1;if(typeof Q!=="number")Q=j.symbols_[Q]||Q;return Q}var V,C,b,k,M,A,u={},S,p,L,c;while(!0){if(b=Y[Y.length-1],this.defaultActions[b])k=this.defaultActions[b];else{if(V===null||typeof V>"u")V=N();k=v[b]&&v[b][V]}if(typeof k>"u"||!k.length||!k[0]){var d="";if(!H){c=[];for(S in v[b])if(this.terminals_[S]&&S>2)c.push("'"+this.terminals_[S]+"'");if(this.lexer.showPosition)d="Parse error on line "+(W+1)+`:
|
|
211
|
+
`+this.lexer.showPosition()+`
|
|
212
|
+
Expecting `+c.join(", ")+", got '"+(this.terminals_[V]||V)+"'";else d="Parse error on line "+(W+1)+": Unexpected "+(V==1?"end of input":"'"+(this.terminals_[V]||V)+"'");this.parseError(d,{text:this.lexer.match,token:this.terminals_[V]||V,line:this.lexer.yylineno,loc:X,expected:c})}}if(k[0]instanceof Array&&k.length>1)throw Error("Parse Error: multiple actions possible at state: "+b+", token: "+V);switch(k[0]){case 1:if(Y.push(V),w.push(this.lexer.yytext),O.push(this.lexer.yylloc),Y.push(k[1]),V=null,!C){if(T=this.lexer.yyleng,z=this.lexer.yytext,W=this.lexer.yylineno,X=this.lexer.yylloc,H>0)H--}else V=C,C=null;break;case 2:if(p=this.productions_[k[1]][1],u.$=w[w.length-p],u._$={first_line:O[O.length-(p||1)].first_line,last_line:O[O.length-1].last_line,first_column:O[O.length-(p||1)].first_column,last_column:O[O.length-1].last_column},G)u._$.range=[O[O.length-(p||1)].range[0],O[O.length-1].range[1]];if(A=this.performAction.call(u,z,T,W,this.yy,k[1],w,O),typeof A<"u")return A;if(p)Y=Y.slice(0,-1*p*2),w=w.slice(0,-1*p),O=O.slice(0,-1*p);Y.push(this.productions_[k[1]][0]),w.push(u.$),O.push(u._$),L=v[Y[Y.length-2]][Y[Y.length-1]],Y.push(L);break;case 3:return!0}}return!0}},$=function(){var P={EOF:1,parseError:function(j,Y){if(this.yy.parser)this.yy.parser.parseError(j,Y);else throw Error(j)},setInput:function(j){if(this._input=j,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function(){var j=this._input[0];this.yytext+=j,this.yyleng++,this.offset++,this.match+=j,this.matched+=j;var Y=j.match(/(?:\r\n?|\n).*/g);if(Y)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),j},unput:function(j){var Y=j.length,w=j.split(/(?:\r\n?|\n)/g);this._input=j+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-Y-1),this.offset-=Y;var O=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),w.length-1)this.yylineno-=w.length-1;var v=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:w?(w.length===O.length?this.yylloc.first_column:0)+O[O.length-w.length].length-w[0].length:this.yylloc.first_column-Y},this.options.ranges)this.yylloc.range=[v[0],v[0]+this.yyleng-Y];return this},more:function(){return this._more=!0,this},less:function(j){this.unput(this.match.slice(j))},pastInput:function(){var j=this.matched.substr(0,this.matched.length-this.match.length);return(j.length>20?"...":"")+j.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var j=this.match;if(j.length<20)j+=this._input.substr(0,20-j.length);return(j.substr(0,20)+(j.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var j=this.pastInput(),Y=Array(j.length+1).join("-");return j+this.upcomingInput()+`
|
|
213
|
+
`+Y+"^"},next:function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var j,Y,w,O,v,z;if(!this._more)this.yytext="",this.match="";var W=this._currentRules();for(var T=0;T<W.length;T++)if(w=this._input.match(this.rules[W[T]]),w&&(!Y||w[0].length>Y[0].length)){if(Y=w,O=T,!this.options.flex)break}if(Y){if(z=Y[0].match(/(?:\r\n?|\n).*/g),z)this.yylineno+=z.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:z?z[z.length-1].length-z[z.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+Y[0].length},this.yytext+=Y[0],this.match+=Y[0],this.matches=Y,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._input=this._input.slice(Y[0].length),this.matched+=Y[0],j=this.performAction.call(this,this.yy,this,W[O],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(j)return j;else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
214
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var j=this.next();if(typeof j<"u")return j;else return this.lex()},begin:function(j){this.conditionStack.push(j)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(j){this.begin(j)}};return P.options={},P.performAction=function(j,Y,w,O){function v(W,T){return Y.yytext=Y.yytext.substring(W,Y.yyleng-T+W)}var z=O;switch(w){case 0:if(Y.yytext.slice(-2)==="\\\\")v(0,1),this.begin("mu");else if(Y.yytext.slice(-1)==="\\")v(0,1),this.begin("emu");else this.begin("mu");if(Y.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:if(this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw")return 15;else return v(5,9),"END_RAW_BLOCK";break;case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(Y.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return Y.yytext=v(1,2).replace(/\\"/g,'"'),80;break;case 32:return Y.yytext=v(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return Y.yytext=Y.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},P.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],P.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},P}();q.lexer=$;function K(){this.yy={}}return K.prototype=q,q.Parser=K,new K}();DZ.default=ED;yZ.exports=DZ.default});var Z7=R((xZ,nZ)=>{xZ.__esModule=!0;function yD(q){return q&&q.__esModule?q:{default:q}}var dD=P6(),P9=yD(dD);function H7(){this.parents=[]}H7.prototype={constructor:H7,mutating:!1,acceptKey:function($,K){var P=this.accept($[K]);if(this.mutating){if(P&&!H7.prototype[P.type])throw new P9.default('Unexpected node type "'+P.type+'" found when accepting '+K+" on "+$.type);$[K]=P}},acceptRequired:function($,K){if(this.acceptKey($,K),!$[K])throw new P9.default($.type+" requires "+K)},acceptArray:function($){for(var K=0,P=$.length;K<P;K++)if(this.acceptKey($,K),!$[K])$.splice(K,1),K--,P--},accept:function($){if(!$)return;if(!this[$.type])throw new P9.default("Unknown type: "+$.type,$);if(this.current)this.parents.unshift(this.current);this.current=$;var K=this[$.type]($);if(this.current=this.parents.shift(),!this.mutating||K)return K;else if(K!==!1)return $},Program:function($){this.acceptArray($.body)},MustacheStatement:J7,Decorator:J7,BlockStatement:LZ,DecoratorBlock:LZ,PartialStatement:gZ,PartialBlockStatement:function($){gZ.call(this,$),this.acceptKey($,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:J7,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function($){this.acceptArray($.pairs)},HashPair:function($){this.acceptRequired($,"value")}};function J7(q){this.acceptRequired(q,"path"),this.acceptArray(q.params),this.acceptKey(q,"hash")}function LZ(q){J7.call(this,q),this.acceptKey(q,"program"),this.acceptKey(q,"inverse")}function gZ(q){this.acceptRequired(q,"name"),this.acceptArray(q.params),this.acceptKey(q,"hash")}xZ.default=H7;nZ.exports=xZ.default});var oZ=R((cZ,lZ)=>{cZ.__esModule=!0;function xD(q){return q&&q.__esModule?q:{default:q}}var nD=Z7(),cD=xD(nD);function g6(){var q=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=q}g6.prototype=new cD.default;g6.prototype.Program=function(q){var $=!this.options.ignoreStandalone,K=!this.isRootSeen;this.isRootSeen=!0;var P=q.body;for(var _=0,j=P.length;_<j;_++){var Y=P[_],w=this.accept(Y);if(!w)continue;var O=_9(P,_,K),v=j9(P,_,K),z=w.openStandalone&&O,W=w.closeStandalone&&v,T=w.inlineStandalone&&O&&v;if(w.close)Q8(P,_,!0);if(w.open)f8(P,_,!0);if($&&T){if(Q8(P,_),f8(P,_)){if(Y.type==="PartialStatement")Y.indent=/([ \t]+$)/.exec(P[_-1].original)[1]}}if($&&z)Q8((Y.program||Y.inverse).body),f8(P,_);if($&&W)Q8(P,_),f8((Y.inverse||Y.program).body)}return q};g6.prototype.BlockStatement=g6.prototype.DecoratorBlock=g6.prototype.PartialBlockStatement=function(q){this.accept(q.program),this.accept(q.inverse);var $=q.program||q.inverse,K=q.program&&q.inverse,P=K,_=K;if(K&&K.chained){P=K.body[0].program;while(_.chained)_=_.body[_.body.length-1].program}var j={open:q.openStrip.open,close:q.closeStrip.close,openStandalone:j9($.body),closeStandalone:_9((P||$).body)};if(q.openStrip.close)Q8($.body,null,!0);if(K){var Y=q.inverseStrip;if(Y.open)f8($.body,null,!0);if(Y.close)Q8(P.body,null,!0);if(q.closeStrip.open)f8(_.body,null,!0);if(!this.options.ignoreStandalone&&_9($.body)&&j9(P.body))f8($.body),Q8(P.body)}else if(q.closeStrip.open)f8($.body,null,!0);return j};g6.prototype.Decorator=g6.prototype.MustacheStatement=function(q){return q.strip};g6.prototype.PartialStatement=g6.prototype.CommentStatement=function(q){var $=q.strip||{};return{inlineStandalone:!0,open:$.open,close:$.close}};function _9(q,$,K){if($===void 0)$=q.length;var P=q[$-1],_=q[$-2];if(!P)return K;if(P.type==="ContentStatement")return(_||!K?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(P.original)}function j9(q,$,K){if($===void 0)$=-1;var P=q[$+1],_=q[$+2];if(!P)return K;if(P.type==="ContentStatement")return(_||!K?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(P.original)}function Q8(q,$,K){var P=q[$==null?0:$+1];if(!P||P.type!=="ContentStatement"||!K&&P.rightStripped)return;var _=P.value;P.value=P.value.replace(K?/^\s+/:/^[ \t]*\r?\n?/,""),P.rightStripped=P.value!==_}function f8(q,$,K){var P=q[$==null?q.length-1:$-1];if(!P||P.type!=="ContentStatement"||!K&&P.leftStripped)return;var _=P.value;return P.value=P.value.replace(K?/\s+$/:/[ \t]+$/,""),P.leftStripped=P.value!==_,P.leftStripped}cZ.default=g6;lZ.exports=cZ.default});var aZ=R((Ky)=>{Ky.__esModule=!0;Ky.SourceLocation=iD;Ky.id=tD;Ky.stripFlags=BD;Ky.stripComment=eD;Ky.preparePath=UD;Ky.prepareMustache=FD;Ky.prepareRawBlock=sD;Ky.prepareBlock=QD;Ky.prepareProgram=qy;Ky.preparePartialBlock=$y;function aD(q){return q&&q.__esModule?q:{default:q}}var rD=P6(),Y9=aD(rD);function w9(q,$){if($=$.path?$.path.original:$,q.path.original!==$){var K={loc:q.path.loc};throw new Y9.default(q.path.original+" doesn't match "+$,K)}}function iD(q,$){this.source=q,this.start={line:$.first_line,column:$.first_column},this.end={line:$.last_line,column:$.last_column}}function tD(q){if(/^\[.*\]$/.test(q))return q.substring(1,q.length-1);else return q}function BD(q,$){return{open:q.charAt(2)==="~",close:$.charAt($.length-3)==="~"}}function eD(q){return q.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function UD(q,$,K){K=this.locInfo(K);var P=q?"@":"",_=[],j=0;for(var Y=0,w=$.length;Y<w;Y++){var O=$[Y].part,v=$[Y].original!==O;if(P+=($[Y].separator||"")+O,!v&&(O===".."||O==="."||O==="this")){if(_.length>0)throw new Y9.default("Invalid path: "+P,{loc:K});else if(O==="..")j++}else _.push(O)}return{type:"PathExpression",data:q,depth:j,parts:_,original:P,loc:K}}function FD(q,$,K,P,_,j){var Y=P.charAt(3)||P.charAt(2),w=Y!=="{"&&Y!=="&",O=/\*/.test(P);return{type:O?"Decorator":"MustacheStatement",path:q,params:$,hash:K,escaped:w,strip:_,loc:this.locInfo(j)}}function sD(q,$,K,P){w9(q,K),P=this.locInfo(P);var _={type:"Program",body:$,strip:{},loc:P};return{type:"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:_,openStrip:{},inverseStrip:{},closeStrip:{},loc:P}}function QD(q,$,K,P,_,j){if(P&&P.path)w9(q,P);var Y=/\*/.test(q.open);$.blockParams=q.blockParams;var w=void 0,O=void 0;if(K){if(Y)throw new Y9.default("Unexpected inverse block on decorator",K);if(K.chain)K.program.body[0].closeStrip=P.strip;O=K.strip,w=K.program}if(_)_=w,w=$,$=_;return{type:Y?"DecoratorBlock":"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:$,inverse:w,openStrip:q.strip,inverseStrip:O,closeStrip:P&&P.strip,loc:this.locInfo(j)}}function qy(q,$){if(!$&&q.length){var K=q[0].loc,P=q[q.length-1].loc;if(K&&P)$={source:K.source,start:{line:K.start.line,column:K.start.column},end:{line:P.end.line,column:P.end.column}}}return{type:"Program",body:q,strip:{},loc:$}}function $y(q,$,K,P){return w9(q,K),{type:"PartialBlockStatement",name:q.path,params:q.params,hash:q.hash,program:$,openStrip:q.strip,closeStrip:K&&K.strip,loc:this.locInfo(P)}}});var iZ=R((Ny)=>{Ny.__esModule=!0;Ny.parseWithoutProcessing=rZ;Ny.parse=Vy;function Jy(q){if(q&&q.__esModule)return q;else{var $={};if(q!=null){for(var K in q)if(Object.prototype.hasOwnProperty.call(q,K))$[K]=q[K]}return $.default=q,$}}function z9(q){return q&&q.__esModule?q:{default:q}}var Zy=dZ(),v9=z9(Zy),ky=oZ(),Xy=z9(ky),fy=aZ(),Ay=Jy(fy),Gy=P6(),VP=z9(Gy),hy=cq();Ny.parser=v9.default;var k7={};hy.extend(k7,Ay);function rZ(q,$){if(q.type==="Program")return My(q),q;v9.default.yy=k7,k7.locInfo=function(P){return new k7.SourceLocation($&&$.srcName,P)};var K=v9.default.parse(q);return K}function Vy(q,$){var K=rZ(q,$),P=new Xy.default($);return P.accept(K)}function My(q){O9(q)}function O9(q){if(q==null)return;if(Array.isArray(q)){q.forEach(O9);return}if(typeof q!=="object")return;if(q.type==="PathExpression"){if(!Cy(q.depth))throw new VP.default("Invalid AST: PathExpression.depth must be an integer");if(!Array.isArray(q.parts))throw new VP.default("Invalid AST: PathExpression.parts must be an array");for(var $=0;$<q.parts.length;$++)if(typeof q.parts[$]!=="string")throw new VP.default("Invalid AST: PathExpression.parts must only contain strings")}else if(q.type==="NumberLiteral"){if(typeof q.value!=="number"||!isFinite(q.value))throw new VP.default("Invalid AST: NumberLiteral.value must be a number")}else if(q.type==="BooleanLiteral"){if(typeof q.value!=="boolean")throw new VP.default("Invalid AST: BooleanLiteral.value must be a boolean")}Object.keys(q).forEach(function(K){if(K==="loc")return;O9(q[K])})}function Cy(q){return typeof q==="number"&&isFinite(q)&&Math.floor(q)===q&&q>=0}});var UZ=R((yy)=>{yy.__esModule=!0;yy.Compiler=W9;yy.precompile=py;yy.compile=Dy;function BZ(q){return q&&q.__esModule?q:{default:q}}var my=P6(),CP=BZ(my),NP=cq(),Iy=K9(),MP=BZ(Iy),Ey=[].slice;function W9(){}W9.prototype={compiler:W9,equals:function($){var K=this.opcodes.length;if($.opcodes.length!==K)return!1;for(var P=0;P<K;P++){var _=this.opcodes[P],j=$.opcodes[P];if(_.opcode!==j.opcode||!eZ(_.args,j.args))return!1}K=this.children.length;for(var P=0;P<K;P++)if(!this.children[P].equals($.children[P]))return!1;return!0},guid:0,compile:function($,K){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=K,this.stringParams=K.stringParams,this.trackIds=K.trackIds,K.blockParams=K.blockParams||[],K.knownHelpers=NP.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},K.knownHelpers),this.accept($)},compileProgram:function($){var K=new this.compiler,P=K.compile($,this.options),_=this.guid++;return this.usePartial=this.usePartial||P.usePartial,this.children[_]=P,this.useDepths=this.useDepths||P.useDepths,_},accept:function($){if(!this[$.type])throw new CP.default("Unknown type: "+$.type,$);this.sourceNode.unshift($);var K=this[$.type]($);return this.sourceNode.shift(),K},Program:function($){this.options.blockParams.unshift($.blockParams);var K=$.body,P=K.length;for(var _=0;_<P;_++)this.accept(K[_]);return this.options.blockParams.shift(),this.isSimple=P===1,this.blockParams=$.blockParams?$.blockParams.length:0,this},BlockStatement:function($){tZ($);var{program:K,inverse:P}=$;K=K&&this.compileProgram(K),P=P&&this.compileProgram(P);var _=this.classifySexpr($);if(_==="helper")this.helperSexpr($,K,P);else if(_==="simple")this.simpleSexpr($),this.opcode("pushProgram",K),this.opcode("pushProgram",P),this.opcode("emptyHash"),this.opcode("blockValue",$.path.original);else this.ambiguousSexpr($,K,P),this.opcode("pushProgram",K),this.opcode("pushProgram",P),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue");this.opcode("append")},DecoratorBlock:function($){var K=$.program&&this.compileProgram($.program),P=this.setupFullMustacheParams($,K,void 0),_=$.path;this.useDecorators=!0,this.opcode("registerDecorator",P.length,_.original)},PartialStatement:function($){this.usePartial=!0;var K=$.program;if(K)K=this.compileProgram($.program);var P=$.params;if(P.length>1)throw new CP.default("Unsupported number of partial arguments: "+P.length,$);else if(!P.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else P.push({type:"PathExpression",parts:[],depth:0});var _=$.name.original,j=$.name.type==="SubExpression";if(j)this.accept($.name);this.setupFullMustacheParams($,K,void 0,!0);var Y=$.indent||"";if(this.options.preventIndent&&Y)this.opcode("appendContent",Y),Y="";this.opcode("invokePartial",j,_,Y),this.opcode("append")},PartialBlockStatement:function($){this.PartialStatement($)},MustacheStatement:function($){if(this.SubExpression($),$.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function($){this.DecoratorBlock($)},ContentStatement:function($){if($.value)this.opcode("appendContent",$.value)},CommentStatement:function(){},SubExpression:function($){tZ($);var K=this.classifySexpr($);if(K==="simple")this.simpleSexpr($);else if(K==="helper")this.helperSexpr($);else this.ambiguousSexpr($)},ambiguousSexpr:function($,K,P){var _=$.path,j=_.parts[0],Y=K!=null||P!=null;this.opcode("getContext",_.depth),this.opcode("pushProgram",K),this.opcode("pushProgram",P),_.strict=!0,this.accept(_),this.opcode("invokeAmbiguous",j,Y)},simpleSexpr:function($){var K=$.path;K.strict=!0,this.accept(K),this.opcode("resolvePossibleLambda")},helperSexpr:function($,K,P){var _=this.setupFullMustacheParams($,K,P),j=$.path,Y=j.parts[0];if(this.options.knownHelpers[Y])this.opcode("invokeKnownHelper",_.length,Y);else if(this.options.knownHelpersOnly)throw new CP.default("You specified knownHelpersOnly, but used the unknown helper "+Y,$);else j.strict=!0,j.falsy=!0,this.accept(j),this.opcode("invokeHelper",_.length,j.original,MP.default.helpers.simpleId(j))},PathExpression:function($){this.addDepth($.depth),this.opcode("getContext",$.depth);var K=$.parts[0],P=MP.default.helpers.scopedId($),_=!$.depth&&!P&&this.blockParamIndex(K);if(_)this.opcode("lookupBlockParam",_,$.parts);else if(!K)this.opcode("pushContext");else if($.data)this.options.data=!0,this.opcode("lookupData",$.depth,$.parts,$.strict);else this.opcode("lookupOnContext",$.parts,$.falsy,$.strict,P)},StringLiteral:function($){this.opcode("pushString",$.value)},NumberLiteral:function($){this.opcode("pushLiteral",$.value)},BooleanLiteral:function($){this.opcode("pushLiteral",$.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function($){var K=$.pairs,P=0,_=K.length;this.opcode("pushHash");for(;P<_;P++)this.pushParam(K[P].value);while(P--)this.opcode("assignToHash",K[P].key);this.opcode("popHash")},opcode:function($){this.opcodes.push({opcode:$,args:Ey.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function($){if(!$)return;this.useDepths=!0},classifySexpr:function($){var K=MP.default.helpers.simpleId($.path),P=K&&!!this.blockParamIndex($.path.parts[0]),_=!P&&MP.default.helpers.helperExpression($),j=!P&&(_||K);if(j&&!_){var Y=$.path.parts[0],w=this.options;if(w.knownHelpers[Y])_=!0;else if(w.knownHelpersOnly)j=!1}if(_)return"helper";else if(j)return"ambiguous";else return"simple"},pushParams:function($){for(var K=0,P=$.length;K<P;K++)this.pushParam($[K])},pushParam:function($){var K=$.value!=null?$.value:$.original||"";if(this.stringParams){if(K.replace)K=K.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if($.depth)this.addDepth($.depth);if(this.opcode("getContext",$.depth||0),this.opcode("pushStringParam",K,$.type),$.type==="SubExpression")this.accept($)}else{if(this.trackIds){var P=void 0;if($.parts&&!MP.default.helpers.scopedId($)&&!$.depth)P=this.blockParamIndex($.parts[0]);if(P){var _=$.parts.slice(1).join(".");this.opcode("pushId","BlockParam",P,_)}else{if(K=$.original||K,K.replace)K=K.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"");this.opcode("pushId",$.type,K)}}this.accept($)}},setupFullMustacheParams:function($,K,P,_){var j=$.params;if(this.pushParams(j),this.opcode("pushProgram",K),this.opcode("pushProgram",P),$.hash)this.accept($.hash);else this.opcode("emptyHash",_);return j},blockParamIndex:function($){for(var K=0,P=this.options.blockParams.length;K<P;K++){var _=this.options.blockParams[K],j=_&&NP.indexOf(_,$);if(_&&j>=0)return[K,j]}}};function py(q,$,K){if(q==null||typeof q!=="string"&&q.type!=="Program")throw new CP.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+q);if($=$||{},!("data"in $))$.data=!0;if($.compat)$.useDepths=!0;var P=K.parse(q,$),_=new K.Compiler().compile(P,$);return new K.JavaScriptCompiler().compile(_,$)}function Dy(q,$,K){if($===void 0)$={};if(q==null||typeof q!=="string"&&q.type!=="Program")throw new CP.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+q);if($=NP.extend({},$),!("data"in $))$.data=!0;if($.compat)$.useDepths=!0;var P=void 0;function _(){var Y=K.parse(q,$),w=new K.Compiler().compile(Y,$),O=new K.JavaScriptCompiler().compile(w,$,void 0,!0);return K.template(O)}function j(Y,w){if(!P)P=_();return P.call(this,Y,w)}return j._setup=function(Y){if(!P)P=_();return P._setup(Y)},j._child=function(Y,w,O,v){if(!P)P=_();return P._child(Y,w,O,v)},j}function eZ(q,$){if(q===$)return!0;if(NP.isArray(q)&&NP.isArray($)&&q.length===$.length){for(var K=0;K<q.length;K++)if(!eZ(q[K],$[K]))return!1;return!0}}function tZ(q){if(!q.path.parts){var $=q.path;q.path={type:"PathExpression",data:!1,depth:0,parts:[$.original+""],original:$.original+"",loc:$.loc}}}});var sZ=R((ny)=>{var FZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ny.encode=function(q){if(0<=q&&q<FZ.length)return FZ[q];throw TypeError("Must be between 0 and 63: "+q)};ny.decode=function(q){var $=65,K=90,P=97,_=122,j=48,Y=57,w=43,O=47,v=26,z=52;if($<=q&&q<=K)return q-$;if(P<=q&&q<=_)return q-P+v;if(j<=q&&q<=Y)return q-j+z;if(q==w)return 62;if(q==O)return 63;return-1}});var H9=R((ry)=>{var QZ=sZ(),T9=5,qk=1<<T9,$k=qk-1,Kk=qk;function oy(q){return q<0?(-q<<1)+1:(q<<1)+0}function ay(q){var $=(q&1)===1,K=q>>1;return $?-K:K}ry.encode=function($){var K="",P,_=oy($);do{if(P=_&$k,_>>>=T9,_>0)P|=Kk;K+=QZ.encode(P)}while(_>0);return K};ry.decode=function($,K,P){var _=$.length,j=0,Y=0,w,O;do{if(K>=_)throw Error("Expected more digits in base 64 VLQ value.");if(O=QZ.decode($.charCodeAt(K++)),O===-1)throw Error("Invalid base64 digit: "+$.charAt(K-1));w=!!(O&Kk),O&=$k,j=j+(O<<Y),Y+=T9}while(w);P.value=ay(j),P.rest=K}});var s$=R((_d)=>{function By(q,$,K){if($ in q)return q[$];else if(arguments.length===3)return K;else throw Error('"'+$+'" is a required argument.')}_d.getArg=By;var Pk=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,ey=/^data:.+\,.+$/;function SP(q){var $=q.match(Pk);if(!$)return null;return{scheme:$[1],auth:$[2],host:$[3],port:$[4],path:$[5]}}_d.urlParse=SP;function U$(q){var $="";if(q.scheme)$+=q.scheme+":";if($+="//",q.auth)$+=q.auth+"@";if(q.host)$+=q.host;if(q.port)$+=":"+q.port;if(q.path)$+=q.path;return $}_d.urlGenerate=U$;function J9(q){var $=q,K=SP(q);if(K){if(!K.path)return q;$=K.path}var P=_d.isAbsolute($),_=$.split(/\/+/);for(var j,Y=0,w=_.length-1;w>=0;w--)if(j=_[w],j===".")_.splice(w,1);else if(j==="..")Y++;else if(Y>0)if(j==="")_.splice(w+1,Y),Y=0;else _.splice(w,2),Y--;if($=_.join("/"),$==="")$=P?"/":".";if(K)return K.path=$,U$(K);return $}_d.normalize=J9;function _k(q,$){if(q==="")q=".";if($==="")$=".";var K=SP($),P=SP(q);if(P)q=P.path||"/";if(K&&!K.scheme){if(P)K.scheme=P.scheme;return U$(K)}if(K||$.match(ey))return $;if(P&&!P.host&&!P.path)return P.host=$,U$(P);var _=$.charAt(0)==="/"?$:J9(q.replace(/\/+$/,"")+"/"+$);if(P)return P.path=_,U$(P);return _}_d.join=_k;_d.isAbsolute=function(q){return q.charAt(0)==="/"||Pk.test(q)};function Uy(q,$){if(q==="")q=".";q=q.replace(/\/$/,"");var K=0;while($.indexOf(q+"/")!==0){var P=q.lastIndexOf("/");if(P<0)return $;if(q=q.slice(0,P),q.match(/^([^\/]+:\/)?\/*$/))return $;++K}return Array(K+1).join("../")+$.substr(q.length+1)}_d.relative=Uy;var jk=function(){var q=Object.create(null);return!("__proto__"in q)}();function Yk(q){return q}function Fy(q){if(wk(q))return"$"+q;return q}_d.toSetString=jk?Yk:Fy;function sy(q){if(wk(q))return q.slice(1);return q}_d.fromSetString=jk?Yk:sy;function wk(q){if(!q)return!1;var $=q.length;if($<9)return!1;if(q.charCodeAt($-1)!==95||q.charCodeAt($-2)!==95||q.charCodeAt($-3)!==111||q.charCodeAt($-4)!==116||q.charCodeAt($-5)!==111||q.charCodeAt($-6)!==114||q.charCodeAt($-7)!==112||q.charCodeAt($-8)!==95||q.charCodeAt($-9)!==95)return!1;for(var K=$-10;K>=0;K--)if(q.charCodeAt(K)!==36)return!1;return!0}function Qy(q,$,K){var P=F$(q.source,$.source);if(P!==0)return P;if(P=q.originalLine-$.originalLine,P!==0)return P;if(P=q.originalColumn-$.originalColumn,P!==0||K)return P;if(P=q.generatedColumn-$.generatedColumn,P!==0)return P;if(P=q.generatedLine-$.generatedLine,P!==0)return P;return F$(q.name,$.name)}_d.compareByOriginalPositions=Qy;function qd(q,$,K){var P=q.generatedLine-$.generatedLine;if(P!==0)return P;if(P=q.generatedColumn-$.generatedColumn,P!==0||K)return P;if(P=F$(q.source,$.source),P!==0)return P;if(P=q.originalLine-$.originalLine,P!==0)return P;if(P=q.originalColumn-$.originalColumn,P!==0)return P;return F$(q.name,$.name)}_d.compareByGeneratedPositionsDeflated=qd;function F$(q,$){if(q===$)return 0;if(q===null)return 1;if($===null)return-1;if(q>$)return 1;return-1}function $d(q,$){var K=q.generatedLine-$.generatedLine;if(K!==0)return K;if(K=q.generatedColumn-$.generatedColumn,K!==0)return K;if(K=F$(q.source,$.source),K!==0)return K;if(K=q.originalLine-$.originalLine,K!==0)return K;if(K=q.originalColumn-$.originalColumn,K!==0)return K;return F$(q.name,$.name)}_d.compareByGeneratedPositionsInflated=$d;function Kd(q){return JSON.parse(q.replace(/^\)]}'[^\n]*\n/,""))}_d.parseSourceMapInput=Kd;function Pd(q,$,K){if($=$||"",q){if(q[q.length-1]!=="/"&&$[0]!=="/")q+="/";$=q+$}if(K){var P=SP(K);if(!P)throw Error("sourceMapURL could not be parsed");if(P.path){var _=P.path.lastIndexOf("/");if(_>=0)P.path=P.path.substring(0,_+1)}$=_k(U$(P),$)}return J9($)}_d.computeSourceURL=Pd});var X9=R((Ad)=>{var Z9=s$(),k9=Object.prototype.hasOwnProperty,q$=typeof Map<"u";function F6(){this._array=[],this._set=q$?new Map:Object.create(null)}F6.fromArray=function($,K){var P=new F6;for(var _=0,j=$.length;_<j;_++)P.add($[_],K);return P};F6.prototype.size=function(){return q$?this._set.size:Object.getOwnPropertyNames(this._set).length};F6.prototype.add=function($,K){var P=q$?$:Z9.toSetString($),_=q$?this.has($):k9.call(this._set,P),j=this._array.length;if(!_||K)this._array.push($);if(!_)if(q$)this._set.set($,j);else this._set[P]=j};F6.prototype.has=function($){if(q$)return this._set.has($);else{var K=Z9.toSetString($);return k9.call(this._set,K)}};F6.prototype.indexOf=function($){if(q$){var K=this._set.get($);if(K>=0)return K}else{var P=Z9.toSetString($);if(k9.call(this._set,P))return this._set[P]}throw Error('"'+$+'" is not in the set.')};F6.prototype.at=function($){if($>=0&&$<this._array.length)return this._array[$];throw Error("No element indexed by "+$)};F6.prototype.toArray=function(){return this._array.slice()};Ad.ArraySet=F6});var Ok=R((Vd)=>{var vk=s$();function hd(q,$){var K=q.generatedLine,P=$.generatedLine,_=q.generatedColumn,j=$.generatedColumn;return P>K||P==K&&j>=_||vk.compareByGeneratedPositionsInflated(q,$)<=0}function X7(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}X7.prototype.unsortedForEach=function($,K){this._array.forEach($,K)};X7.prototype.add=function($){if(hd(this._last,$))this._last=$,this._array.push($);else this._sorted=!1,this._array.push($)};X7.prototype.toArray=function(){if(!this._sorted)this._array.sort(vk.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};Vd.MappingList=X7});var f9=R((Nd)=>{var bP=H9(),Gq=s$(),f7=X9().ArraySet,Cd=Ok().MappingList;function T6(q){if(!q)q={};this._file=Gq.getArg(q,"file",null),this._sourceRoot=Gq.getArg(q,"sourceRoot",null),this._skipValidation=Gq.getArg(q,"skipValidation",!1),this._sources=new f7,this._names=new f7,this._mappings=new Cd,this._sourcesContents=null}T6.prototype._version=3;T6.fromSourceMap=function($){var K=$.sourceRoot,P=new T6({file:$.file,sourceRoot:K});return $.eachMapping(function(_){var j={generated:{line:_.generatedLine,column:_.generatedColumn}};if(_.source!=null){if(j.source=_.source,K!=null)j.source=Gq.relative(K,j.source);if(j.original={line:_.originalLine,column:_.originalColumn},_.name!=null)j.name=_.name}P.addMapping(j)}),$.sources.forEach(function(_){var j=_;if(K!==null)j=Gq.relative(K,_);if(!P._sources.has(j))P._sources.add(j);var Y=$.sourceContentFor(_);if(Y!=null)P.setSourceContent(_,Y)}),P};T6.prototype.addMapping=function($){var K=Gq.getArg($,"generated"),P=Gq.getArg($,"original",null),_=Gq.getArg($,"source",null),j=Gq.getArg($,"name",null);if(!this._skipValidation)this._validateMapping(K,P,_,j);if(_!=null){if(_=String(_),!this._sources.has(_))this._sources.add(_)}if(j!=null){if(j=String(j),!this._names.has(j))this._names.add(j)}this._mappings.add({generatedLine:K.line,generatedColumn:K.column,originalLine:P!=null&&P.line,originalColumn:P!=null&&P.column,source:_,name:j})};T6.prototype.setSourceContent=function($,K){var P=$;if(this._sourceRoot!=null)P=Gq.relative(this._sourceRoot,P);if(K!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[Gq.toSetString(P)]=K}else if(this._sourcesContents){if(delete this._sourcesContents[Gq.toSetString(P)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};T6.prototype.applySourceMap=function($,K,P){var _=K;if(K==null){if($.file==null)throw Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);_=$.file}var j=this._sourceRoot;if(j!=null)_=Gq.relative(j,_);var Y=new f7,w=new f7;this._mappings.unsortedForEach(function(O){if(O.source===_&&O.originalLine!=null){var v=$.originalPositionFor({line:O.originalLine,column:O.originalColumn});if(v.source!=null){if(O.source=v.source,P!=null)O.source=Gq.join(P,O.source);if(j!=null)O.source=Gq.relative(j,O.source);if(O.originalLine=v.line,O.originalColumn=v.column,v.name!=null)O.name=v.name}}var z=O.source;if(z!=null&&!Y.has(z))Y.add(z);var W=O.name;if(W!=null&&!w.has(W))w.add(W)},this),this._sources=Y,this._names=w,$.sources.forEach(function(O){var v=$.sourceContentFor(O);if(v!=null){if(P!=null)O=Gq.join(P,O);if(j!=null)O=Gq.relative(j,O);this.setSourceContent(O,v)}},this)};T6.prototype._validateMapping=function($,K,P,_){if(K&&typeof K.line!=="number"&&typeof K.column!=="number")throw Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if($&&"line"in $&&"column"in $&&$.line>0&&$.column>=0&&!K&&!P&&!_)return;else if($&&"line"in $&&"column"in $&&K&&"line"in K&&"column"in K&&$.line>0&&$.column>=0&&K.line>0&&K.column>=0&&P)return;else throw Error("Invalid mapping: "+JSON.stringify({generated:$,source:P,original:K,name:_}))};T6.prototype._serializeMappings=function(){var $=0,K=1,P=0,_=0,j=0,Y=0,w="",O,v,z,W,T=this._mappings.toArray();for(var H=0,J=T.length;H<J;H++){if(v=T[H],O="",v.generatedLine!==K){$=0;while(v.generatedLine!==K)O+=";",K++}else if(H>0){if(!Gq.compareByGeneratedPositionsInflated(v,T[H-1]))continue;O+=","}if(O+=bP.encode(v.generatedColumn-$),$=v.generatedColumn,v.source!=null){if(W=this._sources.indexOf(v.source),O+=bP.encode(W-Y),Y=W,O+=bP.encode(v.originalLine-1-_),_=v.originalLine-1,O+=bP.encode(v.originalColumn-P),P=v.originalColumn,v.name!=null)z=this._names.indexOf(v.name),O+=bP.encode(z-j),j=z}w+=O}return w};T6.prototype._generateSourcesContent=function($,K){return $.map(function(P){if(!this._sourcesContents)return null;if(K!=null)P=Gq.relative(K,P);var _=Gq.toSetString(P);return Object.prototype.hasOwnProperty.call(this._sourcesContents,_)?this._sourcesContents[_]:null},this)};T6.prototype.toJSON=function(){var $={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)$.file=this._file;if(this._sourceRoot!=null)$.sourceRoot=this._sourceRoot;if(this._sourcesContents)$.sourcesContent=this._generateSourcesContent($.sources,$.sourceRoot);return $};T6.prototype.toString=function(){return JSON.stringify(this.toJSON())};Nd.SourceMapGenerator=T6});var Wk=R((bd)=>{bd.GREATEST_LOWER_BOUND=1;bd.LEAST_UPPER_BOUND=2;function A9(q,$,K,P,_,j){var Y=Math.floor(($-q)/2)+q,w=_(K,P[Y],!0);if(w===0)return Y;else if(w>0){if($-Y>1)return A9(Y,$,K,P,_,j);if(j==bd.LEAST_UPPER_BOUND)return $<P.length?$:-1;else return Y}else{if(Y-q>1)return A9(q,Y,K,P,_,j);if(j==bd.LEAST_UPPER_BOUND)return Y;else return q<0?-1:q}}bd.search=function($,K,P,_){if(K.length===0)return-1;var j=A9(-1,K.length,$,K,P,_||bd.GREATEST_LOWER_BOUND);if(j<0)return-1;while(j-1>=0){if(P(K[j],K[j-1],!0)!==0)break;--j}return j}});var Tk=R((md)=>{function h9(q,$,K){var P=q[$];q[$]=q[K],q[K]=P}function Rd(q,$){return Math.round(q+Math.random()*($-q))}function V9(q,$,K,P){if(K<P){var _=Rd(K,P),j=K-1;h9(q,_,P);var Y=q[P];for(var w=K;w<P;w++)if($(q[w],Y)<=0)j+=1,h9(q,j,w);h9(q,j+1,w);var O=j+1;V9(q,$,K,O-1),V9(q,$,O+1,P)}}md.quickSort=function(q,$){V9(q,$,0,q.length-1)}});var Jk=R((pd)=>{var x=s$(),M9=Wk(),Q$=X9().ArraySet,Ed=H9(),uP=Tk().quickSort;function Pq(q,$){var K=q;if(typeof q==="string")K=x.parseSourceMapInput(q);return K.sections!=null?new h6(K,$):new uq(K,$)}Pq.fromSourceMap=function(q,$){return uq.fromSourceMap(q,$)};Pq.prototype._version=3;Pq.prototype.__generatedMappings=null;Object.defineProperty(Pq.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});Pq.prototype.__originalMappings=null;Object.defineProperty(Pq.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});Pq.prototype._charIsMappingSeparator=function($,K){var P=$.charAt(K);return P===";"||P===","};Pq.prototype._parseMappings=function($,K){throw Error("Subclasses must implement _parseMappings")};Pq.GENERATED_ORDER=1;Pq.ORIGINAL_ORDER=2;Pq.GREATEST_LOWER_BOUND=1;Pq.LEAST_UPPER_BOUND=2;Pq.prototype.eachMapping=function($,K,P){var _=K||null,j=P||Pq.GENERATED_ORDER,Y;switch(j){case Pq.GENERATED_ORDER:Y=this._generatedMappings;break;case Pq.ORIGINAL_ORDER:Y=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var w=this.sourceRoot;Y.map(function(O){var v=O.source===null?null:this._sources.at(O.source);return v=x.computeSourceURL(w,v,this._sourceMapURL),{source:v,generatedLine:O.generatedLine,generatedColumn:O.generatedColumn,originalLine:O.originalLine,originalColumn:O.originalColumn,name:O.name===null?null:this._names.at(O.name)}},this).forEach($,_)};Pq.prototype.allGeneratedPositionsFor=function($){var K=x.getArg($,"line"),P={source:x.getArg($,"source"),originalLine:K,originalColumn:x.getArg($,"column",0)};if(P.source=this._findSourceIndex(P.source),P.source<0)return[];var _=[],j=this._findMapping(P,this._originalMappings,"originalLine","originalColumn",x.compareByOriginalPositions,M9.LEAST_UPPER_BOUND);if(j>=0){var Y=this._originalMappings[j];if($.column===void 0){var w=Y.originalLine;while(Y&&Y.originalLine===w)_.push({line:x.getArg(Y,"generatedLine",null),column:x.getArg(Y,"generatedColumn",null),lastColumn:x.getArg(Y,"lastGeneratedColumn",null)}),Y=this._originalMappings[++j]}else{var O=Y.originalColumn;while(Y&&Y.originalLine===K&&Y.originalColumn==O)_.push({line:x.getArg(Y,"generatedLine",null),column:x.getArg(Y,"generatedColumn",null),lastColumn:x.getArg(Y,"lastGeneratedColumn",null)}),Y=this._originalMappings[++j]}}return _};pd.SourceMapConsumer=Pq;function uq(q,$){var K=q;if(typeof q==="string")K=x.parseSourceMapInput(q);var P=x.getArg(K,"version"),_=x.getArg(K,"sources"),j=x.getArg(K,"names",[]),Y=x.getArg(K,"sourceRoot",null),w=x.getArg(K,"sourcesContent",null),O=x.getArg(K,"mappings"),v=x.getArg(K,"file",null);if(P!=this._version)throw Error("Unsupported version: "+P);if(Y)Y=x.normalize(Y);_=_.map(String).map(x.normalize).map(function(z){return Y&&x.isAbsolute(Y)&&x.isAbsolute(z)?x.relative(Y,z):z}),this._names=Q$.fromArray(j.map(String),!0),this._sources=Q$.fromArray(_,!0),this._absoluteSources=this._sources.toArray().map(function(z){return x.computeSourceURL(Y,z,$)}),this.sourceRoot=Y,this.sourcesContent=w,this._mappings=O,this._sourceMapURL=$,this.file=v}uq.prototype=Object.create(Pq.prototype);uq.prototype.consumer=Pq;uq.prototype._findSourceIndex=function(q){var $=q;if(this.sourceRoot!=null)$=x.relative(this.sourceRoot,$);if(this._sources.has($))return this._sources.indexOf($);var K;for(K=0;K<this._absoluteSources.length;++K)if(this._absoluteSources[K]==q)return K;return-1};uq.fromSourceMap=function($,K){var P=Object.create(uq.prototype),_=P._names=Q$.fromArray($._names.toArray(),!0),j=P._sources=Q$.fromArray($._sources.toArray(),!0);P.sourceRoot=$._sourceRoot,P.sourcesContent=$._generateSourcesContent(P._sources.toArray(),P.sourceRoot),P.file=$._file,P._sourceMapURL=K,P._absoluteSources=P._sources.toArray().map(function(H){return x.computeSourceURL(P.sourceRoot,H,K)});var Y=$._mappings.toArray().slice(),w=P.__generatedMappings=[],O=P.__originalMappings=[];for(var v=0,z=Y.length;v<z;v++){var W=Y[v],T=new Hk;if(T.generatedLine=W.generatedLine,T.generatedColumn=W.generatedColumn,W.source){if(T.source=j.indexOf(W.source),T.originalLine=W.originalLine,T.originalColumn=W.originalColumn,W.name)T.name=_.indexOf(W.name);O.push(T)}w.push(T)}return uP(P.__originalMappings,x.compareByOriginalPositions),P};uq.prototype._version=3;Object.defineProperty(uq.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function Hk(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}uq.prototype._parseMappings=function($,K){var P=1,_=0,j=0,Y=0,w=0,O=0,v=$.length,z=0,W={},T={},H=[],J=[],Z,X,G,f,N;while(z<v)if($.charAt(z)===";")P++,z++,_=0;else if($.charAt(z)===",")z++;else{Z=new Hk,Z.generatedLine=P;for(f=z;f<v;f++)if(this._charIsMappingSeparator($,f))break;if(X=$.slice(z,f),G=W[X],G)z+=X.length;else{G=[];while(z<f)Ed.decode($,z,T),N=T.value,z=T.rest,G.push(N);if(G.length===2)throw Error("Found a source, but no line and column");if(G.length===3)throw Error("Found a source and line, but no column");W[X]=G}if(Z.generatedColumn=_+G[0],_=Z.generatedColumn,G.length>1){if(Z.source=w+G[1],w+=G[1],Z.originalLine=j+G[2],j=Z.originalLine,Z.originalLine+=1,Z.originalColumn=Y+G[3],Y=Z.originalColumn,G.length>4)Z.name=O+G[4],O+=G[4]}if(J.push(Z),typeof Z.originalLine==="number")H.push(Z)}uP(J,x.compareByGeneratedPositionsDeflated),this.__generatedMappings=J,uP(H,x.compareByOriginalPositions),this.__originalMappings=H};uq.prototype._findMapping=function($,K,P,_,j,Y){if($[P]<=0)throw TypeError("Line must be greater than or equal to 1, got "+$[P]);if($[_]<0)throw TypeError("Column must be greater than or equal to 0, got "+$[_]);return M9.search($,K,j,Y)};uq.prototype.computeColumnSpans=function(){for(var $=0;$<this._generatedMappings.length;++$){var K=this._generatedMappings[$];if($+1<this._generatedMappings.length){var P=this._generatedMappings[$+1];if(K.generatedLine===P.generatedLine){K.lastGeneratedColumn=P.generatedColumn-1;continue}}K.lastGeneratedColumn=1/0}};uq.prototype.originalPositionFor=function($){var K={generatedLine:x.getArg($,"line"),generatedColumn:x.getArg($,"column")},P=this._findMapping(K,this._generatedMappings,"generatedLine","generatedColumn",x.compareByGeneratedPositionsDeflated,x.getArg($,"bias",Pq.GREATEST_LOWER_BOUND));if(P>=0){var _=this._generatedMappings[P];if(_.generatedLine===K.generatedLine){var j=x.getArg(_,"source",null);if(j!==null)j=this._sources.at(j),j=x.computeSourceURL(this.sourceRoot,j,this._sourceMapURL);var Y=x.getArg(_,"name",null);if(Y!==null)Y=this._names.at(Y);return{source:j,line:x.getArg(_,"originalLine",null),column:x.getArg(_,"originalColumn",null),name:Y}}}return{source:null,line:null,column:null,name:null}};uq.prototype.hasContentsOfAllSources=function(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function($){return $==null})};uq.prototype.sourceContentFor=function($,K){if(!this.sourcesContent)return null;var P=this._findSourceIndex($);if(P>=0)return this.sourcesContent[P];var _=$;if(this.sourceRoot!=null)_=x.relative(this.sourceRoot,_);var j;if(this.sourceRoot!=null&&(j=x.urlParse(this.sourceRoot))){var Y=_.replace(/^file:\/\//,"");if(j.scheme=="file"&&this._sources.has(Y))return this.sourcesContent[this._sources.indexOf(Y)];if((!j.path||j.path=="/")&&this._sources.has("/"+_))return this.sourcesContent[this._sources.indexOf("/"+_)]}if(K)return null;else throw Error('"'+_+'" is not in the SourceMap.')};uq.prototype.generatedPositionFor=function($){var K=x.getArg($,"source");if(K=this._findSourceIndex(K),K<0)return{line:null,column:null,lastColumn:null};var P={source:K,originalLine:x.getArg($,"line"),originalColumn:x.getArg($,"column")},_=this._findMapping(P,this._originalMappings,"originalLine","originalColumn",x.compareByOriginalPositions,x.getArg($,"bias",Pq.GREATEST_LOWER_BOUND));if(_>=0){var j=this._originalMappings[_];if(j.source===P.source)return{line:x.getArg(j,"generatedLine",null),column:x.getArg(j,"generatedColumn",null),lastColumn:x.getArg(j,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};pd.BasicSourceMapConsumer=uq;function h6(q,$){var K=q;if(typeof q==="string")K=x.parseSourceMapInput(q);var P=x.getArg(K,"version"),_=x.getArg(K,"sections");if(P!=this._version)throw Error("Unsupported version: "+P);this._sources=new Q$,this._names=new Q$;var j={line:-1,column:0};this._sections=_.map(function(Y){if(Y.url)throw Error("Support for url field in sections not implemented.");var w=x.getArg(Y,"offset"),O=x.getArg(w,"line"),v=x.getArg(w,"column");if(O<j.line||O===j.line&&v<j.column)throw Error("Section offsets must be ordered and non-overlapping.");return j=w,{generatedOffset:{generatedLine:O+1,generatedColumn:v+1},consumer:new Pq(x.getArg(Y,"map"),$)}})}h6.prototype=Object.create(Pq.prototype);h6.prototype.constructor=Pq;h6.prototype._version=3;Object.defineProperty(h6.prototype,"sources",{get:function(){var q=[];for(var $=0;$<this._sections.length;$++)for(var K=0;K<this._sections[$].consumer.sources.length;K++)q.push(this._sections[$].consumer.sources[K]);return q}});h6.prototype.originalPositionFor=function($){var K={generatedLine:x.getArg($,"line"),generatedColumn:x.getArg($,"column")},P=M9.search(K,this._sections,function(j,Y){var w=j.generatedLine-Y.generatedOffset.generatedLine;if(w)return w;return j.generatedColumn-Y.generatedOffset.generatedColumn}),_=this._sections[P];if(!_)return{source:null,line:null,column:null,name:null};return _.consumer.originalPositionFor({line:K.generatedLine-(_.generatedOffset.generatedLine-1),column:K.generatedColumn-(_.generatedOffset.generatedLine===K.generatedLine?_.generatedOffset.generatedColumn-1:0),bias:$.bias})};h6.prototype.hasContentsOfAllSources=function(){return this._sections.every(function($){return $.consumer.hasContentsOfAllSources()})};h6.prototype.sourceContentFor=function($,K){for(var P=0;P<this._sections.length;P++){var _=this._sections[P],j=_.consumer.sourceContentFor($,!0);if(j)return j}if(K)return null;else throw Error('"'+$+'" is not in the SourceMap.')};h6.prototype.generatedPositionFor=function($){for(var K=0;K<this._sections.length;K++){var P=this._sections[K];if(P.consumer._findSourceIndex(x.getArg($,"source"))===-1)continue;var _=P.consumer.generatedPositionFor($);if(_){var j={line:_.line+(P.generatedOffset.generatedLine-1),column:_.column+(P.generatedOffset.generatedLine===_.line?P.generatedOffset.generatedColumn-1:0)};return j}}return{line:null,column:null}};h6.prototype._parseMappings=function($,K){this.__generatedMappings=[],this.__originalMappings=[];for(var P=0;P<this._sections.length;P++){var _=this._sections[P],j=_.consumer._generatedMappings;for(var Y=0;Y<j.length;Y++){var w=j[Y],O=_.consumer._sources.at(w.source);O=x.computeSourceURL(_.consumer.sourceRoot,O,this._sourceMapURL),this._sources.add(O),O=this._sources.indexOf(O);var v=null;if(w.name)v=_.consumer._names.at(w.name),this._names.add(v),v=this._names.indexOf(v);var z={source:O,generatedLine:w.generatedLine+(_.generatedOffset.generatedLine-1),generatedColumn:w.generatedColumn+(_.generatedOffset.generatedLine===w.generatedLine?_.generatedOffset.generatedColumn-1:0),originalLine:w.originalLine,originalColumn:w.originalColumn,name:v};if(this.__generatedMappings.push(z),typeof z.originalLine==="number")this.__originalMappings.push(z)}}uP(this.__generatedMappings,x.compareByGeneratedPositionsDeflated),uP(this.__originalMappings,x.compareByOriginalPositions)};pd.IndexedSourceMapConsumer=h6});var Zk=R((nd)=>{var Ld=f9().SourceMapGenerator,A7=s$(),gd=/(\r?\n)/,xd=10,qK="$$$isSourceNode$$$";function _6(q,$,K,P,_){if(this.children=[],this.sourceContents={},this.line=q==null?null:q,this.column=$==null?null:$,this.source=K==null?null:K,this.name=_==null?null:_,this[qK]=!0,P!=null)this.add(P)}_6.fromStringWithSourceMap=function($,K,P){var _=new _6,j=$.split(gd),Y=0,w=function(){var T=J(),H=J()||"";return T+H;function J(){return Y<j.length?j[Y++]:void 0}},O=1,v=0,z=null;if(K.eachMapping(function(T){if(z!==null)if(O<T.generatedLine)W(z,w()),O++,v=0;else{var H=j[Y]||"",J=H.substr(0,T.generatedColumn-v);j[Y]=H.substr(T.generatedColumn-v),v=T.generatedColumn,W(z,J),z=T;return}while(O<T.generatedLine)_.add(w()),O++;if(v<T.generatedColumn){var H=j[Y]||"";_.add(H.substr(0,T.generatedColumn)),j[Y]=H.substr(T.generatedColumn),v=T.generatedColumn}z=T},this),Y<j.length){if(z)W(z,w());_.add(j.splice(Y).join(""))}return K.sources.forEach(function(T){var H=K.sourceContentFor(T);if(H!=null){if(P!=null)T=A7.join(P,T);_.setSourceContent(T,H)}}),_;function W(T,H){if(T===null||T.source===void 0)_.add(H);else{var J=P?A7.join(P,T.source):T.source;_.add(new _6(T.originalLine,T.originalColumn,J,H,T.name))}}};_6.prototype.add=function($){if(Array.isArray($))$.forEach(function(K){this.add(K)},this);else if($[qK]||typeof $==="string"){if($)this.children.push($)}else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+$);return this};_6.prototype.prepend=function($){if(Array.isArray($))for(var K=$.length-1;K>=0;K--)this.prepend($[K]);else if($[qK]||typeof $==="string")this.children.unshift($);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+$);return this};_6.prototype.walk=function($){var K;for(var P=0,_=this.children.length;P<_;P++)if(K=this.children[P],K[qK])K.walk($);else if(K!=="")$(K,{source:this.source,line:this.line,column:this.column,name:this.name})};_6.prototype.join=function($){var K,P,_=this.children.length;if(_>0){K=[];for(P=0;P<_-1;P++)K.push(this.children[P]),K.push($);K.push(this.children[P]),this.children=K}return this};_6.prototype.replaceRight=function($,K){var P=this.children[this.children.length-1];if(P[qK])P.replaceRight($,K);else if(typeof P==="string")this.children[this.children.length-1]=P.replace($,K);else this.children.push("".replace($,K));return this};_6.prototype.setSourceContent=function($,K){this.sourceContents[A7.toSetString($)]=K};_6.prototype.walkSourceContents=function($){for(var K=0,P=this.children.length;K<P;K++)if(this.children[K][qK])this.children[K].walkSourceContents($);var _=Object.keys(this.sourceContents);for(var K=0,P=_.length;K<P;K++)$(A7.fromSetString(_[K]),this.sourceContents[_[K]])};_6.prototype.toString=function(){var $="";return this.walk(function(K){$+=K}),$};_6.prototype.toStringWithSourceMap=function($){var K={code:"",line:1,column:0},P=new Ld($),_=!1,j=null,Y=null,w=null,O=null;return this.walk(function(v,z){if(K.code+=v,z.source!==null&&z.line!==null&&z.column!==null){if(j!==z.source||Y!==z.line||w!==z.column||O!==z.name)P.addMapping({source:z.source,original:{line:z.line,column:z.column},generated:{line:K.line,column:K.column},name:z.name});j=z.source,Y=z.line,w=z.column,O=z.name,_=!0}else if(_)P.addMapping({generated:{line:K.line,column:K.column}}),j=null,_=!1;for(var W=0,T=v.length;W<T;W++)if(v.charCodeAt(W)===xd){if(K.line++,K.column=0,W+1===T)j=null,_=!1;else if(_)P.addMapping({source:z.source,original:{line:z.line,column:z.column},generated:{line:K.line,column:K.column},name:z.name})}else K.column++}),this.walkSourceContents(function(v,z){P.setSourceContent(v,z)}),{code:K.code,map:P}};nd.SourceNode=_6});var kk=R((ld)=>{ld.SourceMapGenerator=f9().SourceMapGenerator;ld.SourceMapConsumer=Jk().SourceMapConsumer;ld.SourceNode=Zk().SourceNode});var Gk=R((fk,Ak)=>{fk.__esModule=!0;var N9=cq(),$$=void 0;try{if(typeof define!=="function"||!define.amd)S9=kk(),$$=S9.SourceNode}catch(q){}var S9;if(!$$)$$=function(q,$,K,P){if(this.src="",P)this.add(P)},$$.prototype={add:function($){if(N9.isArray($))$=$.join("");this.src+=$},prepend:function($){if(N9.isArray($))$=$.join("");this.src=$+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}};function C9(q,$,K){if(N9.isArray(q)){var P=[];for(var _=0,j=q.length;_<j;_++)P.push($.wrap(q[_],K));return P}else if(typeof q==="boolean"||typeof q==="number")return q+"";return q}function Xk(q){this.srcFile=q,this.source=[]}Xk.prototype={isEmpty:function(){return!this.source.length},prepend:function($,K){this.source.unshift(this.wrap($,K))},push:function($,K){this.source.push(this.wrap($,K))},merge:function(){var $=this.empty();return this.each(function(K){$.add([" ",K,`
|
|
215
|
+
`])}),$},each:function($){for(var K=0,P=this.source.length;K<P;K++)$(this.source[K])},empty:function(){var $=this.currentLocation||{start:{}};return new $$($.start.line,$.start.column,this.srcFile)},wrap:function($){var K=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];if($ instanceof $$)return $;return $=C9($,this,K),new $$(K.start.line,K.start.column,this.srcFile,$)},functionCall:function($,K,P){return P=this.generateList(P),this.wrap([$,K?"."+K+"(":"(",P,")"])},quotedString:function($){return'"'+($+"").replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function($){var K=this,P=[];Object.keys($).forEach(function(j){var Y=C9($[j],K);if(Y!=="undefined")P.push([K.quotedString(j),":",Y])});var _=this.generateList(P);return _.prepend("{"),_.add("}"),_},generateList:function($){var K=this.empty();for(var P=0,_=$.length;P<_;P++){if(P)K.add(",");K.add(C9($[P],this))}return K},generateArray:function($){var K=this.generateList($);return K.prepend("["),K.add("]"),K}};fk.default=Xk;Ak.exports=fk.default});var Sk=R((Ck,Nk)=>{Ck.__esModule=!0;function Mk(q){return q&&q.__esModule?q:{default:q}}var hk=z7(),Bd=P6(),b9=Mk(Bd),ed=cq(),Ud=Gk(),Vk=Mk(Ud);function $K(q){this.value=q}function KK(){}KK.prototype={nameLookup:function($,K){return this.internalNameLookup($,K)},depthedLookup:function($){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify($),")"]},compilerInfo:function(){var $=hk.COMPILER_REVISION,K=hk.REVISION_CHANGES[$];return[$,K]},appendToBuffer:function($,K,P){if(!ed.isArray($))$=[$];if($=this.source.wrap($,K),this.environment.isSimple)return["return ",$,";"];else if(P)return["buffer += ",$,";"];else return $.appendToBuffer=!0,$},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function($,K){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",$,",",JSON.stringify(K),")"]},lookupPropertyFunctionIsUsed:!1,compile:function($,K,P,_){this.environment=$,this.options=K,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!_,this.name=this.environment.name,this.isChild=!!P,this.context=P||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren($,K),this.useDepths=this.useDepths||$.useDepths||$.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||$.useBlockParams;var j=$.opcodes,Y=void 0,w=void 0,O=void 0,v=void 0;for(O=0,v=j.length;O<v;O++)Y=j[O],this.source.currentLocation=Y.loc,w=w||Y.loc,this[Y.opcode].apply(this,Y.args);if(this.source.currentLocation=w,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new b9.default("Compile completed with content left on stack");if(!this.decorators.isEmpty())if(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
|
|
216
|
+
`]),this.decorators.push("return fn;"),_)this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]);else this.decorators.prepend(`function(fn, props, container, depth0, data, blockParams, depths) {
|
|
217
|
+
`),this.decorators.push(`}
|
|
218
|
+
`),this.decorators=this.decorators.merge();else this.decorators=void 0;var z=this.createFunctionContext(_);if(!this.isChild){var W={compiler:this.compilerInfo(),main:z};if(this.decorators)W.main_d=this.decorators,W.useDecorators=!0;var T=this.context,H=T.programs,J=T.decorators;for(O=0,v=H.length;O<v;O++)if(W[O]=H[O],J[O])W[O+"_d"]=J[O],W.useDecorators=!0;if(this.environment.usePartial)W.usePartial=!0;if(this.options.data)W.useData=!0;if(this.useDepths)W.useDepths=!0;if(this.useBlockParams)W.useBlockParams=!0;if(this.options.compat)W.compat=!0;if(!_)if(W.compiler=JSON.stringify(W.compiler),this.source.currentLocation={start:{line:1,column:0}},W=this.objectLiteral(W),K.srcName)W=W.toStringWithSourceMap({file:K.destName}),W.map=W.map&&W.map.toString();else W=W.toString();else W.compilerOptions=this.options;return W}else return z},preamble:function(){this.lastContext=0,this.source=new Vk.default(this.options.srcName),this.decorators=new Vk.default(this.options.srcName)},createFunctionContext:function($){var K=this,P="",_=this.stackVars.concat(this.registers.list);if(_.length>0)P+=", "+_.join(", ");var j=0;if(Object.keys(this.aliases).forEach(function(O){var v=K.aliases[O];if(v.children&&v.referenceCount>1)P+=", alias"+ ++j+"="+O,v.children[0]="alias"+j}),this.lookupPropertyFunctionIsUsed)P+=", "+this.lookupPropertyFunctionVarDeclaration();var Y=["container","depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths)Y.push("blockParams");if(this.useDepths)Y.push("depths");var w=this.mergeSource(P);if($)return Y.push(w),Function.apply(this,Y);else return this.source.wrap(["function(",Y.join(","),`) {
|
|
219
|
+
`,w,"}"])},mergeSource:function($){var K=this.environment.isSimple,P=!this.forceBuffer,_=void 0,j=void 0,Y=void 0,w=void 0;if(this.source.each(function(O){if(O.appendToBuffer){if(Y)O.prepend(" + ");else Y=O;w=O}else{if(Y){if(!j)_=!0;else Y.prepend("buffer += ");w.add(";"),Y=w=void 0}if(j=!0,!K)P=!1}}),P){if(Y)Y.prepend("return "),w.add(";");else if(!j)this.source.push('return "";')}else if($+=", buffer = "+(_?"":this.initializeBuffer()),Y)Y.prepend("return buffer + "),w.add(";");else this.source.push("return buffer;");if($)this.source.prepend("var "+$.substring(2)+(_?"":`;
|
|
220
|
+
`));return this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return`
|
|
221
|
+
lookupProperty = container.lookupProperty || function(parent, propertyName) {
|
|
222
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
223
|
+
return parent[propertyName];
|
|
224
|
+
}
|
|
225
|
+
return undefined
|
|
226
|
+
}
|
|
227
|
+
`.trim()},blockValue:function($){var K=this.aliasable("container.hooks.blockHelperMissing"),P=[this.contextName(0)];this.setupHelperArgs($,0,P);var _=this.popStack();P.splice(1,0,_),this.push(this.source.functionCall(K,"call",P))},ambiguousBlockValue:function(){var $=this.aliasable("container.hooks.blockHelperMissing"),K=[this.contextName(0)];this.setupHelperArgs("",0,K,!0),this.flushInline();var P=this.topStack();K.splice(1,0,P),this.pushSource(["if (!",this.lastHelper,") { ",P," = ",this.source.functionCall($,"call",K),"}"])},appendContent:function($){if(this.pendingContent)$=this.pendingContent+$;else this.pendingLocation=this.source.currentLocation;this.pendingContent=$},append:function(){if(this.isInline())this.replaceStack(function(K){return[" != null ? ",K,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var $=this.popStack();if(this.pushSource(["if (",$," != null) { ",this.appendToBuffer($,void 0,!0)," }"]),this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function($){this.lastContext=$},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function($,K,P,_){var j=0;if(!_&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup($[j++]));else this.pushContext();this.resolvePath("context",$,j,K,P)},lookupBlockParam:function($,K){this.useBlockParams=!0,this.push(["blockParams[",$[0],"][",$[1],"]"]),this.resolvePath("context",K,1)},lookupData:function($,K,P){if(!$)this.pushStackLiteral("data");else this.pushStackLiteral("container.data(data, "+$+")");this.resolvePath("data",K,0,!0,P)},resolvePath:function($,K,P,_,j){var Y=this;if(this.options.strict||this.options.assumeObjects){this.push(Fd(this.options.strict&&j,this,K,P,$));return}var w=K.length,O=function(z){Y.replaceStack(function(W){var T=Y.nameLookup(W,K[z],$);if(!_)return[" != null ? ",T," : ",W];else return[" && ",T]})};for(var v=P;v<w;v++)O(v)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function($,K){if(this.pushContext(),this.pushString(K),K!=="SubExpression")if(typeof $==="string")this.pushString($);else this.pushStackLiteral($)},emptyHash:function($){if(this.trackIds)this.push("{}");if(this.stringParams)this.push("{}"),this.push("{}");this.pushStackLiteral($?"undefined":"{}")},pushHash:function(){if(this.hash)this.hashes.push(this.hash);this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var $=this.hash;if(this.hash=this.hashes.pop(),this.trackIds)this.push(this.objectLiteral($.ids));if(this.stringParams)this.push(this.objectLiteral($.contexts)),this.push(this.objectLiteral($.types));this.push(this.objectLiteral($.values))},pushString:function($){this.pushStackLiteral(this.quotedString($))},pushLiteral:function($){this.pushStackLiteral($)},pushProgram:function($){if($!=null)this.pushStackLiteral(this.programExpression($));else this.pushStackLiteral(null)},registerDecorator:function($,K){var P=this.nameLookup("decorators",K,"decorator"),_=this.setupHelperArgs(K,$);this.decorators.push(["var decorator = ",P,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+K+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",_])," || fn;"])},invokeHelper:function($,K,P){var _=this.popStack(),j=this.setupHelper($,K),Y=[];if(P)Y.push(j.name);if(Y.push(_),!this.options.strict)Y.push(this.aliasable("container.hooks.helperMissing"));var w=["(",this.itemsSeparatedBy(Y,"||"),")"],O=this.source.functionCall(w,"call",j.callParams);this.push(O)},itemsSeparatedBy:function($,K){var P=[];P.push($[0]);for(var _=1;_<$.length;_++)P.push(K,$[_]);return P},invokeKnownHelper:function($,K){var P=this.setupHelper($,K);this.push(this.source.functionCall(P.name,"call",P.callParams))},invokeAmbiguous:function($,K){this.useRegister("helper");var P=this.popStack();this.emptyHash();var _=this.setupHelper(0,$,K),j=this.lastHelper=this.nameLookup("helpers",$,"helper"),Y=["(","(helper = ",j," || ",P,")"];if(!this.options.strict)Y[0]="(helper = ",Y.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"));this.push(["(",Y,_.paramsInit?["),(",_.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",_.callParams)," : helper))"])},invokePartial:function($,K,P){var _=[],j=this.setupParams(K,1,_);if($)K=this.popStack(),delete j.name;if(P)j.indent=JSON.stringify(P);if(j.helpers="helpers",j.partials="partials",j.decorators="container.decorators",!$)_.unshift(this.nameLookup("partials",K,"partial"));else _.unshift(K);if(this.options.compat)j.depths="depths";j=this.objectLiteral(j),_.push(j),this.push(this.source.functionCall("container.invokePartial","",_))},assignToHash:function($){var K=this.popStack(),P=void 0,_=void 0,j=void 0;if(this.trackIds)j=this.popStack();if(this.stringParams)_=this.popStack(),P=this.popStack();var Y=this.hash;if(P)Y.contexts[$]=P;if(_)Y.types[$]=_;if(j)Y.ids[$]=j;Y.values[$]=K},pushId:function($,K,P){if($==="BlockParam")this.pushStackLiteral("blockParams["+K[0]+"].path["+K[1]+"]"+(P?" + "+JSON.stringify("."+P):""));else if($==="PathExpression")this.pushString(K);else if($==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:KK,compileChildren:function($,K){var P=$.children,_=void 0,j=void 0;for(var Y=0,w=P.length;Y<w;Y++){_=P[Y],j=new this.compiler;var O=this.matchExistingProgram(_);if(O==null){var v=this.context.programs.push("")-1;_.index=v,_.name="program"+v,this.context.programs[v]=j.compile(_,K,this.context,!this.precompile),this.context.decorators[v]=j.decorators,this.context.environments[v]=_,this.useDepths=this.useDepths||j.useDepths,this.useBlockParams=this.useBlockParams||j.useBlockParams,_.useDepths=this.useDepths,_.useBlockParams=this.useBlockParams}else _.index=O.index,_.name="program"+O.index,this.useDepths=this.useDepths||O.useDepths,this.useBlockParams=this.useBlockParams||O.useBlockParams}},matchExistingProgram:function($){for(var K=0,P=this.context.environments.length;K<P;K++){var _=this.context.environments[K];if(_&&_.equals($))return _}},programExpression:function($){var K=this.environment.children[$],P=[K.index,"data",K.blockParams];if(this.useBlockParams||this.useDepths)P.push("blockParams");if(this.useDepths)P.push("depths");return"container.program("+P.join(", ")+")"},useRegister:function($){if(!this.registers[$])this.registers[$]=!0,this.registers.list.push($)},push:function($){if(!($ instanceof $K))$=this.source.wrap($);return this.inlineStack.push($),$},pushStackLiteral:function($){this.push(new $K($))},pushSource:function($){if(this.pendingContent)this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0;if($)this.source.push($)},replaceStack:function($){var K=["("],P=void 0,_=void 0,j=void 0;if(!this.isInline())throw new b9.default("replaceStack on non-inline");var Y=this.popStack(!0);if(Y instanceof $K)P=[Y.value],K=["(",P],j=!0;else{_=!0;var w=this.incrStack();K=["((",this.push(w)," = ",Y,")"],P=this.topStack()}var O=$.call(this,P);if(!j)this.popStack();if(_)this.stackSlot--;this.push(K.concat(O,")"))},incrStack:function(){if(this.stackSlot++,this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var $=this.inlineStack;this.inlineStack=[];for(var K=0,P=$.length;K<P;K++){var _=$[K];if(_ instanceof $K)this.compileStack.push(_);else{var j=this.incrStack();this.pushSource([j," = ",_,";"]),this.compileStack.push(j)}}},isInline:function(){return this.inlineStack.length},popStack:function($){var K=this.isInline(),P=(K?this.inlineStack:this.compileStack).pop();if(!$&&P instanceof $K)return P.value;else{if(!K){if(!this.stackSlot)throw new b9.default("Invalid stack pop");this.stackSlot--}return P}},topStack:function(){var $=this.isInline()?this.inlineStack:this.compileStack,K=$[$.length-1];if(K instanceof $K)return K.value;else return K},contextName:function($){if(this.useDepths&&$)return"depths["+$+"]";else return"depth"+$},quotedString:function($){return this.source.quotedString($)},objectLiteral:function($){return this.source.objectLiteral($)},aliasable:function($){var K=this.aliases[$];if(K)return K.referenceCount++,K;return K=this.aliases[$]=this.source.wrap($),K.aliasable=!0,K.referenceCount=1,K},setupHelper:function($,K,P){var _=[],j=this.setupHelperArgs(K,$,_,P),Y=this.nameLookup("helpers",K,"helper"),w=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:_,paramsInit:j,name:Y,callParams:[w].concat(_)}},setupParams:function($,K,P){var _={},j=[],Y=[],w=[],O=!P,v=void 0;if(O)P=[];if(_.name=this.quotedString($),_.hash=this.popStack(),this.trackIds)_.hashIds=this.popStack();if(this.stringParams)_.hashTypes=this.popStack(),_.hashContexts=this.popStack();var z=this.popStack(),W=this.popStack();if(W||z)_.fn=W||"container.noop",_.inverse=z||"container.noop";var T=K;while(T--){if(v=this.popStack(),P[T]=v,this.trackIds)w[T]=this.popStack();if(this.stringParams)Y[T]=this.popStack(),j[T]=this.popStack()}if(O)_.args=this.source.generateArray(P);if(this.trackIds)_.ids=this.source.generateArray(w);if(this.stringParams)_.types=this.source.generateArray(Y),_.contexts=this.source.generateArray(j);if(this.options.data)_.data="data";if(this.useBlockParams)_.blockParams="blockParams";return _},setupHelperArgs:function($,K,P,_){var j=this.setupParams($,K,P);if(j.loc=JSON.stringify(this.source.currentLocation),j=this.objectLiteral(j),_)return this.useRegister("options"),P.push("options"),["options=",j];else if(P)return P.push(j),"";else return j}};(function(){var q="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),$=KK.RESERVED_WORDS={};for(var K=0,P=q.length;K<P;K++)$[q[K]]=!0})();KK.isValidJavaScriptVariableName=function(q){return!KK.RESERVED_WORDS[q]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(q)};function Fd(q,$,K,P,_){var j=$.popStack(),Y=K.length;if(q)Y--;for(var w=P;w<Y;w++)j=$.nameLookup(j,K[w],_);if(q)return[$.aliasable("container.strict"),"(",j,", ",$.quotedString(K[Y]),", ",JSON.stringify($.source.currentLocation)," )"];else return j}Ck.default=KK;Nk.exports=Ck.default});var mk=R((uk,Rk)=>{uk.__esModule=!0;function RP(q){return q&&q.__esModule?q:{default:q}}var qL=mZ(),$L=RP(qL),KL=K9(),PL=RP(KL),u9=iZ(),R9=UZ(),_L=Sk(),jL=RP(_L),YL=Z7(),wL=RP(YL),vL=sj(),OL=RP(vL),zL=$L.default.create;function bk(){var q=zL();return q.compile=function($,K){return R9.compile($,K,q)},q.precompile=function($,K){return R9.precompile($,K,q)},q.AST=PL.default,q.Compiler=R9.Compiler,q.JavaScriptCompiler=jL.default,q.Parser=u9.parser,q.parse=u9.parse,q.parseWithoutProcessing=u9.parseWithoutProcessing,q}var PK=bk();PK.create=bk;OL.default(PK);PK.Visitor=wL.default;PK.default=PK;uk.default=PK;Rk.exports=uk.default});var Ik=R((XL)=>{XL.__esModule=!0;XL.print=kL;XL.PrintVisitor=zq;function HL(q){return q&&q.__esModule?q:{default:q}}var JL=Z7(),ZL=HL(JL);function kL(q){return new zq().accept(q)}function zq(){this.padding=0}zq.prototype=new ZL.default;zq.prototype.pad=function(q){var $="";for(var K=0,P=this.padding;K<P;K++)$+=" ";return $+=q+`
|
|
228
|
+
`,$};zq.prototype.Program=function(q){var $="",K=q.body,P=void 0,_=void 0;if(q.blockParams){var j="BLOCK PARAMS: [";for(P=0,_=q.blockParams.length;P<_;P++)j+=" "+q.blockParams[P];j+=" ]",$+=this.pad(j)}for(P=0,_=K.length;P<_;P++)$+=this.accept(K[P]);return this.padding--,$};zq.prototype.MustacheStatement=function(q){return this.pad("{{ "+this.SubExpression(q)+" }}")};zq.prototype.Decorator=function(q){return this.pad("{{ DIRECTIVE "+this.SubExpression(q)+" }}")};zq.prototype.BlockStatement=zq.prototype.DecoratorBlock=function(q){var $="";if($+=this.pad((q.type==="DecoratorBlock"?"DIRECTIVE ":"")+"BLOCK:"),this.padding++,$+=this.pad(this.SubExpression(q)),q.program)$+=this.pad("PROGRAM:"),this.padding++,$+=this.accept(q.program),this.padding--;if(q.inverse){if(q.program)this.padding++;if($+=this.pad("{{^}}"),this.padding++,$+=this.accept(q.inverse),this.padding--,q.program)this.padding--}return this.padding--,$};zq.prototype.PartialStatement=function(q){var $="PARTIAL:"+q.name.original;if(q.params[0])$+=" "+this.accept(q.params[0]);if(q.hash)$+=" "+this.accept(q.hash);return this.pad("{{> "+$+" }}")};zq.prototype.PartialBlockStatement=function(q){var $="PARTIAL BLOCK:"+q.name.original;if(q.params[0])$+=" "+this.accept(q.params[0]);if(q.hash)$+=" "+this.accept(q.hash);return $+=" "+this.pad("PROGRAM:"),this.padding++,$+=this.accept(q.program),this.padding--,this.pad("{{> "+$+" }}")};zq.prototype.ContentStatement=function(q){return this.pad("CONTENT[ '"+q.value+"' ]")};zq.prototype.CommentStatement=function(q){return this.pad("{{! '"+q.value+"' }}")};zq.prototype.SubExpression=function(q){var $=q.params,K=[],P=void 0;for(var _=0,j=$.length;_<j;_++)K.push(this.accept($[_]));return $="["+K.join(", ")+"]",P=q.hash?" "+this.accept(q.hash):"",this.accept(q.path)+" "+$+P};zq.prototype.PathExpression=function(q){var $=q.parts.join("/");return(q.data?"@":"")+"PATH:"+$};zq.prototype.StringLiteral=function(q){return'"'+q.value+'"'};zq.prototype.NumberLiteral=function(q){return"NUMBER{"+q.value+"}"};zq.prototype.BooleanLiteral=function(q){return"BOOLEAN{"+q.value+"}"};zq.prototype.UndefinedLiteral=function(){return"UNDEFINED"};zq.prototype.NullLiteral=function(){return"NULL"};zq.prototype.Hash=function(q){var $=q.pairs,K=[];for(var P=0,_=$.length;P<_;P++)K.push(this.accept($[P]));return"HASH{"+K.join(", ")+"}"};zq.prototype.HashPair=function(q){return q.key+"="+this.accept(q.value)}});var yk=R((ya,Dk)=>{var G7=mk().default,pk=Ik();G7.PrintVisitor=pk.PrintVisitor;G7.print=pk.print;Dk.exports=G7;function Ek(q,$){var K=fq("fs"),P=K.readFileSync($,"utf8");q.exports=G7.compile(P)}if(fq.extensions)fq.extensions[".handlebars"]=Ek,fq.extensions[".hbs"]=Ek});var i=function(q){return q.info="info",q.warn="warn",q.error="error",q.debug="debug",q.trace="trace",q.fatal="fatal",q}({}),mP={[i.trace]:10,[i.debug]:20,[i.info]:30,[i.warn]:40,[i.error]:50,[i.fatal]:60},rk={10:i.trace,20:i.debug,30:i.info,40:i.warn,50:i.error,60:i.fatal};var mq=function(q){return q.transformLogLevel="transformLogLevel",q.onBeforeDataOut="onBeforeDataOut",q.shouldSendToLogger="shouldSendToLogger",q.onMetadataCalled="onMetadataCalled",q.onBeforeMessageOut="onBeforeMessageOut",q.onContextCalled="onContextCalled",q}({});var D9=class q{context={};hasContext=!1;setContext($){if(!$){this.context={},this.hasContext=!1;return}this.context=$,this.hasContext=!0}appendContext($){this.context={...this.context,...$},this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}clearContext($){if($===void 0){this.context={},this.hasContext=!1;return}let K=Array.isArray($)?$:[$];for(let P of K)delete this.context[P];this.hasContext=Object.keys(this.context).length>0}onChildLoggerCreated({parentContextManager:$,childContextManager:K}){if($.hasContextData()){let P=$.getContext();K.setContext({...P})}}clone(){let $=new q;return $.setContext({...this.context}),$.hasContext=this.hasContext,$}},y9=class q{setContext($){}appendContext($){}getContext(){return{}}hasContextData(){return!1}clearContext($){}onChildLoggerCreated($){}clone(){return new q}};var d9=class q{logLevelEnabledStatus={info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0};setLevel($){let K=mP[$];for(let P of Object.values(i)){let _=P,j=mP[P];this.logLevelEnabledStatus[_]=j>=K}}enableIndividualLevel($){let K=$;if(K in this.logLevelEnabledStatus)this.logLevelEnabledStatus[K]=!0}disableIndividualLevel($){let K=$;if(K in this.logLevelEnabledStatus)this.logLevelEnabledStatus[K]=!1}isLevelEnabled($){let K=$;return this.logLevelEnabledStatus[K]}enableLogging(){for(let $ of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[$]=!0}disableLogging(){for(let $ of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[$]=!1}onChildLoggerCreated({parentLogLevelManager:$,childLogLevelManager:K}){let P=$.logLevelEnabledStatus;if(K instanceof q)K.logLevelEnabledStatus={...P}}clone(){let $=new q;return $.logLevelEnabledStatus={...this.logLevelEnabledStatus},$}},L9=class q{setLevel($){}enableIndividualLevel($){}disableIndividualLevel($){}isLevelEnabled($){return!0}enableLogging(){}disableLogging(){}onChildLoggerCreated($){}clone(){return new q}};var ik=[mq.onBeforeDataOut,mq.onMetadataCalled,mq.onBeforeMessageOut,mq.transformLogLevel,mq.shouldSendToLogger,mq.onContextCalled],g9=class{idToPlugin;transformLogLevel=[];onBeforeDataOut=[];shouldSendToLogger=[];onMetadataCalled=[];onBeforeMessageOut=[];onContextCalled=[];constructor(q){this.idToPlugin={},this.mapPlugins(q),this.indexPlugins()}mapPlugins(q){for(let $ of q){if(!$.id)$.id=Date.now().toString()+Math.random().toString();if(this.idToPlugin[$.id])throw Error(`[LogLayer] Plugin with id ${$.id} already exists.`);$.registeredAt=Date.now(),this.idToPlugin[$.id]=$}}indexPlugins(){this.transformLogLevel=[],this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];let q=Object.values(this.idToPlugin).sort(($,K)=>$.registeredAt-K.registeredAt);for(let $ of q){if($.disabled)return;for(let K of ik)if($[K]&&$.id)this[K].push($.id)}}hasPlugins(q){return this[q].length>0}countPlugins(q){if(q)return this[q].length;return Object.keys(this.idToPlugin).length}addPlugins(q){this.mapPlugins(q),this.indexPlugins()}enablePlugin(q){let $=this.idToPlugin[q];if($)$.disabled=!1;this.indexPlugins()}disablePlugin(q){let $=this.idToPlugin[q];if($)$.disabled=!0;this.indexPlugins()}removePlugin(q){delete this.idToPlugin[q],this.indexPlugins()}runTransformLogLevel(q,$){let K=null;for(let P of this.transformLogLevel){let _=this.idToPlugin[P];if(_.transformLogLevel){let j=_.transformLogLevel({data:q.data,logLevel:q.logLevel,messages:q.messages,error:q.error,metadata:q.metadata,context:q.context},$);if(j!==null&&j!==void 0&&j!==!1)K=j}}return K!==null&&K!==void 0&&K!==!1?K:q.logLevel}runOnBeforeDataOut(q,$){let K={...q};for(let P of this.onBeforeDataOut){let _=this.idToPlugin[P];if(_.onBeforeDataOut){let j=_.onBeforeDataOut({data:K.data,logLevel:K.logLevel,error:K.error,metadata:K.metadata,context:K.context},$);if(j){if(!K.data)K.data={};Object.assign(K.data,j)}}}return K.data}runShouldSendToLogger(q,$){return!this.shouldSendToLogger.some((K)=>{return!this.idToPlugin[K].shouldSendToLogger?.(q,$)})}runOnMetadataCalled(q,$){let K={...q};for(let P of this.onMetadataCalled){let _=this.idToPlugin[P].onMetadataCalled?.(K,$);if(_)K=_;else return null}return K}runOnBeforeMessageOut(q,$){let K=[...q.messages];for(let P of this.onBeforeMessageOut){let _=this.idToPlugin[P].onBeforeMessageOut?.({messages:K,logLevel:q.logLevel},$);if(_)K=_}return K}runOnContextCalled(q,$){let K={...q};for(let P of this.onContextCalled){let _=this.idToPlugin[P].onContextCalled?.(K,$);if(_)K=_;else return null}return K}},c9=class q{pluginManager;idToTransport;hasMultipleTransports;singleTransport;contextManager;logLevelManager;_config;constructor($){if(this._config={...$,enabled:$.enabled??!0},this.contextManager=new D9,this.logLevelManager=new d9,!this._config.enabled)this.disableLogging();if(this.pluginManager=new g9([...$.plugins||[],...YK.pluginsToInit]),!this._config.errorFieldName)this._config.errorFieldName="err";if(!this._config.copyMsgOnOnlyError)this._config.copyMsgOnOnlyError=!1;if(this._initializeTransports(this._config.transport),YK.logLayerHandlers.length>0)YK.logLayerHandlers.forEach((K)=>{if(K.onConstruct)K.onConstruct(this,$)})}withContextManager($){if(this.contextManager&&typeof this.contextManager[Symbol.dispose]==="function")this.contextManager[Symbol.dispose]();return this.contextManager=$,this}getContextManager(){return this.contextManager}withLogLevelManager($){if(this.logLevelManager&&typeof this.logLevelManager[Symbol.dispose]==="function")this.logLevelManager[Symbol.dispose]();return this.logLevelManager=$,this}getLogLevelManager(){return this.logLevelManager}getConfig(){return this._config}_initializeTransports($){if(this.idToTransport){for(let K in this.idToTransport)if(this.idToTransport[K]&&typeof this.idToTransport[K][Symbol.dispose]==="function")this.idToTransport[K][Symbol.dispose]()}if(this.hasMultipleTransports=Array.isArray($)&&$.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray($)?$[0]:$,Array.isArray($))this.idToTransport=$.reduce((K,P)=>{return K[P.id]=P,K},{});else this.idToTransport={[$.id]:$}}withPrefix($){let K=this.child();return K._config.prefix=$,K}withContext($){let K=$;if(!$){if(this._config.consoleDebug)console.debug("[LogLayer] withContext was called with no context; dropping.");return this}if(this.pluginManager.hasPlugins(mq.onContextCalled)){if(K=this.pluginManager.runOnContextCalled($,this),!K){if(this._config.consoleDebug)console.debug("[LogLayer] Context was dropped due to plugin returning falsy value.");return this}}return this.contextManager.appendContext(K),this}clearContext($){return this.contextManager.clearContext($),this}getContext(){return this.contextManager.getContext()}addPlugins($){this.pluginManager.addPlugins($)}enablePlugin($){this.pluginManager.enablePlugin($)}disablePlugin($){this.pluginManager.disablePlugin($)}removePlugin($){this.pluginManager.removePlugin($)}withMetadata($){return new n9(this).withMetadata($)}withError($){return new n9(this).withError($)}child(){let $=new q({...this._config,transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport}).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone()).withLogLevelManager(this.logLevelManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:$.contextManager,parentLogger:this,childLogger:$}),this.logLevelManager.onChildLoggerCreated({parentLogLevelManager:this.logLevelManager,childLogLevelManager:$.logLevelManager,parentLogger:this,childLogger:$}),$}withFreshTransports($){return this._config.transport=$,this._initializeTransports($),this}addTransport($){let K=Array.isArray($)?$:[$],P=Array.isArray(this._config.transport)?this._config.transport:[this._config.transport],_=new Set(K.map((Y)=>Y.id));for(let Y of K){let w=this.idToTransport[Y.id];if(w&&typeof w[Symbol.dispose]==="function")w[Symbol.dispose]()}let j=[...P.filter((Y)=>!_.has(Y.id)),...K];this._config.transport=j;for(let Y of K)this.idToTransport[Y.id]=Y;return this.hasMultipleTransports=j.length>1,this.singleTransport=this.hasMultipleTransports?null:j[0],this}removeTransport($){let K=this.idToTransport[$];if(!K)return!1;if(typeof K[Symbol.dispose]==="function")K[Symbol.dispose]();delete this.idToTransport[$];let P=(Array.isArray(this._config.transport)?this._config.transport:[this._config.transport]).filter((_)=>_.id!==$);return this._config.transport=P.length===1?P[0]:P,this.hasMultipleTransports=P.length>1,this.singleTransport=this.hasMultipleTransports?null:P[0]||null,!0}withFreshPlugins($){return this._config.plugins=$,this.pluginManager=new g9($),this}withPluginManager($){return this.pluginManager=$,this}errorOnly($,K){let P=K?.logLevel||i.error;if(!this.isLevelEnabled(P))return;let{copyMsgOnOnlyError:_}=this._config,j={logLevel:P,err:$};if((_&&K?.copyMsg!==!1||K?.copyMsg===!0)&&$?.message)j.params=[$.message];this._formatLog(j)}metadataOnly($,K=i.info){if(!this.isLevelEnabled(K))return;let{muteMetadata:P,consoleDebug:_}=this._config;if(P)return;if(!$){if(_)console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let j=$;if(this.pluginManager.hasPlugins(mq.onMetadataCalled)){if(j=this.pluginManager.runOnMetadataCalled($,this),!j){if(_)console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}}let Y={logLevel:K,metadata:j};this._formatLog(Y)}info(...$){if(!this.isLevelEnabled(i.info))return;this._formatMessage($),this._formatLog({logLevel:i.info,params:$})}warn(...$){if(!this.isLevelEnabled(i.warn))return;this._formatMessage($),this._formatLog({logLevel:i.warn,params:$})}error(...$){if(!this.isLevelEnabled(i.error))return;this._formatMessage($),this._formatLog({logLevel:i.error,params:$})}debug(...$){if(!this.isLevelEnabled(i.debug))return;this._formatMessage($),this._formatLog({logLevel:i.debug,params:$})}trace(...$){if(!this.isLevelEnabled(i.trace))return;this._formatMessage($),this._formatLog({logLevel:i.trace,params:$})}fatal(...$){if(!this.isLevelEnabled(i.fatal))return;this._formatMessage($),this._formatLog({logLevel:i.fatal,params:$})}raw($){if(!this.isLevelEnabled($.logLevel))return;let K={logLevel:$.logLevel,params:$.messages,metadata:$.metadata,err:$.error,context:$.context};this._formatMessage($.messages),this._formatLog(K)}disableLogging(){return this.logLevelManager.disableLogging(),this}enableLogging(){return this.logLevelManager.enableLogging(),this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel($){return this.logLevelManager.enableIndividualLevel($),this}disableIndividualLevel($){return this.logLevelManager.disableIndividualLevel($),this}setLevel($){return this.logLevelManager.setLevel($),this}isLevelEnabled($){return this.logLevelManager.isLevelEnabled($)}formatContext($){let{contextFieldName:K,muteContext:P}=this._config;if($&&Object.keys($).length>0&&!P){if(K)return{[K]:{...$}};return{...$}}return{}}formatMetadata($=null){let{metadataFieldName:K,muteMetadata:P}=this._config;if($&&!P){if(K)return{[K]:{...$}};return{...$}}return{}}getLoggerInstance($){let K=this.idToTransport[$];if(!K)return;return K.getLoggerInstance()}_formatMessage($=[]){let{prefix:K}=this._config;if(K&&typeof $[0]==="string")$[0]=`${K} ${$[0]}`}_formatLog({logLevel:$,params:K=[],metadata:P=null,err:_,context:j=null}){let{errorSerializer:Y,errorFieldInMetadata:w,muteContext:O,contextFieldName:v,metadataFieldName:z,errorFieldName:W}=this._config,T=j!==null?j:this.contextManager.getContext(),H=!!P||(O?!1:j!==null?Object.keys(j).length>0:this.contextManager.hasContextData()),J={};if(H)if(v&&v===z){let Z=this.formatContext(T)[v],X=this.formatMetadata(P)[z];J={[v]:{...Z,...X}}}else J={...this.formatContext(T),...this.formatMetadata(P)};if(_){let Z=Y?Y(_):_;if(w&&P&&z)if(J?.[z])J[z][W]=Z;else J={...J,[z]:{[W]:Z}};else if(w&&!P&&z)J={...J,[z]:{[W]:Z}};else J={...J,[W]:Z};H=!0}if(this.pluginManager.hasPlugins(mq.onBeforeDataOut)){if(J=this.pluginManager.runOnBeforeDataOut({data:H?J:void 0,logLevel:$,error:_,metadata:P,context:T},this),J&&!H)H=!0}if(this.pluginManager.hasPlugins(mq.onBeforeMessageOut))K=this.pluginManager.runOnBeforeMessageOut({messages:[...K],logLevel:$},this);if(this.pluginManager.hasPlugins(mq.transformLogLevel))$=this.pluginManager.runTransformLogLevel({data:H?J:void 0,logLevel:$,messages:[...K],error:_,metadata:P,context:T},this);if(this.hasMultipleTransports){let Z=this._config.transport.filter((X)=>X.enabled).map(async(X)=>{let G=$;if(this.pluginManager.hasPlugins(mq.shouldSendToLogger)){if(!this.pluginManager.runShouldSendToLogger({messages:[...K],data:H?J:void 0,logLevel:G,transportId:X.id,error:_,metadata:P,context:T},this))return}return X._sendToLogger({logLevel:G,messages:[...K],data:H?J:void 0,hasData:H,error:_,metadata:P,context:T})});Promise.all(Z).catch((X)=>{if(this._config.consoleDebug)console.error("[LogLayer] Error executing transports:",X)})}else{if(!this.singleTransport?.enabled)return;if(this.pluginManager.hasPlugins(mq.shouldSendToLogger)){if(!this.pluginManager.runShouldSendToLogger({messages:[...K],data:H?J:void 0,logLevel:$,transportId:this.singleTransport.id,error:_,metadata:P,context:T},this))return}this.singleTransport._sendToLogger({logLevel:$,messages:[...K],data:H?J:void 0,hasData:H,error:_,metadata:P,context:T})}}},x9=class{debug(...q){}error(...q){}info(...q){}trace(...q){}warn(...q){}fatal(...q){}enableLogging(){return this}disableLogging(){return this}withMetadata(q){return this}withError(q){return this}},DL=class{mockLogBuilder=new x9;mockContextManager=new y9;mockLogLevelManager=new L9;info(...q){}warn(...q){}error(...q){}debug(...q){}trace(...q){}fatal(...q){}raw(q){}getLoggerInstance(q){}errorOnly(q,$){}metadataOnly(q,$){}addPlugins(q){}removePlugin(q){}enablePlugin(q){}disablePlugin(q){}withPrefix(q){return this}withContext(q){return this}withError(q){return this.mockLogBuilder.withError(q)}withMetadata(q){return this.mockLogBuilder.withMetadata(q)}getContext(){return{}}clearContext(q){return this}enableLogging(){return this}disableLogging(){return this}child(){return this}muteContext(){return this}unMuteContext(){return this}muteMetadata(){return this}unMuteMetadata(){return this}withFreshTransports(q){return this}addTransport(q){return this}removeTransport(q){return!0}withFreshPlugins(q){return this}withContextManager(q){return this}getContextManager(){return this.mockContextManager}withLogLevelManager(q){return this}getLogLevelManager(){return this.mockLogLevelManager}getConfig(){return{}}setMockLogBuilder(q){this.mockLogBuilder=q}enableIndividualLevel(q){return this}disableIndividualLevel(q){return this}setLevel(q){return this}isLevelEnabled(q){return!0}getMockLogBuilder(){return this.mockLogBuilder}resetMockLogBuilder(){this.mockLogBuilder=new x9}};var YK={logLayerHandlers:[],pluginsToInit:[],logBuilderHandlers:[]};var n9=class{err;metadata;structuredLogger;hasMetadata;pluginManager;constructor(q){if(this.err=null,this.metadata={},this.structuredLogger=q,this.hasMetadata=!1,this.pluginManager=q.pluginManager,YK.logBuilderHandlers.length>0)YK.logBuilderHandlers.forEach(($)=>{if($.onConstruct)$.onConstruct(this,q)})}withMetadata(q){let{pluginManager:$,structuredLogger:{_config:{consoleDebug:K}}}=this;if(!q){if(K)console.debug("[LogLayer] withMetadata was called with no metadata; dropping.");return this}let P=q;if($.hasPlugins(mq.onMetadataCalled)){if(P=$.runOnMetadataCalled(q,this.structuredLogger),!P){if(K)console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return this}}return this.metadata={...this.metadata,...P},this.hasMetadata=!0,this}withError(q){return this.err=q,this}info(...q){if(!this.structuredLogger.isLevelEnabled(i.info))return;this.structuredLogger._formatMessage(q),this.formatLog(i.info,q)}warn(...q){if(!this.structuredLogger.isLevelEnabled(i.warn))return;this.structuredLogger._formatMessage(q),this.formatLog(i.warn,q)}error(...q){if(!this.structuredLogger.isLevelEnabled(i.error))return;this.structuredLogger._formatMessage(q),this.formatLog(i.error,q)}debug(...q){if(!this.structuredLogger.isLevelEnabled(i.debug))return;this.structuredLogger._formatMessage(q),this.formatLog(i.debug,q)}trace(...q){if(!this.structuredLogger.isLevelEnabled(i.trace))return;this.structuredLogger._formatMessage(q),this.formatLog(i.trace,q)}fatal(...q){if(!this.structuredLogger.isLevelEnabled(i.fatal))return;this.structuredLogger._formatMessage(q),this.formatLog(i.fatal,q)}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(q,$){let{muteMetadata:K}=this.structuredLogger._config,P=K?!1:this.hasMetadata;this.structuredLogger._formatLog({logLevel:q,params:$,metadata:P?this.metadata:null,err:this.err})}};function l9(){return new c9({transport:{debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}}})}function Tq(q){return q??l9()}import{RegistryManager as uf}from"@kumori/kdsl-lsp/module/registry/manager.js";import{DeploymentArtifact as Xf,isIdentifierExpression as ff,isDeploymentArtifact as Af,isStringLiteralExpression as Gf}from"@kumori/kdsl-lsp/language/generated/ast.js";import{createKumoriServices as gx}from"@kumori/kdsl-lsp/language/kumori.js";import{URI as hf,UriUtils as Vf}from"langium";import{NodeFileSystem as lx}from"langium/node";import{Result as v$,Err as w$,Ok as Mf}from"@kumori/kdsl-lsp/util/result.js";import{Deployment as yX}from"@kumori/kdsl-lsp/language/builtin/lib/kumori/deployment.js";import{toJSON as dX}from"@kumori/kdsl-lsp/language/type-system/toJSON.js";import{Result as Y5,Err as m7,Ok as w5}from"@kumori/kdsl-lsp/util/result.js";import{AstUtils as j5}from"langium";import{ToUnits as GX}from"@kumori/kdsl-lsp/util/sized.js";import{EphemeralName as tk,Ephemeral as Bk,PersistentName as ek,Persistent as Uk,RegisteredName as Fk,Registered as sk,VolatileName as Qk,Volatile as qX,PersistedName as $X,Persisted as KX,NonReplicatedName as PX,NonReplicated as _X,CAName as jX,CA as YX,CertificateName as wX,SecretName as vX,Secret as OX,DomainName as zX,PortName as WX,Port as TX,Domain as HX,Certificate as JX}from"@kumori/kdsl-lsp/language/builtin/lib/kumori/resource.js";function V6(q){if(q.$type===tk){let $=Bk.parse(q);return{volume:{size:$.value.size,unit:$.value.unit,kind:"storage"}}}if(q.$type===ek)return{volume:Uk.parse(q).value};if(q.$type===Fk)return{volume:sk.parse(q).value};if(q.$type===Qk){let $=qX.parse(q);return{volume:{size:$.value.size,unit:$.value.unit,kind:"storage",type:"volatile"}}}if(q.$type===$X){let $=KX.parse(q);return{volume:{size:$.value.size,unit:$.value.unit,kind:"storage",type:"persistent"}}}if(q.$type===PX){let $=_X.parse(q);return{volume:{size:$.value.size,unit:$.value.unit,kind:"storage",type:"nonreplicated"}}}if(q.$type===jX)return{ca:YX.parse(q).value};if(q.$type===wX)return{certificate:JX.parse(q).value};if(q.$type===vX)return{secret:OX.parse(q).value};if(q.$type===zX)return{domain:HX.parse(q).value};if(q.$type===WX)return{port:TX.parse(q).value};throw Error(`unknown resource type '${q.$type}'`)}import{ParseOCIString as ZX}from"@kumori/kdsl-lsp/util/oci.js";import{Result as wK}from"@kumori/kdsl-lsp/util/result.js";import{AstUtils as kX}from"langium";import{basename as XX}from"path";function a9(q){if(typeof q==="string")return wK.orElse(wK.map(ZX(q),($)=>({tag:$.tag,hub:{name:$.hub,secret:typeof q==="string"?"":q.hub?.secret??""}})),($)=>{throw Error($)});else return q}function h8(q,$){if(!$)return[];let K=kX.getDocument($).uri,P=q.getModule(K);if(wK.isErr(P))return[];let _=wK.tryCatch(()=>new URL(`file://${P.value.Manifest.module}`));if(wK.isErr(_))return[];let j=[];if(_.value.hostname.length)j.push((w)=>w.domain=_.value.hostname);if(_.value.pathname.length)j.push((w)=>{w.module=_.value.pathname.replace(/^\//,""),w.name=XX(w.module)});let Y=P.value.Manifest.version;if(Y){let w=Y.split(".").map(Number);if(w.length>=3&&w.every((O)=>!isNaN(O)))j.push((O)=>O.version=[w[0],w[1],w[2]])}return j}function r9(q){let $="";if(q.domain!==""){if($+=`${q.domain}`,q.module!=="")$+=`/${q.module}`}else if(q.module!=="")$+=q.module;return $}function vK(q){return Array.isArray(q)?q:[q]}function o9(q){if(q===null||q===void 0)return;if(typeof q==="string"){let $=q.trim();if($.length===0)return;try{return JSON.parse($)}catch{return{}}}if(typeof q==="object"){if(Array.isArray(q))return q.length>0?q:void 0;return Object.keys(q).length>0?q:void 0}return q}function IP(q){return!!q&&typeof q==="object"&&!Array.isArray(q)}function i9(q,$){if(!IP(q)||!IP($))return $;let K={...q};for(let[P,_]of Object.entries($))K[P]=P in K?i9(K[P],_):_;return K}function EP(q,$){let K=o9(q),P=o9($);if(K&&P&&IP(K)&&IP(P))return i9(K,P);return P??K??{}}import{isComponentArtifact as hX}from"@kumori/kdsl-lsp/language/generated/ast.js";import{LoadBalancerName as fX,FullConnectorName as AX}from"@kumori/kdsl-lsp/language/builtin/lib/kumori/service.js";function C7(q,$,K,P){let _=q.svcs.shared.references.KumoriModules,j=h8(_,q.nodes.get($));for(let Y of j)Y(K);if(P)K.kind="service";return K}function t9(q,$){return q.some((K)=>JSON.stringify(K)===JSON.stringify($))}function B9(q,$){return{role:q,channel:$}}function N7(q,$,K){return{meta:q,links:[{role:$,channel:K}]}}function e9(q,$,K){let P={version:[0,0,0],kind:"component",domain:"unknown",module:"unknown",name:"unknown"};if(K.$type===fX){K=K;let _=[],j=[];if("from"in K.value&&"to"in K.value){let Y=vK(K.value.from),w=vK(K.value.to);for(let O of Y){j.push(B9(O.target,O.channel));for(let v of w){let z=v.meta??{},W=$.role[v.target=="self"?O.target:v.target],T=s6(W.artifact)||v.target=="self";C7(q,W,P,T);let H=EP(K.value.meta,z),J=[{auto:{channel:v.target!=="self"?v.target+"."+v.channel:v.channel,compRef:P,roleName:v.target=="self"?O.target:v.target},user:H}],Z=N7(J,v.target,v.channel);if(!t9(_,Z))_.push(Z)}}}return{kind:"lb",clients:j,servers:_}}if(K.$type===AX){K=K;let _=[],j=[];if("from"in K.value&&"to"in K.value){let Y=vK(K.value.from),w=vK(K.value.to);for(let O of Y){j.push(B9(O.target,O.channel));for(let v of w){let z=$.role[v.target=="self"?O.target:v.target],W=s6(z.artifact);C7(q,z,P,W);let T=EP(K.value.meta,v.meta),H=[{auto:{channel:v.target!=="self"?v.target+"."+v.channel:v.channel,compRef:P,roleName:v.target=="self"?O.target:v.target},user:T}],J=N7(H,v.target,v.channel);if(!t9(_,J))_.push(J)}}}else if("target"in K.value&&"channel"in K.value){let Y=$.role[K.value.target],w=s6(Y.artifact);C7(q,Y,P,w);let O=EP(K.value.meta,void 0),v=[{auto:{channel:K.value.channel,compRef:P,roleName:K.value.target},user:O}];_.push(N7(v,K.value.target,K.value.channel))}return{kind:"full",clients:j,servers:_}}throw Error(`unknown connection type '${K.$type}'`)}function S7(q,$,K,P){return{kind:"lb",clients:[{role:P==="server"?"self":K,channel:$}],servers:[{meta:[{auto:{channel:$,compRef:q,roleName:P==="client"?"self":K},user:{}}],links:[{role:P==="client"?"self":K,channel:$}]}]}}function F9(q,$,K){let P={version:[0,0,0],kind:"service",domain:"unknown",module:"unknown",name:"unknown"},_=q.svcs.shared.references.KumoriModules,j=h8(_,q.nodes.get($));for(let v of j)v(P);let Y=q.nodes.get($),w="";if(Y&&hX(Y))w=Y.name.value.$refText;if(w==="")throw Error("Unable to determine component name for service artifact conversion.");let O=b7(q,$,K);return{spec:[1,0],ref:P,description:{builtin:!1,connector:Object.fromEntries([...Object.entries($.srv?.server??{}).map(([v])=>[`self_${v}_to_${v}`,S7(O.ref,v,w,"server")]),...Object.entries($.srv?.client??{}).map(([v])=>[`c-${v}`,S7(P,v,w,"client")])]),config:{resilience:0,scale:{},parameter:{},resource:{}},role:{[w]:{name:w,meta:{},artifact:O}},srv:{client:Object.fromEntries(Object.entries($.srv?.client??{}).map(([v,z])=>[v,{protocol:z,inherited:!1}])),server:Object.fromEntries(Object.entries($.srv?.server??{}).map(([v,z])=>{let W;if(typeof z==="string")W={port:80,inherited:!1,protocol:z};else W={...z,inherited:!1};return[v,W]})),duplex:Object.fromEntries(Object.entries($.srv?.duplex??{}).map(([v,z])=>{let W;if(typeof z==="string")W={port:80,inherited:!1,protocol:z};else W={...z,inherited:!1};return[v,W]}))}}}}function b7(q,$,K){let P={version:[0,0,0],kind:"component",domain:"unknown",module:"unknown",name:"unknown"},_=q.svcs.shared.references.KumoriModules,j=h8(_,q.nodes.get($));for(let z of j)z(P);function Y(z,W=!1){return Object.fromEntries(Object.entries(z??{}).map(([T,H])=>{return[T,{name:T,init:W,entrypoint:H.entrypoint,user:H.user,image:a9(H.image),cmd:H.cmd,size:{memory:{...H.size.memory,kind:"ram"},cpu:{...H.size.cpu,kind:"cpu"},mincpu:H.size.mincpu?H.size.mincpu.size:H.size.cpu.size},mapping:{filesystem:Object.fromEntries(Object.entries(H.fs??{}).map(([Z,X])=>[Z,VX(Z,X)])),env:Object.fromEntries(Object.entries(H.env??{}).map(([Z,X])=>{let G=Z,f=(()=>{if(typeof X==="string"||typeof X==="number"||typeof X==="boolean")return{value:String(X)};return X})();return[G,f]}))}}]}))}let w=Object.fromEntries(($.init??[]).map((z,W)=>[`INIT_${W}`,z])),O=Y($.code),v=Y(w,!0);return{spec:[1,0],ref:P,description:{builtin:!1,config:{resilience:0,scale:{hsize:K?K:$.scale?$.scale:1},parameter:$.config,resource:Object.fromEntries(Object.entries($.resource??{}).map(([z,W])=>[z,V6(W)]))},size:{bandwidth:{...$.size.bandwidth,kind:"bandwidth"},minbandwidth:Math.ceil(GX($.size.minbandwidth??$.size.bandwidth,$.size.bandwidth.unit).size),mincpu:{...$.size.mincpu,kind:"cpu"}},profile:{threadability:"*",iopsintensive:!1},srv:{client:Object.fromEntries(Object.entries($.srv?.client??{}).map(([z,W])=>[z,{protocol:W,inherited:!1}])),server:Object.fromEntries(Object.entries($.srv?.server??{}).map(([z,W])=>{let T;if(typeof W==="string")T={port:80,portnum:1,inherited:!1,protocol:W};else T={...W,portnum:1,inherited:!1};return[z,T]})),duplex:Object.fromEntries(Object.entries($.srv?.duplex??{}).map(([z,W])=>{let T;if(typeof W==="string")T={port:80,portnum:1,inherited:!1,protocol:W};else T={...W,portnum:1,inherited:!1};return[z,T]}))},code:{...v,...O},probe:Object.fromEntries(Object.entries($.probe??{}).map(([z,W])=>{return[z,W]}))}}}function VX(q,$){if(typeof $==="string"){let K=U9(q,$);return{path:q,data:{value:K.value},format:K.format,rebootOnUpdate:!1}}if(typeof $==="object"){if("volume"in $)return{path:q,volume:$.volume};if("data"in $){let _=U9(q,$.data,$.format);return{path:q,data:{value:_.value},format:_.format,mode:$.mode??420,rebootOnUpdate:$.rebootOnUpdate??!1}}let P=["secret","port","domain","certificate","ca"].find((_)=>(_ in $));if(P){let _=P;return{path:q,data:{[_]:$[_]},format:$.format??"text",mode:$.mode??420,rebootOnUpdate:$.rebootOnUpdate??!1}}}throw Error(`Unknown key '${q}': ${JSON.stringify($)}`)}function U9(q,$,K){if(K)return{value:CX($,K),format:K};let P=MX(q,$);if(P)return P;return{value:$,format:"text"}}function MX(q,$){if(typeof $!=="string"||!q.toLowerCase().endsWith(".json"))return;let K=$.trim();if(!(K.startsWith("{")||K.startsWith("[")))return;try{return{value:JSON.parse($),format:"json"}}catch{return}}function CX(q,$){if($!=="json"||typeof q!=="string")return q;try{return JSON.parse(q)}catch{return q}}import{Maybe as SX,None as bX,Some as uX}from"@kumori/kdsl-lsp/util/maybe.js";import{SemVer as NX}from"@kumori/kdsl-lsp/util/semver.js";function u7(q){let $=NX(q.id.version);return{spec:[1,0],ref:{version:[$.major,$.minor,$.patch],kind:q.id.kind,domain:q.id.domain,module:q.id.module,name:q.id.name},description:{builtin:!0,srv:{client:Object.fromEntries(Object.entries(q.srv.client??{}).map(([K])=>[K,{protocol:"http",inherited:!1}])),server:Object.fromEntries(Object.entries(q.srv.server??{}).map(([K,P])=>{let _;if(typeof P==="string")_={port:80,portnum:1,inherited:!1,protocol:P};else _={...P,inherited:!1};return[K,_]})),duplex:{}},config:{resilience:0,scale:{},parameter:q.config??{},resource:Object.fromEntries(Object.entries(q.resource).map(([K,P])=>[K,V6(P)]))},connector:{},role:{}}}}function s9(q,$){return{name:V8(q),up:_$(q),meta:{},config:{resilience:0,scale:{},parameter:$.config??{},resource:Object.fromEntries(Object.entries($.resource??{}).map(([K,P])=>[K,V6(P)]))},artifact:u7($)}}function RX(q,$){if(typeof q==="number")return q;if(q&&typeof q==="object"&&$ in q){let K=q[$];return typeof K==="number"?K:void 0}return}function mX(q){let $=q.scale;if(typeof $==="number")return $;if($&&typeof $==="object"&&!Array.isArray($)&&"hsize"in $&&typeof $.hsize==="number")return $.hsize;return}function IX(q,$){return Object.fromEntries(Object.entries(q.role??{}).map(([K,P])=>{if("id"in P.artifact)return[K,{hsize:1}];let _=RX($,K);if(typeof _==="number")return[K,{hsize:_}];let j=mX(P);if(typeof j==="number")return[K,{hsize:j}];return[K,{hsize:1}]}))}function Q9(q,$){if(typeof $==="number")return Object.fromEntries(Object.keys(q.role??{}).map((K)=>[K,$]));if($&&typeof $==="object"&&!Array.isArray($)){let K=new Set(Object.keys(q.role??{})),P=Object.fromEntries(Object.entries($).filter(([_,j])=>K.has(_)&&typeof j==="number").map(([_,j])=>[_,j]));return Object.keys(P).length>0?P:void 0}return}function q5(q,$){return{detail:IX(q,$)}}function R7(q,$,K){let P={version:[0,0,0],kind:"service",domain:"unknown",module:"unknown",name:"unknown"},_=q.svcs.shared.references.KumoriModules,j=h8(_,q.nodes.get($));for(let w of j)w(P);let Y={spec:[1,0],ref:P,description:{builtin:!1,config:{resilience:0,scale:q5($,K),parameter:$?.config??{},resource:Object.fromEntries(Object.entries($.resource??{}).map(([w,O])=>[w,V6(O)]))},role:{},connector:Object.fromEntries(Object.entries($.connect??{}).map(([w,O])=>[w,e9(q,$,O)])),srv:{client:Object.fromEntries(Object.entries($.srv?.client??{}).map(([w,O])=>[w,{protocol:O,inherited:!1}])),server:Object.fromEntries(Object.entries($.srv?.server??{}).map(([w,O])=>{let v;if(typeof O==="string")v={port:80,inherited:!1,protocol:O};else v={...O,inherited:!1};return[w,v]})),duplex:Object.fromEntries(Object.entries($.srv?.duplex??{}).map(([w,O])=>{let v;if(typeof O==="string")v={port:80,inherited:!1,protocol:O};else v={...O,inherited:!1};return[w,v]}))}}};return Y.description.role=Object.fromEntries(Object.entries($.role??{}).map(([w,O])=>[w,pX(q,w,O,Y)]).filter(([,w])=>SX.isSome(w)).map(([w,O])=>[w,O.value])),Y}function EX(q,$,K){let P=K!==void 0?K:Q9($,$.config?.scale);return{name:V8(q),up:_$(q),meta:{},config:{resilience:0,scale:q5($,P),parameter:$.config?.parameter??{},resource:Object.fromEntries(Object.entries($.config?.resource??{}).map(([_,j])=>[_,V6(j)]))},artifact:R7(q,$,P)}}function pX(q,$,K,P){if(M8(K.artifact)){let Y=P.description.config?.scale?.detail?P.description.config.scale.detail[$]?.hsize:1;return uX({name:$,meta:K.meta,config:{resilience:0,scale:{hsize:Y},parameter:K.artifact.config??{},resource:{}},artifact:b7(q,K.artifact,Y)})}let _=K.artifact;q=$5(q,$),K5(q,(()=>{if(s6(_)){let Y=Q9(_,K.scale);return EX(q,_,Y)}else return s9(q,_)})()),P.description.srv??={},P.description.srv.server??={},P.description.srv.client??={};for(let[,Y]of Object.entries(P.description.connector??{})){for(let w of Y.clients){if(w.role!==$)continue;let O={...w},v=`${w.role}.${w.channel}`,z=(_?.srv?.client??{})[w.channel];P.description.srv.server[v]={inherited:!0,protocol:w.channel=="inbound"?"http":z},w.role="self",w.channel=v,q.root.links??=[],q.root.links.push({meta:{},s_d:V8(q),s_c:O.channel,t_d:_$(q),t_c:v})}for(let w of Y.servers)for(let O of w.links)if(O.role===$){let v=`${O.role}.${O.channel}`,z=(_?.srv?.server??{})[O.channel];if(z===void 0)z=(_?.srv?.duplex??{})[O.channel];P.description.srv.client[v]={inherited:!0,protocol:typeof z==="string"?z:z.protocol,port:typeof z==="object"?z.port:void 0},q.root.links??=[],q.root.links.push({meta:{},s_d:_$(q),s_c:v,t_d:V8(q),t_c:O.channel}),O.role="self",O.channel=v}}return bX}import{isComponentArtifact as DX}from"@kumori/kdsl-lsp/language/generated/ast.js";var V8=(q)=>q.path.join("."),_$=(q)=>q.path.slice(0,-1).join("."),$5=(q,$)=>({...q,path:[...q.path,$]}),K5=(q,$)=>q.root.deployments[V8(q)]=$;function P5(q,$,K){let P={cspec:"1.0",top:K.name,deployments:{},links:[]},_={svcs:q,path:[K.name],root:P,nodes:$};return P.deployments[K.name]={name:K.name,meta:K.meta,config:{parameter:K.config??{},resource:Object.fromEntries(Object.entries(K.resource??{}).map(([j,Y])=>[j,V6(Y)])),resilience:K.resilience??0,scale:{detail:(()=>{if(M8(K.artifact)){if(typeof K.scale!=="number")return{};let j=_.nodes.get(K.artifact),Y="";if(j&&DX(j))Y=j.name.value.$refText;if(Y==="")throw Error("Unable to determine component name for scale detail.");return{[Y]:{hsize:K.scale}}}if(s6(K.artifact)){if(!K.scale||typeof K.scale!=="object"||Array.isArray(K.scale))return{};let j=K.scale,Y=Object.entries(K.artifact.role??{});return Object.fromEntries(Y.map(([w])=>{if(!(w in j))return null;let O=j[w];if(typeof O!=="number")return null;return[w,{hsize:O}]}).filter((w)=>Boolean(w)))}return{}})()}},artifact:(()=>{if(M8(K.artifact))return F9(_,K.artifact,K.scale);if(s6(K.artifact))return R7(_,K.artifact,K.scale);if(_5(K.artifact))return u7(K.artifact);throw Error("unknown artifact")})()},P}function M8(q){return"size"in q}function s6(q){return!(M8(q)||_5(q))}function _5(q){return"id"in q}function v5(q,$,K){let P=I7(q,$,K);if(Y5.isErr(P))return P;let{nodes:_,deployment:j}=P.value,Y=JSON.stringify(P5($,_,j),null,2);return w5(Y)}function I7(q,$,K){let P=$.validation.KumoriTypeSystem,[{Value:_},j]=P.Eval($.validation.KumoriValidations.ctx(),K);if(j.length!==0){let v=[];for(let z of j){let W=z.node,T=j5.getDocument(W),H=W.$cstNode?.range.start||{line:0,character:0},J=`${T.uri.fsPath}:${H.line}:${H.character}: type error: ${z.message}`;q.error(J),v.push(J)}return m7(v)}let Y=new Map,w=dX({svcs:$,nodes:Y},_);if(Y5.isErr(w)){let v=[];for(let z of w.err){let W=z.node,T=j5.getDocument(W),H=W.$cstNode?.range.start||{line:0,character:0},J=`${T.uri.fsPath}:${H.line}:${H.character}: json conversion error: ${z.message}`;q.error(J),v.push(J)}return m7(v)}let O=yX.safeParse(w.value);if(!O.success){let v=[];for(let z of O.error.issues){let W=`${z.code}: ${z.path}: invalid deployment: ${z.message}`;q.error(W),v.push(W)}return m7(v)}return w5({nodes:Y,deployment:w.value})}Y$();import{ModuleContext as D5}from"@kumori/kdsl-lsp/module/context.js";import{ListDependencies as Cf}from"@kumori/kdsl-lsp/module/dependency/list.js";import q8 from"assert";import{LocateDependency as Nf}from"@kumori/kdsl-lsp/module/dependency/locate.js";import{Maybe as Sf}from"@kumori/kdsl-lsp/util/maybe.js";import{DependencyId as bf}from"@kumori/kdsl-lsp/module/dependency/id.js";import g7 from"node:path";import{RegistryManager as $n}from"@kumori/kdsl-lsp/module/registry/manager.js";var _n=`
|
|
229
|
+
Generates a solution.json file for a specified Kumori package containing deployment definitions.
|
|
230
|
+
The command requires the path to the package as an argument, and optionally accepts a directory
|
|
231
|
+
path where the Kumori module is located. If the directory is not provided, the current working
|
|
232
|
+
directory is used by default.
|
|
233
|
+
|
|
234
|
+
Some usage examples:
|
|
235
|
+
kdsl build
|
|
236
|
+
kdsl build my-package
|
|
237
|
+
kdsl build my-package path/to/module
|
|
238
|
+
|
|
239
|
+
The generated solution.json file will be created in the package directory, containing all necessary
|
|
240
|
+
information for deploying the resources defined in the package's deployment artifacts.
|
|
241
|
+
`.trim();function p5(q){if(q.value)return q.value;let $=q.$document;if($&&$.uri.path.endsWith(".h.kumori"))return;return q.type}async function y5(q,$,K,P,_){let j=$.shared.workspace.FileSystemProvider,Y=await D5(j,hf.file(g7.resolve(P)),_);if(v$.isErr(Y)){let d=`error: ${Y.err}`;return q.error(d),w$([d])}let w={FS:j,...Y.value},O=await d5(w);if(O.size>0){let d=["error: missing modules"];q.error(d[0]);for(let Vq of O){let Rq=`+ ${Vq}`;q.error(Rq),d.push(Rq)}let Q="unable to build solution.json";return q.error(Q),d.push(Q),w$(d)}let v=await C6(q,$,Y.value);if(v$.isErr(v))return q.error(`failed to check modules ${v.err.join(`
|
|
242
|
+
`)}`),v;let z=Vf.joinPath(Y.value.Current.Root,K),W=$.references.KumoriPackages.GetPackage(z);if(v$.isErr(W)){let d=`error: failed to retrieve package: ${z.toString()}`;return q.error(d),w$([d])}let T=new Set(W.value.docs.map((d)=>d.uri.toString())),H=$.shared.workspace.IndexManager.allElements(Xf.$type,T).toArray();if(H.length<1){let d=`error: no deployment defined in ${z.toString()}`;return q.error(d),w$([d])}if(H.length>1){let d=`error: too many deployments in ${z.toString()}`;return q.error(d),w$([d])}let J=H[0],Z=J.node;if(!Af(Z)){let d=`error: invalid target doc=${J.documentUri} location=${J.path}`;return q.error(d),w$([d])}let X=v5(q,$,Z);if(v$.isErr(X))return X;let G=I7(q,$,Z);if(v$.isErr(G))return G;let{deployment:f}=G.value,N=g7.join(z.fsPath,"solution.json");await Bun.write(N,X.value),q.info(`solution.json written to ${N}`);let V=JSON.parse(X.value),C=Z.body.stmt.find((d)=>d.$type==="StructEntry"&&d.key==="name"),b=C&&C.$type==="StructEntry"?p5(C):void 0;q8(C&&C.$type==="StructEntry"&&b&&Gf(b));let k=V.deployments[b.value];if(M8(f.artifact)){let d=Object.entries(k.artifact.description.role);q8(d.length===1,"Component deployment should have exactly one role");let[Q,Vq]=d[0];k={...k,artifact:Vq.artifact,config:{...k.config,scale:k.config?.scale?.detail?.[Q]??{hsize:1}}}}if(k&&k.artifact)delete k.artifact.description,delete k.artifact.spec;let M=Z.body.stmt.find((d)=>d.$type==="StructEntry"&&d.key==="artifact");q8(M&&M.$type==="StructEntry");let A=p5(M);q8(A&&ff(A)),q8(A.value.ref);let u=k.artifact.ref,S=r9(u),L=Z.$container.imports.find((d)=>d.target.$refText.includes(S))?.target.$refText?.substring(S.length+1);if(k.artifact.ref.package=L?L:"",A.next)q8(A.next.$type==="IdentifierExpression"),k.artifact.ref.name=A.next.value.$refText;else k.artifact.ref.name=A.value.$refText;if(k.artifact.ref.domain==="kumori.systems"&&k.artifact.ref.module.startsWith("builtins/"))k.artifact.ref.domain="kumori",k.artifact.ref.module="builtin";let c=g7.join(z.fsPath,"deployment-config.json");return await Bun.write(Bun.file(c),JSON.stringify(k,null,2)),q.info(`deployment-config.json written to ${c}`),Mf(void 0)}async function d5(q,$=new Set){let K=Cf(q.Current);for(let[,P]of K.entriesGroupedByKey()){q8(P.length>0);let{target:_,version:j}=P[0],Y=await Nf(q,_,j);if(Sf.isNone(Y)){$.add(bf(_,j));continue}let w=await D5.Move(q,q.FS,Y.value.Root);q8(v$.isOk(w));let O={...q,...w.value};await d5(O,$)}return $}async function Rf(q){let $=Tq(q.logger),K=q.package??".",P=q.directory??q.cwd??".",_=q.services;return await new uf(q.configPath).ensureIndexes(),await y5($,_,K,P,q.configPath)}Y$();import{ModuleContext as mf}from"@kumori/kdsl-lsp/module/context.js";import{URI as If}from"langium";import{Result as Ef,Err as pf}from"@kumori/kdsl-lsp/util/result.js";import Df from"node:path";async function yf(q){let $=Tq(q.logger),K=q.directory??q.cwd??".",P=q.services,_=P.shared.workspace.FileSystemProvider,j=await mf(_,If.file(Df.resolve(K)),q.configPath);if(Ef.isErr(j))return pf([j.err]);return await C6($,P,j.value)}import{TempCache as df}from"@kumori/kdsl-lsp/util/tmp.js";import{rm as Lf}from"fs/promises";import{Ok as gf,Err as xf}from"@kumori/kdsl-lsp/util/result.js";async function nf(q={}){let $=Tq(q.logger);try{let K=await df();return $.info(K.fsPath),await Lf(K.fsPath,{force:!0,recursive:!0}),gf(void 0)}catch(K){return xf([String(K)])}}import{URI as nA}from"langium";import{Result as gP,Err as O$,Ok as xP}from"@kumori/kdsl-lsp/util/result.js";async function cA(q){let $=Tq(q.logger),{NewModule:K}=await Promise.resolve().then(() => (r5(),a5));try{let P=q.cwd??process.cwd();return await K($,P,q.name,q.version,q.location,q.cacheLocation),xP(void 0)}catch(P){return O$([String(P)])}}async function lA(q){let $=Tq(q.logger),K=nA.file(q.cwd??process.cwd()),{Dependency:P}=await Promise.resolve().then(() => (Q5(),s5)),{RegistryManager:_}=await import("@kumori/kdsl-lsp/module/registry/manager.js");await new _(q.configPath).ensureIndexes();try{return await P($,K,q.module,{alias:q.alias,headers:q.headers,remove:q.remove?!0:void 0,download:q.download?!0:void 0},q.configPath),xP(void 0)}catch(Y){return O$([String(Y)])}}async function oA(q){let $=Tq(q.logger),{Download:K}=await Promise.resolve().then(() => (yP(),C5)),{RegistryManager:P}=await import("@kumori/kdsl-lsp/module/registry/manager.js");return await new P(q.configPath).ensureIndexes(),await K($,q.services,q.cwd??process.cwd(),q.modules??[],{quiet:q.quiet?!0:void 0},q.configPath)}async function aA(q){let $=Tq(q.logger),{NewModule:K}=await Promise.resolve().then(() => (Y1(),j1));try{return await K($,q.cwd??process.cwd(),{version:q.version,cacheLocation:q.cacheLocation,path:q.path}),xP(void 0)}catch(P){return O$([String(P)])}}async function rA(q){let{CalculateChecksum:$}=await import("@kumori/kdsl-lsp/module/integrity/checksum.js"),{ModuleContext:K}=await import("@kumori/kdsl-lsp/module/context.js"),{URI:P}=await import("langium"),_=await import("node:path"),j=q.services.shared.workspace.FileSystemProvider,Y=q.directory??q.cwd??".",w=await K(j,P.file(_.resolve(Y)),q.configPath);if(gP.isErr(w))return O$([w.err]);try{let O=await $(w.value.Current.Root.fsPath);return xP(O)}catch(O){return O$([String(O)])}}async function iA(q){let $=Tq(q.logger),{LocateModule:K,GetSchema:P}=await Promise.resolve().then(() => (a7(),A1)),{ModuleContext:_}=await import("@kumori/kdsl-lsp/module/context.js"),{Check:j}=await Promise.resolve().then(() => (Y$(),E5)),{URI:Y}=await import("langium"),w=q.services,O=w.shared.workspace.FileSystemProvider,v=await K(q.target,q.configPath);if(gP.isErr(v))return v;let z=await _(O,Y.file(v.value.fsPath),q.configPath);if(gP.isErr(z))return O$([z.err]);let W=await j($,w,z.value);if(gP.isErr(W))return W;return await P(w,z.value,q.packagePath,q.artifactName)}import{RegistryManager as r7}from"@kumori/kdsl-lsp/module/registry/manager.js";import{Ok as i7,Err as t7}from"@kumori/kdsl-lsp/util/result.js";async function tA(q){let $=Tq(q.logger),K=new r7(q.configPath),P={selector:q.selector,repoUrl:q.url,token:q.token};try{return await K.add(P),$.info(`Registry '${q.selector}' added at ${q.url}`),i7(void 0)}catch(_){return t7([`Failed to add registry: ${_}`])}}async function BA(q){let $=Tq(q.logger),K=new r7(q.configPath);try{let P=K.list();return $.info("Configured Registries:"),i7(P)}catch(P){return t7([`Failed to list registries: ${P}`])}}async function eA(q){let $=Tq(q.logger),K=new r7(q.configPath);try{return K.remove(q.name),$.info(`Registry '${q.name}' removed`),i7(void 0)}catch(P){return t7([`Failed to remove registry: ${P}`])}}import{Ok as gI,Err as RJ}from"@kumori/kdsl-lsp/util/result.js";async function xI(q){let $=Tq(q.logger);if(!q.interactive)return RJ(["Index create command requires interactive mode. Set interactive: true to use this command programmatically with prompts, or use the CLI directly: kdsl index create"]);try{let{Action:K}=await Promise.resolve().then(() => (uJ(),bJ));return await K($)({module:q.module??void 0,index:q.indexFile??void 0}),gI(void 0)}catch(K){return RJ([String(K)])}}import{Err as m9,Ok as hL}from"@kumori/kdsl-lsp/util/result.js";var mJ=(q)=>q.charAt(0).toUpperCase()+q.slice(1);var dk=P$(yk(),1);import*as I9 from"node:path";var ca=`
|
|
243
|
+
After running the command kdsl build, which generates a deployment-config.json file containing
|
|
244
|
+
the JSON representation of a particular deployment, this command can be used to generate the corresponding
|
|
245
|
+
deployment artifact in Kumori DSL syntax.
|
|
246
|
+
|
|
247
|
+
Sometimes it is really useful to apply patches directly to the JSON representation of a deployment,
|
|
248
|
+
and then regenerate the Kumori DSL source code for that deployment. This command facilitates that process.
|
|
249
|
+
|
|
250
|
+
This command attempts to search for a deployment-config.json file in the current working directory,
|
|
251
|
+
and generates a deployment artifact file named generated-deployment.kumori in the same directory.
|
|
252
|
+
|
|
253
|
+
Additionally, you can specify a different path to where the deployment-config.json file is located as well
|
|
254
|
+
as a different output path for the generated Kumori DSL file.
|
|
255
|
+
|
|
256
|
+
Examples:
|
|
257
|
+
kdsl deployment gen
|
|
258
|
+
kdsl deployment gen path/to/deployment-config.json
|
|
259
|
+
kdsl deployment gen path/to/deployment-config.json path/to/output/generated-deployment.kumori
|
|
260
|
+
`.trim();async function Lk(q,$,K){let P="";try{let V=I9.resolve($);P=await Bun.file(V).text()}catch(V){return q.error(`Input file not found: ${$} error: ${V}`),m9([`Input file not found: ${$} error: ${V}`])}let _;try{_=JSON.parse(P)}catch(V){return q.error(`Failed to parse JSON from input file: ${$} error: ${V}`),m9([`Failed to parse JSON from input file: ${$} error: ${V}`])}let j=_.name,Y=_.config.resilience,w=void 0,O=!1,v=_.artifact.ref.package.lastIndexOf("/");if(_.artifact.ref.package!=="")w=_.artifact.ref.domain+"/"+_.artifact.ref.module+"/"+_.artifact.ref.package;else if(_.artifact.ref.domain==="kumori"&&_.artifact.ref.module==="builtin")O=!0,w="kumori/builtin";let z=w?[w]:[],W=_.artifact.ref.package!==""?_.artifact.ref.package.substring(v+1)+"."+_.artifact.ref.name:_.artifact.ref.name;if(O)W="builtin."+_.artifact.ref.name;let T=[];if(Object.entries(_.config.resource).forEach(([V,C])=>{let b=Object.entries(Object(C))[0][1],k=mJ(Object.entries(Object(C))[0][0]);if(k==="Ca")k="CA";let M;if(k==="Volume")if(typeof b==="string")M=`${V} kumori.Registered("${b}")`;else{let A=b;switch(A.type){case"volatile":M=`${V} kumori.Volatile(${A.size}${A.unit})`;break;case"persistent":M=`${V} kumori.Persisted(${A.size}${A.unit})`;break;case"nonreplicated":M=`${V} kumori.NonReplicated(${A.size}${A.unit})`;break;default:M=""}}else M=`${V} kumori.${k}("${b}")`;T.push(M)}),Object.keys(_.config.resource).length>0){if(!z.includes("kumori"))z.push("kumori")}let H=[];Object.entries(_.config.parameter).forEach(([V,C])=>{let b=typeof C==="string"?JSON.stringify(C):C;H.push(`${V} ${b}`)});let J=[],Z=-1;if(_.artifact.ref.kind==="component")Z=Object(_.config.scale).hsize;else if(O)Z=1;else Object.entries(_.config.scale.detail).filter(([V])=>V!=="Inbound").forEach(([V,C])=>{J.push(`${V} ${Object(C).hsize}`)});let X=new URL(import.meta.resolve("@kumori/kdsl/deployment-template.kumori")),G=await Bun.file(X.pathname).text(),N=dk.default.compile(G,{noEscape:!0})({name:j,artifact:W,resilience:Y,imports:z,config:H,scale:J,scaleValue:Z,hasScaleValue:Z>=0,resources:T});try{let V=I9.resolve(K);await Bun.write(V,N),q.info(`Generated deployment artifact at: ${K}`)}catch(V){return q.error(`Failed to write output file: ${K} error: ${V}`),m9([`Failed to write output file: ${K} error: ${V}`])}return hL(void 0)}async function VL(q){let $=Tq(q.logger),K=q.input??"deployment-config.json",P=q.output??q.cwd??".";return await Lk($,K,P)}import{createKumoriServices as sa}from"@kumori/kdsl-lsp/language/kumori.js";export{eA as registryRemove,BA as registryList,tA as registryAdd,aA as moduleUpdate,iA as moduleSchemaGet,cA as moduleInit,oA as moduleDownload,lA as moduleDependency,rA as moduleChecksum,xI as indexCreate,Tq as getLogger,VL as generateDeployment,l9 as createSilentLogger,sa as createKumoriServices,nf as clean,yf as check,Rf as build};
|